diff --git a/Cargo.lock b/Cargo.lock index 7191354c86..296ebb42d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9698bf0769c641b18618039fe2ebd41eb3541f98433000f64e663fab7cea2c87" +checksum = "59317f77929f0e679d39364702289274de2f0f0b22cbf50b2b8cff2169a0b27a" dependencies = [ "gimli 0.33.0", ] @@ -32,7 +32,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ - "crypto-common", + "crypto-common 0.1.6", "generic-array 0.14.9", ] @@ -173,9 +173,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.102" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "applying" @@ -191,9 +191,9 @@ checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" [[package]] name = "arc-swap" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a3a1fd6f75306b68087b831f025c712524bcb19aad54e557b1129cfa0a2b207" +checksum = "c049c0be4daef0b145cb3555416b3b8ef5b7888a38aea1a3a155801fe7b0810b" dependencies = [ "rustversion", ] @@ -206,9 +206,9 @@ checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" [[package]] name = "assert2" @@ -230,20 +230,20 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "astral-tokio-tar" -version = "0.6.0" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c23f3af104b40a3430ccb90ed5f7bd877a8dc5c26fc92fde51a22b40890dcf9" +checksum = "b18457efd137254e016bbde5e1d88df61c4e1a5ae2223746e56123bac6af2463" dependencies = [ - "filetime", "futures-core", "libc", "portable-atomic", "rustc-hash", + "rustix 1.1.4", "tokio", "tokio-stream", "xattr", @@ -255,7 +255,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" dependencies = [ - "event-listener 5.4.1", + "event-listener 5.4.2", "event-listener-strategy", "futures-core", "pin-project-lite", @@ -275,9 +275,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.41" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f9ee0f6e02ffd7ad5816e9464499fba7b3effd01123b515c41d1697c43dad1" +checksum = "3976abdc8fe7d1133d43d304afd42abdf5bc3e1319d263d223bde07b5efc4be8" dependencies = [ "compression-codecs", "compression-core", @@ -303,7 +303,7 @@ version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" dependencies = [ - "event-listener 5.4.1", + "event-listener 5.4.2", "event-listener-strategy", "pin-project-lite", ] @@ -325,7 +325,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -368,7 +368,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -385,7 +385,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -441,15 +441,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "aws-config" -version = "1.8.15" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11493b0bad143270fb8ad284a096dd529ba91924c5409adeac856cc1bf047dbc" +checksum = "1b180a3c8b55960db3426d8964b8745e652466a1a49fe1a2eda828046d30b5e4" dependencies = [ "aws-credential-types", "aws-runtime", @@ -457,17 +457,18 @@ dependencies = [ "aws-sdk-ssooidc", "aws-sdk-sts", "aws-smithy-async", - "aws-smithy-http 0.63.6", - "aws-smithy-json 0.62.5", + "aws-smithy-http", + "aws-smithy-json", "aws-smithy-runtime", "aws-smithy-runtime-api", + "aws-smithy-schema", "aws-smithy-types", "aws-types", "bytes", "fastrand", "hex", - "http 1.4.0", - "sha1", + "http 1.5.0", + "sha1 0.10.7", "time", "tokio", "tracing", @@ -477,9 +478,9 @@ dependencies = [ [[package]] name = "aws-credential-types" -version = "1.2.14" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f20799b373a1be121fe3005fba0c2090af9411573878f224df44b42727fcaf7" +checksum = "e93964ffdaf57857f544be3666a5f57570bb699e934700f11b49708f61bb556e" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -489,9 +490,9 @@ dependencies = [ [[package]] name = "aws-lc-rs" -version = "1.16.2" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a054912289d18629dc78375ba2c3726a3afe3ff71b4edba9dedfca0e3446d1fc" +checksum = "00bdb5da18dac48ca2cc7cd4a98e533e8635a58e2361d13a1a4ee3888e0d72f1" dependencies = [ "aws-lc-sys", "zeroize", @@ -499,27 +500,28 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.39.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa7e52a4c5c547c741610a2c6f123f3881e409b714cd27e6798ef020c514f0a" +checksum = "43103168cc76fe62678a375e722fc9cb3a0146159ac5828bc4f0dfd755c2224c" dependencies = [ "cc", "cmake", "dunce", "fs_extra", + "pkg-config", ] [[package]] name = "aws-runtime" -version = "1.7.2" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc0651c57e384202e47153c1260b84a9936e19803d747615edf199dc3b98d17" +checksum = "c9007227e10b5fed2f3e0a2beff489211e2b5604c400b7a9d5d81ca9d64c24bb" dependencies = [ "aws-credential-types", "aws-sigv4", "aws-smithy-async", "aws-smithy-eventstream", - "aws-smithy-http 0.63.6", + "aws-smithy-http", "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types", @@ -528,9 +530,9 @@ dependencies = [ "bytes-utils", "fastrand", "http 0.2.12", - "http 1.4.0", + "http 1.5.0", "http-body 0.4.6", - "http-body 1.0.1", + "http-body 1.1.0", "percent-encoding", "pin-project-lite", "tracing", @@ -539,133 +541,141 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.119.0" +version = "1.140.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d65fddc3844f902dfe1864acb8494db5f9342015ee3ab7890270d36fbd2e01c" +checksum = "e9660cf991e512fbe6094f1041ff3d3282bc5aeeeb6184e8de437ec2de024a10" dependencies = [ + "arc-swap", "aws-credential-types", "aws-runtime", "aws-sigv4", "aws-smithy-async", "aws-smithy-checksums", "aws-smithy-eventstream", - "aws-smithy-http 0.62.6", - "aws-smithy-json 0.61.9", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-observability", "aws-smithy-runtime", "aws-smithy-runtime-api", + "aws-smithy-schema", "aws-smithy-types", "aws-smithy-xml", "aws-types", "bytes", "fastrand", "hex", - "hmac", + "hmac 0.13.0", "http 0.2.12", - "http 1.4.0", - "http-body 0.4.6", + "http 1.5.0", + "http-body 1.1.0", "lru", "percent-encoding", "regex-lite", - "sha2", + "sha2 0.11.0", "tracing", "url", ] [[package]] name = "aws-sdk-sso" -version = "1.97.0" +version = "1.105.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aadc669e184501caaa6beafb28c6267fc1baef0810fb58f9b205485ca3f2567" +checksum = "6ffd0fbe7873cb548a7aa60f9573c268fff94155397fd4f14dc9f1ecaaab8516" dependencies = [ + "arc-swap", "aws-credential-types", "aws-runtime", "aws-smithy-async", - "aws-smithy-http 0.63.6", - "aws-smithy-json 0.62.5", + "aws-smithy-http", + "aws-smithy-json", "aws-smithy-observability", "aws-smithy-runtime", "aws-smithy-runtime-api", + "aws-smithy-schema", "aws-smithy-types", "aws-types", "bytes", "fastrand", "http 0.2.12", - "http 1.4.0", + "http 1.5.0", "regex-lite", "tracing", ] [[package]] name = "aws-sdk-ssooidc" -version = "1.99.0" +version = "1.107.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1342a7db8f358d3de0aed2007a0b54e875458e39848d54cc1d46700b2bfcb0a8" +checksum = "175763eb222a46377df7aa257a3bca980ab3e96703fefc8f4d0b8da6ad2e254c" dependencies = [ + "arc-swap", "aws-credential-types", "aws-runtime", "aws-smithy-async", - "aws-smithy-http 0.63.6", - "aws-smithy-json 0.62.5", + "aws-smithy-http", + "aws-smithy-json", "aws-smithy-observability", "aws-smithy-runtime", "aws-smithy-runtime-api", + "aws-smithy-schema", "aws-smithy-types", "aws-types", "bytes", "fastrand", "http 0.2.12", - "http 1.4.0", + "http 1.5.0", "regex-lite", "tracing", ] [[package]] name = "aws-sdk-sts" -version = "1.101.0" +version = "1.110.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab41ad64e4051ecabeea802d6a17845a91e83287e1dd249e6963ea1ba78c428a" +checksum = "dd8b14781dfbff48984017d57167b6ea0b6471c6920ec52b44a2677c7feb3c13" dependencies = [ + "arc-swap", "aws-credential-types", "aws-runtime", "aws-smithy-async", - "aws-smithy-http 0.63.6", - "aws-smithy-json 0.62.5", + "aws-smithy-http", + "aws-smithy-json", "aws-smithy-observability", "aws-smithy-query", "aws-smithy-runtime", "aws-smithy-runtime-api", + "aws-smithy-schema", "aws-smithy-types", "aws-smithy-xml", "aws-types", "fastrand", "http 0.2.12", - "http 1.4.0", + "http 1.5.0", "regex-lite", "tracing", ] [[package]] name = "aws-sigv4" -version = "1.4.2" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b660013a6683ab23797778e21f1f854744fdf05f68204b4cca4c8c04b5d1f4" +checksum = "723c2234ad7511ceef63eab016b7ba6ff7c55590fefb96fa8467af014a07309f" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", - "aws-smithy-http 0.63.6", + "aws-smithy-http", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", - "crypto-bigint 0.5.5", + "crypto-bigint", "form_urlencoded", "hex", - "hmac", + "hmac 0.13.0", "http 0.2.12", - "http 1.4.0", - "p256 0.11.1", + "http 1.5.0", + "p256", "percent-encoding", - "ring", - "sha2", + "sha2 0.11.0", "subtle", "time", "tracing", @@ -674,9 +684,9 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.2.14" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffcaf626bdda484571968400c326a244598634dc75fd451325a54ad1a59acfc" +checksum = "f02e407fb3b54891734224b9ffac8a71fdd35f542500fa1af95754a6b2beb316" dependencies = [ "futures-util", "pin-project-lite", @@ -685,29 +695,30 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.63.12" +version = "0.65.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87294a084b43d649d967efe58aa1f9e0adc260e13a6938eb904c0ae9b45824ae" +checksum = "b67ecd999972b58e67cab052f5129906c08c25883bd0788ceefc55ef97d61307" dependencies = [ - "aws-smithy-http 0.62.6", + "aws-smithy-http", "aws-smithy-types", "bytes", "crc-fast", "hex", - "http 0.2.12", - "http-body 0.4.6", - "md-5", + "http 1.5.0", + "http-body 1.1.0", + "http-body-util", + "md-5 0.11.0", "pin-project-lite", - "sha1", - "sha2", + "sha1 0.11.0", + "sha2 0.11.0", "tracing", ] [[package]] name = "aws-smithy-eventstream" -version = "0.60.20" +version = "0.61.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf09d74e5e32f76b8762da505a3cd59303e367a664ca67295387baa8c1d7548" +checksum = "5a9381123ab62d20c13082b151f30f962a3b112b727345394536dfa39a482944" dependencies = [ "aws-smithy-types", "bytes", @@ -716,9 +727,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.62.6" +version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826141069295752372f8203c17f28e30c464d22899a43a0c9fd9c458d469c88b" +checksum = "37843d9add67c3aff5856f409c6dc315d3cdff60f9c0cb5b670dab1e9920306d" dependencies = [ "aws-smithy-eventstream", "aws-smithy-runtime-api", @@ -727,29 +738,8 @@ dependencies = [ "bytes-utils", "futures-core", "futures-util", - "http 0.2.12", - "http 1.4.0", - "http-body 0.4.6", - "percent-encoding", - "pin-project-lite", - "pin-utils", - "tracing", -] - -[[package]] -name = "aws-smithy-http" -version = "0.63.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ab2dc1c2c3749ead27180d333c42f11be8b0e934058fb4b2258ee8dbe5231" -dependencies = [ - "aws-smithy-runtime-api", - "aws-smithy-types", - "bytes", - "bytes-utils", - "futures-core", - "futures-util", - "http 1.4.0", - "http-body 1.0.1", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", "percent-encoding", "pin-project-lite", @@ -759,27 +749,27 @@ dependencies = [ [[package]] name = "aws-smithy-http-client" -version = "1.1.12" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a2f165a7feee6f263028b899d0a181987f4fa7179a6411a32a439fba7c5f769" +checksum = "635d23afda0a6ab48d666c4d447c4873e8d1e83518a2be2093122397e50b838e" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", "h2 0.3.27", - "h2 0.4.13", + "h2 0.4.15", "http 0.2.12", - "http 1.4.0", + "http 1.5.0", "http-body 0.4.6", "hyper 0.14.32", - "hyper 1.9.0", + "hyper 1.11.0", "hyper-rustls 0.24.2", - "hyper-rustls 0.27.7", + "hyper-rustls 0.27.9", "hyper-util", "pin-project-lite", "rustls 0.21.12", "rustls 0.23.37", - "rustls-native-certs 0.8.3", + "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-rustls 0.26.4", @@ -789,59 +779,56 @@ dependencies = [ [[package]] name = "aws-smithy-json" -version = "0.61.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49fa1213db31ac95288d981476f78d05d9cbb0353d22cdf3472cc05bb02f6551" -dependencies = [ - "aws-smithy-types", -] - -[[package]] -name = "aws-smithy-json" -version = "0.62.5" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9648b0bb82a2eedd844052c6ad2a1a822d1f8e3adee5fbf668366717e428856a" +checksum = "3dc65a121adb4b33729919fcfa14fa36fb33c1555a8f06bb0e2188dbfdc1d9ef" dependencies = [ + "aws-smithy-runtime-api", + "aws-smithy-schema", "aws-smithy-types", ] [[package]] name = "aws-smithy-observability" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06c2315d173edbf1920da8ba3a7189695827002e4c0fc961973ab1c54abca9c" +checksum = "8e86338c869539a581bf161247762a6e87f92c5c075060057b5ed6d06632ed0c" dependencies = [ "aws-smithy-runtime-api", ] [[package]] name = "aws-smithy-query" -version = "0.60.15" +version = "0.62.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a56d79744fb3edb5d722ef79d86081e121d3b9422cb209eb03aea6aa4f21ebd" +checksum = "512346c7212ab7436df2d77a16d976a468ae44a418835511d2a69269810aaf62" dependencies = [ + "aws-smithy-runtime-api", + "aws-smithy-schema", "aws-smithy-types", + "aws-smithy-xml", "urlencoding", ] [[package]] name = "aws-smithy-runtime" -version = "1.10.3" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028999056d2d2fd58a697232f9eec4a643cf73a71cf327690a7edad1d2af2110" +checksum = "07505b34e8f4b3591a4fa69e9792b52289b95488dbbc68c3c0075b7bedb245e1" dependencies = [ "aws-smithy-async", - "aws-smithy-http 0.63.6", + "aws-smithy-http", "aws-smithy-http-client", "aws-smithy-observability", "aws-smithy-runtime-api", + "aws-smithy-schema", "aws-smithy-types", "bytes", "fastrand", "http 0.2.12", - "http 1.4.0", + "http 1.5.0", "http-body 0.4.6", - "http-body 1.0.1", + "http-body 1.1.0", "http-body-util", "pin-project-lite", "pin-utils", @@ -851,35 +838,58 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.11.6" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876ab3c9c29791ba4ba02b780a3049e21ec63dabda09268b175272c3733a79e6" +checksum = "3b98f2e1fd67ec06618f9c291e5e495a468e60519e44c9c1979cd0521f3affdb" dependencies = [ "aws-smithy-async", + "aws-smithy-runtime-api-macros", "aws-smithy-types", "bytes", "http 0.2.12", - "http 1.4.0", + "http 1.5.0", "pin-project-lite", "tokio", "tracing", "zeroize", ] +[[package]] +name = "aws-smithy-runtime-api-macros" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "221eaa237ddf1ca79b60d1372aad77e47f9c0ea5b3ce5099da8c61d027dc77b3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "aws-smithy-schema" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d56e0a4e53127a632224e43633b0fe045fa9e1e3cfc68b9830f1115e103f910" +dependencies = [ + "aws-smithy-runtime-api", + "aws-smithy-types", + "http 1.5.0", +] + [[package]] name = "aws-smithy-types" -version = "1.4.7" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d73dbfbaa8e4bc57b9045137680b958d274823509a360abfd8e1d514d40c95c" +checksum = "d6dc683efb34b9e755675b37fedbe0103141e5b6df7bdc9eb6967756a8c167d8" dependencies = [ "base64-simd", "bytes", "bytes-utils", "futures-core", "http 0.2.12", - "http 1.4.0", + "http 1.5.0", "http-body 0.4.6", - "http-body 1.0.1", + "http-body 1.1.0", "http-body-util", "itoa", "num-integer", @@ -894,22 +904,26 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.60.15" +version = "0.62.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce02add1aa3677d022f8adf81dcbe3046a95f17a1b1e8979c145cd21d3d22b3" +checksum = "ce84f71c72fee2cbbadde6e7d082f5fb466e3a84733855295fa7aafd1b31b7d8" dependencies = [ + "aws-smithy-runtime-api", + "aws-smithy-schema", + "aws-smithy-types", "xmlparser", ] [[package]] name = "aws-types" -version = "1.3.14" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c8323699dd9b3c8d5b3c13051ae9cdef58fd179957c882f8374dd8725962d9" +checksum = "eec1cd5469f328c782dc3e33d4153cf118a54e33cbb3356d60d16f89883e1f94" dependencies = [ "aws-credential-types", "aws-smithy-async", "aws-smithy-runtime-api", + "aws-smithy-schema", "aws-smithy-types", "rustc_version", "tracing", @@ -917,18 +931,18 @@ dependencies = [ [[package]] name = "axum" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" dependencies = [ "axum-core", "bytes", "form_urlencoded", "futures-util", - "http 1.4.0", - "http-body 1.0.1", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", - "hyper 1.9.0", + "hyper 1.11.0", "hyper-util", "itoa", "matchit", @@ -957,8 +971,8 @@ checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" dependencies = [ "bytes", "futures-core", - "http 1.4.0", - "http-body 1.0.1", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", "mime", "pin-project-lite", @@ -990,7 +1004,7 @@ checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" dependencies = [ "getrandom 0.2.17", "instant", - "rand 0.8.5", + "rand 0.8.7", ] [[package]] @@ -1028,12 +1042,6 @@ dependencies = [ "nix 0.23.2", ] -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - [[package]] name = "base16ct" version = "0.2.0" @@ -1129,18 +1137,18 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.11.1" +version = "2.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" dependencies = [ "serde_core", ] [[package]] name = "bitvec" -version = "1.0.1" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +checksum = "ddcec3d12c579d40898fe0a9a358a803c23e9c52ca3c425707f81c9436211837" dependencies = [ "funty", "radium", @@ -1150,16 +1158,16 @@ dependencies = [ [[package]] name = "blake3" -version = "1.8.3" +version = "1.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" +checksum = "0aa83c34e62843d924f905e0f5c866eb1dd6545fc4d719e803d9ba6030371fce" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", - "cpufeatures 0.2.17", + "cpufeatures 0.3.0", "rayon-core", ] @@ -1172,6 +1180,15 @@ dependencies = [ "generic-array 0.14.9", ] +[[package]] +name = "block-buffer" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa" +dependencies = [ + "hybrid-array", +] + [[package]] name = "blocking" version = "1.6.2" @@ -1193,7 +1210,7 @@ checksum = "ee04c4c84f1f811b017f2fbb7dd8815c976e7ca98593de9c1e2afad0f636bff4" dependencies = [ "async-stream", "base64 0.22.1", - "bitflags 2.11.1", + "bitflags 2.13.1", "bollard-buildkit-proto", "bollard-stubs", "bytes", @@ -1201,19 +1218,19 @@ dependencies = [ "futures-util", "hex", "home", - "http 1.4.0", + "http 1.5.0", "http-body-util", - "hyper 1.9.0", + "hyper 1.11.0", "hyper-named-pipe", - "hyper-rustls 0.27.7", + "hyper-rustls 0.27.9", "hyper-util", "hyperlocal", "log", "num", "pin-project-lite", - "rand 0.9.2", + "rand 0.9.5", "rustls 0.23.37", - "rustls-native-certs 0.8.3", + "rustls-native-certs", "rustls-pki-types", "serde", "serde_derive", @@ -1224,7 +1241,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "tonic 0.14.5", + "tonic 0.14.6", "tower-service", "url", "winapi", @@ -1236,9 +1253,9 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85a885520bf6249ab931a764ffdb87b0ceef48e6e7d807cfdb21b751e086e1ad" dependencies = [ - "prost 0.14.3", + "prost 0.14.4", "prost-types", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-prost", "ureq", ] @@ -1252,7 +1269,7 @@ dependencies = [ "base64 0.22.1", "bollard-buildkit-proto", "bytes", - "prost 0.14.3", + "prost 0.14.4", "serde", "serde_json", "serde_repr", @@ -1267,44 +1284,53 @@ checksum = "dc0b364ead1874514c8c2855ab558056ebfeb775653e7ae45ff72f28f8f3166c" [[package]] name = "borsh" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd1e3f8955a5d7de9fab72fc8373fade9fb8a703968cb200ae3dc6cf08e185a" +checksum = "a88b7ea17d208c4193f2c1e6de3c35fe71f98c96982d5ced308bdcc749ff6e1f" dependencies = [ "borsh-derive", "bytes", - "cfg_aliases 0.2.1", + "cfg_aliases 0.2.2", ] [[package]] name = "borsh-derive" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfcfdc083699101d5a7965e49925975f2f55060f94f9a05e7187be95d530ca59" +checksum = "d8f347189c62a579b8cd5f80714efa178f52e461dc2e6d701d264f5ff22e566c" dependencies = [ "once_cell", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", ] [[package]] name = "bstr" -version = "1.12.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" +checksum = "1f7dc094d718f2e1c1559ad110e27eeaae14a5465d3d56dd6dbd793079fbd530" dependencies = [ "memchr", "regex-automata", - "serde", + "serde_core", ] [[package]] name = "bumpalo" -version = "3.20.2" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" dependencies = [ "allocator-api2", ] @@ -1339,9 +1365,9 @@ checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" [[package]] name = "bytemuck" -version = "1.25.0" +version = "1.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" [[package]] name = "byteorder" @@ -1367,9 +1393,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.2.2" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" +checksum = "bb1307f12aa967b5a58416e87b3653360e0fd614a016b6e970db08fecbb1b80d" [[package]] name = "cap-fs-ext" @@ -1456,22 +1482,16 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.57" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "jobserver", "libc", - "shlex", + "shlex 2.0.1", ] -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - [[package]] name = "cfg-if" version = "1.0.4" @@ -1486,32 +1506,32 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "cfg_aliases" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" [[package]] name = "chacha20" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" dependencies = [ "cfg-if", "cpufeatures 0.3.0", - "rand_core 0.10.0", + "rand_core 0.10.1", ] [[package]] name = "char_index" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10ef8669476802b7127a0a97612a0c34113e949ee65c695e4ac259f1f49aaa25" +checksum = "47b4b5c964e3265da460e34f037984985900ce56b7aba4bbf7d38473d7aec3d2" [[package]] name = "chrono" -version = "0.4.44" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ "iana-time-zone", "js-sys", @@ -1564,7 +1584,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "crypto-common", + "crypto-common 0.1.6", "inout", ] @@ -1603,9 +1623,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.6.0" +version = "4.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c9f1dde76b736e3681f28cec9d5a61299cbaae0fce80a68e43724ad56031eb" +checksum = "b1f84a88507dbd05c695f2cb5e8558e747179134005e9893882dec964190ed89" dependencies = [ "clap", ] @@ -1619,7 +1639,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -1630,13 +1650,19 @@ checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "cmake" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" dependencies = [ "cc", ] +[[package]] +name = "cmov" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a" + [[package]] name = "cobs" version = "0.3.0" @@ -1688,9 +1714,9 @@ dependencies = [ [[package]] name = "compression-codecs" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb7b51a7d9c967fc26773061ba86150f19c50c0d65c887cb1fbe295fd16619b7" +checksum = "ce2548391e9c1929c21bf6aa2680af86fe4c1b33e6cea9ac1cfeec0bd11218cf" dependencies = [ "compression-core", "flate2", @@ -1699,9 +1725,9 @@ dependencies = [ [[package]] name = "compression-core" -version = "0.4.31" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75984efb6ed102a0d42db99afb6c1948f0380d1d91808d5529916e6c08b49d8d" +checksum = "cc14f565cf027a105f7a44ccf9e5b424348421a1d8952a8fc9d499d313107789" [[package]] name = "concurrent-queue" @@ -1752,9 +1778,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8599749b6667e2f0c910c1d0dff6901163ff698a52d5a39720f61b5be4b20d3" dependencies = [ "futures-core", - "prost 0.14.3", + "prost 0.14.4", "prost-types", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-prost", "tracing-core", ] @@ -1772,14 +1798,14 @@ dependencies = [ "hdrhistogram", "humantime", "hyper-util", - "prost 0.14.3", + "prost 0.14.4", "prost-types", "serde", "serde_json", "thread_local", "tokio", "tokio-stream", - "tonic 0.14.5", + "tonic 0.14.6", "tracing", "tracing-core", "tracing-subscriber", @@ -1791,13 +1817,20 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + [[package]] name = "const_format" -version = "0.2.35" +version = "0.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" +checksum = "4481a617ad9a412be3b97c5d403fef8ed023103368908b9c50af598ff467cc1e" dependencies = [ "const_format_proc_macros", + "konst", ] [[package]] @@ -1853,10 +1886,10 @@ dependencies = [ "aes-gcm", "base64 0.22.1", "hkdf", - "hmac", + "hmac 0.12.1", "percent-encoding", - "rand 0.8.5", - "sha2", + "rand 0.8.7", + "sha2 0.10.9", "subtle", "time", "version_check", @@ -1980,7 +2013,7 @@ dependencies = [ "rustc-hash", "serde", "serde_derive", - "sha2", + "sha2 0.10.9", "smallvec", "target-lexicon", "wasmtime-internal-core", @@ -2065,21 +2098,18 @@ dependencies = [ [[package]] name = "crc-catalog" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853" [[package]] name = "crc-fast" -version = "1.6.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ddc2d09feefeee8bd78101665bd8645637828fa9317f9f292496dbbd8c65ff3" +checksum = "e75b2483e97a5a7da73ac68a05b629f9c53cff58d8ed1c77866079e18b00dba5" dependencies = [ - "crc", - "digest", - "rand 0.9.2", - "regex", - "rustversion", + "digest 0.10.7", + "spin 0.10.1", ] [[package]] @@ -2135,18 +2165,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.15" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +checksum = "d85363c37faeca707aef026efa9f3b34d077bce547e48f770770625c6013679e" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -2154,27 +2184,27 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.18" +version = "0.9.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-queue" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +checksum = "803d13fb3b09d88be9f4dbc29062c66b19bf7170867ceb746d2a8689bf6c7a26" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" [[package]] name = "crossterm" @@ -2198,11 +2228,11 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "crossterm_winapi", "derive_more", "document-features", - "mio 1.1.1", + "mio 1.2.2", "parking_lot", "rustix 1.1.4", "signal-hook", @@ -2225,18 +2255,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" -[[package]] -name = "crypto-bigint" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" -dependencies = [ - "generic-array 0.14.9", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - [[package]] name = "crypto-bigint" version = "0.5.5" @@ -2260,6 +2278,15 @@ dependencies = [ "typenum", ] +[[package]] +name = "crypto-common" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" +dependencies = [ + "hybrid-array", +] + [[package]] name = "ctor" version = "0.4.3" @@ -2297,6 +2324,15 @@ dependencies = [ "uuid", ] +[[package]] +name = "ctutils" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e" +dependencies = [ + "cmov", +] + [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -2306,7 +2342,7 @@ dependencies = [ "cfg-if", "cpufeatures 0.2.17", "curve25519-dalek-derive", - "digest", + "digest 0.10.7", "fiat-crypto", "rustc_version", "subtle", @@ -2321,7 +2357,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2365,7 +2401,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2379,7 +2415,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2392,7 +2428,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2403,7 +2439,7 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core 0.20.11", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2414,7 +2450,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core 0.21.3", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2425,7 +2461,7 @@ checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" dependencies = [ "darling_core 0.23.0", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2444,9 +2480,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" +checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" [[package]] name = "deadpool" @@ -2477,23 +2513,13 @@ dependencies = [ "uuid", ] -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "zeroize", -] - [[package]] name = "der" version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ - "const-oid", + "const-oid 0.9.6", "pem-rfc7468", "zeroize", ] @@ -2504,7 +2530,6 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" dependencies = [ - "powerfmt", "serde_core", ] @@ -2527,7 +2552,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.117", + "syn 2.0.119", "unicode-xid", ] @@ -2565,7 +2590,7 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2590,12 +2615,24 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", + "block-buffer 0.10.4", + "const-oid 0.9.6", + "crypto-common 0.1.6", "subtle", ] +[[package]] +name = "digest" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" +dependencies = [ + "block-buffer 0.12.1", + "const-oid 0.10.2", + "crypto-common 0.2.2", + "ctutils", +] + [[package]] name = "directories-next" version = "2.0.0" @@ -2640,22 +2677,22 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.3", ] [[package]] name = "docker_credential" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d89dfcba45b4afad7450a99b39e751590463e45c04728cf555d36bb66940de8" +checksum = "29547a1dc60885a552306986316bc9701ba120c1a8db6769fa68691529ad373d" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "serde", "serde_json", ] @@ -2724,30 +2761,18 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature 1.6.4", -] - [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der 0.7.10", - "digest", - "elliptic-curve 0.13.8", - "rfc6979 0.4.0", - "signature 2.2.0", - "spki 0.7.3", + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature", + "spki", ] [[package]] @@ -2756,8 +2781,8 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "pkcs8 0.10.2", - "signature 2.2.0", + "pkcs8", + "signature", ] [[package]] @@ -2769,7 +2794,7 @@ dependencies = [ "curve25519-dalek", "ed25519", "serde", - "sha2", + "sha2 0.10.9", "subtle", "zeroize", ] @@ -2783,55 +2808,35 @@ dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "either" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" dependencies = [ "serde", ] -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "base16ct 0.1.1", - "crypto-bigint 0.4.9", - "der 0.6.1", - "digest", - "ff 0.12.1", - "generic-array 0.14.9", - "group 0.12.1", - "pkcs8 0.9.0", - "rand_core 0.6.4", - "sec1 0.3.0", - "subtle", - "zeroize", -] - [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.5", - "digest", - "ff 0.13.1", + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", "generic-array 0.14.9", - "group 0.13.0", + "group", "hkdf", "pem-rfc7468", - "pkcs8 0.10.2", + "pkcs8", "rand_core 0.6.4", - "sec1 0.7.3", + "sec1", "subtle", "zeroize", ] @@ -2874,22 +2879,22 @@ dependencies = [ [[package]] name = "enum-ordinalize" -version = "4.3.2" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1091a7bb1f8f2c4b28f1fe2cef4980ca2d410a3d727d67ecc3178c9b0800f0" +checksum = "89dd01549b09589510cf0647475075d12071456586d70f5c75c98ae2a5537677" dependencies = [ "enum-ordinalize-derive", ] [[package]] name = "enum-ordinalize-derive" -version = "4.3.2" +version = "4.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631" +checksum = "42e528e2d34ba8a67a1a650b86beae8ef69fc5fdb638016f386b973226590432" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2956,11 +2961,10 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "5.4.1" +version = "5.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2" dependencies = [ - "concurrent-queue", "parking", "pin-project-lite", ] @@ -2971,7 +2975,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ - "event-listener 5.4.1", + "event-listener 5.4.2", "pin-project-lite", ] @@ -3009,9 +3013,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" [[package]] name = "fd-lock" @@ -3026,25 +3030,15 @@ dependencies = [ [[package]] name = "ferroid" -version = "0.8.9" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb330bbd4cb7a5b9f559427f06f98a4f853a137c8298f3bd3f8ca57663e21986" +checksum = "ee93edf3c501f0035bbeffeccfed0b79e14c311f12195ec0e661e114a0f60da4" dependencies = [ "portable-atomic", - "rand 0.9.2", + "rand 0.10.2", "web-time", ] -[[package]] -name = "ff" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" -dependencies = [ - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "ff" version = "0.13.1" @@ -3086,17 +3080,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "filetime" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" -dependencies = [ - "cfg-if", - "libc", - "libredox", -] - [[package]] name = "find-msvc-tools" version = "0.1.9" @@ -3153,7 +3136,7 @@ checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" dependencies = [ "futures-core", "futures-sink", - "spin", + "spin 0.9.9", ] [[package]] @@ -3206,9 +3189,9 @@ dependencies = [ [[package]] name = "fraction" -version = "0.15.3" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f158e3ff0a1b334408dc9fb811cd99b446986f4d8b741bb08f9df1604085ae7" +checksum = "e076045bb43dac435333ed5f04caf35c7463631d0dae2deb2638d94dd0a5b872" dependencies = [ "lazy_static", "num", @@ -3229,10 +3212,10 @@ dependencies = [ "futures", "log", "parking_lot", - "rand 0.8.5", + "rand 0.8.7", "redis-protocol", "rustls 0.23.37", - "rustls-native-certs 0.8.3", + "rustls-native-certs", "semver", "serde_json", "socket2 0.5.10", @@ -3254,7 +3237,7 @@ checksum = "1458c6e22d36d61507034d5afecc64f105c1d39712b7ac6ec3b352c423f715cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -3297,9 +3280,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae" dependencies = [ "futures-core", "futures-sink", @@ -3320,15 +3303,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" +checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7" [[package]] name = "futures-executor" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +checksum = "6754879cc9f2c66f88c6e5c35344bb0bdb0708b0352b1201815667c7eabc7458" dependencies = [ "futures-core", "futures-task", @@ -3348,9 +3331,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" +checksum = "4577ecaa3c4f96589d473f679a71b596316f6641bc350038b962a5daf0085d7a" [[package]] name = "futures-lite" @@ -3367,38 +3350,38 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +checksum = "2d6d3cde68c518367be28956066ddfef33813991b77a55005a69dae04bf3b10b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "futures-sink" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" +checksum = "e34418ac499d6305c2fb5ad0ed2f6ac998c5f8ca209b4510f7f94242c647e307" [[package]] name = "futures-task" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" +checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109" [[package]] name = "futures-timer" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +checksum = "af43fadb8a98512d547e37b4e92e0ced13e205c061b87b4623eff01d918d6968" [[package]] name = "futures-util" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa" dependencies = [ "futures-channel", "futures-core", @@ -3448,7 +3431,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25234f20a3ec0a962a61770cfe39ecf03cb529a6e474ad8cff025ed497eda557" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "debugid", "rustc-hash", "serde", @@ -3475,9 +3458,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "1.3.5" +version = "1.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf57c49a95fd1fe24b90b3033bee6dc7e8f1288d51494cb44e627c295e38542" +checksum = "ab4e5aa225bc56696909483320f0ff9b600f1a971b52e07a17d70f3d9b43254b" dependencies = [ "rustversion", "typenum", @@ -3512,16 +3495,16 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", + "js-sys", "libc", "r-efi 6.0.0", - "rand_core 0.10.0", - "wasip2", - "wasip3", + "rand_core 0.10.1", + "wasm-bindgen", ] [[package]] @@ -3558,7 +3541,7 @@ version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b88256088d75a56f8ecfa070513a775dd9107f6530ef14919dac831af9cfe2b" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "libc", "libgit2-sys", "log", @@ -3567,9 +3550,9 @@ dependencies = [ [[package]] name = "glob" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" [[package]] name = "glob-match" @@ -3628,11 +3611,11 @@ version = "0.0.0" dependencies = [ "desert_rust", "miette", - "prost 0.14.3", + "prost 0.14.4", "prost-types", "protox", "test-r", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-prost", "tonic-prost-build", "uuid", @@ -3670,7 +3653,7 @@ dependencies = [ "golem-client", "golem-common", "heck", - "http 1.4.0", + "http 1.5.0", "humansize", "include_dir", "indexmap 2.14.0", @@ -3694,7 +3677,7 @@ dependencies = [ "proptest", "quote", "regex", - "reqwest 0.13.2", + "reqwest 0.13.4", "reqwest-middleware", "reqwest-retry", "semver", @@ -3703,11 +3686,11 @@ dependencies = [ "serde_json", "serde_yaml", "shadow-rs", - "shlex", + "shlex 1.3.0", "strip-ansi-escapes", "strum", "strum_macros", - "syn 2.0.117", + "syn 2.0.119", "synoptic", "tempfile", "terminal_size", @@ -3752,8 +3735,8 @@ dependencies = [ "chrono", "golem-common", "golem-openapi-client-generator", - "http 1.4.0", - "reqwest 0.13.2", + "http 1.5.0", + "reqwest 0.13.4", "reqwest-middleware", "serde", "serde_json", @@ -3793,7 +3776,7 @@ dependencies = [ "golem-schema", "golem-schema-derive", "heck", - "http 1.4.0", + "http 1.5.0", "humantime", "humantime-serde", "ident-mash", @@ -3816,7 +3799,7 @@ dependencies = [ "proptest", "prost-types", "quote", - "rand 0.9.2", + "rand 0.9.5", "range-set-blaze", "regex", "scc", @@ -3829,12 +3812,12 @@ dependencies = [ "sqlx", "strum", "strum_macros", - "syn 2.0.117", + "syn 2.0.119", "test-r", "thiserror 2.0.18", "tokio", "toml 0.9.12+spec-1.1.0", - "tonic 0.14.5", + "tonic 0.14.6", "tracing", "tracing-opentelemetry", "tracing-serde", @@ -3864,7 +3847,7 @@ dependencies = [ "golem-api-grpc", "golem-common", "golem-service-base", - "http 1.4.0", + "http 1.5.0", "humantime-serde", "lazy_static", "prometheus", @@ -3874,7 +3857,7 @@ dependencies = [ "thiserror 2.0.18", "tokio", "tokio-stream", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-health", "tonic-tracing-opentelemetry", "tracing", @@ -3914,7 +3897,7 @@ dependencies = [ "tokio-stream", "tokio-tungstenite 0.25.0", "tokio-util", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-tracing-opentelemetry", "tracing", "tracing-subscriber", @@ -3965,9 +3948,9 @@ dependencies = [ "golem-common", "golem-service-base", "heck", - "http 1.4.0", + "http 1.5.0", "humantime-serde", - "hyper 1.9.0", + "hyper 1.11.0", "include_dir", "indoc", "itertools 0.14.0", @@ -3983,10 +3966,10 @@ dependencies = [ "poem-openapi", "poem-openapi-derive", "prometheus", - "prost 0.14.3", + "prost 0.14.4", "rayon", "regex", - "reqwest 0.13.2", + "reqwest 0.13.4", "rustls 0.23.37", "sanitize-filename", "serde", @@ -4005,7 +3988,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-health", "tonic-reflection", "tonic-tracing-opentelemetry", @@ -4068,7 +4051,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.117", + "syn 2.0.119", "test-r", "trybuild", ] @@ -4087,7 +4070,7 @@ dependencies = [ "axum", "base64 0.22.1", "bigdecimal", - "bitflags 2.11.1", + "bitflags 2.13.1", "blake3", "bytes", "chrono", @@ -4099,9 +4082,9 @@ dependencies = [ "golem-common", "headers", "hex", - "hmac", - "http 1.4.0", - "http-body 1.0.1", + "hmac 0.12.1", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", "humantime-serde", "include_dir", @@ -4115,13 +4098,14 @@ dependencies = [ "poem-openapi-derive", "pretty_assertions", "prometheus", + "prost 0.14.4", "prost-types", - "reqwest 0.13.2", + "reqwest 0.13.4", "rustc-hash", "scc", "serde", "serde_json", - "sha2", + "sha2 0.10.9", "sqlx", "strum", "strum_macros", @@ -4133,7 +4117,7 @@ dependencies = [ "tokio-metrics", "tokio-stream", "tokio-util", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-tracing-opentelemetry", "tower 0.5.3", "tracing", @@ -4159,7 +4143,7 @@ dependencies = [ "golem-common", "golem-service-base", "golem-test-framework", - "http 1.4.0", + "http 1.5.0", "humantime-serde", "include_dir", "indoc", @@ -4177,7 +4161,7 @@ dependencies = [ "thiserror 2.0.18", "tokio", "tokio-stream", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-health", "tonic-reflection", "tonic-tracing-opentelemetry", @@ -4213,7 +4197,7 @@ dependencies = [ "opentelemetry_sdk 0.30.0", "prometheus", "redis", - "reqwest 0.13.2", + "reqwest 0.13.4", "reqwest-middleware", "reqwest-tracing", "serde", @@ -4229,7 +4213,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-tungstenite 0.25.0", - "tonic 0.14.5", + "tonic 0.14.6", "tracing", "tracing-core", "tracing-opentelemetry", @@ -4282,12 +4266,12 @@ dependencies = [ "half", "heck", "hex", - "http 1.4.0", - "http-body 1.0.1", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", "humansize", "humantime-serde", - "hyper 1.9.0", + "hyper 1.11.0", "ignite-v2-client", "include_dir", "itertools 0.14.0", @@ -4303,9 +4287,9 @@ dependencies = [ "pretty_assertions", "prometheus", "proptest", - "prost 0.14.3", + "prost 0.14.4", "prost-types", - "rand 0.9.2", + "rand 0.9.5", "redis", "regex", "ringbuf", @@ -4324,7 +4308,7 @@ dependencies = [ "tokio-stream", "tokio-tungstenite 0.25.0", "tokio-util", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-health", "tonic-reflection", "tonic-tracing-opentelemetry", @@ -4368,7 +4352,7 @@ dependencies = [ "test-r", "tokio", "tokio-util", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-tracing-opentelemetry", "tower 0.5.3", "tracing", @@ -4403,10 +4387,10 @@ dependencies = [ "golem-service-base", "golem-test-framework", "headers", - "http 1.4.0", + "http 1.5.0", "http-body-util", "humantime-serde", - "hyper 1.9.0", + "hyper 1.11.0", "include_dir", "indexmap 2.14.0", "mime", @@ -4421,10 +4405,10 @@ dependencies = [ "poem-openapi-derive", "prometheus", "proptest", - "prost 0.14.3", + "prost 0.14.4", "prost-types", "regex", - "reqwest 0.13.2", + "reqwest 0.13.4", "rmcp", "rsa", "rustc-hash", @@ -4443,7 +4427,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-health", "tonic-reflection", "tonic-tracing-opentelemetry", @@ -4474,24 +4458,13 @@ dependencies = [ "web-time", ] -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff 0.12.1", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff 0.13.1", + "ff", "rand_core 0.6.4", "subtle", ] @@ -4517,16 +4490,16 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.13" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +checksum = "6cb093c84e8bd9b188d4c4a8cb6579fc016968d14c99882163cd3ff402a4f155" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "http 1.4.0", + "http 1.5.0", "indexmap 2.14.0", "slab", "tokio", @@ -4607,14 +4580,14 @@ dependencies = [ [[package]] name = "hdrhistogram" -version = "7.5.4" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" +checksum = "f49d1053f4708f0af3cf9fc5bffc7e68a914a3c45becb231c80068c9c3f78bea" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "byteorder", "flate2", - "nom 7.1.3", + "nom 8.0.0", "num-traits", ] @@ -4627,10 +4600,10 @@ dependencies = [ "base64 0.22.1", "bytes", "headers-core", - "http 1.4.0", + "http 1.5.0", "httpdate", "mime", - "sha1", + "sha1 0.10.7", ] [[package]] @@ -4639,7 +4612,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" dependencies = [ - "http 1.4.0", + "http 1.5.0", ] [[package]] @@ -4666,7 +4639,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ - "hmac", + "hmac 0.12.1", ] [[package]] @@ -4675,7 +4648,16 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest", + "digest 0.10.7", +] + +[[package]] +name = "hmac" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" +dependencies = [ + "digest 0.11.3", ] [[package]] @@ -4711,9 +4693,9 @@ dependencies = [ [[package]] name = "http" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -4732,24 +4714,24 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" dependencies = [ "bytes", - "http 1.4.0", + "http 1.5.0", ] [[package]] name = "http-body-util" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +checksum = "e9f41fd6a08e4d4ec69df65976da761afd5ad5e58a9d4acb46bd1c953a9e3ff2" dependencies = [ "bytes", "futures-core", - "http 1.4.0", - "http-body 1.0.1", + "http 1.5.0", + "http-body 1.1.0", "pin-project-lite", ] @@ -4776,9 +4758,9 @@ dependencies = [ [[package]] name = "humantime" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" +checksum = "15cdd26707701c53297e2fa6afb323d55fbc1d0810c3aec078ae3ef0424c3c15" [[package]] name = "humantime-serde" @@ -4790,6 +4772,15 @@ dependencies = [ "serde", ] +[[package]] +name = "hybrid-array" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707114b52a152fa7bdb290cd7cd5912d9467273b6d74e21b8d81aca1f8533f6b" +dependencies = [ + "typenum", +] + [[package]] name = "hyper" version = "0.14.32" @@ -4816,17 +4807,17 @@ dependencies = [ [[package]] name = "hyper" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +checksum = "d22053281f852e11534f5198498373cbb59295120a20771d90f7ed1897490a72" dependencies = [ "atomic-waker", "bytes", "futures-channel", "futures-core", - "h2 0.4.13", - "http 1.4.0", - "http-body 1.0.1", + "h2 0.4.15", + "http 1.5.0", + "http-body 1.1.0", "httparse", "httpdate", "itoa", @@ -4838,19 +4829,18 @@ dependencies = [ [[package]] name = "hyper-http-proxy" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ad4b0a1e37510028bc4ba81d0e38d239c39671b0f0ce9e02dfa93a8133f7c08" +checksum = "8021e0ae20c08eadc94d0bdafdeda66d4f0858541c146ae6e46b219bfe58497e" dependencies = [ "bytes", "futures-util", "headers", - "http 1.4.0", - "hyper 1.9.0", - "hyper-rustls 0.27.7", + "http 1.5.0", + "hyper 1.11.0", + "hyper-rustls 0.27.9", "hyper-util", "pin-project-lite", - "rustls-native-certs 0.7.3", "tokio", "tokio-rustls 0.26.4", "tower-service", @@ -4858,17 +4848,16 @@ dependencies = [ [[package]] name = "hyper-named-pipe" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278" +checksum = "fab3637d6b04a8037af8a266fdf6cf92ea957e8c53981a2bf6136572531025bf" dependencies = [ "hex", - "hyper 1.9.0", + "hyper 1.11.0", "hyper-util", "pin-project-lite", "tokio", "tower-service", - "winapi", ] [[package]] @@ -4888,21 +4877,20 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.7" +version = "0.27.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" dependencies = [ - "http 1.4.0", - "hyper 1.9.0", + "http 1.5.0", + "hyper 1.11.0", "hyper-util", "log", "rustls 0.23.37", - "rustls-native-certs 0.8.3", - "rustls-pki-types", + "rustls-native-certs", "tokio", "tokio-rustls 0.26.4", "tower-service", - "webpki-roots 1.0.6", + "webpki-roots 1.0.9", ] [[package]] @@ -4911,7 +4899,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" dependencies = [ - "hyper 1.9.0", + "hyper 1.11.0", "hyper-util", "pin-project-lite", "tokio", @@ -4928,9 +4916,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.4.0", - "http-body 1.0.1", - "hyper 1.9.0", + "http 1.5.0", + "http-body 1.1.0", + "hyper 1.11.0", "ipnet", "libc", "percent-encoding", @@ -4951,7 +4939,7 @@ checksum = "986c5ce3b994526b3cd75578e62554abd09f0899d6206de48b3e96ab34ccc8c7" dependencies = [ "hex", "http-body-util", - "hyper 1.9.0", + "hyper 1.11.0", "hyper-util", "pin-project-lite", "tokio", @@ -4970,7 +4958,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core", + "windows-core 0.62.2", ] [[package]] @@ -4984,12 +4972,13 @@ dependencies = [ [[package]] name = "icu_collections" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" dependencies = [ "displaydoc", "potential_utf", + "utf8_iter", "yoke", "zerofrom", "zerovec", @@ -4997,9 +4986,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" dependencies = [ "displaydoc", "litemap", @@ -5010,9 +4999,9 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" dependencies = [ "icu_collections", "icu_normalizer_data", @@ -5024,15 +5013,15 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" [[package]] name = "icu_properties" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" dependencies = [ "icu_collections", "icu_locale_core", @@ -5044,15 +5033,15 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" [[package]] name = "icu_provider" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" dependencies = [ "displaydoc", "icu_locale_core", @@ -5078,7 +5067,7 @@ dependencies = [ "convert_case 0.6.0", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -5100,9 +5089,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" dependencies = [ "icu_normalizer", "icu_properties", @@ -5127,7 +5116,7 @@ dependencies = [ "futures", "num-bigint", "rustls 0.23.37", - "rustls-native-certs 0.8.3", + "rustls-native-certs", "socket2 0.6.2", "thiserror 2.0.18", "tokio", @@ -5209,7 +5198,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fddf93031af70e75410a2511ec04d49e758ed2f26dad3404a934e0fb45cc12a" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "crossterm 0.25.0", "dyn-clone", "fuzzy-matcher", @@ -5250,6 +5239,7 @@ dependencies = [ "golem-api-grpc", "golem-client", "golem-common", + "golem-schema", "golem-service-base", "golem-test-framework", "headers", @@ -5257,9 +5247,9 @@ dependencies = [ "opentelemetry 0.30.0", "opentelemetry_sdk 0.30.0", "pretty_assertions", - "rand 0.9.2", + "rand 0.9.5", "redis", - "reqwest 0.13.2", + "reqwest 0.13.4", "rlimit", "serde", "serde_json", @@ -5277,9 +5267,9 @@ dependencies = [ [[package]] name = "interprocess" -version = "2.4.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6be5e5c847dbdb44564bd85294740d031f4f8aeb3464e5375ef7141f7538db69" +checksum = "069323743400cb7ab06a8fe5c1ed911d36b6919ec531661d034c89083629595b" dependencies = [ "doctest-file", "futures-core", @@ -5287,7 +5277,7 @@ dependencies = [ "recvmsg", "tokio", "widestring", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -5321,16 +5311,6 @@ dependencies = [ "serde", ] -[[package]] -name = "iri-string" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e7418f59cc01c88316161279a7f665217ae316b388e58a0d10e29f54f1e5eb" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "is-terminal" version = "0.4.17" @@ -5362,9 +5342,9 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "iso8601" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1082f0c48f143442a1ac6122f67e360ceee130b967af4d50996e5154a45df46" +checksum = "74a0559b45528cf0732d911524974977a5749f477d7dd99652830ffdaf53c4d1" dependencies = [ "nom 8.0.0", ] @@ -5375,7 +5355,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b43b2015ede53eeef1c023e27f540a39841d139044483641d038a975abd6603d" dependencies = [ - "generic-array 1.3.5", + "generic-array 1.4.4", "serde", "time", ] @@ -5444,27 +5424,32 @@ dependencies = [ [[package]] name = "jni" -version = "0.21.1" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" dependencies = [ - "cesu8", "cfg-if", "combine", - "jni-sys 0.3.1", + "jni-macros", + "jni-sys", "log", - "thiserror 1.0.69", + "simd_cesu8", + "thiserror 2.0.18", "walkdir", - "windows-sys 0.45.0", + "windows-link", ] [[package]] -name = "jni-sys" -version = "0.3.1" +name = "jni-macros" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" dependencies = [ - "jni-sys 0.4.1", + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.119", ] [[package]] @@ -5483,26 +5468,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" dependencies = [ "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "jobserver" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" dependencies = [ - "getrandom 0.3.4", + "getrandom 0.4.3", "libc", ] [[package]] name = "js-sys" -version = "0.3.91" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" dependencies = [ - "once_cell", + "cfg-if", + "futures-util", "wasm-bindgen", ] @@ -5597,6 +5583,21 @@ dependencies = [ "serde_json", ] +[[package]] +name = "konst" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128133ed7824fcd73d6e7b17957c5eb7bacb885649bd8c69708b2331a10bcefb" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + [[package]] name = "kube" version = "0.98.0" @@ -5622,12 +5623,12 @@ dependencies = [ "either", "futures", "home", - "http 1.4.0", - "http-body 1.0.1", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", - "hyper 1.9.0", + "hyper 1.11.0", "hyper-http-proxy", - "hyper-rustls 0.27.7", + "hyper-rustls 0.27.9", "hyper-timeout", "hyper-util", "jsonpath-rust", @@ -5656,7 +5657,7 @@ checksum = "97aa830b288a178a90e784d1b0f1539f2d200d2188c7b4a3146d9dc983d596f3" dependencies = [ "chrono", "form_urlencoded", - "http 1.4.0", + "http 1.5.0", "json-patch", "k8s-openapi", "schemars 0.8.22", @@ -5676,7 +5677,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -5714,14 +5715,14 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin", + "spin 0.9.9", ] [[package]] name = "leb128" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" +checksum = "c83bff1d572d6b9aeef67ddfc8448e4a3737909cb28e81f97c791b9018703e52" [[package]] name = "leb128fmt" @@ -5737,15 +5738,15 @@ checksum = "57eeaed462e96d277051c219bf5e2ed22aedf7705d8945d2decb8b2db8fb954d" [[package]] name = "libc" -version = "0.2.186" +version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" [[package]] name = "libgit2-sys" -version = "0.18.3+1.9.2" +version = "0.18.7+1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9b3acc4b91781bb0b3386669d325163746af5f6e4f73e6d2d630e09a35f3487" +checksum = "23c7391e4b9f4ffab1a624223cc1d7385ff9a678f490768add717de7ea2f4d89" dependencies = [ "cc", "libc", @@ -5770,14 +5771,14 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.15" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ddbf48fd451246b1f8c2610bd3b4ac0cc6e149d89832867093ab69a17194f08" +checksum = "c943259e342f1e06ff2da7a83eabdfe7f92ce10262688dbf1895ff0b3e6e4652" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "libc", "plain", - "redox_syscall 0.7.3", + "redox_syscall 0.9.1", ] [[package]] @@ -5793,9 +5794,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.25" +version = "1.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52f4c29e2a68ac30c9087e1b772dc9f44a2b66ed44edf2266cf2be9b03dafc1" +checksum = "85bc9657773828b90eeb625adff10eeac83cc21bbfd8e23a03eaa8a33c9e28d9" dependencies = [ "cc", "libc", @@ -5817,9 +5818,9 @@ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "litrs" @@ -5838,9 +5839,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.29" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "logos" @@ -5860,6 +5861,15 @@ dependencies = [ "logos-derive 0.15.1", ] +[[package]] +name = "logos" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2c55a318a87600ea870ff8c2012148b44bf18b74fad48d0f835c38c7d07c5f" +dependencies = [ + "logos-derive 0.16.1", +] + [[package]] name = "logos-codegen" version = "0.14.4" @@ -5872,7 +5882,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -5888,7 +5898,21 @@ dependencies = [ "quote", "regex-syntax", "rustc_version", - "syn 2.0.117", + "syn 2.0.119", +] + +[[package]] +name = "logos-codegen" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58b3ffaa284e1350d017a57d04ada118c4583cf260c8fb01e0fe28a2e9cf8970" +dependencies = [ + "fnv", + "proc-macro2", + "quote", + "regex-automata", + "regex-syntax", + "syn 2.0.119", ] [[package]] @@ -5909,13 +5933,22 @@ dependencies = [ "logos-codegen 0.15.1", ] +[[package]] +name = "logos-derive" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52d3a9855747c17eaf4383823f135220716ab49bea5fbea7dd42cc9a92f8aa31" +dependencies = [ + "logos-codegen 0.16.1", +] + [[package]] name = "lru" -version = "0.12.5" +version = "0.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +checksum = "7f66e8d5d03f609abc3a39e6f08e4164ebf1447a732906d39eb9b99b7919ef39" dependencies = [ - "hashbrown 0.15.5", + "hashbrown 0.16.1", ] [[package]] @@ -5949,7 +5982,7 @@ checksum = "59a9dbbfc75d2688ed057456ce8a3ee3f48d12eec09229f560f3643b9f275653" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -5980,7 +6013,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ "cfg-if", - "digest", + "digest 0.10.7", +] + +[[package]] +name = "md-5" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b6441f590336821bb897fb28fc622898ccceb1d6cea3fde5ea86b090c4de98" +dependencies = [ + "cfg-if", + "digest 0.11.3", ] [[package]] @@ -5991,9 +6034,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.8.0" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "memfd" @@ -6049,9 +6092,9 @@ dependencies = [ [[package]] name = "metrics-prometheus" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a596d5d1752e1cce7a7a9b130c8a47c5d7b22a193db36861ff31cedfb4e54313" +checksum = "5ba1c653d1714b0057c0581e4ef8d50600470132d311fbed69cdcc1804e69788" dependencies = [ "arc-swap", "metrics", @@ -6071,7 +6114,7 @@ dependencies = [ "crossbeam-utils", "hashbrown 0.16.1", "metrics", - "rand 0.9.2", + "rand 0.9.5", "rand_xoshiro", "rapidhash", "sketches-ddsketch", @@ -6110,7 +6153,7 @@ checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -6140,9 +6183,9 @@ dependencies = [ [[package]] name = "minijinja" -version = "2.18.0" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "328251e58ad8e415be6198888fc207502727dc77945806421ab34f35bf012e7d" +checksum = "cb3d648e68cea56d9858d535ee28f9538404e2dd8cb08ed0bd05dca379477f39" dependencies = [ "memo-map", "serde", @@ -6178,9 +6221,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.1.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" dependencies = [ "libc", "log", @@ -6197,11 +6240,11 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http 1.4.0", + "http 1.5.0", "httparse", "memchr", "mime", - "spin", + "spin 0.9.9", "tokio", "version_check", ] @@ -6270,7 +6313,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "cfg-if", "cfg_aliases 0.1.1", "libc", @@ -6282,9 +6325,9 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "cfg-if", - "cfg_aliases 0.2.1", + "cfg_aliases 0.2.2", "libc", "memoffset 0.9.1", ] @@ -6295,9 +6338,9 @@ version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "cfg-if", - "cfg_aliases 0.2.1", + "cfg_aliases 0.2.2", "libc", ] @@ -6328,9 +6371,9 @@ dependencies = [ [[package]] name = "nonempty-collections" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d127e00b37b19c36c28ac00e874240a61faeea14c7b759b1d9c77efa048322a" +checksum = "988fb92b275335f315a9bddf7a8881a02c79c6084e9a626f656f12c50776a045" [[package]] name = "nonzero_ext" @@ -6391,7 +6434,7 @@ dependencies = [ "num-integer", "num-iter", "num-traits", - "rand 0.8.5", + "rand 0.8.7", "smallvec", "zeroize", ] @@ -6413,9 +6456,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" [[package]] name = "num-integer" @@ -6428,11 +6471,10 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -6486,13 +6528,13 @@ dependencies = [ "base64 0.22.1", "chrono", "getrandom 0.2.17", - "http 1.4.0", - "rand 0.8.5", + "http 1.5.0", + "rand 0.8.7", "reqwest 0.12.28", "serde", "serde_json", "serde_path_to_error", - "sha2", + "sha2 0.10.9", "thiserror 1.0.69", "url", ] @@ -6557,14 +6599,14 @@ dependencies = [ "chrono", "dyn-clone", "ed25519-dalek", - "hmac", - "http 1.4.0", + "hmac 0.12.1", + "http 1.5.0", "itertools 0.10.5", "log", "oauth2", - "p256 0.13.2", + "p256", "p384", - "rand 0.8.5", + "rand 0.8.7", "rsa", "serde", "serde-value", @@ -6572,7 +6614,7 @@ dependencies = [ "serde_path_to_error", "serde_plain", "serde_with", - "sha2", + "sha2 0.10.9", "subtle", "thiserror 1.0.69", "url", @@ -6584,7 +6626,7 @@ version = "0.10.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "cfg-if", "foreign-types", "libc", @@ -6601,7 +6643,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -6664,7 +6706,7 @@ checksum = "50f6639e842a97dbea8886e3439710ae463120091e2e064518ba8e716e6ac36d" dependencies = [ "async-trait", "bytes", - "http 1.4.0", + "http 1.5.0", "opentelemetry 0.30.0", "reqwest 0.12.28", ] @@ -6675,7 +6717,7 @@ version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbee664a43e07615731afc539ca60c6d9f1a9425e25ca09c57bc36c87c55852b" dependencies = [ - "http 1.4.0", + "http 1.5.0", "opentelemetry 0.30.0", "opentelemetry-http", "opentelemetry-proto", @@ -6753,7 +6795,7 @@ dependencies = [ "futures-util", "opentelemetry 0.30.0", "percent-encoding", - "rand 0.9.2", + "rand 0.9.5", "serde_json", "thiserror 2.0.18", ] @@ -6794,27 +6836,16 @@ version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" -[[package]] -name = "p256" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2", -] - [[package]] name = "p256" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "ecdsa 0.16.9", - "elliptic-curve 0.13.8", + "ecdsa", + "elliptic-curve", "primeorder", - "sha2", + "sha2 0.10.9", ] [[package]] @@ -6823,10 +6854,10 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6" dependencies = [ - "ecdsa 0.16.9", - "elliptic-curve 0.13.8", + "ecdsa", + "elliptic-curve", "primeorder", - "sha2", + "sha2 0.10.9", ] [[package]] @@ -6880,14 +6911,14 @@ dependencies = [ "regex", "regex-syntax", "structmeta", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "pastey" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b867cad97c0791bbd3aaa6472142568c6c9e8f71937e98379f584cfb0cf35bec" +checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" [[package]] name = "pear" @@ -6909,7 +6940,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -6939,9 +6970,9 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pest" -version = "2.8.6" +version = "2.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" +checksum = "7df728be843c7070fab6ab7c328c4e9e9d78e23bf749c0669c86ee7ebfa050a2" dependencies = [ "memchr", "ucd-trie", @@ -6949,9 +6980,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.8.6" +version = "2.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11f486f1ea21e6c10ed15d5a7c77165d0ee443402f0780849d1768e7d9d6fe77" +checksum = "9e2dd6fc3b26b3462ee188aac870f5a41d398f1cd5e2408d16531bd71c9591fd" dependencies = [ "pest", "pest_generator", @@ -6959,25 +6990,24 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.8.6" +version = "2.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8040c4647b13b210a963c1ed407c1ff4fdfa01c31d6d2a098218702e6664f94f" +checksum = "6a7a9205cfb6f596a9e8b689c0a15f9ceb7a1aafae7aaf788150ac65b29975b6" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "pest_meta" -version = "2.8.6" +version = "2.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220" +checksum = "85abd351c0de1e8384fc791a0737111a350394937e92b956b743dac12429f57c" dependencies = [ "pest", - "sha2", ] [[package]] @@ -7037,7 +7067,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared 0.11.3", - "rand 0.8.5", + "rand 0.8.7", ] [[package]] @@ -7050,7 +7080,7 @@ dependencies = [ "phf_shared 0.11.3", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -7073,22 +7103,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.11" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.11" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -7120,19 +7150,9 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "der 0.7.10", - "pkcs8 0.10.2", - "spki 0.7.3", -] - -[[package]] -name = "pkcs8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der 0.6.1", - "spki 0.6.0", + "der", + "pkcs8", + "spki", ] [[package]] @@ -7141,15 +7161,15 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.10", - "spki 0.7.3", + "der", + "spki", ] [[package]] name = "pkg-config" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" [[package]] name = "plain" @@ -7197,9 +7217,9 @@ dependencies = [ "cookie", "futures-util", "headers", - "http 1.4.0", + "http 1.5.0", "http-body-util", - "hyper 1.9.0", + "hyper 1.11.0", "hyper-util", "mime", "multer", @@ -7245,7 +7265,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -7286,14 +7306,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41273b691a3d467a8c44d05506afba9f7b6bd56c9cdf80123de13fe52d7ec587" dependencies = [ "darling 0.20.11", - "http 1.4.0", + "http 1.5.0", "indexmap 2.14.0", "mime", "proc-macro-crate", "proc-macro2", "quote", "regex", - "syn 2.0.117", + "syn 2.0.119", "thiserror 2.0.18", ] @@ -7320,15 +7340,15 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" +checksum = "3d20d5497ef88037a52ff98267d066e7f11fcc5e99bbfbd58a42336193aacec3" [[package]] name = "portable-atomic-util" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "091397be61a01d4be58e7841595bd4bfedb15f1cd54977d79b8271e94ed799a3" +checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" dependencies = [ "portable-atomic", ] @@ -7368,9 +7388,9 @@ dependencies = [ [[package]] name = "potential_utf" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" dependencies = [ "zerovec", ] @@ -7397,7 +7417,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32db37eb2b0ec0af154e9c1b33425902d8cd9481e35167c4e9ffb28fec3916bb" dependencies = [ "proc-macro2", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -7427,7 +7447,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -7436,7 +7456,7 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "elliptic-curve 0.13.8", + "elliptic-curve", ] [[package]] @@ -7445,7 +7465,7 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" dependencies = [ - "toml_edit 0.25.8+spec-1.1.0", + "toml_edit 0.25.13+spec-1.1.0", ] [[package]] @@ -7474,9 +7494,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] @@ -7489,7 +7509,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "version_check", "yansi", ] @@ -7500,7 +7520,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "hex", "procfs-core", "rustix 0.38.44", @@ -7512,7 +7532,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "hex", ] @@ -7541,10 +7561,10 @@ checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set 0.5.3", "bit-vec 0.6.3", - "bitflags 2.11.1", + "bitflags 2.13.1", "lazy_static", "num-traits", - "rand 0.8.5", + "rand 0.8.7", "rand_chacha 0.3.1", "rand_xorshift", "regex-syntax", @@ -7565,19 +7585,19 @@ dependencies = [ [[package]] name = "prost" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568" +checksum = "528ac67416ff8646872a3c02cad9cc4ee5dc9f9540c9b10771855c95cb2e5ae1" dependencies = [ "bytes", - "prost-derive 0.14.3", + "prost-derive 0.14.4", ] [[package]] name = "prost-build" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7" +checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042" dependencies = [ "heck", "itertools 0.14.0", @@ -7585,12 +7605,12 @@ dependencies = [ "multimap", "petgraph 0.8.3", "prettyplease", - "prost 0.14.3", + "prost 0.14.4", "prost-types", "pulldown-cmark", "pulldown-cmark-to-cmark", "regex", - "syn 2.0.117", + "syn 2.0.119", "tempfile", ] @@ -7604,41 +7624,41 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "prost-derive" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" +checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" dependencies = [ "anyhow", "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "prost-reflect" -version = "0.16.3" +version = "0.16.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b89455ef41ed200cafc47c76c552ee7792370ac420497e551f16123a9135f76e" +checksum = "01b80ea363c31af2de2b92e3c07ed1156628f7838c4afb4df75ee78a37fedbd1" dependencies = [ - "logos 0.15.1", + "logos 0.16.1", "miette", - "prost 0.14.3", + "prost 0.14.4", "prost-types", ] [[package]] name = "prost-types" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" +checksum = "f94967dc7688f3054c7fac87473ffae4cc4c3904800e2d9f5b857246d8963b0a" dependencies = [ - "prost 0.14.3", + "prost 0.14.4", ] [[package]] @@ -7669,7 +7689,7 @@ checksum = "4f25a07a73c6717f0b9bbbd685918f5df9815f7efba450b83d9c9dea41f0e3a1" dependencies = [ "bytes", "miette", - "prost 0.14.3", + "prost 0.14.4", "prost-reflect", "prost-types", "protox-parse", @@ -7719,11 +7739,11 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a14896dfa883796f1cb410461aef38810ea05f2b2c33c5aded3649095fdad" +checksum = "e9f068eba8e7071c5f9511831b44f32c740d5adf574e990f946ddb53db2f314e" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "memchr", "unicase", ] @@ -7755,7 +7775,7 @@ source = "git+https://github.com/golemcloud/wasmtime.git?branch=golem-wasmtime-v dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -7785,12 +7805,12 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.9" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +checksum = "0c1a41e437b6bbd489372cd4971de128e85c855f56c57f283d20ff016cf7c0a8" dependencies = [ "bytes", - "cfg_aliases 0.2.1", + "cfg_aliases 0.2.2", "pin-project-lite", "quinn-proto", "quinn-udp", @@ -7805,15 +7825,16 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.14" +version = "0.11.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +checksum = "2f4bfc015262b9df63c8845072ce59068853ff5872180c2ce2f13038b970e560" dependencies = [ "aws-lc-rs", "bytes", - "getrandom 0.3.4", + "getrandom 0.4.3", "lru-slab", - "rand 0.9.2", + "rand 0.10.2", + "rand_pcg", "ring", "rustc-hash", "rustls 0.23.37", @@ -7827,23 +7848,23 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.14" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +checksum = "35a133f956daabe89a61a685c2649f13d82d5aa4bd5d12d1277e1072a21c0694" dependencies = [ - "cfg_aliases 0.2.1", + "cfg_aliases 0.2.2", "libc", "once_cell", "socket2 0.6.2", "tracing", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "quote" -version = "1.0.45" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ "proc-macro2", ] @@ -7868,9 +7889,9 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rand" -version = "0.8.5" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" dependencies = [ "libc", "rand_chacha 0.3.1", @@ -7879,9 +7900,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.2" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.5", @@ -7889,13 +7910,13 @@ dependencies = [ [[package]] name = "rand" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" dependencies = [ "chacha20", - "getrandom 0.4.2", - "rand_core 0.10.0", + "getrandom 0.4.3", + "rand_core 0.10.1", ] [[package]] @@ -7938,9 +7959,18 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rand_pcg" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a" +dependencies = [ + "rand_core 0.10.1", +] [[package]] name = "rand_xorshift" @@ -7974,18 +8004,18 @@ dependencies = [ [[package]] name = "rapidhash" -version = "4.4.1" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e48930979c155e2f33aa36ab3119b5ee81332beb6482199a8ecd6029b80b59" +checksum = "5da7e78a036ce858e8d55b7e7dc8ba3a88b78350fd2155d3591bbd966b58589e" dependencies = [ "rustversion", ] [[package]] name = "rayon" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" dependencies = [ "either", "rayon-core", @@ -8049,16 +8079,16 @@ version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", ] [[package]] name = "redox_syscall" -version = "0.7.3" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" +checksum = "07507be7b4a5f9f26eeb41eeaebb1f5a7ff29dfb29739facc21d35bf8b11c21e" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", ] [[package]] @@ -8085,22 +8115,22 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +checksum = "216e8f773d7923bcba9ceb86a86c93cabb3903a11872fc3f138c49630e50b96d" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +checksum = "2c9283685feec7d69af75fb0e858d5e7378f33fe4fc699383b2916ab9273e03c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.3", ] [[package]] @@ -8120,9 +8150,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de2c52737737f8609e94f975dee22854a2d5c125772d4b1cf292120f4d45c186" +checksum = "757712e8e61590d6d4f5d563483755538b5aa13467837a3b41cd9832509a7f85" dependencies = [ "allocator-api2", "bumpalo", @@ -8135,9 +8165,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.3" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" dependencies = [ "aho-corasick", "memchr", @@ -8147,9 +8177,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad" dependencies = [ "aho-corasick", "memchr", @@ -8164,9 +8194,9 @@ checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" [[package]] name = "regex-syntax" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "rend" @@ -8188,11 +8218,11 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "http 1.4.0", - "http-body 1.0.1", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", - "hyper 1.9.0", - "hyper-rustls 0.27.7", + "hyper 1.11.0", + "hyper-rustls 0.27.9", "hyper-util", "js-sys", "log", @@ -8214,26 +8244,26 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 1.0.6", + "webpki-roots 1.0.9", ] [[package]] name = "reqwest" -version = "0.13.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" +checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" dependencies = [ "base64 0.22.1", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2 0.4.13", - "http 1.4.0", - "http-body 1.0.1", + "h2 0.4.15", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", - "hyper 1.9.0", - "hyper-rustls 0.27.7", + "hyper 1.11.0", + "hyper-rustls 0.27.9", "hyper-util", "js-sys", "log", @@ -8264,14 +8294,14 @@ dependencies = [ [[package]] name = "reqwest-middleware" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199dda04a536b532d0cc04d7979e39b1c763ea749bf91507017069c00b96056f" +checksum = "07bc3f1384cffa4f274dad2d4ddd73aed32fed8f786d96c6be8aa4e5fd3c3b58" dependencies = [ "anyhow", "async-trait", - "http 1.4.0", - "reqwest 0.13.2", + "http 1.5.0", + "reqwest 0.13.4", "serde", "thiserror 2.0.18", "tower-service", @@ -8287,9 +8317,9 @@ dependencies = [ "async-trait", "futures", "getrandom 0.2.17", - "http 1.4.0", - "hyper 1.9.0", - "reqwest 0.13.2", + "http 1.5.0", + "hyper 1.11.0", + "reqwest 0.13.4", "reqwest-middleware", "retry-policies", "thiserror 2.0.18", @@ -8300,17 +8330,17 @@ dependencies = [ [[package]] name = "reqwest-tracing" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5c1a1510677d43dce9e9c0c07fc5db8772c0e5a43e4f9cef75a11affa05a578" +checksum = "b5e5af0cd6fc3d3c8f703d597af70b6e4e62432c63157b49419fa1ffaf481702" dependencies = [ "anyhow", "async-trait", "getrandom 0.2.17", - "http 1.4.0", + "http 1.5.0", "matchit", "opentelemetry 0.30.0", - "reqwest 0.13.2", + "reqwest 0.13.4", "reqwest-middleware", "tracing", "tracing-opentelemetry", @@ -8318,22 +8348,11 @@ dependencies = [ [[package]] name = "retry-policies" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a4bd6027df676bcb752d3724db0ea3c0c5fc1dd0376fec51ac7dcaf9cc69be" -dependencies = [ - "rand 0.9.2", -] - -[[package]] -name = "rfc6979" -version = "0.3.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +checksum = "dc05fbf560421a0357a750cbe78c7ca19d4923918490daabba313d5dbc871e47" dependencies = [ - "crypto-bigint 0.4.9", - "hmac", - "zeroize", + "rand 0.10.2", ] [[package]] @@ -8342,7 +8361,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hmac", + "hmac 0.12.1", "subtle", ] @@ -8429,14 +8448,14 @@ dependencies = [ "bytes", "chrono", "futures", - "http 1.4.0", - "http-body 1.0.1", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", "pastey", "pin-project-lite", - "rand 0.10.1", + "rand 0.10.2", "rmcp-macros", - "schemars 1.2.1", + "schemars 1.2.2", "serde", "serde_json", "sse-stream", @@ -8459,7 +8478,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -8468,16 +8487,16 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d" dependencies = [ - "const-oid", - "digest", + "const-oid 0.9.6", + "digest 0.10.7", "num-bigint-dig", "num-integer", "num-traits", "pkcs1", - "pkcs8 0.10.2", + "pkcs8", "rand_core 0.6.4", - "signature 2.2.0", - "spki 0.7.3", + "signature", + "spki", "subtle", "zeroize", ] @@ -8492,7 +8511,7 @@ dependencies = [ "borsh", "bytes", "num-traits", - "rand 0.8.5", + "rand 0.8.7", "rkyv", "serde", "serde_json", @@ -8501,15 +8520,15 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" +checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb" [[package]] name = "rustc-hash" -version = "2.1.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" [[package]] name = "rustc_version" @@ -8526,7 +8545,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "errno", "libc", "linux-raw-sys 0.4.15", @@ -8539,7 +8558,7 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "errno", "libc", "linux-raw-sys 0.12.1", @@ -8579,24 +8598,11 @@ dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.103.10", + "rustls-webpki 0.103.13", "subtle", "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" -dependencies = [ - "openssl-probe 0.1.6", - "rustls-pemfile", - "rustls-pki-types", - "schannel", - "security-framework 2.11.1", -] - [[package]] name = "rustls-native-certs" version = "0.8.3" @@ -8620,9 +8626,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.14.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96" dependencies = [ "web-time", "zeroize", @@ -8630,9 +8636,9 @@ dependencies = [ [[package]] name = "rustls-platform-verifier" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" dependencies = [ "core-foundation 0.10.1", "core-foundation-sys", @@ -8640,9 +8646,9 @@ dependencies = [ "log", "once_cell", "rustls 0.23.37", - "rustls-native-certs 0.8.3", + "rustls-native-certs", "rustls-platform-verifier-android", - "rustls-webpki 0.103.10", + "rustls-webpki 0.103.13", "security-framework 3.7.0", "security-framework-sys", "webpki-root-certs", @@ -8667,9 +8673,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.10" +version = "0.103.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" dependencies = [ "aws-lc-rs", "ring", @@ -8679,9 +8685,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" [[package]] name = "rusty-fork" @@ -8703,9 +8709,9 @@ checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "saa" -version = "5.5.0" +version = "5.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16c7f49c9d5caa3bf4b3106900484b447b9253fe99670ceb81cb6cb5027855e1" +checksum = "68f5acb362a0e75c2a963532fa7fabf13dff81626dc494df16488d30befcbea0" [[package]] name = "same-file" @@ -8727,9 +8733,9 @@ dependencies = [ [[package]] name = "scc" -version = "3.6.12" +version = "3.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f448f7d881535036452f0cac656a41463807f095eda504890764ca7d11e2a2ea" +checksum = "f8af0b99483d1c3e59471d4f0cb58b244169436a8979c889a91a3f697075ea01" dependencies = [ "saa", "sdd", @@ -8770,14 +8776,14 @@ dependencies = [ [[package]] name = "schemars" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" +checksum = "687274d293b6cdc6e73e0fee520bf2049650090d7164f87672d212a3c530cf4a" dependencies = [ "chrono", "dyn-clone", "ref-cast", - "schemars_derive 1.2.1", + "schemars_derive 1.2.2", "serde", "serde_json", ] @@ -8790,20 +8796,20 @@ checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" dependencies = [ "proc-macro2", "quote", - "serde_derive_internals", - "syn 2.0.117", + "serde_derive_internals 0.29.1", + "syn 2.0.119", ] [[package]] name = "schemars_derive" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d115b50f4aaeea07e79c1912f645c7513d81715d0420f8bc77a18c6260b307f" +checksum = "d98c67716b46af2f0b8cf752abc930f6f9aecfbf671ecfb531db8a31dbe4e2ba" dependencies = [ "proc-macro2", "quote", - "serde_derive_internals", - "syn 2.0.117", + "serde_derive_internals 0.30.0", + "syn 3.0.3", ] [[package]] @@ -8824,9 +8830,12 @@ dependencies = [ [[package]] name = "sdd" -version = "4.7.5" +version = "4.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ca0e33fc1ae39e36b2d1fdfc8ee470b26397b642ff87572a59a36ff4f2340b" +checksum = "1836bad8bdc9c6d665b63202da3d9c6d60ed1e597cae63620e21ebf89a3595a9" +dependencies = [ + "saa", +] [[package]] name = "seahash" @@ -8836,27 +8845,13 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "sealed" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f968c5ea23d555e670b449c1c5e7b2fc399fdaec1d304a17cd48e288abc107" +checksum = "9b68e2ea526d9fb32f23ca8894fb5da9e743f34c2f41701f0501dc8a25c4b343" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", -] - -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", - "generic-array 0.14.9", - "pkcs8 0.9.0", - "subtle", - "zeroize", + "syn 3.0.3", ] [[package]] @@ -8865,10 +8860,10 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct 0.2.0", - "der 0.7.10", + "base16ct", + "der", "generic-array 0.14.9", - "pkcs8 0.10.2", + "pkcs8", "subtle", "zeroize", ] @@ -8888,7 +8883,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -8901,7 +8896,7 @@ version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "core-foundation 0.10.1", "core-foundation-sys", "libc", @@ -8920,9 +8915,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" dependencies = [ "serde", "serde_core", @@ -8930,9 +8925,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" dependencies = [ "serde_core", "serde_derive", @@ -8950,22 +8945,22 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.3", ] [[package]] @@ -8976,14 +8971,25 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", +] + +[[package]] +name = "serde_derive_internals" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f852137cce035d6a4df67ccce505ff6b3e9fd3a10e3e52b24dc71e650bb1a9bd" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", ] [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" dependencies = [ "indexmap 2.14.0", "itoa", @@ -9015,13 +9021,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.3", ] [[package]] @@ -9035,9 +9041,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876ac351060d4f882bb1032b6369eb0aef79ad9df1ea8bc404874d8cc3d0cd98" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" dependencies = [ "serde_core", ] @@ -9056,17 +9062,18 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.18.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5414fad8e6907dbdd5bc441a50ae8d6e26151a03b1de04d89a5576de61d01f" +checksum = "76a5c54c7310e7b8b9577c286d7e399ddd876c3e12b3ed917a8aabc4b96e9e8c" dependencies = [ "base64 0.22.1", + "bs58", "chrono", "hex", "indexmap 1.9.3", "indexmap 2.14.0", "schemars 0.9.0", - "schemars 1.2.1", + "schemars 1.2.2", "serde_core", "serde_json", "serde_with_macros", @@ -9075,14 +9082,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.18.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3db8978e608f1fe7357e211969fd9abdcae80bac1ba7a3369bb7eb6b404eb65" +checksum = "84d57bc0c8b9a17920c178daa6bb924850d54a9c97ab45194bb8c17ad66bb660" dependencies = [ "darling 0.23.0", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -9111,13 +9118,24 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" dependencies = [ "cfg-if", "cpufeatures 0.2.17", - "digest", + "digest 0.10.7", +] + +[[package]] +name = "sha1" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "digest 0.11.3", ] [[package]] @@ -9134,7 +9152,18 @@ checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures 0.2.17", - "digest", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "digest 0.11.3", ] [[package]] @@ -9181,6 +9210,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + [[package]] name = "signal-hook" version = "0.3.18" @@ -9199,7 +9234,7 @@ checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc" dependencies = [ "libc", "mio 0.8.11", - "mio 1.1.1", + "mio 1.2.2", "signal-hook", ] @@ -9213,31 +9248,31 @@ dependencies = [ "libc", ] -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest", - "rand_core 0.6.4", -] - [[package]] name = "signature" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest", + "digest 0.10.7", "rand_core 0.6.4", ] [[package]] name = "simd-adler32" -version = "0.3.8" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" + +[[package]] +name = "simd_cesu8" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" +dependencies = [ + "rustc_version", + "simdutf8", +] [[package]] name = "simdutf8" @@ -9279,9 +9314,9 @@ dependencies = [ [[package]] name = "siphasher" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" +checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" [[package]] name = "sketches-ddsketch" @@ -9297,9 +9332,9 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" -version = "1.15.1" +version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" dependencies = [ "serde", ] @@ -9317,9 +9352,9 @@ dependencies = [ [[package]] name = "smawk" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" +checksum = "e8e2fb0f499abb4d162f2bedad68f5ef91a1682b5a03596ddb67efd37768d100" [[package]] name = "socket2" @@ -9352,13 +9387,19 @@ dependencies = [ [[package]] name = "spin" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" dependencies = [ "lock_api", ] +[[package]] +name = "spin" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "023a211cb3138dbc438680b32560ad89f699977624c9f8dbb95a47d5b4c07dd3" + [[package]] name = "spinning_top" version = "0.3.0" @@ -9368,16 +9409,6 @@ dependencies = [ "lock_api", ] -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der 0.6.1", -] - [[package]] name = "spki" version = "0.7.3" @@ -9385,7 +9416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der 0.7.10", + "der", ] [[package]] @@ -9415,7 +9446,7 @@ dependencies = [ "crc", "crossbeam-queue", "either", - "event-listener 5.4.1", + "event-listener 5.4.2", "futures-core", "futures-intrusive", "futures-io", @@ -9432,7 +9463,7 @@ dependencies = [ "rustls 0.23.37", "serde", "serde_json", - "sha2", + "sha2 0.10.9", "smallvec", "thiserror 2.0.18", "tokio", @@ -9453,7 +9484,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -9471,12 +9502,12 @@ dependencies = [ "quote", "serde", "serde_json", - "sha2", + "sha2 0.10.9", "sqlx-core", "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.117", + "syn 2.0.119", "tokio", "url", ] @@ -9490,12 +9521,12 @@ dependencies = [ "atoi", "base64 0.22.1", "bigdecimal", - "bitflags 2.11.1", + "bitflags 2.13.1", "byteorder", "bytes", "chrono", "crc", - "digest", + "digest 0.10.7", "dotenvy", "either", "futures-channel", @@ -9505,18 +9536,18 @@ dependencies = [ "generic-array 0.14.9", "hex", "hkdf", - "hmac", + "hmac 0.12.1", "itoa", "log", - "md-5", + "md-5 0.10.6", "memchr", "once_cell", "percent-encoding", - "rand 0.8.5", + "rand 0.8.7", "rsa", "serde", - "sha1", - "sha2", + "sha1 0.10.7", + "sha2 0.10.9", "smallvec", "sqlx-core", "stringprep", @@ -9536,7 +9567,7 @@ dependencies = [ "base64 0.22.1", "bigdecimal", "bit-vec 0.6.3", - "bitflags 2.11.1", + "bitflags 2.13.1", "byteorder", "chrono", "crc", @@ -9547,20 +9578,20 @@ dependencies = [ "futures-util", "hex", "hkdf", - "hmac", + "hmac 0.12.1", "home", "ipnetwork", "itoa", "log", "mac_address", - "md-5", + "md-5 0.10.6", "memchr", "num-bigint", "once_cell", - "rand 0.8.5", + "rand 0.8.7", "serde", "serde_json", - "sha2", + "sha2 0.10.9", "smallvec", "sqlx-core", "stringprep", @@ -9609,13 +9640,13 @@ dependencies = [ [[package]] name = "sse-stream" -version = "0.2.1" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb4dc4d33c68ec1f27d386b5610a351922656e1fdf5c05bbaad930cd1519479a" +checksum = "c123f296ade4ec4b8b0f6162116e6629f5146922ca5ab40ca9d3c2e73ab4761e" dependencies = [ "bytes", "futures-util", - "http-body 1.0.1", + "http-body 1.1.0", "http-body-util", "pin-project-lite", ] @@ -9673,7 +9704,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -9684,7 +9715,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -9702,7 +9733,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -9745,9 +9776,20 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.117" +version = "2.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -9784,7 +9826,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -9807,7 +9849,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "core-foundation 0.9.4", "system-configuration-sys", ] @@ -9828,7 +9870,7 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc4592f674ce18521c2a81483873a49596655b179f71c5e05d10c1fe66c78745" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "cap-fs-ext", "cap-std", "fd-lock", @@ -9852,9 +9894,9 @@ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" [[package]] name = "target-triple" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ef38edfb78ca4771ee32cf494cb8771944bee237a9b91fc9c1424ac4b777b" +checksum = "c3a6bfce3d99adfa72d24750a61f782f3036a81e7f86d8841ee1326deaebd171" [[package]] name = "tempfile" @@ -9863,7 +9905,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.4.2", + "getrandom 0.4.3", "once_cell", "rustix 1.1.4", "windows-sys 0.61.2", @@ -9920,7 +9962,7 @@ dependencies = [ "libc", "parking_lot", "quick-xml 0.38.4", - "rand 0.10.1", + "rand 0.10.2", "serde_json", "tokio", "topological-sort", @@ -9938,16 +9980,16 @@ dependencies = [ "humantime", "proc-macro2", "quote", - "rand 0.10.1", - "syn 2.0.117", + "rand 0.10.2", + "syn 2.0.119", "test-r-core", ] [[package]] name = "testcontainers" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd36b06a2a6c0c3c81a83be1ab05fe86460d054d4d51bf513bc56b3e15bdc22" +checksum = "bfd5785b5483672915ed5fe3cddf9f546802779fc1eceff0a6fb7321fac81c1e" dependencies = [ "astral-tokio-tar", "async-trait", @@ -9958,7 +10000,7 @@ dependencies = [ "etcetera 0.11.0", "ferroid", "futures", - "http 1.4.0", + "http 1.5.0", "itertools 0.14.0", "log", "memchr", @@ -10020,7 +10062,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -10031,26 +10073,25 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "thread_local" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" dependencies = [ "cfg-if", ] [[package]] name = "time" -version = "0.3.47" +version = "0.3.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +checksum = "3e1d5e639ff6bab73cb6885cc7e7b1de96c3f32c68ec55f3952614bec1092244" dependencies = [ "deranged", - "itoa", "libc", "num-conv", "num_threads", @@ -10062,15 +10103,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" [[package]] name = "time-macros" -version = "0.2.27" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85" dependencies = [ "num-conv", "time-core", @@ -10078,9 +10119,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" dependencies = [ "displaydoc", "zerovec", @@ -10098,9 +10139,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" dependencies = [ "tinyvec_macros", ] @@ -10119,7 +10160,7 @@ checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" dependencies = [ "bytes", "libc", - "mio 1.1.1", + "mio 1.2.2", "parking_lot", "pin-project-lite", "signal-hook-registry", @@ -10137,14 +10178,14 @@ checksum = "5c55a2eff8b69ce66c84f85e1da1c233edc36ceb85a2058d11b0d6a3c7e7569c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "tokio-metrics" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9e81d53caf955549b1dec7af4ac2149e94cc25ed97b4a545151140281e2f528" +checksum = "9eb550d0339653b52b1a4b03b96d0e6a97ee0641ed88b3c0cd098c7fabb275f3" dependencies = [ "futures-util", "metrics", @@ -10185,9 +10226,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +checksum = "a3d06f0b082ba57c26b79407372e57cf2a1e28124f78e9479fe80322cf53420b" dependencies = [ "futures-core", "pin-project-lite", @@ -10256,7 +10297,7 @@ checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ "indexmap 2.14.0", "serde_core", - "serde_spanned 1.1.0", + "serde_spanned 1.1.1", "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", "toml_writer", @@ -10265,17 +10306,17 @@ dependencies = [ [[package]] name = "toml" -version = "1.1.0+spec-1.1.0" +version = "1.1.4+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8195ca05e4eb728f4ba94f3e3291661320af739c4e43779cbdfae82ab239fcc" +checksum = "3aace63f4bbcdfc2c965b059de67119c89c4017a70d633be6c104910f67056f5" dependencies = [ "indexmap 2.14.0", "serde_core", - "serde_spanned 1.1.0", - "toml_datetime 1.1.0+spec-1.1.0", + "serde_spanned 1.1.1", + "toml_datetime 1.1.1+spec-1.1.0", "toml_parser", "toml_writer", - "winnow 1.0.0", + "winnow 1.0.4", ] [[package]] @@ -10298,9 +10339,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "1.1.0+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97251a7c317e03ad83774a8752a7e81fb6067740609f75ea2b585b569a59198f" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" dependencies = [ "serde_core", ] @@ -10334,23 +10375,23 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.25.8+spec-1.1.0" +version = "0.25.13+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16bff38f1d86c47f9ff0647e6838d7bb362522bdf44006c7068c2b1e606f1f3c" +checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b" dependencies = [ "indexmap 2.14.0", - "toml_datetime 1.1.0+spec-1.1.0", + "toml_datetime 1.1.1+spec-1.1.0", "toml_parser", - "winnow 1.0.0", + "winnow 1.0.4", ] [[package]] name = "toml_parser" -version = "1.1.0+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2334f11ee363607eb04df9b8fc8a13ca1715a72ba8662a26ac285c98aabb4011" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ - "winnow 1.0.0", + "winnow 1.0.4", ] [[package]] @@ -10361,9 +10402,9 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "toml_writer" -version = "1.1.0+spec-1.1.0" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d282ade6016312faf3e41e57ebbba0c073e4056dab1232ab1cb624199648f8ed" +checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" [[package]] name = "tonic" @@ -10374,8 +10415,8 @@ dependencies = [ "async-trait", "base64 0.22.1", "bytes", - "http 1.4.0", - "http-body 1.0.1", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", "percent-encoding", "pin-project", @@ -10388,20 +10429,20 @@ dependencies = [ [[package]] name = "tonic" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec7c61a0695dc1887c1b53952990f3ad2e3a31453e1f49f10e75424943a93ec" +checksum = "ac2a5518c70fa84342385732db33fb3f44bc4cc748936eb5833d2df34d6445ef" dependencies = [ "async-trait", "axum", "base64 0.22.1", "bytes", "flate2", - "h2 0.4.13", - "http 1.4.0", - "http-body 1.0.1", + "h2 0.4.15", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", - "hyper 1.9.0", + "hyper 1.11.0", "hyper-timeout", "hyper-util", "percent-encoding", @@ -10419,67 +10460,67 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1882ac3bf5ef12877d7ed57aad87e75154c11931c2ba7e6cde5e22d63522c734" +checksum = "c68f61875ac5293cf72e6c8cf0158086428c82c37229e98c840878f1706b0322" dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "tonic-health" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ff0636fef47afb3ec02818f5bceb4377b8abb9d6a386aeade18bd6212f8eb7" +checksum = "fcfab99db777fba2802f0dfa861d1628d1ae916fb199d29819941f139ae85082" dependencies = [ - "prost 0.14.3", + "prost 0.14.4", "tokio", "tokio-stream", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-prost", ] [[package]] name = "tonic-prost" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55376a0bbaa4975a3f10d009ad763d8f4108f067c7c2e74f3001fb49778d309" +checksum = "50849f68853be452acf590cde0b146665b8d507b3b8af17261df47e02c209ea0" dependencies = [ "bytes", - "prost 0.14.3", - "tonic 0.14.5", + "prost 0.14.4", + "tonic 0.14.6", ] [[package]] name = "tonic-prost-build" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3144df636917574672e93d0f56d7edec49f90305749c668df5101751bb8f95a" +checksum = "654e5643eff75d7f8c99197ce1440ed19a3474eada74c12bbac488b2cafdae27" dependencies = [ "prettyplease", "proc-macro2", "prost-build", "prost-types", "quote", - "syn 2.0.117", + "syn 2.0.119", "tempfile", "tonic-build", ] [[package]] name = "tonic-reflection" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf0685a51e6d02b502ba0764002e766b7f3042aed13d9234925b6ffbfa3fca7" +checksum = "acccd136a4bf19810a1fde9c74edc6129b42a66b44d0c1c8aaa67aeb49a146a7" dependencies = [ - "prost 0.14.3", + "prost 0.14.4", "prost-types", "tokio", "tokio-stream", - "tonic 0.14.5", + "tonic 0.14.6", "tonic-prost", ] @@ -10491,9 +10532,9 @@ checksum = "0e24b3f8770cc48b60ccf1f9a2c30d1c15a19442f741a9cdd62f04e1169fd458" dependencies = [ "futures-core", "futures-util", - "http 1.4.0", - "http-body 1.0.1", - "hyper 1.9.0", + "http 1.5.0", + "http-body 1.1.0", + "hyper 1.11.0", "opentelemetry 0.30.0", "pin-project-lite", "tonic 0.13.1", @@ -10547,20 +10588,19 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" dependencies = [ "async-compression", "base64 0.22.1", - "bitflags 2.11.1", + "bitflags 2.13.1", "bytes", "futures-core", "futures-util", - "http 1.4.0", - "http-body 1.0.1", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", - "iri-string", "mime", "pin-project-lite", "tokio", @@ -10569,6 +10609,7 @@ dependencies = [ "tower-layer", "tower-service", "tracing", + "url", ] [[package]] @@ -10603,7 +10644,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -10663,7 +10704,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad59746664e45161625561841c0c9385565913c2d349fdd04cae89502fb5f30a" dependencies = [ - "http 1.4.0", + "http 1.5.0", "opentelemetry 0.30.0", "tracing", "tracing-opentelemetry", @@ -10718,14 +10759,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad06847b7afb65c7866a36664b75c40b895e318cea4f71299f013fb22965329d" dependencies = [ "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "tree-sitter" -version = "0.26.7" +version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a6592b1aec0109df37b6bafea77eb4e61466e37b0a5a98bef4f89bfb81b7a2" +checksum = "af1c71c1c4cc0920b20d6b0f6572e7682cd07a6a2faec71067a31fa394c586df" dependencies = [ "cc", "regex", @@ -10753,9 +10794,9 @@ checksum = "009994f150cc0cd50ff54917d5bc8bffe8cad10ca10d81c34da2ec421ae61782" [[package]] name = "tree-sitter-rust" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f715f73a0687261ddb686f0d64a1e5af57bd199c4d12be5fdda6676ce1885bf9" +checksum = "439e577dbe07423ec2582ac62c7531120dbfccfa6e5f92406f93dd271a120e45" dependencies = [ "cc", "tree-sitter-language", @@ -10804,14 +10845,14 @@ checksum = "b9c81686f7ab4065ccac3df7a910c4249f8c0f3fb70421d6ddec19b9311f63f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "trybuild" -version = "1.0.116" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c635f0191bd3a2941013e5062667100969f8c4e9cd787c14f977265d73616e" +checksum = "06649c6f63d86604ba0c8950d5a1829fc9a17afd70fc6629f481d75b6a624c78" dependencies = [ "glob", "serde", @@ -10819,7 +10860,7 @@ dependencies = [ "serde_json", "target-triple", "termcolor", - "toml 1.1.0+spec-1.1.0", + "toml 1.1.4+spec-1.1.0", ] [[package]] @@ -10841,12 +10882,12 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.4.0", + "http 1.5.0", "httparse", "log", "native-tls", - "rand 0.8.5", - "sha1", + "rand 0.8.7", + "sha1 0.10.7", "thiserror 2.0.18", "utf-8", ] @@ -10859,11 +10900,11 @@ checksum = "eadc29d668c91fcc564941132e17b28a7ceb2f3ebf0b9dae3e03fd7a6748eb0d" dependencies = [ "bytes", "data-encoding", - "http 1.4.0", + "http 1.5.0", "httparse", "log", - "rand 0.9.2", - "sha1", + "rand 0.9.5", + "sha1 0.10.7", "thiserror 2.0.18", "utf-8", ] @@ -10876,9 +10917,9 @@ checksum = "41713888c5ccfd99979fcd1afd47b71652e331b3d4a0e19d30769e80fec76cce" [[package]] name = "typenum" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "tz-rs" @@ -10899,9 +10940,9 @@ dependencies = [ [[package]] name = "tzdb_data" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "125a0a63c4bd75c73f61863463cb400db4b1aa5039b203b0ee1d628a7e3dabb2" +checksum = "febaa995f6852367564e16c3369988b99d471d43ed12b1255b8d294661797f1c" dependencies = [ "tz-rs", ] @@ -10974,9 +11015,9 @@ checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" [[package]] name = "unicode-segmentation" -version = "1.13.1" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da36089a805484bcccfffe0739803392c8298778a2d2f09febf76fac5ad9025b" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] name = "unicode-width" @@ -11002,7 +11043,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ - "crypto-common", + "crypto-common 0.1.6", "subtle", ] @@ -11040,7 +11081,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e994ba84b0bd1b1b0cf92878b7ef898a5c1760108fe7b6010327e274917a808c" dependencies = [ "base64 0.22.1", - "http 1.4.0", + "http 1.5.0", "httparse", "log", ] @@ -11094,7 +11135,7 @@ version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" dependencies = [ - "getrandom 0.4.2", + "getrandom 0.4.3", "js-sys", "serde_core", "sha1_smol", @@ -11186,20 +11227,11 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.2+wasi-0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" -dependencies = [ - "wit-bindgen 0.51.0", -] - -[[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +version = "1.0.4+wasi-0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" dependencies = [ - "wit-bindgen 0.51.0", + "wit-bindgen 0.57.1", ] [[package]] @@ -11210,9 +11242,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.114" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" dependencies = [ "cfg-if", "once_cell", @@ -11224,23 +11256,19 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.64" +version = "0.4.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" +checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d" dependencies = [ - "cfg-if", - "futures-util", "js-sys", - "once_cell", "wasm-bindgen", - "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.114" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -11248,22 +11276,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.114" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.114" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" dependencies = [ "unicode-ident", ] @@ -11285,16 +11313,6 @@ dependencies = [ "wat", ] -[[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser 0.244.0", -] - [[package]] name = "wasm-encoder" version = "0.247.0" @@ -11337,24 +11355,12 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.254.0" +version = "0.255.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09480d646178e5fdd12bb06e812d0af9a3a191dbc9cd697fdc86687beade7393" +checksum = "9b524283fb5df62eec102ed0574838961bdd7ba5ac9c50d38e2756c51c971a42" dependencies = [ "leb128fmt", - "wasmparser 0.254.0", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap 2.14.0", - "wasm-encoder 0.244.0", - "wasmparser 0.244.0", + "wasmparser 0.255.0", ] [[package]] @@ -11402,7 +11408,7 @@ dependencies = [ "prettier-please", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "tokio", "toml_edit 0.22.27", "wasm-encoder 0.247.0", @@ -11440,25 +11446,13 @@ dependencies = [ "wit-parser 0.248.0", ] -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags 2.11.1", - "hashbrown 0.15.5", - "indexmap 2.14.0", - "semver", -] - [[package]] name = "wasmparser" version = "0.247.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e6fb4c2bee46c5ea4d40f8cdb5c131725cd976718ec56f1c8e82fbde5fa2a80" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "hashbrown 0.17.1", "indexmap 2.14.0", "semver", @@ -11471,7 +11465,7 @@ version = "0.248.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4439c5eee9df71ee0c6efb37f63b1fcb1fec38f85f5142c54e7ed05d33091a" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "hashbrown 0.17.1", "indexmap 2.14.0", "semver", @@ -11484,7 +11478,7 @@ version = "0.251.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "437970b35b1a85cfde9c74b2398352d8d653f3bd8e3a3db0c063ea8f5b4b36ff" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "hashbrown 0.17.1", "indexmap 2.14.0", "semver", @@ -11497,7 +11491,7 @@ version = "0.253.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19db11f87d2486580e1e8b6f494c54df7e0566b87d0b599db843c24019667339" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "hashbrown 0.17.1", "indexmap 2.14.0", "semver", @@ -11505,11 +11499,11 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.254.0" +version = "0.255.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5769a29f799fbab136aaf65b4fe5384cd7d93fe6fc9ba0dcb6c8382a1f16e27" +checksum = "e8e329ef4b5d46e73b91d3ac6924417cad55a8cbbf869c199283383427c3320b" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "indexmap 2.14.0", "semver", ] @@ -11530,9 +11524,9 @@ name = "wasmtime" version = "46.0.1" source = "git+https://github.com/golemcloud/wasmtime.git?branch=golem-wasmtime-v46.0.1-p3#9a3221a39a0b7124a72f7ce626756376996e3f4d" dependencies = [ - "addr2line 0.26.0", + "addr2line 0.26.1", "async-trait", - "bitflags 2.11.1", + "bitflags 2.13.1", "bumpalo", "bytes", "cc", @@ -11598,7 +11592,7 @@ dependencies = [ "semver", "serde", "serde_derive", - "sha2", + "sha2 0.10.9", "smallvec", "target-lexicon", "wasm-encoder 0.251.0", @@ -11620,7 +11614,7 @@ dependencies = [ "rustix 1.1.4", "serde", "serde_derive", - "sha2", + "sha2 0.10.9", "toml 0.9.12+spec-1.1.0", "wasmtime-environ", "windows-sys 0.61.2", @@ -11635,7 +11629,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "wasmtime-internal-component-util", "wasmtime-internal-wit-bindgen", "wit-parser 0.251.0", @@ -11738,7 +11732,7 @@ source = "git+https://github.com/golemcloud/wasmtime.git?branch=golem-wasmtime-v dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -11747,7 +11741,7 @@ version = "46.0.1" source = "git+https://github.com/golemcloud/wasmtime.git?branch=golem-wasmtime-v46.0.1-p3#9a3221a39a0b7124a72f7ce626756376996e3f4d" dependencies = [ "anyhow", - "bitflags 2.11.1", + "bitflags 2.13.1", "heck", "indexmap 2.14.0", "wit-parser 0.251.0", @@ -11759,7 +11753,7 @@ version = "46.0.1" source = "git+https://github.com/golemcloud/wasmtime.git?branch=golem-wasmtime-v46.0.1-p3#9a3221a39a0b7124a72f7ce626756376996e3f4d" dependencies = [ "async-trait", - "bitflags 2.11.1", + "bitflags 2.13.1", "bytes", "cap-fs-ext", "cap-net-ext", @@ -11769,7 +11763,7 @@ dependencies = [ "futures", "io-extras", "io-lifetimes", - "rand 0.10.1", + "rand 0.10.2", "rustix 1.1.4", "thiserror 2.0.18", "tokio", @@ -11789,11 +11783,11 @@ dependencies = [ "async-trait", "bytes", "futures", - "http 1.4.0", - "http-body 1.0.1", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", - "hyper 1.9.0", - "hyper-rustls 0.27.7", + "hyper 1.11.0", + "hyper-rustls 0.27.9", "hyper-util", "rustls 0.23.37", "tokio", @@ -11855,24 +11849,24 @@ dependencies = [ [[package]] name = "wast" -version = "254.0.0" +version = "255.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ed4dfc8f6b9fc38b231065e2cdfbf7359af5ab945990abf09658dcc63c3e32" +checksum = "55ffec530f199bd3d553ac442c13dd108353cad533cad8514bc41e1f1f0fe686" dependencies = [ "bumpalo", "leb128fmt", "memchr", "unicode-width 0.2.2", - "wasm-encoder 0.254.0", + "wasm-encoder 0.255.0", ] [[package]] name = "wat" -version = "1.254.0" +version = "1.255.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7127f7f9b8f127c879991cecd35f494e4628bae1b0874c681414d8d8831e952c" +checksum = "dda82c82e1486c7eed42a0465e544d80fff37abc3b39482e0d34dbaabe2fe5b1" dependencies = [ - "wast 254.0.0", + "wast 255.0.0", ] [[package]] @@ -11892,9 +11886,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.91" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" +checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" dependencies = [ "js-sys", "wasm-bindgen", @@ -11912,9 +11906,9 @@ dependencies = [ [[package]] name = "webpki-root-certs" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804f18a4ac2676ffb4e8b5b5fa9ae38af06df08162314f96a68d2a363e21a8ca" +checksum = "b96554aa2acc8ccdb7e1c9a58a7a68dd5d13bccc69cd124cb09406db612a1c9b" dependencies = [ "rustls-pki-types", ] @@ -11925,23 +11919,23 @@ version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "webpki-roots 1.0.6", + "webpki-roots 1.0.9", ] [[package]] name = "webpki-roots" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" +checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" dependencies = [ "rustls-pki-types", ] [[package]] name = "which" -version = "8.0.2" +version = "8.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81995fafaaaf6ae47a7d0cc83c67caf92aeb7e5331650ae6ff856f7c0c60c459" +checksum = "8f3ef584124b911bcc3875c2f1472e80f24361ceb789bd1c62b3e9a3df9ff43c" dependencies = [ "libc", ] @@ -11967,7 +11961,7 @@ name = "wiggle" version = "46.0.1" source = "git+https://github.com/golemcloud/wasmtime.git?branch=golem-wasmtime-v46.0.1-p3#9a3221a39a0b7124a72f7ce626756376996e3f4d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "thiserror 2.0.18", "tracing", "wasmtime", @@ -11983,7 +11977,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "wasmtime-environ", "witx", ] @@ -11995,7 +11989,7 @@ source = "git+https://github.com/golemcloud/wasmtime.git?branch=golem-wasmtime-v dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "wiggle-generate", ] @@ -12051,7 +12045,7 @@ version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" dependencies = [ - "windows-core", + "windows-core 0.57.0", "windows-targets 0.52.6", ] @@ -12061,12 +12055,25 @@ version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" dependencies = [ - "windows-implement", - "windows-interface", + "windows-implement 0.57.0", + "windows-interface 0.57.0", "windows-result 0.1.2", "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link", + "windows-result 0.4.1", + "windows-strings", +] + [[package]] name = "windows-implement" version = "0.57.0" @@ -12075,7 +12082,18 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", ] [[package]] @@ -12086,7 +12104,18 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", ] [[package]] @@ -12133,15 +12162,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -12441,9 +12461,9 @@ dependencies = [ [[package]] name = "winnow" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" dependencies = [ "memchr", ] @@ -12463,18 +12483,17 @@ version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f3fd376f71958b862e7afb20cfe5a22830e1963462f3a17f49d82a6c1d1f42d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.1", "windows-sys 0.59.0", ] [[package]] name = "wit-bindgen" -version = "0.51.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" dependencies = [ - "bitflags 2.11.1", - "wit-bindgen-rust-macro 0.51.0", + "bitflags 2.13.1", ] [[package]] @@ -12482,19 +12501,8 @@ name = "wit-bindgen" version = "0.59.0" source = "git+https://github.com/golemcloud/wit-bindgen?branch=golem-outline-lift-v0.58.0#4407232ead86d9bcbd06cbebd790a52120a4087a" dependencies = [ - "bitflags 2.11.1", - "wit-bindgen-rust-macro 0.59.0", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck", - "wit-parser 0.244.0", + "bitflags 2.13.1", + "wit-bindgen-rust-macro", ] [[package]] @@ -12518,22 +12526,6 @@ dependencies = [ "wit-parser 0.253.0", ] -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck", - "indexmap 2.14.0", - "prettyplease", - "syn 2.0.117", - "wasm-metadata 0.244.0", - "wit-bindgen-core 0.51.0", - "wit-component 0.244.0", -] - [[package]] name = "wit-bindgen-rust" version = "0.59.0" @@ -12543,27 +12535,12 @@ dependencies = [ "heck", "indexmap 2.14.0", "prettyplease", - "syn 2.0.117", + "syn 2.0.119", "wasm-metadata 0.253.0", "wit-bindgen-core 0.59.0", "wit-component 0.253.0", ] -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn 2.0.117", - "wit-bindgen-core 0.51.0", - "wit-bindgen-rust 0.51.0", -] - [[package]] name = "wit-bindgen-rust-macro" version = "0.59.0" @@ -12574,28 +12551,9 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "wit-bindgen-core 0.59.0", - "wit-bindgen-rust 0.59.0", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags 2.11.1", - "indexmap 2.14.0", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder 0.244.0", - "wasm-metadata 0.244.0", - "wasmparser 0.244.0", - "wit-parser 0.244.0", + "wit-bindgen-rust", ] [[package]] @@ -12605,7 +12563,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0012379f0ff47e1d44dd312e76cfa42de2589251f093fb105e9de9db90c89221" dependencies = [ "anyhow", - "bitflags 2.11.1", + "bitflags 2.13.1", "indexmap 2.14.0", "log", "serde", @@ -12624,7 +12582,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbbd2500ac3488489ee8c6e59b79d7e47e6da5bfb019efd35d5dca57b78af624" dependencies = [ "anyhow", - "bitflags 2.11.1", + "bitflags 2.13.1", "indexmap 2.14.0", "log", "serde", @@ -12649,24 +12607,6 @@ dependencies = [ "wit-parser 0.247.0", ] -[[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" -dependencies = [ - "anyhow", - "id-arena", - "indexmap 2.14.0", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser 0.244.0", -] - [[package]] name = "wit-parser" version = "0.247.0" @@ -12757,9 +12697,9 @@ dependencies = [ [[package]] name = "writeable" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" [[package]] name = "wyz" @@ -12794,9 +12734,9 @@ checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yoke" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" dependencies = [ "stable_deref_trait", "yoke-derive", @@ -12805,68 +12745,68 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "synstructure", ] [[package]] name = "zerocopy" -version = "0.8.47" +version = "0.8.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbb2a062be311f2ba113ce66f697a4dc589f85e78a4aea276200804cea0ed87" +checksum = "b5a105cd7b140f6eeec8acff2ea38135d3cab283ada58540f629fe51e46696eb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.47" +version = "0.8.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e8bc7269b54418e7aeeef514aa68f8690b8c0489a06b0136e5f57c4c5ccab89" +checksum = "0fe976fb70c78cd64cccfe3a6fc142244e8a77b70959b30faf9d0ac37ee228eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "zerofrom" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "synstructure", ] [[package]] name = "zeroize" -version = "1.8.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" [[package]] name = "zerotrie" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" dependencies = [ "displaydoc", "yoke", @@ -12875,9 +12815,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" dependencies = [ "yoke", "zerofrom", @@ -12886,20 +12826,20 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "zmij" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" [[package]] name = "zstd" diff --git a/cli/golem-cli/command-output-schema/command-output.schema.json b/cli/golem-cli/command-output-schema/command-output.schema.json index a6085fef44..f3f5f2760c 100644 --- a/cli/golem-cli/command-output-schema/command-output.schema.json +++ b/cli/golem-cli/command-output-schema/command-output.schema.json @@ -1244,6 +1244,35 @@ } }, "additionalProperties": false + }, + { + "type": "object", + "required": [ + "type", + "environmentId", + "agentId", + "invocationKey", + "oplogIndex" + ], + "properties": { + "type": { + "const": "RuntimeDerived" + }, + "environmentId": { + "type": "string" + }, + "agentId": { + "$ref": "#/definitions/AgentId" + }, + "invocationKey": { + "type": "string" + }, + "oplogIndex": { + "type": "integer", + "minimum": 0 + } + }, + "additionalProperties": false } ] }, @@ -3518,6 +3547,34 @@ "type": "string", "format": "uuid" }, + "WalletVersionToken": { + "type": "object", + "required": ["walletIdHash", "generation"], + "properties": { + "walletIdHash": { + "type": "array", + "minItems": 32, + "maxItems": 32, + "items": { "type": "integer", "minimum": 0, "maximum": 255 } + }, + "generation": { "type": "integer", "minimum": 0 } + }, + "additionalProperties": false + }, + "PublicInvocationWalletPin": { + "type": "object", + "required": ["walletToken", "scopeCardId"], + "properties": { + "walletToken": { "$ref": "#/definitions/WalletVersionToken" }, + "scopeCardId": { + "oneOf": [ + { "$ref": "#/definitions/CardId" }, + { "type": "null" } + ] + } + }, + "additionalProperties": false + }, "PolymorphicCardPermissionPattern": { "type": "string", "description": "Rendered form of a card permission entry" @@ -3860,7 +3917,17 @@ { "$ref": "#/definitions/PublicOplogEntrySnapshot" }, { "$ref": "#/definitions/PublicOplogEntryOplogProcessorCheckpoint" }, { "$ref": "#/definitions/PublicOplogEntrySetRetryPolicy" }, - { "$ref": "#/definitions/PublicOplogEntryRemoveRetryPolicy" } + { "$ref": "#/definitions/PublicOplogEntryRemoveRetryPolicy" }, + { "$ref": "#/definitions/PublicOplogEntryCardEventQueued" }, + { "$ref": "#/definitions/PublicOplogEntryCardInstalled" }, + { "$ref": "#/definitions/PublicOplogEntryCardInstallFailed" }, + { "$ref": "#/definitions/PublicOplogEntryCardRevoked" }, + { "$ref": "#/definitions/PublicOplogEntryCardExpired" }, + { "$ref": "#/definitions/PublicOplogEntryCardDerived" }, + { "$ref": "#/definitions/PublicOplogEntryCardTransferStarted" }, + { "$ref": "#/definitions/PublicOplogEntryCardTransferred" }, + { "$ref": "#/definitions/PublicOplogEntryCardRevokedCascade" }, + { "$ref": "#/definitions/PublicOplogEntryCardTransferConfirmed" } ] }, "AgentId": { @@ -3953,11 +4020,17 @@ }, "PublicOplogEntryAgentInvocationStarted": { "type": "object", - "required": ["type", "timestamp", "invocation"], + "required": ["type", "timestamp", "invocation", "walletPin"], "properties": { "type": { "const": "AgentInvocationStarted" }, "timestamp": { "type": "string" }, - "invocation": { "$ref": "#/definitions/PublicAgentInvocation" } + "invocation": { "$ref": "#/definitions/PublicAgentInvocation" }, + "walletPin": { + "oneOf": [ + { "$ref": "#/definitions/PublicInvocationWalletPin" }, + { "type": "null" } + ] + } }, "additionalProperties": false }, @@ -4170,6 +4243,129 @@ "properties": { "type": { "const": "RemoveRetryPolicy" }, "timestamp": { "type": "string" }, "name": { "type": "string" } }, "additionalProperties": false }, + "CardHolder": { + "oneOf": [ + { + "type": "object", + "required": ["type", "accountId"], + "properties": { "type": { "const": "Account" }, "accountId": { "type": "string", "format": "uuid" } }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["type", "applicationId"], + "properties": { "type": { "const": "Application" }, "applicationId": { "type": "string", "format": "uuid" } }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["type", "agentId"], + "properties": { "type": { "const": "Agent" }, "agentId": { "$ref": "#/definitions/AgentId" } }, + "additionalProperties": false + } + ] + }, + "PublicQueuedCardEvent": { + "oneOf": [ + { + "type": "object", + "required": ["type", "cardId"], + "properties": { "type": { "const": "Install" }, "cardId": { "$ref": "#/definitions/CardId" } }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["type", "cardId"], + "properties": { "type": { "const": "Revoke" }, "cardId": { "$ref": "#/definitions/CardId" } }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["type", "transferId", "cardId", "targetHolder"], + "properties": { + "type": { "const": "TransferStarted" }, + "transferId": { "type": "string", "format": "uuid" }, + "cardId": { "$ref": "#/definitions/CardId" }, + "targetHolder": { "$ref": "#/definitions/CardHolder" } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["type", "transferId", "cardId"], + "properties": { + "type": { "const": "TransferReceived" }, + "transferId": { "type": "string", "format": "uuid" }, + "cardId": { "$ref": "#/definitions/CardId" } + }, + "additionalProperties": false + } + ] + }, + "CardInstallFailure": { + "type": "string", + "enum": ["cardRevoked", "notFound", "recipientMismatch", "notPermitted"] + }, + "PublicOplogEntryCardEventQueued": { + "type": "object", + "required": ["type", "timestamp", "event"], + "properties": { "type": { "const": "CardEventQueued" }, "timestamp": { "type": "string" }, "event": { "$ref": "#/definitions/PublicQueuedCardEvent" } }, + "additionalProperties": false + }, + "PublicOplogEntryCardInstalled": { + "type": "object", + "required": ["type", "timestamp", "queuedEventIndex", "cardId", "walletGeneration"], + "properties": { "type": { "const": "CardInstalled" }, "timestamp": { "type": "string" }, "queuedEventIndex": { "type": ["integer", "null"], "minimum": 0 }, "cardId": { "$ref": "#/definitions/CardId" }, "walletGeneration": { "type": ["integer", "null"], "minimum": 0 } }, + "additionalProperties": false + }, + "PublicOplogEntryCardInstallFailed": { + "type": "object", + "required": ["type", "timestamp", "queuedEventIndex", "cardId", "reason"], + "properties": { "type": { "const": "CardInstallFailed" }, "timestamp": { "type": "string" }, "queuedEventIndex": { "type": "integer", "minimum": 0 }, "cardId": { "$ref": "#/definitions/CardId" }, "reason": { "$ref": "#/definitions/CardInstallFailure" } }, + "additionalProperties": false + }, + "PublicOplogEntryCardRevoked": { + "type": "object", + "required": ["type", "timestamp", "queuedEventIndex", "cardId", "walletGeneration"], + "properties": { "type": { "const": "CardRevoked" }, "timestamp": { "type": "string" }, "queuedEventIndex": { "type": "integer", "minimum": 0 }, "cardId": { "$ref": "#/definitions/CardId" }, "walletGeneration": { "type": ["integer", "null"], "minimum": 0 } }, + "additionalProperties": false + }, + "PublicOplogEntryCardExpired": { + "type": "object", + "required": ["type", "timestamp", "cardId", "walletGeneration"], + "properties": { "type": { "const": "CardExpired" }, "timestamp": { "type": "string" }, "cardId": { "$ref": "#/definitions/CardId" }, "walletGeneration": { "type": ["integer", "null"], "minimum": 0 } }, + "additionalProperties": false + }, + "PublicOplogEntryCardDerived": { + "type": "object", + "required": ["type", "timestamp", "cardId", "parentIds", "walletGeneration"], + "properties": { "type": { "const": "CardDerived" }, "timestamp": { "type": "string" }, "cardId": { "$ref": "#/definitions/CardId" }, "parentIds": { "type": "array", "items": { "$ref": "#/definitions/CardId" } }, "walletGeneration": { "type": ["integer", "null"], "minimum": 0 } }, + "additionalProperties": false + }, + "PublicOplogEntryCardTransferStarted": { + "type": "object", + "required": ["type", "timestamp", "transferId", "cardId", "targetHolder", "sourceWalletGeneration"], + "properties": { "type": { "const": "CardTransferStarted" }, "timestamp": { "type": "string" }, "transferId": { "type": "string", "format": "uuid" }, "cardId": { "$ref": "#/definitions/CardId" }, "targetHolder": { "$ref": "#/definitions/CardHolder" }, "sourceWalletGeneration": { "type": ["integer", "null"], "minimum": 0 } }, + "additionalProperties": false + }, + "PublicOplogEntryCardTransferred": { + "type": "object", + "required": ["type", "timestamp", "transferId", "sourceCardId", "installedCardId", "targetHolder", "targetWalletGeneration"], + "properties": { "type": { "const": "CardTransferred" }, "timestamp": { "type": "string" }, "transferId": { "type": "string", "format": "uuid" }, "sourceCardId": { "oneOf": [{ "$ref": "#/definitions/CardId" }, { "type": "null" }] }, "installedCardId": { "$ref": "#/definitions/CardId" }, "targetHolder": { "$ref": "#/definitions/CardHolder" }, "targetWalletGeneration": { "type": ["integer", "null"], "minimum": 0 } }, + "additionalProperties": false + }, + "PublicOplogEntryCardRevokedCascade": { + "type": "object", + "required": ["type", "timestamp", "revokedCardIds", "localWalletGeneration"], + "properties": { "type": { "const": "CardRevokedCascade" }, "timestamp": { "type": "string" }, "revokedCardIds": { "type": "array", "items": { "$ref": "#/definitions/CardId" } }, "localWalletGeneration": { "type": ["integer", "null"], "minimum": 0 } }, + "additionalProperties": false + }, + "PublicOplogEntryCardTransferConfirmed": { + "type": "object", + "required": ["type", "timestamp", "transferId", "sourceCardId", "installedCardId", "targetHolder"], + "properties": { "type": { "const": "CardTransferConfirmed" }, "timestamp": { "type": "string" }, "transferId": { "type": "string", "format": "uuid" }, "sourceCardId": { "$ref": "#/definitions/CardId" }, "installedCardId": { "$ref": "#/definitions/CardId" }, "targetHolder": { "$ref": "#/definitions/CardHolder" } }, + "additionalProperties": false + }, "PublicDurableFunctionType": { "oneOf": [ { "type": "object", "required": ["type"], "properties": { "type": { "const": "ReadLocal" } }, "additionalProperties": false }, @@ -6105,6 +6301,20 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": ["kind", "value"], + "properties": { + "kind": { "const": "permission-card" }, + "value": { + "type": "object", + "required": ["spec"], + "properties": { "spec": { "$ref": "#/definitions/PermissionCardSpec" }, "metadata": { "$ref": "#/definitions/MetadataEnvelope" } }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "type": "object", "required": ["kind", "value"], @@ -6298,6 +6508,12 @@ "properties": { "resourceName": { "type": "string" } }, "additionalProperties": false }, + "PermissionCardSpec": { + "type": "object", + "required": ["polymorphic"], + "properties": { "polymorphic": { "type": "boolean" } }, + "additionalProperties": false + }, "MetadataEnvelope": { "type": "object", "properties": { @@ -6477,6 +6693,12 @@ "required": ["kind", "value"], "properties": { "kind": { "const": "quota-token" }, "value": { "$ref": "#/definitions/QuotaTokenValuePayload" } }, "additionalProperties": false + }, + { + "type": "object", + "required": ["kind", "value"], + "properties": { "kind": { "const": "permission-card" }, "value": { "$ref": "#/definitions/PermissionCardValuePayload" } }, + "additionalProperties": false } ] }, @@ -6562,6 +6784,17 @@ }, "additionalProperties": false }, + "PermissionCardValuePayload": { + "type": "object", + "required": ["cardId", "polymorphic"], + "properties": { + "cardId": { "type": "string", "format": "uuid" }, + "parentIds": { "type": "array", "items": { "type": "string", "format": "uuid" } }, + "expiresAt": { "type": "string" }, + "polymorphic": { "type": "boolean" } + }, + "additionalProperties": false + }, "EnvironmentId": { "type": "object", "required": ["uuid"], diff --git a/cli/golem-cli/src/agent_id_display/parse_common.rs b/cli/golem-cli/src/agent_id_display/parse_common.rs index a28e586fdd..fbc9b3c256 100644 --- a/cli/golem-cli/src/agent_id_display/parse_common.rs +++ b/cli/golem-cli/src/agent_id_display/parse_common.rs @@ -17,8 +17,8 @@ use chrono::DateTime; use golem_common::schema::agent::NamedField; use golem_common::schema::canonical::{ binary as canon_binary, datetime as canon_datetime, duration as canon_duration, - path as canon_path, quantity as canon_quantity, quota_token as canon_quota_token, - secret as canon_secret, text as canon_text, url as canon_url, + path as canon_path, permission_card as canon_permission_card, quantity as canon_quantity, + quota_token as canon_quota_token, secret as canon_secret, text as canon_text, url as canon_url, }; use golem_common::schema::graph::SchemaGraph; use golem_common::schema::schema_type::{ @@ -281,6 +281,16 @@ fn parse_cm_value_inner( .map_err(|e| perr(lexer.position(), &format!("invalid quota-token value: {e}")))?; Ok(SchemaValue::QuotaToken(payload)) } + SchemaType::PermissionCard { .. } => { + let s = parse_rich_constructor(lexer, "PermissionCard")?; + let payload = canon_permission_card::from_text(&s).map_err(|e| { + perr( + lexer.position(), + &format!("invalid permission-card value: {e}"), + ) + })?; + Ok(SchemaValue::PermissionCard(payload)) + } SchemaType::Union { spec, .. } => parse_union::(lexer, graph, spec), SchemaType::FixedList { element, length, .. diff --git a/cli/golem-cli/src/agent_id_display/render_moonbit.rs b/cli/golem-cli/src/agent_id_display/render_moonbit.rs index 5cf03e2490..d4966bd4a7 100644 --- a/cli/golem-cli/src/agent_id_display/render_moonbit.rs +++ b/cli/golem-cli/src/agent_id_display/render_moonbit.rs @@ -352,6 +352,7 @@ fn render_type_moonbit_inner( SchemaType::Quantity { .. } => "quantity".to_string(), SchemaType::Secret { .. } => "secret".to_string(), SchemaType::QuotaToken { .. } => "quota-token".to_string(), + SchemaType::PermissionCard { .. } => "permission-card".to_string(), SchemaType::Union { spec, .. } => { let inner = spec .branches diff --git a/cli/golem-cli/src/agent_id_display/render_rust.rs b/cli/golem-cli/src/agent_id_display/render_rust.rs index f5c05e8245..83cea41bd5 100644 --- a/cli/golem-cli/src/agent_id_display/render_rust.rs +++ b/cli/golem-cli/src/agent_id_display/render_rust.rs @@ -367,6 +367,7 @@ fn render_type_rust_inner( SchemaType::Quantity { .. } => "quantity".to_string(), SchemaType::Secret { .. } => "secret".to_string(), SchemaType::QuotaToken { .. } => "quota-token".to_string(), + SchemaType::PermissionCard { .. } => "permission-card".to_string(), SchemaType::Union { spec, .. } => { let inner = spec .branches diff --git a/cli/golem-cli/src/agent_id_display/render_scala.rs b/cli/golem-cli/src/agent_id_display/render_scala.rs index 56980ccb9a..6e32b1e8da 100644 --- a/cli/golem-cli/src/agent_id_display/render_scala.rs +++ b/cli/golem-cli/src/agent_id_display/render_scala.rs @@ -372,6 +372,7 @@ fn render_type_scala_inner( SchemaType::Quantity { .. } => "quantity".to_string(), SchemaType::Secret { .. } => "secret".to_string(), SchemaType::QuotaToken { .. } => "quota-token".to_string(), + SchemaType::PermissionCard { .. } => "permission-card".to_string(), SchemaType::Union { spec, .. } => { let inner = spec .branches diff --git a/cli/golem-cli/src/agent_id_display/render_ts.rs b/cli/golem-cli/src/agent_id_display/render_ts.rs index 74870d524c..4e2fec4c8e 100644 --- a/cli/golem-cli/src/agent_id_display/render_ts.rs +++ b/cli/golem-cli/src/agent_id_display/render_ts.rs @@ -358,6 +358,7 @@ fn render_type_ts_inner( SchemaType::Quantity { .. } => "quantity".to_string(), SchemaType::Secret { .. } => "secret".to_string(), SchemaType::QuotaToken { .. } => "quota-token".to_string(), + SchemaType::PermissionCard { .. } => "permission-card".to_string(), SchemaType::Union { spec, .. } => { let inner = spec .branches diff --git a/cli/golem-cli/src/bridge_gen/moonbit/mod.rs b/cli/golem-cli/src/bridge_gen/moonbit/mod.rs index d44d180c85..f342c25689 100644 --- a/cli/golem-cli/src/bridge_gen/moonbit/mod.rs +++ b/cli/golem-cli/src/bridge_gen/moonbit/mod.rs @@ -2398,6 +2398,7 @@ fn guest_decode_unstructured_binary(value : @model.SchemaValue, allowed : Array[ SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => { bail!( @@ -2549,6 +2550,7 @@ fn guest_decode_unstructured_binary(value : @model.SchemaValue, allowed : Array[ SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => { bail!( @@ -2719,6 +2721,7 @@ fn guest_decode_unstructured_binary(value : @model.SchemaValue, allowed : Array[ SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => bail!( "Cannot emit MoonBit type reference for unsupported schema variant: {resolved:?}" @@ -3067,6 +3070,10 @@ fn emit_schema_type(ty: &SchemaType) -> String { "@model.QuotaToken(@types.QuotaTokenSpec::{{ resource_name: {} }})", mb_opt_str(spec.resource_name.as_deref()) ), + PermissionCard { spec, .. } => format!( + "@model.PermissionCard(@types.PermissionCardSpec::{{ polymorphic: {} }})", + spec.polymorphic + ), Future { inner, .. } => format!("@model.Future({})", mb_opt_type(inner.as_deref())), Stream { inner, .. } => format!("@model.Stream({})", mb_opt_type(inner.as_deref())), }; diff --git a/cli/golem-cli/src/bridge_gen/moonbit/type_name.rs b/cli/golem-cli/src/bridge_gen/moonbit/type_name.rs index a1666e3d4f..6fd7e515da 100644 --- a/cli/golem-cli/src/bridge_gen/moonbit/type_name.rs +++ b/cli/golem-cli/src/bridge_gen/moonbit/type_name.rs @@ -121,6 +121,7 @@ impl TypeName for MoonBitTypeName { | SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => false, } diff --git a/cli/golem-cli/src/bridge_gen/rust/mod.rs b/cli/golem-cli/src/bridge_gen/rust/mod.rs index 8f25b79ef1..b313892f9c 100644 --- a/cli/golem-cli/src/bridge_gen/rust/mod.rs +++ b/cli/golem-cli/src/bridge_gen/rust/mod.rs @@ -1171,7 +1171,7 @@ impl RustBridgeGenerator { let method_parameters: crate::__golem_bridge_runtime::schema::SchemaValue = #params_schema_value; let method_parameters = golem_rust::encode_schema_value(&method_parameters) .map_err(|__e| crate::__golem_bridge_runtime::ClientError::SchemaEncodeFailed { message: __e.to_string() })?; - self.wasm_rpc.invoke(#name_lit, method_parameters) + self.wasm_rpc.invoke(#name_lit, method_parameters, None) .map_err(|__e| crate::__golem_bridge_runtime::ClientError::RpcFailed { message: format!("{__e:?}") }) } }); @@ -1182,7 +1182,7 @@ impl RustBridgeGenerator { let method_parameters: crate::__golem_bridge_runtime::schema::SchemaValue = #params_schema_value; let method_parameters = golem_rust::encode_schema_value(&method_parameters) .map_err(|__e| crate::__golem_bridge_runtime::ClientError::SchemaEncodeFailed { message: __e.to_string() })?; - self.wasm_rpc.invoke(#name_lit, method_parameters) + self.wasm_rpc.invoke(#name_lit, method_parameters, None) .map(|_| ()) .map_err(|__e| crate::__golem_bridge_runtime::ClientError::RpcFailed { message: format!("{__e:?}") }) } @@ -1208,7 +1208,7 @@ impl RustBridgeGenerator { let method_parameters: crate::__golem_bridge_runtime::schema::SchemaValue = #params_schema_value; let method_parameters = golem_rust::encode_schema_value(&method_parameters) .map_err(|__e| crate::__golem_bridge_runtime::ClientError::SchemaEncodeFailed { message: __e.to_string() })?; - Ok(self.wasm_rpc.schedule_invocation(#scheduled_time_param, #name_lit, method_parameters).metadata) + Ok(self.wasm_rpc.schedule_invocation(#scheduled_time_param, #name_lit, method_parameters, None).metadata) } }); } @@ -1218,7 +1218,7 @@ impl RustBridgeGenerator { let method_parameters: crate::__golem_bridge_runtime::schema::SchemaValue = #params_schema_value; let method_parameters = golem_rust::encode_schema_value(&method_parameters) .map_err(|__e| crate::__golem_bridge_runtime::ClientError::SchemaEncodeFailed { message: __e.to_string() })?; - self.wasm_rpc.schedule_invocation(#scheduled_time_param, #name_lit, method_parameters); + self.wasm_rpc.schedule_invocation(#scheduled_time_param, #name_lit, method_parameters, None); Ok(()) } }) @@ -1243,7 +1243,7 @@ impl RustBridgeGenerator { let method_parameters: crate::__golem_bridge_runtime::schema::SchemaValue = #params_schema_value; let method_parameters = golem_rust::encode_schema_value(&method_parameters) .map_err(|__e| crate::__golem_bridge_runtime::ClientError::SchemaEncodeFailed { message: __e.to_string() })?; - Ok(self.wasm_rpc.schedule_cancelable_invocation(#scheduled_time_param, #name_lit, method_parameters)) + Ok(self.wasm_rpc.schedule_cancelable_invocation(#scheduled_time_param, #name_lit, method_parameters, None)) } }); } @@ -1253,7 +1253,7 @@ impl RustBridgeGenerator { let method_parameters: crate::__golem_bridge_runtime::schema::SchemaValue = #params_schema_value; let method_parameters = golem_rust::encode_schema_value(&method_parameters) .map_err(|__e| crate::__golem_bridge_runtime::ClientError::SchemaEncodeFailed { message: __e.to_string() })?; - Ok(self.wasm_rpc.schedule_cancelable_invocation(#scheduled_time_param, #name_lit, method_parameters).cancellation_token) + Ok(self.wasm_rpc.schedule_cancelable_invocation(#scheduled_time_param, #name_lit, method_parameters, None).cancellation_token) } }) } @@ -1280,7 +1280,7 @@ impl RustBridgeGenerator { let method_parameters: crate::__golem_bridge_runtime::schema::SchemaValue = #params_schema_value; let method_parameters = golem_rust::encode_schema_value(&method_parameters) .map_err(|__e| crate::__golem_bridge_runtime::ClientError::SchemaEncodeFailed { message: __e.to_string() })?; - let invocation = self.wasm_rpc.async_invoke_and_await(#name_lit, method_parameters); + let invocation = self.wasm_rpc.async_invoke_and_await(#name_lit, method_parameters, None); let metadata = invocation.metadata; let response = golem_rust::agentic::await_invoke_schema_value_result(invocation.future).await .map_err(|__e| crate::__golem_bridge_runtime::ClientError::RpcFailed { message: format!("{__e:?}") })?; @@ -1303,7 +1303,7 @@ impl RustBridgeGenerator { let method_parameters: crate::__golem_bridge_runtime::schema::SchemaValue = #params_schema_value; let method_parameters = golem_rust::encode_schema_value(&method_parameters) .map_err(|__e| crate::__golem_bridge_runtime::ClientError::SchemaEncodeFailed { message: __e.to_string() })?; - let rpc_result_future = self.wasm_rpc.async_invoke_and_await(#name_lit, method_parameters).future; + let rpc_result_future = self.wasm_rpc.async_invoke_and_await(#name_lit, method_parameters, None).future; let response = golem_rust::agentic::await_invoke_schema_value_result(rpc_result_future).await .map_err(|__e| crate::__golem_bridge_runtime::ClientError::RpcFailed { message: format!("{__e:?}") })?; match response { @@ -1323,7 +1323,7 @@ impl RustBridgeGenerator { let method_parameters: crate::__golem_bridge_runtime::schema::SchemaValue = #params_schema_value; let method_parameters = golem_rust::encode_schema_value(&method_parameters) .map_err(|__e| crate::__golem_bridge_runtime::ClientError::SchemaEncodeFailed { message: __e.to_string() })?; - let invocation = self.wasm_rpc.async_invoke_and_await(#name_lit, method_parameters); + let invocation = self.wasm_rpc.async_invoke_and_await(#name_lit, method_parameters, None); let metadata = invocation.metadata; let _response = golem_rust::agentic::await_invoke_schema_value_result(invocation.future).await .map_err(|__e| crate::__golem_bridge_runtime::ClientError::RpcFailed { message: format!("{__e:?}") })?; @@ -1335,7 +1335,7 @@ impl RustBridgeGenerator { let method_parameters: crate::__golem_bridge_runtime::schema::SchemaValue = #params_schema_value; let method_parameters = golem_rust::encode_schema_value(&method_parameters) .map_err(|__e| crate::__golem_bridge_runtime::ClientError::SchemaEncodeFailed { message: __e.to_string() })?; - let rpc_result_future = self.wasm_rpc.async_invoke_and_await(#name_lit, method_parameters).future; + let rpc_result_future = self.wasm_rpc.async_invoke_and_await(#name_lit, method_parameters, None).future; let _response = golem_rust::agentic::await_invoke_schema_value_result(rpc_result_future).await .map_err(|__e| crate::__golem_bridge_runtime::ClientError::RpcFailed { message: format!("{__e:?}") })?; Ok(Some(())) @@ -2375,6 +2375,7 @@ impl RustBridgeGenerator { SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => { bail!("SchemaType variant has no Rust bridge encoding yet; type = {typ:?}") @@ -2626,6 +2627,7 @@ impl RustBridgeGenerator { SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => { bail!("SchemaType variant has no Rust bridge decoding yet; type = {typ:?}") @@ -2741,6 +2743,7 @@ impl RustBridgeGenerator { SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => Err(anyhow!( "Cannot emit Rust type reference for unsupported schema variant: {typ:?}" diff --git a/cli/golem-cli/src/bridge_gen/rust/type_name.rs b/cli/golem-cli/src/bridge_gen/rust/type_name.rs index fe85724451..16eef4c769 100644 --- a/cli/golem-cli/src/bridge_gen/rust/type_name.rs +++ b/cli/golem-cli/src/bridge_gen/rust/type_name.rs @@ -126,6 +126,7 @@ impl TypeName for RustTypeName { | SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => false, } diff --git a/cli/golem-cli/src/bridge_gen/scala/mod.rs b/cli/golem-cli/src/bridge_gen/scala/mod.rs index b0606ca258..cfe57646a8 100644 --- a/cli/golem-cli/src/bridge_gen/scala/mod.rs +++ b/cli/golem-cli/src/bridge_gen/scala/mod.rs @@ -2676,6 +2676,7 @@ impl ScalaBridgeGenerator { SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => { bail!("Cannot encode unsupported schema variant in the Scala bridge: {resolved:?}") @@ -2813,6 +2814,7 @@ impl ScalaBridgeGenerator { SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => { bail!("Cannot decode unsupported schema variant in the Scala bridge: {resolved:?}") @@ -3011,6 +3013,7 @@ impl ScalaBridgeGenerator { SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => bail!( "Cannot emit Scala type reference for unsupported schema variant: {resolved:?}" diff --git a/cli/golem-cli/src/bridge_gen/scala/type_name.rs b/cli/golem-cli/src/bridge_gen/scala/type_name.rs index 01d010faf1..97e1b0c003 100644 --- a/cli/golem-cli/src/bridge_gen/scala/type_name.rs +++ b/cli/golem-cli/src/bridge_gen/scala/type_name.rs @@ -163,6 +163,7 @@ impl TypeName for ScalaTypeName { | SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => false, } diff --git a/cli/golem-cli/src/bridge_gen/type_naming/mod.rs b/cli/golem-cli/src/bridge_gen/type_naming/mod.rs index 1c38a7b405..eb51cda4b8 100644 --- a/cli/golem-cli/src/bridge_gen/type_naming/mod.rs +++ b/cli/golem-cli/src/bridge_gen/type_naming/mod.rs @@ -469,7 +469,8 @@ impl TypeNaming { | SchemaType::Duration { .. } | SchemaType::Quantity { .. } | SchemaType::Secret { .. } - | SchemaType::QuotaToken { .. } => { + | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } => { // NOP } // `Ref` was already unwrapped by `resolve_for_walk_owned`; diff --git a/cli/golem-cli/src/bridge_gen/type_naming/schema_type_ext.rs b/cli/golem-cli/src/bridge_gen/type_naming/schema_type_ext.rs index 4c8d44d4b8..db6e71fb1f 100644 --- a/cli/golem-cli/src/bridge_gen/type_naming/schema_type_ext.rs +++ b/cli/golem-cli/src/bridge_gen/type_naming/schema_type_ext.rs @@ -69,7 +69,8 @@ fn is_path_leaf_type(typ: &SchemaType) -> bool { | SchemaType::Duration { .. } | SchemaType::Quantity { .. } | SchemaType::Secret { .. } - | SchemaType::QuotaToken { .. } => true, + | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } => true, } } @@ -126,6 +127,7 @@ fn can_be_named(typ: &SchemaType) -> bool { | SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => false, } diff --git a/cli/golem-cli/src/bridge_gen/typescript/mod.rs b/cli/golem-cli/src/bridge_gen/typescript/mod.rs index a8a67a42cc..37f1f25a6d 100644 --- a/cli/golem-cli/src/bridge_gen/typescript/mod.rs +++ b/cli/golem-cli/src/bridge_gen/typescript/mod.rs @@ -2213,6 +2213,7 @@ impl TypeScriptBridgeGenerator { SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => anyhow::bail!( "SchemaType variant has no TypeScript bridge decoding yet; type = {typ:?}" @@ -2451,6 +2452,7 @@ impl TypeScriptBridgeGenerator { SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => { anyhow::bail!( @@ -2609,6 +2611,7 @@ impl TypeScriptBridgeGenerator { SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => anyhow::bail!( "SchemaType variant has no TypeScript bridge encoding yet; type = {typ:?}" @@ -2817,6 +2820,7 @@ impl TypeScriptBridgeGenerator { SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => { anyhow::bail!( @@ -3099,6 +3103,7 @@ impl TypeScriptBridgeGenerator { SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => Err(anyhow!( "Cannot emit TypeScript type reference for unsupported schema variant: {typ:?}" @@ -3257,6 +3262,7 @@ impl TypeScriptBridgeGenerator { SchemaType::Quantity { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => Err(anyhow!( "Cannot emit TypeScript type definition for unsupported schema variant: {typ:?}" diff --git a/cli/golem-cli/src/bridge_gen/typescript/type_name.rs b/cli/golem-cli/src/bridge_gen/typescript/type_name.rs index 5d7fa2d65f..320b26d76d 100644 --- a/cli/golem-cli/src/bridge_gen/typescript/type_name.rs +++ b/cli/golem-cli/src/bridge_gen/typescript/type_name.rs @@ -118,6 +118,7 @@ impl TypeName for TypeScriptTypeName { | SchemaType::Union { .. } | SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } | SchemaType::Future { .. } | SchemaType::Stream { .. } => false, } diff --git a/cli/golem-cli/src/model/cli_output.rs b/cli/golem-cli/src/model/cli_output.rs index 637af07f0f..1dd15c8b8d 100644 --- a/cli/golem-cli/src/model/cli_output.rs +++ b/cli/golem-cli/src/model/cli_output.rs @@ -258,7 +258,9 @@ mod tests { }; use crate::model::masking::MaskingConfig; use crate::model::text::diff::DeployPlanView; - use golem_common::model::card::{CardId, PolymorphicCard}; + use golem_common::model::card::{ + CardId, PolymorphicCard, PublicInvocationWalletPin, WalletVersionToken, + }; use proptest::prelude::*; use quote::ToTokens; use serde_json::{Value, json}; @@ -1893,6 +1895,9 @@ mod tests { use golem_common::base_model::retry_policy::{ ApiImmediatePolicy, ApiPredicate, ApiPredicateTrue, ApiRetryPolicy, }; + use golem_common::model::card::{ + AccountCardHolder, AgentCardHolder, ApplicationCardHolder, CardHolder, CardId, + }; use golem_common::model::component::{ComponentId, ComponentRevision, PluginPriority}; use golem_common::model::environment::EnvironmentId; use golem_common::model::environment_plugin_grant::EnvironmentPluginGrantId; @@ -1920,6 +1925,10 @@ mod tests { } } + fn card_id(value: &str) -> CardId { + CardId(Uuid::parse_str(value).unwrap()) + } + fn plugin(priority: i32) -> PluginInstallationDescription { PluginInstallationDescription { environment_plugin_grant_id: EnvironmentPluginGrantId::new(), @@ -2071,6 +2080,13 @@ mod tests { PublicOplogEntry::AgentInvocationStarted(AgentInvocationStartedParams { timestamp: timestamp(), invocation: method_invocation(), + wallet_pin: Some(PublicInvocationWalletPin { + wallet_token: WalletVersionToken { + wallet_id_hash: [0x42; 32], + generation: 7, + }, + scope_card_id: Some(CardId::new()), + }), }), PublicOplogEntry::AgentInvocationFinished(AgentInvocationFinishedParams { timestamp: timestamp(), @@ -2271,6 +2287,104 @@ mod tests { timestamp: timestamp(), name: "generated-retry".to_string(), }), + PublicOplogEntry::CardEventQueued(CardEventQueuedParams { + timestamp: timestamp(), + event: PublicQueuedCardEvent::Install(PublicQueuedCardEventCard { + card_id: card_id("43a5c8d4-f05e-4e23-b982-f4d413e181cb"), + }), + }), + PublicOplogEntry::CardEventQueued(CardEventQueuedParams { + timestamp: timestamp(), + event: PublicQueuedCardEvent::Revoke(PublicQueuedCardEventCard { + card_id: card_id("43a5c8d4-f05e-4e23-b982-f4d413e181cb"), + }), + }), + PublicOplogEntry::CardEventQueued(CardEventQueuedParams { + timestamp: timestamp(), + event: PublicQueuedCardEvent::TransferStarted(PublicQueuedCardEventTransfer { + transfer_id: Uuid::parse_str("53a5c8d4-f05e-4e23-b982-f4d413e181cb").unwrap(), + card_id: card_id("43a5c8d4-f05e-4e23-b982-f4d413e181cb"), + target_holder: CardHolder::Agent(AgentCardHolder { + agent_id: agent_id("card-target"), + }), + }), + }), + PublicOplogEntry::CardEventQueued(CardEventQueuedParams { + timestamp: timestamp(), + event: PublicQueuedCardEvent::TransferReceived( + PublicQueuedCardEventTransferReceived { + transfer_id: Uuid::parse_str("63a5c8d4-f05e-4e23-b982-f4d413e181cb") + .unwrap(), + card_id: card_id("43a5c8d4-f05e-4e23-b982-f4d413e181cb"), + }, + ), + }), + PublicOplogEntry::CardInstalled(CardInstalledParams { + timestamp: timestamp(), + queued_event_index: Some(OplogIndex::from_u64(22)), + card_id: card_id("43a5c8d4-f05e-4e23-b982-f4d413e181cb"), + wallet_generation: Some(1), + }), + PublicOplogEntry::CardInstallFailed(CardInstallFailedParams { + timestamp: timestamp(), + queued_event_index: OplogIndex::from_u64(23), + card_id: card_id("63a5c8d4-f05e-4e23-b982-f4d413e181cb"), + reason: CardInstallFailure::RecipientMismatch, + }), + PublicOplogEntry::CardRevoked(CardRevokedParams { + timestamp: timestamp(), + queued_event_index: OplogIndex::from_u64(24), + card_id: card_id("43a5c8d4-f05e-4e23-b982-f4d413e181cb"), + wallet_generation: Some(2), + }), + PublicOplogEntry::CardExpired(CardExpiredParams { + timestamp: timestamp(), + card_id: card_id("63a5c8d4-f05e-4e23-b982-f4d413e181cb"), + wallet_generation: Some(3), + }), + PublicOplogEntry::CardDerived(CardDerivedParams { + timestamp: timestamp(), + card_id: card_id("73a5c8d4-f05e-4e23-b982-f4d413e181cb"), + parent_ids: vec![card_id("43a5c8d4-f05e-4e23-b982-f4d413e181cb")], + wallet_generation: Some(4), + }), + PublicOplogEntry::CardTransferStarted(CardTransferStartedParams { + timestamp: timestamp(), + transfer_id: Uuid::parse_str("53a5c8d4-f05e-4e23-b982-f4d413e181cb").unwrap(), + card_id: card_id("73a5c8d4-f05e-4e23-b982-f4d413e181cb"), + target_holder: CardHolder::Account(AccountCardHolder { + account_id: Uuid::parse_str("83a5c8d4-f05e-4e23-b982-f4d413e181cb").unwrap(), + }), + source_wallet_generation: Some(4), + }), + PublicOplogEntry::CardTransferred(CardTransferredParams { + timestamp: timestamp(), + transfer_id: Uuid::parse_str("53a5c8d4-f05e-4e23-b982-f4d413e181cb").unwrap(), + source_card_id: Some(card_id("63a5c8d4-f05e-4e23-b982-f4d413e181cb")), + installed_card_id: card_id("73a5c8d4-f05e-4e23-b982-f4d413e181cb"), + target_holder: CardHolder::Application(ApplicationCardHolder { + application_id: Uuid::parse_str("93a5c8d4-f05e-4e23-b982-f4d413e181cb") + .unwrap(), + }), + target_wallet_generation: Some(7), + }), + PublicOplogEntry::CardRevokedCascade(CardRevokedCascadeParams { + timestamp: timestamp(), + revoked_card_ids: vec![ + card_id("43a5c8d4-f05e-4e23-b982-f4d413e181cb"), + card_id("73a5c8d4-f05e-4e23-b982-f4d413e181cb"), + ], + local_wallet_generation: Some(8), + }), + PublicOplogEntry::CardTransferConfirmed(CardTransferConfirmedParams { + timestamp: timestamp(), + transfer_id: Uuid::parse_str("53a5c8d4-f05e-4e23-b982-f4d413e181cb").unwrap(), + source_card_id: card_id("63a5c8d4-f05e-4e23-b982-f4d413e181cb"), + installed_card_id: card_id("73a5c8d4-f05e-4e23-b982-f4d413e181cb"), + target_holder: CardHolder::Agent(AgentCardHolder { + agent_id: agent_id("card-target"), + }), + }), PublicOplogEntry::AgentInvocationFinished(AgentInvocationFinishedParams { timestamp: timestamp(), result: PublicAgentInvocationResult::SaveSnapshot(SaveSnapshotResultParameters { @@ -3655,6 +3769,30 @@ mod tests { ) } ), + ( + arb_uuid(), + arb_uuid(), + arb_small_string(), + arb_small_string(), + arb_small_u64(), + ) + .prop_map( + |(environment_id, component_id, agent_id, invocation_key, oplog_index)| { + golem_client::model::CardManagedBy::RuntimeDerived( + golem_client::model::CardManagedByRuntimeDerived { + environment_id, + agent_id: golem_common::model::AgentId { + component_id: golem_common::model::component::ComponentId( + component_id, + ), + agent_id, + }, + invocation_key, + oplog_index, + }, + ) + }, + ), ] .boxed() } diff --git a/cli/golem-cli/src/model/text/card.rs b/cli/golem-cli/src/model/text/card.rs index 987098867c..0ffc9987cc 100644 --- a/cli/golem-cli/src/model/text/card.rs +++ b/cli/golem-cli/src/model/text/card.rs @@ -165,6 +165,13 @@ fn card_managed_by(card: &StoredCard) -> String { "agent initial {} rev {} {}", managed_by.component_id, managed_by.component_revision, managed_by.agent_type ), + Some(CardManagedBy::RuntimeDerived(managed_by)) => format!( + "runtime derived {} {} invocation {} oplog {}", + managed_by.environment_id, + managed_by.agent_id, + managed_by.invocation_key, + managed_by.oplog_index + ), None => "(none)".to_string(), }, StoredCard::Polymorphic(_) => "(not stored on polymorphic cards)".to_string(), diff --git a/cli/golem-cli/src/model/text/worker.rs b/cli/golem-cli/src/model/text/worker.rs index ef7fab33ea..2d742d25e5 100644 --- a/cli/golem-cli/src/model/text/worker.rs +++ b/cli/golem-cli/src/model/text/worker.rs @@ -597,6 +597,22 @@ impl TextOutput for PublicOplogEntry { ¶ms.timestamp, ¶ms.invocation, ); + if let Some(wallet_pin) = ¶ms.wallet_pin { + let wallet_id_hash = wallet_pin + .wallet_token + .wallet_id_hash + .iter() + .map(|byte| format!("{byte:02x}")) + .collect::(); + logln(format!("{pad}wallet id hash: {wallet_id_hash}")); + logln(format!( + "{pad}wallet generation: {}", + wallet_pin.wallet_token.generation + )); + if let Some(scope_card_id) = wallet_pin.scope_card_id { + logln(format!("{pad}scope card: {scope_card_id}")); + } + } } PublicOplogEntry::AgentInvocationFinished(params) => { let variant_label = match ¶ms.result { @@ -1085,6 +1101,9 @@ impl TextOutput for PublicOplogEntry { "{pad}card id: {}", format_id(¶ms.card_id) )); + if let Some(generation) = params.wallet_generation { + logln(format!("{pad}wallet generation: {generation}")); + } } PublicOplogEntry::HostStreamFrame(params) => { logln(format_message_highlight("HOST STREAM FRAME")); @@ -1115,6 +1134,9 @@ impl TextOutput for PublicOplogEntry { "{pad}card id: {}", format_id(¶ms.card_id) )); + if let Some(generation) = params.wallet_generation { + logln(format!("{pad}wallet generation: {generation}")); + } } PublicOplogEntry::CardEventQueued(params) => { logln(format_message_highlight("CARD EVENT QUEUED")); @@ -1141,6 +1163,9 @@ impl TextOutput for PublicOplogEntry { "{pad}card id: {}", format_id(¶ms.card_id) )); + if let Some(generation) = params.wallet_generation { + logln(format!("{pad}wallet generation: {generation}")); + } } PublicOplogEntry::CardInstallFailed(params) => { logln(format_message_highlight("CARD INSTALL FAILED")); @@ -1161,6 +1186,111 @@ impl TextOutput for PublicOplogEntry { format_id(&format!("{:?}", params.reason)) )); } + PublicOplogEntry::CardDerived(params) => { + logln(format_message_highlight("CARD DERIVED")); + logln(format!( + "{pad}at: {}", + format_id(¶ms.timestamp) + )); + logln(format!( + "{pad}card id: {}", + format_id(¶ms.card_id) + )); + logln(format!( + "{pad}parent ids: {}", + format_id(&format!("{:?}", params.parent_ids)) + )); + if let Some(generation) = params.wallet_generation { + logln(format!("{pad}wallet generation: {generation}")); + } + } + PublicOplogEntry::CardTransferStarted(params) => { + logln(format_message_highlight("CARD TRANSFER STARTED")); + logln(format!( + "{pad}at: {}", + format_id(¶ms.timestamp) + )); + logln(format!( + "{pad}transfer id: {}", + format_id(¶ms.transfer_id) + )); + logln(format!( + "{pad}card id: {}", + format_id(¶ms.card_id) + )); + logln(format!( + "{pad}target holder: {}", + format_id(&format!("{:?}", params.target_holder)) + )); + if let Some(generation) = params.source_wallet_generation { + logln(format!("{pad}source generation: {generation}")); + } + } + PublicOplogEntry::CardTransferred(params) => { + logln(format_message_highlight("CARD TRANSFER ADMITTED")); + logln(format!( + "{pad}at: {}", + format_id(¶ms.timestamp) + )); + logln(format!( + "{pad}transfer id: {}", + format_id(¶ms.transfer_id) + )); + if let Some(source_card_id) = params.source_card_id { + logln(format!( + "{pad}source card id: {}", + format_id(&source_card_id) + )); + } + logln(format!( + "{pad}installed card id: {}", + format_id(¶ms.installed_card_id) + )); + logln(format!( + "{pad}target holder: {}", + format_id(&format!("{:?}", params.target_holder)) + )); + if let Some(generation) = params.target_wallet_generation { + logln(format!("{pad}target generation: {generation}")); + } + } + PublicOplogEntry::CardRevokedCascade(params) => { + logln(format_message_highlight("CARD REVOKED CASCADE")); + logln(format!( + "{pad}at: {}", + format_id(¶ms.timestamp) + )); + logln(format!( + "{pad}revoked card ids: {}", + format_id(&format!("{:?}", params.revoked_card_ids)) + )); + if let Some(generation) = params.local_wallet_generation { + logln(format!("{pad}local generation: {generation}")); + } + } + PublicOplogEntry::CardTransferConfirmed(params) => { + logln(format_message_highlight("CARD TRANSFER CONFIRMED")); + logln(format!( + "{pad}at: {}", + format_id(¶ms.timestamp) + )); + logln(format!( + "{pad}transfer id: {}", + format_id(¶ms.transfer_id) + )); + logln(format!( + "{pad}source card id: {}", + format_id(¶ms.source_card_id) + )); + logln(format!( + "{pad}installed card id: {}", + format_id(¶ms.installed_card_id) + )); + logln(format!( + "{pad}target holder: {}", + format_id(&format!("{:?}", params.target_holder)) + )); + } } } } diff --git a/cli/golem-cli/tests/app/cards.rs b/cli/golem-cli/tests/app/cards.rs new file mode 100644 index 0000000000..61dfc963f7 --- /dev/null +++ b/cli/golem-cli/tests/app/cards.rs @@ -0,0 +1,130 @@ +use crate::Tracing; +use crate::app::{TestContext, cmd, flag}; +use golem_cli::model::text::card::{CardGetView, CardListView, CardRevokeResult}; +use golem_client::model::StoredCard; +use test_r::{inherit_test_dep, test, timeout}; +use uuid::Uuid; + +inherit_test_dep!(Tracing); + +fn card_id(card: &StoredCard) -> Uuid { + match card { + StoredCard::Concrete(card) => card.card_id, + StoredCard::Polymorphic(card) => card.card_id, + } +} + +#[test] +#[timeout("10m")] +async fn card_management_works_against_a_live_server(_tracing: &Tracing) { + let mut ctx = TestContext::new(); + let app_name = "card-management"; + let agent_name = "CounterAgent(\"cards\")"; + + ctx.start_server().await; + let output = ctx + .cli([flag::YES, cmd::NEW, app_name, flag::TEMPLATE, "rust"]) + .await; + assert!(output.success_or_dump()); + ctx.cd(app_name); + let output = ctx.cli([cmd::DEPLOY, flag::YES]).await; + assert!(output.success_or_dump()); + let output = ctx + .cli([flag::YES, cmd::AGENT, cmd::INVOKE, agent_name, "increment"]) + .await; + assert!(output.success_or_dump()); + + let output = ctx + .cli([ + "card", + cmd::LIST, + "--include-agent-initials", + flag::FORMAT, + "json", + ]) + .await; + assert!(output.success_or_dump()); + let account_cards = output + .stdout_json::() + .into_iter() + .next() + .expect("card list produced no JSON output"); + assert_eq!(account_cards.cards.len(), 1); + let initial_card_id = card_id(&account_cards.cards[0]); + + let output = ctx + .cli([ + "card", + cmd::LIST, + "--agent", + agent_name, + flag::FORMAT, + "json", + ]) + .await; + assert!(output.success_or_dump()); + let wallet = output + .stdout_json::() + .into_iter() + .next() + .expect("agent wallet list produced no JSON output"); + assert!( + wallet + .cards + .iter() + .any(|card| card_id(card) == initial_card_id) + ); + + let initial_card_id_string = initial_card_id.to_string(); + let output = ctx + .cli([ + "card", + cmd::GET, + &initial_card_id_string, + flag::FORMAT, + "json", + ]) + .await; + assert!(output.success_or_dump()); + let card = output + .stdout_json::() + .into_iter() + .next() + .expect("card get produced no JSON output"); + assert_eq!(card_id(&card.0), initial_card_id); + + let output = ctx + .cli([ + flag::YES, + "card", + "revoke", + &initial_card_id_string, + flag::FORMAT, + "json", + ]) + .await; + assert!(output.success_or_dump()); + let revoked = output + .stdout_json::() + .into_iter() + .next() + .expect("card revoke produced no JSON output"); + assert_eq!(revoked.revoked_card_ids, vec![initial_card_id]); + + let output = ctx + .cli([ + "card", + cmd::LIST, + "--include-agent-initials", + flag::FORMAT, + "json", + ]) + .await; + assert!(output.success_or_dump()); + let account_cards = output + .stdout_json::() + .into_iter() + .next() + .expect("card list after revoke produced no JSON output"); + assert!(account_cards.cards.is_empty()); +} diff --git a/cli/golem-cli/tests/app/mod.rs b/cli/golem-cli/tests/app/mod.rs index 616c5a1976..d684b316d9 100644 --- a/cli/golem-cli/tests/app/mod.rs +++ b/cli/golem-cli/tests/app/mod.rs @@ -19,6 +19,7 @@ mod agents; mod app; mod build_and_deploy_all; +mod cards; mod directory_source_ifs; mod plugins; diff --git a/cli/golem-cli/tests/bridge_gen/moonbit.rs b/cli/golem-cli/tests/bridge_gen/moonbit.rs index b5f8524dec..d408162dee 100644 --- a/cli/golem-cli/tests/bridge_gen/moonbit.rs +++ b/cli/golem-cli/tests/bridge_gen/moonbit.rs @@ -33,8 +33,9 @@ use golem_common::model::agent::{AgentConfigSource, AgentMode}; use golem_common::schema::agent::AgentConfigDeclarationSchema; use golem_common::schema::schema_type::{ BinaryRestrictions, DiscriminatorRule, FieldDiscriminator, NumericBound, NumericRestrictions, - PathDirection, PathKind, PathSpec, QuantitySpec, QuantityValue, QuotaTokenSpec, SecretSpec, - TextRestrictions, UnionBranch, UnionSpec, UrlRestrictions, VariantCaseType, + PathDirection, PathKind, PathSpec, PermissionCardSpec, QuantitySpec, QuantityValue, + QuotaTokenSpec, SecretSpec, TextRestrictions, UnionBranch, UnionSpec, UrlRestrictions, + VariantCaseType, }; use golem_common::schema::tool::{ CommandBody, CommandIndex, CommandNode, CommandTree, Doc, ErrorCase, ErrorKind, Formatter, @@ -1015,6 +1016,10 @@ fn schema_graph_literal_moon_checks_as_sdk_model() { resource_name: Some("cpu".into()), }), ), + named_field( + "permission-card", + SchemaType::permission_card(PermissionCardSpec { polymorphic: true }), + ), named_field("future", SchemaType::future(Some(SchemaType::u32()))), named_field("stream", SchemaType::stream(None)), ]), diff --git a/cli/golem-cli/wit/deps/golem-1.x/golem-host.wit b/cli/golem-cli/wit/deps/golem-1.x/golem-host.wit index ac94d44384..296b14e498 100644 --- a/cli/golem-cli/wit/deps/golem-1.x/golem-host.wit +++ b/cli/golem-cli/wit/deps/golem-1.x/golem-host.wit @@ -3,7 +3,7 @@ package golem:api@1.5.0; /// The Golem host API provides low level access to Golem specific features such as promises and control over /// the durability and transactional guarantees the executor provides. interface host { - use golem:core/types@2.0.0.{component-id, card-id, uuid, agent-id, promise-id, oplog-index}; + use golem:core/types@2.0.0.{component-id, uuid, agent-id, promise-id, oplog-index}; /// Represents a Golem component's version type component-revision = u64; @@ -186,17 +186,6 @@ interface host { get: async func() -> list; } - /// Plain-data handle to a permission card visible to the guest. - record card { - card-id: card-id, - } - - enum card-install-error { - revoked, - not-found, - not-permitted, - } - /// Create a new promise create-promise: func() -> promise-id; @@ -257,15 +246,6 @@ interface host { /// to introduce idempotence. generate-idempotency-key: func() -> uuid; - /// Returns one permission card currently installed in this agent's wallet, if any. - self-card: func() -> option; - - /// Derives a card handle from an installed card. This minimal test-facing form keeps the card as plain data. - derive-card: func(card: card) -> result; - - /// Installs a card into this agent's own wallet. - install-card: func(card: card) -> result<_, card-install-error>; - /// Initiates an update attempt for the given agent. The function returns immediately once the request has been processed, /// not waiting for the agent to get updated. update-agent: func(agent-id: agent-id, target-revision: component-revision, mode: update-mode); diff --git a/cli/golem-cli/wit/deps/golem-agent/host.wit b/cli/golem-cli/wit/deps/golem-agent/host.wit index 345fa12b02..b10c052e8b 100644 --- a/cli/golem-cli/wit/deps/golem-agent/host.wit +++ b/cli/golem-cli/wit/deps/golem-agent/host.wit @@ -1,7 +1,7 @@ package golem:agent@2.0.0; interface host { - use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value}; + use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value, permission-card}; use wasi:clocks/system-clock@0.3.0.{instant as datetime}; use common.{agent-error, agent-type, registered-agent-type, typed-agent-config-value}; @@ -90,25 +90,25 @@ interface host { /// /// `input` encodes the method's parameter list. The returned result is /// `none` for a `unit` output and `some(value)` for a `single` output. - invoke-and-await: func(method-name: string, input: schema-value-tree) -> result; + invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Triggers the invocation of a remote method with the given parameters, /// and returns its final identity immediately. - invoke: func(method-name: string, input: schema-value-tree) -> result; + invoke: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Invokes a remote method with the given parameters, and returns a `future-invoke-result` value which can /// be polled for the result together with the final invocation identity. /// /// With this function it is possible to call multiple (different) agents simultaneously. - async-invoke-and-await: func(method-name: string, input: schema-value-tree) -> async-invocation-with-metadata; + async-invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> async-invocation-with-metadata; /// Schedules an invocation for later and returns its final identity. - schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> scheduled-invocation-receipt; + schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> scheduled-invocation-receipt; /// Schedules an invocation for later and returns its final identity and /// cancellation capability. Call cancel on the returned resource to /// cancel the invocation before the scheduled time. - schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> cancelable-scheduled-invocation-receipt; + schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> cancelable-scheduled-invocation-receipt; } /// Represents an asynchronous invocation result diff --git a/cli/golem-cli/wit/deps/golem-core-v2/golem-core-v2.wit b/cli/golem-cli/wit/deps/golem-core-v2/golem-core-v2.wit index bb7dda191e..a59e6e4ede 100644 --- a/cli/golem-cli/wit/deps/golem-core-v2/golem-core-v2.wit +++ b/cli/golem-cli/wit/deps/golem-core-v2/golem-core-v2.wit @@ -125,6 +125,17 @@ interface types { /// and reveal it only through capability-gated host interfaces. resource secret; + /// An unforgeable handle to a permission card held by the runtime. The + /// handle is opaque to guests: components can hold, pass, derive, install, + /// and revoke cards only through the `golem:permissions` interfaces. When + /// carried in a `schema-value-tree` (see + /// `schema-value-node::permission-card-handle`) the handle is transferred + /// by ownership; the host converts it to/from its internal trusted + /// card-store representation at the boundary. The wire form is the card-id + /// (UUID) alone — no grants, parents, or metadata cross the wire as + /// authority. + resource permission-card; + // ============================================================ // Schema graph (self-contained type carrier) // ============================================================ @@ -266,6 +277,7 @@ interface types { // --- Capability nodes --- secret-type(secret-spec), quota-token-type(quota-token-spec), + permission-card-type(permission-card-spec), // --- WASI P3 stubs (parseable only; no semantics yet) --- future-type(option), @@ -462,6 +474,13 @@ interface types { resource-name: option, } + record permission-card-spec { + /// `true` = polymorphic (carries slot variables in owner / resource-id), + /// `false` = monomorphic. Structural metadata only; authority lives in + /// the card store, not in the schema spec. + polymorphic: bool, + } + // ============================================================ // Schema value (always paired with a schema-graph) // ============================================================ @@ -524,6 +543,7 @@ interface types { // Capability nodes secret-value(own), quota-token-handle(own), + permission-card-handle(own), // WASI P3 stubs (parseable only in the schema; no constructible values). } diff --git a/cli/golem/src/router.rs b/cli/golem/src/router.rs index 633925158e..be953a0fd7 100644 --- a/cli/golem/src/router.rs +++ b/cli/golem/src/router.rs @@ -140,6 +140,10 @@ pub async fn start_router( "/v1/components/:component_id/workers/:agent_name/update", worker_service_api.clone(), ) + .at( + "/v1/components/:component_id/workers/:agent_name/wallet", + worker_service_api.clone(), + ) // Metrics .at("/metrics", metrics) // Everything else is routed to registry service diff --git a/golem-api-grpc/proto/golem/auth/auth_ctx.proto b/golem-api-grpc/proto/golem/auth/auth_ctx.proto index b361a29909..f201d92af0 100644 --- a/golem-api-grpc/proto/golem/auth/auth_ctx.proto +++ b/golem-api-grpc/proto/golem/auth/auth_ctx.proto @@ -25,12 +25,14 @@ message UserAuthCtx { repeated AccountRole account_roles = 3; AuthEffectiveSurface effective_surface = 4; string account_email = 5; + optional bytes delegation_surface = 6; } message AgentAuthCtx { golem.common.AccountId account_id = 1; string account_email = 2; AuthEffectiveSurface effective_surface = 3; + optional bytes delegation_surface = 4; } message AdminImpersonationAuthCtx { @@ -40,6 +42,7 @@ message AdminImpersonationAuthCtx { golem.account.PlanId target_account_plan_id = 4; AuthEffectiveSurface effective_surface = 5; string target_account_email = 6; + optional bytes delegation_surface = 7; } message AuthCtx { diff --git a/golem-api-grpc/proto/golem/registry/v1/registry_service.proto b/golem-api-grpc/proto/golem/registry/v1/registry_service.proto index 252d6c4fef..97922b0b26 100644 --- a/golem-api-grpc/proto/golem/registry/v1/registry_service.proto +++ b/golem-api-grpc/proto/golem/registry/v1/registry_service.proto @@ -57,6 +57,8 @@ service RegistryService { // cards api rpc BatchGetExistingCards (BatchGetExistingCardsRequest) returns (BatchGetExistingCardsResponse); rpc BatchGetCards (BatchGetCardsRequest) returns (BatchGetCardsResponse); + rpc CreateRuntimeCard (CreateRuntimeCardRequest) returns (CreateRuntimeCardResponse); + rpc RevokeCard (RevokeCardRequest) returns (RevokeCardResponse); // registry invalidation stream — multiplexed event types rpc SubscribeRegistryInvalidations(SubscribeRegistryInvalidationsRequest) @@ -156,6 +158,42 @@ message BatchGetCardsSuccessResponse { repeated CardData cards = 1; } +message RuntimeCardData { + golem.common.UUID card_id = 1; + bytes card_json = 2; +} + +message CreateRuntimeCardRequest { + RuntimeCardData card = 1; + bytes provenance_json = 2; +} + +message CreateRuntimeCardResponse { + oneof result { + CreateRuntimeCardSuccessResponse success = 1; + RegistryServiceError error = 2; + } +} + +message CreateRuntimeCardSuccessResponse { + RuntimeCardData card = 1; +} + +message RevokeCardRequest { + golem.common.UUID card_id = 1; +} + +message RevokeCardResponse { + oneof result { + RevokeCardSuccessResponse success = 1; + RegistryServiceError error = 2; + } +} + +message RevokeCardSuccessResponse { + repeated golem.common.UUID revoked_card_ids = 1; +} + message DownloadComponentRequest { golem.component.ComponentId componentId = 1; uint64 revision = 2; diff --git a/golem-api-grpc/proto/golem/schema/schema.proto b/golem-api-grpc/proto/golem/schema/schema.proto index f7bfe3b912..e498a22f1e 100644 --- a/golem-api-grpc/proto/golem/schema/schema.proto +++ b/golem-api-grpc/proto/golem/schema/schema.proto @@ -98,6 +98,7 @@ message SchemaType { // Capability nodes SecretSpec secret_type = 70; QuotaTokenSpec quota_token_type = 71; + PermissionCardSpec permission_card_type = 72; // WASI P3 stubs (parseable only; no semantics yet) WasiStubType future_type = 80; @@ -272,6 +273,10 @@ message QuotaTokenSpec { optional string resource_name = 1; } +message PermissionCardSpec { + bool polymorphic = 1; +} + // Future/Stream stub bodies. Absent `element` means the inner type is unknown. message WasiStubType { SchemaType element = 1; @@ -330,6 +335,7 @@ message SchemaValue { // Capability nodes SecretValue secret_value = 70; QuotaTokenValue quota_token_value = 71; + PermissionCardValue permission_card_value = 72; } } @@ -424,6 +430,13 @@ message QuotaTokenValue { DatetimeValue last_credit_at = 5; } +message PermissionCardValue { + golem.common.UUID card_id = 1; + repeated golem.common.UUID parent_ids = 2; + DatetimeValue expires_at = 3; + bool polymorphic = 4; +} + // A typed value: a self-contained SchemaGraph paired with a value tree built // against it. Mirrors golem-common TypedSchemaValue. message TypedSchemaValue { diff --git a/golem-api-grpc/proto/golem/worker/public_oplog.proto b/golem-api-grpc/proto/golem/worker/public_oplog.proto index 5e414ce82e..68efd4857d 100644 --- a/golem-api-grpc/proto/golem/worker/public_oplog.proto +++ b/golem-api-grpc/proto/golem/worker/public_oplog.proto @@ -74,6 +74,11 @@ message OplogEntry { CardExpiredParameters CardExpired = 51; HostStreamFrameParameters HostStreamFrame = 52; CompletionDiscardedParameters CompletionDiscarded = 53; + CardDerivedParameters CardDerived = 54; + CardTransferStartedParameters CardTransferStarted = 55; + CardTransferredParameters CardTransferred = 56; + CardRevokedCascadeParameters CardRevokedCascade = 57; + CardTransferConfirmedParameters CardTransferConfirmed = 58; } } @@ -156,6 +161,17 @@ message CompletionDiscardedParameters { message AgentInvocationStartedParameters { google.protobuf.Timestamp timestamp = 1; PublicAgentInvocation invocation = 2; + optional PublicInvocationWalletPin wallet_pin = 3; +} + +message WalletVersionToken { + bytes wallet_id_hash = 1; + uint64 generation = 2; +} + +message PublicInvocationWalletPin { + WalletVersionToken wallet_token = 1; + optional golem.common.UUID scope_card_id = 2; } message AgentInvocationFinishedParameters { @@ -297,11 +313,13 @@ message CardRevokedParameters { google.protobuf.Timestamp timestamp = 1; uint64 queued_event_index = 2; golem.common.UUID card_id = 3; + optional uint64 wallet_generation = 4; } message CardExpiredParameters { google.protobuf.Timestamp timestamp = 1; golem.common.UUID card_id = 2; + optional uint64 wallet_generation = 3; } message QueuedCardEvent { @@ -313,9 +331,22 @@ message QueuedCardEvent { golem.common.UUID card_id = 1; } + message TransferStarted { + golem.common.UUID transfer_id = 1; + golem.common.UUID card_id = 2; + CardHolder target_holder = 3; + } + + message TransferReceived { + golem.common.UUID transfer_id = 1; + golem.common.UUID card_id = 2; + } + oneof event { Install install = 1; Revoke revoke = 2; + TransferStarted transfer_started = 3; + TransferReceived transfer_received = 4; } } @@ -336,6 +367,7 @@ message CardInstalledParameters { google.protobuf.Timestamp timestamp = 1; optional uint64 queued_event_index = 2; golem.common.UUID card_id = 3; + optional uint64 wallet_generation = 4; } message CardInstallFailedParameters { @@ -345,6 +377,55 @@ message CardInstallFailedParameters { CardInstallFailure reason = 4; } +message CardHolder { + oneof holder { + golem.common.UUID account = 1; + golem.common.UUID application = 2; + AgentId agent = 3; + } +} + +message CardDerivedParameters { + google.protobuf.Timestamp timestamp = 1; + golem.common.UUID card_id = 2; + repeated golem.common.UUID parent_ids = 3; + optional uint64 wallet_generation = 4; +} + +// Source-agent durable transfer intent. +message CardTransferStartedParameters { + google.protobuf.Timestamp timestamp = 1; + golem.common.UUID transfer_id = 2; + golem.common.UUID card_id = 3; + CardHolder target_holder = 4; + optional uint64 source_wallet_generation = 5; +} + +// Target-agent durable admission of a transferred card. +message CardTransferredParameters { + google.protobuf.Timestamp timestamp = 1; + golem.common.UUID transfer_id = 2; + golem.common.UUID installed_card_id = 3; + CardHolder target_holder = 4; + golem.common.UUID source_card_id = 5; + optional uint64 target_wallet_generation = 6; +} + +message CardRevokedCascadeParameters { + google.protobuf.Timestamp timestamp = 1; + repeated golem.common.UUID revoked_card_ids = 2; + optional uint64 local_wallet_generation = 3; +} + +// Source-agent terminal receipt, written after target admission is durable. +message CardTransferConfirmedParameters { + google.protobuf.Timestamp timestamp = 1; + golem.common.UUID transfer_id = 2; + golem.common.UUID source_card_id = 3; + golem.common.UUID installed_card_id = 4; + CardHolder target_holder = 5; +} + // A durably recorded frame of a host-owned stream (e.g. an outgoing HTTP request body), // attached to the durable host call identified by its Start entry's index. message HostStreamFrameParameters { diff --git a/golem-api-grpc/proto/golem/worker/raw_oplog.proto b/golem-api-grpc/proto/golem/worker/raw_oplog.proto index adedc631a2..bab2c3f94f 100644 --- a/golem-api-grpc/proto/golem/worker/raw_oplog.proto +++ b/golem-api-grpc/proto/golem/worker/raw_oplog.proto @@ -66,6 +66,11 @@ message RawOplogEntry { RawCardExpiredParameters card_expired = 50; RawHostStreamFrameParameters host_stream_frame = 51; RawCompletionDiscardedParameters completion_discarded = 52; + RawCardDerivedParameters card_derived = 53; + RawCardTransferStartedParameters card_transfer_started = 54; + RawCardTransferredParameters card_transferred = 55; + RawCardRevokedCascadeParameters card_revoked_cascade = 56; + RawCardTransferConfirmedParameters card_transfer_confirmed = 57; } } @@ -179,6 +184,13 @@ message RawAgentInvocationStartedParameters { string trace_id = 3; repeated string trace_states = 4; repeated RawSpanData invocation_context = 5; + optional RawInvocationWalletPin wallet_pin = 6; +} + +message RawInvocationWalletPin { + WalletVersionToken wallet_token = 1; + repeated golem.common.UUID pinned_card_ids = 2; + optional golem.common.UUID scope_card_id = 3; } message RawAgentInvocationFinishedParameters { @@ -305,6 +317,7 @@ message RawSnapshotParameters { RawOplogPayload data = 1; string mime_type = 2; repeated bytes active_cards = 3; + uint64 wallet_generation = 4; } message RawOplogProcessorCheckpointParameters { @@ -327,11 +340,13 @@ message RawCardRevokedParameters { google.protobuf.Timestamp timestamp = 1; uint64 queued_event_index = 2; golem.common.UUID card_id = 3; + optional uint64 wallet_generation = 4; } message RawCardExpiredParameters { google.protobuf.Timestamp timestamp = 1; golem.common.UUID card_id = 2; + optional uint64 wallet_generation = 3; } message RawQueuedCardEvent { @@ -344,9 +359,25 @@ message RawQueuedCardEvent { golem.common.UUID card_id = 1; } + message TransferStarted { + golem.common.UUID transfer_id = 1; + golem.common.UUID card_id = 2; + bytes card = 3; + CardHolder target_holder = 4; + } + + message TransferReceived { + golem.common.UUID transfer_id = 1; + golem.common.UUID card_id = 2; + bytes card = 3; + golem.common.UUID source_card_id = 4; + } + oneof event { Install install = 1; Revoke revoke = 2; + TransferStarted transfer_started = 3; + TransferReceived transfer_received = 4; } } @@ -367,6 +398,7 @@ message RawCardInstalledParameters { google.protobuf.Timestamp timestamp = 1; optional uint64 queued_event_index = 2; bytes card = 3; + optional uint64 wallet_generation = 4; } message RawCardInstallFailedParameters { @@ -376,6 +408,59 @@ message RawCardInstallFailedParameters { RawCardInstallFailure reason = 4; } +message RawCardDerivedParameters { + google.protobuf.Timestamp timestamp = 1; + bytes card = 2; + optional uint64 wallet_generation = 3; +} + +// Source-agent durable transfer intent. source_wallet_generation belongs only to +// the wallet owning this oplog. +message RawCardTransferStartedParameters { + google.protobuf.Timestamp timestamp = 1; + golem.common.UUID transfer_id = 2; + golem.common.UUID card_id = 3; + CardHolder source_holder = 4; + CardHolder target_holder = 5; + optional uint64 source_wallet_generation = 6; +} + +// Target-agent durable card admission. target_wallet_generation belongs only to +// the wallet owning this oplog. +message RawCardTransferredParameters { + google.protobuf.Timestamp timestamp = 1; + golem.common.UUID transfer_id = 2; + golem.common.UUID installed_card_id = 3; + CardHolder target_holder = 4; + bytes card = 5; + golem.common.UUID source_card_id = 6; + optional uint64 target_wallet_generation = 7; +} + +message CardHolderGenerationBump { + CardHolder holder = 1; + uint64 generation = 2; +} + +// Cascade impact plus the generation of the wallet owning this oplog. Other +// affected wallets record their own local entries. +message RawCardRevokedCascadeParameters { + google.protobuf.Timestamp timestamp = 1; + repeated golem.common.UUID revoked_card_ids = 2; + repeated CardHolder affected_wallets = 3; + repeated CardHolderGenerationBump generation_bumps = 4 [deprecated = true]; + optional uint64 local_wallet_generation = 5; +} + +// Source-agent terminal receipt, written after target admission is durable. +message RawCardTransferConfirmedParameters { + google.protobuf.Timestamp timestamp = 1; + golem.common.UUID transfer_id = 2; + golem.common.UUID source_card_id = 3; + golem.common.UUID installed_card_id = 4; + CardHolder target_holder = 5; +} + // A durably recorded frame of a host-owned stream (e.g. an outgoing HTTP request body), // attached to the durable host call identified by its Start entry's index. message RawHostStreamFrameParameters { diff --git a/golem-api-grpc/proto/golem/worker/scope_card.proto b/golem-api-grpc/proto/golem/worker/scope_card.proto new file mode 100644 index 0000000000..0675d7157a --- /dev/null +++ b/golem-api-grpc/proto/golem/worker/scope_card.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package golem.worker; + +import "golem/common/uuid.proto"; + +message EncodedScopeCard { + uint32 encoding_version = 1; + golem.common.UUID scope_card_id = 2; + repeated golem.common.UUID root_card_ids = 3; + bytes lower_positive = 4; + bytes lower_negative = 5; + bytes upper_positive = 6; + bytes upper_negative = 7; +} diff --git a/golem-api-grpc/proto/golem/worker/v1/worker_execution_error.proto b/golem-api-grpc/proto/golem/worker/v1/worker_execution_error.proto index 9f66f7826c..9837772b9b 100644 --- a/golem-api-grpc/proto/golem/worker/v1/worker_execution_error.proto +++ b/golem-api-grpc/proto/golem/worker/v1/worker_execution_error.proto @@ -37,6 +37,7 @@ message WorkerExecutionError { InitialAgentFileDownloadFailed initial_agent_file_download_failed = 25; FileSystemError file_system_error = 26; InvocationFailed invocation_failed = 27; + PermissionDenied permission_denied = 28; } } @@ -152,3 +153,7 @@ message InvocationFailed { AgentError error = 1; string stderr = 2; } + +message PermissionDenied { + string details = 1; +} diff --git a/golem-api-grpc/proto/golem/worker/v1/worker_service.proto b/golem-api-grpc/proto/golem/worker/v1/worker_service.proto index ff343d1c2d..005ed70771 100644 --- a/golem-api-grpc/proto/golem/worker/v1/worker_service.proto +++ b/golem-api-grpc/proto/golem/worker/v1/worker_service.proto @@ -26,6 +26,7 @@ import "golem/worker/v1/worker_error.proto"; import "golem/worker/worker_filter.proto"; import "golem/worker/worker_id.proto"; import "golem/worker/raw_oplog.proto"; +import "golem/worker/scope_card.proto"; import "golem/worker/worker_metadata.proto"; import "google/protobuf/timestamp.proto"; @@ -39,6 +40,7 @@ service WorkerService { rpc InvokeAgent (InvokeAgentRequest) returns (InvokeAgentResponse); rpc CancelInvocation (CancelInvocationRequest) returns (CancelInvocationResponse); rpc ProcessOplogEntries (ProcessOplogEntriesRequest) returns (ProcessOplogEntriesResponse); + rpc DeliverCardTransfer (DeliverCardTransferRequest) returns (DeliverCardTransferResponse); } message LaunchNewWorkerRequest { @@ -150,6 +152,7 @@ message InvokeAgentRequest { optional golem.common.EnvironmentId environment_id = 10; InvocationFreshnessDisposition freshness_disposition = 11; repeated golem.worker.AgentConfigEntryDto config = 12; + optional golem.worker.EncodedScopeCard scope_card = 13; } enum InvocationFreshnessDisposition { @@ -214,3 +217,20 @@ message ProcessOplogEntriesResponse { golem.worker.v1.AgentError error = 2; } } + +message DeliverCardTransferRequest { + golem.worker.AgentId target_agent_id = 1; + golem.common.EnvironmentId environment_id = 2; + golem.common.UUID transfer_id = 3; + // desert_rust BinaryCodec encoding of golem_common::model::card::StoredCard. + bytes card = 4; + golem.auth.AuthCtx auth_ctx = 5; + golem.common.UUID source_card_id = 6; +} + +message DeliverCardTransferResponse { + oneof result { + golem.common.Empty success = 1; + golem.worker.v1.AgentError error = 2; + } +} diff --git a/golem-api-grpc/proto/golem/workerexecutor/v1/worker_executor.proto b/golem-api-grpc/proto/golem/workerexecutor/v1/worker_executor.proto index d97b15fc69..58a3a7367f 100644 --- a/golem-api-grpc/proto/golem/workerexecutor/v1/worker_executor.proto +++ b/golem-api-grpc/proto/golem/workerexecutor/v1/worker_executor.proto @@ -23,6 +23,7 @@ import "golem/worker/oplog_cursor.proto"; import "golem/worker/promise_id.proto"; import "golem/worker/public_oplog.proto"; import "golem/worker/raw_oplog.proto"; +import "golem/worker/scope_card.proto"; import "golem/worker/update_mode.proto"; import "golem/worker/v1/worker_execution_error.proto"; import "golem/worker/worker_filter.proto"; @@ -62,6 +63,7 @@ service WorkerExecutor { rpc InvokeAgent(InvokeAgentRequest) returns (InvokeAgentResponse); rpc ProcessOplogEntries(ProcessOplogEntriesRequest) returns (ProcessOplogEntriesResponse); + rpc DeliverCardTransfer(DeliverCardTransferRequest) returns (DeliverCardTransferResponse); } message ForkWorkerRequest { @@ -480,6 +482,7 @@ message InvokeAgentRequest { golem.component.Principal principal = 14; InvocationFreshnessDisposition freshness_disposition = 15; repeated golem.worker.AgentConfigEntryDto config = 16; + optional golem.worker.EncodedScopeCard scope_card = 17; } enum InvocationFreshnessDisposition { @@ -531,3 +534,20 @@ message ProcessOplogEntriesResponse { golem.worker.v1.WorkerExecutionError failure = 2; } } + +message DeliverCardTransferRequest { + golem.worker.AgentId target_agent_id = 1; + golem.common.EnvironmentId environment_id = 2; + golem.common.UUID transfer_id = 3; + // desert_rust BinaryCodec encoding of golem_common::model::card::StoredCard. + bytes card = 4; + golem.auth.AuthCtx auth_ctx = 5; + golem.common.UUID source_card_id = 6; +} + +message DeliverCardTransferResponse { + oneof result { + golem.common.Empty success = 1; + golem.worker.v1.WorkerExecutionError failure = 2; + } +} diff --git a/golem-common/src/base_model/api.rs b/golem-common/src/base_model/api.rs index 3a7f453277..e02fe980d4 100644 --- a/golem-common/src/base_model/api.rs +++ b/golem-common/src/base_model/api.rs @@ -144,6 +144,7 @@ pub mod error_code { pub const INVALID_COMPONENT_NAME: &str = "INVALID_COMPONENT_NAME"; pub const INVALID_COMPONENT_REFERENCE: &str = "INVALID_COMPONENT_REFERENCE"; pub const INVALID_AGENT_INITIAL_PERMISSION_CARD: &str = "INVALID_AGENT_INITIAL_PERMISSION_CARD"; + pub const INVALID_RUNTIME_CARD: &str = "INVALID_RUNTIME_CARD"; pub const INVALID_CUSTOM_PROVIDER_ISSUER_URL: &str = "INVALID_CUSTOM_PROVIDER_ISSUER_URL"; pub const INVALID_FILE_NAME: &str = "INVALID_FILE_NAME"; pub const INVALID_FILE_PATH: &str = "INVALID_FILE_PATH"; diff --git a/golem-common/src/base_model/card/algebra.rs b/golem-common/src/base_model/card/algebra.rs index 4269836764..02bf444536 100644 --- a/golem-common/src/base_model/card/algebra.rs +++ b/golem-common/src/base_model/card/algebra.rs @@ -21,7 +21,12 @@ use serde::{Deserialize, Serialize}; pub enum CardAlgebraError { InvalidOwnerPath(String), InvalidRecipientPath(String), - DerivationNotSubsumed { grant: Box }, + LowerBoundTooBroad { + grant: Box, + }, + UpperBoundTooBroad { + grant: Option>, + }, } #[derive(Debug, Clone, Default, PartialEq, Eq, Hash)] @@ -32,10 +37,6 @@ pub struct GrantSurface { } impl GrantSurface { - fn is_empty(&self) -> bool { - self.positive.is_empty() && self.negative.is_empty() - } - pub fn allows(&self, request: &PermissionTarget) -> Result { let granted = self.positive.iter().any(|grant| grant.subsumes(request)); if !granted { @@ -66,6 +67,29 @@ pub struct EffectiveSurface { pub upper: Vec, } +#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] +pub struct DelegationCard { + pub source_card_id: Option, + pub lower_positive: Vec, + pub lower_negative: Vec, + pub upper_positive: Vec, + pub upper_negative: Vec, +} + +#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] +pub struct DelegationSurface { + pub cards: Vec, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum WalletDerivationParent { + Single(CardId), + MultipleRequired, + NotPermitted, +} + impl EffectiveSurface { pub fn from_cards(cards: &[Card], holder: &RecipientPattern) -> Result { let mut lower = Vec::new(); @@ -137,47 +161,6 @@ impl EffectiveSurface { self.allows_upper(request) } - pub fn validates_derivation( - &self, - child_lower_positive: &[PermissionPattern], - child_upper_positive: &[PermissionPattern], - ) -> Result, CardAlgebraError> { - let mut witness = Vec::new(); - - for grant in child_lower_positive { - let target = grant.to_target(); - let mut parent_index = None; - for (index, surface) in self.lower.iter().enumerate() { - if surface.allows(&target)? { - parent_index = Some(index); - break; - } - } - let Some(parent_index) = parent_index else { - return Err(CardAlgebraError::DerivationNotSubsumed { - grant: Box::new(grant.clone()), - }); - }; - push_source_if_available(&mut witness, &self.source_card_ids, parent_index); - } - - for grant in child_upper_positive { - let target = grant.to_target(); - for (parent_index, surface) in self.upper.iter().enumerate() { - if !surface.allows_ceiling(&target)? { - return Err(CardAlgebraError::DerivationNotSubsumed { - grant: Box::new(grant.clone()), - }); - } - if !surface.is_empty() { - push_source_if_available(&mut witness, &self.source_card_ids, parent_index); - } - } - } - - Ok(witness) - } - fn allows_lower(&self, request: &PermissionTarget) -> Result { for surface in &self.lower { if surface.allows(request)? { @@ -199,9 +182,197 @@ impl EffectiveSurface { } } -fn push_source_if_available(values: &mut Vec, source_card_ids: &[CardId], index: usize) { - if let Some(card_id) = source_card_ids.get(index) { - push_unique(values, *card_id); +impl DelegationSurface { + pub fn from_cards(cards: &[Card]) -> Self { + Self { + cards: cards + .iter() + .map(|card| DelegationCard { + source_card_id: Some(card.card_id), + lower_positive: card.lower_positive.clone(), + lower_negative: card.lower_negative.clone(), + upper_positive: card.upper_positive.clone(), + upper_negative: card.upper_negative.clone(), + }) + .collect(), + } + } + + /// Validates resulting child bounds. Child negatives must include inherited denials plus additions. + pub fn validate_attenuation( + &self, + child_lower_positive: &[PermissionPattern], + child_lower_negative: &[PermissionPattern], + child_upper_positive: &[PermissionPattern], + child_upper_negative: &[PermissionPattern], + ) -> Result, CardAlgebraError> { + validate_attenuation_for_cards( + &self.cards, + child_lower_positive, + child_lower_negative, + child_upper_positive, + child_upper_negative, + ) + } + + pub fn select_wallet_derivation_parent( + &self, + child_lower_positive: &[PermissionPattern], + child_lower_negative: &[PermissionPattern], + child_upper_positive: &[PermissionPattern], + child_upper_negative: &[PermissionPattern], + ) -> Result { + if self.cards.is_empty() { + return Ok(WalletDerivationParent::NotPermitted); + } + + let selected = self + .cards + .iter() + .filter_map(|card| { + validate_attenuation_for_cards( + std::slice::from_ref(card), + child_lower_positive, + child_lower_negative, + child_upper_positive, + child_upper_negative, + ) + .ok() + .and(card.source_card_id) + }) + .max(); + + if let Some(card_id) = selected { + return Ok(WalletDerivationParent::Single(card_id)); + } + + self.validate_attenuation( + child_lower_positive, + child_lower_negative, + child_upper_positive, + child_upper_negative, + )?; + Ok(WalletDerivationParent::MultipleRequired) + } +} + +fn validate_attenuation_for_cards( + cards: &[DelegationCard], + child_lower_positive: &[PermissionPattern], + child_lower_negative: &[PermissionPattern], + child_upper_positive: &[PermissionPattern], + child_upper_negative: &[PermissionPattern], +) -> Result, CardAlgebraError> { + let mut witness = Vec::new(); + + for grant in child_lower_positive { + let mut parent = None; + for card in cards { + if positive_subsumes(&card.lower_positive, grant) + && negatives_are_preserved(&card.lower_negative, child_lower_negative) + { + parent = Some(card); + break; + } + } + let Some(parent) = parent else { + return Err(CardAlgebraError::LowerBoundTooBroad { + grant: Box::new(grant.clone()), + }); + }; + push_source_if_available(&mut witness, parent.source_card_id); + } + + for card in cards { + if !negatives_are_preserved(&card.upper_negative, child_upper_negative) { + return Err(CardAlgebraError::UpperBoundTooBroad { + grant: child_upper_positive + .first() + .or(child_lower_positive.first()) + .cloned() + .map(Box::new), + }); + } + + // Empty upper positives denote an implicit top ceiling. Recipient coverage + // keeps a finite parent ceiling from becoming top for excluded holders. + if (!card.upper_positive.is_empty() && child_upper_positive.is_empty()) + || !parent_upper_recipients_are_covered(&card.upper_positive, child_upper_positive) + { + return Err(CardAlgebraError::UpperBoundTooBroad { grant: None }); + } + + for grant in child_upper_positive { + if !ceiling_positive_subsumes(&card.upper_positive, grant) { + return Err(CardAlgebraError::UpperBoundTooBroad { + grant: Some(Box::new(grant.clone())), + }); + } + } + + if !upper_is_empty(card) { + push_source_if_available(&mut witness, card.source_card_id); + } + } + + Ok(witness) +} + +fn positive_subsumes(positive: &[PermissionPattern], request: &PermissionPattern) -> bool { + positive.iter().any(|grant| grant.subsumes(request)) +} + +fn ceiling_positive_subsumes(positive: &[PermissionPattern], request: &PermissionPattern) -> bool { + let request_recipient = request.recipient(); + let request_target = request.to_target(); + + positive + .iter() + .filter(|grant| recipients_overlap(grant.recipient(), request_recipient)) + .all(|overlapping_grant| { + let overlap_recipient = if request_recipient.subsumes(overlapping_grant.recipient()) { + overlapping_grant.recipient() + } else { + request_recipient + }; + positive.iter().any(|grant| { + grant.recipient().subsumes(overlap_recipient) + && grant.subsumes_target(&request_target) + }) + }) +} + +fn parent_upper_recipients_are_covered( + parent: &[PermissionPattern], + child: &[PermissionPattern], +) -> bool { + parent.iter().all(|parent_grant| { + child + .iter() + .any(|child_grant| child_grant.recipient().subsumes(parent_grant.recipient())) + }) +} + +fn recipients_overlap(left: &RecipientPattern, right: &RecipientPattern) -> bool { + left.subsumes(right) || right.subsumes(left) +} + +fn negatives_are_preserved( + parent_negative: &[PermissionPattern], + child_negative: &[PermissionPattern], +) -> bool { + parent_negative + .iter() + .all(|parent| child_negative.iter().any(|child| child.subsumes(parent))) +} + +fn upper_is_empty(card: &DelegationCard) -> bool { + card.upper_positive.is_empty() && card.upper_negative.is_empty() +} + +fn push_source_if_available(values: &mut Vec, source_card_id: Option) { + if let Some(card_id) = source_card_id { + push_unique(values, card_id); } } diff --git a/golem-common/src/base_model/card/class/mod.rs b/golem-common/src/base_model/card/class/mod.rs index 049a7161a8..f2c9473713 100644 --- a/golem-common/src/base_model/card/class/mod.rs +++ b/golem-common/src/base_model/card/class/mod.rs @@ -131,6 +131,12 @@ macro_rules! card_permission_classes { pub(crate) use card_permission_classes; +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub struct PermissionClassMetadata { + pub class_name: &'static str, + pub verbs: &'static [&'static str], +} + #[cfg(feature = "full")] pub trait VerbPattern: Debug diff --git a/golem-common/src/base_model/card/mod.rs b/golem-common/src/base_model/card/mod.rs index da91bd7b0d..1c061a62fa 100644 --- a/golem-common/src/base_model/card/mod.rs +++ b/golem-common/src/base_model/card/mod.rs @@ -43,4 +43,5 @@ pub use envelope::*; pub use monomorphization::*; pub use parsing::*; pub use pattern::*; +pub use rendering::permission_class_metadata; pub use types::*; diff --git a/golem-common/src/base_model/card/monomorphization.rs b/golem-common/src/base_model/card/monomorphization.rs index 13b25b531a..79452ab7d0 100644 --- a/golem-common/src/base_model/card/monomorphization.rs +++ b/golem-common/src/base_model/card/monomorphization.rs @@ -15,12 +15,16 @@ use super::class::*; use super::owner::*; use super::recipient::RecipientPattern; -use super::{Card, EffectiveSurface, PermissionPattern, PolymorphicPermissionPattern, StoredCard}; +use super::{ + Card, CardId, DelegationSurface, EffectiveSurface, PermissionPattern, PolymorphicCard, + PolymorphicPermissionPattern, ScopeCard, StoredCard, +}; use crate::model::account::AccountEmail; use crate::model::agent::AgentTypeName; use crate::model::application::ApplicationName; use crate::model::component::ComponentName; use crate::model::environment::EnvironmentName; +use chrono::{DateTime, Utc}; #[derive(Debug, Clone, PartialEq, Eq)] pub struct AgentPermissionMonomorphizationContext { @@ -37,15 +41,52 @@ pub fn agent_effective_surface_from_wallet<'a>( wallet_cards: impl IntoIterator, ) -> EffectiveSurface { let holder = agent_recipient_pattern(context); - let cards = wallet_cards + let cards = monomorphize_wallet_cards(context, wallet_cards); + + EffectiveSurface::from_cards(&cards, &holder).unwrap_or_default() +} + +pub fn agent_effective_surface_from_wallet_and_scope<'a>( + context: &AgentPermissionMonomorphizationContext, + wallet_cards: impl IntoIterator, + scope_card: Option<&ScopeCard>, +) -> EffectiveSurface { + let mut surface = agent_effective_surface_from_wallet(context, wallet_cards); + if let Some(scope_card) = scope_card { + let holder = agent_recipient_pattern(context); + if let Ok(mut scope_surface) = EffectiveSurface::from_grants( + &scope_card.lower_positive, + &scope_card.lower_negative, + &scope_card.upper_positive, + &scope_card.upper_negative, + &holder, + ) { + surface.source_card_ids.push(scope_card.scope_card_id); + surface.lower.append(&mut scope_surface.lower); + surface.upper.append(&mut scope_surface.upper); + } + } + surface +} + +pub fn agent_delegation_surface_from_wallet<'a>( + context: &AgentPermissionMonomorphizationContext, + wallet_cards: impl IntoIterator, +) -> DelegationSurface { + DelegationSurface::from_cards(&monomorphize_wallet_cards(context, wallet_cards)) +} + +fn monomorphize_wallet_cards<'a>( + context: &AgentPermissionMonomorphizationContext, + wallet_cards: impl IntoIterator, +) -> Vec { + wallet_cards .into_iter() .map(|card| match card { StoredCard::Concrete(card) => card.clone(), - StoredCard::Polymorphic(_) => monomorphize_stored_card(card, context), + StoredCard::Polymorphic(_) => monomorphize_card_for_agent(card, context), }) - .collect::>(); - - EffectiveSurface::from_cards(&cards, &holder).unwrap_or_default() + .collect() } fn agent_recipient_pattern(context: &AgentPermissionMonomorphizationContext) -> RecipientPattern { @@ -58,27 +99,59 @@ fn agent_recipient_pattern(context: &AgentPermissionMonomorphizationContext) -> } } -fn monomorphize_stored_card( +pub fn monomorphize_card_for_agent( card: &StoredCard, context: &AgentPermissionMonomorphizationContext, ) -> Card { match card { StoredCard::Concrete(card) => card.clone(), - StoredCard::Polymorphic(card) => Card { - card_id: card.card_id, - parent_ids: card.parent_ids.clone(), - lower_positive: resolve_permissions_for_agent_context(&card.lower_positive, context), - lower_negative: resolve_permissions_for_agent_context(&card.lower_negative, context), - upper_positive: resolve_permissions_for_agent_context(&card.upper_positive, context), - upper_negative: resolve_permissions_for_agent_context(&card.upper_negative, context), - created_at: card.created_at, - expires_at: card.expires_at, - system_card: card.system_card, - managed_by: None, - }, + StoredCard::Polymorphic(card) => monomorphize_polymorphic_card_for_agent(card, context), } } +pub fn instantiate_polymorphic_card_for_agent( + card: &PolymorphicCard, + context: &AgentPermissionMonomorphizationContext, + child_card_id: CardId, + created_at: DateTime, +) -> Card { + Card { + card_id: child_card_id, + parent_ids: vec![card.card_id], + created_at, + ..monomorphize_polymorphic_card_for_agent(card, context) + } +} + +fn monomorphize_polymorphic_card_for_agent( + card: &PolymorphicCard, + context: &AgentPermissionMonomorphizationContext, +) -> Card { + Card { + card_id: card.card_id, + parent_ids: card.parent_ids.clone(), + lower_positive: resolve_permissions_for_agent_context(&card.lower_positive, context), + lower_negative: resolve_permissions_for_agent_context(&card.lower_negative, context), + upper_positive: resolve_permissions_for_agent_context(&card.upper_positive, context), + upper_negative: resolve_permissions_for_agent_context(&card.upper_negative, context), + created_at: card.created_at, + expires_at: card.expires_at, + system_card: card.system_card, + managed_by: None, + } +} + +pub fn card_matches_agent_recipient( + card: &StoredCard, + context: &AgentPermissionMonomorphizationContext, +) -> bool { + let holder = agent_recipient_pattern(context); + monomorphize_card_for_agent(card, context) + .lower_positive + .iter() + .any(|grant| grant.recipient().subsumes(&holder)) +} + pub(crate) fn resolve_permissions_for_agent_context( permissions: &[PolymorphicPermissionPattern], context: &AgentPermissionMonomorphizationContext, @@ -565,7 +638,6 @@ mod tests { use crate::model::account::AccountEmail; use crate::model::agent::AgentTypeName; use crate::model::application::ApplicationName; - use crate::model::card::default_agent_initial_permission_grants; use crate::model::card::recipient::RecipientPattern; use crate::model::card::{ AgentClass, AgentResourcePattern, AgentVerb, CardId, ClassPermissionTarget, ComponentClass, @@ -573,6 +645,7 @@ mod tests { EnvironmentVerb, PermissionTarget, PolymorphicCard, PolymorphicClassPermissionPattern, PolymorphicPermissionPattern, StoredCard, }; + use crate::model::card::{default_agent_initial_permission_grants, parse_permission}; use crate::model::component::ComponentName; use crate::model::environment::EnvironmentName; @@ -621,6 +694,93 @@ mod tests { }) } + #[test] + fn invocation_scope_card_contributes_lower_and_upper_authority() { + let context = context(); + let scope_card_id = CardId(uuid::Uuid::from_u128(10)); + let grant = parse_permission( + "agent(owner@example.com/shop/prod/cart-svc/Cart(*)) @ owner@example.com/shop/prod/cart-svc/Cart : view : *", + ) + .unwrap(); + let scope_card = ScopeCard { + scope_card_id, + root_card_ids: vec![CardId(uuid::Uuid::from_u128(11))], + lower_positive: vec![grant.clone()], + lower_negative: Vec::new(), + upper_positive: vec![grant], + upper_negative: Vec::new(), + }; + + let without_scope = agent_effective_surface_from_wallet(&context, std::iter::empty()); + let with_scope = agent_effective_surface_from_wallet_and_scope( + &context, + std::iter::empty(), + Some(&scope_card), + ); + let request = agent_target( + "owner@example.com/shop/prod/cart-svc/Cart(alice)", + AgentVerb::View, + ); + + assert!(!without_scope.authorize(&request).unwrap()); + assert!(with_scope.authorize(&request).unwrap()); + assert_eq!(with_scope.source_card_ids, vec![scope_card_id]); + assert_eq!(with_scope.lower.len(), 1); + assert_eq!(with_scope.upper.len(), 1); + } + + #[test] + fn upper_only_invocation_scope_card_clamps_persistent_authority() { + let context = context(); + let persistent_grant = parse_permission( + "agent(owner@example.com/shop/prod/cart-svc/Cart(*)) @ owner@example.com/shop/prod/cart-svc/Cart : view : *", + ) + .unwrap(); + let scope_ceiling = parse_permission( + "agent(owner@example.com/shop/prod/cart-svc/Cart(*)) @ owner@example.com/shop/prod/cart-svc/Cart : invoke : *", + ) + .unwrap(); + let persistent_card = StoredCard::Concrete(Card { + card_id: CardId(uuid::Uuid::from_u128(20)), + parent_ids: Vec::new(), + lower_positive: vec![persistent_grant], + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: chrono::Utc::now(), + expires_at: None, + system_card: false, + managed_by: None, + }); + let scope_card = ScopeCard { + scope_card_id: CardId(uuid::Uuid::from_u128(21)), + root_card_ids: vec![persistent_card.card_id()], + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: vec![scope_ceiling], + upper_negative: Vec::new(), + }; + let request = agent_target( + "owner@example.com/shop/prod/cart-svc/Cart(alice)", + AgentVerb::View, + ); + + assert!( + agent_effective_surface_from_wallet(&context, [&persistent_card]) + .authorize(&request) + .unwrap() + ); + assert!( + !agent_effective_surface_from_wallet_and_scope( + &context, + [&persistent_card], + Some(&scope_card), + ) + .authorize(&request) + .unwrap() + ); + } + #[test] fn monomorphizes_holder_relative_agent_initial_card_slots() { let context = context(); @@ -656,10 +816,19 @@ mod tests { expires_at: None, system_card: false, }; - let surface = - agent_effective_surface_from_wallet(&context, [&StoredCard::Polymorphic(card)]); + let stored_card = StoredCard::Polymorphic(card); + let surface = agent_effective_surface_from_wallet(&context, [&stored_card]); + let delegation_surface = agent_delegation_surface_from_wallet(&context, [&stored_card]); assert_eq!(surface.source_card_ids, vec![card_id]); + assert_eq!(delegation_surface.cards.len(), 1); + assert_eq!(delegation_surface.cards[0].source_card_id, Some(card_id)); + assert!( + delegation_surface.cards[0] + .lower_positive + .iter() + .all(|grant| grant.recipient() == &RecipientPattern::Any) + ); assert!( surface .authorize(&environment_view_target("owner@example.com/shop/prod")) @@ -690,6 +859,63 @@ mod tests { ); } + #[test] + fn installed_polymorphic_child_has_target_grants_and_source_parent() { + let context = context(); + let source_card_id = CardId(uuid::Uuid::from_u128(1)); + let source_parent_id = CardId(uuid::Uuid::from_u128(2)); + let child_card_id = CardId(uuid::Uuid::from_u128(3)); + let source_created_at = chrono::DateTime::from_timestamp(1_700_000_000, 0).unwrap(); + let child_created_at = chrono::DateTime::from_timestamp(1_700_000_100, 0).unwrap(); + let expires_at = chrono::DateTime::from_timestamp(1_800_000_000, 0).unwrap(); + let grant = PolymorphicPermissionPattern::Agent(PolymorphicClassPermissionPattern { + owner: PolymorphicAgentOwnerPattern::Agent, + recipient: RecipientPattern::Any, + verb: Some(AgentVerb::View), + resource: AgentResourcePattern::Any, + }); + let source = PolymorphicCard { + card_id: source_card_id, + parent_ids: vec![source_parent_id], + lower_positive: vec![grant.clone()], + lower_negative: vec![grant.clone()], + upper_positive: vec![grant.clone()], + upper_negative: vec![grant], + created_at: source_created_at, + expires_at: Some(expires_at), + system_card: false, + }; + let monomorphized_source = + monomorphize_card_for_agent(&StoredCard::Polymorphic(source.clone()), &context); + + let child = instantiate_polymorphic_card_for_agent( + &source, + &context, + child_card_id, + child_created_at, + ); + + assert_eq!(child.card_id, child_card_id); + assert_eq!(child.parent_ids, vec![source_card_id]); + assert_eq!(child.lower_positive, monomorphized_source.lower_positive); + assert_eq!(child.lower_negative, monomorphized_source.lower_negative); + assert_eq!(child.upper_positive, monomorphized_source.upper_positive); + assert_eq!(child.upper_negative, monomorphized_source.upper_negative); + assert_eq!(child.created_at, child_created_at); + assert_eq!(child.expires_at, source.expires_at); + assert_eq!(child.system_card, source.system_card); + assert_eq!(child.managed_by, None); + assert_eq!( + child, + instantiate_polymorphic_card_for_agent( + &source, + &context, + child_card_id, + child_created_at, + ) + ); + } + #[test] fn default_agent_initial_permission_is_current_environment_scoped() { let context = context(); diff --git a/golem-common/src/base_model/card/parsing.rs b/golem-common/src/base_model/card/parsing.rs index 37402eb68c..4178aaf2fc 100644 --- a/golem-common/src/base_model/card/parsing.rs +++ b/golem-common/src/base_model/card/parsing.rs @@ -103,13 +103,37 @@ pub fn parse_permission(value: &str) -> Result Result { + for value in [owner, recipient, resource] { + if contains_slot_reference(value) { + return Err(CardParseError::SlotVariableInConcreteGrant( + value.to_string(), + )); + } + } + + dispatch_permission_class!( + parse_permission_case, + class, + owner, + recipient, + verb, + resource ) } diff --git a/golem-common/src/base_model/card/pattern.rs b/golem-common/src/base_model/card/pattern.rs index 481e225252..de714580bb 100644 --- a/golem-common/src/base_model/card/pattern.rs +++ b/golem-common/src/base_model/card/pattern.rs @@ -27,6 +27,15 @@ macro_rules! define_permission_pattern { card_permission_classes!(define_permission_pattern); +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct RenderedPermissionFields { + pub class: &'static str, + pub owner: String, + pub recipient: String, + pub verb: String, + pub resource: String, +} + macro_rules! define_permission_target { ($($variant:ident: $class:ty,)+) => { #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -185,6 +194,10 @@ impl PermissionPattern { super::rendering::render_permission(self) } + pub fn render_fields(&self) -> Result { + super::rendering::render_permission_fields(self) + } + pub(crate) fn to_target(&self) -> PermissionTarget { permission_pattern_to_target_match!(self) } @@ -202,6 +215,10 @@ impl PolymorphicPermissionPattern { pub fn render(&self) -> Result { super::rendering::render_polymorphic_permission(self) } + + pub fn render_fields(&self) -> Result { + super::rendering::render_polymorphic_permission_fields(self) + } } impl PolymorphicManifestPermissionPattern { diff --git a/golem-common/src/base_model/card/rendering.rs b/golem-common/src/base_model/card/rendering.rs index 1f2c3cb056..3cfae93573 100644 --- a/golem-common/src/base_model/card/rendering.rs +++ b/golem-common/src/base_model/card/rendering.rs @@ -23,6 +23,7 @@ use super::owner::{ }; use super::pattern::{ PermissionPattern, PolymorphicManifestPermissionPattern, PolymorphicPermissionPattern, + RenderedPermissionFields, }; use super::recipient::{PolymorphicRecipientPattern, RecipientPattern}; @@ -44,6 +45,26 @@ pub fn render_permission(permission: &PermissionPattern) -> Result Result { + macro_rules! render_case { + ($($variant:ident: $class:ty,)+) => { + match permission { + $(PermissionPattern::$variant(pattern) => render_class_permission_fields( + <$class as PermissionClass>::NAME, + &pattern.owner, + &pattern.recipient, + pattern.verb.as_ref(), + &pattern.resource, + ),)+ + } + }; + } + + card_permission_classes!(render_case) +} + pub fn render_polymorphic_permission( permission: &PolymorphicPermissionPattern, ) -> Result { @@ -64,6 +85,26 @@ pub fn render_polymorphic_permission( card_permission_classes!(render_case) } +pub fn render_polymorphic_permission_fields( + permission: &PolymorphicPermissionPattern, +) -> Result { + macro_rules! render_case { + ($($variant:ident: $class:ty,)+) => { + match permission { + $(PolymorphicPermissionPattern::$variant(pattern) => render_class_permission_fields( + <$class as PermissionClass>::NAME, + &pattern.owner, + &pattern.recipient, + pattern.verb.as_ref(), + &pattern.resource, + ),)+ + } + }; + } + + card_permission_classes!(render_case) +} + pub fn render_polymorphic_manifest_permission( permission: &PolymorphicManifestPermissionPattern, ) -> Result { @@ -97,16 +138,36 @@ where Verb: RenderFragment, Resource: RenderFragment, { + let fields = render_class_permission_fields(class_name, owner, recipient, verb, resource)?; Ok(format!( "{}({}) @ {} : {} : {}", - class_name, - owner.render_fragment()?, - recipient.render_fragment()?, - verb.map(RenderFragment::render_fragment) + fields.class, fields.owner, fields.recipient, fields.verb, fields.resource, + )) +} + +fn render_class_permission_fields( + class_name: &'static str, + owner: &Owner, + recipient: &Recipient, + verb: Option<&Verb>, + resource: &Resource, +) -> Result +where + Owner: RenderFragment, + Recipient: RenderFragment, + Verb: RenderFragment, + Resource: RenderFragment, +{ + Ok(RenderedPermissionFields { + class: class_name, + owner: owner.render_fragment()?, + recipient: recipient.render_fragment()?, + verb: verb + .map(RenderFragment::render_fragment) .transpose()? .unwrap_or_else(|| "*".to_string()), - resource.render_fragment()?, - )) + resource: resource.render_fragment()?, + }) } trait RenderFragment { @@ -513,6 +574,25 @@ impl RenderFragment for RecipientPattern { } } +trait VerbNames { + const NAMES: &'static [&'static str]; +} + +pub fn permission_class_metadata() -> Vec { + macro_rules! metadata_case { + ($($variant:ident: $class:ty,)+) => { + vec![$( + PermissionClassMetadata { + class_name: <$class as PermissionClass>::NAME, + verbs: <<$class as PermissionClass>::Verb as VerbNames>::NAMES, + }, + )+] + }; + } + + card_permission_classes!(metadata_case) +} + macro_rules! render_verb { ($ty:ty { $($variant:ident => $name:literal),+ $(,)? }) => { impl RenderFragment for $ty { @@ -522,6 +602,10 @@ macro_rules! render_verb { }.to_string()) } } + + impl VerbNames for $ty { + const NAMES: &'static [&'static str] = &[$($name,)+]; + } }; } @@ -708,7 +792,7 @@ impl RenderFragment for ToolResourcePattern { path.iter() .map(|part| part.0.clone()) .collect::>() - .join("/") + .join(".") }); let args = invocation .args diff --git a/golem-common/src/base_model/card/rendering_tests.rs b/golem-common/src/base_model/card/rendering_tests.rs index 568d52f477..8ea97fca3a 100644 --- a/golem-common/src/base_model/card/rendering_tests.rs +++ b/golem-common/src/base_model/card/rendering_tests.rs @@ -932,6 +932,7 @@ fn golden_grants() -> Vec<&'static str> { "secret(acme/shop/prod) @ acme/shop/prod/cart/CartAgent : reveal : api-key", "agent(acme/shop/prod/cart/CartAgent(*)) @ acme/shop/prod/cart/CartAgent : invoke : charge", "tool(acme/shop/prod/tools/*) @ acme/shop/prod/cart/CartAgent : invoke : *", + "tool(acme/shop/prod/cli-tools/grep) @ acme/shop/prod/cart/CartAgent : invoke : search.files --pattern=* --path=src/** -in README.md", "kv(acme/shop/prod) @ acme/shop/prod/cart/CartAgent : read : store.user-*", "blob(acme/shop/prod) @ acme/shop/prod/cart/CartAgent : read : bucket.path/**", "rdbms(acme/shop/prod) @ acme/shop/prod/cart/CartAgent : query : orders.public.orders", diff --git a/golem-common/src/base_model/card/subsumption_tests.rs b/golem-common/src/base_model/card/subsumption_tests.rs index 75b6426874..d336b9ec8a 100644 --- a/golem-common/src/base_model/card/subsumption_tests.rs +++ b/golem-common/src/base_model/card/subsumption_tests.rs @@ -14,7 +14,10 @@ use super::*; use crate::model::auth::TokenId; -use crate::model::card::owner::{AgentOwnerPattern, EmptyOwnerPattern, OwnerPattern}; +use crate::model::card::owner::{ + AccountOwnerPattern, AgentOwnerPattern, ApplicationOwnerPattern, ComponentOwnerPattern, + EmptyOwnerPattern, EnvironmentOwnerPattern, OwnerPattern, ToolOwnerPattern, +}; use crate::model::card::recipient::RecipientPattern; use RecipientPattern as AccountRecipientPattern; use RecipientPattern as AgentRecipientPattern; @@ -805,8 +808,6 @@ fn subsumption_requires_same_permission_class() { #[test] fn derivation_must_be_subsumed_by_parent_union() { - let holder = "acme/shop/prod/cart/agent"; - let recipient = RecipientPattern::parse(holder).unwrap(); let parent_grant = fs( "acme/shop/prod/cart/agent", "acme/shop/prod/cart/agent", @@ -824,24 +825,21 @@ fn derivation_must_be_subsumed_by_parent_union() { ); let parent = card(vec![parent_grant], Vec::new()); - let parent_surface = - EffectiveSurface::from_cards(std::slice::from_ref(&parent), &recipient).unwrap(); + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); assert!( parent_surface - .validates_derivation(std::slice::from_ref(&child_grant), &[]) + .validate_attenuation(std::slice::from_ref(&child_grant), &[], &[], &[],) .is_ok() ); assert_matches!( - parent_surface.validates_derivation(std::slice::from_ref(&denied_child), &[]), - Err(CardAlgebraError::DerivationNotSubsumed { .. }) + parent_surface.validate_attenuation(std::slice::from_ref(&denied_child), &[], &[], &[],), + Err(CardAlgebraError::LowerBoundTooBroad { .. }) ); } #[test] fn derivation_checks_upper_bounds_against_parent_upper_surface() { - let holder = "acme/shop/prod/cart/agent"; - let recipient = RecipientPattern::parse(holder).unwrap(); let parent_upper = fs( "acme/shop/prod/cart/agent", "acme/shop/prod/cart/agent", @@ -858,17 +856,1035 @@ fn derivation_checks_upper_bounds_against_parent_upper_surface() { fs_path(vec![fs_lit("other"), fs_lit("file.txt")]), ); let parent = card(Vec::new(), vec![parent_upper]); - let parent_surface = - EffectiveSurface::from_cards(std::slice::from_ref(&parent), &recipient).unwrap(); + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); assert!( parent_surface - .validates_derivation(&[], std::slice::from_ref(&child_upper)) + .validate_attenuation(&[], &[], std::slice::from_ref(&child_upper), &[],) .is_ok() ); assert_matches!( - parent_surface.validates_derivation(&[], std::slice::from_ref(&too_broad_child_upper)), - Err(CardAlgebraError::DerivationNotSubsumed { .. }) + parent_surface.validate_attenuation( + &[], + &[], + std::slice::from_ref(&too_broad_child_upper), + &[], + ), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) + ); + assert_matches!( + parent_surface.validate_attenuation(&[], &[], &[], &[]), + Err(CardAlgebraError::UpperBoundTooBroad { grant: None }) + ); +} + +#[test] +fn attenuation_rejects_upper_positive_for_disjoint_recipient() { + let holder = "acme/shop/prod/cart/agent"; + let parent_upper = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let child_upper = fs( + holder, + "acme/shop/prod/cart/child", + fs_path(vec![fs_lit("data"), fs_lit("file.txt")]), + ); + let parent = card(Vec::new(), vec![parent_upper]); + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + + assert_matches!( + parent_surface.validate_attenuation(&[], &[], std::slice::from_ref(&child_upper), &[],), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) + ); +} + +#[test] +fn attenuation_rejects_narrowing_upper_positive_recipient() { + let holder = "acme/shop/prod/cart/agent"; + let other_recipient = "acme/shop/prod/cart/other"; + let parent_upper = fs( + holder, + "*", + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let child_upper = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let lower_grant = fs( + holder, + other_recipient, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let parent_ceiling = card(Vec::new(), vec![parent_upper]); + let companion = card(vec![lower_grant], Vec::new()); + let child_ceiling = card(Vec::new(), vec![child_upper.clone()]); + let recipient = RecipientPattern::parse(other_recipient).unwrap(); + let parent_surface = + EffectiveSurface::from_cards(&[parent_ceiling.clone(), companion.clone()], &recipient) + .unwrap(); + let child_surface = + EffectiveSurface::from_cards(&[child_ceiling, companion], &recipient).unwrap(); + let secret = fs_target(holder, fs_path(vec![fs_lit("data"), fs_lit("secret.txt")])); + + assert!(!parent_surface.authorize(&secret).unwrap()); + assert!(child_surface.authorize(&secret).unwrap()); + + let delegation_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent_ceiling)); + assert_matches!( + delegation_surface.validate_attenuation(&[], &[], std::slice::from_ref(&child_upper), &[],), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) + ); +} + +#[test] +fn attenuation_accepts_equivalent_disjoint_recipient_ceilings() { + let holder = "acme/shop/prod/cart/agent"; + let upper_a = fs( + holder, + "acme/shop/prod/cart/a", + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let upper_b = fs( + holder, + "acme/shop/prod/cart/b", + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let parent_a = card(Vec::new(), vec![upper_a.clone()]); + let parent_b = card(Vec::new(), vec![upper_b.clone()]); + let parent_surface = DelegationSurface::from_cards(&[parent_a, parent_b]); + + let result = parent_surface.validate_attenuation(&[], &[], &[upper_a, upper_b], &[]); + + assert!( + result.is_ok(), + "retaining the same holder-local ceilings must be accepted: {result:?}" + ); +} + +#[test] +fn attenuation_accepts_lower_grant_where_retained_ceiling_is_locally_top() { + let holder = "acme/shop/prod/cart/agent"; + let recipient_a = "acme/shop/prod/cart/a"; + let recipient_b = "acme/shop/prod/cart/b"; + let parent_lower = fs( + holder, + "*", + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let child_lower = fs( + holder, + recipient_b, + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let retained_upper = fs( + holder, + recipient_a, + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let parent = card(vec![parent_lower], vec![retained_upper.clone()]); + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + + let result = parent_surface.validate_attenuation( + std::slice::from_ref(&child_lower), + &[], + std::slice::from_ref(&retained_upper), + &[], + ); + + assert!( + result.is_ok(), + "the unchanged ceiling is implicit top for the lower grant's disjoint recipient: {result:?}" + ); +} + +#[test] +fn attenuation_rejects_dropped_positive_ceiling_when_child_has_lower_grant() { + let holder = "acme/shop/prod/cart/agent"; + let recipient = RecipientPattern::parse(holder).unwrap(); + let read_public = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let read_secret = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let bounded_parent = card(vec![read_public.clone()], vec![read_public.clone()]); + let companion = card(vec![read_secret], Vec::new()); + let parent_cards = [bounded_parent, companion.clone()]; + let parent_surface = EffectiveSurface::from_cards(&parent_cards, &recipient).unwrap(); + let parent_delegation_surface = DelegationSurface::from_cards(&parent_cards); + + let child = card(vec![read_public.clone()], Vec::new()); + let child_surface = EffectiveSurface::from_cards(&[child, companion], &recipient).unwrap(); + let secret_target = fs_target(holder, fs_path(vec![fs_lit("data"), fs_lit("secret.txt")])); + + assert!(!parent_surface.authorize(&secret_target).unwrap()); + assert!(child_surface.authorize(&secret_target).unwrap()); + assert_matches!( + parent_delegation_surface.validate_attenuation( + std::slice::from_ref(&read_public), + &[], + &[], + &[], + ), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) + ); +} + +#[test] +fn attenuation_preserves_parent_denials_and_accepts_additions_on_both_bounds() { + let holder = "acme/shop/prod/cart/agent"; + let parent_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let child_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("file.txt")]), + ); + let added_negative = fs( + holder, + holder, + fs_path(vec![ + fs_lit("other"), + FilesystemPathSegmentPattern::GlobStar, + ]), + ); + let inherited_negative = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let mut parent = card(vec![parent_grant.clone()], vec![parent_grant]); + parent.lower_negative = vec![inherited_negative.clone()]; + parent.upper_negative = vec![inherited_negative.clone()]; + let parent_id = parent.card_id; + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + let resulting_negative = vec![inherited_negative, added_negative]; + + assert_matches!( + parent_surface.validate_attenuation( + std::slice::from_ref(&child_grant), + std::slice::from_ref(&resulting_negative[1]), + &[], + &[], + ), + Err(CardAlgebraError::LowerBoundTooBroad { .. }) + ); + assert_matches!( + parent_surface.validate_attenuation( + &[], + &resulting_negative, + std::slice::from_ref(&child_grant), + std::slice::from_ref(&resulting_negative[1]), + ), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) + ); + + let witness = parent_surface + .validate_attenuation( + std::slice::from_ref(&child_grant), + &resulting_negative, + std::slice::from_ref(&child_grant), + &resulting_negative, + ) + .unwrap(); + + assert_eq!(witness, vec![parent_id]); +} + +#[test] +fn attenuation_witness_excludes_grantless_lower_denial_parent() { + let holder = "acme/shop/prod/cart/agent"; + let parent_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let child_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let inherited_negative = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let granting_parent = card(vec![parent_grant], Vec::new()); + let granting_parent_id = granting_parent.card_id; + let mut denial_parent = card(Vec::new(), Vec::new()); + denial_parent.lower_negative = vec![inherited_negative.clone()]; + let parent_surface = DelegationSurface::from_cards(&[granting_parent, denial_parent]); + + let witness = parent_surface + .validate_attenuation(std::slice::from_ref(&child_grant), &[], &[], &[]) + .unwrap(); + + assert_eq!(witness, vec![granting_parent_id]); +} + +#[test] +fn attenuation_does_not_preserve_a_parent_denial_with_an_unrelated_recipient() { + let holder = "acme/shop/prod/cart/agent"; + let recipient = RecipientPattern::parse(holder).unwrap(); + let parent_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let child_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let inherited_negative = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let unrelated_recipient_negative = fs( + holder, + "other/shop/prod/cart/agent", + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let mut parent = card(vec![parent_grant.clone()], vec![parent_grant]); + parent.lower_negative = vec![inherited_negative.clone()]; + parent.upper_negative = vec![inherited_negative.clone()]; + let parent_delegation_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + let parent_surface = + EffectiveSurface::from_cards(std::slice::from_ref(&parent), &recipient).unwrap(); + let mut child = card(vec![child_grant.clone()], vec![child_grant.clone()]); + child.lower_negative = vec![unrelated_recipient_negative.clone()]; + child.upper_negative = vec![unrelated_recipient_negative.clone()]; + let child_surface = + EffectiveSurface::from_cards(std::slice::from_ref(&child), &recipient).unwrap(); + let denied_target = fs_target(holder, fs_path(vec![fs_lit("data"), fs_lit("secret.txt")])); + + assert!(!parent_surface.authorize(&denied_target).unwrap()); + assert!(child_surface.authorize(&denied_target).unwrap()); + + assert_matches!( + parent_delegation_surface.validate_attenuation( + std::slice::from_ref(&child_grant), + std::slice::from_ref(&unrelated_recipient_negative), + &[], + &[], + ), + Err(CardAlgebraError::LowerBoundTooBroad { .. }) + ); + assert_matches!( + parent_delegation_surface.validate_attenuation( + &[], + std::slice::from_ref(&inherited_negative), + std::slice::from_ref(&child_grant), + std::slice::from_ref(&unrelated_recipient_negative), + ), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) + ); +} + +#[test] +fn attenuation_keeps_inherited_denials_scoped_to_the_parent_recipient() { + let holder = "acme/shop/prod/cart/agent"; + let child_recipient = "acme/shop/prod/cart/child"; + let parent_grant = fs( + holder, + "*", + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let child_grant = fs( + holder, + child_recipient, + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let inherited_negative = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let mut parent = card(vec![parent_grant], Vec::new()); + parent.lower_negative = vec![inherited_negative.clone()]; + parent.upper_negative = vec![inherited_negative.clone()]; + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + + let lower_result = parent_surface.validate_attenuation( + std::slice::from_ref(&child_grant), + std::slice::from_ref(&inherited_negative), + &[], + std::slice::from_ref(&inherited_negative), + ); + let upper_result = parent_surface.validate_attenuation( + &[], + std::slice::from_ref(&inherited_negative), + std::slice::from_ref(&child_grant), + std::slice::from_ref(&inherited_negative), + ); + + assert!( + lower_result.is_ok() && upper_result.is_ok(), + "lower: {lower_result:?}, upper: {upper_result:?}" + ); +} + +#[test] +fn attenuation_rejects_narrowing_an_inherited_upper_denial_recipient() { + let holder = "acme/shop/prod/cart/agent"; + let parent_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let inherited_negative = fs( + holder, + "*", + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let narrowed_negative = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let mut parent = card(Vec::new(), vec![parent_grant.clone()]); + parent.upper_negative = vec![inherited_negative]; + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + + assert_matches!( + parent_surface.validate_attenuation( + &[], + &[], + std::slice::from_ref(&parent_grant), + std::slice::from_ref(&narrowed_negative), + ), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) + ); +} + +#[test] +fn attenuation_rejects_omitting_selected_parent_denials_for_other_recipients() { + let holder = "acme/shop/prod/cart/agent"; + let other_recipient = "acme/shop/prod/cart/other"; + let parent_grant = fs( + holder, + "*", + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let inherited_negative = fs( + holder, + other_recipient, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let mut parent = card(vec![parent_grant.clone()], Vec::new()); + parent.lower_negative = vec![inherited_negative]; + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + + assert_matches!( + parent_surface.validate_attenuation(std::slice::from_ref(&parent_grant), &[], &[], &[],), + Err(CardAlgebraError::LowerBoundTooBroad { .. }) + ); +} + +#[test] +fn attenuation_rejects_upper_denial_scoped_away_from_lower_recipient() { + let holder = "acme/shop/prod/cart/agent"; + let lower_recipient = "acme/shop/prod/cart/child"; + let unrelated_upper_recipient = "acme/shop/prod/cart/other"; + let parent_grant = fs( + holder, + "*", + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let inherited_negative = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let mut parent = card(vec![parent_grant], Vec::new()); + parent.upper_negative = vec![inherited_negative]; + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + let parent_effective_surface = EffectiveSurface::from_cards( + std::slice::from_ref(&parent), + &RecipientPattern::parse(holder).unwrap(), + ) + .unwrap(); + + let child_lower = fs( + holder, + lower_recipient, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let child_upper = fs( + holder, + unrelated_upper_recipient, + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let child_negative = fs( + holder, + unrelated_upper_recipient, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let mut child = card(vec![child_lower.clone()], vec![child_upper.clone()]); + child.upper_negative = vec![child_negative.clone()]; + let child_surface = EffectiveSurface::from_cards( + std::slice::from_ref(&child), + &RecipientPattern::parse(lower_recipient).unwrap(), + ) + .unwrap(); + let secret = fs_target(holder, fs_path(vec![fs_lit("data"), fs_lit("secret.txt")])); + + assert!(!parent_effective_surface.authorize(&secret).unwrap()); + assert!(child_surface.authorize(&secret).unwrap()); + assert_matches!( + parent_surface.validate_attenuation( + std::slice::from_ref(&child_lower), + &[], + std::slice::from_ref(&child_upper), + std::slice::from_ref(&child_negative), + ), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) + ); +} + +#[test] +fn attenuation_accepts_retained_negative_only_ceiling_without_lower_grants() { + let holder = "acme/shop/prod/cart/agent"; + let inherited_negative = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let retained_negative = fs( + holder, + "*", + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let mut parent = card(Vec::new(), Vec::new()); + parent.upper_negative = vec![inherited_negative]; + let parent_id = parent.card_id; + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + + let witness = parent_surface + .validate_attenuation(&[], &[], &[], std::slice::from_ref(&retained_negative)) + .unwrap(); + + assert_eq!(witness, vec![parent_id]); +} + +#[test] +fn attenuation_rejects_negative_only_child_ceiling_that_drops_parent_positive_ceiling() { + let holder = "acme/shop/prod/cart/agent"; + let recipient = RecipientPattern::parse(holder).unwrap(); + let parent_upper = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let deny_parent_upper = fs(holder, holder, FilesystemResourcePattern::any()); + let network_grant = network(holder, NetworkResourcePattern::Any); + let network_target = network_grant.to_target(); + let parent = card(Vec::new(), vec![parent_upper]); + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + let companion = card(vec![network_grant], Vec::new()); + let parent_effective_surface = + EffectiveSurface::from_cards(&[parent, companion.clone()], &recipient).unwrap(); + let mut child_ceiling = card(Vec::new(), Vec::new()); + child_ceiling.upper_negative = vec![deny_parent_upper.clone()]; + let child_effective_surface = + EffectiveSurface::from_cards(&[child_ceiling, companion], &recipient).unwrap(); + + assert!(!parent_effective_surface.authorize(&network_target).unwrap()); + assert!(child_effective_surface.authorize(&network_target).unwrap()); + + assert_matches!( + parent_surface.validate_attenuation( + &[], + &[], + &[], + std::slice::from_ref(&deny_parent_upper), + ), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) + ); +} + +#[test] +fn attenuation_requires_retaining_positive_ceiling_even_when_negative_denies_it() { + let holder = "acme/shop/prod/cart/agent"; + let parent_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let child_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let deny_everything = fs(holder, holder, FilesystemResourcePattern::any()); + let parent = card(vec![parent_grant.clone()], vec![parent_grant.clone()]); + let parent_id = parent.card_id; + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + + assert_matches!( + parent_surface.validate_attenuation( + std::slice::from_ref(&child_grant), + &[], + &[], + std::slice::from_ref(&deny_everything), + ), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) + ); + + let witness = parent_surface + .validate_attenuation( + std::slice::from_ref(&child_grant), + &[], + std::slice::from_ref(&parent_grant), + std::slice::from_ref(&deny_everything), + ) + .unwrap(); + + assert_eq!(witness, vec![parent_id]); +} + +#[test] +fn attenuation_accepts_identical_fully_denied_parent_ceiling() { + let holder = "acme/shop/prod/cart/agent"; + let retained_positive = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let mut parent = card(Vec::new(), vec![retained_positive.clone()]); + parent.upper_negative = vec![retained_positive.clone()]; + let parent_id = parent.card_id; + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + + let witness = parent_surface + .validate_attenuation( + &[], + &[], + std::slice::from_ref(&retained_positive), + std::slice::from_ref(&retained_positive), + ) + .unwrap(); + + assert_eq!(witness, vec![parent_id]); +} + +#[test] +fn attenuation_accepts_identical_fully_denied_parent_lower_bound() { + let holder = "acme/shop/prod/cart/agent"; + let retained_positive = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let mut parent = card(vec![retained_positive.clone()], Vec::new()); + parent.lower_negative = vec![retained_positive.clone()]; + let parent_id = parent.card_id; + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + + let witness = parent_surface + .validate_attenuation( + std::slice::from_ref(&retained_positive), + std::slice::from_ref(&retained_positive), + &[], + &[], + ) + .unwrap(); + + assert_eq!(witness, vec![parent_id]); +} + +#[test] +fn attenuation_accepts_fully_denied_ceiling_against_implicit_and_explicit_top() { + macro_rules! grant { + ($variant:ident, $owner:expr, $resource:expr) => { + PermissionPattern::$variant(ClassPermissionPattern { + verb: None, + owner: $owner, + recipient: RecipientPattern::Any, + resource: $resource, + }) + }; + } + + let universal = vec![ + grant!( + Filesystem, + AgentOwnerPattern::AnyAgents, + FilesystemResourcePattern::any() + ), + grant!(Network, EmptyOwnerPattern, NetworkResourcePattern::Any), + grant!(Env, AgentOwnerPattern::AnyAgents, EnvResourcePattern::Any), + grant!( + Oplog, + AgentOwnerPattern::AnyAgents, + OplogResourcePattern::Any + ), + grant!( + Config, + AgentOwnerPattern::AnyAgents, + ConfigResourcePattern::Any + ), + grant!( + Secret, + EnvironmentOwnerPattern::AnyEnvironments, + SecretResourcePattern::Any + ), + grant!( + Agent, + AgentOwnerPattern::AnyAgents, + AgentResourcePattern::Any + ), + grant!(Tool, ToolOwnerPattern::AnyTools, ToolResourcePattern::any()), + grant!( + Kv, + EnvironmentOwnerPattern::AnyEnvironments, + KvResourcePattern::any() + ), + grant!( + Blob, + EnvironmentOwnerPattern::AnyEnvironments, + BlobResourcePattern::any() + ), + grant!( + Rdbms, + EnvironmentOwnerPattern::AnyEnvironments, + RdbmsResourcePattern::any() + ), + grant!(Card, AccountOwnerPattern::Any, CardResourcePattern::Any), + grant!(System, EmptyOwnerPattern, SystemResourcePattern), + grant!(Plan, EmptyOwnerPattern, PlanResourcePattern::Any), + grant!(Account, AccountOwnerPattern::Any, AccountResourcePattern), + grant!( + AccountUsage, + AccountOwnerPattern::Any, + AccountUsageResourcePattern + ), + grant!( + AccountToken, + AccountOwnerPattern::Any, + AccountTokenResourcePattern::Any + ), + grant!( + AccountPlugin, + AccountOwnerPattern::Any, + AccountPluginResourcePattern::Any + ), + grant!( + Application, + ApplicationOwnerPattern::AnyApplications, + ApplicationResourcePattern + ), + grant!( + Environment, + EnvironmentOwnerPattern::AnyEnvironments, + EnvironmentResourcePattern::Any + ), + grant!( + EnvironmentPluginGrant, + EnvironmentOwnerPattern::AnyEnvironments, + EnvironmentPluginGrantResourcePattern::Any + ), + grant!( + EnvironmentDomainRegistration, + EnvironmentOwnerPattern::AnyEnvironments, + EnvironmentDomainRegistrationResourcePattern::Any + ), + grant!( + EnvironmentSecurityScheme, + EnvironmentOwnerPattern::AnyEnvironments, + EnvironmentSecuritySchemeResourcePattern::Any + ), + grant!( + EnvironmentHttpApiDeployment, + EnvironmentOwnerPattern::AnyEnvironments, + EnvironmentHttpApiDeploymentResourcePattern::Any + ), + grant!( + EnvironmentMcpDeployment, + EnvironmentOwnerPattern::AnyEnvironments, + EnvironmentMcpDeploymentResourcePattern::Any + ), + grant!( + EnvironmentAgentSecret, + EnvironmentOwnerPattern::AnyEnvironments, + EnvironmentAgentSecretResourcePattern::Any + ), + grant!( + EnvironmentResourceDefinition, + EnvironmentOwnerPattern::AnyEnvironments, + EnvironmentResourceDefinitionResourcePattern::Any + ), + grant!( + EnvironmentRetryPolicy, + EnvironmentOwnerPattern::AnyEnvironments, + EnvironmentRetryPolicyResourcePattern::Any + ), + grant!( + Component, + ComponentOwnerPattern::AnyComponents, + ComponentResourcePattern::Any + ), + grant!( + AccountOauth2Identity, + AccountOwnerPattern::Any, + AccountOauth2IdentityResourcePattern::Any + ), + grant!( + EnvironmentInitialFiles, + ComponentOwnerPattern::AnyComponents, + EnvironmentInitialFilesResourcePattern::any() + ), + grant!( + EnvironmentKvBucket, + EnvironmentOwnerPattern::AnyEnvironments, + EnvironmentKvBucketResourcePattern::Any + ), + grant!( + EnvironmentBlobBucket, + EnvironmentOwnerPattern::AnyEnvironments, + EnvironmentBlobBucketResourcePattern::Any + ), + grant!( + AccountPermissionShare, + AccountOwnerPattern::Any, + AccountPermissionShareResourcePattern::Any + ), + ]; + assert_eq!(universal.len(), 34); + + let implicit_top = card(Vec::new(), Vec::new()); + let implicit_top_surface = DelegationSurface::from_cards(std::slice::from_ref(&implicit_top)); + assert!( + implicit_top_surface + .validate_attenuation(&[], &[], &[], &universal) + .is_ok(), + "the implicit top representation accepts the same empty child ceiling" + ); + + let explicit_top = card(Vec::new(), universal.clone()); + let surface = DelegationSurface::from_cards(std::slice::from_ref(&explicit_top)); + + let result = surface.validate_attenuation(&[], &[], &universal, &universal); + + assert!( + result.is_ok(), + "a retained child ceiling denying every permission is a subset of an explicit top ceiling: {result:?}" + ); +} + +#[test] +fn attenuation_accepts_exactly_retained_negative_only_ceiling() { + let holder = "acme/shop/prod/cart/agent"; + let inherited_negative = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let mut parent = card(Vec::new(), Vec::new()); + parent.upper_negative = vec![inherited_negative.clone()]; + let parent_id = parent.card_id; + let parent_surface = DelegationSurface::from_cards(std::slice::from_ref(&parent)); + + let witness = parent_surface + .validate_attenuation(&[], &[], &[], std::slice::from_ref(&inherited_negative)) + .unwrap(); + + assert_eq!(witness, vec![parent_id]); +} + +#[test] +fn attenuation_rejects_negative_only_ceiling_retained_for_another_recipient() { + let holder = "acme/shop/prod/cart/agent"; + let other_recipient = "acme/shop/prod/cart/other"; + let inherited_negative = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let mismatched_negative = fs( + holder, + other_recipient, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + let lower_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("secret.txt")]), + ); + + let mut parent_ceiling = card(Vec::new(), Vec::new()); + parent_ceiling.upper_negative = vec![inherited_negative]; + let companion = card(vec![lower_grant], Vec::new()); + let recipient = RecipientPattern::parse(holder).unwrap(); + let parent_surface = + EffectiveSurface::from_cards(&[parent_ceiling.clone(), companion.clone()], &recipient) + .unwrap(); + + let mut child_ceiling = card(Vec::new(), Vec::new()); + child_ceiling.upper_negative = vec![mismatched_negative.clone()]; + let child_surface = + EffectiveSurface::from_cards(&[child_ceiling, companion], &recipient).unwrap(); + let secret = fs_target(holder, fs_path(vec![fs_lit("data"), fs_lit("secret.txt")])); + + assert!(!parent_surface.authorize(&secret).unwrap()); + assert!(child_surface.authorize(&secret).unwrap()); + + let parent_ceiling_surface = + DelegationSurface::from_cards(std::slice::from_ref(&parent_ceiling)); + assert_matches!( + parent_ceiling_surface.validate_attenuation( + &[], + &[], + &[], + std::slice::from_ref(&mismatched_negative), + ), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) + ); +} + +#[test] +fn wallet_derivation_parent_selection_chooses_highest_qualifying_card_id() { + let holder = "acme/shop/prod/cart/agent"; + let parent_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let child_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let lower_id = CardId(Uuid::from_u128(1)); + let higher_id = CardId(Uuid::from_u128(2)); + let mut lower = card(vec![parent_grant.clone()], Vec::new()); + lower.card_id = lower_id; + let mut higher = card(vec![parent_grant], Vec::new()); + higher.card_id = higher_id; + + for cards in [ + vec![lower.clone(), higher.clone()], + vec![higher.clone(), lower.clone()], + ] { + assert_eq!( + DelegationSurface::from_cards(&cards) + .select_wallet_derivation_parent(std::slice::from_ref(&child_grant), &[], &[], &[],) + .unwrap(), + WalletDerivationParent::Single(higher_id) + ); + } +} + +#[test] +fn wallet_derivation_parent_selection_detects_multi_source_lower_union() { + let holder = "acme/shop/prod/cart/agent"; + let first_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("first.txt")]), + ); + let second_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("second.txt")]), + ); + let parents = [ + card(vec![first_grant.clone()], Vec::new()), + card(vec![second_grant.clone()], Vec::new()), + ]; + + assert_eq!( + DelegationSurface::from_cards(&parents) + .select_wallet_derivation_parent(&[first_grant, second_grant], &[], &[], &[],) + .unwrap(), + WalletDerivationParent::MultipleRequired + ); +} + +#[test] +fn wallet_derivation_parent_selection_rejects_empty_wallet() { + assert_eq!( + DelegationSurface::default() + .select_wallet_derivation_parent(&[], &[], &[], &[]) + .unwrap(), + WalletDerivationParent::NotPermitted + ); +} + +#[test] +fn wallet_derivation_parent_selection_preserves_combined_attenuation_failure() { + let holder = "acme/shop/prod/cart/agent"; + let available_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("available.txt")]), + ); + let unavailable_grant = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("unavailable.txt")]), + ); + let surface = DelegationSurface::from_cards(&[card(vec![available_grant], Vec::new())]); + + assert_matches!( + surface.select_wallet_derivation_parent( + std::slice::from_ref(&unavailable_grant), + &[], + &[], + &[], + ), + Err(CardAlgebraError::LowerBoundTooBroad { grant }) if *grant == unavailable_grant + ); +} + +#[test] +fn wallet_derivation_parent_selection_applies_upper_intersection_after_lower_union() { + let holder = "acme/shop/prod/cart/agent"; + let first_lower = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("first.txt")]), + ); + let second_lower = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("second.txt")]), + ); + let broad_upper = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), FilesystemPathSegmentPattern::GlobStar]), + ); + let narrow_upper = fs( + holder, + holder, + fs_path(vec![fs_lit("data"), fs_lit("public.txt")]), + ); + let parents = [ + card(vec![first_lower.clone()], vec![broad_upper.clone()]), + card(vec![second_lower.clone()], vec![narrow_upper]), + ]; + + assert_matches!( + DelegationSurface::from_cards(&parents).select_wallet_derivation_parent( + &[first_lower, second_lower], + &[], + std::slice::from_ref(&broad_upper), + &[], + ), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) ); } diff --git a/golem-common/src/base_model/card/tests.rs b/golem-common/src/base_model/card/tests.rs index 4eddb78f31..68a7aa87e6 100644 --- a/golem-common/src/base_model/card/tests.rs +++ b/golem-common/src/base_model/card/tests.rs @@ -13,6 +13,11 @@ // limitations under the License. use super::*; +use crate::base_model::account::AccountId; +use crate::base_model::agent::AgentTypeName; +use crate::base_model::component::{ComponentId, ComponentRevision}; +use crate::base_model::environment::EnvironmentId; +use crate::base_model::{AgentId, IdempotencyKey, OplogIndex}; use crate::model::card::owner::{AgentOwnerPattern, EnvironmentOwnerPattern}; use crate::model::card::recipient::RecipientPattern; use RecipientPattern as AccountRecipientPattern; @@ -20,6 +25,167 @@ use RecipientPattern as AgentRecipientPattern; use RecipientPattern as EnvironmentRecipientPattern; use chrono::Utc; use test_r::test; +use uuid::uuid; + +#[derive(desert_rust::BinaryCodec)] +enum LegacyCardManagedBy { + AccountRoot(CardManagedByAccountRoot), + EnvironmentDefault(CardManagedByEnvironmentDefault), + PermissionShare(CardManagedByPermissionShare), + AgentInitial(CardManagedByAgentInitial), +} + +#[test] +fn runtime_derived_provenance_preserves_existing_managed_by_encoding() { + let account_root = CardManagedByAccountRoot { + account_id: AccountId(uuid!("00112233-4455-6677-8899-aabbccddeeff")), + }; + let environment_default = CardManagedByEnvironmentDefault { + environment_id: EnvironmentId(uuid!("11223344-5566-7788-99aa-bbccddeeff00")), + }; + let permission_share = CardManagedByPermissionShare { + permission_share_id: uuid!("22334455-6677-8899-aabb-ccddeeff0011"), + }; + let agent_initial = CardManagedByAgentInitial { + component_id: ComponentId(uuid!("33445566-7788-99aa-bbcc-ddeeff001122")), + component_revision: ComponentRevision::new(7).unwrap(), + agent_type: AgentTypeName("cart".to_string()), + }; + let cases = [ + ( + LegacyCardManagedBy::AccountRoot(account_root.clone()), + CardManagedBy::AccountRoot(account_root), + ), + ( + LegacyCardManagedBy::EnvironmentDefault(environment_default.clone()), + CardManagedBy::EnvironmentDefault(environment_default), + ), + ( + LegacyCardManagedBy::PermissionShare(permission_share.clone()), + CardManagedBy::PermissionShare(permission_share), + ), + ( + LegacyCardManagedBy::AgentInitial(agent_initial.clone()), + CardManagedBy::AgentInitial(agent_initial), + ), + ]; + + for (legacy, expected) in cases { + let bytes = crate::serialization::serialize(&legacy).unwrap(); + let decoded: CardManagedBy = crate::serialization::deserialize(&bytes).unwrap(); + assert_eq!(decoded, expected); + assert_eq!( + bytes, + crate::serialization::serialize(&expected).unwrap(), + "adding RuntimeDerived must not renumber existing union variants" + ); + } +} + +#[test] +fn runtime_derived_card_provenance_binary_roundtrip() { + let provenance = CardManagedBy::RuntimeDerived(CardManagedByRuntimeDerived { + environment_id: EnvironmentId(uuid!("00112233-4455-6677-8899-aabbccddeeff")), + agent_id: AgentId { + component_id: ComponentId(uuid!("ffeeddcc-bbaa-9988-7766-554433221100")), + agent_id: "cart/primary".to_string(), + }, + invocation_key: IdempotencyKey::new("invocation-42".to_string()), + oplog_index: OplogIndex::from_u64(42), + }); + + let bytes = crate::serialization::serialize(&provenance).unwrap(); + let decoded: CardManagedBy = crate::serialization::deserialize(&bytes).unwrap(); + + assert_eq!(decoded, provenance); +} + +#[test] +fn card_holder_wallet_identity_has_stable_canonical_encoding() { + let wallet_uuid = uuid!("00112233-4455-6677-8899-aabbccddeeff"); + let component_uuid = uuid!("ffeeddcc-bbaa-9988-7766-554433221100"); + + let account = CardHolder::Account(AccountCardHolder { + account_id: wallet_uuid, + }); + let application = CardHolder::Application(ApplicationCardHolder { + application_id: wallet_uuid, + }); + let agent = CardHolder::Agent(AgentCardHolder { + agent_id: AgentId { + component_id: ComponentId(component_uuid), + agent_id: "cart/primary".to_string(), + }, + }); + + assert_eq!( + account.canonical_wallet_id_bytes(), + [ + b"golem:permissions:wallet-id:v1\0".as_slice(), + &[0], + wallet_uuid.as_bytes(), + ] + .concat() + ); + assert_eq!( + application.canonical_wallet_id_bytes(), + [ + b"golem:permissions:wallet-id:v1\0".as_slice(), + &[1], + wallet_uuid.as_bytes(), + ] + .concat() + ); + assert_eq!( + agent.canonical_wallet_id_bytes(), + [ + b"golem:permissions:wallet-id:v1\0".as_slice(), + &[2], + component_uuid.as_bytes(), + &12_u64.to_be_bytes(), + b"cart/primary".as_slice(), + ] + .concat() + ); +} + +#[test] +fn card_holder_wallet_id_hash_has_golden_vectors() { + let wallet_uuid = uuid!("00112233-4455-6677-8899-aabbccddeeff"); + let component_uuid = uuid!("ffeeddcc-bbaa-9988-7766-554433221100"); + + let account = CardHolder::Account(AccountCardHolder { + account_id: wallet_uuid, + }); + let application = CardHolder::Application(ApplicationCardHolder { + application_id: wallet_uuid, + }); + let agent = CardHolder::Agent(AgentCardHolder { + agent_id: AgentId { + component_id: ComponentId(component_uuid), + agent_id: "cart/primary".to_string(), + }, + }); + + assert_eq!( + account.wallet_id_hash(), + *blake3::Hash::from_hex("56e13114d62d58ac0cb1ecdd8848b0394a16b90ba3031d4d3b36bfd58b6c52cd") + .unwrap() + .as_bytes() + ); + assert_eq!( + application.wallet_id_hash(), + *blake3::Hash::from_hex("b89907b4b6404484d37b5eca9875eb7e46d8091d0aecb6f9b7301ba2c56b705f") + .unwrap() + .as_bytes() + ); + assert_eq!( + agent.wallet_id_hash(), + *blake3::Hash::from_hex("870da9d5773f7bd02afe111d0a8546316bbf8e645209949cdfa879edf9804ac4") + .unwrap() + .as_bytes() + ); +} fn fs(owner: &str, recipient: &str, resource: FilesystemResourcePattern) -> PermissionPattern { PermissionPattern::Filesystem(ClassPermissionPattern:: { @@ -199,20 +365,30 @@ fn upper_negative_without_positive_is_unrestricted_except_denials() { vec![reveal_secret.clone()], ); let surface = EffectiveSurface::from_cards(&[lower, ceiling.clone()], &recipient).unwrap(); - let ceiling_surface = - EffectiveSurface::from_cards(std::slice::from_ref(&ceiling), &recipient).unwrap(); + let ceiling_surface = DelegationSurface::from_cards(std::slice::from_ref(&ceiling)); assert!(surface.authorize(&read_tmp_target).unwrap()); assert!(!surface.authorize(&reveal_secret_target).unwrap()); assert!( ceiling_surface - .validates_derivation(&[], std::slice::from_ref(&read_tmp)) + .validate_attenuation( + &[], + &[], + std::slice::from_ref(&read_tmp), + std::slice::from_ref(&reveal_secret), + ) + .is_ok() + ); + assert!( + ceiling_surface + .validate_attenuation( + &[], + &[], + std::slice::from_ref(&reveal_secret), + std::slice::from_ref(&reveal_secret), + ) .is_ok() ); - assert!(matches!( - ceiling_surface.validates_derivation(&[], std::slice::from_ref(&reveal_secret)), - Err(CardAlgebraError::DerivationNotSubsumed { .. }) - )); } #[test] @@ -266,7 +442,6 @@ fn lower_negative_is_scoped_to_its_card() { #[test] fn derivation_upper_bound_uses_parent_ceiling_intersection() { let holder = "acme/shop/prod/cart/agent"; - let recipient = RecipientPattern::parse(holder).unwrap(); let read_all = fs( holder, holder, @@ -295,19 +470,27 @@ fn derivation_upper_bound_uses_parent_ceiling_intersection() { Vec::new(), vec![read_secret.clone()], ); - let parent_surface = - EffectiveSurface::from_cards(&[parent_allow, parent_deny], &recipient).unwrap(); + let parent_surface = DelegationSurface::from_cards(&[parent_allow, parent_deny]); assert!(matches!( - parent_surface.validates_derivation(&[], std::slice::from_ref(&read_secret)), - Err(CardAlgebraError::DerivationNotSubsumed { .. }) + parent_surface.validate_attenuation(&[], &[], std::slice::from_ref(&read_secret), &[],), + Err(CardAlgebraError::UpperBoundTooBroad { .. }) )); + assert!( + parent_surface + .validate_attenuation( + &[], + &[], + std::slice::from_ref(&read_secret), + std::slice::from_ref(&read_secret), + ) + .is_ok() + ); } #[test] fn derivation_witness_excludes_unrelated_parent() { let holder = "acme/shop/prod/cart/agent"; - let recipient = RecipientPattern::parse(holder).unwrap(); let read_tmp = fs( holder, holder, @@ -323,11 +506,10 @@ fn derivation_witness_excludes_unrelated_parent() { let needed_parent = card(vec![read_tmp.clone()], Vec::new()); let needed_parent_id = needed_parent.card_id; let unrelated_parent = card(vec![reveal_secret], Vec::new()); - let surface = - EffectiveSurface::from_cards(&[needed_parent, unrelated_parent], &recipient).unwrap(); + let surface = DelegationSurface::from_cards(&[needed_parent, unrelated_parent]); let witness = surface - .validates_derivation(std::slice::from_ref(&read_tmp), &[]) + .validate_attenuation(std::slice::from_ref(&read_tmp), &[], &[], &[]) .unwrap(); assert_eq!(witness, vec![needed_parent_id]); @@ -336,7 +518,6 @@ fn derivation_witness_excludes_unrelated_parent() { #[test] fn derivation_witness_includes_multiple_needed_parents() { let holder = "acme/shop/prod/cart/agent"; - let recipient = RecipientPattern::parse(holder).unwrap(); let read_tmp = fs( holder, holder, @@ -353,11 +534,10 @@ fn derivation_witness_includes_multiple_needed_parents() { let filesystem_parent_id = filesystem_parent.card_id; let secret_parent = card(vec![reveal_secret.clone()], Vec::new()); let secret_parent_id = secret_parent.card_id; - let surface = - EffectiveSurface::from_cards(&[filesystem_parent, secret_parent], &recipient).unwrap(); + let surface = DelegationSurface::from_cards(&[filesystem_parent, secret_parent]); let witness = surface - .validates_derivation(&[read_tmp, reveal_secret], &[]) + .validate_attenuation(&[read_tmp, reveal_secret], &[], &[], &[]) .unwrap(); assert_eq!(witness, vec![filesystem_parent_id, secret_parent_id]); diff --git a/golem-common/src/base_model/card/types.rs b/golem-common/src/base_model/card/types.rs index e0309e9856..f5d8fd3526 100644 --- a/golem-common/src/base_model/card/types.rs +++ b/golem-common/src/base_model/card/types.rs @@ -17,15 +17,48 @@ use crate::base_model::account::AccountId; use crate::base_model::agent::AgentTypeName; use crate::base_model::component::{ComponentId, ComponentRevision}; use crate::base_model::environment::EnvironmentId; +use crate::base_model::{AgentId, IdempotencyKey, OplogIndex}; use crate::{declare_revision, declare_structs, declare_unions, newtype_uuid}; use chrono::{DateTime, Utc}; use uuid::Uuid; newtype_uuid!(CardId, wit_name: "card-id", wit_owner: "golem:core@2.0.0/types"); +#[cfg(feature = "full")] +impl From for golem_schema::schema::wit::wire::CardId { + fn from(card_id: CardId) -> Self { + card_id.0.into() + } +} + declare_revision!(CardRevision); declare_structs! { + #[derive(Eq)] + #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] + #[cfg_attr(feature = "full", desert(evolution()))] + pub struct WalletVersionToken { + pub wallet_id_hash: [u8; 32], + pub generation: u64, + } + + #[derive(Eq)] + #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] + #[cfg_attr(feature = "full", desert(evolution()))] + pub struct InvocationWalletPin { + pub wallet_token: WalletVersionToken, + pub pinned_card_ids: Vec, + pub scope_card_id: Option, + } + + #[derive(Eq)] + #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] + #[cfg_attr(feature = "full", desert(evolution()))] + pub struct PublicInvocationWalletPin { + pub wallet_token: WalletVersionToken, + pub scope_card_id: Option, + } + #[derive(Eq)] #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] pub struct CardManagedByAccountRoot { @@ -52,6 +85,16 @@ declare_structs! { pub agent_type: AgentTypeName, } + #[derive(Eq)] + #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] + #[cfg_attr(feature = "full", desert(evolution()))] + pub struct CardManagedByRuntimeDerived { + pub environment_id: EnvironmentId, + pub agent_id: AgentId, + pub invocation_key: IdempotencyKey, + pub oplog_index: OplogIndex, + } + #[derive(Eq)] #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] pub struct Card { @@ -67,6 +110,17 @@ declare_structs! { pub managed_by: Option, } + #[derive(Eq)] + #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] + pub struct ScopeCard { + pub scope_card_id: CardId, + pub root_card_ids: Vec, + pub lower_positive: Vec, + pub lower_negative: Vec, + pub upper_positive: Vec, + pub upper_negative: Vec, + } + #[derive(Eq)] #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] pub struct PolymorphicCard { @@ -80,6 +134,27 @@ declare_structs! { pub expires_at: Option>, pub system_card: bool, } + + #[derive(Eq)] + #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] + #[cfg_attr(feature = "full", desert(evolution()))] + pub struct AccountCardHolder { + pub account_id: Uuid, + } + + #[derive(Eq)] + #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] + #[cfg_attr(feature = "full", desert(evolution()))] + pub struct ApplicationCardHolder { + pub application_id: Uuid, + } + + #[derive(Eq)] + #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] + #[cfg_attr(feature = "full", desert(evolution()))] + pub struct AgentCardHolder { + pub agent_id: AgentId, + } } declare_unions! { @@ -97,6 +172,53 @@ declare_unions! { EnvironmentDefault(CardManagedByEnvironmentDefault), PermissionShare(CardManagedByPermissionShare), AgentInitial(CardManagedByAgentInitial), + RuntimeDerived(CardManagedByRuntimeDerived), + } + + #[derive(Eq)] + #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] + pub enum CardHolder { + Account(AccountCardHolder), + Application(ApplicationCardHolder), + Agent(AgentCardHolder), + } +} + +pub type PublicCardHolder = CardHolder; + +impl CardHolder { + const WALLET_ID_ENCODING_DOMAIN: &'static [u8] = b"golem:permissions:wallet-id:v1\0"; + + /// Encodes the wallet owner using the stable, versioned wallet identity format. + /// + /// UUIDs use RFC 4122 network byte order. Agent IDs encode the component UUID + /// followed by the big-endian byte length and UTF-8 bytes of the agent name. + pub fn canonical_wallet_id_bytes(&self) -> Vec { + let mut bytes = Vec::from(Self::WALLET_ID_ENCODING_DOMAIN); + match self { + Self::Account(holder) => { + bytes.push(0); + bytes.extend_from_slice(holder.account_id.as_bytes()); + } + Self::Application(holder) => { + bytes.push(1); + bytes.extend_from_slice(holder.application_id.as_bytes()); + } + Self::Agent(holder) => { + bytes.push(2); + bytes.extend_from_slice(holder.agent_id.component_id.0.as_bytes()); + let agent_id = holder.agent_id.agent_id.as_bytes(); + let length = u64::try_from(agent_id.len()) + .expect("agent ID byte length does not fit into u64"); + bytes.extend_from_slice(&length.to_be_bytes()); + bytes.extend_from_slice(agent_id); + } + } + bytes + } + + pub fn wallet_id_hash(&self) -> [u8; 32] { + *blake3::hash(&self.canonical_wallet_id_bytes()).as_bytes() } } @@ -134,6 +256,13 @@ impl StoredCard { } } + pub fn created_at(&self) -> DateTime { + match self { + Self::Concrete(card) => card.created_at, + Self::Polymorphic(card) => card.created_at, + } + } + pub fn system_card(&self) -> bool { match self { Self::Concrete(card) => card.system_card, diff --git a/golem-common/src/base_model/oplog/mod.rs b/golem-common/src/base_model/oplog/mod.rs index 68a4ed8b0e..d6240ff500 100644 --- a/golem-common/src/base_model/oplog/mod.rs +++ b/golem-common/src/base_model/oplog/mod.rs @@ -23,9 +23,9 @@ use crate::base_model::invocation_context::SpanId; use crate::base_model::regions::OplogRegion; use crate::base_model::{AgentId, IdempotencyKey, OplogIndex, Timestamp, TransactionId}; use crate::model::account::AccountId; -use crate::model::card::CardId; #[cfg(feature = "full")] -use crate::model::card::StoredCard; +use crate::model::card::{CardHolder, InvocationWalletPin, StoredCard}; +use crate::model::card::{CardId, PublicCardHolder, PublicInvocationWalletPin}; use crate::oplog_entry; use crate::schema::TypedSchemaValue; pub use public_types::*; @@ -173,6 +173,7 @@ oplog_entry! { } }, /// The agent has been invoked + #[desert(evolution(FieldAdded("wallet_pin", None::)))] AgentInvocationStarted { hint: false wit_raw_type: "raw-agent-invocation-started-parameters" @@ -183,9 +184,11 @@ oplog_entry! { trace_id: TraceId, trace_states: Vec, invocation_context: Vec, + wallet_pin: Option, } public { invocation: PublicAgentInvocation, + wallet_pin: Option, } }, /// The agent has completed an invocation @@ -615,6 +618,7 @@ oplog_entry! { } }, /// A snapshot of the agent's state + #[desert(evolution(FieldAdded("wallet_generation", 0_u64)))] Snapshot { hint: true wit_raw_type: "raw-snapshot-parameters" @@ -623,6 +627,7 @@ oplog_entry! { data: payload::OplogPayload>, mime_type: String, active_cards: Vec, + wallet_generation: u64, } public { data: PublicSnapshotData @@ -685,6 +690,7 @@ oplog_entry! { } }, /// Records successful installation of a permission card into the agent wallet. + #[desert(evolution(FieldAdded("wallet_generation", None::)))] CardInstalled { hint: true wit_raw_type: "raw-card-installed-parameters" @@ -692,10 +698,12 @@ oplog_entry! { raw { queued_event_index: Option, card: StoredCard, + wallet_generation: Option, } public { queued_event_index: Option, card_id: CardId, + wallet_generation: Option, } }, /// Records failed installation of a permission card into the agent wallet. @@ -715,6 +723,7 @@ oplog_entry! { } }, /// Records that a permission card used by the agent has been revoked. + #[desert(evolution(FieldAdded("wallet_generation", None::)))] CardRevoked { hint: true wit_raw_type: "card-revoked-parameters" @@ -722,22 +731,157 @@ oplog_entry! { raw { queued_event_index: OplogIndex, card_id: CardId, + wallet_generation: Option, } public { queued_event_index: OplogIndex, card_id: CardId, + wallet_generation: Option, } }, /// Records that a permission card used by the agent has expired. + #[desert(evolution(FieldAdded("wallet_generation", None::)))] CardExpired { hint: true wit_raw_type: "card-expired-parameters" wit_public_type: "card-expired-parameters" raw { card_id: CardId, + wallet_generation: Option, } public { card_id: CardId, + wallet_generation: Option, + } + }, + /// Records a permission card derived by the running agent. + #[desert(evolution(FieldAdded("wallet_generation", None::)))] + CardDerived { + hint: true + wit_raw_type: "raw-card-derived-parameters" + wit_public_type: "card-derived-parameters" + raw { + card: StoredCard, + wallet_generation: Option, + } + public { + card_id: CardId, + parent_ids: Vec, + wallet_generation: Option, + } + }, + /// Records a source wallet's durable permission-card transfer intent. + /// + /// This entry is written only to the source agent's oplog. `source_holder` is absent only for + /// legacy entries written before source ownership was captured; the owning oplog identifies + /// the source in that case. `source_wallet_generation`, when present, is the source wallet's + /// new generation after recording the pending transfer. + /// A concrete source card leaves the source wallet at this point, while a polymorphic source + /// remains so that the target can receive a monomorphic child. Retry identity and payload are + /// pinned by the preceding queued transfer event. No entry may advance another wallet's + /// generation. + #[desert(evolution( + FieldAdded("source_holder", None::), + FieldAdded("source_wallet_generation", None::) + ))] + CardTransferStarted { + hint: true + wit_raw_type: "raw-card-transfer-started-parameters" + wit_public_type: "card-transfer-started-parameters" + raw { + transfer_id: Uuid, + card_id: CardId, + source_holder: Option, + target_holder: CardHolder, + source_wallet_generation: Option, + } + public { + /// Identifies a transfer intent recorded by its source agent. + transfer_id: Uuid, + card_id: CardId, + target_holder: PublicCardHolder, + /// New generation of the source wallet that owns this oplog entry. + source_wallet_generation: Option, + } + }, + /// Records a target wallet's durable admission of a transferred permission card. + /// + /// This entry is written only to the target agent's oplog. `source_card_id` is absent only for + /// legacy entries written before source identity was captured. `target_wallet_generation`, + /// when present, is the target wallet's new generation after admission. No entry may advance + /// another wallet's generation. + #[desert(evolution( + FieldAdded("source_card_id", None::), + FieldAdded("target_wallet_generation", None::) + ))] + CardTransferred { + hint: true + wit_raw_type: "raw-card-transferred-parameters" + wit_public_type: "card-transferred-parameters" + raw { + transfer_id: Uuid, + source_card_id: Option, + installed_card_id: CardId, + target_holder: CardHolder, + card: StoredCard, + target_wallet_generation: Option, + } + public { + /// Identifies a target admission recorded by the target agent. + transfer_id: Uuid, + /// Source card identity, absent only on legacy entries. + source_card_id: Option, + installed_card_id: CardId, + target_holder: PublicCardHolder, + /// New generation of the target wallet that owns this oplog entry. + target_wallet_generation: Option, + } + }, + /// Records an atomic revocation of a permission-card DAG subtree. + /// + /// `affected_wallets` describes cascade impact but does not authorize this entry to mutate + /// those wallets. `local_wallet_generation`, when present, is the new generation of the wallet + /// owning this oplog. Each other affected agent records its own local entry. + #[desert(evolution( + FieldRemoved("generation_bumps"), + FieldAdded("local_wallet_generation", None::) + ))] + CardRevokedCascade { + hint: true + wit_raw_type: "raw-card-revoked-cascade-parameters" + wit_public_type: "card-revoked-cascade-parameters" + raw { + revoked_card_ids: Vec, + affected_wallets: Vec, + local_wallet_generation: Option, + } + public { + revoked_card_ids: Vec, + /// New generation of the wallet that owns this oplog entry. + local_wallet_generation: Option, + } + }, + /// Records the source wallet's durable receipt of a target admission. + /// + /// This terminal entry is written only to the source agent's oplog after the target's durable + /// transfer receipt is acknowledged. It closes the matching pending transfer without changing + /// target state or any wallet generation. + CardTransferConfirmed { + hint: true + wit_raw_type: "raw-card-transfer-confirmed-parameters" + wit_public_type: "card-transfer-confirmed-parameters" + raw { + transfer_id: Uuid, + source_card_id: CardId, + installed_card_id: CardId, + target_holder: CardHolder, + } + public { + /// Identifies a target-admission receipt recorded by the source agent. + transfer_id: Uuid, + source_card_id: CardId, + installed_card_id: CardId, + target_holder: PublicCardHolder, } }, /// A durably recorded frame of a host-owned stream (e.g. the outgoing request body of a diff --git a/golem-common/src/base_model/oplog/public_types.rs b/golem-common/src/base_model/oplog/public_types.rs index 7bcd721f32..ecfae3de38 100644 --- a/golem-common/src/base_model/oplog/public_types.rs +++ b/golem-common/src/base_model/oplog/public_types.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::base_model::card::{CardId, StoredCard}; +use crate::base_model::card::{CardHolder, CardId, PublicCardHolder, StoredCard}; use crate::base_model::component::{ComponentRevision, PluginPriority}; use crate::base_model::environment_plugin_grant::EnvironmentPluginGrantId; use crate::base_model::invocation_context::{SpanId, TraceId}; @@ -598,18 +598,68 @@ pub struct PublicQueuedCardEventCard { pub card_id: CardId, } +#[derive(Clone, Debug, PartialEq, Eq)] +#[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] +#[cfg_attr(feature = "full", desert(evolution()))] +pub struct QueuedCardEventTransfer { + pub transfer_id: uuid::Uuid, + pub card_id: CardId, + pub card: Option, + pub target_holder: CardHolder, +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(feature = "full", derive(poem_openapi::Object))] +#[cfg_attr(feature = "full", oai(rename_all = "camelCase"))] +#[serde(rename_all = "camelCase")] +#[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] +#[cfg_attr(feature = "full", desert(evolution()))] +pub struct PublicQueuedCardEventTransfer { + pub transfer_id: uuid::Uuid, + pub card_id: CardId, + pub target_holder: PublicCardHolder, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +#[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] +#[cfg_attr( + feature = "full", + desert(evolution(FieldAdded("source_card_id", None::))) +)] +pub struct QueuedCardEventTransferReceived { + pub transfer_id: uuid::Uuid, + pub source_card_id: Option, + pub card_id: CardId, + pub card: Option, +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(feature = "full", derive(poem_openapi::Object))] +#[cfg_attr(feature = "full", oai(rename_all = "camelCase"))] +#[serde(rename_all = "camelCase")] +#[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] +#[cfg_attr(feature = "full", desert(evolution()))] +pub struct PublicQueuedCardEventTransferReceived { + pub transfer_id: uuid::Uuid, + pub card_id: CardId, +} + #[derive(Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] #[cfg_attr(feature = "full", desert(evolution()))] pub enum QueuedCardEvent { Install(QueuedCardEventCard), Revoke(QueuedCardEventCard), + TransferStarted(QueuedCardEventTransfer), + TransferReceived(QueuedCardEventTransferReceived), } impl QueuedCardEvent { pub fn card_id(&self) -> CardId { match self { Self::Install(event) | Self::Revoke(event) => event.card_id, + Self::TransferStarted(event) => event.card_id, + Self::TransferReceived(event) => event.card_id, } } @@ -627,6 +677,44 @@ impl QueuedCardEvent { card: None, }) } + + pub fn transfer_started( + transfer_id: uuid::Uuid, + card: impl Into, + target_holder: CardHolder, + ) -> Self { + let card = card.into(); + Self::transfer_started_with_source(transfer_id, card.card_id(), card, target_holder) + } + + pub fn transfer_started_with_source( + transfer_id: uuid::Uuid, + source_card_id: CardId, + installed_card: impl Into, + target_holder: CardHolder, + ) -> Self { + let installed_card = installed_card.into(); + Self::TransferStarted(QueuedCardEventTransfer { + transfer_id, + card_id: source_card_id, + card: Some(installed_card), + target_holder, + }) + } + + pub fn transfer_received( + transfer_id: uuid::Uuid, + source_card_id: CardId, + card: impl Into, + ) -> Self { + let card = card.into(); + Self::TransferReceived(QueuedCardEventTransferReceived { + transfer_id, + source_card_id: Some(source_card_id), + card_id: card.card_id(), + card: Some(card), + }) + } } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] @@ -638,12 +726,16 @@ impl QueuedCardEvent { pub enum PublicQueuedCardEvent { Install(PublicQueuedCardEventCard), Revoke(PublicQueuedCardEventCard), + TransferStarted(PublicQueuedCardEventTransfer), + TransferReceived(PublicQueuedCardEventTransferReceived), } impl PublicQueuedCardEvent { pub fn card_id(&self) -> CardId { match self { Self::Install(event) | Self::Revoke(event) => event.card_id, + Self::TransferStarted(event) => event.card_id, + Self::TransferReceived(event) => event.card_id, } } } @@ -657,6 +749,19 @@ impl From for PublicQueuedCardEvent { QueuedCardEvent::Revoke(event) => Self::Revoke(PublicQueuedCardEventCard { card_id: event.card_id, }), + QueuedCardEvent::TransferStarted(event) => { + Self::TransferStarted(PublicQueuedCardEventTransfer { + transfer_id: event.transfer_id, + card_id: event.card_id, + target_holder: event.target_holder, + }) + } + QueuedCardEvent::TransferReceived(event) => { + Self::TransferReceived(PublicQueuedCardEventTransferReceived { + transfer_id: event.transfer_id, + card_id: event.card_id, + }) + } } } } diff --git a/golem-common/src/model/agent/extraction.rs b/golem-common/src/model/agent/extraction.rs index 0a4f90ae48..96a5469ae2 100644 --- a/golem-common/src/model/agent/extraction.rs +++ b/golem-common/src/model/agent/extraction.rs @@ -21,7 +21,8 @@ use crate::schema::tool::validation::validate_tool; use crate::schema::tool::wit::{decode_tool, wire as tool_wire}; use anyhow::anyhow; use golem_schema::schema::wit::{ - QuotaTokenHandleDropper, QuotaTokenHandleRep, SecretHandleDropper, SecretHandleRep, + PermissionCardHandleDropper, PermissionCardHandleRep, QuotaTokenHandleDropper, + QuotaTokenHandleRep, SecretHandleDropper, SecretHandleRep, }; use serde::{Deserialize, Serialize}; use std::future::Future; @@ -491,6 +492,15 @@ impl SecretHandleDropper for Host { } } +impl PermissionCardHandleDropper for Host { + fn drop_permission_card_handle( + &mut self, + handle: wasmtime::component::Resource, + ) { + let _ = self.table().delete(handle); + } +} + /// Whether the resource `resource_name` imported from interface /// `interface_name` is the opaque `golem:core/types.quota-token`. It is matched /// both at its defining interface and at the `golem:quota/types` interface that @@ -516,6 +526,24 @@ fn is_secret_resource(interface_name: &str, resource_name: &str) -> bool { ) } +/// Whether the resource `resource_name` imported from interface +/// `interface_name` is the opaque `golem:core/types.permission-card`. Like +/// `secret`, it can appear transitively inside schema value trees and must use +/// the same host resource representation as the generated wire bindings. +fn is_permission_card_resource(interface_name: &str, resource_name: &str) -> bool { + resource_name == "permission-card" + && matches!( + interface_name, + "golem:core/types@2.0.0" + | "golem:permissions/types@0.1.0" + | "golem:permissions/inspect@0.1.0" + | "golem:permissions/derive@0.1.0" + | "golem:permissions/revoke@0.1.0" + | "golem:permissions/wallet@0.1.0" + | "golem:agent/host@2.0.0" + ) +} + fn dynamic_import( name: &str, engine: &Engine, @@ -582,6 +610,12 @@ fn dynamic_import( ResourceType::host::(), |_store, _rep| Ok(()), )?; + } else if is_permission_card_resource(&name, &inner_name) { + instance.resource( + &inner_name, + ResourceType::host::(), + |_store, _rep| Ok(()), + )?; } else if &inner_name != "pollable" && inner_name != "wasi-io-pollable" && &inner_name != "input-stream" diff --git a/golem-common/src/model/agent/schema_evolution.rs b/golem-common/src/model/agent/schema_evolution.rs index a805cf5c13..83c1c742c7 100644 --- a/golem-common/src/model/agent/schema_evolution.rs +++ b/golem-common/src/model/agent/schema_evolution.rs @@ -154,6 +154,7 @@ fn discriminant_name(typ: &SchemaType) -> &'static str { SchemaType::Union { .. } => "Union", SchemaType::Secret { .. } => "Secret", SchemaType::QuotaToken { .. } => "QuotaToken", + SchemaType::PermissionCard { .. } => "PermissionCard", SchemaType::Future { .. } => "Future", SchemaType::Stream { .. } => "Stream", } diff --git a/golem-common/src/model/agent/structural_format/mod.rs b/golem-common/src/model/agent/structural_format/mod.rs index 178e310c6b..154a524a0f 100644 --- a/golem-common/src/model/agent/structural_format/mod.rs +++ b/golem-common/src/model/agent/structural_format/mod.rs @@ -26,7 +26,9 @@ use crate::model::agent::text_utils::{ write_json_escaped, write_json_escaped_char, write_with_decimal_point, }; -use crate::schema::canonical::{datetime, duration, quantity, quota_token, secret}; +use crate::schema::canonical::{ + datetime, duration, permission_card, quantity, quota_token, secret, +}; use crate::schema::graph::{SchemaGraph, TypedSchemaValue}; use crate::schema::schema_type::{SchemaType, UnionSpec}; use crate::schema::schema_value::{ @@ -492,6 +494,13 @@ fn format_schema_value( (SchemaValue::QuotaToken(v), SchemaType::QuotaToken { .. }) => { format_tagged_string(buf, "qt", "a_token::to_text(v).map_err(canonical_err)?) } + (SchemaValue::PermissionCard(v), SchemaType::PermissionCard { .. }) => { + format_tagged_string( + buf, + "pc", + &permission_card::to_text(v).map_err(canonical_err)?, + ) + } (SchemaValue::Union(UnionValuePayload { tag, body }), SchemaType::Union { spec, .. }) => { let (idx, branch) = union_branch(spec, tag)?; write!(buf, "u{idx}").unwrap(); @@ -793,6 +802,10 @@ impl<'a> Parser<'a> { quota_token::from_text(&self.parse_tagged_string("qt")?) .map_err(|e| self.error(&format!("Invalid quota token: {e}")))?, )), + SchemaType::PermissionCard { .. } => Ok(SchemaValue::PermissionCard( + permission_card::from_text(&self.parse_tagged_string("pc")?) + .map_err(|e| self.error(&format!("Invalid permission card: {e}")))?, + )), SchemaType::Union { spec, .. } => self.parse_schema_union(spec, graph, depth), SchemaType::Future { .. } | SchemaType::Stream { .. } => { Err(StructuralFormatError::HandleType) diff --git a/golem-common/src/model/card.rs b/golem-common/src/model/card.rs index 8d12437d0d..8e66983cdc 100644 --- a/golem-common/src/model/card.rs +++ b/golem-common/src/model/card.rs @@ -13,3 +13,108 @@ // limitations under the License. pub use crate::base_model::card::*; + +const SCOPE_CARD_ENCODING_VERSION: u32 = 1; + +impl TryFrom<&ScopeCard> for golem_api_grpc::proto::golem::worker::EncodedScopeCard { + type Error = String; + + fn try_from(value: &ScopeCard) -> Result { + Ok(Self { + encoding_version: SCOPE_CARD_ENCODING_VERSION, + scope_card_id: Some(value.scope_card_id.0.into()), + root_card_ids: value + .root_card_ids + .iter() + .map(|card_id| card_id.0.into()) + .collect(), + lower_positive: desert_rust::serialize_to_byte_vec(&value.lower_positive) + .map_err(|error| format!("failed to encode lower-positive grants: {error}"))?, + lower_negative: desert_rust::serialize_to_byte_vec(&value.lower_negative) + .map_err(|error| format!("failed to encode lower-negative grants: {error}"))?, + upper_positive: desert_rust::serialize_to_byte_vec(&value.upper_positive) + .map_err(|error| format!("failed to encode upper-positive grants: {error}"))?, + upper_negative: desert_rust::serialize_to_byte_vec(&value.upper_negative) + .map_err(|error| format!("failed to encode upper-negative grants: {error}"))?, + }) + } +} + +impl TryFrom for ScopeCard { + type Error = String; + + fn try_from( + value: golem_api_grpc::proto::golem::worker::EncodedScopeCard, + ) -> Result { + if value.encoding_version != SCOPE_CARD_ENCODING_VERSION { + return Err(format!( + "unsupported scope-card encoding version {}", + value.encoding_version + )); + } + + Ok(Self { + scope_card_id: CardId(value.scope_card_id.ok_or("missing scope-card ID")?.into()), + root_card_ids: value + .root_card_ids + .into_iter() + .map(|card_id| CardId(card_id.into())) + .collect(), + lower_positive: desert_rust::deserialize(&value.lower_positive) + .map_err(|error| format!("failed to decode lower-positive grants: {error}"))?, + lower_negative: desert_rust::deserialize(&value.lower_negative) + .map_err(|error| format!("failed to decode lower-negative grants: {error}"))?, + upper_positive: desert_rust::deserialize(&value.upper_positive) + .map_err(|error| format!("failed to decode upper-positive grants: {error}"))?, + upper_negative: desert_rust::deserialize(&value.upper_negative) + .map_err(|error| format!("failed to decode upper-negative grants: {error}"))?, + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use test_r::test; + + fn scope_card() -> ScopeCard { + let grant = parse_permission( + "agent(acme/shop/prod/cart-svc/ShoppingCart(*)) @ acme/shop/prod/cart-svc/ShoppingCart : invoke : add-item", + ) + .unwrap(); + ScopeCard { + scope_card_id: CardId(uuid::Uuid::from_u128(1)), + root_card_ids: vec![ + CardId(uuid::Uuid::from_u128(2)), + CardId(uuid::Uuid::from_u128(3)), + ], + lower_positive: vec![grant.clone()], + lower_negative: vec![grant.clone()], + upper_positive: vec![grant.clone()], + upper_negative: vec![grant], + } + } + + #[test] + fn scope_card_protobuf_round_trip_preserves_full_payload() { + let scope_card = scope_card(); + let encoded = + golem_api_grpc::proto::golem::worker::EncodedScopeCard::try_from(&scope_card).unwrap(); + assert_eq!( + encoded, + golem_api_grpc::proto::golem::worker::EncodedScopeCard::try_from(&scope_card).unwrap() + ); + + assert_eq!(ScopeCard::try_from(encoded).unwrap(), scope_card); + } + + #[test] + fn scope_card_protobuf_rejects_unsupported_versions() { + let mut encoded = + golem_api_grpc::proto::golem::worker::EncodedScopeCard::try_from(&scope_card()) + .unwrap(); + encoded.encoding_version += 1; + + assert!(ScopeCard::try_from(encoded).is_err()); + } +} diff --git a/golem-common/src/model/mod.rs b/golem-common/src/model/mod.rs index 30c48e26b3..ffa9e9dc4b 100644 --- a/golem-common/src/model/mod.rs +++ b/golem-common/src/model/mod.rs @@ -66,7 +66,7 @@ use crate::base_model::agent::Principal; use crate::base_model::environment_plugin_grant::EnvironmentPluginGrantId; use crate::model::account::{AccountEmail, AccountId}; use crate::model::agent::{AgentTypeSchemaResolver, ParsedAgentId}; -use crate::model::card::CardId; +use crate::model::card::{CardId, ScopeCard}; use crate::model::invocation_context::InvocationContextStack; use crate::model::oplog::types::AgentMetadataForGuests; use crate::model::oplog::{AgentResourceId, OplogEntry, RawSnapshotData}; @@ -821,6 +821,7 @@ pub enum AgentInvocation { input: SchemaValue, invocation_context: InvocationContextStack, principal: Principal, + scope_card: Option, }, LoadSnapshot { idempotency_key: IdempotencyKey, @@ -854,6 +855,7 @@ pub enum AgentInvocationPayload { method_name: String, input: SchemaValue, principal: Principal, + scope_card: Option, }, LoadSnapshot { snapshot: RawSnapshotData, @@ -1034,12 +1036,14 @@ impl AgentInvocation { method_name, input, principal, + scope_card, } => Self::AgentMethod { idempotency_key, method_name, input, invocation_context, principal, + scope_card, }, AgentInvocationPayload::LoadSnapshot { snapshot } => Self::LoadSnapshot { idempotency_key, @@ -1092,12 +1096,14 @@ impl AgentInvocation { input, invocation_context, principal, + scope_card, } => ( idempotency_key, AgentInvocationPayload::AgentMethod { method_name, input, principal, + scope_card, }, invocation_context, ), diff --git a/golem-common/src/model/oplog/matcher.rs b/golem-common/src/model/oplog/matcher.rs index 1d32540f32..a09ac2bd58 100644 --- a/golem-common/src/model/oplog/matcher.rs +++ b/golem-common/src/model/oplog/matcher.rs @@ -464,6 +464,55 @@ impl PublicOplogEntry { || Self::string_match("card-install-failed", &[], query_path, query) || Self::string_match(¶ms.card_id.to_string(), &[], query_path, query) } + PublicOplogEntry::CardDerived(params) => { + Self::string_match("cardderived", &[], query_path, query) + || Self::string_match("card-derived", &[], query_path, query) + || Self::string_match(¶ms.card_id.to_string(), &[], query_path, query) + } + PublicOplogEntry::CardTransferStarted(params) => { + Self::string_match("cardtransferstarted", &[], query_path, query) + || Self::string_match("card-transfer-started", &[], query_path, query) + || Self::string_match(¶ms.transfer_id.to_string(), &[], query_path, query) + || Self::string_match(¶ms.card_id.to_string(), &[], query_path, query) + } + PublicOplogEntry::CardTransferred(params) => { + Self::string_match("cardtransferred", &[], query_path, query) + || Self::string_match("card-transferred", &[], query_path, query) + || Self::string_match(¶ms.transfer_id.to_string(), &[], query_path, query) + || params.source_card_id.as_ref().is_some_and(|card_id| { + Self::string_match(&card_id.to_string(), &[], query_path, query) + }) + || Self::string_match( + ¶ms.installed_card_id.to_string(), + &[], + query_path, + query, + ) + } + PublicOplogEntry::CardRevokedCascade(params) => { + Self::string_match("cardrevokedcascade", &[], query_path, query) + || Self::string_match("card-revoked-cascade", &[], query_path, query) + || params.revoked_card_ids.iter().any(|card_id| { + Self::string_match(&card_id.to_string(), &[], query_path, query) + }) + } + PublicOplogEntry::CardTransferConfirmed(params) => { + Self::string_match("cardtransferconfirmed", &[], query_path, query) + || Self::string_match("card-transfer-confirmed", &[], query_path, query) + || Self::string_match(¶ms.transfer_id.to_string(), &[], query_path, query) + || Self::string_match( + ¶ms.source_card_id.to_string(), + &[], + query_path, + query, + ) + || Self::string_match( + ¶ms.installed_card_id.to_string(), + &[], + query_path, + query, + ) + } PublicOplogEntry::CardExpired(params) => { Self::string_match("cardexpired", &[], query_path, query) || Self::string_match("card-expired", &[], query_path, query) @@ -788,6 +837,12 @@ impl PublicOplogEntry { SchemaValue::QuotaToken(payload) => { Self::string_match(&payload.resource_name, path_stack, query_path, query) } + SchemaValue::PermissionCard(payload) => { + Self::string_match(&payload.card_id.to_string(), path_stack, query_path, query) + || payload.parent_ids.iter().any(|parent_id| { + Self::string_match(&parent_id.to_string(), path_stack, query_path, query) + }) + } } } } diff --git a/golem-common/src/model/oplog/payload/mod.rs b/golem-common/src/model/oplog/payload/mod.rs index bc2a40727d..e988f913e2 100644 --- a/golem-common/src/model/oplog/payload/mod.rs +++ b/golem-common/src/model/oplog/payload/mod.rs @@ -18,15 +18,14 @@ pub mod types; mod tests; use crate::model::agent::AgentTypeName; +use crate::model::card::ScopeCard; use crate::model::component::ComponentRevision; use crate::model::environment::EnvironmentId; -use crate::model::oplog::CardInstallFailure; -use crate::model::oplog::PayloadId; use crate::model::oplog::payload::types::{ - FileSystemError, ObjectMetadata, SecretRevealAudit, SecretRevealError, SerializableDateTime, - SerializableFileTimes, SerializableP3FileSystemError, SerializableP3IpSocketAddress, - SerializableP3SocketErrorCode, SerializableP3UdpDatagram, SerializableSocketError, - SerializableWebsocketError, SerializableWebsocketMessage, + FileSystemError, ObjectMetadata, PermissionCardRevokeError, SecretRevealAudit, + SecretRevealError, SerializableDateTime, SerializableFileTimes, SerializableP3FileSystemError, + SerializableP3IpSocketAddress, SerializableP3SocketErrorCode, SerializableP3UdpDatagram, + SerializableSocketError, SerializableWebsocketError, SerializableWebsocketMessage, }; use crate::model::oplog::types::{ AgentMetadataForGuests, SerializableDbColumn, SerializableDbResult, SerializableDbValue, @@ -38,6 +37,7 @@ use crate::model::oplog::types::{ SerializableRdbmsRequest, SerializableRpcError, SerializableScheduleId, SerializableStreamError, }; +use crate::model::oplog::{CardInstallFailure, PayloadId}; use crate::model::retry_policy::{NamedRetryPolicy, PredicateValue, RetryPolicy}; use crate::model::worker::RevertWorkerTarget; use crate::model::{ @@ -146,6 +146,8 @@ oplog_payload! { #[transient(None::)] #[schema(skip)] remote_agent_parameters: Option, // enriched field, only filled when exposed as public oplog entry + #[schema(skip)] + scope_card: Option, }, GolemRpcScheduledInvocation { remote_agent_id: AgentId, @@ -225,6 +227,20 @@ oplog_payload! { QuotaCommitRequest { used: u64, }, + PermissionCardDerive { + card: Vec, + provenance: Vec, + }, + PermissionCardRevoke { + card_id: Uuid, + }, + PermissionCardTransfer { + transfer_id: Uuid, + source_card: Vec, + installed_card: Vec, + installed_card_provenance: Option>, + target_agent_id: AgentId, + }, GolemRetryPolicyByName { name: String }, @@ -476,6 +492,13 @@ oplog_payload! { /// Unix timestamp in milliseconds when credit_after was recorded. credit_after_at_ms: i64, }, + PermissionCardDerived { + card: Vec, + }, + PermissionCardsRevoked { + result: Result, PermissionCardRevokeError>, + }, + PermissionCardTransferComplete {}, GolemRetryPolicies { policies: Vec }, @@ -665,10 +688,14 @@ pub mod host_functions { (GolemQuotaTokenNew => "golem::quota::quota-token", "[constructor]quota-token", QuotaTokenRequest, QuotaTokenAcquired), (GolemQuotaTokenReserve => "golem::quota::quota-token", "reserve", QuotaReserveRequest, QuotaReserveResult), (GolemQuotaReservationCommit => "golem::quota::reservation", "commit", QuotaCommitRequest, QuotaCommitResult), + (GolemPermissionsDerivePersist => "golem::permissions::derive", "persist-derived-card", PermissionCardDerive, PermissionCardDerived), + (GolemPermissionsRevokePersist => "golem::permissions::revoke", "persist-revoked-cards", PermissionCardRevoke, PermissionCardsRevoked), (GolemApiRetryGetRetryPolicies => "golem::api::retry", "get_retry_policies", NoInput, GolemRetryPolicies), (GolemApiRetryGetRetryPolicyByName => "golem::api::retry", "get_retry_policy_by_name", GolemRetryPolicyByName, GolemRetryNamedPolicy), (GolemApiRetryResolveRetryPolicy => "golem::api::retry", "resolve_retry_policy", GolemRetryResolvePolicy, GolemRetryResolvedPolicy), (GolemRpcWasmRpcNew => "golem::rpc::wasm-rpc", "new", GolemRpcCreate, GolemRpcCreate), + (GolemPermissionsInstallChildPersist => "golem::permissions::wallet", "persist-installed-child-card", PermissionCardDerive, PermissionCardDerived), + (GolemPermissionsInstallTransfer => "golem::permissions::wallet", "install-card-transfer", PermissionCardTransfer, PermissionCardTransferComplete), (P3KeyvalueCacheGet => "keyvalue::cache", "get", KVCacheKey, KVGet), (P3KeyvalueCacheExists => "keyvalue::cache", "exists", KVCacheKey, KVDelete), (P3KeyvalueCacheSet => "keyvalue::cache", "set", KVCacheKeyValueAndTtl, KVUnit), diff --git a/golem-common/src/model/oplog/payload/tests.rs b/golem-common/src/model/oplog/payload/tests.rs index bd01431a12..e472d72e3a 100644 --- a/golem-common/src/model/oplog/payload/tests.rs +++ b/golem-common/src/model/oplog/payload/tests.rs @@ -14,8 +14,15 @@ use test_r::test; +use super::HostRequestGolemRpcInvoke; use crate::model::Timestamp; +use crate::model::card::{CardId, ScopeCard}; +use crate::model::component::ComponentId; use crate::model::invocation_context::{AttributeValue, SpanId}; +use crate::model::oplog::host_functions::{ + GolemPermissionsDerivePersist, GolemPermissionsInstallChildPersist, + GolemPermissionsInstallTransfer, HostFunctionName, +}; use crate::model::oplog::raw_types::SpanData; use crate::model::oplog::types::{ SerializableDateTime, SerializableFileTimes, SerializableHttpErrorCode, SerializableHttpMethod, @@ -43,6 +50,8 @@ use crate::model::oplog::{ HostResponseP3SocketsUdpReceive, HostResponseP3SocketsUdpSend, HostResponseRandomBytes, HostResponseRandomSeed, HostResponseRandomU64, HostResponseWallClock, host_functions, }; +use crate::model::{AgentId, IdempotencyKey}; +use crate::schema::SchemaValue; use http::Version; use iso8601_timestamp as iso_ts; use proptest::collection::vec; @@ -59,6 +68,79 @@ use wasmtime_wasi_http::p2::bindings::http::types::{ DnsErrorPayload, ErrorCode, FieldSizePayload, TlsAlertReceivedPayload, }; +#[test] +fn installed_child_persistence_has_a_distinct_host_function_name() { + let function_name = HostFunctionName::GolemPermissionsInstallChildPersist; + assert_eq!( + GolemPermissionsInstallChildPersist::FQFN, + "golem::permissions::wallet::persist-installed-child-card" + ); + assert_ne!( + GolemPermissionsInstallChildPersist::FQFN, + GolemPermissionsDerivePersist::FQFN + ); + assert_eq!( + HostFunctionName::from(GolemPermissionsInstallChildPersist::FQFN), + function_name + ); + let bytes = desert_rust::serialize_to_byte_vec(&function_name).unwrap(); + let decoded: HostFunctionName = desert_rust::deserialize(&bytes).unwrap(); + assert_eq!(decoded, function_name); +} + +#[test] +fn card_transfer_has_a_distinct_host_function_name() { + let function_name = HostFunctionName::GolemPermissionsInstallTransfer; + assert_eq!( + GolemPermissionsInstallTransfer::FQFN, + "golem::permissions::wallet::install-card-transfer" + ); + assert_ne!( + GolemPermissionsInstallTransfer::FQFN, + GolemPermissionsInstallChildPersist::FQFN + ); + assert_eq!( + HostFunctionName::from(GolemPermissionsInstallTransfer::FQFN), + function_name + ); + let bytes = desert_rust::serialize_to_byte_vec(&function_name).unwrap(); + let decoded: HostFunctionName = desert_rust::deserialize(&bytes).unwrap(); + assert_eq!(decoded, function_name); +} + +#[test] +fn rpc_durable_request_captures_scope_card_payload_deterministically() { + let scope_card = ScopeCard { + scope_card_id: CardId(uuid::Uuid::from_u128(1)), + root_card_ids: vec![CardId(uuid::Uuid::from_u128(2))], + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + }; + let request = HostRequestGolemRpcInvoke { + remote_agent_id: AgentId { + component_id: ComponentId::new(), + agent_id: "target".to_string(), + }, + idempotency_key: IdempotencyKey::new("scope-card-call".to_string()), + method_name: "run".to_string(), + input: SchemaValue::Tuple { + elements: Vec::new(), + }, + remote_agent_type: None, + remote_agent_parameters: None, + scope_card: Some(scope_card), + }; + + let first = desert_rust::serialize_to_byte_vec(&request).unwrap(); + let second = desert_rust::serialize_to_byte_vec(&request).unwrap(); + let decoded: HostRequestGolemRpcInvoke = desert_rust::deserialize(&first).unwrap(); + + assert_eq!(first, second); + assert_eq!(decoded, request); +} + fn datetime_strat() -> impl Strategy { (0..(u64::MAX / 1_000_000_000), 0..1_000_000_000u32).prop_map(|(seconds, nanoseconds)| { diff --git a/golem-common/src/model/oplog/payload/types.rs b/golem-common/src/model/oplog/payload/types.rs index 7655406ba5..11755493e6 100644 --- a/golem-common/src/model/oplog/payload/types.rs +++ b/golem-common/src/model/oplog/payload/types.rs @@ -94,6 +94,22 @@ pub enum SecretRevealError { Internal(String), } +#[derive( + Debug, + Clone, + PartialEq, + Eq, + BinaryCodec, + golem_schema_derive::IntoSchema, + golem_schema_derive::FromSchema, +)] +#[desert(evolution())] +pub enum PermissionCardRevokeError { + AlreadyRevoked(String), + CardRevoked(String), + NotPermitted(String), +} + #[derive( Debug, Clone, diff --git a/golem-common/src/model/oplog/protobuf.rs b/golem-common/src/model/oplog/protobuf.rs index 907bb20781..c5d7beabd0 100644 --- a/golem-common/src/model/oplog/protobuf.rs +++ b/golem-common/src/model/oplog/protobuf.rs @@ -29,11 +29,16 @@ use super::{ use crate::base_model::OplogIndex; use crate::base_model::agent::AgentMode; use crate::base_model::oplog::{ - CardInstallFailure, PublicQueuedCardEvent, QueuedCardEvent, QueuedCardEventCard, + CardInstallFailure, PublicQueuedCardEvent, PublicQueuedCardEventTransfer, + PublicQueuedCardEventTransferReceived, QueuedCardEvent, QueuedCardEventCard, + QueuedCardEventTransfer, QueuedCardEventTransferReceived, }; use crate::model::AgentInvocationResult; use crate::model::Empty; -use crate::model::card::CardId; +use crate::model::card::{ + AccountCardHolder, AgentCardHolder, ApplicationCardHolder, CardHolder, CardId, + InvocationWalletPin, PublicInvocationWalletPin, WalletVersionToken, +}; use crate::model::component::PluginPriority; use crate::model::invocation_context::{SpanId, TraceId}; use crate::model::oplog::payload::OplogPayload; @@ -43,17 +48,18 @@ use crate::model::oplog::payload::host_functions::{ use crate::model::oplog::public_oplog_entry::{ ActivatePluginParams, AgentInvocationFinishedParams, AgentInvocationStartedParams, BeginAtomicRegionParams, BeginRemoteTransactionParams, CancelPendingInvocationParams, - CancelledParams, CardEventQueuedParams, CardInstallFailedParams, CardInstalledParams, - CardRevokedParams, ChangePersistenceLevelParams, CommittedRemoteTransactionParams, - CompletionDiscardedParams, CreateParams, CreateResourceParams, DeactivatePluginParams, - DropResourceParams, EndAtomicRegionParams, EndParams, ErrorParams, ExitedParams, - FailedUpdateParams, FilesystemStorageUsageUpdateParams, FinishSpanParams, GrowMemoryParams, - HostStreamFrameParams, InterruptedParams, JumpParams, LogParams, NoOpParams, - OplogProcessorCheckpointParams, PendingAgentInvocationParams, PendingUpdateParams, - PreCommitRemoteTransactionParams, PreRollbackRemoteTransactionParams, RemoveRetryPolicyParams, - RestartParams, RevertParams, RolledBackRemoteTransactionParams, SetRetryPolicyParams, - SetSpanAttributeParams, SnapshotParams, StartParams, StartSpanParams, SuccessfulUpdateParams, - SuspendParams, + CancelledParams, CardDerivedParams, CardEventQueuedParams, CardInstallFailedParams, + CardInstalledParams, CardRevokedCascadeParams, CardRevokedParams, CardTransferConfirmedParams, + CardTransferStartedParams, CardTransferredParams, ChangePersistenceLevelParams, + CommittedRemoteTransactionParams, CompletionDiscardedParams, CreateParams, + CreateResourceParams, DeactivatePluginParams, DropResourceParams, EndAtomicRegionParams, + EndParams, ErrorParams, ExitedParams, FailedUpdateParams, FilesystemStorageUsageUpdateParams, + FinishSpanParams, GrowMemoryParams, HostStreamFrameParams, InterruptedParams, JumpParams, + LogParams, NoOpParams, OplogProcessorCheckpointParams, PendingAgentInvocationParams, + PendingUpdateParams, PreCommitRemoteTransactionParams, PreRollbackRemoteTransactionParams, + RemoveRetryPolicyParams, RestartParams, RevertParams, RolledBackRemoteTransactionParams, + SetRetryPolicyParams, SetSpanAttributeParams, SnapshotParams, StartParams, StartSpanParams, + SuccessfulUpdateParams, SuspendParams, }; use crate::model::oplog::{ AgentTerminatedByQuotaError, DurableFunctionType, EphemeralCannotSuspendError, @@ -100,6 +106,109 @@ impl TryFrom } } +fn card_holder_from_proto( + value: golem_api_grpc::proto::golem::worker::CardHolder, +) -> Result { + use golem_api_grpc::proto::golem::worker::card_holder::Holder; + + match value.holder.ok_or("Missing card holder")? { + Holder::Account(account_id) => Ok(CardHolder::Account(AccountCardHolder { + account_id: account_id.into(), + })), + Holder::Application(application_id) => Ok(CardHolder::Application(ApplicationCardHolder { + application_id: application_id.into(), + })), + Holder::Agent(agent_id) => Ok(CardHolder::Agent(AgentCardHolder { + agent_id: agent_id.try_into()?, + })), + } +} + +fn card_holder_to_proto(value: CardHolder) -> golem_api_grpc::proto::golem::worker::CardHolder { + use golem_api_grpc::proto::golem::worker::card_holder::Holder; + + let holder = match value { + CardHolder::Account(holder) => Holder::Account(holder.account_id.into()), + CardHolder::Application(holder) => Holder::Application(holder.application_id.into()), + CardHolder::Agent(holder) => Holder::Agent(holder.agent_id.into()), + }; + golem_api_grpc::proto::golem::worker::CardHolder { + holder: Some(holder), + } +} + +fn wallet_version_token_from_proto( + value: golem_api_grpc::proto::golem::worker::WalletVersionToken, +) -> Result { + let wallet_id_hash = value + .wallet_id_hash + .try_into() + .map_err(|hash: Vec| format!("wallet_id_hash must be 32 bytes, got {}", hash.len()))?; + Ok(WalletVersionToken { + wallet_id_hash, + generation: value.generation, + }) +} + +fn wallet_version_token_to_proto( + value: WalletVersionToken, +) -> golem_api_grpc::proto::golem::worker::WalletVersionToken { + golem_api_grpc::proto::golem::worker::WalletVersionToken { + wallet_id_hash: value.wallet_id_hash.to_vec(), + generation: value.generation, + } +} + +fn invocation_wallet_pin_from_proto( + value: golem_api_grpc::proto::golem::worker::RawInvocationWalletPin, +) -> Result { + Ok(InvocationWalletPin { + wallet_token: wallet_version_token_from_proto( + value.wallet_token.ok_or("Missing wallet_token field")?, + )?, + pinned_card_ids: value + .pinned_card_ids + .into_iter() + .map(|card_id| CardId(card_id.into())) + .collect(), + scope_card_id: value.scope_card_id.map(|card_id| CardId(card_id.into())), + }) +} + +fn invocation_wallet_pin_to_proto( + value: InvocationWalletPin, +) -> golem_api_grpc::proto::golem::worker::RawInvocationWalletPin { + golem_api_grpc::proto::golem::worker::RawInvocationWalletPin { + wallet_token: Some(wallet_version_token_to_proto(value.wallet_token)), + pinned_card_ids: value + .pinned_card_ids + .into_iter() + .map(|card_id| card_id.0.into()) + .collect(), + scope_card_id: value.scope_card_id.map(|card_id| card_id.0.into()), + } +} + +fn public_invocation_wallet_pin_from_proto( + value: golem_api_grpc::proto::golem::worker::PublicInvocationWalletPin, +) -> Result { + Ok(PublicInvocationWalletPin { + wallet_token: wallet_version_token_from_proto( + value.wallet_token.ok_or("Missing wallet_token field")?, + )?, + scope_card_id: value.scope_card_id.map(|card_id| CardId(card_id.into())), + }) +} + +fn public_invocation_wallet_pin_to_proto( + value: PublicInvocationWalletPin, +) -> golem_api_grpc::proto::golem::worker::PublicInvocationWalletPin { + golem_api_grpc::proto::golem::worker::PublicInvocationWalletPin { + wallet_token: Some(wallet_version_token_to_proto(value.wallet_token)), + scope_card_id: value.scope_card_id.map(|card_id| card_id.0.into()), + } +} + fn public_queued_card_event_from_proto( value: golem_api_grpc::proto::golem::worker::QueuedCardEvent, ) -> Result { @@ -112,6 +221,21 @@ fn public_queued_card_event_from_proto( Event::Revoke(event) => Ok(PublicQueuedCardEvent::Revoke(PublicQueuedCardEventCard { card_id: CardId(event.card_id.ok_or("Missing card_id")?.into()), })), + Event::TransferStarted(event) => Ok(PublicQueuedCardEvent::TransferStarted( + PublicQueuedCardEventTransfer { + transfer_id: event.transfer_id.ok_or("Missing transfer_id")?.into(), + card_id: CardId(event.card_id.ok_or("Missing card_id")?.into()), + target_holder: card_holder_from_proto( + event.target_holder.ok_or("Missing target_holder")?, + )?, + }, + )), + Event::TransferReceived(event) => Ok(PublicQueuedCardEvent::TransferReceived( + PublicQueuedCardEventTransferReceived { + transfer_id: event.transfer_id.ok_or("Missing transfer_id")?.into(), + card_id: CardId(event.card_id.ok_or("Missing card_id")?.into()), + }, + )), } } @@ -127,6 +251,19 @@ fn public_queued_card_event_to_proto( PublicQueuedCardEvent::Revoke(event) => proto::Event::Revoke(proto::Revoke { card_id: Some(event.card_id.0.into()), }), + PublicQueuedCardEvent::TransferStarted(event) => { + proto::Event::TransferStarted(proto::TransferStarted { + transfer_id: Some(event.transfer_id.into()), + card_id: Some(event.card_id.0.into()), + target_holder: Some(card_holder_to_proto(event.target_holder)), + }) + } + PublicQueuedCardEvent::TransferReceived(event) => { + proto::Event::TransferReceived(proto::TransferReceived { + transfer_id: Some(event.transfer_id.into()), + card_id: Some(event.card_id.0.into()), + }) + } }; golem_api_grpc::proto::golem::worker::QueuedCardEvent { event: Some(event) } @@ -143,9 +280,7 @@ fn raw_queued_card_event_from_proto( if event.card.is_empty() { return Err("Queued card install is missing card payload".to_string()); } - let card: crate::model::card::StoredCard = - crate::serialization::deserialize(&event.card) - .map_err(|err| format!("Failed to deserialize queued card install: {err}"))?; + let card = deserialize_stored_card(&event.card, "queued card install")?; if card.card_id() != card_id { return Err("Queued card install card payload does not match card_id".to_string()); } @@ -158,9 +293,73 @@ fn raw_queued_card_event_from_proto( card_id: CardId(event.card_id.ok_or("Missing card_id")?.into()), card: None, })), + Event::TransferStarted(event) => { + let card_id = CardId(event.card_id.ok_or("Missing card_id")?.into()); + if event.card.is_empty() { + return Err("Queued card transfer is missing card payload".to_string()); + } + let card = deserialize_stored_card(&event.card, "queued card transfer")?; + Ok(QueuedCardEvent::TransferStarted(QueuedCardEventTransfer { + transfer_id: event.transfer_id.ok_or("Missing transfer_id")?.into(), + card_id, + card: Some(card), + target_holder: card_holder_from_proto( + event.target_holder.ok_or("Missing target_holder")?, + )?, + })) + } + Event::TransferReceived(event) => { + let card_id = CardId(event.card_id.ok_or("Missing card_id")?.into()); + if event.card.is_empty() { + return Err("Received card transfer is missing card payload".to_string()); + } + let card = deserialize_stored_card(&event.card, "received card transfer")?; + if card.card_id() != card_id { + return Err("Received card transfer payload does not match card_id".to_string()); + } + Ok(QueuedCardEvent::TransferReceived( + QueuedCardEventTransferReceived { + transfer_id: event.transfer_id.ok_or("Missing transfer_id")?.into(), + source_card_id: event.source_card_id.map(|card_id| CardId(card_id.into())), + card_id, + card: Some(card), + }, + )) + } } } +fn deserialize_stored_card( + bytes: &[u8], + description: &str, +) -> Result { + let version = bytes + .first() + .ok_or_else(|| format!("Failed to deserialize {description}: missing payload"))?; + if *version != crate::serialization::SERIALIZATION_VERSION_V3 { + return Err(format!( + "Failed to deserialize {description}: invalid serialization version: {version}" + )); + } + std::panic::catch_unwind(|| { + let mut context = + desert_rust::DeserializationContext::new(&bytes[1..], desert_rust::Options::default()); + let card = + ::deserialize( + &mut context, + )?; + match desert_rust::BinaryInput::read_u8(&mut context) { + Err(desert_rust::Error::InputEndedUnexpectedly) => Ok(card), + Ok(_) => Err(desert_rust::Error::DeserializationFailure( + "trailing bytes after StoredCard payload".to_string(), + )), + Err(error) => Err(error), + } + }) + .map_err(|_| format!("Failed to deserialize {description}: malformed payload"))? + .map_err(|err| format!("Failed to deserialize {description}: {err}")) +} + fn raw_queued_card_event_to_proto( value: QueuedCardEvent, ) -> Result { @@ -182,6 +381,31 @@ fn raw_queued_card_event_to_proto( QueuedCardEvent::Revoke(event) => proto::Event::Revoke(proto::Revoke { card_id: Some(event.card_id.0.into()), }), + QueuedCardEvent::TransferStarted(event) => { + let card = event + .card + .ok_or("Queued card transfer is missing card payload")?; + proto::Event::TransferStarted(proto::TransferStarted { + transfer_id: Some(event.transfer_id.into()), + card_id: Some(event.card_id.0.into()), + card: crate::serialization::serialize(&card)?, + target_holder: Some(card_holder_to_proto(event.target_holder)), + }) + } + QueuedCardEvent::TransferReceived(event) => { + let card = event + .card + .ok_or("Received card transfer is missing card payload")?; + if card.card_id() != event.card_id { + return Err("Received card transfer payload does not match card_id".to_string()); + } + proto::Event::TransferReceived(proto::TransferReceived { + transfer_id: Some(event.transfer_id.into()), + card_id: Some(event.card_id.0.into()), + card: crate::serialization::serialize(&card)?, + source_card_id: event.source_card_id.map(|card_id| card_id.0.into()), + }) + } }; Ok(golem_api_grpc::proto::golem::worker::RawQueuedCardEvent { event: Some(event) }) @@ -621,6 +845,10 @@ impl TryFrom for PublicOplogEn .invocation .ok_or("Missing invocation field")? .try_into()?, + wallet_pin: agent_invocation_started + .wallet_pin + .map(public_invocation_wallet_pin_from_proto) + .transpose()?, }), ), oplog_entry::Entry::AgentInvocationFinished(agent_invocation_finished) => Ok( @@ -994,6 +1222,7 @@ impl TryFrom for PublicOplogEn timestamp: params.timestamp.ok_or("Missing timestamp field")?.into(), queued_event_index: OplogIndex::from_u64(params.queued_event_index), card_id: CardId(params.card_id.ok_or("Missing card_id field")?.into()), + wallet_generation: params.wallet_generation, })) } oplog_entry::Entry::CardEventQueued(params) => { @@ -1009,6 +1238,7 @@ impl TryFrom for PublicOplogEn timestamp: params.timestamp.ok_or("Missing timestamp field")?.into(), queued_event_index: params.queued_event_index.map(OplogIndex::from_u64), card_id: CardId(params.card_id.ok_or("Missing card_id field")?.into()), + wallet_generation: params.wallet_generation, })) } oplog_entry::Entry::CardInstallFailed(params) => Ok( @@ -1024,10 +1254,92 @@ impl TryFrom for PublicOplogEn )?, }), ), + oplog_entry::Entry::CardDerived(params) => { + Ok(PublicOplogEntry::CardDerived(CardDerivedParams { + timestamp: params.timestamp.ok_or("Missing timestamp field")?.into(), + card_id: CardId(params.card_id.ok_or("Missing card_id field")?.into()), + parent_ids: params + .parent_ids + .into_iter() + .map(|id| CardId(id.into())) + .collect(), + wallet_generation: params.wallet_generation, + })) + } + oplog_entry::Entry::CardTransferStarted(params) => Ok( + PublicOplogEntry::CardTransferStarted(CardTransferStartedParams { + timestamp: params.timestamp.ok_or("Missing timestamp field")?.into(), + transfer_id: params + .transfer_id + .ok_or("Missing transfer_id field")? + .into(), + card_id: CardId(params.card_id.ok_or("Missing card_id field")?.into()), + target_holder: card_holder_from_proto( + params.target_holder.ok_or("Missing target_holder field")?, + )?, + source_wallet_generation: params.source_wallet_generation, + }), + ), + oplog_entry::Entry::CardTransferred(params) => { + Ok(PublicOplogEntry::CardTransferred(CardTransferredParams { + timestamp: params.timestamp.ok_or("Missing timestamp field")?.into(), + transfer_id: params + .transfer_id + .ok_or("Missing transfer_id field")? + .into(), + source_card_id: params.source_card_id.map(|id| CardId(id.into())), + installed_card_id: CardId( + params + .installed_card_id + .ok_or("Missing installed_card_id field")? + .into(), + ), + target_holder: card_holder_from_proto( + params.target_holder.ok_or("Missing target_holder field")?, + )?, + target_wallet_generation: params.target_wallet_generation, + })) + } + oplog_entry::Entry::CardRevokedCascade(params) => Ok( + PublicOplogEntry::CardRevokedCascade(CardRevokedCascadeParams { + timestamp: params.timestamp.ok_or("Missing timestamp field")?.into(), + revoked_card_ids: params + .revoked_card_ids + .into_iter() + .map(|id| CardId(id.into())) + .collect(), + local_wallet_generation: params.local_wallet_generation, + }), + ), + oplog_entry::Entry::CardTransferConfirmed(params) => Ok( + PublicOplogEntry::CardTransferConfirmed(CardTransferConfirmedParams { + timestamp: params.timestamp.ok_or("Missing timestamp field")?.into(), + transfer_id: params + .transfer_id + .ok_or("Missing transfer_id field")? + .into(), + source_card_id: CardId( + params + .source_card_id + .ok_or("Missing source_card_id field")? + .into(), + ), + installed_card_id: CardId( + params + .installed_card_id + .ok_or("Missing installed_card_id field")? + .into(), + ), + target_holder: card_holder_from_proto( + params.target_holder.ok_or("Missing target_holder field")?, + )?, + }), + ), oplog_entry::Entry::CardExpired(params) => { Ok(PublicOplogEntry::CardExpired(CardExpiredParams { timestamp: params.timestamp.ok_or("Missing timestamp field")?.into(), card_id: CardId(params.card_id.ok_or("Missing card_id field")?.into()), + wallet_generation: params.wallet_generation, })) } oplog_entry::Entry::HostStreamFrame(params) => { @@ -1130,6 +1442,9 @@ impl TryFrom for golem_api_grpc::proto::golem::worker::OplogEn golem_api_grpc::proto::golem::worker::AgentInvocationStartedParameters { timestamp: Some(agent_invocation_started.timestamp.into()), invocation: Some(agent_invocation_started.invocation.try_into()?), + wallet_pin: agent_invocation_started + .wallet_pin + .map(public_invocation_wallet_pin_to_proto), }, )), } @@ -1578,6 +1893,7 @@ impl TryFrom for golem_api_grpc::proto::golem::worker::OplogEn timestamp: Some(params.timestamp.into()), queued_event_index: params.queued_event_index.into(), card_id: Some(params.card_id.0.into()), + wallet_generation: params.wallet_generation, }, )), } @@ -1599,6 +1915,7 @@ impl TryFrom for golem_api_grpc::proto::golem::worker::OplogEn timestamp: Some(params.timestamp.into()), queued_event_index: params.queued_event_index.map(Into::into), card_id: Some(params.card_id.0.into()), + wallet_generation: params.wallet_generation, }, )), } @@ -1615,12 +1932,84 @@ impl TryFrom for golem_api_grpc::proto::golem::worker::OplogEn )), } } + PublicOplogEntry::CardDerived(params) => { + golem_api_grpc::proto::golem::worker::OplogEntry { + entry: Some(oplog_entry::Entry::CardDerived( + golem_api_grpc::proto::golem::worker::CardDerivedParameters { + timestamp: Some(params.timestamp.into()), + card_id: Some(params.card_id.0.into()), + parent_ids: params + .parent_ids + .into_iter() + .map(|id| id.0.into()) + .collect(), + wallet_generation: params.wallet_generation, + }, + )), + } + } + PublicOplogEntry::CardTransferStarted(params) => { + golem_api_grpc::proto::golem::worker::OplogEntry { + entry: Some(oplog_entry::Entry::CardTransferStarted( + golem_api_grpc::proto::golem::worker::CardTransferStartedParameters { + timestamp: Some(params.timestamp.into()), + transfer_id: Some(params.transfer_id.into()), + card_id: Some(params.card_id.0.into()), + target_holder: Some(card_holder_to_proto(params.target_holder)), + source_wallet_generation: params.source_wallet_generation, + }, + )), + } + } + PublicOplogEntry::CardTransferred(params) => { + golem_api_grpc::proto::golem::worker::OplogEntry { + entry: Some(oplog_entry::Entry::CardTransferred( + golem_api_grpc::proto::golem::worker::CardTransferredParameters { + timestamp: Some(params.timestamp.into()), + transfer_id: Some(params.transfer_id.into()), + source_card_id: params.source_card_id.map(|id| id.0.into()), + installed_card_id: Some(params.installed_card_id.0.into()), + target_holder: Some(card_holder_to_proto(params.target_holder)), + target_wallet_generation: params.target_wallet_generation, + }, + )), + } + } + PublicOplogEntry::CardRevokedCascade(params) => { + golem_api_grpc::proto::golem::worker::OplogEntry { + entry: Some(oplog_entry::Entry::CardRevokedCascade( + golem_api_grpc::proto::golem::worker::CardRevokedCascadeParameters { + timestamp: Some(params.timestamp.into()), + revoked_card_ids: params + .revoked_card_ids + .into_iter() + .map(|id| id.0.into()) + .collect(), + local_wallet_generation: params.local_wallet_generation, + }, + )), + } + } + PublicOplogEntry::CardTransferConfirmed(params) => { + golem_api_grpc::proto::golem::worker::OplogEntry { + entry: Some(oplog_entry::Entry::CardTransferConfirmed( + golem_api_grpc::proto::golem::worker::CardTransferConfirmedParameters { + timestamp: Some(params.timestamp.into()), + transfer_id: Some(params.transfer_id.into()), + source_card_id: Some(params.source_card_id.0.into()), + installed_card_id: Some(params.installed_card_id.0.into()), + target_holder: Some(card_holder_to_proto(params.target_holder)), + }, + )), + } + } PublicOplogEntry::CardExpired(params) => { golem_api_grpc::proto::golem::worker::OplogEntry { entry: Some(oplog_entry::Entry::CardExpired( golem_api_grpc::proto::golem::worker::CardExpiredParameters { timestamp: Some(params.timestamp.into()), card_id: Some(params.card_id.0.into()), + wallet_generation: params.wallet_generation, }, )), } @@ -2792,6 +3181,7 @@ impl TryFrom for OplogEntry { data: OplogPayload::Inline(Box::new(data)), mime_type, active_cards: Vec::new(), + wallet_generation: 0, }) } PublicOplogEntry::OplogProcessorCheckpoint(p) => { @@ -2816,6 +3206,7 @@ impl TryFrom for OplogEntry { timestamp: p.timestamp, queued_event_index: p.queued_event_index, card_id: p.card_id, + wallet_generation: p.wallet_generation, }), PublicOplogEntry::CardEventQueued(_) => { Err("Converting CardEventQueued from public to raw oplog entry is not supported".to_string()) @@ -2823,6 +3214,21 @@ impl TryFrom for OplogEntry { PublicOplogEntry::CardInstalled(_) => { Err("Converting CardInstalled from public to raw oplog entry is not supported".to_string()) } + PublicOplogEntry::CardDerived(_) => { + Err("Converting CardDerived from public to raw oplog entry is not supported".to_string()) + } + PublicOplogEntry::CardTransferStarted(_) => { + Err("Converting CardTransferStarted from public to raw oplog entry is not supported".to_string()) + } + PublicOplogEntry::CardTransferred(_) => { + Err("Converting CardTransferred from public to raw oplog entry is not supported".to_string()) + } + PublicOplogEntry::CardRevokedCascade(_) => { + Err("Converting CardRevokedCascade from public to raw oplog entry is not supported".to_string()) + } + PublicOplogEntry::CardTransferConfirmed(_) => { + Err("Converting CardTransferConfirmed from public to raw oplog entry is not supported".to_string()) + } PublicOplogEntry::CardInstallFailed(p) => Ok(OplogEntry::CardInstallFailed { timestamp: p.timestamp, queued_event_index: p.queued_event_index, @@ -2832,6 +3238,7 @@ impl TryFrom for OplogEntry { PublicOplogEntry::CardExpired(p) => Ok(OplogEntry::CardExpired { timestamp: p.timestamp, card_id: p.card_id, + wallet_generation: p.wallet_generation, }), // The concrete payload type cannot be recovered from the rendered schema value // (there is no owning function name to key it on), so it is preserved as a @@ -3194,6 +3601,7 @@ fn update_description_from_proto( } } +#[allow(deprecated)] impl TryFrom for golem_api_grpc::proto::golem::worker::RawOplogEntry { type Error = String; @@ -3204,13 +3612,14 @@ impl TryFrom for golem_api_grpc::proto::golem::worker::RawOplogEntry use golem_api_grpc::proto::golem::worker::{ RawActivatePluginParameters, RawAgentInvocationFinishedParameters, RawAgentInvocationStartedParameters, RawBeginRemoteTransactionParameters, - RawCancelPendingInvocationParameters, RawCancelledParameters, + RawCancelPendingInvocationParameters, RawCancelledParameters, RawCardDerivedParameters, RawCardEventQueuedParameters, RawCardInstallFailedParameters, - RawCardInstalledParameters, RawCardRevokedParameters, - RawChangePersistenceLevelParameters, RawCompletionDiscardedParameters, - RawCreateParameters, RawCreateResourceParameters, RawDeactivatePluginParameters, - RawDropResourceParameters, RawEndAtomicRegionParameters, RawEndParameters, RawEnvVar, - RawErrorParameters, RawFailedUpdateParameters, + RawCardInstalledParameters, RawCardRevokedCascadeParameters, RawCardRevokedParameters, + RawCardTransferConfirmedParameters, RawCardTransferStartedParameters, + RawCardTransferredParameters, RawChangePersistenceLevelParameters, + RawCompletionDiscardedParameters, RawCreateParameters, RawCreateResourceParameters, + RawDeactivatePluginParameters, RawDropResourceParameters, RawEndAtomicRegionParameters, + RawEndParameters, RawEnvVar, RawErrorParameters, RawFailedUpdateParameters, RawFilesystemStorageUsageUpdateParameters, RawFinishSpanParameters, RawGrowMemoryParameters, RawHostStreamFrameParameters, RawJumpParameters, RawLogParameters, RawOplogProcessorCheckpointParameters, RawOplogRegion, @@ -3306,6 +3715,7 @@ impl TryFrom for golem_api_grpc::proto::golem::worker::RawOplogEntry trace_id, trace_states, invocation_context, + wallet_pin, .. } => Entry::AgentInvocationStarted(RawAgentInvocationStartedParameters { idempotency_key: Some(idempotency_key.into()), @@ -3316,6 +3726,7 @@ impl TryFrom for golem_api_grpc::proto::golem::worker::RawOplogEntry .into_iter() .map(span_data_to_proto) .collect(), + wallet_pin: wallet_pin.map(invocation_wallet_pin_to_proto), }), OplogEntry::AgentInvocationFinished { result, @@ -3541,6 +3952,7 @@ impl TryFrom for golem_api_grpc::proto::golem::worker::RawOplogEntry data, mime_type, active_cards, + wallet_generation, .. } => Entry::Snapshot(RawSnapshotParameters { data: Some(oplog_payload_to_proto(data)?), @@ -3549,6 +3961,7 @@ impl TryFrom for golem_api_grpc::proto::golem::worker::RawOplogEntry .into_iter() .map(|card| crate::serialization::serialize(&card)) .collect::, _>>()?, + wallet_generation, }), OplogEntry::OplogProcessorCheckpoint { plugin_grant_id, @@ -3576,10 +3989,12 @@ impl TryFrom for golem_api_grpc::proto::golem::worker::RawOplogEntry timestamp, queued_event_index, card_id, + wallet_generation, } => Entry::CardRevoked(RawCardRevokedParameters { timestamp: Some(timestamp.into()), queued_event_index: queued_event_index.into(), card_id: Some(card_id.0.into()), + wallet_generation, }), OplogEntry::CardEventQueued { timestamp, event } => { Entry::CardEventQueued(RawCardEventQueuedParameters { @@ -3591,10 +4006,12 @@ impl TryFrom for golem_api_grpc::proto::golem::worker::RawOplogEntry timestamp, queued_event_index, card, + wallet_generation, } => Entry::CardInstalled(RawCardInstalledParameters { timestamp: Some(timestamp.into()), queued_event_index: queued_event_index.map(Into::into), card: crate::serialization::serialize(&card)?, + wallet_generation, }), OplogEntry::CardInstallFailed { timestamp, @@ -3607,12 +4024,91 @@ impl TryFrom for golem_api_grpc::proto::golem::worker::RawOplogEntry card_id: Some(card_id.0.into()), reason: raw_card_install_failure_to_proto(reason) as i32, }), - OplogEntry::CardExpired { timestamp, card_id } => { - Entry::CardExpired(RawCardExpiredParameters { + OplogEntry::CardDerived { + timestamp, + card, + wallet_generation, + } => Entry::CardDerived(RawCardDerivedParameters { + timestamp: Some(timestamp.into()), + card: crate::serialization::serialize(&card)?, + wallet_generation, + }), + OplogEntry::CardTransferStarted { + timestamp, + transfer_id, + card_id, + source_holder, + target_holder, + source_wallet_generation, + } => Entry::CardTransferStarted(RawCardTransferStartedParameters { + timestamp: Some(timestamp.into()), + transfer_id: Some(transfer_id.into()), + card_id: Some(card_id.0.into()), + source_holder: source_holder.map(card_holder_to_proto), + target_holder: Some(card_holder_to_proto(target_holder)), + source_wallet_generation, + }), + OplogEntry::CardTransferred { + timestamp, + transfer_id, + source_card_id, + installed_card_id, + target_holder, + card, + target_wallet_generation, + } => { + if card.card_id() != installed_card_id { + return Err( + "Transferred card payload does not match installed_card_id".to_string() + ); + } + Entry::CardTransferred(RawCardTransferredParameters { timestamp: Some(timestamp.into()), - card_id: Some(card_id.0.into()), + transfer_id: Some(transfer_id.into()), + source_card_id: source_card_id.map(|id| id.0.into()), + installed_card_id: Some(installed_card_id.0.into()), + target_holder: Some(card_holder_to_proto(target_holder)), + card: crate::serialization::serialize(&card)?, + target_wallet_generation, }) } + OplogEntry::CardRevokedCascade { + timestamp, + revoked_card_ids, + affected_wallets, + local_wallet_generation, + } => Entry::CardRevokedCascade(RawCardRevokedCascadeParameters { + timestamp: Some(timestamp.into()), + revoked_card_ids: revoked_card_ids.into_iter().map(|id| id.0.into()).collect(), + affected_wallets: affected_wallets + .into_iter() + .map(card_holder_to_proto) + .collect(), + generation_bumps: Vec::new(), + local_wallet_generation, + }), + OplogEntry::CardTransferConfirmed { + timestamp, + transfer_id, + source_card_id, + installed_card_id, + target_holder, + } => Entry::CardTransferConfirmed(RawCardTransferConfirmedParameters { + timestamp: Some(timestamp.into()), + transfer_id: Some(transfer_id.into()), + source_card_id: Some(source_card_id.0.into()), + installed_card_id: Some(installed_card_id.0.into()), + target_holder: Some(card_holder_to_proto(target_holder)), + }), + OplogEntry::CardExpired { + timestamp, + card_id, + wallet_generation, + } => Entry::CardExpired(RawCardExpiredParameters { + timestamp: Some(timestamp.into()), + card_id: Some(card_id.0.into()), + wallet_generation, + }), OplogEntry::HostStreamFrame { parent_start_index, kind, @@ -3752,6 +4248,10 @@ impl TryFrom for OplogEntry trace_id, trace_states: p.trace_states, invocation_context, + wallet_pin: p + .wallet_pin + .map(invocation_wallet_pin_from_proto) + .transpose()?, }) } Entry::AgentInvocationFinished(p) => { @@ -4017,8 +4517,9 @@ impl TryFrom for OplogEntry active_cards: p .active_cards .into_iter() - .map(|card| crate::serialization::deserialize(&card)) + .map(|card| deserialize_stored_card(&card, "active card")) .collect::, _>>()?, + wallet_generation: p.wallet_generation, }) } Entry::OplogProcessorCheckpoint(p) => { @@ -4052,6 +4553,7 @@ impl TryFrom for OplogEntry timestamp: p.timestamp.map(Into::into).unwrap_or(timestamp), queued_event_index: OplogIndex::from_u64(p.queued_event_index), card_id: CardId(p.card_id.ok_or("Missing card_id")?.into()), + wallet_generation: p.wallet_generation, }), Entry::CardEventQueued(p) => Ok(OplogEntry::CardEventQueued { timestamp: p.timestamp.map(Into::into).unwrap_or(timestamp), @@ -4060,8 +4562,8 @@ impl TryFrom for OplogEntry Entry::CardInstalled(p) => Ok(OplogEntry::CardInstalled { timestamp: p.timestamp.map(Into::into).unwrap_or(timestamp), queued_event_index: p.queued_event_index.map(OplogIndex::from_u64), - card: crate::serialization::deserialize(&p.card) - .map_err(|err| format!("Failed to deserialize installed card: {err}"))?, + card: deserialize_stored_card(&p.card, "installed card")?, + wallet_generation: p.wallet_generation, }), Entry::CardInstallFailed(p) => Ok(OplogEntry::CardInstallFailed { timestamp: p.timestamp.map(Into::into).unwrap_or(timestamp), @@ -4072,9 +4574,76 @@ impl TryFrom for OplogEntry .map_err(|e| format!("Invalid raw card install failure: {e}"))?, )?, }), + Entry::CardDerived(p) => Ok(OplogEntry::CardDerived { + timestamp: p.timestamp.map(Into::into).unwrap_or(timestamp), + card: deserialize_stored_card(&p.card, "derived card")?, + wallet_generation: p.wallet_generation, + }), + Entry::CardTransferStarted(p) => Ok(OplogEntry::CardTransferStarted { + timestamp: p.timestamp.map(Into::into).unwrap_or(timestamp), + transfer_id: p.transfer_id.ok_or("Missing transfer_id")?.into(), + card_id: CardId(p.card_id.ok_or("Missing card_id")?.into()), + source_holder: p.source_holder.map(card_holder_from_proto).transpose()?, + target_holder: card_holder_from_proto( + p.target_holder.ok_or("Missing target_holder")?, + )?, + source_wallet_generation: p.source_wallet_generation, + }), + Entry::CardTransferred(p) => { + let installed_card_id = CardId( + p.installed_card_id + .ok_or("Missing installed_card_id")? + .into(), + ); + let card = deserialize_stored_card(&p.card, "transferred card")?; + if card.card_id() != installed_card_id { + return Err( + "Transferred card payload does not match installed_card_id".to_string() + ); + } + Ok(OplogEntry::CardTransferred { + timestamp: p.timestamp.map(Into::into).unwrap_or(timestamp), + transfer_id: p.transfer_id.ok_or("Missing transfer_id")?.into(), + source_card_id: p.source_card_id.map(|id| CardId(id.into())), + installed_card_id, + target_holder: card_holder_from_proto( + p.target_holder.ok_or("Missing target_holder")?, + )?, + card, + target_wallet_generation: p.target_wallet_generation, + }) + } + Entry::CardRevokedCascade(p) => Ok(OplogEntry::CardRevokedCascade { + timestamp: p.timestamp.map(Into::into).unwrap_or(timestamp), + revoked_card_ids: p + .revoked_card_ids + .into_iter() + .map(|id| CardId(id.into())) + .collect(), + affected_wallets: p + .affected_wallets + .into_iter() + .map(card_holder_from_proto) + .collect::, _>>()?, + local_wallet_generation: p.local_wallet_generation, + }), + Entry::CardTransferConfirmed(p) => Ok(OplogEntry::CardTransferConfirmed { + timestamp: p.timestamp.map(Into::into).unwrap_or(timestamp), + transfer_id: p.transfer_id.ok_or("Missing transfer_id")?.into(), + source_card_id: CardId(p.source_card_id.ok_or("Missing source_card_id")?.into()), + installed_card_id: CardId( + p.installed_card_id + .ok_or("Missing installed_card_id")? + .into(), + ), + target_holder: card_holder_from_proto( + p.target_holder.ok_or("Missing target_holder")?, + )?, + }), Entry::CardExpired(p) => Ok(OplogEntry::CardExpired { timestamp: p.timestamp.map(Into::into).unwrap_or(timestamp), card_id: CardId(p.card_id.ok_or("Missing card_id")?.into()), + wallet_generation: p.wallet_generation, }), Entry::HostStreamFrame(p) => Ok(OplogEntry::HostStreamFrame { timestamp, @@ -4135,11 +4704,18 @@ mod read_only_violation_roundtrip { #[cfg(test)] mod queued_card_event_proto_tests { - use crate::base_model::oplog::{QueuedCardEvent, QueuedCardEventCard}; + use crate::base_model::oplog::{ + QueuedCardEvent, QueuedCardEventCard, QueuedCardEventTransferReceived, + }; use crate::model::card::{Card, CardId, StoredCard}; + use golem_api_grpc::proto::golem::worker::card_holder::Holder; use golem_api_grpc::proto::golem::worker::raw_queued_card_event::Event; - use golem_api_grpc::proto::golem::worker::{RawQueuedCardEvent, raw_queued_card_event}; + use golem_api_grpc::proto::golem::worker::{ + CardHolder, RawQueuedCardEvent, raw_queued_card_event, + }; + use proptest::prelude::*; use test_r::test; + use uuid::Uuid; fn stored_card(card_id: CardId) -> StoredCard { StoredCard::Concrete(Card { @@ -4200,4 +4776,103 @@ mod queued_card_event_proto_tests { "raw queued card installs with mismatched outer card_id and payload must not encode to an undecodable protobuf" ); } + + #[test] + fn raw_received_card_transfer_protobuf_roundtrip_preserves_receipt_payload() { + let card_id = CardId::new(); + let source_card_id = CardId::new(); + let event = QueuedCardEvent::TransferReceived(QueuedCardEventTransferReceived { + transfer_id: Uuid::new_v4(), + source_card_id: Some(source_card_id), + card_id, + card: Some(stored_card(card_id)), + }); + + let encoded = super::raw_queued_card_event_to_proto(event.clone()).unwrap(); + let decoded = super::raw_queued_card_event_from_proto(encoded).unwrap(); + + assert_eq!(decoded, event); + } + + #[test] + fn raw_received_card_transfer_protobuf_rejects_trailing_payload_bytes() { + let card_id = CardId::new(); + let event = QueuedCardEvent::TransferReceived(QueuedCardEventTransferReceived { + transfer_id: Uuid::new_v4(), + source_card_id: Some(CardId::new()), + card_id, + card: Some(stored_card(card_id)), + }); + let mut encoded = super::raw_queued_card_event_to_proto(event).unwrap(); + let Event::TransferReceived(receipt) = encoded.event.as_mut().unwrap() else { + unreachable!() + }; + receipt.card.push(0xff); + + assert!( + super::raw_queued_card_event_from_proto(encoded).is_err(), + "a StoredCard payload with trailing bytes is malformed and must be rejected" + ); + } + + #[test] + fn raw_queued_card_transfer_with_malformed_payload_is_rejected() { + let proto = RawQueuedCardEvent { + event: Some(Event::TransferStarted( + raw_queued_card_event::TransferStarted { + transfer_id: Some(Uuid::new_v4().into()), + card_id: Some(CardId::new().0.into()), + card: vec![u8::MAX], + target_holder: Some(CardHolder { + holder: Some(Holder::Account(Uuid::new_v4().into())), + }), + }, + )), + }; + + assert!( + super::raw_queued_card_event_from_proto(proto).is_err(), + "malformed raw queued card transfer payloads must be rejected without panicking" + ); + } + + #[test] + fn raw_queued_card_install_with_negative_collection_length_is_rejected_without_panicking() { + let mut card = vec![crate::serialization::SERIALIZATION_VERSION_V3, 0, 0, 0]; + card.extend_from_slice(&[0; 16]); + card.push(0x03); + + let proto = RawQueuedCardEvent { + event: Some(Event::Install(raw_queued_card_event::Install { + card_id: Some(Uuid::nil().into()), + card, + })), + }; + + let result = std::panic::catch_unwind(|| super::raw_queued_card_event_from_proto(proto)); + + assert!(matches!(result, Ok(Err(_)))); + } + + proptest! { + #[test] + fn malformed_v3_raw_queued_card_transfer_never_panics(mut payload in prop::collection::vec(any::(), 0..128)) { + payload.insert(0, crate::serialization::SERIALIZATION_VERSION_V3); + let proto = RawQueuedCardEvent { + event: Some(Event::TransferStarted( + raw_queued_card_event::TransferStarted { + transfer_id: Some(Uuid::new_v4().into()), + card_id: Some(CardId::new().0.into()), + card: payload, + target_holder: Some(CardHolder { + holder: Some(Holder::Account(Uuid::new_v4().into())), + }), + }, + )), + }; + + let result = std::panic::catch_unwind(|| super::raw_queued_card_event_from_proto(proto)); + prop_assert!(result.is_ok(), "malformed raw queued card transfer payload panicked"); + } + } } diff --git a/golem-common/src/model/oplog/tests.rs b/golem-common/src/model/oplog/tests.rs index 2e612ac99a..56f58236a2 100644 --- a/golem-common/src/model/oplog/tests.rs +++ b/golem-common/src/model/oplog/tests.rs @@ -13,7 +13,11 @@ // limitations under the License. use crate::base_model::environment_plugin_grant::EnvironmentPluginGrantId; -use crate::model::card::{Card, CardId}; +use crate::model::agent::Principal; +use crate::model::card::{ + AccountCardHolder, AgentCardHolder, ApplicationCardHolder, Card, CardHolder, CardId, + InvocationWalletPin, PublicInvocationWalletPin, WalletVersionToken, +}; use crate::model::component::PluginPriority; use crate::model::invocation_context::{SpanId, TraceId}; use crate::model::lucene::Query; @@ -22,14 +26,17 @@ use crate::model::oplog::payload::{HostRequestSecretReveal, HostResponseSecretRe use crate::model::oplog::public_oplog_entry::{ ActivatePluginParams, AgentInvocationFinishedParams, AgentInvocationStartedParams, BeginAtomicRegionParams, BeginRemoteTransactionParams, CancelPendingInvocationParams, - CancelledParams, ChangePersistenceLevelParams, CommittedRemoteTransactionParams, CreateParams, - CreateResourceParams, DeactivatePluginParams, DropResourceParams, EndAtomicRegionParams, - EndParams, ErrorParams, ExitedParams, FailedUpdateParams, FinishSpanParams, GrowMemoryParams, - InterruptedParams, JumpParams, LogParams, NoOpParams, PendingAgentInvocationParams, - PendingUpdateParams, PreCommitRemoteTransactionParams, PreRollbackRemoteTransactionParams, - RemoveRetryPolicyParams, RestartParams, RevertParams, RolledBackRemoteTransactionParams, - SetRetryPolicyParams, SetSpanAttributeParams, SnapshotParams, StartParams, StartSpanParams, - SuccessfulUpdateParams, SuspendParams, + CancelledParams, CardDerivedParams, CardExpiredParams, CardInstalledParams, + CardRevokedCascadeParams, CardRevokedParams, CardTransferConfirmedParams, + CardTransferStartedParams, CardTransferredParams, ChangePersistenceLevelParams, + CommittedRemoteTransactionParams, CreateParams, CreateResourceParams, DeactivatePluginParams, + DropResourceParams, EndAtomicRegionParams, EndParams, ErrorParams, ExitedParams, + FailedUpdateParams, FinishSpanParams, GrowMemoryParams, InterruptedParams, JumpParams, + LogParams, NoOpParams, PendingAgentInvocationParams, PendingUpdateParams, + PreCommitRemoteTransactionParams, PreRollbackRemoteTransactionParams, RemoveRetryPolicyParams, + RestartParams, RevertParams, RolledBackRemoteTransactionParams, SetRetryPolicyParams, + SetSpanAttributeParams, SnapshotParams, StartParams, StartSpanParams, SuccessfulUpdateParams, + SuspendParams, }; use crate::model::oplog::{ AgentInitializationParameters, AgentInvocationOutputParameters, @@ -37,13 +44,14 @@ use crate::model::oplog::{ MultipartPartData, MultipartSnapshotData, MultipartSnapshotPart, OplogEntry, OplogPayload, PersistenceLevel, PluginInstallationDescription, PublicAgentInvocation, PublicAgentInvocationResult, PublicAttribute, PublicAttributeValue, PublicDurableFunctionType, - PublicLocalSpanData, PublicOplogEntry, PublicSnapshotData, PublicSpanData, - PublicTypedAgentConfigEntry, PublicUpdateDescription, RawSnapshotData, - SnapshotBasedUpdateParameters, StringAttributeValue, + PublicLocalSpanData, PublicOplogEntry, PublicQueuedCardEvent, PublicSnapshotData, + PublicSpanData, PublicTypedAgentConfigEntry, PublicUpdateDescription, QueuedCardEvent, + RawSnapshotData, SnapshotBasedUpdateParameters, StringAttributeValue, }; use crate::model::regions::OplogRegion; use crate::model::{ - AccountId, AgentId, ComponentId, Empty, IdempotencyKey, OplogIndex, Timestamp, TransactionId, + AccountId, AgentId, AgentInvocationPayload, ComponentId, Empty, IdempotencyKey, OplogIndex, + Timestamp, TransactionId, }; use crate::schema::IntoTypedSchemaValue; use crate::schema::graph::{SchemaGraph, TypedSchemaValue}; @@ -76,6 +84,23 @@ fn test_card(card_id: CardId) -> Card { } } +fn phase_four_fixture_card() -> Card { + Card { + card_id: CardId(Uuid::parse_str("11111111-2222-3333-4444-555555555555").unwrap()), + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: chrono::DateTime::parse_from_rfc3339("2026-01-02T03:04:05Z") + .unwrap() + .to_utc(), + expires_at: None, + system_card: false, + managed_by: None, + } +} + fn nf(name: &str, body: SchemaType) -> NamedFieldType { NamedFieldType { name: name.to_string(), @@ -429,6 +454,7 @@ fn agent_invocation_started_serialization_poem_serde_equivalence() { inherited: true, })]], }), + wallet_pin: None, }); let serialized = entry.to_json_string(); let deserialized: PublicOplogEntry = serde_json::from_str(&serialized).unwrap(); @@ -572,6 +598,7 @@ fn agent_invocation_started_with_initialization_serialization_poem_serde_equival inherited: false, })]], }), + wallet_pin: None, }); let serialized = entry.to_json_string(); let deserialized: PublicOplogEntry = serde_json::from_str(&serialized).unwrap(); @@ -989,20 +1016,486 @@ fn raw_snapshot_protobuf_roundtrip_preserves_active_cards() { data: OplogPayload::Inline(Box::new(vec![1, 2, 3, 4])), mime_type: "application/octet-stream".to_string(), active_cards, + wallet_generation: 73, }; let proto: golem_api_grpc::proto::golem::worker::RawOplogEntry = entry.clone().try_into().unwrap(); let decoded = OplogEntry::try_from(proto).unwrap(); + let bytes = crate::serialization::serialize(&entry).unwrap(); + let binary_decoded = crate::serialization::deserialize::(&bytes).unwrap(); + match binary_decoded { + OplogEntry::Snapshot { + active_cards, + wallet_generation, + .. + } => { + assert_eq!(active_cards, vec![card.clone().into()]); + assert_eq!(wallet_generation, 73); + } + other => panic!("expected binary snapshot entry, got {other:?}"), + } match decoded { - OplogEntry::Snapshot { active_cards, .. } => { + OplogEntry::Snapshot { + active_cards, + wallet_generation, + .. + } => { assert_eq!(active_cards, vec![card.into()]); + assert_eq!(wallet_generation, 73); + } + other => panic!("expected snapshot entry, got {other:?}"), + } +} + +#[test] +fn invocation_wallet_pin_protobuf_roundtrip_and_legacy_defaults() { + let pinned_card_ids = vec![CardId::new(), CardId::new()]; + let scope_card_id = CardId::new(); + let wallet_token = WalletVersionToken { + wallet_id_hash: [0x42; 32], + generation: 73, + }; + let raw_entry = OplogEntry::AgentInvocationStarted { + timestamp: Timestamp::now_utc().rounded(), + idempotency_key: IdempotencyKey::new("wallet-pin".to_string()), + payload: OplogPayload::Inline(Box::new(AgentInvocationPayload::AgentMethod { + method_name: "test".to_string(), + input: SchemaValue::Record { fields: Vec::new() }, + principal: Principal::anonymous(), + scope_card: None, + })), + trace_id: TraceId::generate(), + trace_states: Vec::new(), + invocation_context: Vec::new(), + wallet_pin: Some(InvocationWalletPin { + wallet_token: wallet_token.clone(), + pinned_card_ids: pinned_card_ids.clone(), + scope_card_id: Some(scope_card_id), + }), + }; + + let mut raw_proto: golem_api_grpc::proto::golem::worker::RawOplogEntry = + raw_entry.clone().try_into().unwrap(); + match OplogEntry::try_from(raw_proto.clone()).unwrap() { + OplogEntry::AgentInvocationStarted { wallet_pin, .. } => { + assert_eq!( + wallet_pin, + Some(InvocationWalletPin { + wallet_token: wallet_token.clone(), + pinned_card_ids: pinned_card_ids.clone(), + scope_card_id: Some(scope_card_id), + }) + ); + } + other => panic!("expected raw invocation-started entry, got {other:?}"), + } + if let Some( + golem_api_grpc::proto::golem::worker::raw_oplog_entry::Entry::AgentInvocationStarted( + params, + ), + ) = &mut raw_proto.entry + { + params.wallet_pin = None; + } else { + panic!("expected raw invocation-started protobuf entry"); + } + match OplogEntry::try_from(raw_proto).unwrap() { + OplogEntry::AgentInvocationStarted { wallet_pin, .. } => { + assert_eq!(wallet_pin, None); + } + other => panic!("expected raw invocation-started entry, got {other:?}"), + } + + let public_entry = PublicOplogEntry::AgentInvocationStarted(AgentInvocationStartedParams { + timestamp: Timestamp::now_utc().rounded(), + invocation: PublicAgentInvocation::SaveSnapshot(Empty {}), + wallet_pin: Some(PublicInvocationWalletPin { + wallet_token, + scope_card_id: Some(scope_card_id), + }), + }); + let mut public_proto: golem_api_grpc::proto::golem::worker::OplogEntry = + public_entry.clone().try_into().unwrap(); + assert_eq!( + PublicOplogEntry::try_from(public_proto.clone()).unwrap(), + public_entry + ); + if let Some(golem_api_grpc::proto::golem::worker::oplog_entry::Entry::AgentInvocationStarted( + params, + )) = &mut public_proto.entry + { + params.wallet_pin = None; + } else { + panic!("expected public invocation-started protobuf entry"); + } + match PublicOplogEntry::try_from(public_proto).unwrap() { + PublicOplogEntry::AgentInvocationStarted(params) => { + assert_eq!(params.wallet_pin, None); + } + other => panic!("expected public invocation-started entry, got {other:?}"), + } +} + +#[test] +fn phase_four_queued_card_event_binary_fixtures_remain_decodable() { + let card = phase_four_fixture_card(); + let card_id = card.card_id; + let fixtures = [ + ( + include_bytes!( + "../../../tests/fixtures/permission-cards/phase4/queued_card_event_install.bin" + ) + .as_slice(), + QueuedCardEvent::install(card), + ), + ( + include_bytes!( + "../../../tests/fixtures/permission-cards/phase4/queued_card_event_revoke.bin" + ) + .as_slice(), + QueuedCardEvent::revoke(card_id), + ), + ]; + + for (bytes, expected) in fixtures { + assert_eq!( + crate::serialization::deserialize::(bytes).unwrap(), + expected + ); + } +} + +#[test] +fn phase_four_public_queued_card_event_binary_fixtures_remain_decodable() { + let card_id = phase_four_fixture_card().card_id; + let fixtures = [ + ( + include_bytes!( + "../../../tests/fixtures/permission-cards/phase4/public_queued_card_event_install.bin" + ) + .as_slice(), + PublicQueuedCardEvent::Install(crate::model::oplog::PublicQueuedCardEventCard { + card_id, + }), + ), + ( + include_bytes!( + "../../../tests/fixtures/permission-cards/phase4/public_queued_card_event_revoke.bin" + ) + .as_slice(), + PublicQueuedCardEvent::Revoke(crate::model::oplog::PublicQueuedCardEventCard { + card_id, + }), + ), + ]; + + for (bytes, expected) in fixtures { + assert_eq!( + crate::serialization::deserialize::(bytes).unwrap(), + expected + ); + } +} + +#[test] +fn phase_four_card_oplog_binary_fixtures_remain_decodable() { + let card = phase_four_fixture_card(); + let card_id = card.card_id; + let timestamp = Timestamp::from(1_750_000_000_123); + let queued_event_index = OplogIndex::from_u64(42); + let fixtures = [ + ( + include_bytes!( + "../../../tests/fixtures/permission-cards/phase4/oplog_entry_card_event_queued_install.bin" + ) + .as_slice(), + OplogEntry::CardEventQueued { + timestamp, + event: QueuedCardEvent::install(card.clone()), + }, + ), + ( + include_bytes!( + "../../../tests/fixtures/permission-cards/phase4/oplog_entry_card_event_queued_revoke.bin" + ) + .as_slice(), + OplogEntry::CardEventQueued { + timestamp, + event: QueuedCardEvent::revoke(card_id), + }, + ), + ( + include_bytes!( + "../../../tests/fixtures/permission-cards/phase4/oplog_entry_card_installed.bin" + ) + .as_slice(), + OplogEntry::CardInstalled { + timestamp, + queued_event_index: Some(queued_event_index), + card: card.into(), + wallet_generation: None, + }, + ), + ( + include_bytes!( + "../../../tests/fixtures/permission-cards/phase4/oplog_entry_card_install_failed.bin" + ) + .as_slice(), + OplogEntry::CardInstallFailed { + timestamp, + queued_event_index, + card_id, + reason: crate::model::oplog::CardInstallFailure::RecipientMismatch, + }, + ), + ( + include_bytes!( + "../../../tests/fixtures/permission-cards/phase4/oplog_entry_card_revoked.bin" + ) + .as_slice(), + OplogEntry::CardRevoked { + timestamp, + queued_event_index, + card_id, + wallet_generation: None, + }, + ), + ( + include_bytes!( + "../../../tests/fixtures/permission-cards/phase4/oplog_entry_card_expired.bin" + ) + .as_slice(), + OplogEntry::CardExpired { + timestamp, + card_id, + wallet_generation: None, + }, + ), + ]; + + for (bytes, expected) in fixtures { + assert_eq!( + crate::serialization::deserialize::(bytes).unwrap(), + expected + ); + } +} + +#[test] +fn phase_four_snapshot_with_active_cards_remains_decodable() { + let bytes = include_bytes!( + "../../../tests/fixtures/permission-cards/phase4/oplog_entry_snapshot_with_active_card.bin" + ); + + let decoded = crate::serialization::deserialize::(bytes).unwrap(); + + match decoded { + OplogEntry::Snapshot { + active_cards, + wallet_generation, + .. + } => { + assert_eq!(active_cards, vec![phase_four_fixture_card().into()]); + assert_eq!(wallet_generation, 0); } other => panic!("expected snapshot entry, got {other:?}"), } } +#[test] +fn phase_five_raw_card_oplog_entries_protobuf_roundtrip() { + let source_card_id = CardId::new(); + let installed_card_id = CardId::new(); + let source_card = test_card(source_card_id); + let installed_card = test_card(installed_card_id); + let transfer_id = Uuid::new_v4(); + let source_holder = CardHolder::Account(AccountCardHolder { + account_id: Uuid::new_v4(), + }); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: AgentId { + component_id: ComponentId(Uuid::new_v4()), + agent_id: "phase-five-target".to_string(), + }, + }); + let application_holder = CardHolder::Application(ApplicationCardHolder { + application_id: Uuid::new_v4(), + }); + let timestamp = Timestamp::now_utc().rounded(); + let entries = vec![ + OplogEntry::CardInstalled { + timestamp, + queued_event_index: None, + card: source_card.clone().into(), + wallet_generation: Some(1), + }, + OplogEntry::CardDerived { + timestamp, + card: source_card.clone().into(), + wallet_generation: Some(3), + }, + OplogEntry::CardRevoked { + timestamp, + queued_event_index: OplogIndex::from_u64(1), + card_id: source_card_id, + wallet_generation: Some(4), + }, + OplogEntry::CardExpired { + timestamp, + card_id: installed_card_id, + wallet_generation: Some(5), + }, + OplogEntry::CardTransferStarted { + timestamp, + transfer_id, + card_id: source_card_id, + source_holder: Some(source_holder.clone()), + target_holder: target_holder.clone(), + source_wallet_generation: Some(4), + }, + OplogEntry::CardTransferred { + timestamp, + transfer_id, + source_card_id: Some(source_card_id), + installed_card_id, + target_holder: target_holder.clone(), + card: installed_card.into(), + target_wallet_generation: Some(7), + }, + OplogEntry::CardRevokedCascade { + timestamp, + revoked_card_ids: vec![source_card_id, installed_card_id], + affected_wallets: vec![source_holder.clone(), target_holder.clone()], + local_wallet_generation: Some(8), + }, + OplogEntry::CardTransferConfirmed { + timestamp, + transfer_id, + source_card_id, + installed_card_id, + target_holder: target_holder.clone(), + }, + OplogEntry::CardEventQueued { + timestamp, + event: QueuedCardEvent::transfer_started(transfer_id, source_card, application_holder), + }, + OplogEntry::CardTransferStarted { + timestamp, + transfer_id: Uuid::new_v4(), + card_id: installed_card_id, + source_holder: None, + target_holder, + source_wallet_generation: None, + }, + ]; + + for entry in entries { + let proto: golem_api_grpc::proto::golem::worker::RawOplogEntry = + entry.clone().try_into().unwrap(); + assert_eq!(OplogEntry::try_from(proto).unwrap(), entry); + + let bytes = crate::serialization::serialize(&entry).unwrap(); + assert_eq!( + crate::serialization::deserialize::(&bytes).unwrap(), + entry + ); + } +} + +#[test] +fn phase_five_public_card_oplog_entries_protobuf_roundtrip() { + let card_id = CardId::new(); + let installed_card_id = CardId::new(); + let transfer_id = Uuid::new_v4(); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: AgentId { + component_id: ComponentId(Uuid::new_v4()), + agent_id: "phase-five-public-target".to_string(), + }, + }); + let timestamp = Timestamp::now_utc().rounded(); + let entries = vec![ + PublicOplogEntry::CardInstalled(CardInstalledParams { + timestamp, + queued_event_index: None, + card_id, + wallet_generation: Some(1), + }), + PublicOplogEntry::CardDerived(CardDerivedParams { + timestamp, + card_id, + parent_ids: vec![CardId::new(), CardId::new()], + wallet_generation: Some(3), + }), + PublicOplogEntry::CardRevoked(CardRevokedParams { + timestamp, + queued_event_index: OplogIndex::from_u64(1), + card_id, + wallet_generation: Some(4), + }), + PublicOplogEntry::CardExpired(CardExpiredParams { + timestamp, + card_id: installed_card_id, + wallet_generation: Some(5), + }), + PublicOplogEntry::CardTransferStarted(CardTransferStartedParams { + timestamp, + transfer_id, + card_id, + target_holder: target_holder.clone(), + source_wallet_generation: Some(4), + }), + PublicOplogEntry::CardTransferred(CardTransferredParams { + timestamp, + transfer_id, + source_card_id: Some(card_id), + installed_card_id, + target_holder: target_holder.clone(), + target_wallet_generation: Some(7), + }), + PublicOplogEntry::CardRevokedCascade(CardRevokedCascadeParams { + timestamp, + revoked_card_ids: vec![card_id, installed_card_id], + local_wallet_generation: Some(8), + }), + PublicOplogEntry::CardTransferConfirmed(CardTransferConfirmedParams { + timestamp, + transfer_id, + source_card_id: card_id, + installed_card_id, + target_holder, + }), + PublicOplogEntry::CardEventQueued( + crate::model::oplog::public_oplog_entry::CardEventQueuedParams { + timestamp, + event: PublicQueuedCardEvent::TransferStarted( + crate::model::oplog::PublicQueuedCardEventTransfer { + transfer_id, + card_id, + target_holder: CardHolder::Application(ApplicationCardHolder { + application_id: Uuid::new_v4(), + }), + }, + ), + }, + ), + ]; + + for entry in entries { + let proto: golem_api_grpc::proto::golem::worker::OplogEntry = + entry.clone().try_into().unwrap(); + assert_eq!(PublicOplogEntry::try_from(proto).unwrap(), entry); + + let json = serde_json::to_string(&entry).unwrap(); + assert_eq!( + serde_json::from_str::(&json).unwrap(), + entry + ); + } +} + #[test] fn snapshot_json_serialization_poem_serde_equivalence() { let entry = PublicOplogEntry::Snapshot(SnapshotParams { diff --git a/golem-common/src/model/tests.rs b/golem-common/src/model/tests.rs index 2371084638..f5ddfc71a8 100644 --- a/golem-common/src/model/tests.rs +++ b/golem-common/src/model/tests.rs @@ -537,3 +537,42 @@ fn agent_invocation_result_redacted_debug_hides_capability_material() { format!("{:?}", AgentInvocationResult::ManualUpdate) ); } + +#[test] +fn agent_invocation_payload_round_trip_preserves_scope_card() { + use crate::model::card::{CardId, ScopeCard}; + use crate::model::invocation_context::InvocationContextStack; + use crate::model::{AgentInvocation, AgentInvocationPayload, Principal}; + use crate::schema::SchemaValue; + use crate::serialization::{deserialize, serialize}; + + let scope_card = ScopeCard { + scope_card_id: CardId(Uuid::from_u128(1)), + root_card_ids: vec![CardId(Uuid::from_u128(2))], + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + }; + let invocation = AgentInvocation::AgentMethod { + idempotency_key: IdempotencyKey::fresh(), + method_name: "run".to_string(), + input: SchemaValue::Tuple { + elements: Vec::new(), + }, + invocation_context: InvocationContextStack::fresh(), + principal: Principal::anonymous(), + scope_card: Some(scope_card.clone()), + }; + let (_, payload, _) = invocation.into_parts(); + let encoded = serialize(&payload).unwrap(); + let decoded: AgentInvocationPayload = deserialize(&encoded).unwrap(); + + assert!(matches!( + decoded, + AgentInvocationPayload::AgentMethod { + scope_card: Some(decoded_scope_card), + .. + } if decoded_scope_card == scope_card + )); +} diff --git a/golem-common/src/schema/agent/mod.rs b/golem-common/src/schema/agent/mod.rs index 8bdea52faa..02e055fcc6 100644 --- a/golem-common/src/schema/agent/mod.rs +++ b/golem-common/src/schema/agent/mod.rs @@ -674,7 +674,8 @@ fn find_p3_stub(ty: &SchemaType) -> Option<&'static str> { | SchemaType::Duration { .. } | SchemaType::Quantity { .. } | SchemaType::Secret { .. } - | SchemaType::QuotaToken { .. } => None, + | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } => None, } } diff --git a/golem-common/src/schema/agent/wit.rs b/golem-common/src/schema/agent/wit.rs index c32f4b42cb..3a4baa9cfd 100644 --- a/golem-common/src/schema/agent/wit.rs +++ b/golem-common/src/schema/agent/wit.rs @@ -530,7 +530,8 @@ pub fn decode_agent_error( #[cfg(feature = "full")] pub fn decode_agent_error_rejecting_quota_with< D: golem_schema::schema::wit::QuotaTokenHandleDropper - + golem_schema::schema::wit::SecretHandleDropper, + + golem_schema::schema::wit::SecretHandleDropper + + golem_schema::schema::wit::PermissionCardHandleDropper, >( w: wire::AgentError, dropper: &mut D, diff --git a/golem-common/src/schema/mod.rs b/golem-common/src/schema/mod.rs index 55ddef7cc5..ec8ea75407 100644 --- a/golem-common/src/schema/mod.rs +++ b/golem-common/src/schema/mod.rs @@ -60,10 +60,12 @@ pub use host_managed::{ pub use metadata::{MetadataEnvelope, Role, TypeId}; pub use schema_type::{ BinaryRestrictions, DiscriminatorRule, FieldDiscriminator, NamedFieldType, PathDirection, - PathKind, PathSpec, QuantitySpec, QuantityValue, QuotaTokenSpec, ResultSpec, SchemaType, - SecretSpec, TextRestrictions, UnionBranch, UnionSpec, UrlRestrictions, VariantCaseType, + PathKind, PathSpec, PermissionCardSpec, QuantitySpec, QuantityValue, QuotaTokenSpec, + ResultSpec, SchemaType, SecretSpec, TextRestrictions, UnionBranch, UnionSpec, UrlRestrictions, + VariantCaseType, }; pub use schema_value::{ - BinaryValuePayload, DurationValuePayload, QuotaTokenValuePayload, ResultValuePayload, - SchemaValue, SecretValuePayload, TextValuePayload, UnionValuePayload, VariantValuePayload, + BinaryValuePayload, DurationValuePayload, PermissionCardValuePayload, QuotaTokenValuePayload, + ResultValuePayload, SchemaValue, SecretValuePayload, TextValuePayload, UnionValuePayload, + VariantValuePayload, }; diff --git a/golem-common/src/schema/render/cli_text.rs b/golem-common/src/schema/render/cli_text.rs index 4060146fe0..f543b9d10b 100644 --- a/golem-common/src/schema/render/cli_text.rs +++ b/golem-common/src/schema/render/cli_text.rs @@ -247,6 +247,13 @@ fn type_to_text_inner( } SchemaType::Secret { .. } => "secret".to_string(), SchemaType::QuotaToken { .. } => "quota-token".to_string(), + SchemaType::PermissionCard { spec, .. } => { + if spec.polymorphic { + "permission-card".to_string() + } else { + "permission-card".to_string() + } + } SchemaType::Future { inner, .. } => match inner { None => "future".to_string(), Some(t) => format!("future<{}>", type_to_text_inner(graph, t, visited)), @@ -403,6 +410,9 @@ fn render_value( (SchemaType::QuotaToken { .. }, SchemaValue::QuotaToken(p)) => { Ok(canonical::quota_token::to_text(p)?) } + (SchemaType::PermissionCard { .. }, SchemaValue::PermissionCard(p)) => { + Ok(canonical::permission_card::to_text(p)?) + } (SchemaType::Record { fields, .. }, SchemaValue::Record { fields: vs }) => { if fields.len() != vs.len() { diff --git a/golem-common/src/schema/render/json_schema.rs b/golem-common/src/schema/render/json_schema.rs index ab2307be1b..86ecfbd81c 100644 --- a/golem-common/src/schema/render/json_schema.rs +++ b/golem-common/src/schema/render/json_schema.rs @@ -19,9 +19,9 @@ use crate::schema::agent::{FieldSource, InputSchema, OutputSchema}; use crate::schema::graph::SchemaGraph; use crate::schema::metadata::{MetadataEnvelope, TypeId}; use crate::schema::schema_type::{ - BinaryRestrictions, DiscriminatorRule, NamedFieldType, PathSpec, QuantitySpec, QuantityValue, - QuotaTokenSpec, ResultSpec, SchemaType, SecretSpec, TextRestrictions, UnionBranch, UnionSpec, - UrlRestrictions, VariantCaseType, + BinaryRestrictions, DiscriminatorRule, NamedFieldType, PathSpec, PermissionCardSpec, + QuantitySpec, QuantityValue, QuotaTokenSpec, ResultSpec, SchemaType, SecretSpec, + TextRestrictions, UnionBranch, UnionSpec, UrlRestrictions, VariantCaseType, }; use serde_json::{Map, Number, Value}; use std::collections::{HashMap, HashSet}; @@ -791,6 +791,7 @@ pub(super) fn render_type( SchemaType::Secret { spec, .. } => Value::Object(secret_schema(spec)), SchemaType::QuotaToken { spec, .. } => Value::Object(quota_token_schema(spec)), + SchemaType::PermissionCard { spec, .. } => Value::Object(permission_card_schema(spec)), SchemaType::Future { .. } | SchemaType::Stream { .. } => obj([ ("type", Value::String("null".to_string())), @@ -1210,6 +1211,48 @@ fn quota_token_schema(_spec: &QuotaTokenSpec) -> Map { m } +fn permission_card_schema(_spec: &PermissionCardSpec) -> Map { + // Permission-card values are opaque capability handles. The transported + // snapshot carries card_id (authoritative), parent_ids, expires_at, and + // polymorphic as trusted cache. See canonical/permission_card.rs. + let card_id = obj_inline([ + ("type", Value::String("string".to_string())), + ("format", Value::String("uuid".to_string())), + ]); + let parent_ids = obj_inline([ + ("type", Value::String("array".to_string())), + ( + "items", + obj_inline([ + ("type", Value::String("string".to_string())), + ("format", Value::String("uuid".to_string())), + ]), + ), + ]); + let expires_at = obj_inline([ + ("type", Value::String("string".to_string())), + ("format", Value::String("date-time".to_string())), + ]); + let polymorphic = obj_inline([("type", Value::String("boolean".to_string()))]); + let mut properties = Map::new(); + properties.insert("cardId".to_string(), card_id); + properties.insert("parentIds".to_string(), parent_ids); + properties.insert("expiresAt".to_string(), expires_at); + properties.insert("polymorphic".to_string(), polymorphic); + let mut m = Map::new(); + m.insert("type".to_string(), Value::String("object".to_string())); + m.insert("properties".to_string(), Value::Object(properties)); + m.insert( + "required".to_string(), + Value::Array(vec![ + Value::String("cardId".to_string()), + Value::String("polymorphic".to_string()), + ]), + ); + m.insert("additionalProperties".to_string(), Value::Bool(false)); + m +} + fn union_schema( graph: &SchemaGraph, spec: &UnionSpec, diff --git a/golem-common/src/schema/render/json_value.rs b/golem-common/src/schema/render/json_value.rs index 33fdc8405d..f1a45a8e80 100644 --- a/golem-common/src/schema/render/json_value.rs +++ b/golem-common/src/schema/render/json_value.rs @@ -179,6 +179,9 @@ fn encode( (SchemaType::QuotaToken { .. }, SchemaValue::QuotaToken(p)) => { canonical::quota_token::to_json(p).map_err(RenderError::from) } + (SchemaType::PermissionCard { .. }, SchemaValue::PermissionCard(p)) => { + canonical::permission_card::to_json(p).map_err(RenderError::from) + } (SchemaType::Record { fields, .. }, SchemaValue::Record { fields: vs }) => { if fields.len() != vs.len() { @@ -587,6 +590,10 @@ fn from_json_body( let p = canonical::quota_token::from_json(json)?; Ok(SchemaValue::QuotaToken(p)) } + SchemaType::PermissionCard { .. } => { + let p = canonical::permission_card::from_json(json)?; + Ok(SchemaValue::PermissionCard(p)) + } SchemaType::Record { fields, .. } => { let obj = json @@ -1055,6 +1062,7 @@ fn type_name(ty: &SchemaType) -> &'static str { SchemaType::Union { .. } => "union", SchemaType::Secret { .. } => "secret", SchemaType::QuotaToken { .. } => "quota-token", + SchemaType::PermissionCard { .. } => "permission-card", SchemaType::Future { .. } => "future", SchemaType::Stream { .. } => "stream", } @@ -1095,6 +1103,7 @@ fn value_name(value: &SchemaValue) -> &'static str { SchemaValue::Union(_) => "union", SchemaValue::Secret(_) => "secret", SchemaValue::QuotaToken(_) => "quota-token", + SchemaValue::PermissionCard(_) => "permission-card", } } diff --git a/golem-common/src/schema/render/tests/cli_text_tests.rs b/golem-common/src/schema/render/tests/cli_text_tests.rs index 42506aba88..be851369ee 100644 --- a/golem-common/src/schema/render/tests/cli_text_tests.rs +++ b/golem-common/src/schema/render/tests/cli_text_tests.rs @@ -18,10 +18,11 @@ use crate::schema::render::cli_text::{ type_to_cli_text, value_to_cli_text, value_to_cli_text_unredacted, }; use crate::schema::schema_type::{ - NamedFieldType, QuotaTokenSpec, SchemaType, SecretSpec, TextRestrictions, + NamedFieldType, PermissionCardSpec, QuotaTokenSpec, SchemaType, SecretSpec, TextRestrictions, }; use crate::schema::schema_value::{ - QuotaTokenValuePayload, SchemaValue, SecretValuePayload, TextValuePayload, + PermissionCardValuePayload, QuotaTokenValuePayload, SchemaValue, SecretValuePayload, + TextValuePayload, }; use chrono::{TimeZone, Utc}; use proptest::prelude::*; @@ -138,6 +139,34 @@ fn quota_token_value_is_redacted_by_default() { assert_eq!(text, ""); } +#[test] +fn permission_card_type_and_value_render_safely() { + let ty = SchemaType::permission_card(PermissionCardSpec { polymorphic: true }); + let graph = SchemaGraph::anonymous(ty.clone()); + assert_eq!( + type_to_cli_text(&graph, &ty), + "permission-card" + ); + + let payload = PermissionCardValuePayload { + card_id: uuid::Uuid::from_u128(1), + parent_ids: vec![uuid::Uuid::from_u128(2)], + expires_at: Some(Utc.timestamp_opt(1_700_000_000, 0).unwrap()), + polymorphic: true, + }; + let value = SchemaValue::PermissionCard(payload.clone()); + let redacted = value_to_cli_text(&graph, &ty, &value).expect("redacted permission-card"); + assert_eq!(redacted, ""); + + let unredacted = + value_to_cli_text_unredacted(&graph, &ty, &value).expect("unredacted permission-card"); + assert!(unredacted.starts_with("permission-card:")); + assert_eq!( + canonical::permission_card::from_text(&unredacted).expect("parse permission-card text"), + payload + ); +} + #[test] fn capability_value_is_redacted_inside_record() { let ty = SchemaType::record(vec![ diff --git a/golem-common/src/schema/render/tests/json_value_tests.rs b/golem-common/src/schema/render/tests/json_value_tests.rs index 58b50a20d0..78e24806c2 100644 --- a/golem-common/src/schema/render/tests/json_value_tests.rs +++ b/golem-common/src/schema/render/tests/json_value_tests.rs @@ -19,12 +19,12 @@ use crate::schema::render::error::RenderError; use crate::schema::render::json_value::{from_json_value, to_json_value, to_json_value_redacted}; use crate::schema::render::tests::paired_strategy::paired_strategy; use crate::schema::schema_type::{ - DiscriminatorRule, FieldDiscriminator, NamedFieldType, QuotaTokenSpec, ResultSpec, SchemaType, - SecretSpec, TextRestrictions, UnionBranch, UnionSpec, VariantCaseType, + DiscriminatorRule, FieldDiscriminator, NamedFieldType, PermissionCardSpec, QuotaTokenSpec, + ResultSpec, SchemaType, SecretSpec, TextRestrictions, UnionBranch, UnionSpec, VariantCaseType, }; use crate::schema::schema_value::{ - QuotaTokenValuePayload, SchemaValue, SecretValuePayload, TextValuePayload, UnionValuePayload, - VariantValuePayload, + PermissionCardValuePayload, QuotaTokenValuePayload, SchemaValue, SecretValuePayload, + TextValuePayload, UnionValuePayload, VariantValuePayload, }; use chrono::{TimeZone, Utc}; use proptest::prelude::*; @@ -740,6 +740,33 @@ fn to_json_value_redacted_replaces_quota_token_with_placeholder() { assert_eq!(json, json!("")); } +#[test] +fn permission_card_json_round_trip_matches_schema_and_redacts() { + let ty = SchemaType::permission_card(PermissionCardSpec { polymorphic: true }); + let graph = SchemaGraph::anonymous(ty.clone()); + let value = SchemaValue::PermissionCard(PermissionCardValuePayload { + card_id: uuid::Uuid::from_u128(1), + parent_ids: vec![uuid::Uuid::from_u128(2)], + expires_at: Some(Utc.timestamp_opt(1_700_000_000, 0).unwrap()), + polymorphic: true, + }); + + let json = to_json_value(&graph, &ty, &value).expect("encode permission-card"); + let decoded = from_json_value(&graph, &ty, &json).expect("decode permission-card"); + assert_eq!(decoded, value); + + let schema = crate::schema::render::json_schema::to_json_schema(&graph, &ty); + let compiled = jsonschema::draft202012::new(&schema).expect("compile permission-card schema"); + assert!( + compiled.is_valid(&json), + "permission-card JSON did not match rendered schema: {schema}" + ); + + let redacted = + to_json_value_redacted(&graph, &ty, &value).expect("redact permission-card JSON value"); + assert_eq!(redacted, json!("")); +} + /// Redaction recurses through every container kind the walker descends into, /// mirroring `redacted_schema_value_debug`. One representative value per /// container path; the assertion checks the capability never leaks and the diff --git a/golem-common/src/schema/tests/protobuf_tests.rs b/golem-common/src/schema/tests/protobuf_tests.rs index 42c8e2652b..75b576007a 100644 --- a/golem-common/src/schema/tests/protobuf_tests.rs +++ b/golem-common/src/schema/tests/protobuf_tests.rs @@ -27,8 +27,8 @@ use crate::schema::agent::{ use crate::schema::graph::{SchemaGraph, SchemaTypeDef, TypedSchemaValue}; use crate::schema::metadata::{MetadataEnvelope, Role, TypeId}; use crate::schema::proptest_strategies as strategies; -use crate::schema::schema_type::SchemaType; -use crate::schema::schema_value::SchemaValue; +use crate::schema::schema_type::{PermissionCardSpec, SchemaType}; +use crate::schema::schema_value::{PermissionCardValuePayload, SchemaValue}; use proptest::prelude::*; use strategies::{ schema_graph_strategy, schema_value_strategy, schema_values_eq, typed_schema_value_strategy, @@ -189,6 +189,28 @@ fn field_source_round_trips() { } } +#[test] +fn permission_card_type_and_value_proto_round_trip() { + let graph = SchemaGraph::anonymous(SchemaType::permission_card(PermissionCardSpec { + polymorphic: true, + })); + let graph_proto: golem_api_grpc::proto::golem::schema::SchemaGraph = graph.clone().into(); + let graph_back: SchemaGraph = graph_proto.try_into().expect("decode permission-card type"); + assert_eq!(graph, graph_back); + + let value = SchemaValue::PermissionCard(PermissionCardValuePayload { + card_id: Uuid::from_u128(1), + parent_ids: vec![Uuid::from_u128(2), Uuid::from_u128(3)], + expires_at: Some(chrono::DateTime::from_timestamp(1_700_000_000, 123_456_789).unwrap()), + polymorphic: true, + }); + let value_proto: golem_api_grpc::proto::golem::schema::SchemaValue = value.clone().into(); + let value_back: SchemaValue = value_proto + .try_into() + .expect("decode permission-card value"); + assert_eq!(value, value_back); +} + /// Deterministic numeric-restriction vectors round-trip through the protobuf /// mirror exactly. #[test] diff --git a/golem-common/src/schema/tests/wit_tests.rs b/golem-common/src/schema/tests/wit_tests.rs index a76cd1d766..cf0ddf267d 100644 --- a/golem-common/src/schema/tests/wit_tests.rs +++ b/golem-common/src/schema/tests/wit_tests.rs @@ -16,12 +16,14 @@ use crate::schema::graph::{SchemaGraph, SchemaTypeDef, TypedSchemaValue}; use crate::schema::metadata::TypeId; use crate::schema::proptest_strategies as strategies; use crate::schema::schema_type::SchemaType; -use crate::schema::schema_value::{QuotaTokenValuePayload, SchemaValue, SecretValuePayload}; +use crate::schema::schema_value::{ + PermissionCardValuePayload, QuotaTokenValuePayload, SchemaValue, SecretValuePayload, +}; use crate::schema::wit::{ - DecodeError, EncodeError, QuotaTokenHandleRep, QuotaTokenResolver, SecretHandleRep, - SecretResolver, decode_graph, decode_typed, decode_typed_rejecting_quota_with, decode_value, - decode_value_rejecting_quota_with, decode_value_with, encode_graph, encode_typed, encode_value, - encode_value_with, wire, + DecodeError, EncodeError, PermissionCardHandleRep, PermissionCardResolver, QuotaTokenHandleRep, + QuotaTokenResolver, SecretHandleRep, SecretResolver, decode_graph, decode_typed, + decode_typed_rejecting_quota_with, decode_value, decode_value_rejecting_quota_with, + decode_value_with, encode_graph, encode_typed, encode_value, encode_value_with, wire, }; use chrono::{TimeZone, Utc}; use golem_schema::model::EnvironmentId; @@ -267,6 +269,15 @@ fn sample_secret_snapshot() -> SecretValuePayload { } } +fn sample_permission_card_snapshot() -> PermissionCardValuePayload { + PermissionCardValuePayload { + card_id: uuid::Uuid::from_u64_pair(5, 6), + parent_ids: vec![uuid::Uuid::from_u64_pair(1, 2)], + expires_at: None, + polymorphic: false, + } +} + /// A minimal [`QuotaTokenResolver`] backed by a real [`ResourceTable`], storing /// the trusted snapshot as the boxed payload of each handle. Mirrors what the /// executor does, without any of the live-lease machinery. @@ -310,6 +321,17 @@ impl TableResolver { self.live += 1; handle } + + fn permission_card_handle(&mut self) -> Resource { + let handle = self + .table + .push(PermissionCardHandleRep::new( + sample_permission_card_snapshot(), + )) + .unwrap(); + self.live += 1; + handle + } } impl QuotaTokenResolver for TableResolver { @@ -381,6 +403,45 @@ impl SecretResolver for TableResolver { } } +impl PermissionCardResolver for TableResolver { + type Error = anyhow::Error; + + fn snapshot_permission_card_handle( + &mut self, + handle: Resource, + ) -> Result { + let rep = self.table.delete(handle)?; + self.live -= 1; + self.snapshotted += 1; + rep.downcast_ref::() + .cloned() + .ok_or_else(|| anyhow::anyhow!("handle payload was not a permission-card snapshot")) + } + + fn permission_card_handle_from_snapshot( + &mut self, + snapshot: &PermissionCardValuePayload, + ) -> Result, Self::Error> { + if let Some(limit) = self.fail_create_after + && self.created >= limit + { + return Err(anyhow::anyhow!("resolver refused to create handle")); + } + let handle = self + .table + .push(PermissionCardHandleRep::new(snapshot.clone()))?; + self.created += 1; + self.live += 1; + Ok(handle) + } + + fn drop_permission_card_handle(&mut self, handle: Resource) { + if self.table.delete(handle).is_ok() { + self.live -= 1; + } + } +} + #[test] fn quota_token_round_trips_through_resolver() { let value = SchemaValue::QuotaToken(sample_snapshot()); @@ -402,6 +463,95 @@ fn secret_round_trips_through_resolver() { assert_eq!(resolver.live, 0); } +#[test] +fn permission_card_round_trips_through_resolver() { + let value = SchemaValue::PermissionCard(sample_permission_card_snapshot()); + let mut resolver = TableResolver::new(); + let wire = encode_value_with(&value, &mut resolver).expect("encode_with"); + let back = decode_value_with(wire, &mut resolver).expect("decode_with"); + assert_eq!(value, back); + assert_eq!(resolver.live, 0); +} + +#[test] +fn nested_permission_card_round_trips_through_resolver() { + let value = SchemaValue::Record { + fields: vec![ + SchemaValue::U32(7), + SchemaValue::List { + elements: vec![ + SchemaValue::PermissionCard(sample_permission_card_snapshot()), + SchemaValue::PermissionCard(PermissionCardValuePayload { + card_id: uuid::Uuid::from_u64_pair(9, 10), + parent_ids: vec![], + expires_at: Some(Utc.timestamp_opt(1_700_000_020, 0).single().unwrap()), + polymorphic: true, + }), + ], + }, + ], + }; + let mut resolver = TableResolver::new(); + let wire = encode_value_with(&value, &mut resolver).expect("encode_with"); + let back = decode_value_with(wire, &mut resolver).expect("decode_with"); + assert_eq!(value, back); + assert_eq!(resolver.live, 0); +} + +#[test] +fn pure_encode_rejects_permission_card() { + let value = SchemaValue::PermissionCard(sample_permission_card_snapshot()); + assert!(matches!( + encode_value(&value), + Err(EncodeError::PermissionCardNotTransportable) + )); +} + +#[test] +fn pure_decode_rejects_permission_card_handle() { + let mut resolver = TableResolver::new(); + let wire = encode_value_with( + &SchemaValue::PermissionCard(sample_permission_card_snapshot()), + &mut resolver, + ) + .unwrap(); + let err = decode_value(&wire).expect_err("pure decode must reject handles"); + assert!(matches!(err, DecodeError::PermissionCardRequiresResolver)); +} + +#[test] +fn reject_decoder_drops_permission_card_handle_and_rejects() { + let mut resolver = TableResolver::new(); + let handle = resolver + .permission_card_handle_from_snapshot(&sample_permission_card_snapshot()) + .unwrap(); + let tree = wire::SchemaValueTree { + value_nodes: vec![wire::SchemaValueNode::PermissionCardHandle(handle)], + root: 0, + }; + let err = decode_value_rejecting_quota_with(tree, &mut resolver) + .expect_err("permission-card handle must be rejected at a reject-only boundary"); + assert!(matches!(err, DecodeError::PermissionCardNotPermitted(0))); + assert_eq!(resolver.live, 0); +} + +#[test] +fn encode_cleans_up_permission_card_handles_when_resolver_fails_midway() { + let value = SchemaValue::Record { + fields: vec![ + SchemaValue::PermissionCard(sample_permission_card_snapshot()), + SchemaValue::PermissionCard(PermissionCardValuePayload { + card_id: uuid::Uuid::from_u64_pair(9, 10), + ..sample_permission_card_snapshot() + }), + ], + }; + let mut resolver = TableResolver::failing_after(1); + let err = encode_value_with(&value, &mut resolver).expect_err("encode must fail"); + assert!(matches!(err, EncodeError::PermissionCardResolver(_))); + assert_eq!(resolver.live, 0); +} + #[test] fn nested_quota_token_round_trips_through_resolver() { let value = SchemaValue::Record { @@ -459,6 +609,22 @@ fn pure_decode_rejects_unreferenced_secret_handle() { assert!(matches!(err, DecodeError::SecretRequiresResolver)); } +#[test] +fn pure_decode_rejects_unreferenced_permission_card_handle() { + let mut resolver = TableResolver::new(); + let card = resolver.permission_card_handle(); + let tree = wire::SchemaValueTree { + value_nodes: vec![ + wire::SchemaValueNode::PermissionCardHandle(card), + wire::SchemaValueNode::BoolValue(false), + ], + root: 1, + }; + + let err = decode_value(&tree).expect_err("pure decode must reject permission-card transport"); + assert!(matches!(err, DecodeError::PermissionCardRequiresResolver)); +} + #[test] fn aliased_quota_handle_is_rejected() { let mut resolver = TableResolver::new(); diff --git a/golem-common/src/schema/validation/placement.rs b/golem-common/src/schema/validation/placement.rs index 39403c4845..4b55e6dcb0 100644 --- a/golem-common/src/schema/validation/placement.rs +++ b/golem-common/src/schema/validation/placement.rs @@ -66,6 +66,9 @@ pub enum PlacementError { /// A [`SchemaType::QuotaToken`] node appeared in a scope that forbids /// quota tokens (today: [`SchemaScope::Constructor`]). QuotaTokenNotAllowed { scope: SchemaScope }, + /// A [`SchemaType::PermissionCard`] node appeared in a scope that forbids + /// permission cards (today: [`SchemaScope::Constructor`]). + PermissionCardNotAllowed { scope: SchemaScope }, /// A field / definition annotated with [`Role::Multimodal`] whose body /// is `list>` appeared in [`SchemaScope::Constructor`]. MultimodalListNotAllowedInConstructor, @@ -80,6 +83,12 @@ impl Display for PlacementError { PlacementError::QuotaTokenNotAllowed { scope } => { write!(f, "quota-token values are not allowed in scope {scope:?}") } + PlacementError::PermissionCardNotAllowed { scope } => { + write!( + f, + "permission-card values are not allowed in scope {scope:?}" + ) + } PlacementError::MultimodalListNotAllowedInConstructor => write!( f, "a multimodal `list>` is not allowed in constructor scope" @@ -165,6 +174,9 @@ fn walk_type<'a>( Some(HostManagedKind::QuotaToken) => { errors.push(PlacementError::QuotaTokenNotAllowed { scope }); } + Some(HostManagedKind::PermissionCard) => { + errors.push(PlacementError::PermissionCardNotAllowed { scope }); + } None => {} } } diff --git a/golem-common/src/schema/validation/tests/placement_tests.rs b/golem-common/src/schema/validation/tests/placement_tests.rs index ac178b0721..5ba4af5d46 100644 --- a/golem-common/src/schema/validation/tests/placement_tests.rs +++ b/golem-common/src/schema/validation/tests/placement_tests.rs @@ -14,7 +14,9 @@ use crate::schema::graph::{SchemaGraph, SchemaTypeDef}; use crate::schema::metadata::{MetadataEnvelope, Role, TypeId}; -use crate::schema::schema_type::{NamedFieldType, SchemaType, SecretSpec, VariantCaseType}; +use crate::schema::schema_type::{ + NamedFieldType, PermissionCardSpec, SchemaType, SecretSpec, VariantCaseType, +}; use crate::schema::validation::placement::{PlacementError, SchemaScope, validate_placement}; use test_r::test; @@ -42,6 +44,33 @@ fn quota_token_in_constructor_is_rejected() { })); } +#[test] +fn permission_card_in_constructor_is_rejected() { + let graph = SchemaGraph::anonymous(SchemaType::permission_card(PermissionCardSpec { + polymorphic: true, + })); + let errors = validate_placement(&graph, SchemaScope::Constructor).expect_err("should fail"); + assert!(errors.contains(&PlacementError::PermissionCardNotAllowed { + scope: SchemaScope::Constructor, + })); +} + +#[test] +fn permission_card_is_allowed_outside_constructor_scope() { + let graph = SchemaGraph::anonymous(SchemaType::permission_card(PermissionCardSpec { + polymorphic: false, + })); + for scope in [ + SchemaScope::Persisted, + SchemaScope::Boundary, + SchemaScope::Docs, + SchemaScope::Custom, + ] { + validate_placement(&graph, scope) + .unwrap_or_else(|errors| panic!("permission-card in {scope:?}: {errors:?}")); + } +} + #[test] fn multimodal_list_in_constructor_is_rejected_via_field_metadata() { let multimodal = MetadataEnvelope { diff --git a/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_event_queued_install.bin b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_event_queued_install.bin new file mode 100644 index 0000000000..d465228b1f Binary files /dev/null and b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_event_queued_install.bin differ diff --git a/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_event_queued_revoke.bin b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_event_queued_revoke.bin new file mode 100644 index 0000000000..58cf8849fe Binary files /dev/null and b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_event_queued_revoke.bin differ diff --git a/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_expired.bin b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_expired.bin new file mode 100644 index 0000000000..49745a571c Binary files /dev/null and b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_expired.bin differ diff --git a/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_install_failed.bin b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_install_failed.bin new file mode 100644 index 0000000000..9364acff95 Binary files /dev/null and b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_install_failed.bin differ diff --git a/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_installed.bin b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_installed.bin new file mode 100644 index 0000000000..d4f9816183 Binary files /dev/null and b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_installed.bin differ diff --git a/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_revoked.bin b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_revoked.bin new file mode 100644 index 0000000000..966e8413cf Binary files /dev/null and b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_card_revoked.bin differ diff --git a/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_snapshot_with_active_card.bin b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_snapshot_with_active_card.bin new file mode 100644 index 0000000000..b73e9ec6ce Binary files /dev/null and b/golem-common/tests/fixtures/permission-cards/phase4/oplog_entry_snapshot_with_active_card.bin differ diff --git a/golem-common/tests/fixtures/permission-cards/phase4/public_queued_card_event_install.bin b/golem-common/tests/fixtures/permission-cards/phase4/public_queued_card_event_install.bin new file mode 100644 index 0000000000..133be0ed21 Binary files /dev/null and b/golem-common/tests/fixtures/permission-cards/phase4/public_queued_card_event_install.bin differ diff --git a/golem-common/tests/fixtures/permission-cards/phase4/public_queued_card_event_revoke.bin b/golem-common/tests/fixtures/permission-cards/phase4/public_queued_card_event_revoke.bin new file mode 100644 index 0000000000..db0eaf2ff8 Binary files /dev/null and b/golem-common/tests/fixtures/permission-cards/phase4/public_queued_card_event_revoke.bin differ diff --git a/golem-common/tests/fixtures/permission-cards/phase4/queued_card_event_install.bin b/golem-common/tests/fixtures/permission-cards/phase4/queued_card_event_install.bin new file mode 100644 index 0000000000..7884776b50 Binary files /dev/null and b/golem-common/tests/fixtures/permission-cards/phase4/queued_card_event_install.bin differ diff --git a/golem-common/tests/fixtures/permission-cards/phase4/queued_card_event_revoke.bin b/golem-common/tests/fixtures/permission-cards/phase4/queued_card_event_revoke.bin new file mode 100644 index 0000000000..9b21340325 Binary files /dev/null and b/golem-common/tests/fixtures/permission-cards/phase4/queued_card_event_revoke.bin differ diff --git a/golem-common/wit/deps/golem-1.x/golem-host.wit b/golem-common/wit/deps/golem-1.x/golem-host.wit index ac94d44384..296b14e498 100644 --- a/golem-common/wit/deps/golem-1.x/golem-host.wit +++ b/golem-common/wit/deps/golem-1.x/golem-host.wit @@ -3,7 +3,7 @@ package golem:api@1.5.0; /// The Golem host API provides low level access to Golem specific features such as promises and control over /// the durability and transactional guarantees the executor provides. interface host { - use golem:core/types@2.0.0.{component-id, card-id, uuid, agent-id, promise-id, oplog-index}; + use golem:core/types@2.0.0.{component-id, uuid, agent-id, promise-id, oplog-index}; /// Represents a Golem component's version type component-revision = u64; @@ -186,17 +186,6 @@ interface host { get: async func() -> list; } - /// Plain-data handle to a permission card visible to the guest. - record card { - card-id: card-id, - } - - enum card-install-error { - revoked, - not-found, - not-permitted, - } - /// Create a new promise create-promise: func() -> promise-id; @@ -257,15 +246,6 @@ interface host { /// to introduce idempotence. generate-idempotency-key: func() -> uuid; - /// Returns one permission card currently installed in this agent's wallet, if any. - self-card: func() -> option; - - /// Derives a card handle from an installed card. This minimal test-facing form keeps the card as plain data. - derive-card: func(card: card) -> result; - - /// Installs a card into this agent's own wallet. - install-card: func(card: card) -> result<_, card-install-error>; - /// Initiates an update attempt for the given agent. The function returns immediately once the request has been processed, /// not waiting for the agent to get updated. update-agent: func(agent-id: agent-id, target-revision: component-revision, mode: update-mode); diff --git a/golem-common/wit/deps/golem-agent/host.wit b/golem-common/wit/deps/golem-agent/host.wit index 345fa12b02..b10c052e8b 100644 --- a/golem-common/wit/deps/golem-agent/host.wit +++ b/golem-common/wit/deps/golem-agent/host.wit @@ -1,7 +1,7 @@ package golem:agent@2.0.0; interface host { - use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value}; + use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value, permission-card}; use wasi:clocks/system-clock@0.3.0.{instant as datetime}; use common.{agent-error, agent-type, registered-agent-type, typed-agent-config-value}; @@ -90,25 +90,25 @@ interface host { /// /// `input` encodes the method's parameter list. The returned result is /// `none` for a `unit` output and `some(value)` for a `single` output. - invoke-and-await: func(method-name: string, input: schema-value-tree) -> result; + invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Triggers the invocation of a remote method with the given parameters, /// and returns its final identity immediately. - invoke: func(method-name: string, input: schema-value-tree) -> result; + invoke: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Invokes a remote method with the given parameters, and returns a `future-invoke-result` value which can /// be polled for the result together with the final invocation identity. /// /// With this function it is possible to call multiple (different) agents simultaneously. - async-invoke-and-await: func(method-name: string, input: schema-value-tree) -> async-invocation-with-metadata; + async-invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> async-invocation-with-metadata; /// Schedules an invocation for later and returns its final identity. - schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> scheduled-invocation-receipt; + schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> scheduled-invocation-receipt; /// Schedules an invocation for later and returns its final identity and /// cancellation capability. Call cancel on the returned resource to /// cancel the invocation before the scheduled time. - schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> cancelable-scheduled-invocation-receipt; + schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> cancelable-scheduled-invocation-receipt; } /// Represents an asynchronous invocation result diff --git a/golem-common/wit/deps/golem-core-v2/golem-core-v2.wit b/golem-common/wit/deps/golem-core-v2/golem-core-v2.wit index bb7dda191e..a59e6e4ede 100644 --- a/golem-common/wit/deps/golem-core-v2/golem-core-v2.wit +++ b/golem-common/wit/deps/golem-core-v2/golem-core-v2.wit @@ -125,6 +125,17 @@ interface types { /// and reveal it only through capability-gated host interfaces. resource secret; + /// An unforgeable handle to a permission card held by the runtime. The + /// handle is opaque to guests: components can hold, pass, derive, install, + /// and revoke cards only through the `golem:permissions` interfaces. When + /// carried in a `schema-value-tree` (see + /// `schema-value-node::permission-card-handle`) the handle is transferred + /// by ownership; the host converts it to/from its internal trusted + /// card-store representation at the boundary. The wire form is the card-id + /// (UUID) alone — no grants, parents, or metadata cross the wire as + /// authority. + resource permission-card; + // ============================================================ // Schema graph (self-contained type carrier) // ============================================================ @@ -266,6 +277,7 @@ interface types { // --- Capability nodes --- secret-type(secret-spec), quota-token-type(quota-token-spec), + permission-card-type(permission-card-spec), // --- WASI P3 stubs (parseable only; no semantics yet) --- future-type(option), @@ -462,6 +474,13 @@ interface types { resource-name: option, } + record permission-card-spec { + /// `true` = polymorphic (carries slot variables in owner / resource-id), + /// `false` = monomorphic. Structural metadata only; authority lives in + /// the card store, not in the schema spec. + polymorphic: bool, + } + // ============================================================ // Schema value (always paired with a schema-graph) // ============================================================ @@ -524,6 +543,7 @@ interface types { // Capability nodes secret-value(own), quota-token-handle(own), + permission-card-handle(own), // WASI P3 stubs (parseable only in the schema; no constructible values). } diff --git a/golem-debugging-service/src/debug_context.rs b/golem-debugging-service/src/debug_context.rs index 40d1fb0efd..ba4ed34b26 100644 --- a/golem-debugging-service/src/debug_context.rs +++ b/golem-debugging-service/src/debug_context.rs @@ -239,6 +239,10 @@ impl InvocationHooks for DebugContext { .await } + async fn on_agent_invocation_finished(&mut self) { + self.durable_ctx.on_agent_invocation_finished().await + } + async fn on_invocation_failure( &mut self, full_function_name: &str, @@ -403,9 +407,10 @@ impl HostWasmRpc for DebugContext { self_: Resource, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result> { self.durable_ctx - .invoke_and_await(self_, method_name, input) + .invoke_and_await(self_, method_name, input, scope_card) .await } @@ -414,8 +419,11 @@ impl HostWasmRpc for DebugContext { self_: Resource, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result> { - self.durable_ctx.invoke(self_, method_name, input).await + self.durable_ctx + .invoke(self_, method_name, input, scope_card) + .await } async fn async_invoke_and_await( @@ -423,9 +431,10 @@ impl HostWasmRpc for DebugContext { self_: Resource, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result { self.durable_ctx - .async_invoke_and_await(self_, method_name, input) + .async_invoke_and_await(self_, method_name, input, scope_card) .await } @@ -435,9 +444,10 @@ impl HostWasmRpc for DebugContext { scheduled_time: wasmtime_wasi::p3::bindings::clocks::system_clock::Instant, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result { self.durable_ctx - .schedule_invocation(self_, scheduled_time, method_name, input) + .schedule_invocation(self_, scheduled_time, method_name, input, scope_card) .await } @@ -447,9 +457,10 @@ impl HostWasmRpc for DebugContext { scheduled_time: wasmtime_wasi::p3::bindings::clocks::system_clock::Instant, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result { self.durable_ctx - .schedule_cancelable_invocation(self_, scheduled_time, method_name, input) + .schedule_cancelable_invocation(self_, scheduled_time, method_name, input, scope_card) .await } diff --git a/golem-debugging-service/tests/services/auth_service.rs b/golem-debugging-service/tests/services/auth_service.rs index c27a0f5e56..dac31f7838 100644 --- a/golem-debugging-service/tests/services/auth_service.rs +++ b/golem-debugging-service/tests/services/auth_service.rs @@ -43,6 +43,7 @@ impl AuthService for TestAuthService { }], upper: Vec::new(), }, + delegation_surface: None, })) } } diff --git a/golem-debugging-service/tests/services/worker_proxy.rs b/golem-debugging-service/tests/services/worker_proxy.rs index 7c10faa90d..7381eebe3e 100644 --- a/golem-debugging-service/tests/services/worker_proxy.rs +++ b/golem-debugging-service/tests/services/worker_proxy.rs @@ -102,6 +102,7 @@ impl WorkerProxy for TestWorkerProxy { _principal: Principal, _environment_id: EnvironmentId, _auth_ctx: &AuthCtx, + _scope_card: Option, ) -> Result { Err(WorkerProxyError::InternalError( WorkerExecutorError::unknown( @@ -110,6 +111,21 @@ impl WorkerProxy for TestWorkerProxy { )) } + async fn deliver_card_transfer( + &self, + _target_agent_id: &AgentId, + _environment_id: EnvironmentId, + _transfer_id: uuid::Uuid, + _source_card_id: golem_common::model::card::CardId, + _card: &golem_common::model::card::StoredCard, + ) -> Result<(), WorkerProxyError> { + Err(WorkerProxyError::InternalError( + WorkerExecutorError::unknown( + "Not implemented in tests as debug service does not deliver permission cards", + ), + )) + } + async fn cancel_invocation( &self, _agent_id: &AgentId, @@ -162,6 +178,7 @@ impl WorkerProxy for TestWorkerProxy { lower: Vec::new(), upper: Vec::new(), }, + delegation_surface: None, }); let result = loop { @@ -221,6 +238,7 @@ impl WorkerProxy for TestWorkerProxy { lower: Vec::new(), upper: Vec::new(), }, + delegation_surface: None, }); let result = self @@ -273,6 +291,7 @@ impl WorkerProxy for TestWorkerProxy { lower: Vec::new(), upper: Vec::new(), }, + delegation_surface: None, }); let result = self diff --git a/golem-registry-service/Cargo.toml b/golem-registry-service/Cargo.toml index 95c20ae7cd..2942592f66 100644 --- a/golem-registry-service/Cargo.toml +++ b/golem-registry-service/Cargo.toml @@ -2,6 +2,7 @@ name = "golem-registry-service" version = "0.0.0" edition = "2024" +autotests = false [[bin]] name = "golem-registry-service" diff --git a/golem-registry-service/db/migration/postgres/031_runtime_card_lifecycle.sql b/golem-registry-service/db/migration/postgres/031_runtime_card_lifecycle.sql new file mode 100644 index 0000000000..2039760e59 --- /dev/null +++ b/golem-registry-service/db/migration/postgres/031_runtime_card_lifecycle.sql @@ -0,0 +1,8 @@ +CREATE TABLE runtime_card_lifecycle +( + card_id UUID NOT NULL, + revoked BOOLEAN NOT NULL, + + CONSTRAINT runtime_card_lifecycle_pk + PRIMARY KEY (card_id) +); diff --git a/golem-registry-service/db/migration/sqlite/031_runtime_card_lifecycle.sql b/golem-registry-service/db/migration/sqlite/031_runtime_card_lifecycle.sql new file mode 100644 index 0000000000..2039760e59 --- /dev/null +++ b/golem-registry-service/db/migration/sqlite/031_runtime_card_lifecycle.sql @@ -0,0 +1,8 @@ +CREATE TABLE runtime_card_lifecycle +( + card_id UUID NOT NULL, + revoked BOOLEAN NOT NULL, + + CONSTRAINT runtime_card_lifecycle_pk + PRIMARY KEY (card_id) +); diff --git a/golem-registry-service/src/api/error.rs b/golem-registry-service/src/api/error.rs index add245ca06..c8518ce512 100644 --- a/golem-registry-service/src/api/error.rs +++ b/golem-registry-service/src/api/error.rs @@ -396,6 +396,12 @@ impl From for ApiError { CardError::ConcurrentModification => { Self::conflict(api::error_code::CONCURRENT_UPDATE, error) } + CardError::RuntimeCardConflict(_) | CardError::RuntimeCardRevoked(_) => { + Self::conflict(api::error_code::CONCURRENT_UPDATE, error) + } + CardError::RuntimeCardCannotBeSystemCard => { + Self::bad_request(api::error_code::INVALID_RUNTIME_CARD, error) + } CardError::CannotRevokeSystemCard | CardError::CannotRevokePermissionShareCard | CardError::CannotRevokeEnvironmentDefaultCard diff --git a/golem-registry-service/src/bootstrap/mod.rs b/golem-registry-service/src/bootstrap/mod.rs index f02184c709..29848aa12f 100644 --- a/golem-registry-service/src/bootstrap/mod.rs +++ b/golem-registry-service/src/bootstrap/mod.rs @@ -311,6 +311,7 @@ impl Services { account_usage_service.clone(), environment_service.clone(), environment_plugin_grant_service.clone(), + registry_change_notifier.clone(), )); let login_system = LoginSystem::new( diff --git a/golem-registry-service/src/grpc/api_impl.rs b/golem-registry-service/src/grpc/api_impl.rs index d5a8b1b5dc..9bc25e6eea 100644 --- a/golem-registry-service/src/grpc/api_impl.rs +++ b/golem-registry-service/src/grpc/api_impl.rs @@ -16,7 +16,7 @@ use super::error::GrpcApiError; use crate::repo::registry_change::RegistryChangeRepo; use crate::services::account_usage::{AccountUsageService, ResourceUsageUpdate}; use crate::services::auth::AuthService; -use crate::services::card::CardService; +use crate::services::card::{CardError, CardService}; use crate::services::component::ComponentService; use crate::services::component_resolver::ComponentResolverService; use crate::services::deployment::{DeployedMcpService, DeployedRoutesService, DeploymentService}; @@ -34,6 +34,7 @@ use golem_api_grpc::proto::golem::registry::v1::{ BatchGetExistingCardsRequest, BatchGetExistingCardsResponse, BatchGetExistingCardsSuccessResponse, BatchUpdateResourceUsageRequest, BatchUpdateResourceUsageResponse, BatchUpdateResourceUsageSuccessResponse, CardData, + CreateRuntimeCardRequest, CreateRuntimeCardResponse, CreateRuntimeCardSuccessResponse, DownloadComponentRequest, DownloadComponentResponse, GetActiveMcpForDomainRequest, GetActiveMcpForDomainResponse, GetActiveMcpForDomainSuccessResponse, GetActiveRoutesForDomainRequest, GetActiveRoutesForDomainResponse, @@ -54,18 +55,20 @@ use golem_api_grpc::proto::golem::registry::v1::{ RegistryInvalidationEvent, RegistryServiceError, ResolveAgentTypeByNamesRequest, ResolveAgentTypeByNamesResponse, ResolveAgentTypeByNamesSuccessResponse, ResolveComponentRequest, ResolveComponentResponse, ResolveComponentSuccessResponse, + RevokeCardRequest, RevokeCardResponse, RevokeCardSuccessResponse, RuntimeCardData, SubscribeRegistryInvalidationsRequest, UpdateWorkerConnectionLimitRequest, UpdateWorkerConnectionLimitResponse, authenticate_token_response, batch_get_cards_response, batch_get_existing_cards_response, batch_update_resource_usage_response, - download_component_response, get_active_mcp_for_domain_response, + create_runtime_card_response, download_component_response, get_active_mcp_for_domain_response, get_active_routes_for_domain_response, get_agent_secret_revision_response, get_agent_type_response, get_all_agent_types_response, get_all_deployed_component_revisions_response, get_component_metadata_response, get_current_environment_state_response, get_deployed_component_metadata_response, get_resource_definition_by_id_response, get_resource_definition_by_name_response, get_resource_limits_response, registry_service_error, resolve_agent_type_by_names_response, - resolve_component_response, update_worker_connection_limit_response, + resolve_component_response, revoke_card_response, update_worker_connection_limit_response, }; +use golem_common::base_model::api; use golem_common::model::account::AccountId; use golem_common::model::agent::{AgentTypeName, RegisteredAgentType}; use golem_common::model::agent_secret::{ @@ -73,11 +76,12 @@ use golem_common::model::agent_secret::{ }; use golem_common::model::application::{ApplicationId, ApplicationName}; use golem_common::model::auth::TokenSecret; -use golem_common::model::card::CardId; +use golem_common::model::card::{CardId, CardManagedByRuntimeDerived, StoredCard}; use golem_common::model::component::{ComponentId, ComponentRevision}; use golem_common::model::deployment::DeploymentRevision; use golem_common::model::domain_registration::Domain; use golem_common::model::environment::{EnvironmentId, EnvironmentName}; +use golem_common::model::error::{ErrorBody, ErrorsBody}; use golem_common::model::quota::{ResourceDefinitionId, ResourceName}; use golem_common::recorded_grpc_api_request; use golem_service_base::model::auth::AuthCtx; @@ -86,6 +90,15 @@ use std::collections::HashMap; use std::sync::Arc; use tonic::{Request, Response, Status}; use tracing_futures::Instrument; +use uuid::Uuid; + +fn invalid_runtime_card_request(error: impl Into) -> GrpcApiError { + GrpcApiError::BadRequest(ErrorsBody { + code: api::error_code::VALIDATION_ERROR.to_string(), + errors: vec![error.into()], + cause: None, + }) +} pub struct RegistryServiceGrpcApi { auth_service: Arc, @@ -257,6 +270,74 @@ impl RegistryServiceGrpcApi { }) } + async fn create_runtime_card_internal( + &self, + request: CreateRuntimeCardRequest, + ) -> Result { + let card_data = request + .card + .ok_or_else(|| invalid_runtime_card_request("missing card field"))?; + let envelope_card_id = card_data + .card_id + .ok_or_else(|| invalid_runtime_card_request("missing card.card_id field"))?; + let envelope_card_id = Uuid::from(envelope_card_id); + let card: StoredCard = serde_json::from_slice(&card_data.card_json) + .map_err(|error| invalid_runtime_card_request(format!("invalid card: {error}")))?; + let provenance: CardManagedByRuntimeDerived = + serde_json::from_slice(&request.provenance_json).map_err(|error| { + invalid_runtime_card_request(format!("invalid provenance: {error}")) + })?; + + if card.card_id().0 != envelope_card_id { + return Err(invalid_runtime_card_request( + "card.card_id does not match the serialized card", + )); + } + + let card = self + .card_service + .create_runtime_card(card, provenance, &AuthCtx::System) + .await?; + let card_id = card.card_id(); + Ok(CreateRuntimeCardSuccessResponse { + card: Some(RuntimeCardData { + card_id: Some(card_id.0.into()), + card_json: serde_json::to_vec(&card).map_err(|error| error.to_string())?, + }), + }) + } + + async fn revoke_card_internal( + &self, + request: RevokeCardRequest, + ) -> Result { + let card_id = request + .card_id + .ok_or_else(|| invalid_runtime_card_request("missing card_id field"))?; + let revoked_card_ids = match self + .card_service + .revoke_card(CardId(card_id.into()), &AuthCtx::System) + .await + { + Ok(card_ids) => card_ids, + Err(CardError::ConcurrentModification) => { + return Err(GrpcApiError::AlreadyExists(ErrorBody { + error: CardError::ConcurrentModification.to_string(), + code: api::error_code::CONCURRENT_UPDATE.to_string(), + cause: None, + })); + } + Err(error) => return Err(error.into()), + }; + + Ok(RevokeCardSuccessResponse { + revoked_card_ids: revoked_card_ids + .into_iter() + .map(|card_id| card_id.0.into()) + .collect(), + }) + } + async fn download_component_internal( &self, request: DownloadComponentRequest, @@ -746,6 +827,62 @@ impl golem_api_grpc::proto::golem::registry::v1::registry_service_server::Regist })) } + async fn create_runtime_card( + &self, + request: Request, + ) -> Result, tonic::Status> { + let request = request.into_inner(); + let card_id = request + .card + .as_ref() + .and_then(|card| card.card_id) + .map(Uuid::from); + let record = recorded_grpc_api_request!( + "create_runtime_card", + card_id = card_id.map(|id| id.to_string()).unwrap_or_default() + ); + + let response = match self + .create_runtime_card_internal(request) + .instrument(record.span.clone()) + .await + .apply(|r| record.result(r)) + { + Ok(result) => create_runtime_card_response::Result::Success(result), + Err(error) => create_runtime_card_response::Result::Error(error.into()), + }; + + Ok(Response::new(CreateRuntimeCardResponse { + result: Some(response), + })) + } + + async fn revoke_card( + &self, + request: Request, + ) -> Result, tonic::Status> { + let request = request.into_inner(); + let card_id = request.card_id.map(Uuid::from); + let record = recorded_grpc_api_request!( + "revoke_card", + card_id = card_id.map(|id| id.to_string()).unwrap_or_default() + ); + + let response = match self + .revoke_card_internal(request) + .instrument(record.span.clone()) + .await + .apply(|result| record.result(result)) + { + Ok(result) => revoke_card_response::Result::Success(result), + Err(error) => revoke_card_response::Result::Error(error.into()), + }; + + Ok(Response::new(RevokeCardResponse { + result: Some(response), + })) + } + type DownloadComponentStream = BoxStream<'static, Result>; diff --git a/golem-registry-service/src/grpc/error.rs b/golem-registry-service/src/grpc/error.rs index 19eaf1cf7d..6275d2eac7 100644 --- a/golem-registry-service/src/grpc/error.rs +++ b/golem-registry-service/src/grpc/error.rs @@ -141,6 +141,18 @@ impl From for GrpcApiError { code: api::error_code::AUTH_FORBIDDEN.to_string(), cause: None, }), + CardError::RuntimeCardConflict(_) | CardError::RuntimeCardRevoked(_) => { + Self::AlreadyExists(ErrorBody { + error, + code: api::error_code::CONCURRENT_UPDATE.to_string(), + cause: None, + }) + } + CardError::RuntimeCardCannotBeSystemCard => Self::BadRequest(ErrorsBody { + errors: vec![error], + code: api::error_code::INVALID_RUNTIME_CARD.to_string(), + cause: None, + }), CardError::ConcurrentModification => Self::InternalError(ErrorBody { error, code: api::error_code::CONCURRENT_UPDATE.to_string(), diff --git a/golem-registry-service/src/repo/card.rs b/golem-registry-service/src/repo/card.rs index fd03bd55af..f66b700bab 100644 --- a/golem-registry-service/src/repo/card.rs +++ b/golem-registry-service/src/repo/card.rs @@ -32,8 +32,22 @@ use uuid::Uuid; pub trait CardRepo: Send + Sync { async fn create(&self, card: CardRecord) -> Result; + async fn create_runtime(&self, card: CardRecord) -> Result; + async fn get(&self, card_id: CardId) -> Result, CardRepoError>; + /// Returns the card and all of its transitive ancestors once each. + async fn ancestor_ids_including_self( + &self, + card_id: CardId, + ) -> Result, CardRepoError>; + + /// Returns the card and all of its transitive descendants once each. + async fn descendant_ids_including_self( + &self, + card_id: CardId, + ) -> Result, CardRepoError>; + // Delete a card including all descendants. Returns ids of all deleted cards. async fn delete( &self, @@ -67,6 +81,12 @@ impl CardRepo for LoggedCardRepo { self.repo.create(card).instrument(span).await } + async fn create_runtime(&self, card: CardRecord) -> Result { + let span = Self::span_card_id(CardId(card.card_id)); + + self.repo.create_runtime(card).instrument(span).await + } + async fn get(&self, card_id: CardId) -> Result, CardRepoError> { self.repo .get(card_id) @@ -74,6 +94,26 @@ impl CardRepo for LoggedCardRepo { .await } + async fn ancestor_ids_including_self( + &self, + card_id: CardId, + ) -> Result, CardRepoError> { + self.repo + .ancestor_ids_including_self(card_id) + .instrument(Self::span_card_id(card_id)) + .await + } + + async fn descendant_ids_including_self( + &self, + card_id: CardId, + ) -> Result, CardRepoError> { + self.repo + .descendant_ids_including_self(card_id) + .instrument(Self::span_card_id(card_id)) + .await + } + async fn delete( &self, card_id: CardId, @@ -137,6 +177,23 @@ impl DbCardRepo { } impl DbCardRepo { + pub(crate) async fn get_for_update_in_tx( + tx: &mut PoolLabelledTransaction, + card_id: CardId, + ) -> Result, CardRepoError> { + Ok(tx + .fetch_optional_as( + sqlx::query_as(indoc! { r#" + SELECT card_id, data, created_at, expires_at, system_card, managed_by + FROM cards + WHERE card_id = $1 + FOR UPDATE + "#}) + .bind(card_id.0), + ) + .await?) + } + pub async fn delete_tree_in_tx( tx: &mut PoolLabelledTransaction, card_id: CardId, @@ -144,20 +201,28 @@ impl DbCardRepo { let rows = tx .fetch_all( sqlx::query(indoc! { r#" - WITH RECURSIVE to_delete(card_id) AS ( + WITH RECURSIVE to_delete(card_id) AS MATERIALIZED ( SELECT card_id FROM cards WHERE card_id = $1 UNION SELECT cp.card_id FROM card_parents cp JOIN to_delete td ON cp.parent_id = td.card_id ), + mark_runtime_cards_revoked AS ( + UPDATE runtime_card_lifecycle + SET revoked = TRUE + WHERE card_id IN (SELECT card_id FROM to_delete) + RETURNING card_id + ), delete_parent_links AS ( -- Side-effect CTE: remove all edges touching the subtree before deleting cards. DELETE FROM card_parents WHERE card_id IN (SELECT card_id FROM to_delete) + AND (SELECT COUNT(*) FROM mark_runtime_cards_revoked) >= 0 ) DELETE FROM cards WHERE card_id IN (SELECT card_id FROM to_delete) + AND (SELECT COUNT(*) FROM mark_runtime_cards_revoked) >= 0 RETURNING card_id "#}) .bind(card_id.0), @@ -172,6 +237,7 @@ impl DbCardRepo { } if !deleted.is_empty() { + deleted.sort_unstable(); DbRegistryChangeRepo::::create_change_event_in_tx( tx, &NewRegistryChangeEvent::cards_revoked(deleted.iter().map(|id| id.0).collect()), @@ -184,6 +250,22 @@ impl DbCardRepo { } impl DbCardRepo { + pub(crate) async fn get_for_update_in_tx( + tx: &mut PoolLabelledTransaction, + card_id: CardId, + ) -> Result, CardRepoError> { + Ok(tx + .fetch_optional_as( + sqlx::query_as(indoc! { r#" + SELECT card_id, data, created_at, expires_at, system_card, managed_by + FROM cards + WHERE card_id = $1 + "#}) + .bind(card_id.0), + ) + .await?) + } + pub async fn delete_tree_in_tx( tx: &mut PoolLabelledTransaction, card_id: CardId, @@ -210,6 +292,14 @@ impl DbCardRepo { card_ids.push(card_id); } + for card_id in &card_ids { + tx.execute( + sqlx::query("UPDATE runtime_card_lifecycle SET revoked = TRUE WHERE card_id = $1") + .bind(card_id), + ) + .await?; + } + for card_id in &card_ids { tx.execute(sqlx::query("DELETE FROM card_parents WHERE card_id = $1").bind(card_id)) .await?; @@ -231,6 +321,7 @@ impl DbCardRepo { } if !deleted.is_empty() { + deleted.sort_unstable(); DbRegistryChangeRepo::::create_change_event_in_tx( tx, &NewRegistryChangeEvent::cards_revoked(deleted.iter().map(|id| id.0).collect()), @@ -265,12 +356,36 @@ impl DbCardRepo { .bind(record.system_card) .bind(record.managed_by), ) - .await?; + .await + .to_error_on_unique_violation(CardRepoError::CardAlreadyExists(record.card_id))?; Self::insert_parent_links(tx, inserted.card_id, inserted.data.value().parent_ids()).await?; Ok(inserted) } + + async fn create_runtime_in_tx( + tx: &mut PoolLabelledTransaction, + record: CardRecord, + ) -> Result { + let row = tx + .fetch_one( + sqlx::query(indoc! { r#" + INSERT INTO runtime_card_lifecycle (card_id, revoked) + VALUES ($1, FALSE) + ON CONFLICT (card_id) DO UPDATE + SET revoked = runtime_card_lifecycle.revoked + RETURNING revoked + "#}) + .bind(record.card_id), + ) + .await?; + if row.try_get::("revoked").map_err(RepoError::from)? { + return Err(CardRepoError::RuntimeCardRevoked(record.card_id)); + } + + Self::create_in_tx(tx, record).await + } } impl DbCardRepo { @@ -278,11 +393,19 @@ impl DbCardRepo { tx: &mut PoolLabelledTransaction, parent_ids: &[CardId], ) -> Result<(), CardRepoError> { + let now = golem_service_base::repo::SqlDateTime::now(); for parent_id in parent_ids { let row = tx .fetch_optional( - sqlx::query("SELECT card_id FROM cards WHERE card_id = $1 FOR UPDATE") - .bind(parent_id.0), + sqlx::query(indoc! { r#" + SELECT card_id + FROM cards + WHERE card_id = $1 + AND (expires_at IS NULL OR expires_at > $2) + FOR UPDATE + "#}) + .bind(parent_id.0) + .bind(now.clone()), ) .await?; @@ -297,11 +420,31 @@ impl DbCardRepo { impl DbCardRepo { async fn lock_parent_cards_for_create( - _tx: &mut PoolLabelledTransaction, - _parent_ids: &[CardId], - ) -> RepoResult<()> { - // SQLite serializes write transactions, so there is no separate row-locking - // primitive to use here. Missing parents are rejected by the card_parents FK. + tx: &mut PoolLabelledTransaction, + parent_ids: &[CardId], + ) -> Result<(), CardRepoError> { + // SQLite serializes write transactions, so validating inside this transaction + // keeps every parent live until the card and its edges have been inserted. + let now = golem_service_base::repo::SqlDateTime::now(); + for parent_id in parent_ids { + let row = tx + .fetch_optional( + sqlx::query(indoc! { r#" + SELECT card_id + FROM cards + WHERE card_id = $1 + AND (expires_at IS NULL OR expires_at > $2) + "#}) + .bind(parent_id.0) + .bind(now.clone()), + ) + .await?; + + if row.is_none() { + return Err(CardRepoError::ParentNotFound(parent_id.0)); + } + } + Ok(()) } } @@ -317,6 +460,14 @@ impl CardRepo for DbCardRepo { .await } + async fn create_runtime(&self, record: CardRecord) -> Result { + self.db_pool + .with_tx_err(METRICS_SVC_NAME, "create_runtime", |tx| { + Box::pin(async move { Self::create_runtime_in_tx(tx, record).await }) + }) + .await + } + async fn get(&self, card_id: CardId) -> Result, CardRepoError> { self.with_ro("get") .fetch_optional_as( @@ -331,6 +482,70 @@ impl CardRepo for DbCardRepo { .map_err(Into::into) } + async fn ancestor_ids_including_self( + &self, + card_id: CardId, + ) -> Result, CardRepoError> { + let rows = self + .with_ro("ancestor_ids_including_self") + .fetch_all( + sqlx::query(indoc! { r#" + WITH RECURSIVE ancestors(card_id) AS ( + SELECT card_id FROM cards WHERE card_id = $1 + UNION + SELECT cp.parent_id + FROM card_parents cp + JOIN ancestors a ON cp.card_id = a.card_id + ) + SELECT card_id FROM ancestors + ORDER BY card_id + "#}) + .bind(card_id.0), + ) + .await?; + + rows.into_iter() + .map(|row| { + row.try_get::("card_id") + .map(CardId) + .map_err(RepoError::from) + .map_err(Into::into) + }) + .collect() + } + + async fn descendant_ids_including_self( + &self, + card_id: CardId, + ) -> Result, CardRepoError> { + let rows = self + .with_ro("descendant_ids_including_self") + .fetch_all( + sqlx::query(indoc! { r#" + WITH RECURSIVE descendants(card_id) AS ( + SELECT card_id FROM cards WHERE card_id = $1 + UNION + SELECT cp.card_id + FROM card_parents cp + JOIN descendants d ON cp.parent_id = d.card_id + ) + SELECT card_id FROM descendants + ORDER BY card_id + "#}) + .bind(card_id.0), + ) + .await?; + + rows.into_iter() + .map(|row| { + row.try_get::("card_id") + .map(CardId) + .map_err(RepoError::from) + .map_err(Into::into) + }) + .collect() + } + async fn delete( &self, card_id: CardId, diff --git a/golem-registry-service/src/repo/component.rs b/golem-registry-service/src/repo/component.rs index 383d83b33c..f253892918 100644 --- a/golem-registry-service/src/repo/component.rs +++ b/golem-registry-service/src/repo/component.rs @@ -19,6 +19,7 @@ use crate::repo::model::component::{ ComponentAuthExtRevisionRecord, ComponentExtRevisionRecord, ComponentRepoError, ComponentRevisionIdentityRecord, ComponentRevisionRecord, }; +use crate::repo::registry_change::{RequiresNotificationSignal, RequiresSignalExt}; use async_trait::async_trait; use conditional_trait_gen::trait_gen; use futures::FutureExt; @@ -29,7 +30,7 @@ use golem_service_base::db::postgres::PostgresPool; use golem_service_base::db::sqlite::SqlitePool; use golem_service_base::db::{LabelledPoolApi, LabelledPoolTransaction, Pool, PoolApi}; use golem_service_base::repo::Blob; -use golem_service_base::repo::{RepoError, RepoResult, ResultExt}; +use golem_service_base::repo::{PoolLabelledTransaction, RepoError, RepoResult, ResultExt}; use indoc::indoc; use sqlx::{Database, Row}; use std::fmt::Debug; @@ -57,7 +58,7 @@ pub trait ComponentRepo: Send + Sync { user_account_id: Uuid, component_id: Uuid, revision_id: i64, - ) -> Result<(), ComponentRepoError>; + ) -> Result>, ComponentRepoError>; async fn get_staged_by_id( &self, @@ -194,7 +195,7 @@ impl ComponentRepo for LoggedComponentRepo { user_account_id: Uuid, component_id: Uuid, revision_id: i64, - ) -> Result<(), ComponentRepoError> { + ) -> Result>, ComponentRepoError> { self.repo .delete(user_account_id, component_id, revision_id) .instrument(Self::span_id(component_id)) @@ -363,6 +364,33 @@ impl DbComponentRepo { } } +#[trait_gen(PostgresPool -> PostgresPool, SqlitePool)] +impl DbComponentRepo { + async fn lock_live_environment( + tx: &mut PoolLabelledTransaction, + environment_id: Uuid, + ) -> Result<(), ComponentRepoError> { + let environment = tx + .fetch_optional( + sqlx::query(indoc! { r#" + UPDATE environments + SET environment_id = environment_id + WHERE environment_id = $1 + AND deleted_at IS NULL + RETURNING environment_id + "#}) + .bind(environment_id), + ) + .await?; + + if environment.is_none() { + return Err(ComponentRepoError::ConcurrentModification); + } + + Ok(()) + } +} + #[trait_gen(PostgresPool -> PostgresPool, SqlitePool)] #[async_trait] impl ComponentRepo for DbComponentRepo { @@ -399,6 +427,8 @@ impl ComponentRepo for DbComponentRepo { self.with_tx_err("create", |tx| { async move { + Self::lock_live_environment(tx, environment_id).await?; + tx.execute( sqlx::query(indoc! { r#" INSERT INTO components @@ -441,6 +471,21 @@ impl ComponentRepo for DbComponentRepo { ) -> Result { self.with_tx_err("update", |tx| { async move { + let environment_id = tx + .fetch_optional( + sqlx::query(indoc! { r#" + SELECT environment_id + FROM components + WHERE component_id = $1 + "#}) + .bind(revision.component_id), + ) + .await? + .ok_or(ComponentRepoError::ConcurrentModification)? + .try_get::("environment_id") + .map_err(RepoError::from)?; + Self::lock_live_environment(tx, environment_id).await?; + for card in cards_to_create { DbCardRepo::::create_in_tx(tx, card).await?; } @@ -482,33 +527,119 @@ impl ComponentRepo for DbComponentRepo { user_account_id: Uuid, component_id: Uuid, revision_id: i64, - ) -> Result<(), ComponentRepoError> { - self.with_tx_err("delete", |tx| { - async move { - let revision: ComponentRevisionRecord = Self::insert_revision( - tx, - ComponentRevisionRecord::deletion(user_account_id, component_id, revision_id)?, - ) - .await?; + ) -> Result>, ComponentRepoError> { + let deleted_cards = self + .with_tx_err("delete", |tx| { + async move { + let active_revisions: Vec = tx + .fetch_all_as( + sqlx::query_as(indoc! { r#" + SELECT cr.component_id, cr.revision_id, cr.hash, + cr.created_at, cr.created_by, cr.deleted, + cr.size, cr.metadata, + cr.object_store_key, cr.binary_hash + FROM component_revisions cr + WHERE cr.component_id = $1 + AND NOT cr.deleted + AND cr.revision_id > COALESCE( + ( + SELECT MAX(deleted_cr.revision_id) + FROM component_revisions deleted_cr + WHERE deleted_cr.component_id = cr.component_id + AND deleted_cr.deleted + ), + -1 + ) + "#}) + .bind(component_id), + ) + .await?; + + let mut card_roots = Vec::new(); + for revision in active_revisions { + let component_revision = revision.revision_id.try_into()?; + for (agent_type, config) in revision + .metadata + .value() + .agent_type_provision_configs() + .iter() + { + let card_id = config.initial_permissions.card_id; + let managed_by = CardManagedByAgentInitial { + component_id: ComponentId(component_id), + component_revision, + agent_type: agent_type.clone(), + }; + if !card_roots.contains(&(card_id, managed_by.clone())) { + card_roots.push((card_id, managed_by)); + } + } + } + card_roots.sort_unstable_by_key(|(card_id, _)| *card_id); + + let revision: ComponentRevisionRecord = Self::insert_revision( + tx, + ComponentRevisionRecord::deletion( + user_account_id, + component_id, + revision_id, + )?, + ) + .await?; - tx.execute( - sqlx::query(indoc! { r#" + tx.execute( + sqlx::query(indoc! { r#" UPDATE components SET deleted_at = $1, modified_by = $2, current_revision_id = $3 WHERE component_id = $4 "#}) - .bind(&revision.audit.created_at) - .bind(revision.audit.created_by) - .bind(revision.revision_id) - .bind(revision.component_id), - ) - .await?; + .bind(&revision.audit.created_at) + .bind(revision.audit.created_by) + .bind(revision.revision_id) + .bind(revision.component_id), + ) + .await?; - Ok(()) - } - .boxed() - }) - .await + let mut deleted_cards = Vec::new(); + let mut root_index = 0; + while root_index < card_roots.len() { + let card_id = card_roots[root_index].0; + let mut next_root_index = root_index + 1; + while next_root_index < card_roots.len() + && card_roots[next_root_index].0 == card_id + { + next_root_index += 1; + } + + let record = + DbCardRepo::::get_for_update_in_tx(tx, card_id).await?; + let managed_by_matches = record + .as_ref() + .and_then(|record| record.managed_by.as_ref()) + .is_some_and(|managed_by| { + let CardManagedBy::AgentInitial(actual) = managed_by.value() else { + return false; + }; + card_roots[root_index..next_root_index] + .iter() + .any(|(_, expected)| actual == expected) + }); + + if managed_by_matches { + deleted_cards.extend( + DbCardRepo::::delete_tree_in_tx(tx, card_id).await?, + ); + } + root_index = next_root_index; + } + + Ok::<_, ComponentRepoError>(deleted_cards) + } + .boxed() + }) + .await?; + + Ok(deleted_cards.requires_notification_signal()) } async fn get_staged_by_id( @@ -760,6 +891,15 @@ impl ComponentRepo for DbComponentRepo { WHERE c.component_id = $1 AND cr.revision_id = $2 AND ($3 OR c.deleted_at IS NULL) + AND ($3 OR cr.revision_id > COALESCE( + ( + SELECT MAX(deleted_cr.revision_id) + FROM component_revisions deleted_cr + WHERE deleted_cr.component_id = c.component_id + AND deleted_cr.deleted + ), + -1 + )) AND e.deleted_at IS NULL AND ap.deleted_at IS NULL AND a.deleted_at IS NULL diff --git a/golem-registry-service/src/repo/environment.rs b/golem-registry-service/src/repo/environment.rs index 3e54b61a2a..54795bf67c 100644 --- a/golem-registry-service/src/repo/environment.rs +++ b/golem-registry-service/src/repo/environment.rs @@ -16,6 +16,7 @@ use super::model::environment::{EnvironmentRepoError, EnvironmentWithDetailsReco use crate::repo::card::DbCardRepo; use crate::repo::model::BindFields; use crate::repo::model::card::CardRecord; +use crate::repo::model::component::ComponentRevisionRecord; pub use crate::repo::model::environment::{ EnvironmentDefaultCardRef, EnvironmentDefaultCardRefRow, EnvironmentExtRecord, EnvironmentExtRevisionRecord, EnvironmentRevisionRecord, EnvironmentScopedExtRevisionRecord, @@ -29,6 +30,11 @@ use async_trait::async_trait; use conditional_trait_gen::trait_gen; use futures::FutureExt; use futures::future::BoxFuture; +use golem_common::model::card::{ + CardId, CardManagedBy, CardManagedByAgentInitial, CardManagedByEnvironmentDefault, +}; +use golem_common::model::component::ComponentId; +use golem_common::model::environment::EnvironmentId; use golem_service_base::db::postgres::PostgresPool; use golem_service_base::db::sqlite::SqlitePool; use golem_service_base::db::{LabelledPoolApi, LabelledPoolTransaction, Pool, PoolApi}; @@ -903,6 +909,103 @@ impl EnvironmentRepo for DbEnvironmentRepo { .await? .ok_or(EnvironmentRepoError::ConcurrentModification)?; + let default_card_id = tx + .fetch_one( + sqlx::query(indoc! { r#" + SELECT environment_default_card_id + FROM environments + WHERE environment_id = $1 + "#}) + .bind(revision.environment_id), + ) + .await? + .try_get::, _>("environment_default_card_id") + .map_err(RepoError::from)?; + + let active_component_revisions: Vec = tx + .fetch_all_as( + sqlx::query_as(indoc! { r#" + SELECT cr.component_id, cr.revision_id, cr.hash, + cr.created_at, cr.created_by, cr.deleted, + cr.size, cr.metadata, + cr.object_store_key, cr.binary_hash + FROM component_revisions cr + JOIN components c ON c.component_id = cr.component_id + WHERE c.environment_id = $1 + AND NOT cr.deleted + AND cr.revision_id > COALESCE( + ( + SELECT MAX(deleted_cr.revision_id) + FROM component_revisions deleted_cr + WHERE deleted_cr.component_id = cr.component_id + AND deleted_cr.deleted + ), + -1 + ) + "#}) + .bind(revision.environment_id), + ) + .await?; + + let environment_id = EnvironmentId(revision.environment_id); + let mut card_roots = Vec::new(); + if let Some(default_card_id) = default_card_id { + card_roots.push(( + CardId(default_card_id), + CardManagedBy::EnvironmentDefault(CardManagedByEnvironmentDefault { + environment_id, + }), + )); + } + for component_revision_record in active_component_revisions { + let component_revision = component_revision_record.revision_id.try_into()?; + for (agent_type, config) in component_revision_record + .metadata + .value() + .agent_type_provision_configs() + { + let root = ( + config.initial_permissions.card_id, + CardManagedBy::AgentInitial(CardManagedByAgentInitial { + component_id: ComponentId(component_revision_record.component_id), + component_revision, + agent_type: agent_type.clone(), + }), + ); + if !card_roots.contains(&root) { + card_roots.push(root); + } + } + } + card_roots.sort_unstable_by_key(|(card_id, _)| *card_id); + + let mut root_index = 0; + while root_index < card_roots.len() { + let card_id = card_roots[root_index].0; + let mut next_root_index = root_index + 1; + while next_root_index < card_roots.len() + && card_roots[next_root_index].0 == card_id + { + next_root_index += 1; + } + + let record = + DbCardRepo::::get_for_update_in_tx(tx, card_id).await?; + let managed_by_matches = record + .as_ref() + .and_then(|record| record.managed_by.as_ref()) + .is_some_and(|managed_by| { + card_roots[root_index..next_root_index] + .iter() + .any(|(_, expected)| managed_by.value() == expected) + }); + + if managed_by_matches { + DbCardRepo::::delete_tree_in_tx(tx, card_id).await?; + } + root_index = next_root_index; + } + // Emit an EnvironmentDeleted invalidation event carrying the // human-readable app_name and env_name so subscribers can perform // targeted cache invalidation without a full flush. diff --git a/golem-registry-service/src/repo/model/card.rs b/golem-registry-service/src/repo/model/card.rs index 3ac287db17..ee3a4713ab 100644 --- a/golem-registry-service/src/repo/model/card.rs +++ b/golem-registry-service/src/repo/model/card.rs @@ -13,12 +13,12 @@ // limitations under the License. use anyhow::anyhow; -use chrono::{DateTime, Utc}; -use golem_common::error_forwarding; +use chrono::{DateTime, Timelike, Utc}; use golem_common::model::card::{ - Card, CardId, CardManagedBy, PermissionPattern, PolymorphicCard, PolymorphicPermissionPattern, + Card, CardId, CardManagedBy, CardManagedByRuntimeDerived, PermissionPattern, PolymorphicCard, StoredCard, }; +use golem_common::{IntoAnyhow, error_forwarding}; use golem_service_base::repo::{Blob, RepoError, SqlDateTime}; use sqlx::FromRow; use uuid::Uuid; @@ -27,6 +27,10 @@ use uuid::Uuid; pub enum CardRepoError { #[error("Parent card {0} does not exist")] ParentNotFound(Uuid), + #[error("Card {0} already exists")] + CardAlreadyExists(Uuid), + #[error("Runtime card {0} has been revoked")] + RuntimeCardRevoked(Uuid), #[error("Card tree changed during deletion")] CardTreeChangedDuringDelete, #[error("Concurrent modification")] @@ -35,7 +39,28 @@ pub enum CardRepoError { InternalError(#[from] anyhow::Error), } -error_forwarding!(CardRepoError, RepoError); +error_forwarding!(CardRepoError); + +impl From for CardRepoError { + fn from(value: RepoError) -> Self { + let is_postgres_deadlock = match &value { + RepoError::InternalError(error) => error.chain().any(|cause| { + cause + .downcast_ref::() + .and_then(sqlx::Error::as_database_error) + .and_then(|error| error.code()) + .is_some_and(|code| code == "40P01") + }), + RepoError::UniqueViolation(_) | RepoError::ForeignKeyViolation(_) => false, + }; + + if is_postgres_deadlock { + Self::ConcurrentModification + } else { + Self::InternalError(value.into_anyhow()) + } + } +} #[derive(Debug, Clone, PartialEq, Eq, desert_rust::BinaryCodec)] pub struct CardDataRecord { @@ -94,6 +119,34 @@ impl TryFrom for StoredCard { } impl CardRecord { + pub fn runtime_creation(mut card: StoredCard, provenance: CardManagedByRuntimeDerived) -> Self { + let managed_by = CardManagedBy::RuntimeDerived(provenance); + match &mut card { + StoredCard::Concrete(card) => { + card.parent_ids.sort_unstable(); + card.parent_ids.dedup(); + card.created_at = sql_timestamp_precision(card.created_at); + card.expires_at = card.expires_at.map(sql_timestamp_precision); + card.managed_by = Some(managed_by.clone()); + } + StoredCard::Polymorphic(card) => { + card.parent_ids.sort_unstable(); + card.parent_ids.dedup(); + card.created_at = sql_timestamp_precision(card.created_at); + card.expires_at = card.expires_at.map(sql_timestamp_precision); + } + } + + Self { + card_id: card.card_id().0, + created_at: card.created_at().into(), + expires_at: card.expires_at().map(Into::into), + system_card: card.system_card(), + data: Blob::new(CardDataRecord { card }), + managed_by: Some(Blob::new(managed_by)), + } + } + pub fn creation( card_id: CardId, parent_ids: Vec, @@ -130,27 +183,13 @@ impl CardRecord { } pub fn polymorphic_creation( - card_id: CardId, - parent_ids: Vec, - lower_positive: Vec, - lower_negative: Vec, - upper_positive: Vec, - upper_negative: Vec, - expires_at: Option>, - system_card: bool, + mut card: PolymorphicCard, managed_by: Option, ) -> Self { - let card = PolymorphicCard { - card_id, - parent_ids, - lower_positive, - lower_negative, - upper_positive, - upper_negative, - created_at: Utc::now(), - expires_at, - system_card, - }; + card.parent_ids.sort_unstable(); + card.parent_ids.dedup(); + card.created_at = sql_timestamp_precision(card.created_at); + card.expires_at = card.expires_at.map(sql_timestamp_precision); Self { card_id: card.card_id.0, data: Blob::new(CardDataRecord { @@ -184,15 +223,69 @@ impl CardRecord { } } +fn sql_timestamp_precision(timestamp: DateTime) -> DateTime { + timestamp + .with_nanosecond(timestamp.nanosecond() / 1_000 * 1_000) + .expect("truncating nanoseconds preserves a valid timestamp") +} + #[cfg(test)] mod tests { use super::*; - use golem_common::model::card::default_agent_initial_permission_grants; use golem_common::model::card::recipient::RecipientPattern; + use golem_common::model::card::{ + CardManagedByRuntimeDerived, default_agent_initial_permission_grants, + }; + use golem_common::model::{AgentId, IdempotencyKey, OplogIndex}; use test_r::test; + fn runtime_derived_provenance() -> CardManagedByRuntimeDerived { + CardManagedByRuntimeDerived { + environment_id: golem_common::model::environment::EnvironmentId(Uuid::new_v4()), + agent_id: AgentId { + component_id: golem_common::model::component::ComponentId(Uuid::new_v4()), + agent_id: "source-agent".to_string(), + }, + invocation_key: IdempotencyKey::new("source-invocation".to_string()), + oplog_index: OplogIndex::from_u64(42), + } + } + + #[test] + fn concrete_creation_persists_runtime_derived_provenance() { + let provenance = runtime_derived_provenance(); + let created_at = DateTime::from_timestamp(1_700_000_000, 123_456_789).unwrap(); + let expires_at = DateTime::from_timestamp(1_800_000_000, 987_654_321).unwrap(); + let record = CardRecord::runtime_creation( + StoredCard::Concrete(Card { + card_id: CardId::new(), + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at, + expires_at: Some(expires_at), + system_card: false, + managed_by: None, + }), + provenance.clone(), + ); + let expected_provenance = CardManagedBy::RuntimeDerived(provenance); + + assert_eq!( + record.managed_by.as_ref().map(|value| value.value()), + Some(&expected_provenance) + ); + let card = Card::try_from(record).unwrap(); + assert_eq!(card.created_at, sql_timestamp_precision(created_at)); + assert_eq!(card.expires_at, Some(sql_timestamp_precision(expires_at))); + assert_eq!(card.managed_by, Some(expected_provenance)); + } + #[test] fn polymorphic_creation_persists_agent_initial_card_grants() { + let created_at = DateTime::from_timestamp(1_700_000_000, 123_456_789).unwrap(); let initial_card = PolymorphicCard { card_id: CardId::new(), parent_ids: Vec::new(), @@ -200,22 +293,12 @@ mod tests { lower_negative: Vec::new(), upper_positive: Vec::new(), upper_negative: Vec::new(), - created_at: chrono::Utc::now(), + created_at, expires_at: None, system_card: false, }; - let record = CardRecord::polymorphic_creation( - initial_card.card_id, - initial_card.parent_ids.clone(), - initial_card.lower_positive.clone(), - initial_card.lower_negative.clone(), - initial_card.upper_positive.clone(), - initial_card.upper_negative.clone(), - initial_card.expires_at, - initial_card.system_card, - None, - ); + let record = CardRecord::polymorphic_creation(initial_card.clone(), None); let card = PolymorphicCard::try_from(record).unwrap(); assert_eq!(card.card_id, initial_card.card_id); @@ -223,5 +306,34 @@ mod tests { assert_eq!(card.lower_negative, initial_card.lower_negative); assert_eq!(card.upper_positive, initial_card.upper_positive); assert_eq!(card.upper_negative, initial_card.upper_negative); + assert_eq!(card.created_at, sql_timestamp_precision(created_at)); + } + + #[test] + fn polymorphic_creation_persists_runtime_derived_provenance() { + let provenance = runtime_derived_provenance(); + let created_at = DateTime::from_timestamp(1_700_000_000, 123_456_789).unwrap(); + let record = CardRecord::runtime_creation( + StoredCard::Polymorphic(PolymorphicCard { + card_id: CardId::new(), + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at, + expires_at: None, + system_card: false, + }), + provenance.clone(), + ); + let expected_provenance = CardManagedBy::RuntimeDerived(provenance); + + assert_eq!( + record.managed_by.as_ref().map(|value| value.value()), + Some(&expected_provenance) + ); + let card = PolymorphicCard::try_from(record).unwrap(); + assert_eq!(card.created_at, sql_timestamp_precision(created_at)); } } diff --git a/golem-registry-service/src/repo/model/component.rs b/golem-registry-service/src/repo/model/component.rs index 8048f85c8e..f39dcdcea9 100644 --- a/golem-registry-service/src/repo/model/component.rs +++ b/golem-registry-service/src/repo/model/component.rs @@ -47,13 +47,24 @@ pub enum ComponentRepoError { #[error("Version already exists: {version}")] VersionAlreadyExists { version: String }, #[error(transparent)] - CardRepoError(#[from] CardRepoError), + CardRepoError(CardRepoError), #[error(transparent)] InternalError(#[from] anyhow::Error), } error_forwarding!(ComponentRepoError, RepoError); +impl From for ComponentRepoError { + fn from(value: CardRepoError) -> Self { + match value { + CardRepoError::CardTreeChangedDuringDelete | CardRepoError::ConcurrentModification => { + Self::ConcurrentModification + } + other => Self::CardRepoError(other), + } + } +} + #[derive(Debug, Clone, FromRow, PartialEq)] pub struct ComponentRecord { pub component_id: Uuid, diff --git a/golem-registry-service/src/repo/model/environment.rs b/golem-registry-service/src/repo/model/environment.rs index 2c845ab49a..74c7613455 100644 --- a/golem-registry-service/src/repo/model/environment.rs +++ b/golem-registry-service/src/repo/model/environment.rs @@ -44,7 +44,18 @@ pub enum EnvironmentRepoError { InternalError(#[from] anyhow::Error), } -error_forwarding!(EnvironmentRepoError, CardRepoError, RepoError); +error_forwarding!(EnvironmentRepoError, RepoError); + +impl From for EnvironmentRepoError { + fn from(value: CardRepoError) -> Self { + match value { + CardRepoError::CardTreeChangedDuringDelete | CardRepoError::ConcurrentModification => { + Self::ConcurrentModification + } + other => Self::InternalError(other.into()), + } + } +} #[derive(Debug, Clone, FromRow, PartialEq)] pub struct EnvironmentExtRecord { diff --git a/golem-registry-service/src/repo/model/permission_share.rs b/golem-registry-service/src/repo/model/permission_share.rs index 15563972f5..c552aac62a 100644 --- a/golem-registry-service/src/repo/model/permission_share.rs +++ b/golem-registry-service/src/repo/model/permission_share.rs @@ -45,6 +45,9 @@ impl From for PermissionShareRepoError { fn from(value: CardRepoError) -> Self { match value { CardRepoError::ParentNotFound(card_id) => Self::ParentCardNotFound(card_id), + CardRepoError::CardAlreadyExists(_) | CardRepoError::RuntimeCardRevoked(_) => { + Self::ConcurrentModification + } CardRepoError::CardTreeChangedDuringDelete => Self::CardTreeChangedDuringDelete, CardRepoError::ConcurrentModification => Self::ConcurrentModification, CardRepoError::InternalError(err) => Self::InternalError(err), diff --git a/golem-registry-service/src/services/agent_secret.rs b/golem-registry-service/src/services/agent_secret.rs index ddc4f36a92..d9f763f62f 100644 --- a/golem-registry-service/src/services/agent_secret.rs +++ b/golem-registry-service/src/services/agent_secret.rs @@ -193,7 +193,9 @@ fn schema_type_contains_host_managed_capability( visiting.remove(id); contains } - SchemaType::Secret { .. } | SchemaType::QuotaToken { .. } => true, + SchemaType::Secret { .. } + | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } => true, SchemaType::Record { fields, .. } => fields.iter().any(|field| { schema_type_contains_host_managed_capability(graph, &field.body, visiting) }), diff --git a/golem-registry-service/src/services/auth.rs b/golem-registry-service/src/services/auth.rs index 76ea656d6a..1424dd3d14 100644 --- a/golem-registry-service/src/services/auth.rs +++ b/golem-registry-service/src/services/auth.rs @@ -24,8 +24,8 @@ use golem_common::model::auth::{TokenId, TokenSecret}; use golem_common::model::card::owner::EmptyOwnerPattern; use golem_common::model::card::recipient::RecipientPattern; use golem_common::model::card::{ - Card, ClassPermissionTarget, EffectiveSurface, PermissionTarget, SystemResourcePattern, - SystemVerb, + Card, ClassPermissionTarget, DelegationSurface, EffectiveSurface, PermissionTarget, + SystemResourcePattern, SystemVerb, }; use golem_common::{SafeDisplay, error_forwarding}; use golem_service_base::model::auth::{AdminImpersonationAuthCtx, AuthCtx, UserAuthCtx}; @@ -105,7 +105,9 @@ impl AuthService { // Normal login flow None => { let account_roles = BTreeSet::from_iter(target_account.roles.clone()); - let effective_surface = self.materialize_effective_surface(&target_account).await?; + let (effective_surface, delegation_surface) = self + .materialize_permission_surfaces(&target_account) + .await?; Ok(AuthCtx::User(UserAuthCtx { account_id: target_account.id, @@ -113,6 +115,7 @@ impl AuthService { account_roles, account_plan_id: target_account.plan_id, effective_surface, + delegation_surface: Some(delegation_surface), })) } // Impersonation flow @@ -126,14 +129,15 @@ impl AuthService { { let account_roles = BTreeSet::from_iter(admin_account.roles.clone()); - let effective_surface = - self.materialize_effective_surface(&admin_account).await?; + let (effective_surface, delegation_surface) = + self.materialize_permission_surfaces(&admin_account).await?; let admin_auth_ctx = AuthCtx::User(UserAuthCtx { account_id: admin_account.id, account_email: admin_account.email.clone(), account_roles, account_plan_id: admin_account.plan_id, effective_surface, + delegation_surface: Some(delegation_surface), }); if admin_auth_ctx @@ -153,7 +157,9 @@ impl AuthService { } let target_account_roles = BTreeSet::from_iter(target_account.roles.clone()); - let effective_surface = self.materialize_effective_surface(&target_account).await?; + let (effective_surface, delegation_surface) = self + .materialize_permission_surfaces(&target_account) + .await?; Ok(AuthCtx::AdminImpersonation(AdminImpersonationAuthCtx { admin_account_id, @@ -162,15 +168,16 @@ impl AuthService { target_account_roles, target_account_plan_id: target_account.plan_id, effective_surface, + delegation_surface: Some(delegation_surface), })) } } } - async fn materialize_effective_surface( + async fn materialize_permission_surfaces( &self, account: &Account, - ) -> Result { + ) -> Result<(EffectiveSurface, DelegationSurface), AuthError> { let account_root_card: Card = self .card_repo .get(account.account_root_card_id) @@ -198,12 +205,15 @@ impl AuthService { account: account.email.clone(), }; - EffectiveSurface::from_cards(&cards, &account_recipient).map_err(|err| { - AuthError::InternalError(anyhow::anyhow!( - "Failed to materialize effective surface for account {}: {:?}", - account.id, - err - )) - }) + let effective_surface = + EffectiveSurface::from_cards(&cards, &account_recipient).map_err(|err| { + AuthError::InternalError(anyhow::anyhow!( + "Failed to materialize effective surface for account {}: {:?}", + account.id, + err + )) + })?; + + Ok((effective_surface, DelegationSurface::from_cards(&cards))) } } diff --git a/golem-registry-service/src/services/card.rs b/golem-registry-service/src/services/card.rs index 06efd6d52b..2049c20b66 100644 --- a/golem-registry-service/src/services/card.rs +++ b/golem-registry-service/src/services/card.rs @@ -28,9 +28,9 @@ use golem_common::model::card::owner::{ use golem_common::model::card::recipient::RecipientPattern; use golem_common::model::card::{ Card, CardId, CardManagedBy, CardManagedByAgentInitial, CardManagedByEnvironmentDefault, - CardResourcePattern, CardVerb, ClassPermissionPattern, ClassPermissionTarget, - ComponentResourcePattern, EnvironmentResourcePattern, PermissionPattern, PermissionTarget, - PolymorphicCard, StoredCard, + CardManagedByRuntimeDerived, CardResourcePattern, CardVerb, ClassPermissionPattern, + ClassPermissionTarget, ComponentResourcePattern, EnvironmentResourcePattern, PermissionPattern, + PermissionTarget, PolymorphicCard, StoredCard, }; use golem_common::model::component::{ComponentId, ComponentRevision}; use golem_common::model::permission_share::PermissionShareId; @@ -47,6 +47,12 @@ pub enum CardError { AccountNotFound(AccountId), #[error("Concurrent modification")] ConcurrentModification, + #[error("Card {0} already exists with different runtime card data")] + RuntimeCardConflict(CardId), + #[error("Runtime card {0} has been revoked")] + RuntimeCardRevoked(CardId), + #[error("Runtime-derived cards cannot be system cards")] + RuntimeCardCannotBeSystemCard, #[error("Cannot revoke a system card")] CannotRevokeSystemCard, #[error("Permission-share-managed cards must be revoked through the permission share")] @@ -67,6 +73,9 @@ impl SafeDisplay for CardError { Self::CardNotFound(_) => self.to_string(), Self::AccountNotFound(_) => self.to_string(), Self::ConcurrentModification => self.to_string(), + Self::RuntimeCardConflict(_) => self.to_string(), + Self::RuntimeCardRevoked(_) => self.to_string(), + Self::RuntimeCardCannotBeSystemCard => self.to_string(), Self::CannotRevokeSystemCard => self.to_string(), Self::CannotRevokePermissionShareCard => self.to_string(), Self::CannotRevokeEnvironmentDefaultCard => self.to_string(), @@ -85,6 +94,9 @@ impl From for CardError { CardRepoError::CardTreeChangedDuringDelete | CardRepoError::ConcurrentModification => { Self::ConcurrentModification } + CardRepoError::ParentNotFound(card_id) => Self::CardNotFound(CardId(card_id)), + CardRepoError::CardAlreadyExists(card_id) => Self::RuntimeCardConflict(CardId(card_id)), + CardRepoError::RuntimeCardRevoked(card_id) => Self::RuntimeCardRevoked(CardId(card_id)), other => Self::InternalError(other.into_anyhow()), } } @@ -183,14 +195,7 @@ impl CardService { let card_id = card.card_id; self.card_repo .create(CardRecord::polymorphic_creation( - card_id, - card.parent_ids.clone(), - card.lower_positive.clone(), - card.lower_negative.clone(), - card.upper_positive.clone(), - card.upper_negative.clone(), - card.expires_at, - card.system_card, + card.clone(), Some(CardManagedBy::AgentInitial(CardManagedByAgentInitial { component_id, component_revision, @@ -202,6 +207,41 @@ impl CardService { Ok(card_id) } + pub async fn create_runtime_card( + &self, + card: StoredCard, + provenance: CardManagedByRuntimeDerived, + auth: &AuthCtx, + ) -> Result { + auth.authorize_system_only("create runtime permission card")?; + + if card.system_card() { + return Err(CardError::RuntimeCardCannotBeSystemCard); + } + + let requested = CardRecord::runtime_creation(card, provenance); + for parent_id in requested.data.value().parent_ids() { + self.materialized_card_unchecked(*parent_id).await?; + } + + match self.card_repo.create_runtime(requested.clone()).await { + Ok(created) => Ok(created.try_into()?), + Err(CardRepoError::CardAlreadyExists(_)) => { + let existing = self + .card_repo + .get(CardId(requested.card_id)) + .await? + .ok_or(CardError::ConcurrentModification)?; + if existing == requested { + Ok(existing.try_into()?) + } else { + Err(CardError::RuntimeCardConflict(CardId(requested.card_id))) + } + } + Err(error) => Err(error.into()), + } + } + pub async fn existing(&self, card_ids: Vec) -> Result, CardError> { let mut result = Vec::new(); for card_id in card_ids { @@ -306,10 +346,12 @@ impl CardService { return Err(CardError::CannotRevokeSystemCard); } - let owner_email = self - .card_owner_email(card_id, card.managed_by.as_ref()) - .await?; - authorize_card_permission(auth, &owner_email, CardVerb::Revoke)?; + if !matches!(auth, AuthCtx::System) { + let owner_email = self + .card_owner_email(card_id, card.managed_by.as_ref()) + .await?; + authorize_card_permission(auth, &owner_email, CardVerb::Revoke)?; + } let deleted = self .card_repo @@ -356,11 +398,11 @@ impl CardService { ComponentError::ComponentNotFound(_) => CardError::CardNotFound(card_id), other => other.into(), })?; - let current_agent_initial_card_ids = self - .component_service - .list_initial_permission_card_ids_by_account(component.account_id) - .await?; - if !current_agent_initial_card_ids.contains(&card_id) { + let revision_card_id = component + .metadata + .agent_type_initial_permission_card(&managed_by.agent_type) + .map(|card| card.card_id); + if revision_card_id != Some(card_id) { return Err(CardError::CardNotFound(card_id)); } } @@ -421,6 +463,12 @@ impl CardService { ) .await? .account_email), + Some(CardManagedBy::RuntimeDerived(managed_by)) => Ok(self + .environment_service + .default_card_ref_by_environment(managed_by.environment_id) + .await? + .ok_or(CardError::CardNotFound(card_id))? + .account_email), None => Err(CardError::CardOwnerNotFound(card_id)), } } diff --git a/golem-registry-service/src/services/component/write.rs b/golem-registry-service/src/services/component/write.rs index e5b5a3fe84..85655a79af 100644 --- a/golem-registry-service/src/services/component/write.rs +++ b/golem-registry-service/src/services/component/write.rs @@ -26,6 +26,9 @@ use crate::services::environment::EnvironmentService; use crate::services::environment_plugin_grant::{ EnvironmentPluginGrantError, EnvironmentPluginGrantService, }; +use crate::services::registry_change_notifier::{ + RegistryChangeNotifier, RequiresNotificationSignalExt, +}; use crate::services::run_cpu_bound_work; use anyhow::Context; use golem_common::base_model::component_metadata::AgentTypeProvisionConfig; @@ -35,7 +38,7 @@ use golem_common::model::agent::{AgentFileContentHash, AgentTypeName}; use golem_common::model::card::owner::ComponentOwnerPattern; use golem_common::model::card::{ CardManagedBy, CardManagedByAgentInitial, ClassPermissionTarget, ComponentResourcePattern, - ComponentVerb, EffectiveSurface, PermissionTarget, PolymorphicCard, + ComponentVerb, DelegationSurface, PermissionTarget, PolymorphicCard, permission_envelopes_for_recipient_patterns, }; use golem_common::model::component::{ @@ -75,6 +78,7 @@ pub struct ComponentWriteService { account_usage_service: Arc, environment_service: Arc, environment_plugin_grant_service: Arc, + registry_change_notifier: Arc, } impl ComponentWriteService { @@ -86,6 +90,7 @@ impl ComponentWriteService { account_usage_service: Arc, environment_service: Arc, environment_plugin_grant_service: Arc, + registry_change_notifier: Arc, ) -> Self { Self { component_repo, @@ -95,6 +100,7 @@ impl ComponentWriteService { account_usage_service, environment_service, environment_plugin_grant_service, + registry_change_notifier, } } @@ -106,28 +112,22 @@ impl ComponentWriteService { initial_permissions: &golem_common::model::component::AgentTypeInitialPermissions, auth: &AuthCtx, ) -> Result<(PolymorphicCard, CardRecord), ComponentError> { - let effective_surface = - auth.effective_surface_for_card_derivation("create agent initial permission card")?; + let delegation_surface = + auth.delegation_surface_for_card_derivation("create agent initial permission card")?; let card = prepare_agent_initial_card_for_minting( agent_type_name, initial_permissions, - effective_surface, + delegation_surface, )?; let record = CardRecord::polymorphic_creation( - card.card_id, - card.parent_ids.clone(), - card.lower_positive.clone(), - card.lower_negative.clone(), - card.upper_positive.clone(), - card.upper_negative.clone(), - card.expires_at, - card.system_card, + card, Some(CardManagedBy::AgentInitial(CardManagedByAgentInitial { component_id, component_revision, agent_type: agent_type_name.clone(), })), ); + let card = record.clone().try_into()?; Ok((card, record)) } @@ -559,7 +559,8 @@ impl ComponentWriteService { .map_err(|err| match err { ComponentRepoError::ConcurrentModification => ComponentError::ConcurrentUpdate, other => other.into(), - })?; + })? + .signal_new_events_available(self.registry_change_notifier.as_ref()); Ok(()) } @@ -912,7 +913,7 @@ fn resolve_files_for_update( fn prepare_agent_initial_card_for_minting( agent_type_name: &AgentTypeName, initial_permissions: &golem_common::model::component::AgentTypeInitialPermissions, - effective_surface: &EffectiveSurface, + delegation_surface: &DelegationSurface, ) -> Result { let mut card = initial_permissions.to_polymorphic_card(); let lower_positive = permission_envelopes_for_recipient_patterns(&card.lower_positive) @@ -922,6 +923,13 @@ fn prepare_agent_initial_card_for_minting( message, }, )?; + let lower_negative = permission_envelopes_for_recipient_patterns(&card.lower_negative) + .map_err( + |message| ComponentError::InvalidAgentInitialPermissionCard { + agent_type: agent_type_name.clone(), + message, + }, + )?; let upper_positive = permission_envelopes_for_recipient_patterns(&card.upper_positive) .map_err( |message| ComponentError::InvalidAgentInitialPermissionCard { @@ -929,8 +937,20 @@ fn prepare_agent_initial_card_for_minting( message, }, )?; - effective_surface - .validates_derivation(&lower_positive, &upper_positive) + let upper_negative = permission_envelopes_for_recipient_patterns(&card.upper_negative) + .map_err( + |message| ComponentError::InvalidAgentInitialPermissionCard { + agent_type: agent_type_name.clone(), + message, + }, + )?; + delegation_surface + .validate_attenuation( + &lower_positive, + &lower_negative, + &upper_positive, + &upper_negative, + ) .map_err(|error| ComponentError::InvalidAgentInitialPermissionCard { agent_type: agent_type_name.clone(), message: format!("card derivation is not allowed by the creator's cards: {error:?}"), @@ -1257,7 +1277,7 @@ mod tests { use chrono::Utc; use golem_common::model::agent::AgentTypeName; use golem_common::model::card::recipient::RecipientPattern; - use golem_common::model::card::{Card, CardId, EffectiveSurface, PermissionPattern}; + use golem_common::model::card::{Card, CardId, DelegationSurface, PermissionPattern}; use golem_common::model::component::AgentTypeInitialPermissions; use std::str::FromStr; use test_r::test; @@ -1266,7 +1286,7 @@ mod tests { PermissionPattern::from_str(value).unwrap() } - fn parent_surface(parent_id: CardId) -> EffectiveSurface { + fn parent_surface(parent_id: CardId) -> DelegationSurface { let card = Card { card_id: parent_id, parent_ids: Vec::new(), @@ -1286,7 +1306,7 @@ mod tests { system_card: false, managed_by: None, }; - EffectiveSurface::from_cards(&[card], &RecipientPattern::Any).unwrap() + DelegationSurface::from_cards(&[card]) } #[test] @@ -1309,7 +1329,7 @@ mod tests { fn agent_initial_card_must_be_subsumed_by_creator_surface() { let initial_permission = AgentTypeInitialPermissions::default_for_recipient(RecipientPattern::Any); - let empty_surface = EffectiveSurface::default(); + let empty_surface = DelegationSurface::default(); let error = prepare_agent_initial_card_for_minting( &AgentTypeName("Cart".to_string()), diff --git a/golem-registry-service/src/services/permission_share.rs b/golem-registry-service/src/services/permission_share.rs index e8b8f42f9e..3fee3f42f0 100644 --- a/golem-registry-service/src/services/permission_share.rs +++ b/golem-registry-service/src/services/permission_share.rs @@ -26,7 +26,7 @@ use golem_common::model::card::recipient::RecipientPattern; use golem_common::model::card::{ AccountPermissionShareResourcePattern, AccountPermissionShareVerb, Card, CardAlgebraError, CardId, CardManagedBy, CardManagedByPermissionShare, CardParseError, ClassPermissionTarget, - EffectiveSurface, PermissionPattern, PermissionTarget, + DelegationSurface, PermissionPattern, PermissionTarget, }; use golem_common::model::permission_share::{ PermissionShare, PermissionShareCreation, PermissionShareData, PermissionShareId, @@ -589,24 +589,29 @@ fn validate_derivation( ) -> Result<(), PermissionShareError> { match auth { AuthCtx::System => Ok(()), - AuthCtx::User(user) => { - validate_effective_surface_derivation(&user.effective_surface, parsed) - } - AuthCtx::AdminImpersonation(ctx) => { - validate_effective_surface_derivation(&ctx.effective_surface, parsed) - } AuthCtx::Agent(_) => Err(PermissionShareError::GrantNotDelegable( "agent contexts cannot delegate permission grants".to_string(), )), + AuthCtx::User(_) | AuthCtx::AdminImpersonation(_) => { + validate_delegation_surface_derivation( + auth.delegation_surface_for_card_derivation("create or update a permission share")?, + parsed, + ) + } } } -fn validate_effective_surface_derivation( - effective_surface: &EffectiveSurface, +fn validate_delegation_surface_derivation( + delegation_surface: &DelegationSurface, parsed: &ParsedPermissionShareData, ) -> Result<(), PermissionShareError> { - effective_surface - .validates_derivation(&parsed.lower_positive, &parsed.upper_positive) + delegation_surface + .validate_attenuation( + &parsed.lower_positive, + &parsed.lower_negative, + &parsed.upper_positive, + &parsed.upper_negative, + ) .map(|_| ()) .map_err(derivation_error) } diff --git a/golem-registry-service/tests/grpc.rs b/golem-registry-service/tests/grpc.rs new file mode 100644 index 0000000000..1f391a48ca --- /dev/null +++ b/golem-registry-service/tests/grpc.rs @@ -0,0 +1,334 @@ +// Copyright 2024-2026 Golem Cloud +// +// Licensed under the Golem Source License v1.1 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://license.golem.cloud/LICENSE +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use chrono::Utc; +use golem_common::config::{DbConfig, DbSqliteConfig}; +use golem_common::model::card::{Card, CardId, CardManagedByRuntimeDerived, StoredCard}; +use golem_common::model::component::ComponentId; +use golem_common::model::environment::EnvironmentId; +use golem_common::model::{AgentId, Empty, IdempotencyKey, OplogIndex}; +use golem_registry_service::RegistryService as RegistryServer; +use golem_registry_service::config::{ + ComponentCompilationConfig, LoginConfig, RegistryServiceConfig, +}; +use golem_registry_service::repo::card::{CardRepo, DbCardRepo}; +use golem_registry_service::repo::registry_change::{ + ChangeEventId, DbRegistryChangeRepo, RegistryChangeEvent, RegistryChangeRepo, +}; +use golem_service_base::clients::registry::{ + GrpcRegistryService, GrpcRegistryServiceConfig, RegistryService, RegistryServiceError, +}; +use golem_service_base::config::BlobStorageConfig; +use golem_service_base::db::sqlite::SqlitePool; +use tempfile::TempDir; +use test_r::{test, timeout}; +use tokio::task::JoinSet; + +fn runtime_card(card_id: CardId, parent_ids: Vec) -> StoredCard { + StoredCard::Concrete(Card { + card_id, + parent_ids, + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: Utc::now(), + expires_at: None, + system_card: false, + managed_by: None, + }) +} + +fn runtime_card_provenance(oplog_index: u64) -> CardManagedByRuntimeDerived { + CardManagedByRuntimeDerived { + environment_id: EnvironmentId::new(), + agent_id: AgentId { + component_id: ComponentId::new(), + agent_id: "runtime-card-grpc-test".to_string(), + }, + invocation_key: IdempotencyKey::new(format!("runtime-card-grpc-test-{oplog_index}")), + oplog_index: OplogIndex::from_u64(oplog_index), + } +} + +async fn start_registry() -> ( + TempDir, + DbSqliteConfig, + JoinSet>, + u16, +) { + let temp_dir = tempfile::tempdir().unwrap(); + let db_config = DbSqliteConfig { + database: temp_dir + .path() + .join("registry.db") + .to_string_lossy() + .into_owned(), + max_connections: 4, + foreign_keys: true, + }; + let config = RegistryServiceConfig { + grpc: golem_registry_service::config::GrpcApiConfig { + port: 0, + ..Default::default() + }, + db: DbConfig::Sqlite(db_config.clone()), + login: LoginConfig::Disabled(Empty {}), + blob_storage: BlobStorageConfig::default_in_memory(), + component_compilation: ComponentCompilationConfig::Disabled(Empty {}), + ..Default::default() + }; + let mut join_set = JoinSet::new(); + let details = RegistryServer::new(config, prometheus::Registry::new()) + .start_for_single_executable(&mut join_set) + .await + .unwrap(); + + (temp_dir, db_config, join_set, details.grpc_port) +} + +fn registry_client(port: u16) -> GrpcRegistryService { + GrpcRegistryService::new(&GrpcRegistryServiceConfig { + host: "127.0.0.1".to_string(), + port, + ..Default::default() + }) +} + +#[test] +#[timeout("120s")] +async fn runtime_card_grpc_lifecycle_is_shared_across_executor_clients() { + let (_temp_dir, db_config, mut join_set, port) = start_registry().await; + let writer = registry_client(port); + let reader = registry_client(port); + + let parent_id = CardId::new(); + writer + .create_runtime_card( + runtime_card(parent_id, Vec::new()), + runtime_card_provenance(1), + ) + .await + .unwrap(); + + let card_id = CardId::new(); + let card = runtime_card(card_id, vec![parent_id]); + let provenance = runtime_card_provenance(2); + let created = writer + .create_runtime_card(card.clone(), provenance.clone()) + .await + .unwrap(); + + assert_eq!( + writer + .create_runtime_card(card.clone(), provenance.clone()) + .await + .unwrap(), + created + ); + assert_eq!( + writer + .create_runtime_card(created.clone(), provenance.clone()) + .await + .unwrap(), + created + ); + + let mut conflicting = card.clone().into_concrete().unwrap(); + conflicting.expires_at = Some(Utc::now() + chrono::Duration::days(1)); + assert!(matches!( + writer + .create_runtime_card(conflicting.into(), provenance) + .await, + Err(RegistryServiceError::AlreadyExists(_)) + )); + + assert_eq!( + reader.batch_get_cards(vec![card_id]).await.unwrap(), + vec![created] + ); + + let missing_parent_card_id = CardId::new(); + assert!(matches!( + writer + .create_runtime_card( + runtime_card(missing_parent_card_id, vec![CardId::new()]), + runtime_card_provenance(3), + ) + .await, + Err(RegistryServiceError::NotFound(_)) + )); + assert!( + reader + .batch_get_cards(vec![missing_parent_card_id]) + .await + .unwrap() + .is_empty() + ); + + let revoked_parent_id = CardId::new(); + writer + .create_runtime_card( + runtime_card(revoked_parent_id, Vec::new()), + runtime_card_provenance(4), + ) + .await + .unwrap(); + let card_repo = DbCardRepo::logged(SqlitePool::configured(&db_config).await.unwrap()); + let _ = card_repo.delete(revoked_parent_id).await.unwrap(); + + let revoked_parent_card_id = CardId::new(); + assert!(matches!( + writer + .create_runtime_card( + runtime_card(revoked_parent_card_id, vec![revoked_parent_id]), + runtime_card_provenance(5), + ) + .await, + Err(RegistryServiceError::NotFound(_)) + )); + assert!( + reader + .batch_get_cards(vec![revoked_parent_card_id]) + .await + .unwrap() + .is_empty() + ); + + let sibling_id = CardId::new(); + writer + .create_runtime_card( + runtime_card(sibling_id, vec![parent_id]), + runtime_card_provenance(6), + ) + .await + .unwrap(); + let diamond_id = CardId::new(); + writer + .create_runtime_card( + runtime_card(diamond_id, vec![card_id, sibling_id]), + runtime_card_provenance(7), + ) + .await + .unwrap(); + + let mut expected_revoked = vec![parent_id, card_id, sibling_id, diamond_id]; + expected_revoked.sort_unstable(); + assert_eq!( + writer.revoke_card(parent_id).await.unwrap(), + expected_revoked + ); + let registry_change_repo = + DbRegistryChangeRepo::new(SqlitePool::configured(&db_config).await.unwrap()); + let events = registry_change_repo + .get_events_since(ChangeEventId(0)) + .await + .unwrap(); + let emitted_card_ids = events + .into_iter() + .find_map(|event| match event { + RegistryChangeEvent::CardRevoked { card_ids, .. } + if card_ids.contains(&parent_id.0) => + { + Some(card_ids) + } + _ => None, + }) + .expect("atomic DAG revoke must emit a card revocation event"); + assert_eq!( + emitted_card_ids, + expected_revoked + .iter() + .map(|card_id| card_id.0) + .collect::>() + ); + assert!( + reader + .batch_get_cards(expected_revoked.clone()) + .await + .unwrap() + .is_empty() + ); + assert!(matches!( + writer.revoke_card(parent_id).await, + Err(RegistryServiceError::NotFound(_)) + )); + + join_set.abort_all(); +} + +#[test] +#[timeout("120s")] +async fn revoked_runtime_card_cannot_be_resurrected_by_an_identical_create_retry() { + let (_temp_dir, _db_config, mut join_set, port) = start_registry().await; + let client = registry_client(port); + + let parent_id = CardId::new(); + client + .create_runtime_card( + runtime_card(parent_id, Vec::new()), + runtime_card_provenance(1), + ) + .await + .unwrap(); + + let card_id = CardId::new(); + let card = runtime_card(card_id, vec![parent_id]); + let provenance = runtime_card_provenance(2); + client + .create_runtime_card(card.clone(), provenance.clone()) + .await + .unwrap(); + assert_eq!(client.revoke_card(card_id).await.unwrap(), vec![card_id]); + + let retry = client.create_runtime_card(card, provenance).await; + let cards = client.batch_get_cards(vec![card_id]).await.unwrap(); + assert!( + retry.is_err() && cards.is_empty(), + "an idempotent retry must not make a revoked deterministic card ID live again: retry={retry:?}, cards={cards:?}" + ); + + join_set.abort_all(); +} + +#[test] +#[timeout("120s")] +async fn runtime_card_creation_rejects_an_expired_parent() { + let (_temp_dir, _db_config, mut join_set, port) = start_registry().await; + let client = registry_client(port); + + let parent_id = CardId::new(); + let mut parent = runtime_card(parent_id, Vec::new()).into_concrete().unwrap(); + parent.expires_at = Some(Utc::now() + chrono::Duration::milliseconds(100)); + client + .create_runtime_card(parent.into(), runtime_card_provenance(1)) + .await + .unwrap(); + tokio::time::sleep(std::time::Duration::from_millis(200)).await; + + let child_id = CardId::new(); + let creation = client + .create_runtime_card( + runtime_card(child_id, vec![parent_id]), + runtime_card_provenance(2), + ) + .await; + let cards = client.batch_get_cards(vec![child_id]).await.unwrap(); + assert!( + creation.is_err() && cards.is_empty(), + "runtime card creation must validate that every parent is live: creation={creation:?}, cards={cards:?}" + ); + + join_set.abort_all(); +} diff --git a/golem-registry-service/tests/lib.rs b/golem-registry-service/tests/lib.rs index 1e92b21df6..f608265289 100644 --- a/golem-registry-service/tests/lib.rs +++ b/golem-registry-service/tests/lib.rs @@ -15,10 +15,12 @@ use golem_common::tracing::{TracingConfig, init_tracing_with_default_debug_env_filter}; use test_r::{sequential_suite, test_dep}; +pub mod grpc; pub mod repo; test_r::enable!(); +sequential_suite!(grpc); sequential_suite!(repo); #[derive(Debug)] diff --git a/golem-registry-service/tests/repo/common.rs b/golem-registry-service/tests/repo/common.rs index c3f0ccde96..31572103c5 100644 --- a/golem-registry-service/tests/repo/common.rs +++ b/golem-registry-service/tests/repo/common.rs @@ -26,8 +26,8 @@ use golem_common::model::agent_secret::{ use golem_common::model::application::{ApplicationId, ApplicationName}; use golem_common::model::card::owner::{ComponentOwnerPattern, EnvironmentOwnerPattern}; use golem_common::model::card::{ - CardId, CardManagedBy, CardManagedByAccountRoot, CardManagedByAgentInitial, PermissionPattern, - PolymorphicCard, StoredCard, + Card, CardId, CardManagedBy, CardManagedByAccountRoot, CardManagedByAgentInitial, + CardManagedByRuntimeDerived, PermissionPattern, PolymorphicCard, StoredCard, }; use golem_common::model::component::{ComponentId, ComponentRevision}; use golem_common::model::component_metadata::{AgentTypeProvisionConfig, ComponentMetadata}; @@ -36,12 +36,13 @@ use golem_common::model::environment::{ }; use golem_common::model::http_api_deployment::HttpApiDeploymentAgentOptions; use golem_common::model::plan::PlanId; +use golem_common::model::{AgentId, IdempotencyKey, OplogIndex}; use golem_common::schema::{AgentConstructorSchema, AgentTypeSchema, InputSchema, SchemaGraph}; use golem_registry_service::repo::account::DbAccountRepo; use golem_registry_service::repo::account_usage::DbAccountUsageRepo; use golem_registry_service::repo::application::DbApplicationRepo; -use golem_registry_service::repo::card::DbCardRepo; -use golem_registry_service::repo::component::DbComponentRepo; +use golem_registry_service::repo::card::{CardRepo, DbCardRepo}; +use golem_registry_service::repo::component::{ComponentRepo, DbComponentRepo}; use golem_registry_service::repo::deployment::DbDeploymentRepo; use golem_registry_service::repo::environment::{ DbEnvironmentRepo, EnvironmentExtRevisionRecord, EnvironmentRevisionRecord, @@ -97,11 +98,13 @@ use golem_registry_service::services::{ card::{AccountCardFilter, CardError, CardService}, component::ComponentService, deployment::DeploymentService, - environment::EnvironmentService, + environment::{EnvironmentError, EnvironmentService}, permission_share::PermissionShareService, plan::PlanService, }; -use golem_service_base::model::auth::AuthCtx; +use golem_service_base::db::{LabelledPoolApi, LabelledPoolTransaction, Pool, PoolApi}; +use golem_service_base::db::{postgres::PostgresPool, sqlite::SqlitePool}; +use golem_service_base::model::auth::{AuthCtx, AuthorizationError}; use golem_service_base::repo::Blob; use golem_service_base::repo::SqlDateTime; use golem_service_base::storage::blob::memory::InMemoryBlobStorage; @@ -113,6 +116,1097 @@ use strum::IntoEnumIterator; use uuid::Uuid; // Common test cases ------------------------------------------------------------------------------- +fn runtime_card(card_id: CardId, parent_ids: Vec) -> StoredCard { + StoredCard::Concrete(Card { + card_id, + parent_ids, + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: chrono::DateTime::from_timestamp(1_700_000_000, 123_456_789).unwrap(), + expires_at: Some(chrono::DateTime::from_timestamp(1_800_000_000, 987_654_321).unwrap()), + system_card: false, + managed_by: None, + }) +} + +fn runtime_card_provenance() -> CardManagedByRuntimeDerived { + CardManagedByRuntimeDerived { + environment_id: EnvironmentId::new(), + agent_id: AgentId { + component_id: ComponentId::new(), + agent_id: "runtime-card-source".to_string(), + }, + invocation_key: IdempotencyKey::new("runtime-card-invocation".to_string()), + oplog_index: OplogIndex::from_u64(42), + } +} + +pub async fn test_runtime_card_creation_is_idempotent_and_rejects_conflicts(deps: &Deps) { + let services = environment_service_deps(deps); + let parent_ids = vec![CardId::new(), CardId::new()]; + let provenance = runtime_card_provenance(); + for parent_id in &parent_ids { + services + .card_service + .create_runtime_card( + runtime_card(*parent_id, Vec::new()), + provenance.clone(), + &AuthCtx::System, + ) + .await + .unwrap(); + } + + let card_id = CardId::new(); + let card = runtime_card(card_id, parent_ids.clone()); + + let created = services + .card_service + .create_runtime_card(card.clone(), provenance.clone(), &AuthCtx::System) + .await + .unwrap(); + let retried_from_original_request = services + .card_service + .create_runtime_card(card.clone(), provenance.clone(), &AuthCtx::System) + .await + .unwrap(); + let retried = services + .card_service + .create_runtime_card(created.clone(), provenance.clone(), &AuthCtx::System) + .await + .unwrap(); + let mut reordered = card.clone().into_concrete().unwrap(); + reordered.parent_ids.reverse(); + let retried_with_reordered_parents = services + .card_service + .create_runtime_card(reordered.into(), provenance.clone(), &AuthCtx::System) + .await + .unwrap(); + + assert_eq!(created, retried_from_original_request); + assert_eq!(created, retried); + assert_eq!(created, retried_with_reordered_parents); + let mut conflicting = card.clone().into_concrete().unwrap(); + conflicting.expires_at = None; + assert!(matches!( + services + .card_service + .create_runtime_card(conflicting.into(), provenance.clone(), &AuthCtx::System) + .await, + Err(CardError::RuntimeCardConflict(id)) if id == card_id + )); + + assert_eq!( + services + .card_service + .revoke_card(card_id, &AuthCtx::System) + .await + .unwrap(), + vec![card_id] + ); + assert!(matches!( + services + .card_service + .create_runtime_card(card, provenance, &AuthCtx::System) + .await, + Err(CardError::RuntimeCardRevoked(id)) if id == card_id + )); +} + +pub async fn test_runtime_card_creation_rejects_system_cards(deps: &Deps) { + let services = environment_service_deps(deps); + let card_id = CardId::new(); + let mut card = runtime_card(card_id, Vec::new()).into_concrete().unwrap(); + card.system_card = true; + + assert!(matches!( + services + .card_service + .create_runtime_card(card.into(), runtime_card_provenance(), &AuthCtx::System) + .await + .unwrap_err(), + CardError::RuntimeCardCannotBeSystemCard + )); +} + +pub async fn test_runtime_card_creation_requires_system_auth(deps: &Deps) { + let services = environment_service_deps(deps); + let auth = AuthCtx::agent_with_effective_surface( + AccountId::new(), + golem_common::model::account::AccountEmail::new("runtime-card-test@example.com"), + Default::default(), + ); + + assert!(matches!( + services + .card_service + .create_runtime_card( + runtime_card(CardId::new(), Vec::new()), + runtime_card_provenance(), + &auth, + ) + .await + .unwrap_err(), + CardError::Unauthorized(AuthorizationError::SystemOnlyActionNotAllowed(_)) + )); +} + +pub async fn test_runtime_card_parent_integrity(deps: &Deps) { + let services = environment_service_deps(deps); + let card_repo: Arc = match &deps.test_db { + TestDb::Postgres(pool) => Arc::new(DbCardRepo::new(pool.clone())), + TestDb::Sqlite(pool) => Arc::new(DbCardRepo::new(pool.clone())), + }; + let provenance = runtime_card_provenance(); + let parent_ids = (0..4).map(|_| CardId::new()).collect::>(); + + for parent_id in &parent_ids { + services + .card_service + .create_runtime_card( + runtime_card(*parent_id, Vec::new()), + provenance.clone(), + &AuthCtx::System, + ) + .await + .unwrap(); + } + + let first_child_id = CardId::new(); + services + .card_service + .create_runtime_card( + runtime_card(first_child_id, vec![parent_ids[0], parent_ids[1]]), + provenance.clone(), + &AuthCtx::System, + ) + .await + .unwrap(); + let second_child_id = CardId::new(); + services + .card_service + .create_runtime_card( + runtime_card(second_child_id, vec![parent_ids[2], parent_ids[3]]), + provenance.clone(), + &AuthCtx::System, + ) + .await + .unwrap(); + + let notifier = deps.test_registry_change_notifier(); + let first_deleted = card_repo + .delete(parent_ids[0]) + .await + .unwrap() + .signal_new_events_available(notifier.as_ref()); + let second_deleted = card_repo + .delete(parent_ids[3]) + .await + .unwrap() + .signal_new_events_available(notifier.as_ref()); + assert!(first_deleted.contains(&first_child_id)); + assert!(second_deleted.contains(&second_child_id)); + + let rejected_card_id = CardId::new(); + let error = services + .card_service + .create_runtime_card( + runtime_card(rejected_card_id, vec![parent_ids[1], parent_ids[3]]), + provenance, + &AuthCtx::System, + ) + .await + .unwrap_err(); + assert!(matches!(error, CardError::CardNotFound(id) if id == parent_ids[3])); + assert!(card_repo.get(rejected_card_id).await.unwrap().is_none()); + assert!(card_repo.get(parent_ids[1]).await.unwrap().is_some()); + + let self_parented_card_id = CardId::new(); + let error = services + .card_service + .create_runtime_card( + runtime_card(self_parented_card_id, vec![self_parented_card_id]), + runtime_card_provenance(), + &AuthCtx::System, + ) + .await + .unwrap_err(); + assert!(matches!(error, CardError::CardNotFound(id) if id == self_parented_card_id)); + assert!( + card_repo + .get(self_parented_card_id) + .await + .unwrap() + .is_none() + ); + + let expired_parent_id = CardId::new(); + let mut expired_parent = runtime_card(expired_parent_id, Vec::new()) + .into_concrete() + .unwrap(); + expired_parent.expires_at = Some(chrono::DateTime::from_timestamp(1_600_000_000, 0).unwrap()); + services + .card_service + .create_runtime_card( + expired_parent.into(), + runtime_card_provenance(), + &AuthCtx::System, + ) + .await + .unwrap(); + let child_of_expired_parent = CardId::new(); + assert!(matches!( + services + .card_service + .create_runtime_card( + runtime_card(child_of_expired_parent, vec![expired_parent_id]), + runtime_card_provenance(), + &AuthCtx::System, + ) + .await, + Err(CardError::CardNotFound(id)) if id == expired_parent_id + )); + assert!( + card_repo + .get(child_of_expired_parent) + .await + .unwrap() + .is_none() + ); +} + +pub async fn test_card_dag_traversal_deduplicates_diamonds(deps: &Deps) { + let services = environment_service_deps(deps); + let card_repo: Arc = match &deps.test_db { + TestDb::Postgres(pool) => Arc::new(DbCardRepo::new(pool.clone())), + TestDb::Sqlite(pool) => Arc::new(DbCardRepo::new(pool.clone())), + }; + let provenance = runtime_card_provenance(); + let root = CardId::new(); + let left = CardId::new(); + let right = CardId::new(); + let leaf = CardId::new(); + + for (card_id, parent_ids) in [ + (root, Vec::new()), + (left, vec![root]), + (right, vec![root]), + (leaf, vec![left, right]), + ] { + services + .card_service + .create_runtime_card( + runtime_card(card_id, parent_ids), + provenance.clone(), + &AuthCtx::System, + ) + .await + .unwrap(); + } + + let sorted = |mut card_ids: Vec| { + card_ids.sort_unstable(); + card_ids + }; + let all = sorted(vec![root, left, right, leaf]); + + assert_eq!( + card_repo.ancestor_ids_including_self(leaf).await.unwrap(), + all + ); + assert_eq!( + card_repo.descendant_ids_including_self(root).await.unwrap(), + all + ); + assert_eq!( + card_repo.descendant_ids_including_self(left).await.unwrap(), + sorted(vec![left, leaf]) + ); + assert_eq!( + card_repo.ancestor_ids_including_self(root).await.unwrap(), + vec![root] + ); + + let missing = CardId::new(); + assert!( + card_repo + .ancestor_ids_including_self(missing) + .await + .unwrap() + .is_empty() + ); + assert!( + card_repo + .descendant_ids_including_self(missing) + .await + .unwrap() + .is_empty() + ); +} + +pub async fn test_card_dag_revoke_transaction_rolls_back_atomically(deps: &Deps) { + let services = environment_service_deps(deps); + let card_repo: Arc = match &deps.test_db { + TestDb::Postgres(pool) => Arc::new(DbCardRepo::new(pool.clone())), + TestDb::Sqlite(pool) => Arc::new(DbCardRepo::new(pool.clone())), + }; + let provenance = runtime_card_provenance(); + let root = CardId::new(); + let left = CardId::new(); + let right = CardId::new(); + let leaf = CardId::new(); + let cards = [ + runtime_card(root, Vec::new()), + runtime_card(left, vec![root]), + runtime_card(right, vec![root]), + runtime_card(leaf, vec![left, right]), + ]; + + for card in &cards { + services + .card_service + .create_runtime_card(card.clone(), provenance.clone(), &AuthCtx::System) + .await + .unwrap(); + } + + let baseline = deps + .registry_change_repo + .get_latest_event_id() + .await + .unwrap() + .unwrap_or(ChangeEventId(0)); + let deleted = match &deps.test_db { + TestDb::Postgres(pool) => { + let mut tx = pool + .with_rw("test", "rollback_card_dag_revoke") + .begin() + .await + .unwrap(); + let deleted = DbCardRepo::::delete_tree_in_tx(&mut tx, root) + .await + .unwrap(); + tx.rollback().await.unwrap(); + deleted + } + TestDb::Sqlite(pool) => { + let mut tx = pool + .with_rw("test", "rollback_card_dag_revoke") + .begin() + .await + .unwrap(); + let deleted = DbCardRepo::::delete_tree_in_tx(&mut tx, root) + .await + .unwrap(); + tx.rollback().await.unwrap(); + deleted + } + }; + let mut expected = vec![root, left, right, leaf]; + expected.sort_unstable(); + + assert_eq!(deleted, expected); + assert_eq!( + card_repo.existing(expected.clone()).await.unwrap(), + expected + ); + let events = deps + .registry_change_repo + .get_events_since(baseline) + .await + .unwrap(); + assert!(events.iter().all(|event| { + !matches!( + event, + RegistryChangeEvent::CardRevoked { card_ids, .. } + if card_ids.iter().any(|card_id| expected.contains(&CardId(*card_id))) + ) + })); + + for card in cards { + assert_eq!( + services + .card_service + .create_runtime_card(card.clone(), provenance.clone(), &AuthCtx::System) + .await + .unwrap() + .card_id(), + card.card_id() + ); + } +} + +pub async fn test_component_deletion_racing_runtime_derivation(deps: &Deps) { + let TestDb::Postgres(pool) = &deps.test_db else { + panic!("this race depends on PostgreSQL row-lock and statement-snapshot semantics"); + }; + let pool = pool.clone(); + let services = environment_service_deps(deps); + let card_service = Arc::new(services.card_service); + let component_repo = Arc::new(DbComponentRepo::new(pool.clone())); + + let owner = deps.create_account().await; + let app = deps.create_application(owner.revision.account_id).await; + let env = deps.create_env(app.revision.application_id).await; + let component_id = ComponentId(new_repo_uuid()); + let agent_type = AgentTypeName("agent".to_string()); + let initial_card = PolymorphicCard { + card_id: CardId(new_repo_uuid()), + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: Utc::now(), + expires_at: None, + system_card: false, + }; + let initial_card_id = initial_card.card_id; + let metadata = ComponentMetadata::from_parts( + KnownExports::default(), + vec![], + None, + None, + vec![], + BTreeMap::from([( + agent_type.clone(), + AgentTypeProvisionConfig { + initial_permissions: initial_card.clone(), + env: BTreeMap::new(), + config: Vec::new(), + plugins: Vec::new(), + files: Vec::new(), + }, + )]), + ); + component_repo + .create( + env.revision.environment_id, + "component-delete-runtime-race", + ComponentRevisionRecord { + component_id: component_id.0, + revision_id: ComponentRevision::INITIAL.into(), + hash: SqlBlake3Hash::empty(), + audit: DeletableRevisionAuditFields::new(owner.revision.account_id), + size: 0.into(), + metadata: Blob::new(metadata), + object_store_key: "component-delete-runtime-race".to_string(), + binary_hash: SqlBlake3Hash::empty(), + }, + vec![CardRecord::polymorphic_creation( + initial_card.clone(), + Some(CardManagedBy::AgentInitial(CardManagedByAgentInitial { + component_id, + component_revision: ComponentRevision::INITIAL, + agent_type, + })), + )], + ) + .await + .unwrap(); + + let mut second_parent_id = CardId::new(); + while second_parent_id <= initial_card_id { + second_parent_id = CardId::new(); + } + let mut provenance = runtime_card_provenance(); + provenance.environment_id = EnvironmentId(env.revision.environment_id); + card_service + .create_runtime_card( + runtime_card(second_parent_id, Vec::new()), + provenance.clone(), + &AuthCtx::System, + ) + .await + .unwrap(); + + let mut blocker = pool + .with_rw("test", "block_second_runtime_parent") + .begin() + .await + .unwrap(); + blocker + .execute( + sqlx::query("SELECT card_id FROM cards WHERE card_id = $1 FOR UPDATE") + .bind(second_parent_id.0), + ) + .await + .unwrap(); + + let child_id = CardId::new(); + let create_task = tokio::spawn({ + let card_service = card_service.clone(); + async move { + card_service + .create_runtime_card( + runtime_card(child_id, vec![initial_card_id, second_parent_id]), + provenance, + &AuthCtx::System, + ) + .await + } + }); + + tokio::time::sleep(std::time::Duration::from_millis(100)).await; + let delete_task = tokio::spawn({ + let component_repo = component_repo.clone(); + async move { + component_repo + .delete(owner.revision.account_id, component_id.0, 1) + .await + } + }); + + let mut deletion_is_blocked = false; + for _ in 0..100 { + let mut api = pool.with_ro("test", "observe_blocked_component_delete"); + if api + .fetch_optional(sqlx::query( + "SELECT 1 FROM pg_stat_activity WHERE wait_event_type = 'Lock' AND query LIKE '%SELECT card_id, data, created_at, expires_at, system_card, managed_by%' AND query LIKE '%FOR UPDATE%'", + )) + .await + .unwrap() + .is_some() + { + deletion_is_blocked = true; + break; + } + tokio::time::sleep(std::time::Duration::from_millis(20)).await; + } + assert!( + deletion_is_blocked, + "failed to block component deletion on the AgentInitial root held by runtime derivation" + ); + + blocker.commit().await.unwrap(); + create_task.await.unwrap().unwrap(); + match delete_task.await.unwrap() { + Ok(_) => assert!( + card_service + .existing(vec![initial_card_id, child_id]) + .await + .unwrap() + .is_empty(), + "a successful deletion must remove the AgentInitial root and concurrently committed runtime descendant" + ), + Err(ComponentRepoError::ConcurrentModification) => {} + Err(error) => panic!( + "a create/delete race must either complete atomically or use the component concurrency error category, but returned {error:?}" + ), + } +} + +pub async fn test_component_deletion_racing_multi_parent_runtime_derivation(deps: &Deps) { + let TestDb::Postgres(pool) = &deps.test_db else { + panic!("this race depends on PostgreSQL row-lock semantics"); + }; + let pool = pool.clone(); + let services = environment_service_deps(deps); + let card_service = Arc::new(services.card_service); + let component_repo = Arc::new(DbComponentRepo::new(pool.clone())); + + let owner = deps.create_account().await; + let app = deps.create_application(owner.revision.account_id).await; + let env = deps.create_env(app.revision.application_id).await; + let component_id = ComponentId(new_repo_uuid()); + let low_card_id = CardId(Uuid::from_u128(1)); + let high_card_id = CardId(Uuid::from_u128(u128::MAX)); + let high_agent_type = AgentTypeName("a-high-card".to_string()); + let low_agent_type = AgentTypeName("b-low-card".to_string()); + let initial_card = |card_id| PolymorphicCard { + card_id, + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: Utc::now(), + expires_at: None, + system_card: false, + }; + let high_card = initial_card(high_card_id); + let low_card = initial_card(low_card_id); + let provision_config = |card: PolymorphicCard| AgentTypeProvisionConfig { + initial_permissions: card, + env: BTreeMap::new(), + config: Vec::new(), + plugins: Vec::new(), + files: Vec::new(), + }; + let metadata = ComponentMetadata::from_parts( + KnownExports::default(), + vec![], + None, + None, + vec![], + BTreeMap::from([ + (high_agent_type.clone(), provision_config(high_card.clone())), + (low_agent_type.clone(), provision_config(low_card.clone())), + ]), + ); + let card_record = |card: &PolymorphicCard, agent_type| { + CardRecord::polymorphic_creation( + card.clone(), + Some(CardManagedBy::AgentInitial(CardManagedByAgentInitial { + component_id, + component_revision: ComponentRevision::INITIAL, + agent_type, + })), + ) + }; + component_repo + .create( + env.revision.environment_id, + "component-delete-multi-parent-runtime-race", + ComponentRevisionRecord { + component_id: component_id.0, + revision_id: ComponentRevision::INITIAL.into(), + hash: SqlBlake3Hash::empty(), + audit: DeletableRevisionAuditFields::new(owner.revision.account_id), + size: 0.into(), + metadata: Blob::new(metadata), + object_store_key: "component-delete-multi-parent-runtime-race".to_string(), + binary_hash: SqlBlake3Hash::empty(), + }, + vec![ + card_record(&high_card, high_agent_type), + card_record(&low_card, low_agent_type), + ], + ) + .await + .unwrap(); + + let mut blocker = pool + .with_rw("test", "block_high_runtime_parent") + .begin() + .await + .unwrap(); + blocker + .execute( + sqlx::query("SELECT card_id FROM cards WHERE card_id = $1 FOR UPDATE") + .bind(high_card_id.0), + ) + .await + .unwrap(); + + let delete_task = tokio::spawn({ + let component_repo = component_repo.clone(); + async move { + component_repo + .delete(owner.revision.account_id, component_id.0, 1) + .await + } + }); + let mut deletion_is_blocked = false; + for _ in 0..100 { + let mut api = pool.with_ro("test", "observe_multi_parent_component_delete"); + if api + .fetch_optional(sqlx::query( + "SELECT 1 FROM pg_stat_activity WHERE wait_event_type = 'Lock' AND query LIKE '%FROM cards%' AND query LIKE '%FOR UPDATE%'", + )) + .await + .unwrap() + .is_some() + { + deletion_is_blocked = true; + break; + } + tokio::time::sleep(std::time::Duration::from_millis(20)).await; + } + assert!( + deletion_is_blocked, + "failed to block deletion on its first AgentInitial root" + ); + + let child_id = CardId::new(); + let mut provenance = runtime_card_provenance(); + provenance.environment_id = EnvironmentId(env.revision.environment_id); + let create_task = tokio::spawn({ + let card_service = card_service.clone(); + async move { + card_service + .create_runtime_card( + runtime_card(child_id, vec![high_card_id, low_card_id]), + provenance, + &AuthCtx::System, + ) + .await + } + }); + tokio::time::sleep(std::time::Duration::from_millis(100)).await; + blocker.commit().await.unwrap(); + + let create_result = tokio::time::timeout(std::time::Duration::from_secs(5), create_task) + .await + .expect("runtime creation did not finish after PostgreSQL deadlock detection") + .unwrap(); + let delete_result = tokio::time::timeout(std::time::Duration::from_secs(5), delete_task) + .await + .expect("component deletion did not finish after PostgreSQL deadlock detection") + .unwrap(); + + if let Err(error) = &create_result { + assert!( + !matches!(error, CardError::InternalError(_)), + "runtime derivation versus component deletion must never surface an internal error, but returned {error:?}" + ); + } + match delete_result { + Ok(_) => { + assert!( + card_service + .existing(vec![low_card_id, high_card_id, child_id]) + .await + .unwrap() + .is_empty(), + "a successful deletion must remove both roots and their runtime descendant" + ); + } + Err(ComponentRepoError::ConcurrentModification) => {} + Err(error) => panic!( + "runtime derivation versus component deletion must use the component concurrency category, but returned {error:?}" + ), + } +} + +pub async fn test_component_deletion_racing_runtime_derivation_from_descendant(deps: &Deps) { + let TestDb::Postgres(pool) = &deps.test_db else { + panic!("this race depends on PostgreSQL row-lock semantics"); + }; + let pool = pool.clone(); + let services = environment_service_deps(deps); + let card_service = Arc::new(services.card_service); + let component_repo = Arc::new(DbComponentRepo::new(pool.clone())); + + let owner = deps.create_account().await; + let app = deps.create_application(owner.revision.account_id).await; + let env = deps.create_env(app.revision.application_id).await; + let component_id = ComponentId(new_repo_uuid()); + let root_id = CardId(Uuid::from_u128(u128::MAX)); + let descendant_id = CardId(Uuid::from_u128(2)); + let agent_type = AgentTypeName("agent".to_string()); + let initial_card = PolymorphicCard { + card_id: root_id, + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: Utc::now(), + expires_at: None, + system_card: false, + }; + let metadata = ComponentMetadata::from_parts( + KnownExports::default(), + vec![], + None, + None, + vec![], + BTreeMap::from([( + agent_type.clone(), + AgentTypeProvisionConfig { + initial_permissions: initial_card.clone(), + env: BTreeMap::new(), + config: Vec::new(), + plugins: Vec::new(), + files: Vec::new(), + }, + )]), + ); + component_repo + .create( + env.revision.environment_id, + "component-delete-descendant-parent-race", + ComponentRevisionRecord { + component_id: component_id.0, + revision_id: ComponentRevision::INITIAL.into(), + hash: SqlBlake3Hash::empty(), + audit: DeletableRevisionAuditFields::new(owner.revision.account_id), + size: 0.into(), + metadata: Blob::new(metadata), + object_store_key: "component-delete-descendant-parent-race".to_string(), + binary_hash: SqlBlake3Hash::empty(), + }, + vec![CardRecord::polymorphic_creation( + initial_card, + Some(CardManagedBy::AgentInitial(CardManagedByAgentInitial { + component_id, + component_revision: ComponentRevision::INITIAL, + agent_type, + })), + )], + ) + .await + .unwrap(); + + let mut provenance = runtime_card_provenance(); + provenance.environment_id = EnvironmentId(env.revision.environment_id); + card_service + .create_runtime_card( + runtime_card(descendant_id, vec![root_id]), + provenance.clone(), + &AuthCtx::System, + ) + .await + .unwrap(); + + let mut blocker = pool + .with_rw("test", "block_runtime_descendant_parent") + .begin() + .await + .unwrap(); + blocker + .execute( + sqlx::query("SELECT card_id FROM cards WHERE card_id = $1 FOR UPDATE") + .bind(descendant_id.0), + ) + .await + .unwrap(); + + let child_id = CardId::new(); + let create_task = tokio::spawn({ + let card_service = card_service.clone(); + async move { + card_service + .create_runtime_card( + runtime_card(child_id, vec![descendant_id, root_id]), + provenance, + &AuthCtx::System, + ) + .await + } + }); + let mut creation_is_blocked = false; + for _ in 0..100 { + let mut api = pool.with_ro("test", "observe_blocked_descendant_parent_create"); + if api + .fetch_optional(sqlx::query( + "SELECT 1 FROM pg_stat_activity WHERE wait_event_type = 'Lock' AND query LIKE '%FROM cards%' AND query LIKE '%FOR UPDATE%'", + )) + .await + .unwrap() + .is_some() + { + creation_is_blocked = true; + break; + } + tokio::time::sleep(std::time::Duration::from_millis(20)).await; + } + assert!( + creation_is_blocked, + "failed to block creation on the descendant" + ); + + let delete_task = tokio::spawn({ + let component_repo = component_repo.clone(); + async move { + component_repo + .delete(owner.revision.account_id, component_id.0, 1) + .await + } + }); + let mut deletion_is_blocked = false; + for _ in 0..100 { + let mut api = pool.with_ro("test", "observe_descendant_component_delete"); + if api + .fetch_optional(sqlx::query( + "SELECT 1 FROM pg_stat_activity WHERE wait_event_type = 'Lock' AND query LIKE '%WITH RECURSIVE to_delete%'", + )) + .await + .unwrap() + .is_some() + { + deletion_is_blocked = true; + break; + } + tokio::time::sleep(std::time::Duration::from_millis(20)).await; + } + assert!( + deletion_is_blocked, + "failed to block deletion on the runtime descendant" + ); + + blocker.commit().await.unwrap(); + let create_result = tokio::time::timeout(std::time::Duration::from_secs(5), create_task) + .await + .expect("runtime creation did not finish after PostgreSQL deadlock detection") + .unwrap(); + let delete_result = tokio::time::timeout(std::time::Duration::from_secs(5), delete_task) + .await + .expect("component deletion did not finish after PostgreSQL deadlock detection") + .unwrap(); + + if let Err(error) = &create_result { + assert!( + !matches!(error, CardError::InternalError(_)), + "runtime derivation versus component deletion must never surface an internal error, but returned {error:?}" + ); + } + match delete_result { + Ok(_) => assert!( + card_service + .existing(vec![root_id, descendant_id, child_id]) + .await + .unwrap() + .is_empty(), + "a successful deletion must remove the root and all runtime descendants" + ), + Err(ComponentRepoError::ConcurrentModification) => {} + Err(error) => panic!( + "runtime derivation versus component deletion must use the component concurrency category, but returned {error:?}" + ), + } +} + +pub async fn test_environment_deletion_racing_runtime_derivation_from_descendant(deps: &Deps) { + let TestDb::Postgres(pool) = &deps.test_db else { + panic!("this race depends on PostgreSQL row-lock and statement-snapshot semantics"); + }; + let pool = pool.clone(); + let services = environment_service_deps(deps); + let environment_service = services.environment_service.clone(); + let card_service = Arc::new(services.card_service); + + let owner = deps.create_account().await; + let app = deps.create_application(owner.revision.account_id).await; + let env = environment_service + .create( + ApplicationId(app.revision.application_id), + EnvironmentCreation { + name: EnvironmentName("environment-runtime-delete-race".to_string()), + compatibility_check: false, + version_check: false, + security_overrides: false, + }, + &AuthCtx::System, + ) + .await + .unwrap(); + let default_card_id = deps + .environment_repo + .get_default_card_ref_by_environment(env.id.0) + .await + .unwrap() + .unwrap() + .card_id; + + let descendant_id = CardId::new(); + let mut provenance = runtime_card_provenance(); + provenance.environment_id = env.id; + card_service + .create_runtime_card( + runtime_card(descendant_id, vec![default_card_id]), + provenance.clone(), + &AuthCtx::System, + ) + .await + .unwrap(); + + let mut blocker = pool + .with_rw("test", "block_environment_runtime_descendant_parent") + .begin() + .await + .unwrap(); + blocker + .execute( + sqlx::query("SELECT card_id FROM cards WHERE card_id = $1 FOR UPDATE") + .bind(descendant_id.0), + ) + .await + .unwrap(); + + let child_id = CardId::new(); + let create_task = tokio::spawn({ + let card_service = card_service.clone(); + async move { + card_service + .create_runtime_card( + runtime_card(child_id, vec![descendant_id]), + provenance, + &AuthCtx::System, + ) + .await + } + }); + let mut creation_is_blocked = false; + for _ in 0..100 { + let mut api = pool.with_ro("test", "observe_blocked_environment_child_create"); + if api + .fetch_optional(sqlx::query( + "SELECT 1 FROM pg_stat_activity WHERE wait_event_type = 'Lock' AND query LIKE '%FROM cards%' AND query LIKE '%FOR UPDATE%'", + )) + .await + .unwrap() + .is_some() + { + creation_is_blocked = true; + break; + } + tokio::time::sleep(std::time::Duration::from_millis(20)).await; + } + assert!( + creation_is_blocked, + "failed to block runtime creation on the existing descendant" + ); + + let delete_task = tokio::spawn({ + let environment_service = environment_service.clone(); + async move { + environment_service + .delete(env.id, env.revision, &AuthCtx::System) + .await + } + }); + let mut deletion_is_blocked = false; + for _ in 0..100 { + let mut api = pool.with_ro("test", "observe_blocked_environment_delete"); + if api + .fetch_optional(sqlx::query( + "SELECT 1 FROM pg_stat_activity WHERE wait_event_type = 'Lock' AND query LIKE '%WITH RECURSIVE to_delete%'", + )) + .await + .unwrap() + .is_some() + { + deletion_is_blocked = true; + break; + } + tokio::time::sleep(std::time::Duration::from_millis(20)).await; + } + assert!( + deletion_is_blocked, + "failed to block environment deletion on the runtime descendant" + ); + + blocker.commit().await.unwrap(); + create_task.await.unwrap().unwrap(); + let delete_result = delete_task.await.unwrap(); + + match delete_result { + Ok(()) => assert!( + card_service + .existing(vec![default_card_id, descendant_id, child_id]) + .await + .unwrap() + .is_empty(), + "a successful environment deletion must remove the default-card DAG" + ), + Err(EnvironmentError::ConcurrentModification) => assert_eq!( + card_service + .existing(vec![default_card_id, descendant_id, child_id]) + .await + .unwrap(), + vec![default_card_id, descendant_id, child_id], + "a rejected environment deletion must roll back the revocation boundary" + ), + Err(error) => panic!( + "runtime derivation versus environment deletion must complete atomically or use the environment concurrency category, but returned {error:?}" + ), + } +} + pub async fn test_create_and_get_account(deps: &Deps) { let account = AccountRevisionRecord { account_id: new_repo_uuid(), @@ -886,28 +1980,161 @@ pub async fn test_deleted_environment_default_card_revoke_returns_not_found(deps let revoke_error = services .card_service - .revoke_card(default_card_id, &AuthCtx::System) + .revoke_card(default_card_id, &AuthCtx::System) + .await + .unwrap_err(); + match revoke_error { + CardError::CardNotFound(card_id) if card_id == default_card_id => {} + other => panic!( + "deleted environment default cards should not remain revokable through the raw card row; expected CardNotFound({default_card_id}), got {other:?}" + ), + } +} + +pub async fn test_deleted_environment_default_card_is_not_reported_existing(deps: &Deps) { + let owner = deps.create_account().await; + let app = deps.create_application(owner.revision.account_id).await; + let services = environment_service_deps(deps); + + let env = services + .environment_service + .create( + ApplicationId(app.revision.application_id), + EnvironmentCreation { + name: EnvironmentName("env".to_string()), + compatibility_check: false, + version_check: false, + security_overrides: false, + }, + &AuthCtx::System, + ) + .await + .unwrap(); + + let refs = deps + .environment_repo + .list_default_card_refs_by_account(owner.revision.account_id) + .await + .unwrap(); + assert_eq!(refs.len(), 1); + let default_card_id = refs[0].card_id; + + services + .environment_service + .delete(env.id, env.revision, &AuthCtx::System) + .await + .unwrap(); + + let get_error = services + .card_service + .get_card(default_card_id, &AuthCtx::System) + .await + .unwrap_err(); + assert!(matches!(get_error, CardError::CardNotFound(card_id) if card_id == default_card_id)); + + assert!( + services + .card_service + .get_cards(vec![default_card_id]) + .await + .unwrap() + .is_empty() + ); + + let existing = services + .card_service + .existing(vec![default_card_id]) + .await + .unwrap(); + + assert!( + existing.is_empty(), + "deleted environment-default cards are logically not found and must not be reported as existing" + ); +} + +pub async fn test_runtime_descendants_of_deleted_environment_default_card_are_not_live( + deps: &Deps, +) { + let owner = deps.create_account().await; + let app = deps.create_application(owner.revision.account_id).await; + let services = environment_service_deps(deps); + + let env = services + .environment_service + .create( + ApplicationId(app.revision.application_id), + EnvironmentCreation { + name: EnvironmentName("env".to_string()), + compatibility_check: false, + version_check: false, + security_overrides: false, + }, + &AuthCtx::System, + ) + .await + .unwrap(); + + let refs = deps + .environment_repo + .list_default_card_refs_by_account(owner.revision.account_id) + .await + .unwrap(); + assert_eq!(refs.len(), 1); + let default_card_id = refs[0].card_id; + + let child_id = CardId::new(); + let mut provenance = runtime_card_provenance(); + provenance.environment_id = env.id; + services + .card_service + .create_runtime_card( + runtime_card(child_id, vec![default_card_id]), + provenance.clone(), + &AuthCtx::System, + ) + .await + .unwrap(); + + services + .environment_service + .delete(env.id, env.revision, &AuthCtx::System) + .await + .unwrap(); + + assert!( + services + .card_service + .existing(vec![default_card_id, child_id]) + .await + .unwrap() + .is_empty(), + "revoking a parent must also make its runtime descendants non-live" + ); + + let grandchild_id = CardId::new(); + let error = services + .card_service + .create_runtime_card( + runtime_card(grandchild_id, vec![child_id]), + provenance, + &AuthCtx::System, + ) .await .unwrap_err(); - match revoke_error { - CardError::CardNotFound(card_id) if card_id == default_card_id => {} - other => panic!( - "deleted environment default cards should not remain revokable through the raw card row; expected CardNotFound({default_card_id}), got {other:?}" - ), - } + assert!(matches!(error, CardError::CardNotFound(card_id) if card_id == child_id)); } -pub async fn test_deleted_environment_default_card_is_not_reported_existing(deps: &Deps) { +pub async fn test_environment_deletion_revokes_component_card_runtime_descendants(deps: &Deps) { let owner = deps.create_account().await; let app = deps.create_application(owner.revision.account_id).await; let services = environment_service_deps(deps); - let env = services .environment_service .create( ApplicationId(app.revision.application_id), EnvironmentCreation { - name: EnvironmentName("env".to_string()), + name: EnvironmentName("env-with-component-card".to_string()), compatibility_check: false, version_check: false, security_overrides: false, @@ -917,13 +2144,74 @@ pub async fn test_deleted_environment_default_card_is_not_reported_existing(deps .await .unwrap(); - let refs = deps - .environment_repo - .list_default_card_refs_by_account(owner.revision.account_id) + let component_id = ComponentId(new_repo_uuid()); + let agent_type = AgentTypeName("agent".to_string()); + let initial_card = PolymorphicCard { + card_id: CardId(new_repo_uuid()), + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: Utc::now(), + expires_at: None, + system_card: false, + }; + let metadata = ComponentMetadata::from_parts( + KnownExports::default(), + vec![], + None, + None, + vec![], + BTreeMap::from([( + agent_type.clone(), + AgentTypeProvisionConfig { + initial_permissions: initial_card.clone(), + env: BTreeMap::new(), + config: Vec::new(), + plugins: Vec::new(), + files: Vec::new(), + }, + )]), + ); + deps.component_repo + .create( + env.id.0, + "component", + ComponentRevisionRecord { + component_id: component_id.0, + revision_id: ComponentRevision::INITIAL.into(), + hash: SqlBlake3Hash::empty(), + audit: DeletableRevisionAuditFields::new(owner.revision.account_id), + size: 0.into(), + metadata: Blob::new(metadata), + object_store_key: "component".to_string(), + binary_hash: SqlBlake3Hash::empty(), + }, + vec![CardRecord::polymorphic_creation( + initial_card.clone(), + Some(CardManagedBy::AgentInitial(CardManagedByAgentInitial { + component_id, + component_revision: ComponentRevision::INITIAL, + agent_type, + })), + )], + ) + .await + .unwrap(); + + let child_id = CardId::new(); + let mut provenance = runtime_card_provenance(); + provenance.environment_id = env.id; + services + .card_service + .create_runtime_card( + runtime_card(child_id, vec![initial_card.card_id]), + provenance.clone(), + &AuthCtx::System, + ) .await .unwrap(); - assert_eq!(refs.len(), 1); - let default_card_id = refs[0].card_id; services .environment_service @@ -931,31 +2219,25 @@ pub async fn test_deleted_environment_default_card_is_not_reported_existing(deps .await .unwrap(); - let get_error = services + let grandchild_id = CardId::new(); + let creation = services .card_service - .get_card(default_card_id, &AuthCtx::System) - .await - .unwrap_err(); - assert!(matches!(get_error, CardError::CardNotFound(card_id) if card_id == default_card_id)); - - assert!( - services - .card_service - .get_cards(vec![default_card_id]) - .await - .unwrap() - .is_empty() - ); - + .create_runtime_card( + runtime_card(grandchild_id, vec![child_id]), + provenance, + &AuthCtx::System, + ) + .await; let existing = services .card_service - .existing(vec![default_card_id]) + .existing(vec![initial_card.card_id, child_id, grandchild_id]) .await .unwrap(); assert!( - existing.is_empty(), - "deleted environment-default cards are logically not found and must not be reported as existing" + matches!(creation, Err(CardError::CardNotFound(card_id)) if card_id == child_id) + && existing.is_empty(), + "environment deletion must revoke component cards and their runtime descendants; creation result: {creation:?}, existing cards: {existing:?}" ); } @@ -1478,7 +2760,8 @@ pub async fn test_component_stage(deps: &Deps) { deps.component_repo .delete(user.revision.account_id, component_id, 2) .await - .unwrap(); + .unwrap() + .signal_new_events_available(deps.test_registry_change_notifier().as_ref()); let components = deps .component_repo @@ -1565,14 +2848,7 @@ pub async fn test_initial_permission_card_ids_by_account_are_unique(deps: &Deps) binary_hash: SqlBlake3Hash::empty(), }, vec![CardRecord::polymorphic_creation( - initial_card.card_id, - initial_card.parent_ids.clone(), - initial_card.lower_positive.clone(), - initial_card.lower_negative.clone(), - initial_card.upper_positive.clone(), - initial_card.upper_negative.clone(), - initial_card.expires_at, - initial_card.system_card, + initial_card.clone(), Some(CardManagedBy::AgentInitial(CardManagedByAgentInitial { component_id, component_revision: ComponentRevision::INITIAL, @@ -1608,7 +2884,7 @@ pub async fn test_initial_permission_card_ids_by_account_are_unique(deps: &Deps) assert_eq!(ids, vec![initial_card.card_id]); } -pub async fn test_agent_initial_card_removed_from_current_component_is_not_live(deps: &Deps) { +pub async fn test_agent_initial_card_from_older_component_revision_remains_live(deps: &Deps) { let owner = deps.create_account().await; let app = deps.create_application(owner.revision.account_id).await; let env = deps.create_env(app.revision.application_id).await; @@ -1660,14 +2936,7 @@ pub async fn test_agent_initial_card_removed_from_current_component_is_not_live( binary_hash: SqlBlake3Hash::empty(), }, vec![CardRecord::polymorphic_creation( - initial_card.card_id, - initial_card.parent_ids.clone(), - initial_card.lower_positive.clone(), - initial_card.lower_negative.clone(), - initial_card.upper_positive.clone(), - initial_card.upper_negative.clone(), - initial_card.expires_at, - initial_card.system_card, + initial_card.clone(), Some(CardManagedBy::AgentInitial(CardManagedByAgentInitial { component_id, component_revision: ComponentRevision::INITIAL, @@ -1678,6 +2947,19 @@ pub async fn test_agent_initial_card_removed_from_current_component_is_not_live( .await .unwrap(); + let derived_parent_id = CardId::new(); + let mut provenance = runtime_card_provenance(); + provenance.environment_id = EnvironmentId(env.revision.environment_id); + services + .card_service + .create_runtime_card( + runtime_card(derived_parent_id, vec![initial_card.card_id]), + provenance.clone(), + &AuthCtx::System, + ) + .await + .unwrap(); + deps.component_repo .update( ComponentRevisionRecord { @@ -1717,26 +2999,67 @@ pub async fn test_agent_initial_card_removed_from_current_component_is_not_live( assert_eq!( ids, Vec::::new(), - "agent-initial cards removed from the current live component revision must not remain account cards" + "the staged-card listing follows the current component revision" ); - assert!( + assert_eq!( services .card_service .get_cards(vec![initial_card.card_id]) .await .unwrap() - .is_empty(), - "agent-initial cards removed from the current live component revision must not remain live through batch_get_cards" + .into_iter() + .map(|card| card.card_id()) + .collect::>(), + vec![initial_card.card_id], + "agents can keep using cards from their component revision after a newer revision is staged" ); - assert!( + assert_eq!( services .card_service .existing(vec![initial_card.card_id]) .await - .unwrap() - .is_empty(), - "agent-initial cards removed from the current live component revision must not be reported as existing" + .unwrap(), + vec![initial_card.card_id], + "older-revision agent-initial cards remain authoritative" + ); + + let card_repo: Arc = match &deps.test_db { + TestDb::Postgres(pool) => Arc::new(DbCardRepo::new(pool.clone())), + TestDb::Sqlite(pool) => Arc::new(DbCardRepo::new(pool.clone())), + }; + assert!( + card_repo.get(initial_card.card_id).await.unwrap().is_some(), + "the older revision's agent-initial card remains physically stored" + ); + let child_id = CardId::new(); + services + .card_service + .create_runtime_card( + runtime_card(child_id, vec![initial_card.card_id]), + runtime_card_provenance(), + &AuthCtx::System, + ) + .await + .unwrap(); + assert!( + card_repo.get(child_id).await.unwrap().is_some(), + "runtime derivation from an older-revision agent-initial card remains valid" + ); + + let transitive_child_id = CardId::new(); + services + .card_service + .create_runtime_card( + runtime_card(transitive_child_id, vec![derived_parent_id]), + provenance, + &AuthCtx::System, + ) + .await + .unwrap(); + assert!( + card_repo.get(transitive_child_id).await.unwrap().is_some(), + "runtime descendants of an older-revision card remain live" ); let account_cards = services @@ -1755,7 +3078,7 @@ pub async fn test_agent_initial_card_removed_from_current_component_is_not_live( .unwrap(); assert!( account_cards.is_empty(), - "account card listing filtered to agent-initial cards must follow the current live component revision" + "account card listing is a view of the currently staged component revision" ); } @@ -1810,14 +3133,7 @@ pub async fn test_initial_permission_card_ids_by_account_excludes_deleted_compon binary_hash: SqlBlake3Hash::empty(), }, vec![CardRecord::polymorphic_creation( - initial_card.card_id, - initial_card.parent_ids.clone(), - initial_card.lower_positive.clone(), - initial_card.lower_negative.clone(), - initial_card.upper_positive.clone(), - initial_card.upper_negative.clone(), - initial_card.expires_at, - initial_card.system_card, + initial_card.clone(), Some(CardManagedBy::AgentInitial(CardManagedByAgentInitial { component_id, component_revision: ComponentRevision::INITIAL, @@ -1838,7 +3154,8 @@ pub async fn test_initial_permission_card_ids_by_account_excludes_deleted_compon deps.component_repo .delete(owner.revision.account_id, component_id.0, 1) .await - .unwrap(); + .unwrap() + .signal_new_events_available(deps.test_registry_change_notifier().as_ref()); let ids = deps .component_repo @@ -1900,14 +3217,7 @@ pub async fn test_deleted_component_agent_initial_card_is_not_reported_existing( binary_hash: SqlBlake3Hash::empty(), }, vec![CardRecord::polymorphic_creation( - initial_card.card_id, - initial_card.parent_ids.clone(), - initial_card.lower_positive.clone(), - initial_card.lower_negative.clone(), - initial_card.upper_positive.clone(), - initial_card.upper_negative.clone(), - initial_card.expires_at, - initial_card.system_card, + initial_card.clone(), Some(CardManagedBy::AgentInitial(CardManagedByAgentInitial { component_id, component_revision: ComponentRevision::INITIAL, @@ -1929,7 +3239,8 @@ pub async fn test_deleted_component_agent_initial_card_is_not_reported_existing( deps.component_repo .delete(owner.revision.account_id, component_id.0, 1) .await - .unwrap(); + .unwrap() + .signal_new_events_available(deps.test_registry_change_notifier().as_ref()); assert!( deps.component_repo @@ -1958,6 +3269,120 @@ pub async fn test_deleted_component_agent_initial_card_is_not_reported_existing( ); } +pub async fn test_component_delete_does_not_revoke_reused_agent_initial_card_id(deps: &Deps) { + let owner = deps.create_account().await; + let app = deps.create_application(owner.revision.account_id).await; + let env = deps.create_env(app.revision.application_id).await; + let services = environment_service_deps(deps); + + let component_id = ComponentId(new_repo_uuid()); + let agent_type = AgentTypeName("agent".to_string()); + let reused_card_id = CardId(new_repo_uuid()); + let initial_card = PolymorphicCard { + card_id: reused_card_id, + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: Utc::now(), + expires_at: None, + system_card: false, + }; + let metadata = ComponentMetadata::from_parts( + KnownExports::default(), + vec![], + None, + None, + vec![], + BTreeMap::from([( + agent_type.clone(), + AgentTypeProvisionConfig { + initial_permissions: initial_card.clone(), + env: BTreeMap::new(), + config: Vec::new(), + plugins: Vec::new(), + files: Vec::new(), + }, + )]), + ); + + deps.component_repo + .create( + env.revision.environment_id, + "component-with-reused-card-id", + ComponentRevisionRecord { + component_id: component_id.0, + revision_id: ComponentRevision::INITIAL.into(), + hash: SqlBlake3Hash::empty(), + audit: DeletableRevisionAuditFields::new(owner.revision.account_id), + size: 0.into(), + metadata: Blob::new(metadata), + object_store_key: "component-with-reused-card-id".to_string(), + binary_hash: SqlBlake3Hash::empty(), + }, + vec![CardRecord::polymorphic_creation( + initial_card.clone(), + Some(CardManagedBy::AgentInitial(CardManagedByAgentInitial { + component_id, + component_revision: ComponentRevision::INITIAL, + agent_type, + })), + )], + ) + .await + .unwrap(); + + services + .card_service + .revoke_card(reused_card_id, &AuthCtx::System) + .await + .unwrap(); + + let mut provenance = runtime_card_provenance(); + provenance.environment_id = EnvironmentId(env.revision.environment_id); + services + .card_service + .create_runtime_card( + runtime_card(reused_card_id, Vec::new()), + provenance.clone(), + &AuthCtx::System, + ) + .await + .unwrap(); + let child_id = CardId::new(); + services + .card_service + .create_runtime_card( + runtime_card(child_id, vec![reused_card_id]), + provenance, + &AuthCtx::System, + ) + .await + .unwrap(); + + let deleted = deps + .component_repo + .delete(owner.revision.account_id, component_id.0, 1) + .await + .unwrap() + .signal_new_events_available(deps.test_registry_change_notifier().as_ref()); + + assert!( + !deleted.contains(&reused_card_id) && !deleted.contains(&child_id), + "component deletion must only revoke roots still managed as AgentInitial cards and their descendants" + ); + assert_eq!( + services + .card_service + .existing(vec![reused_card_id, child_id]) + .await + .unwrap(), + vec![reused_card_id, child_id], + "reusing a revoked card ID for an unrelated runtime card must not make it part of the component's revocation tree" + ); +} + pub async fn test_initial_permission_card_ids_by_account_excludes_pre_recreate_revisions( deps: &Deps, ) { @@ -2012,14 +3437,7 @@ pub async fn test_initial_permission_card_ids_by_account_excludes_pre_recreate_r binary_hash: SqlBlake3Hash::empty(), }, vec![CardRecord::polymorphic_creation( - initial_card.card_id, - initial_card.parent_ids.clone(), - initial_card.lower_positive.clone(), - initial_card.lower_negative.clone(), - initial_card.upper_positive.clone(), - initial_card.upper_negative.clone(), - initial_card.expires_at, - initial_card.system_card, + initial_card.clone(), Some(CardManagedBy::AgentInitial(CardManagedByAgentInitial { component_id, component_revision: ComponentRevision::INITIAL, @@ -2030,10 +3448,24 @@ pub async fn test_initial_permission_card_ids_by_account_excludes_pre_recreate_r .await .unwrap(); + let descendant_id = CardId::new(); + let mut provenance = runtime_card_provenance(); + provenance.environment_id = EnvironmentId(env.revision.environment_id); + services + .card_service + .create_runtime_card( + runtime_card(descendant_id, vec![initial_card.card_id]), + provenance.clone(), + &AuthCtx::System, + ) + .await + .unwrap(); + deps.component_repo .delete(owner.revision.account_id, component_id.0, 1) .await - .unwrap(); + .unwrap() + .signal_new_events_available(deps.test_registry_change_notifier().as_ref()); deps.component_repo .create( @@ -2082,6 +3514,38 @@ pub async fn test_initial_permission_card_ids_by_account_excludes_pre_recreate_r .is_empty(), "agent-initial cards from a deleted component incarnation must not be reported as existing after same-name recreation" ); + + assert!( + services + .card_service + .existing(vec![descendant_id]) + .await + .unwrap() + .is_empty(), + "runtime descendants from a deleted component incarnation must not remain authoritative after same-name recreation" + ); + + let rejected_card_id = CardId::new(); + let error = services + .card_service + .create_runtime_card( + runtime_card(rejected_card_id, vec![descendant_id]), + provenance, + &AuthCtx::System, + ) + .await + .unwrap_err(); + assert!(matches!(error, CardError::CardNotFound(id) if id == descendant_id)); + + let card_repo: Arc = match &deps.test_db { + TestDb::Postgres(pool) => Arc::new(DbCardRepo::new(pool.clone())), + TestDb::Sqlite(pool) => Arc::new(DbCardRepo::new(pool.clone())), + }; + assert!( + card_repo.get(descendant_id).await.unwrap().is_none(), + "component deletion must physically remove runtime descendants" + ); + assert!(card_repo.get(rejected_card_id).await.unwrap().is_none()); } pub async fn test_http_api_deployment_stage(deps: &Deps) { diff --git a/golem-registry-service/tests/repo/postgres.rs b/golem-registry-service/tests/repo/postgres.rs index ba2bc6ddc4..069f73f980 100644 --- a/golem-registry-service/tests/repo/postgres.rs +++ b/golem-registry-service/tests/repo/postgres.rs @@ -263,6 +263,67 @@ async fn postgres_tls_deps(db: &PostgresTlsDb) -> Deps { make_deps(db.pool.clone()).await } +#[test] +async fn test_runtime_card_creation_is_idempotent_and_rejects_conflicts( + #[dimension(postgres_variant)] deps: &Deps, +) { + crate::repo::common::test_runtime_card_creation_is_idempotent_and_rejects_conflicts(deps).await; +} + +#[test] +async fn test_runtime_card_creation_rejects_system_cards( + #[dimension(postgres_variant)] deps: &Deps, +) { + crate::repo::common::test_runtime_card_creation_rejects_system_cards(deps).await; +} + +#[test] +async fn test_runtime_card_parent_integrity(#[dimension(postgres_variant)] deps: &Deps) { + crate::repo::common::test_runtime_card_parent_integrity(deps).await; +} + +#[test] +async fn test_card_dag_traversal_deduplicates_diamonds(#[dimension(postgres_variant)] deps: &Deps) { + crate::repo::common::test_card_dag_traversal_deduplicates_diamonds(deps).await; +} + +#[test] +async fn test_card_dag_revoke_transaction_rolls_back_atomically( + #[dimension(postgres_variant)] deps: &Deps, +) { + crate::repo::common::test_card_dag_revoke_transaction_rolls_back_atomically(deps).await; +} + +#[test] +async fn test_component_deletion_racing_runtime_derivation( + #[dimension(postgres_variant)] deps: &Deps, +) { + crate::repo::common::test_component_deletion_racing_runtime_derivation(deps).await; +} + +#[test] +async fn test_component_deletion_racing_multi_parent_runtime_derivation( + #[dimension(postgres_variant)] deps: &Deps, +) { + crate::repo::common::test_component_deletion_racing_multi_parent_runtime_derivation(deps).await; +} + +#[test] +async fn test_component_deletion_racing_runtime_derivation_from_descendant( + #[dimension(postgres_variant)] deps: &Deps, +) { + crate::repo::common::test_component_deletion_racing_runtime_derivation_from_descendant(deps) + .await; +} + +#[test] +async fn test_environment_deletion_racing_runtime_derivation_from_descendant( + #[dimension(postgres_variant)] deps: &Deps, +) { + crate::repo::common::test_environment_deletion_racing_runtime_derivation_from_descendant(deps) + .await; +} + #[test] async fn test_create_and_get_account(#[dimension(postgres_variant)] deps: &Deps) { crate::repo::common::test_create_and_get_account(deps).await; @@ -332,6 +393,24 @@ async fn test_deleted_environment_default_card_is_not_reported_existing( crate::repo::common::test_deleted_environment_default_card_is_not_reported_existing(deps).await; } +#[test] +async fn test_runtime_descendants_of_deleted_environment_default_card_are_not_live( + #[dimension(postgres_variant)] deps: &Deps, +) { + crate::repo::common::test_runtime_descendants_of_deleted_environment_default_card_are_not_live( + deps, + ) + .await; +} + +#[test] +async fn test_environment_deletion_revokes_component_card_runtime_descendants( + #[dimension(postgres_variant)] deps: &Deps, +) { + crate::repo::common::test_environment_deletion_revokes_component_card_runtime_descendants(deps) + .await; +} + #[test] async fn test_environment_default_card_tracks_environment_rename( #[dimension(postgres_variant)] deps: &Deps, @@ -366,10 +445,10 @@ async fn test_initial_permission_card_ids_by_account_are_unique( } #[test] -async fn test_agent_initial_card_removed_from_current_component_is_not_live( +async fn test_agent_initial_card_from_older_component_revision_remains_live( #[dimension(postgres_variant)] deps: &Deps, ) { - crate::repo::common::test_agent_initial_card_removed_from_current_component_is_not_live(deps) + crate::repo::common::test_agent_initial_card_from_older_component_revision_remains_live(deps) .await; } @@ -391,6 +470,14 @@ async fn test_deleted_component_agent_initial_card_is_not_reported_existing( .await; } +#[test] +async fn test_component_delete_does_not_revoke_reused_agent_initial_card_id( + #[dimension(postgres_variant)] deps: &Deps, +) { + crate::repo::common::test_component_delete_does_not_revoke_reused_agent_initial_card_id(deps) + .await; +} + #[test] async fn test_initial_permission_card_ids_by_account_excludes_pre_recreate_revisions( #[dimension(postgres_variant)] deps: &Deps, diff --git a/golem-registry-service/tests/repo/sqlite.rs b/golem-registry-service/tests/repo/sqlite.rs index f0277812d5..fdd010a2a0 100644 --- a/golem-registry-service/tests/repo/sqlite.rs +++ b/golem-registry-service/tests/repo/sqlite.rs @@ -108,6 +108,36 @@ async fn deps(db: &SqliteDb) -> Deps { // Test cases -------------------------------------------------------------------------------------- +#[test] +async fn test_runtime_card_creation_is_idempotent_and_rejects_conflicts(deps: &Deps) { + crate::repo::common::test_runtime_card_creation_is_idempotent_and_rejects_conflicts(deps).await; +} + +#[test] +async fn test_runtime_card_creation_rejects_system_cards(deps: &Deps) { + crate::repo::common::test_runtime_card_creation_rejects_system_cards(deps).await; +} + +#[test] +async fn test_runtime_card_creation_requires_system_auth(deps: &Deps) { + crate::repo::common::test_runtime_card_creation_requires_system_auth(deps).await; +} + +#[test] +async fn test_runtime_card_parent_integrity(deps: &Deps) { + crate::repo::common::test_runtime_card_parent_integrity(deps).await; +} + +#[test] +async fn test_card_dag_traversal_deduplicates_diamonds(deps: &Deps) { + crate::repo::common::test_card_dag_traversal_deduplicates_diamonds(deps).await; +} + +#[test] +async fn test_card_dag_revoke_transaction_rolls_back_atomically(deps: &Deps) { + crate::repo::common::test_card_dag_revoke_transaction_rolls_back_atomically(deps).await; +} + #[test] async fn test_create_and_get_account(deps: &Deps) { crate::repo::common::test_create_and_get_account(deps).await; @@ -169,6 +199,20 @@ async fn test_deleted_environment_default_card_is_not_reported_existing(deps: &D crate::repo::common::test_deleted_environment_default_card_is_not_reported_existing(deps).await; } +#[test] +async fn test_runtime_descendants_of_deleted_environment_default_card_are_not_live(deps: &Deps) { + crate::repo::common::test_runtime_descendants_of_deleted_environment_default_card_are_not_live( + deps, + ) + .await; +} + +#[test] +async fn test_environment_deletion_revokes_component_card_runtime_descendants(deps: &Deps) { + crate::repo::common::test_environment_deletion_revokes_component_card_runtime_descendants(deps) + .await; +} + #[test] async fn test_environment_default_card_tracks_environment_rename(deps: &Deps) { crate::repo::common::test_environment_default_card_tracks_environment_rename(deps).await; @@ -195,8 +239,8 @@ async fn test_initial_permission_card_ids_by_account_are_unique(deps: &Deps) { } #[test] -async fn test_agent_initial_card_removed_from_current_component_is_not_live(deps: &Deps) { - crate::repo::common::test_agent_initial_card_removed_from_current_component_is_not_live(deps) +async fn test_agent_initial_card_from_older_component_revision_remains_live(deps: &Deps) { + crate::repo::common::test_agent_initial_card_from_older_component_revision_remains_live(deps) .await; } @@ -214,6 +258,12 @@ async fn test_deleted_component_agent_initial_card_is_not_reported_existing(deps .await; } +#[test] +async fn test_component_delete_does_not_revoke_reused_agent_initial_card_id(deps: &Deps) { + crate::repo::common::test_component_delete_does_not_revoke_reused_agent_initial_card_id(deps) + .await; +} + #[test] async fn test_initial_permission_card_ids_by_account_excludes_pre_recreate_revisions(deps: &Deps) { crate::repo::common::test_initial_permission_card_ids_by_account_excludes_pre_recreate_revisions( diff --git a/golem-schema/src/schema/canonical/mod.rs b/golem-schema/src/schema/canonical/mod.rs index e4cc5d8533..24defb9c5f 100644 --- a/golem-schema/src/schema/canonical/mod.rs +++ b/golem-schema/src/schema/canonical/mod.rs @@ -31,6 +31,7 @@ pub mod datetime; pub mod duration; pub mod error; pub mod path; +pub mod permission_card; pub mod quantity; pub mod quota_token; pub mod secret; diff --git a/golem-schema/src/schema/canonical/permission_card.rs b/golem-schema/src/schema/canonical/permission_card.rs new file mode 100644 index 0000000000..848a225e3f --- /dev/null +++ b/golem-schema/src/schema/canonical/permission_card.rs @@ -0,0 +1,294 @@ +// Copyright 2024-2026 Golem Cloud +// +// Licensed under the Golem Source License v1.1 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://license.golem.cloud/LICENSE +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Canonical encoding for [`PermissionCardValuePayload`]. +//! +//! - Text form: `permission-card:`, where `` +//! is the URL-safe-no-pad base64 encoding of the canonical JSON form's UTF-8 +//! bytes. +//! - JSON form: +//! ```json +//! { +//! "cardId": "", +//! "parentIds": ["", ...], +//! "expiresAt": "", +//! "polymorphic": true +//! } +//! ``` +//! `cardId` is the canonical hyphenated UUID string and is the only +//! authoritative identity field. `parentIds` defaults to an empty array when +//! absent. `expiresAt` is optional (absent means no expiry). `polymorphic` +//! defaults to `false` when absent. + +use crate::schema::canonical::datetime; +use crate::schema::canonical::error::ParseError; +use crate::schema::schema_value::PermissionCardValuePayload; +use base64::Engine; +use base64::engine::general_purpose::URL_SAFE_NO_PAD; +use serde_json::{Map, Value}; + +const TEXT_PREFIX: &str = "permission-card:"; + +const FIELD_CARD_ID: &str = "cardId"; +const FIELD_PARENT_IDS: &str = "parentIds"; +const FIELD_EXPIRES_AT: &str = "expiresAt"; +const FIELD_POLYMORPHIC: &str = "polymorphic"; + +pub fn to_text(payload: &PermissionCardValuePayload) -> Result { + let json = to_json(payload)?; + let body = serde_json::to_vec(&json).expect("serialise PermissionCard JSON"); + Ok(format!("{TEXT_PREFIX}{}", URL_SAFE_NO_PAD.encode(body))) +} + +pub fn from_text(s: &str) -> Result { + if s.is_empty() { + return Err(ParseError::Empty); + } + let rest = s + .strip_prefix(TEXT_PREFIX) + .ok_or_else(|| ParseError::BadFormat("missing 'permission-card:' prefix".into()))?; + if rest.is_empty() { + return Err(ParseError::Empty); + } + let bytes = URL_SAFE_NO_PAD + .decode(rest.as_bytes()) + .map_err(|e| ParseError::InvalidBase64(e.to_string()))?; + let json: Value = serde_json::from_slice(&bytes) + .map_err(|e| ParseError::BadFormat(format!("invalid JSON payload: {e}")))?; + from_json(&json) +} + +pub fn to_json(payload: &PermissionCardValuePayload) -> Result { + let mut obj = Map::new(); + obj.insert( + FIELD_CARD_ID.to_string(), + Value::String(payload.card_id.hyphenated().to_string()), + ); + obj.insert( + FIELD_PARENT_IDS.to_string(), + Value::Array( + payload + .parent_ids + .iter() + .map(|id| Value::String(id.hyphenated().to_string())) + .collect(), + ), + ); + if let Some(expires_at) = &payload.expires_at { + obj.insert( + FIELD_EXPIRES_AT.to_string(), + datetime::to_json(expires_at).map_err(|e| ParseError::Nested(Box::new(e)))?, + ); + } + obj.insert( + FIELD_POLYMORPHIC.to_string(), + Value::Bool(payload.polymorphic), + ); + Ok(Value::Object(obj)) +} + +pub fn from_json(value: &Value) -> Result { + let obj = value.as_object().ok_or(ParseError::TypeField { + expected: "object", + field: None, + })?; + for key in obj.keys() { + if ![ + FIELD_CARD_ID, + FIELD_PARENT_IDS, + FIELD_EXPIRES_AT, + FIELD_POLYMORPHIC, + ] + .contains(&key.as_str()) + { + return Err(ParseError::ExtraField(key.clone())); + } + } + let card_id = uuid::Uuid::parse_str( + obj.get(FIELD_CARD_ID) + .ok_or(ParseError::MissingField("cardId"))? + .as_str() + .ok_or(ParseError::TypeField { + expected: "string", + field: Some("cardId"), + })?, + ) + .map_err(|e| ParseError::BadFormat(format!("invalid UUID: {e}")))?; + let parent_ids = obj + .get(FIELD_PARENT_IDS) + .map(|v| { + v.as_array() + .ok_or(ParseError::TypeField { + expected: "array", + field: Some("parentIds"), + })? + .iter() + .map(|id| { + uuid::Uuid::parse_str(id.as_str().ok_or(ParseError::TypeField { + expected: "string", + field: Some("parentIds"), + })?) + .map_err(|e| ParseError::BadFormat(format!("invalid UUID: {e}"))) + }) + .collect::, _>>() + }) + .transpose()? + .unwrap_or_default(); + let expires_at = match obj.get(FIELD_EXPIRES_AT) { + Some(v) => Some(datetime::from_json(v).map_err(|e| ParseError::Nested(Box::new(e)))?), + None => None, + }; + let polymorphic = obj + .get(FIELD_POLYMORPHIC) + .map(|v| { + v.as_bool().ok_or(ParseError::TypeField { + expected: "boolean", + field: Some("polymorphic"), + }) + }) + .transpose()? + .unwrap_or(false); + Ok(PermissionCardValuePayload { + card_id, + parent_ids, + expires_at, + polymorphic, + }) +} + +#[cfg(test)] +mod tests { + use super::*; + use chrono::{DateTime, TimeZone, Utc}; + use proptest::prelude::*; + use test_r::test; + + fn datetime_strategy() -> impl Strategy> { + (0i64..253_402_214_400i64, 0u32..1_000_000_000).prop_map(|(s, n)| { + Utc.timestamp_opt(s, n) + .single() + .expect("strategy bounds keep timestamps valid") + }) + } + + fn payload_strategy() -> impl Strategy { + ( + any::(), + any::(), + proptest::collection::vec((any::(), any::()), 0..4), + proptest::option::of(datetime_strategy()), + any::(), + ) + .prop_map(|(hi, lo, parents, expires_at, polymorphic)| { + PermissionCardValuePayload { + card_id: uuid::Uuid::from_u64_pair(hi, lo), + parent_ids: parents + .into_iter() + .map(|(h, l)| uuid::Uuid::from_u64_pair(h, l)) + .collect(), + expires_at, + polymorphic, + } + }) + } + + proptest! { + #![proptest_config(ProptestConfig::with_cases(64))] + + #[test] + fn text_round_trip(p in payload_strategy()) { + let s = to_text(&p).expect("to_text"); + let back = from_text(&s).expect("from_text"); + prop_assert_eq!(back, p); + } + + #[test] + fn json_round_trip(p in payload_strategy()) { + let j = to_json(&p).expect("to_json"); + let back = from_json(&j).expect("from_json"); + prop_assert_eq!(back, p); + } + } + + #[test] + fn empty_text_rejected() { + assert_eq!(from_text(""), Err(ParseError::Empty)); + } + + #[test] + fn missing_prefix_rejected() { + assert!(matches!( + from_text("garbage"), + Err(ParseError::BadFormat(_)) + )); + } + + #[test] + fn prefix_only_rejected() { + assert_eq!(from_text("permission-card:"), Err(ParseError::Empty)); + } + + #[test] + fn json_wrong_type() { + assert_eq!( + from_json(&Value::String("x".into())), + Err(ParseError::TypeField { + expected: "object", + field: None, + }) + ); + } + + #[test] + fn json_missing_card_id() { + let v = serde_json::json!({ + "parentIds": [], + "polymorphic": false + }); + assert_eq!(from_json(&v), Err(ParseError::MissingField("cardId"))); + } + + #[test] + fn json_extra_field_rejected() { + let v = serde_json::json!({ + "cardId": "00000000-0000-0000-0000-000000000000", + "polymorphic": true, + "stowaway": 1 + }); + assert_eq!( + from_json(&v), + Err(ParseError::ExtraField("stowaway".into())) + ); + } + + #[test] + fn json_defaults_parent_ids_and_polymorphic() { + let v = serde_json::json!({ + "cardId": "00000000-0000-0000-0000-000000000000" + }); + let p = from_json(&v).expect("defaults"); + assert!(p.parent_ids.is_empty()); + assert!(!p.polymorphic); + assert!(p.expires_at.is_none()); + } + + #[test] + fn invalid_card_id_rejected() { + let v = serde_json::json!({ + "cardId": "not a uuid", + "polymorphic": false + }); + assert!(matches!(from_json(&v), Err(ParseError::BadFormat(_)))); + } +} diff --git a/golem-schema/src/schema/conversion.rs b/golem-schema/src/schema/conversion.rs index 5ff1b7c337..37201a34bb 100644 --- a/golem-schema/src/schema/conversion.rs +++ b/golem-schema/src/schema/conversion.rs @@ -460,6 +460,7 @@ pub fn value_kind(v: &SchemaValue) -> &'static str { SchemaValue::Union(_) => "union", SchemaValue::Secret(_) => "secret", SchemaValue::QuotaToken(_) => "quota-token", + SchemaValue::PermissionCard(_) => "permission-card", } } diff --git a/golem-schema/src/schema/graph.rs b/golem-schema/src/schema/graph.rs index ab8052aef0..d90586469e 100644 --- a/golem-schema/src/schema/graph.rs +++ b/golem-schema/src/schema/graph.rs @@ -379,7 +379,8 @@ fn collect_refs<'a>(ty: &'a SchemaType, out: &mut Vec<&'a TypeId>) { | SchemaType::Datetime { .. } | SchemaType::Duration { .. } | SchemaType::Quantity { .. } - | SchemaType::QuotaToken { .. } => {} + | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } => {} } } diff --git a/golem-schema/src/schema/host_managed.rs b/golem-schema/src/schema/host_managed.rs index 0f9e0f1746..119dec957c 100644 --- a/golem-schema/src/schema/host_managed.rs +++ b/golem-schema/src/schema/host_managed.rs @@ -36,6 +36,7 @@ use std::fmt; pub enum HostManagedKind { Secret, QuotaToken, + PermissionCard, } impl HostManagedKind { @@ -44,6 +45,7 @@ impl HostManagedKind { match ty { SchemaType::Secret { .. } => Some(Self::Secret), SchemaType::QuotaToken { .. } => Some(Self::QuotaToken), + SchemaType::PermissionCard { .. } => Some(Self::PermissionCard), _ => None, } } @@ -54,6 +56,7 @@ impl HostManagedKind { match value { SchemaValue::Secret(_) => Some(Self::Secret), SchemaValue::QuotaToken(_) => Some(Self::QuotaToken), + SchemaValue::PermissionCard(_) => Some(Self::PermissionCard), _ => None, } } @@ -63,6 +66,7 @@ impl HostManagedKind { match self { Self::Secret => "secret", Self::QuotaToken => "quota-token", + Self::PermissionCard => "permission-card", } } @@ -72,6 +76,7 @@ impl HostManagedKind { match self { Self::Secret => "", Self::QuotaToken => "", + Self::PermissionCard => "", } } } diff --git a/golem-schema/src/schema/mod.rs b/golem-schema/src/schema/mod.rs index b57421ad0f..04d6169b35 100644 --- a/golem-schema/src/schema/mod.rs +++ b/golem-schema/src/schema/mod.rs @@ -49,10 +49,12 @@ pub use host_managed::{HostManagedKind, RedactedSchemaValue, redacted_schema_val pub use metadata::{MetadataEnvelope, Role, TypeId}; pub use schema_type::{ BinaryRestrictions, DiscriminatorRule, FieldDiscriminator, NamedFieldType, PathDirection, - PathKind, PathSpec, QuantitySpec, QuantityValue, QuotaTokenSpec, ResultSpec, SchemaType, - SecretSpec, TextRestrictions, UnionBranch, UnionSpec, UrlRestrictions, VariantCaseType, + PathKind, PathSpec, PermissionCardSpec, QuantitySpec, QuantityValue, QuotaTokenSpec, + ResultSpec, SchemaType, SecretSpec, TextRestrictions, UnionBranch, UnionSpec, UrlRestrictions, + VariantCaseType, }; pub use schema_value::{ - BinaryValuePayload, DurationValuePayload, QuotaTokenValuePayload, ResultValuePayload, - SchemaValue, SecretValuePayload, TextValuePayload, UnionValuePayload, VariantValuePayload, + BinaryValuePayload, DurationValuePayload, PermissionCardValuePayload, QuotaTokenValuePayload, + ResultValuePayload, SchemaValue, SecretValuePayload, TextValuePayload, UnionValuePayload, + VariantValuePayload, }; diff --git a/golem-schema/src/schema/proptest_strategies.rs b/golem-schema/src/schema/proptest_strategies.rs index 2de8433809..41cfbfc4f8 100644 --- a/golem-schema/src/schema/proptest_strategies.rs +++ b/golem-schema/src/schema/proptest_strategies.rs @@ -29,12 +29,14 @@ use crate::schema::graph::{SchemaGraph, SchemaTypeDef, TypedSchemaValue}; use crate::schema::metadata::{MetadataEnvelope, Role, TypeId}; use crate::schema::schema_type::{ BinaryRestrictions, DiscriminatorRule, FieldDiscriminator, NamedFieldType, PathDirection, - PathKind, PathSpec, QuantitySpec, QuantityValue, QuotaTokenSpec, ResultSpec, SchemaType, - SecretSpec, TextRestrictions, UnionBranch, UnionSpec, UrlRestrictions, VariantCaseType, + PathKind, PathSpec, PermissionCardSpec, QuantitySpec, QuantityValue, QuotaTokenSpec, + ResultSpec, SchemaType, SecretSpec, TextRestrictions, UnionBranch, UnionSpec, UrlRestrictions, + VariantCaseType, }; use crate::schema::schema_value::{ - BinaryValuePayload, DurationValuePayload, QuotaTokenValuePayload, ResultValuePayload, - SchemaValue, SecretValuePayload, TextValuePayload, UnionValuePayload, VariantValuePayload, + BinaryValuePayload, DurationValuePayload, PermissionCardValuePayload, QuotaTokenValuePayload, + ResultValuePayload, SchemaValue, SecretValuePayload, TextValuePayload, UnionValuePayload, + VariantValuePayload, }; use chrono::{DateTime, TimeZone, Utc}; use proptest::collection::{hash_set, vec}; @@ -218,6 +220,10 @@ fn quota_token_spec() -> impl Strategy { option::of(ident_strategy()).prop_map(|resource_name| QuotaTokenSpec { resource_name }) } +fn permission_card_spec() -> impl Strategy { + any::().prop_map(|polymorphic| PermissionCardSpec { polymorphic }) +} + /// Generator for one [`SchemaType`] case at a chosen depth budget. /// /// `def_ids` is the set of `TypeId`s that may be referenced via @@ -254,6 +260,9 @@ fn leaf_schema_type_strategy(def_ids: Vec) -> BoxedStrategy quantity_spec().prop_map(SchemaType::quantity).boxed(), secret_spec().prop_map(SchemaType::secret).boxed(), quota_token_spec().prop_map(SchemaType::quota_token).boxed(), + permission_card_spec() + .prop_map(SchemaType::permission_card) + .boxed(), vec(ident_strategy(), 0..4) .prop_map(SchemaType::r#enum) .boxed(), @@ -349,23 +358,24 @@ fn composite_schema_type_strategy( // --- Schema-value strategies --- pub fn schema_value_strategy() -> impl Strategy { - let leaf = leaf_schema_value_strategy_impl(true, true); + let leaf = leaf_schema_value_strategy_impl(true, true, true); leaf.prop_recursive(4, 32, 4, composite_schema_value_strategy) } /// Like [`schema_value_strategy`] but never produces host-managed capability values. /// -/// Quota tokens and secrets travel across the WASM boundary only as opaque owned -/// handles, so they cannot round-trip through the pure (resolver-less) WIT -/// codec. Use this strategy for tests of that pure path. +/// Quota tokens, secrets, and permission cards travel across the WASM boundary +/// only as opaque owned handles, so they cannot round-trip through the pure +/// (resolver-less) WIT codec. Use this strategy for tests of that pure path. pub fn transportable_schema_value_strategy() -> impl Strategy { - let leaf = leaf_schema_value_strategy_impl(false, false); + let leaf = leaf_schema_value_strategy_impl(false, false, false); leaf.prop_recursive(4, 32, 4, composite_schema_value_strategy) } fn leaf_schema_value_strategy_impl( include_quota: bool, include_secret: bool, + include_permission_card: bool, ) -> BoxedStrategy { let mut leaves = vec![base_leaf_schema_value_strategy()]; if include_secret { @@ -374,6 +384,9 @@ fn leaf_schema_value_strategy_impl( if include_quota { leaves.push(quota_token_value_strategy()); } + if include_permission_card { + leaves.push(permission_card_value_strategy()); + } prop::strategy::Union::new(leaves).boxed() } @@ -460,6 +473,24 @@ fn quota_token_value_strategy() -> BoxedStrategy { .boxed() } +fn permission_card_value_strategy() -> BoxedStrategy { + ( + any::(), + vec(any::(), 0..4), + option::of(datetime_strategy()), + any::(), + ) + .prop_map(|(card_id, parent_ids, expires_at, polymorphic)| { + SchemaValue::PermissionCard(PermissionCardValuePayload { + card_id: uuid::Uuid::from_u128(card_id), + parent_ids: parent_ids.into_iter().map(uuid::Uuid::from_u128).collect(), + expires_at, + polymorphic, + }) + }) + .boxed() +} + fn composite_schema_value_strategy( inner: BoxedStrategy, ) -> BoxedStrategy { @@ -544,8 +575,9 @@ pub fn typed_schema_value_strategy() -> impl Strategy .prop_map(|(graph, value)| TypedSchemaValue::new(graph, value)) } -/// Like [`typed_schema_value_strategy`] but never produces a quota token in the -/// value tree, so it round-trips through the pure (resolver-less) WIT codec. +/// Like [`typed_schema_value_strategy`] but never produces a host-managed +/// capability in the value tree, so it round-trips through the pure +/// (resolver-less) WIT codec. pub fn transportable_typed_schema_value_strategy() -> impl Strategy { ( schema_graph_strategy(), diff --git a/golem-schema/src/schema/protobuf.rs b/golem-schema/src/schema/protobuf.rs index 4eafeaa3cd..e4abed5169 100644 --- a/golem-schema/src/schema/protobuf.rs +++ b/golem-schema/src/schema/protobuf.rs @@ -20,13 +20,14 @@ use crate::schema::graph::{SchemaGraph, SchemaTypeDef, TypedSchemaValue}; use crate::schema::metadata::{MetadataEnvelope, Role, TypeId}; use crate::schema::schema_type::{ BinaryRestrictions, DiscriminatorRule, FieldDiscriminator, NamedFieldType, NumericBound, - NumericRestrictions, PathDirection, PathKind, PathSpec, QuantitySpec, QuantityValue, - QuotaTokenSpec, ResultSpec, SchemaType, SecretSpec, TextRestrictions, UnionBranch, UnionSpec, - UrlRestrictions, VariantCaseType, + NumericRestrictions, PathDirection, PathKind, PathSpec, PermissionCardSpec, QuantitySpec, + QuantityValue, QuotaTokenSpec, ResultSpec, SchemaType, SecretSpec, TextRestrictions, + UnionBranch, UnionSpec, UrlRestrictions, VariantCaseType, }; use crate::schema::schema_value::{ - BinaryValuePayload, DurationValuePayload, QuotaTokenValuePayload, ResultValuePayload, - SchemaValue, SecretValuePayload, TextValuePayload, UnionValuePayload, VariantValuePayload, + BinaryValuePayload, DurationValuePayload, PermissionCardValuePayload, QuotaTokenValuePayload, + ResultValuePayload, SchemaValue, SecretValuePayload, TextValuePayload, UnionValuePayload, + VariantValuePayload, }; use chrono::{DateTime, TimeZone, Utc}; use golem_api_grpc::proto::golem::common::Empty as ProtoEmpty; @@ -263,6 +264,7 @@ impl From for proto::SchemaType { SchemaType::Union { spec, .. } => Body::UnionType(spec.into()), SchemaType::Secret { spec, .. } => Body::SecretType(Box::new(spec.into())), SchemaType::QuotaToken { spec, .. } => Body::QuotaTokenType(spec.into()), + SchemaType::PermissionCard { spec, .. } => Body::PermissionCardType(spec.into()), SchemaType::Future { inner, .. } => Body::FutureType(Box::new(proto::WasiStubType { element: opt_box_to_proto(inner), })), @@ -424,6 +426,10 @@ impl TryFrom for SchemaType { spec: q.into(), metadata, }, + Body::PermissionCardType(p) => SchemaType::PermissionCard { + spec: p.into(), + metadata, + }, Body::FutureType(w) => SchemaType::Future { inner: opt_box_from_proto(w.element)?, metadata, @@ -746,6 +752,22 @@ impl From for QuotaTokenSpec { } } +impl From for proto::PermissionCardSpec { + fn from(value: PermissionCardSpec) -> Self { + Self { + polymorphic: value.polymorphic, + } + } +} + +impl From for PermissionCardSpec { + fn from(value: proto::PermissionCardSpec) -> Self { + Self { + polymorphic: value.polymorphic, + } + } +} + // --- discriminated union ----------------------------------------------------- impl From for proto::UnionSpec { @@ -1001,6 +1023,14 @@ impl From for proto::SchemaValue { last_credit: q.last_credit, last_credit_at: Some(datetime_to_proto(q.last_credit_at)), }), + SchemaValue::PermissionCard(p) => { + ValueBody::PermissionCardValue(proto::PermissionCardValue { + card_id: Some(p.card_id.into()), + parent_ids: p.parent_ids.into_iter().map(Into::into).collect(), + expires_at: p.expires_at.map(datetime_to_proto), + polymorphic: p.polymorphic, + }) + } }; Self { value: Some(body) } } @@ -1137,6 +1167,20 @@ impl TryFrom for SchemaValue { })?, )?, }), + ValueBody::PermissionCardValue(p) => { + SchemaValue::PermissionCard(PermissionCardValuePayload { + card_id: p + .card_id + .ok_or_else(|| "Missing field: PermissionCardValue.card_id".to_string())? + .into(), + parent_ids: p.parent_ids.into_iter().map(Into::into).collect(), + expires_at: match p.expires_at { + Some(d) => Some(datetime_from_proto(d)?), + None => None, + }, + polymorphic: p.polymorphic, + }) + } }; Ok(result) } diff --git a/golem-schema/src/schema/schema_type.rs b/golem-schema/src/schema/schema_type.rs index d374481eaf..05c20c9a4c 100644 --- a/golem-schema/src/schema/schema_type.rs +++ b/golem-schema/src/schema/schema_type.rs @@ -274,6 +274,11 @@ pub enum SchemaType { #[serde(default, skip_serializing_if = "MetadataEnvelope::is_empty")] metadata: MetadataEnvelope, }, + PermissionCard { + spec: PermissionCardSpec, + #[serde(default, skip_serializing_if = "MetadataEnvelope::is_empty")] + metadata: MetadataEnvelope, + }, // WASI P3 stubs (parseable only; no semantics yet). Future { @@ -327,6 +332,7 @@ impl SchemaType { | SchemaType::Union { metadata, .. } | SchemaType::Secret { metadata, .. } | SchemaType::QuotaToken { metadata, .. } + | SchemaType::PermissionCard { metadata, .. } | SchemaType::Future { metadata, .. } | SchemaType::Stream { metadata, .. } => metadata, } @@ -369,6 +375,7 @@ impl SchemaType { | SchemaType::Union { metadata, .. } | SchemaType::Secret { metadata, .. } | SchemaType::QuotaToken { metadata, .. } + | SchemaType::PermissionCard { metadata, .. } | SchemaType::Future { metadata, .. } | SchemaType::Stream { metadata, .. } => metadata, } @@ -621,6 +628,12 @@ impl SchemaType { metadata: MetadataEnvelope::default(), } } + pub fn permission_card(spec: PermissionCardSpec) -> Self { + Self::PermissionCard { + spec, + metadata: MetadataEnvelope::default(), + } + } pub fn future(inner: Option) -> Self { Self::Future { inner: inner.map(Box::new), @@ -1257,6 +1270,22 @@ pub struct QuotaTokenSpec { pub resource_name: Option, } +/// Spec for a [`SchemaType::PermissionCard`] capability node. +/// +/// Mirrors the WIT `permission-card-spec { polymorphic: bool }` record: a +/// permission-card is an opaque, unforgeable handle whose only static trait +/// visible to schema consumers is whether it is polymorphic (can spawn scoped +/// child cards at runtime). +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, IntoSchema, FromSchema)] +#[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] +#[cfg_attr(feature = "full", desert(evolution()))] +#[serde(rename_all = "camelCase")] +#[cfg_attr(feature = "full", derive(golem_schema_derive::PoemSchema))] +pub struct PermissionCardSpec { + /// Whether cards of this type may spawn scoped child cards at runtime. + pub polymorphic: bool, +} + #[cfg(test)] mod numeric_restriction_tests { use super::*; diff --git a/golem-schema/src/schema/schema_value.rs b/golem-schema/src/schema/schema_value.rs index 4e6c4a0564..28ab1c0a8e 100644 --- a/golem-schema/src/schema/schema_value.rs +++ b/golem-schema/src/schema/schema_value.rs @@ -52,6 +52,28 @@ pub type QuotaTokenVariantValue = QuotaTokenValuePayload; #[cfg(all(feature = "guest", not(feature = "host")))] pub type QuotaTokenVariantValue = crate::schema::wit::GuestQuotaTokenHandle; +/// The payload carried by [`SchemaValue::PermissionCard`]. +/// +/// A permission-card is an opaque, unforgeable capability, exactly like a +/// secret or quota-token. The representation differs by build target: +/// +/// - On the host (and in feature-neutral builds) it is the trusted internal +/// snapshot [`PermissionCardValuePayload`], converted to/from an owned +/// `permission-card` handle by a `PermissionCardResolver` at the WIT +/// boundary. The `card_id` field is the only authoritative identity; the +/// other fields are trusted cache verified against the card store. +/// - On a guest it is an opaque, affine, take-once owned handle +/// ([`crate::schema::wit::GuestPermissionCardHandle`]) that the guest can +/// only hold and transfer, never read. +#[cfg(not(all(feature = "guest", not(feature = "host"))))] +pub type PermissionCardVariantValue = PermissionCardValuePayload; + +/// The payload carried by [`SchemaValue::PermissionCard`] on a guest: an +/// opaque, affine owned handle. See [`PermissionCardVariantValue`] (host +/// build) for details. +#[cfg(all(feature = "guest", not(feature = "host")))] +pub type PermissionCardVariantValue = crate::schema::wit::GuestPermissionCardHandle; + /// One node in the recursive in-memory schema-value tree. /// /// Always travels paired with a [`super::SchemaGraph`] (see @@ -132,6 +154,7 @@ pub enum SchemaValue { // Capability nodes Secret(SecretVariantValue), QuotaToken(QuotaTokenVariantValue), + PermissionCard(PermissionCardVariantValue), } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, IntoSchema, FromSchema)] @@ -245,3 +268,36 @@ pub struct QuotaTokenValuePayload { pub last_credit: i64, pub last_credit_at: DateTime, } + +/// Capability value: the trusted internal/persistent representation of a +/// permission-card, held only inside `SchemaValue::PermissionCard`. Across a +/// WIT boundary the card travels as an opaque, unforgeable owned handle +/// (`permission-card-handle(own)`); the host converts between +/// this snapshot and a handle through a resolver and the receiver re-acquires +/// the live card against `card_id` on demand. This snapshot is never exposed +/// to or constructible by a guest. +/// +/// Only `card_id` is authoritative identity. The remaining fields are trusted +/// cache verified against the card store on the host side; receivers must not +/// treat them as proof of authorization, only as a hint of the card's last +/// known shape. +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, IntoSchema, FromSchema)] +#[cfg_attr(feature = "full", derive(desert_rust::BinaryCodec))] +#[cfg_attr(feature = "full", desert(evolution()))] +#[serde(rename_all = "camelCase")] +#[cfg_attr(feature = "full", derive(golem_schema_derive::PoemSchema))] +pub struct PermissionCardValuePayload { + /// Authoritative identity of the card. Survives serialization and is the + /// only field a receiver may trust without re-validation. + pub card_id: uuid::Uuid, + /// Direct parents in the permission DAG. Order is not significant. Trusted + /// cache only; receivers re-validate by walking the live card store. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub parent_ids: Vec, + /// Absolute expiry of the card, if any. Trusted cache only. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub expires_at: Option>, + /// Whether the card is polymorphic (can spawn scoped child cards). Trusted + /// cache only; the live card store is the source of truth. + pub polymorphic: bool, +} diff --git a/golem-schema/src/schema/validation/subtyping.rs b/golem-schema/src/schema/validation/subtyping.rs index 7855c917af..36d7a8dd8e 100644 --- a/golem-schema/src/schema/validation/subtyping.rs +++ b/golem-schema/src/schema/validation/subtyping.rs @@ -280,6 +280,10 @@ fn assignable( a.category == b.category && assignable(graph, &a.inner, &b.inner, visited) } (SchemaType::QuotaToken { spec: a, .. }, SchemaType::QuotaToken { spec: b, .. }) => a == b, + ( + SchemaType::PermissionCard { spec: a, .. }, + SchemaType::PermissionCard { spec: b, .. }, + ) => a == b, // Unions: exact match by tag set and per-branch body assignability. (SchemaType::Union { spec: a, .. }, SchemaType::Union { spec: b, .. }) => { @@ -570,6 +574,10 @@ fn equivalent( a.category == b.category && equivalent(graph_a, &a.inner, graph_b, &b.inner, visited) } (SchemaType::QuotaToken { spec: a, .. }, SchemaType::QuotaToken { spec: b, .. }) => a == b, + ( + SchemaType::PermissionCard { spec: a, .. }, + SchemaType::PermissionCard { spec: b, .. }, + ) => a == b, // Unions: exact tag set, matching discriminators and equivalent bodies. (SchemaType::Union { spec: a, .. }, SchemaType::Union { spec: b, .. }) => { diff --git a/golem-schema/src/schema/validation/tests/subtyping_tests.rs b/golem-schema/src/schema/validation/tests/subtyping_tests.rs index 235aa8c0a8..bbe091981b 100644 --- a/golem-schema/src/schema/validation/tests/subtyping_tests.rs +++ b/golem-schema/src/schema/validation/tests/subtyping_tests.rs @@ -16,8 +16,8 @@ use super::wellformed_strategy::wellformed_schema_graph_strategy; use crate::schema::graph::{SchemaGraph, SchemaTypeDef}; use crate::schema::metadata::TypeId; use crate::schema::schema_type::{ - BinaryRestrictions, NamedFieldType, NumericBound, NumericRestrictions, QuantitySpec, - QuantityValue, SchemaType, TextRestrictions, UrlRestrictions, VariantCaseType, + BinaryRestrictions, NamedFieldType, NumericBound, NumericRestrictions, PermissionCardSpec, + QuantitySpec, QuantityValue, SchemaType, TextRestrictions, UrlRestrictions, VariantCaseType, }; use crate::schema::validation::subtyping::{is_assignable, is_equivalent_cross_graph}; use proptest::prelude::*; @@ -282,6 +282,42 @@ fn primitive_kind_mismatch_rejected() { )); } +#[test] +fn permission_card_polymorphism_is_invariant() { + let monomorphic = SchemaType::permission_card(PermissionCardSpec { polymorphic: false }); + let polymorphic = SchemaType::permission_card(PermissionCardSpec { polymorphic: true }); + let monomorphic_graph = SchemaGraph::anonymous(monomorphic.clone()); + let polymorphic_graph = SchemaGraph::anonymous(polymorphic.clone()); + + assert!(is_assignable( + &monomorphic_graph, + &monomorphic, + &monomorphic + )); + assert!(!is_assignable( + &monomorphic_graph, + &monomorphic, + &polymorphic + )); + assert!(!is_assignable( + &monomorphic_graph, + &polymorphic, + &monomorphic + )); + assert!(is_equivalent_cross_graph( + &monomorphic_graph, + &monomorphic, + &monomorphic_graph, + &monomorphic + )); + assert!(!is_equivalent_cross_graph( + &monomorphic_graph, + &monomorphic, + &polymorphic_graph, + &polymorphic + )); +} + #[test] fn quantity_suffix_subset_is_enforced() { let graph = SchemaGraph::anonymous(SchemaType::bool()); diff --git a/golem-schema/src/schema/validation/tests/value_tests.rs b/golem-schema/src/schema/validation/tests/value_tests.rs index ea78ac9ea5..9e7a713a73 100644 --- a/golem-schema/src/schema/validation/tests/value_tests.rs +++ b/golem-schema/src/schema/validation/tests/value_tests.rs @@ -17,13 +17,14 @@ use crate::schema::graph::{SchemaGraph, SchemaTypeDef}; use crate::schema::metadata::TypeId; use crate::schema::schema_type::{ BinaryRestrictions, DiscriminatorRule, NamedFieldType, NumericBound, NumericRestrictions, - PathDirection, PathKind, PathSpec, QuantitySpec, QuantityValue, QuotaTokenSpec, ResultSpec, - SchemaType, SecretSpec, TextRestrictions, UnionBranch, UnionSpec, UrlRestrictions, - VariantCaseType, + PathDirection, PathKind, PathSpec, PermissionCardSpec, QuantitySpec, QuantityValue, + QuotaTokenSpec, ResultSpec, SchemaType, SecretSpec, TextRestrictions, UnionBranch, UnionSpec, + UrlRestrictions, VariantCaseType, }; use crate::schema::schema_value::{ - BinaryValuePayload, DurationValuePayload, QuotaTokenValuePayload, ResultValuePayload, - SchemaValue, SecretValuePayload, TextValuePayload, UnionValuePayload, VariantValuePayload, + BinaryValuePayload, DurationValuePayload, PermissionCardValuePayload, QuotaTokenValuePayload, + ResultValuePayload, SchemaValue, SecretValuePayload, TextValuePayload, UnionValuePayload, + VariantValuePayload, }; use crate::schema::validation::subtyping::is_assignable; use crate::schema::validation::value::{ @@ -1249,3 +1250,31 @@ fn numeric_inverted_min_max_is_rejected() { "expected NumericOutOfRange, got {errors:?}" ); } + +#[test] +fn permission_card_polymorphism_is_validated() { + let ty = SchemaType::permission_card(PermissionCardSpec { polymorphic: true }); + let graph = SchemaGraph::anonymous(ty.clone()); + let matching = SchemaValue::PermissionCard(PermissionCardValuePayload { + card_id: uuid::Uuid::from_u128(1), + parent_ids: vec![uuid::Uuid::from_u128(2)], + expires_at: None, + polymorphic: true, + }); + validate_value(&graph, &ty, &matching).expect("matching permission-card must pass"); + + let SchemaValue::PermissionCard(mut payload) = matching else { + unreachable!() + }; + payload.polymorphic = false; + let errors = validate_value(&graph, &ty, &SchemaValue::PermissionCard(payload)) + .expect_err("mismatched permission-card must fail"); + assert!(errors.iter().any(|error| matches!( + error, + ValueError::PermissionCardPolymorphicMismatch { + expected: true, + found: false, + .. + } + ))); +} diff --git a/golem-schema/src/schema/validation/value.rs b/golem-schema/src/schema/validation/value.rs index 8e24cf6398..0e5f00873b 100644 --- a/golem-schema/src/schema/validation/value.rs +++ b/golem-schema/src/schema/validation/value.rs @@ -30,9 +30,9 @@ use crate::schema::schema_value::{ // Only the host (and feature-neutral) build inspects a quota-token's snapshot // fields; on a guest the value is an opaque owned handle. #[cfg(not(all(feature = "guest", not(feature = "host"))))] -use crate::schema::schema_type::{QuotaTokenSpec, SecretSpec}; +use crate::schema::schema_type::{PermissionCardSpec, QuotaTokenSpec, SecretSpec}; #[cfg(not(all(feature = "guest", not(feature = "host"))))] -use crate::schema::schema_value::QuotaTokenValuePayload; +use crate::schema::schema_value::{PermissionCardValuePayload, QuotaTokenValuePayload}; use std::cmp::Ordering; use std::error::Error; use std::fmt::{self, Display, Formatter, Write}; @@ -256,6 +256,11 @@ pub enum ValueError { expected: String, found: String, }, + PermissionCardPolymorphicMismatch { + path: ValuePath, + expected: bool, + found: bool, + }, } #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -450,6 +455,14 @@ impl Display for ValueError { f, "quota-token value at {path} expected resource `{expected}`, found `{found}`" ), + ValueError::PermissionCardPolymorphicMismatch { + path, + expected, + found, + } => write!( + f, + "permission-card value at {path} expected polymorphic `{expected}`, found `{found}`" + ), } } } @@ -557,6 +570,7 @@ fn shape_name(value: &SchemaValue) -> &'static str { SchemaValue::Union(_) => "union", SchemaValue::Secret(_) => "secret", SchemaValue::QuotaToken(_) => "quota-token", + SchemaValue::PermissionCard(_) => "permission-card", } } @@ -596,6 +610,7 @@ fn type_name(ty: &SchemaType) -> &'static str { SchemaType::Union { .. } => "union", SchemaType::Secret { .. } => "secret", SchemaType::QuotaToken { .. } => "quota-token", + SchemaType::PermissionCard { .. } => "permission-card", SchemaType::Future { .. } => "future", SchemaType::Stream { .. } => "stream", } @@ -813,6 +828,15 @@ fn check<'a>( #[cfg(all(feature = "guest", not(feature = "host")))] let _ = (spec, payload); } + (SchemaType::PermissionCard { spec, .. }, SchemaValue::PermissionCard(payload)) => { + #[cfg(not(all(feature = "guest", not(feature = "host"))))] + check_permission_card(spec, payload, path, errors); + // On a guest the permission-card value is an opaque owned handle + // with no readable fields; the polymorphic constraint is enforced + // host-side when the handle is lifted to its trusted snapshot. + #[cfg(all(feature = "guest", not(feature = "host")))] + let _ = (spec, payload); + } (SchemaType::Record { fields, .. }, SchemaValue::Record { fields: vs }) => { if fields.len() != vs.len() { @@ -1312,6 +1336,22 @@ fn check_quota_token( } } +#[cfg(not(all(feature = "guest", not(feature = "host"))))] +fn check_permission_card( + spec: &PermissionCardSpec, + payload: &PermissionCardValuePayload, + path: &mut ValuePath, + errors: &mut Vec, +) { + if spec.polymorphic != payload.polymorphic { + errors.push(ValueError::PermissionCardPolymorphicMismatch { + path: path.snapshot(), + expected: spec.polymorphic, + found: payload.polymorphic, + }); + } +} + fn discriminator_matches(index: &GraphIndex, branch: &UnionBranch, body: &SchemaValue) -> bool { match &branch.discriminator { DiscriminatorRule::Prefix { prefix } => string_view(index, &branch.body, body) diff --git a/golem-schema/src/schema/validation/well_formedness.rs b/golem-schema/src/schema/validation/well_formedness.rs index 3fc78be064..caef129ff1 100644 --- a/golem-schema/src/schema/validation/well_formedness.rs +++ b/golem-schema/src/schema/validation/well_formedness.rs @@ -436,7 +436,8 @@ fn check_type( | SchemaType::String { .. } | SchemaType::Datetime { .. } | SchemaType::Duration { .. } - | SchemaType::QuotaToken { .. } => {} + | SchemaType::QuotaToken { .. } + | SchemaType::PermissionCard { .. } => {} } } diff --git a/golem-schema/src/schema/wit/decode.rs b/golem-schema/src/schema/wit/decode.rs index 8343b70300..fa26d65dc5 100644 --- a/golem-schema/src/schema/wit/decode.rs +++ b/golem-schema/src/schema/wit/decode.rs @@ -17,13 +17,14 @@ use crate::schema::graph::{SchemaGraph, SchemaTypeDef, TypedSchemaValue}; use crate::schema::metadata::{MetadataEnvelope, Role, TypeId}; use crate::schema::schema_type::{ BinaryRestrictions, DiscriminatorRule, FieldDiscriminator, NamedFieldType, NumericBound, - NumericRestrictions, PathDirection, PathKind, PathSpec, QuantitySpec, QuantityValue, - QuotaTokenSpec, ResultSpec, SchemaType, SecretSpec, TextRestrictions, UnionBranch, UnionSpec, - UrlRestrictions, VariantCaseType, + NumericRestrictions, PathDirection, PathKind, PathSpec, PermissionCardSpec, QuantitySpec, + QuantityValue, QuotaTokenSpec, ResultSpec, SchemaType, SecretSpec, TextRestrictions, + UnionBranch, UnionSpec, UrlRestrictions, VariantCaseType, }; use crate::schema::schema_value::{ - BinaryValuePayload, DurationValuePayload, QuotaTokenVariantValue, ResultValuePayload, - SchemaValue, SecretVariantValue, TextValuePayload, UnionValuePayload, VariantValuePayload, + BinaryValuePayload, DurationValuePayload, PermissionCardVariantValue, QuotaTokenVariantValue, + ResultValuePayload, SchemaValue, SecretVariantValue, TextValuePayload, UnionValuePayload, + VariantValuePayload, }; use chrono::{DateTime, TimeZone, Utc}; use std::collections::HashSet; @@ -43,6 +44,13 @@ type WireSecretHandle = wasmtime::component::Resource; #[cfg(all(feature = "guest", not(feature = "host")))] type WireSecretHandle = wire::Secret; +/// The owned handle type carried by +/// `wire::SchemaValueNode::PermissionCardHandle`. +#[cfg(all(feature = "host", not(feature = "guest")))] +type WirePermissionCardHandle = wasmtime::component::Resource; +#[cfg(all(feature = "guest", not(feature = "host")))] +type WirePermissionCardHandle = wire::PermissionCard; + /// Errors that can occur while decoding the flat wire form into the /// recursive in-memory representation. #[derive(Debug, Clone, PartialEq, Eq)] @@ -92,6 +100,21 @@ pub enum DecodeError { /// does not permit secret transport. The handle is dropped from the resource /// table before this error is returned, so nothing leaks. SecretNotPermitted(wire::ValueNodeIndex), + /// A `permission-card-handle` node was encountered while decoding through + /// the pure (resolver-less) path. Owned permission-card handles can only be + /// lifted on the host via [`decode_value_with`] and a + /// `PermissionCardResolver`. + PermissionCardRequiresResolver, + /// An owned `permission-card` handle was present in the value tree but + /// never reached from the root. + UnconsumedPermissionCardHandle(wire::ValueNodeIndex), + /// The host `PermissionCardResolver` failed to snapshot an owned handle. + PermissionCardResolver(String), + /// An owned `permission-card` handle was present in a value tree at a + /// boundary that does not permit permission-card transport. The handle is + /// dropped from the resource table before this error is returned, so + /// nothing leaks. + PermissionCardNotPermitted(wire::ValueNodeIndex), } impl Display for DecodeError { @@ -142,6 +165,25 @@ impl Display for DecodeError { DecodeError::SecretNotPermitted(i) => { write!(f, "secret handle not permitted at this boundary: {i}") } + DecodeError::PermissionCardRequiresResolver => write!( + f, + "permission-card handles can only be decoded through the host resolver-aware path" + ), + DecodeError::UnconsumedPermissionCardHandle(i) => { + write!( + f, + "permission-card handle not referenced from the root: {i}" + ) + } + DecodeError::PermissionCardResolver(msg) => { + write!(f, "permission-card handle could not be resolved: {msg}") + } + DecodeError::PermissionCardNotPermitted(i) => { + write!( + f, + "permission-card handle not permitted at this boundary: {i}" + ) + } } } } @@ -240,6 +282,7 @@ pub fn decode_value(wire_tree: wire::SchemaValueTree) -> Result Err(e), }; @@ -260,6 +303,11 @@ pub fn decode_value(wire_tree: wire::SchemaValueTree) -> Result { + leaked.get_or_insert(DecodeError::UnconsumedPermissionCardHandle( + i as wire::ValueNodeIndex, + )); + } other => *slot = other, } } @@ -550,6 +598,12 @@ impl<'a> GraphCtx<'a> { }, metadata, }, + wire::SchemaTypeBody::PermissionCardType(p) => SchemaType::PermissionCard { + spec: PermissionCardSpec { + polymorphic: p.polymorphic, + }, + metadata, + }, wire::SchemaTypeBody::FutureType(inner) => { let inner = match inner { Some(i) => Some(Box::new(self.decode_type(*i, visiting)?)), @@ -709,6 +763,9 @@ fn decode_value_node( wire::SchemaValueNode::QuotaTokenHandle(_) => { return Err(DecodeError::QuotaTokenRequiresResolver); } + wire::SchemaValueNode::PermissionCardHandle(_) => { + return Err(DecodeError::PermissionCardRequiresResolver); + } }; Ok(out) } @@ -729,7 +786,9 @@ fn decode_value_node( /// [`DecodeError::UnconsumedQuotaTokenHandle`]. The same cleanup runs when /// decoding fails partway through. #[cfg(all(feature = "host", not(feature = "guest")))] -pub fn decode_value_with( +pub fn decode_value_with< + R: super::QuotaTokenResolver + super::SecretResolver + super::PermissionCardResolver, +>( wire_tree: wire::SchemaValueTree, resolver: &mut R, ) -> Result { @@ -757,6 +816,12 @@ pub fn decode_value_with( .snapshot_secret_handle(handle) .map_err(|e| DecodeError::SecretResolver(e.to_string())) }, + &mut |handle| { + let mut resolver = resolver.borrow_mut(); + resolver + .snapshot_permission_card_handle(handle) + .map_err(|e| DecodeError::PermissionCardResolver(e.to_string())) + }, ), Err(e) => Err(e), }; @@ -779,6 +844,12 @@ pub fn decode_value_with( i as wire::ValueNodeIndex, )); } + Some(wire::SchemaValueNode::PermissionCardHandle(handle)) => { + super::PermissionCardResolver::drop_permission_card_handle(&mut **resolver, handle); + leaked.get_or_insert(DecodeError::UnconsumedPermissionCardHandle( + i as wire::ValueNodeIndex, + )); + } other => *slot = other, } } @@ -789,20 +860,22 @@ pub fn decode_value_with( } } -/// Drain every owned `quota-token` handle out of an owned value tree at a -/// boundary that does **not** permit quota tokens. +/// Drain every owned capability handle (quota-token, secret, permission-card) +/// out of an owned value tree at a boundary that does **not** permit any of +/// them. /// /// The tree is consumed because the owned handles it carries were already /// transferred into the host resource table at the WIT boundary; each must be -/// deleted exactly once. Every handle node is dropped via -/// [`super::QuotaTokenHandleDropper`], regardless of where it sits in the tree -/// (including unreferenced nodes), so nothing leaks. If any handle was present -/// the tree is rejected with [`DecodeError::QuotaTokenNotPermitted`]; otherwise -/// the handle-free tree is returned unchanged so the caller can decode it with -/// the pure path. +/// deleted exactly once. Every handle node is dropped via the corresponding +/// dropper, regardless of where it sits in the tree (including unreferenced +/// nodes), so nothing leaks. If any handle was present the tree is rejected +/// with the appropriate `*NotPermitted` error; otherwise the handle-free tree +/// is returned unchanged so the caller can decode it with the pure path. #[cfg(all(feature = "host", not(feature = "guest")))] pub fn reject_quota_handles_in_value_tree< - D: super::QuotaTokenHandleDropper + super::SecretHandleDropper, + D: super::QuotaTokenHandleDropper + + super::SecretHandleDropper + + super::PermissionCardHandleDropper, >( mut wire_tree: wire::SchemaValueTree, dropper: &mut D, @@ -811,6 +884,7 @@ pub fn reject_quota_handles_in_value_tree< for (i, node) in wire_tree.value_nodes.iter_mut().enumerate() { if matches!(node, wire::SchemaValueNode::QuotaTokenHandle(_)) || matches!(node, wire::SchemaValueNode::SecretValue(_)) + || matches!(node, wire::SchemaValueNode::PermissionCardHandle(_)) { // Replace the handle node with a placeholder so the `Resource` can be // moved out and deleted from the table. The tree is rejected below, @@ -828,6 +902,12 @@ pub fn reject_quota_handles_in_value_tree< first_error .get_or_insert(DecodeError::SecretNotPermitted(i as wire::ValueNodeIndex)); } + wire::SchemaValueNode::PermissionCardHandle(handle) => { + dropper.drop_permission_card_handle(handle); + first_error.get_or_insert(DecodeError::PermissionCardNotPermitted( + i as wire::ValueNodeIndex, + )); + } _ => unreachable!(), } } @@ -840,7 +920,21 @@ pub fn reject_quota_handles_in_value_tree< #[cfg(all(feature = "host", not(feature = "guest")))] pub fn reject_secret_handles_in_value_tree< - D: super::QuotaTokenHandleDropper + super::SecretHandleDropper, + D: super::QuotaTokenHandleDropper + + super::SecretHandleDropper + + super::PermissionCardHandleDropper, +>( + wire_tree: wire::SchemaValueTree, + dropper: &mut D, +) -> Result { + reject_quota_handles_in_value_tree(wire_tree, dropper) +} + +#[cfg(all(feature = "host", not(feature = "guest")))] +pub fn reject_permission_card_handles_in_value_tree< + D: super::QuotaTokenHandleDropper + + super::SecretHandleDropper + + super::PermissionCardHandleDropper, >( wire_tree: wire::SchemaValueTree, dropper: &mut D, @@ -855,7 +949,9 @@ pub fn reject_secret_handles_in_value_tree< /// cannot leak a handle by smuggling one into a reject-only position. #[cfg(all(feature = "host", not(feature = "guest")))] pub fn decode_value_rejecting_quota_with< - D: super::QuotaTokenHandleDropper + super::SecretHandleDropper, + D: super::QuotaTokenHandleDropper + + super::SecretHandleDropper + + super::PermissionCardHandleDropper, >( wire_tree: wire::SchemaValueTree, dropper: &mut D, @@ -866,7 +962,21 @@ pub fn decode_value_rejecting_quota_with< #[cfg(all(feature = "host", not(feature = "guest")))] pub fn decode_value_rejecting_secret_with< - D: super::QuotaTokenHandleDropper + super::SecretHandleDropper, + D: super::QuotaTokenHandleDropper + + super::SecretHandleDropper + + super::PermissionCardHandleDropper, +>( + wire_tree: wire::SchemaValueTree, + dropper: &mut D, +) -> Result { + decode_value_rejecting_quota_with(wire_tree, dropper) +} + +#[cfg(all(feature = "host", not(feature = "guest")))] +pub fn decode_value_rejecting_permission_card_with< + D: super::QuotaTokenHandleDropper + + super::SecretHandleDropper + + super::PermissionCardHandleDropper, >( wire_tree: wire::SchemaValueTree, dropper: &mut D, @@ -882,7 +992,9 @@ pub fn decode_value_rejecting_secret_with< /// and the decode is rejected with [`DecodeError::QuotaTokenNotPermitted`]. #[cfg(all(feature = "host", not(feature = "guest")))] pub fn decode_typed_rejecting_quota_with< - D: super::QuotaTokenHandleDropper + super::SecretHandleDropper, + D: super::QuotaTokenHandleDropper + + super::SecretHandleDropper + + super::PermissionCardHandleDropper, >( wire_typed: wire::TypedSchemaValue, dropper: &mut D, @@ -895,7 +1007,21 @@ pub fn decode_typed_rejecting_quota_with< #[cfg(all(feature = "host", not(feature = "guest")))] pub fn decode_typed_rejecting_secret_with< - D: super::QuotaTokenHandleDropper + super::SecretHandleDropper, + D: super::QuotaTokenHandleDropper + + super::SecretHandleDropper + + super::PermissionCardHandleDropper, +>( + wire_typed: wire::TypedSchemaValue, + dropper: &mut D, +) -> Result { + decode_typed_rejecting_quota_with(wire_typed, dropper) +} + +#[cfg(all(feature = "host", not(feature = "guest")))] +pub fn decode_typed_rejecting_permission_card_with< + D: super::QuotaTokenHandleDropper + + super::SecretHandleDropper + + super::PermissionCardHandleDropper, >( wire_typed: wire::TypedSchemaValue, dropper: &mut D, @@ -942,6 +1068,11 @@ fn preflight_owned_value_tree( i as wire::ValueNodeIndex, )); } + Some(wire::SchemaValueNode::PermissionCardHandle(_)) if !reached[i] => { + return Err(DecodeError::UnconsumedPermissionCardHandle( + i as wire::ValueNodeIndex, + )); + } _ => {} } } @@ -1024,6 +1155,9 @@ fn reject_handles_in_pure_value_tree(wire_tree: &wire::SchemaValueTree) -> Resul wire::SchemaValueNode::QuotaTokenHandle(_) => { return Err(DecodeError::QuotaTokenRequiresResolver); } + wire::SchemaValueNode::PermissionCardHandle(_) => { + return Err(DecodeError::PermissionCardRequiresResolver); + } _ => {} } } @@ -1044,6 +1178,9 @@ fn decode_owned_at( idx: wire::ValueNodeIndex, lift_quota: &mut dyn FnMut(WireQuotaHandle) -> Result, lift_secret: &mut dyn FnMut(WireSecretHandle) -> Result, + lift_permission_card: &mut dyn FnMut( + WirePermissionCardHandle, + ) -> Result, ) -> Result { let pos = usize_index_v(idx)?; let node = slots @@ -1068,7 +1205,13 @@ fn decode_owned_at( wire::SchemaValueNode::RecordValue(fields) => { let mut decoded = Vec::with_capacity(fields.len()); for i in fields { - decoded.push(decode_owned_at(slots, i, lift_quota, lift_secret)?); + decoded.push(decode_owned_at( + slots, + i, + lift_quota, + lift_secret, + lift_permission_card, + )?); } SchemaValue::Record { fields: decoded } } @@ -1079,6 +1222,7 @@ fn decode_owned_at( i, lift_quota, lift_secret, + lift_permission_card, )?)), None => None, }; @@ -1092,29 +1236,54 @@ fn decode_owned_at( wire::SchemaValueNode::TupleValue(elements) => { let mut decoded = Vec::with_capacity(elements.len()); for i in elements { - decoded.push(decode_owned_at(slots, i, lift_quota, lift_secret)?); + decoded.push(decode_owned_at( + slots, + i, + lift_quota, + lift_secret, + lift_permission_card, + )?); } SchemaValue::Tuple { elements: decoded } } wire::SchemaValueNode::ListValue(elements) => { let mut decoded = Vec::with_capacity(elements.len()); for i in elements { - decoded.push(decode_owned_at(slots, i, lift_quota, lift_secret)?); + decoded.push(decode_owned_at( + slots, + i, + lift_quota, + lift_secret, + lift_permission_card, + )?); } SchemaValue::List { elements: decoded } } wire::SchemaValueNode::FixedListValue(elements) => { let mut decoded = Vec::with_capacity(elements.len()); for i in elements { - decoded.push(decode_owned_at(slots, i, lift_quota, lift_secret)?); + decoded.push(decode_owned_at( + slots, + i, + lift_quota, + lift_secret, + lift_permission_card, + )?); } SchemaValue::FixedList { elements: decoded } } wire::SchemaValueNode::MapValue(entries) => { let mut decoded = Vec::with_capacity(entries.len()); for e in entries { - let key = decode_owned_at(slots, e.key, lift_quota, lift_secret)?; - let value = decode_owned_at(slots, e.value, lift_quota, lift_secret)?; + let key = + decode_owned_at(slots, e.key, lift_quota, lift_secret, lift_permission_card)?; + let value = decode_owned_at( + slots, + e.value, + lift_quota, + lift_secret, + lift_permission_card, + )?; decoded.push((key, value)); } SchemaValue::Map { entries: decoded } @@ -1126,6 +1295,7 @@ fn decode_owned_at( i, lift_quota, lift_secret, + lift_permission_card, )?)), None => None, }, @@ -1139,6 +1309,7 @@ fn decode_owned_at( i, lift_quota, lift_secret, + lift_permission_card, )?)), None => None, }, @@ -1150,6 +1321,7 @@ fn decode_owned_at( i, lift_quota, lift_secret, + lift_permission_card, )?)), None => None, }, @@ -1180,12 +1352,21 @@ fn decode_owned_at( }), wire::SchemaValueNode::UnionValue(p) => SchemaValue::Union(UnionValuePayload { tag: p.tag, - body: Box::new(decode_owned_at(slots, p.body, lift_quota, lift_secret)?), + body: Box::new(decode_owned_at( + slots, + p.body, + lift_quota, + lift_secret, + lift_permission_card, + )?), }), wire::SchemaValueNode::SecretValue(handle) => SchemaValue::Secret(lift_secret(handle)?), wire::SchemaValueNode::QuotaTokenHandle(handle) => { SchemaValue::QuotaToken(lift_quota(handle)?) } + wire::SchemaValueNode::PermissionCardHandle(handle) => { + SchemaValue::PermissionCard(lift_permission_card(handle)?) + } }; Ok(out) } diff --git a/golem-schema/src/schema/wit/encode.rs b/golem-schema/src/schema/wit/encode.rs index ccc36b5059..e4f21e0175 100644 --- a/golem-schema/src/schema/wit/encode.rs +++ b/golem-schema/src/schema/wit/encode.rs @@ -21,7 +21,8 @@ use crate::schema::schema_type::{ UnionBranch, UrlRestrictions, VariantCaseType, }; use crate::schema::schema_value::{ - QuotaTokenVariantValue, ResultValuePayload, SchemaValue, SecretVariantValue, + PermissionCardVariantValue, QuotaTokenVariantValue, ResultValuePayload, SchemaValue, + SecretVariantValue, }; use std::collections::HashMap; use std::fmt::{Display, Formatter}; @@ -44,12 +45,21 @@ pub enum EncodeError { /// value tree through the pure (resolver-less) path. Secrets cross the /// WASM boundary only as owned handles. SecretNotTransportable, + /// A [`SchemaValue::PermissionCard`] snapshot was encountered while encoding + /// a value tree through the pure (resolver-less) path. Permission cards + /// cross the WASM boundary only as owned handles, which requires the + /// host-side [`encode_value_with`] entry point and a + /// `PermissionCardResolver`. + PermissionCardNotTransportable, /// The host `QuotaTokenResolver` failed to materialize an owned handle from /// a snapshot. QuotaResolver(String), /// The host `SecretResolver` failed to materialize an owned handle from a /// snapshot. SecretResolver(String), + /// The host `PermissionCardResolver` failed to materialize an owned handle + /// from a snapshot. + PermissionCardResolver(String), /// (Guest) A quota-token value was encoded after its owned handle had /// already been transferred out by an earlier encode. An owned /// `quota-token` can only be lowered once. @@ -57,6 +67,9 @@ pub enum EncodeError { /// (Guest) A secret value was encoded after its owned handle had already /// been transferred out by an earlier encode. SecretAlreadyConsumed, + /// (Guest) A permission-card value was encoded after its owned handle had + /// already been transferred out by an earlier encode. + PermissionCardAlreadyConsumed, /// (Guest) The same owned quota-token handle appeared more than once in a /// single value tree. An owned `quota-token` cannot be lowered twice; split /// the token first if two independent capabilities are required. @@ -64,6 +77,9 @@ pub enum EncodeError { /// (Guest) The same owned secret handle appeared more than once in a single /// value tree. AliasedSecretHandle, + /// (Guest) The same owned permission-card handle appeared more than once in + /// a single value tree. An owned `permission-card` cannot be lowered twice. + AliasedPermissionCardHandle, } impl Display for EncodeError { @@ -79,12 +95,19 @@ impl Display for EncodeError { f, "secret values can only be encoded through a secret resolver-aware path" ), + EncodeError::PermissionCardNotTransportable => write!( + f, + "permission-card values can only be encoded through the host resolver-aware path" + ), EncodeError::QuotaResolver(msg) => { write!(f, "quota-token handle could not be created: {msg}") } EncodeError::SecretResolver(msg) => { write!(f, "secret handle could not be created: {msg}") } + EncodeError::PermissionCardResolver(msg) => { + write!(f, "permission-card handle could not be created: {msg}") + } EncodeError::QuotaTokenAlreadyConsumed => write!( f, "quota-token handle was already transferred; an owned quota-token can only be sent once" @@ -93,6 +116,10 @@ impl Display for EncodeError { f, "secret handle was already transferred; an owned secret can only be sent once" ), + EncodeError::PermissionCardAlreadyConsumed => write!( + f, + "permission-card handle was already transferred; an owned permission-card can only be sent once" + ), EncodeError::AliasedQuotaTokenHandle => write!( f, "the same quota-token handle appeared more than once in one value tree" @@ -103,6 +130,10 @@ impl Display for EncodeError { "the same secret handle appeared more than once in one value tree" ) } + EncodeError::AliasedPermissionCardHandle => write!( + f, + "the same permission-card handle appeared more than once in one value tree" + ), } } } @@ -178,6 +209,7 @@ pub fn encode_value(value: &SchemaValue) -> Result Result Result<(), EncodeError> { value: &SchemaValue, seen_quota: &mut std::collections::HashSet<*const ()>, seen_secret: &mut std::collections::HashSet<*const ()>, + seen_permission_card: &mut std::collections::HashSet<*const ()>, ) -> Result<(), EncodeError> { match value { SchemaValue::QuotaToken(handle) => { @@ -241,9 +280,18 @@ fn preflight_guest_handles(value: &SchemaValue) -> Result<(), EncodeError> { } Ok(()) } + SchemaValue::PermissionCard(handle) => { + if !handle.is_present() { + return Err(EncodeError::PermissionCardAlreadyConsumed); + } + if !seen_permission_card.insert(handle.cell_id()) { + return Err(EncodeError::AliasedPermissionCardHandle); + } + Ok(()) + } SchemaValue::Record { fields } => { for f in fields { - walk(f, seen_quota, seen_secret)?; + walk(f, seen_quota, seen_secret, seen_permission_card)?; } Ok(()) } @@ -251,26 +299,26 @@ fn preflight_guest_handles(value: &SchemaValue) -> Result<(), EncodeError> { | SchemaValue::List { elements } | SchemaValue::FixedList { elements } => { for e in elements { - walk(e, seen_quota, seen_secret)?; + walk(e, seen_quota, seen_secret, seen_permission_card)?; } Ok(()) } SchemaValue::Variant(p) => { if let Some(payload) = &p.payload { - walk(payload, seen_quota, seen_secret)?; + walk(payload, seen_quota, seen_secret, seen_permission_card)?; } Ok(()) } SchemaValue::Map { entries } => { for (k, v) in entries { - walk(k, seen_quota, seen_secret)?; - walk(v, seen_quota, seen_secret)?; + walk(k, seen_quota, seen_secret, seen_permission_card)?; + walk(v, seen_quota, seen_secret, seen_permission_card)?; } Ok(()) } SchemaValue::Option { inner } => { if let Some(inner) = inner { - walk(inner, seen_quota, seen_secret)?; + walk(inner, seen_quota, seen_secret, seen_permission_card)?; } Ok(()) } @@ -279,18 +327,24 @@ fn preflight_guest_handles(value: &SchemaValue) -> Result<(), EncodeError> { ResultValuePayload::Ok { value } | ResultValuePayload::Err { value } => value, }; if let Some(inner) = inner { - walk(inner, seen_quota, seen_secret)?; + walk(inner, seen_quota, seen_secret, seen_permission_card)?; } Ok(()) } - SchemaValue::Union(p) => walk(&p.body, seen_quota, seen_secret), + SchemaValue::Union(p) => walk(&p.body, seen_quota, seen_secret, seen_permission_card), _ => Ok(()), } } let mut seen_quota = std::collections::HashSet::new(); let mut seen_secret = std::collections::HashSet::new(); - walk(value, &mut seen_quota, &mut seen_secret) + let mut seen_permission_card = std::collections::HashSet::new(); + walk( + value, + &mut seen_quota, + &mut seen_secret, + &mut seen_permission_card, + ) } /// Encode a value tree, turning each [`SchemaValue::QuotaToken`] snapshot into a @@ -306,7 +360,9 @@ fn preflight_guest_handles(value: &SchemaValue) -> Result<(), EncodeError> { /// [`super::QuotaTokenResolver::drop_handle`] so none leak from the resource /// table. #[cfg(all(feature = "host", not(feature = "guest")))] -pub fn encode_value_with( +pub fn encode_value_with< + R: super::QuotaTokenResolver + super::SecretResolver + super::PermissionCardResolver, +>( value: &SchemaValue, resolver: &mut R, ) -> Result { @@ -328,6 +384,13 @@ pub fn encode_value_with( .map_err(|e| EncodeError::SecretResolver(e.to_string()))?; Ok(wire::SchemaValueNode::SecretValue(handle)) }, + &mut |snapshot| { + let mut resolver = resolver.borrow_mut(); + let handle = resolver + .permission_card_handle_from_snapshot(snapshot) + .map_err(|e| EncodeError::PermissionCardResolver(e.to_string()))?; + Ok(wire::SchemaValueNode::PermissionCardHandle(handle)) + }, ); match root { Ok(root) => Ok(wire::SchemaValueTree { @@ -342,6 +405,12 @@ pub fn encode_value_with( wire::SchemaValueNode::SecretValue(handle) => { super::SecretResolver::drop_secret_handle(&mut **resolver, handle) } + wire::SchemaValueNode::PermissionCardHandle(handle) => { + super::PermissionCardResolver::drop_permission_card_handle( + &mut **resolver, + handle, + ) + } _ => {} } } @@ -354,9 +423,12 @@ fn encode_value_inner( value: &SchemaValue, quota: &mut dyn FnMut(&QuotaTokenVariantValue) -> Result, secret: &mut dyn FnMut(&SecretVariantValue) -> Result, + permission_card: &mut dyn FnMut( + &PermissionCardVariantValue, + ) -> Result, ) -> Result { let mut ctx = ValueCtx::default(); - let root = ctx.encode(value, quota, secret)?; + let root = ctx.encode(value, quota, secret, permission_card)?; Ok(wire::SchemaValueTree { value_nodes: ctx.value_nodes, root, @@ -553,6 +625,11 @@ impl GraphCtx { resource_name: spec.resource_name.clone(), }) } + SchemaType::PermissionCard { spec, .. } => { + wire::SchemaTypeBody::PermissionCardType(wire::PermissionCardSpec { + polymorphic: spec.polymorphic, + }) + } SchemaType::Future { inner, .. } => { let inner = match inner { Some(t) => Some(self.encode_type(t)?), @@ -737,6 +814,9 @@ impl ValueCtx { &QuotaTokenVariantValue, ) -> Result, secret: &mut dyn FnMut(&SecretVariantValue) -> Result, + permission_card: &mut dyn FnMut( + &PermissionCardVariantValue, + ) -> Result, ) -> Result { let node = match value { SchemaValue::Bool(b) => wire::SchemaValueNode::BoolValue(*b), @@ -755,13 +835,13 @@ impl ValueCtx { SchemaValue::Record { fields } => { let mut indices = Vec::with_capacity(fields.len()); for v in fields { - indices.push(self.encode(v, quota, secret)?); + indices.push(self.encode(v, quota, secret, permission_card)?); } wire::SchemaValueNode::RecordValue(indices) } SchemaValue::Variant(p) => { let payload = match &p.payload { - Some(v) => Some(self.encode(v, quota, secret)?), + Some(v) => Some(self.encode(v, quota, secret, permission_card)?), None => None, }; wire::SchemaValueNode::VariantValue(wire::VariantValuePayload { @@ -774,21 +854,21 @@ impl ValueCtx { SchemaValue::Tuple { elements } => { let mut indices = Vec::with_capacity(elements.len()); for v in elements { - indices.push(self.encode(v, quota, secret)?); + indices.push(self.encode(v, quota, secret, permission_card)?); } wire::SchemaValueNode::TupleValue(indices) } SchemaValue::List { elements } => { let mut indices = Vec::with_capacity(elements.len()); for v in elements { - indices.push(self.encode(v, quota, secret)?); + indices.push(self.encode(v, quota, secret, permission_card)?); } wire::SchemaValueNode::ListValue(indices) } SchemaValue::FixedList { elements } => { let mut indices = Vec::with_capacity(elements.len()); for v in elements { - indices.push(self.encode(v, quota, secret)?); + indices.push(self.encode(v, quota, secret, permission_card)?); } wire::SchemaValueNode::FixedListValue(indices) } @@ -796,15 +876,15 @@ impl ValueCtx { let mut encoded = Vec::with_capacity(entries.len()); for (k, v) in entries { encoded.push(wire::MapEntry { - key: self.encode(k, quota, secret)?, - value: self.encode(v, quota, secret)?, + key: self.encode(k, quota, secret, permission_card)?, + value: self.encode(v, quota, secret, permission_card)?, }); } wire::SchemaValueNode::MapValue(encoded) } SchemaValue::Option { inner } => { let inner = match inner { - Some(v) => Some(self.encode(v, quota, secret)?), + Some(v) => Some(self.encode(v, quota, secret, permission_card)?), None => None, }; wire::SchemaValueNode::OptionValue(inner) @@ -813,14 +893,14 @@ impl ValueCtx { let payload = match p { ResultValuePayload::Ok { value } => { let v = match value { - Some(v) => Some(self.encode(v, quota, secret)?), + Some(v) => Some(self.encode(v, quota, secret, permission_card)?), None => None, }; wire::ResultValuePayload::OkValue(v) } ResultValuePayload::Err { value } => { let v = match value { - Some(v) => Some(self.encode(v, quota, secret)?), + Some(v) => Some(self.encode(v, quota, secret, permission_card)?), None => None, }; wire::ResultValuePayload::ErrValue(v) @@ -861,7 +941,7 @@ impl ValueCtx { }) } SchemaValue::Union(p) => { - let body = self.encode(&p.body, quota, secret)?; + let body = self.encode(&p.body, quota, secret, permission_card)?; wire::SchemaValueNode::UnionValue(wire::UnionValuePayload { tag: p.tag.clone(), body, @@ -869,6 +949,7 @@ impl ValueCtx { } SchemaValue::Secret(s) => secret(s)?, SchemaValue::QuotaToken(q) => quota(q)?, + SchemaValue::PermissionCard(p) => permission_card(p)?, }; Ok(self.push(node)) } diff --git a/golem-schema/src/schema/wit/host.rs b/golem-schema/src/schema/wit/host.rs index e8eefe6d12..e16b8a0bba 100644 --- a/golem-schema/src/schema/wit/host.rs +++ b/golem-schema/src/schema/wit/host.rs @@ -28,6 +28,7 @@ pub mod generated { with: { "golem:core/types@2.0.0.quota-token": crate::schema::wit::QuotaTokenHandleRep, "golem:core/types@2.0.0.secret": crate::schema::wit::SecretHandleRep, + "golem:core/types@2.0.0.permission-card": crate::schema::wit::PermissionCardHandleRep, }, }); } diff --git a/golem-schema/src/schema/wit/mod.rs b/golem-schema/src/schema/wit/mod.rs index 959ca00ca6..348c5ec47b 100644 --- a/golem-schema/src/schema/wit/mod.rs +++ b/golem-schema/src/schema/wit/mod.rs @@ -52,20 +52,23 @@ pub use encode::{ #[cfg(all(feature = "host", not(feature = "guest")))] pub use decode::{ - decode_typed_rejecting_quota_with, decode_typed_rejecting_secret_with, + decode_typed_rejecting_permission_card_with, decode_typed_rejecting_quota_with, + decode_typed_rejecting_secret_with, decode_value_rejecting_permission_card_with, decode_value_rejecting_quota_with, decode_value_rejecting_secret_with, decode_value_with, - reject_quota_handles_in_value_tree, reject_secret_handles_in_value_tree, + reject_permission_card_handles_in_value_tree, reject_quota_handles_in_value_tree, + reject_secret_handles_in_value_tree, }; #[cfg(all(feature = "host", not(feature = "guest")))] pub use encode::encode_value_with; #[cfg(all(feature = "host", not(feature = "guest")))] pub use host_support::{ + PermissionCardHandleDropper, PermissionCardHandleRep, PermissionCardResolver, QuotaTokenHandleDropper, QuotaTokenHandleRep, QuotaTokenResolver, SecretHandleDropper, SecretHandleRep, SecretResolver, }; #[cfg(all(feature = "guest", not(feature = "host")))] -pub use guest_support::{GuestQuotaTokenHandle, GuestSecretHandle}; +pub use guest_support::{GuestPermissionCardHandle, GuestQuotaTokenHandle, GuestSecretHandle}; /// Host-side bridge for the opaque `golem:core/types.quota-token` resource. /// @@ -77,7 +80,9 @@ pub use guest_support::{GuestQuotaTokenHandle, GuestSecretHandle}; /// [`QuotaTokenResolver`] trait at the value-tree boundary. #[cfg(all(feature = "host", not(feature = "guest")))] mod host_support { - use crate::schema::schema_value::{QuotaTokenValuePayload, SecretValuePayload}; + use crate::schema::schema_value::{ + PermissionCardValuePayload, QuotaTokenValuePayload, SecretValuePayload, + }; use wasmtime::component::Resource; /// Opaque host representation backing the `quota-token` WIT resource. @@ -244,6 +249,104 @@ mod host_support { } } } + + /// Opaque host representation backing the `permission-card` WIT resource. + /// + /// The boxed payload is owned and interpreted solely by the embedder; this + /// crate only moves the handle in and out of the resource table. The payload + /// is intentionally private so embedders go through [`Self::new`], + /// [`Self::downcast_ref`], and [`Self::downcast_mut`] rather than touching + /// the erased box directly. + pub struct PermissionCardHandleRep { + payload: Box, + } + + impl PermissionCardHandleRep { + pub fn new(payload: impl std::any::Any + Send + Sync) -> Self { + Self { + payload: Box::new(payload), + } + } + + pub fn downcast_ref(&self) -> Option<&T> { + self.payload.downcast_ref::() + } + + pub fn downcast_mut(&mut self) -> Option<&mut T> { + self.payload.downcast_mut::() + } + + /// Consume the handle, returning the owned payload if it has the + /// expected type. On a type mismatch the handle is returned unchanged in + /// the `Err` so the caller can recover or drop it. + pub fn into_payload(self) -> Result { + match self.payload.downcast::() { + Ok(boxed) => Ok(*boxed), + Err(payload) => Err(Self { payload }), + } + } + } + + /// Boundary bridge between owned `permission-card` handles carried inside a + /// `schema-value-tree` and the trusted host snapshot. + /// + /// Implemented by the embedder that owns the resource table. The codec calls + /// these hooks while lifting/lowering value trees so that the snapshot never + /// crosses the WASM boundary as forgeable data. Only `card_id` is + /// authoritative; the other snapshot fields are trusted cache verified + /// against the card store. + pub trait PermissionCardResolver { + type Error: std::fmt::Display; + + /// Consume an owned handle lifted from a value tree and return its + /// trusted snapshot. + /// + /// The handle is always removed from the resource table: implementations + /// must delete the entry on every path for a valid handle, including + /// when extracting the snapshot afterwards fails. The codec gives up + /// ownership of the handle when calling this, so it cannot clean up a + /// handle that an `Err` return leaves behind in the table. + fn snapshot_permission_card_handle( + &mut self, + handle: Resource, + ) -> Result; + + /// Materialize a fresh owned handle from a trusted snapshot so it can be + /// lowered to a guest. + /// + /// On `Err`, implementations must not leave a newly created handle or + /// resource-table entry behind: the codec only tracks handles that were + /// returned to it, so it cannot clean up an entry abandoned by a failed + /// call. + fn permission_card_handle_from_snapshot( + &mut self, + snapshot: &PermissionCardValuePayload, + ) -> Result, Self::Error>; + + /// Drop an owned handle without snapshotting it. Used to release handles + /// that are left unconsumed when decoding fails partway through a tree. + fn drop_permission_card_handle(&mut self, handle: Resource); + } + + /// Minimal capability needed to clean up owned `permission-card` handles at + /// boundaries that reject permission-card transport. + /// + /// Reject paths never snapshot or mint handles; they only need to delete a + /// handle that the guest already transferred into the resource table. This + /// is a strictly smaller capability than [`PermissionCardResolver`], so + /// callers that lack a full resolver can still drain handles. Every + /// [`PermissionCardResolver`] is a `PermissionCardHandleDropper` via the + /// blanket impl below. + pub trait PermissionCardHandleDropper { + /// Delete an owned handle from the resource table without inspecting it. + fn drop_permission_card_handle(&mut self, handle: Resource); + } + + impl PermissionCardHandleDropper for R { + fn drop_permission_card_handle(&mut self, handle: Resource) { + PermissionCardResolver::drop_permission_card_handle(self, handle) + } + } } /// Guest-side carrier for the opaque, owned `golem:core/types.quota-token` @@ -262,7 +365,7 @@ mod guest_support { use super::wire; use crate::schema::conversion::{FromSchema, FromSchemaError, IntoSchema, SchemaBuilder}; use crate::schema::metadata::TypeId; - use crate::schema::schema_type::{QuotaTokenSpec, SchemaType}; + use crate::schema::schema_type::{PermissionCardSpec, QuotaTokenSpec, SchemaType}; use crate::schema::schema_value::SchemaValue; use std::cell::RefCell; use std::rc::Rc; @@ -485,6 +588,118 @@ mod guest_support { } } } + + #[derive(Clone)] + pub struct GuestPermissionCardHandle { + inner: Rc>>, + } + + // The methods below expose the affine owned handle so the codec (this + // crate) and the SDK wrappers (`golem-rust`, a separate crate) can move it + // through encode/decode and call borrowing permission operations on it. + // They have to stay `pub` because they cross that crate boundary, but they + // are not a supported guest API: a guest that calls `take`/`new`/`with_handle` + // could move the underlying `wire::PermissionCard` resource around outside + // the take-once cell and defeat the affine/unforgeable guarantee. They are + // hidden from the documented surface (`#[doc(hidden)]`) to discourage that; + // genuine forgery is only possible through wit-bindgen's own hidden resource + // handle accessors, which are outside this crate's control. + impl GuestPermissionCardHandle { + /// Wrap a freshly received owned handle in a take-once cell. + #[doc(hidden)] + pub fn new(handle: wire::PermissionCard) -> Self { + Self { + inner: Rc::new(RefCell::new(Some(handle))), + } + } + + /// Take the owned handle out of the cell. Returns `None` if it was + /// already transferred (consumed) by a previous encode. + #[doc(hidden)] + pub fn take(&self) -> Option { + self.inner.borrow_mut().take() + } + + /// Whether the handle is still present (not yet transferred). + #[doc(hidden)] + pub fn is_present(&self) -> bool { + self.inner.borrow().is_some() + } + + /// Run `f` with a shared reference to the owned handle, if it is still + /// present. + #[doc(hidden)] + pub fn with_handle(&self, f: impl FnOnce(&wire::PermissionCard) -> R) -> Option { + self.inner.borrow().as_ref().map(f) + } + + /// Identity of the shared cell, used to detect the same card appearing + /// more than once in a single value tree. + #[doc(hidden)] + pub fn cell_id(&self) -> *const () { + Rc::as_ptr(&self.inner).cast() + } + } + + impl std::fmt::Debug for GuestPermissionCardHandle { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let state = if self.is_present() { + "present" + } else { + "consumed" + }; + write!(f, "GuestPermissionCardHandle(<{state}>)") + } + } + + impl PartialEq for GuestPermissionCardHandle { + fn eq(&self, other: &Self) -> bool { + Rc::ptr_eq(&self.inner, &other.inner) + } + } + + impl serde::Serialize for GuestPermissionCardHandle { + fn serialize(&self, _serializer: S) -> Result { + Err(serde::ser::Error::custom( + "permission-card handles cannot be serialized; transfer them through a WIT schema-value-tree", + )) + } + } + + impl<'de> serde::Deserialize<'de> for GuestPermissionCardHandle { + fn deserialize>(_deserializer: D) -> Result { + Err(serde::de::Error::custom( + "permission-card handles cannot be deserialized or forged from data", + )) + } + } + + impl IntoSchema for GuestPermissionCardHandle { + fn type_id() -> TypeId { + TypeId::new("golem.core.PermissionCard") + } + + fn register_in(_builder: &mut SchemaBuilder) -> SchemaType { + SchemaType::permission_card(PermissionCardSpec::default()) + } + + fn to_value(&self) -> SchemaValue { + SchemaValue::PermissionCard(self.clone()) + } + } + + impl FromSchema for GuestPermissionCardHandle { + fn from_value(value: &SchemaValue) -> Result { + match value { + SchemaValue::PermissionCard(h) => Ok(h.clone()), + other => Err(FromSchemaError::shape_mismatch( + "permission-card", + format!("{other:?}"), + "PermissionCard", + )), + } + } + } } #[cfg(any( @@ -516,3 +731,13 @@ impl From for wire::Uuid { } } } + +#[cfg(any( + all(feature = "guest", not(feature = "host")), + all(feature = "host", not(feature = "guest")) +))] +impl From for wire::CardId { + fn from(uuid: uuid::Uuid) -> Self { + Self { uuid: uuid.into() } + } +} diff --git a/golem-schema/wit/deps/golem-core-v2/golem-core-v2.wit b/golem-schema/wit/deps/golem-core-v2/golem-core-v2.wit index bb7dda191e..a59e6e4ede 100644 --- a/golem-schema/wit/deps/golem-core-v2/golem-core-v2.wit +++ b/golem-schema/wit/deps/golem-core-v2/golem-core-v2.wit @@ -125,6 +125,17 @@ interface types { /// and reveal it only through capability-gated host interfaces. resource secret; + /// An unforgeable handle to a permission card held by the runtime. The + /// handle is opaque to guests: components can hold, pass, derive, install, + /// and revoke cards only through the `golem:permissions` interfaces. When + /// carried in a `schema-value-tree` (see + /// `schema-value-node::permission-card-handle`) the handle is transferred + /// by ownership; the host converts it to/from its internal trusted + /// card-store representation at the boundary. The wire form is the card-id + /// (UUID) alone — no grants, parents, or metadata cross the wire as + /// authority. + resource permission-card; + // ============================================================ // Schema graph (self-contained type carrier) // ============================================================ @@ -266,6 +277,7 @@ interface types { // --- Capability nodes --- secret-type(secret-spec), quota-token-type(quota-token-spec), + permission-card-type(permission-card-spec), // --- WASI P3 stubs (parseable only; no semantics yet) --- future-type(option), @@ -462,6 +474,13 @@ interface types { resource-name: option, } + record permission-card-spec { + /// `true` = polymorphic (carries slot variables in owner / resource-id), + /// `false` = monomorphic. Structural metadata only; authority lives in + /// the card store, not in the schema spec. + polymorphic: bool, + } + // ============================================================ // Schema value (always paired with a schema-graph) // ============================================================ @@ -524,6 +543,7 @@ interface types { // Capability nodes secret-value(own), quota-token-handle(own), + permission-card-handle(own), // WASI P3 stubs (parseable only in the schema; no constructible values). } diff --git a/golem-service-base/Cargo.toml b/golem-service-base/Cargo.toml index cca1b72062..d50629b320 100644 --- a/golem-service-base/Cargo.toml +++ b/golem-service-base/Cargo.toml @@ -93,6 +93,7 @@ wasmtime-wasi = { workspace = true, optional = true } [dev-dependencies] assert2.workspace = true pretty_assertions = { workspace = true } +prost.workspace = true tempfile = { workspace = true } test-r = { workspace = true } testcontainers = { workspace = true } diff --git a/golem-service-base/src/clients/registry.rs b/golem-service-base/src/clients/registry.rs index f846472932..dda19261a1 100644 --- a/golem-service-base/src/clients/registry.rs +++ b/golem-service-base/src/clients/registry.rs @@ -25,21 +25,23 @@ use golem_api_grpc::proto::golem::registry::ResourceUsageUpdate as GrpcResourceU use golem_api_grpc::proto::golem::registry::v1::registry_service_client::RegistryServiceClient; use golem_api_grpc::proto::golem::registry::v1::{ AuthenticateTokenRequest, BatchGetCardsRequest, BatchGetExistingCardsRequest, - BatchUpdateResourceUsageRequest, DownloadComponentRequest, GetActiveMcpForDomainRequest, - GetActiveRoutesForDomainRequest, GetAgentSecretRevisionRequest, GetAgentTypeRequest, - GetAllAgentTypesRequest, GetAllDeployedComponentRevisionsRequest, GetComponentMetadataRequest, - GetCurrentEnvironmentStateRequest, GetDeployedComponentMetadataRequest, - GetResourceDefinitionByIdRequest, GetResourceDefinitionByNameRequest, GetResourceLimitsRequest, - ResolveAgentTypeByNamesRequest, ResolveComponentRequest, UpdateWorkerConnectionLimitRequest, - authenticate_token_response, batch_get_cards_response, batch_get_existing_cards_response, - batch_update_resource_usage_response, download_component_response, - get_active_mcp_for_domain_response, get_active_routes_for_domain_response, - get_agent_secret_revision_response, get_agent_type_response, get_all_agent_types_response, + BatchUpdateResourceUsageRequest, CreateRuntimeCardRequest, DownloadComponentRequest, + GetActiveMcpForDomainRequest, GetActiveRoutesForDomainRequest, GetAgentSecretRevisionRequest, + GetAgentTypeRequest, GetAllAgentTypesRequest, GetAllDeployedComponentRevisionsRequest, + GetComponentMetadataRequest, GetCurrentEnvironmentStateRequest, + GetDeployedComponentMetadataRequest, GetResourceDefinitionByIdRequest, + GetResourceDefinitionByNameRequest, GetResourceLimitsRequest, ResolveAgentTypeByNamesRequest, + ResolveComponentRequest, RevokeCardRequest, RuntimeCardData, + UpdateWorkerConnectionLimitRequest, authenticate_token_response, batch_get_cards_response, + batch_get_existing_cards_response, batch_update_resource_usage_response, + create_runtime_card_response, download_component_response, get_active_mcp_for_domain_response, + get_active_routes_for_domain_response, get_agent_secret_revision_response, + get_agent_type_response, get_all_agent_types_response, get_all_deployed_component_revisions_response, get_component_metadata_response, get_current_environment_state_response, get_deployed_component_metadata_response, get_resource_definition_by_id_response, get_resource_definition_by_name_response, get_resource_limits_response, resolve_agent_type_by_names_response, resolve_component_response, - update_worker_connection_limit_response, + revoke_card_response, update_worker_connection_limit_response, }; use golem_common::config::{ConfigExample, HasConfigExamples}; use golem_common::model::AgentId; @@ -52,7 +54,7 @@ use golem_common::model::agent_secret::{ }; use golem_common::model::application::{ApplicationId, ApplicationName}; use golem_common::model::auth::TokenSecret; -use golem_common::model::card::{CardId, StoredCard}; +use golem_common::model::card::{CardId, CardManagedByRuntimeDerived, StoredCard}; use golem_common::model::component::{ComponentId, ComponentRevision}; use golem_common::model::deployment::{CurrentDeploymentRevision, DeploymentRevision}; use golem_common::model::domain_registration::Domain; @@ -128,6 +130,22 @@ pub trait RegistryService: Send + Sync { Ok(Vec::new()) } + async fn create_runtime_card( + &self, + _card: StoredCard, + _provenance: CardManagedByRuntimeDerived, + ) -> Result { + Err(RegistryServiceError::internal_client_error( + "create_runtime_card is not supported by this registry service", + )) + } + + async fn revoke_card(&self, _card_id: CardId) -> Result, RegistryServiceError> { + Err(RegistryServiceError::internal_client_error( + "revoke_card is not supported by this registry service", + )) + } + // components api // will return the component even if it is deleted async fn download_component( @@ -659,6 +677,101 @@ impl RegistryService for GrpcRegistryService { } } + async fn create_runtime_card( + &self, + card: StoredCard, + provenance: CardManagedByRuntimeDerived, + ) -> Result { + let card_id = card.card_id(); + let card_json = serde_json::to_vec(&card).map_err(|error| { + RegistryServiceError::internal_client_error(format!( + "failed to serialize runtime card {}: {error}", + card_id.0 + )) + })?; + let provenance_json = serde_json::to_vec(&provenance).map_err(|error| { + RegistryServiceError::internal_client_error(format!( + "failed to serialize provenance for runtime card {}: {error}", + card_id.0 + )) + })?; + + let response = self + .client + .call("create_runtime_card", move |client| { + let request = CreateRuntimeCardRequest { + card: Some(RuntimeCardData { + card_id: Some(card_id.0.into()), + card_json: card_json.clone(), + }), + provenance_json: provenance_json.clone(), + }; + + Box::pin(client.create_runtime_card(request)) + }) + .await? + .into_inner(); + + match response.result { + None => Err(RegistryServiceError::empty_response()), + Some(create_runtime_card_response::Result::Success(payload)) => { + let card = payload.card.ok_or_else(|| { + RegistryServiceError::internal_client_error( + "missing card field in create runtime card response", + ) + })?; + let envelope_card_id = + card.card_id.map(|id| CardId(id.into())).ok_or_else(|| { + RegistryServiceError::internal_client_error( + "missing card ID in create runtime card response", + ) + })?; + let created: StoredCard = + serde_json::from_slice(&card.card_json).map_err(|error| { + RegistryServiceError::internal_client_error(format!( + "failed to deserialize create runtime card response: {error}" + )) + })?; + if created.card_id() != envelope_card_id { + return Err(RegistryServiceError::internal_client_error( + "card ID in create runtime card response does not match its serialized card", + )); + } + if created.card_id() != card_id { + return Err(RegistryServiceError::internal_client_error( + "create runtime card response returned an unexpected card ID", + )); + } + Ok(created) + } + Some(create_runtime_card_response::Result::Error(error)) => Err(error.into()), + } + } + + async fn revoke_card(&self, card_id: CardId) -> Result, RegistryServiceError> { + let response = self + .client + .call("revoke_card", move |client| { + let request = RevokeCardRequest { + card_id: Some(card_id.0.into()), + }; + + Box::pin(client.revoke_card(request)) + }) + .await? + .into_inner(); + + match response.result { + None => Err(RegistryServiceError::empty_response()), + Some(revoke_card_response::Result::Success(payload)) => Ok(payload + .revoked_card_ids + .into_iter() + .map(|id| CardId(id.into())) + .collect()), + Some(revoke_card_response::Result::Error(error)) => Err(error.into()), + } + } + async fn download_component( &self, component_id: ComponentId, diff --git a/golem-service-base/src/error/worker_executor.rs b/golem-service-base/src/error/worker_executor.rs index 9a722b5928..c37d48e6c9 100644 --- a/golem-service-base/src/error/worker_executor.rs +++ b/golem-service-base/src/error/worker_executor.rs @@ -128,6 +128,9 @@ pub enum WorkerExecutorError { method: String, host_function: String, }, + PermissionDenied { + details: String, + }, } impl WorkerExecutorError { @@ -175,6 +178,12 @@ impl WorkerExecutorError { } } + pub fn permission_denied(details: impl Into) -> Self { + Self::PermissionDenied { + details: details.into(), + } + } + pub fn invalid_shard_id(shard_id: ShardId, shard_ids: HashSet) -> Self { Self::InvalidShardId { shard_id, @@ -324,6 +333,9 @@ impl Display for WorkerExecutorError { "Read-only agent method '{method}' attempted side effect via '{host_function}'" ) } + Self::PermissionDenied { details } => { + write!(f, "Permission denied: {details}") + } } } } @@ -367,6 +379,7 @@ impl Error for WorkerExecutorError { Self::ShardingNotReady => "Sharding not ready", Self::FileSystemError { .. } => "File system error", Self::ReadOnlyViolation { .. } => "Read-only agent method attempted a side effect", + Self::PermissionDenied { .. } => "Permission denied", } } } @@ -402,6 +415,7 @@ impl ApiErrorDetails for WorkerExecutorError { Self::ShardingNotReady => "ShardingNotReady", Self::FileSystemError { .. } => "FileSystemError", Self::ReadOnlyViolation { .. } => "ReadOnlyViolation", + Self::PermissionDenied { .. } => "PermissionDenied", } } @@ -434,7 +448,8 @@ impl ApiErrorDetails for WorkerExecutorError { | Self::Unknown { .. } | Self::ShardingNotReady | Self::FileSystemError { .. } - | Self::ReadOnlyViolation { .. } => false, + | Self::ReadOnlyViolation { .. } + | Self::PermissionDenied { .. } => false, } } @@ -512,6 +527,7 @@ impl From for Status { WorkerExecutorError::PreviousInvocationFailed { .. } => { Self::failed_precondition(format!("{value}")) } + WorkerExecutorError::PermissionDenied { details } => Self::permission_denied(details), _ => Self::internal(format!("{value}")), } } @@ -773,6 +789,13 @@ impl From for golem::worker::v1::WorkerExecutionError { }, )), }, + WorkerExecutorError::PermissionDenied { details } => Self { + error: Some( + golem::worker::v1::worker_execution_error::Error::PermissionDenied( + golem::worker::v1::PermissionDenied { details }, + ), + ), + }, } } } @@ -970,6 +993,11 @@ impl TryFrom for WorkerExecutorError { stderr: inner.stderr, }) } + Some(golem::worker::v1::worker_execution_error::Error::PermissionDenied(error)) => { + Ok(Self::PermissionDenied { + details: error.details, + }) + } } } } diff --git a/golem-service-base/src/model/auth/mod.rs b/golem-service-base/src/model/auth/mod.rs index 74cf0e6ed9..64c7ae9c0e 100644 --- a/golem-service-base/src/model/auth/mod.rs +++ b/golem-service-base/src/model/auth/mod.rs @@ -19,7 +19,9 @@ use axum::http::header; use golem_common::SafeDisplay; use golem_common::model::account::{AccountEmail, AccountId}; use golem_common::model::auth::{AccountRole, TokenSecret}; -use golem_common::model::card::{CardAlgebraError, EffectiveSurface, PermissionTarget}; +use golem_common::model::card::{ + CardAlgebraError, DelegationSurface, EffectiveSurface, PermissionTarget, +}; use golem_common::model::plan::PlanId; use headers::Cookie as HCookie; use headers::HeaderMapExt; @@ -175,6 +177,7 @@ pub struct UserAuthCtx { pub account_plan_id: PlanId, pub account_roles: BTreeSet, pub effective_surface: EffectiveSurface, + pub delegation_surface: Option, } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -185,6 +188,7 @@ pub struct AgentAuthCtx { pub account_id: AccountId, pub account_email: AccountEmail, pub effective_surface: EffectiveSurface, + pub delegation_surface: Option, } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -198,6 +202,7 @@ pub struct AdminImpersonationAuthCtx { pub target_account_roles: BTreeSet, pub target_account_plan_id: PlanId, pub effective_surface: EffectiveSurface, + pub delegation_surface: Option, } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -231,6 +236,21 @@ impl AuthCtx { account_id, account_email, effective_surface, + delegation_surface: None, + }) + } + + pub fn agent_with_permission_surfaces( + account_id: AccountId, + account_email: AccountEmail, + effective_surface: EffectiveSurface, + delegation_surface: DelegationSurface, + ) -> AuthCtx { + AuthCtx::Agent(AgentAuthCtx { + account_id, + account_email, + effective_surface, + delegation_surface: Some(delegation_surface), }) } @@ -249,6 +269,7 @@ impl AuthCtx { target_account_roles, target_account_plan_id, effective_surface, + delegation_surface: None, }) } @@ -337,16 +358,17 @@ impl AuthCtx { } } - pub fn effective_surface_for_card_derivation( + pub fn delegation_surface_for_card_derivation( &self, action: impl Into, - ) -> Result<&EffectiveSurface, AuthorizationError> { - match self { - Self::System => Err(AuthorizationError::AuthContextHasNoCards(action.into())), - Self::User(user) => Ok(&user.effective_surface), - Self::Agent(agent) => Ok(&agent.effective_surface), - Self::AdminImpersonation(ctx) => Ok(&ctx.effective_surface), - } + ) -> Result<&DelegationSurface, AuthorizationError> { + let surface = match self { + Self::System => None, + Self::User(user) => user.delegation_surface.as_ref(), + Self::Agent(agent) => agent.delegation_surface.as_ref(), + Self::AdminImpersonation(ctx) => ctx.delegation_surface.as_ref(), + }; + surface.ok_or_else(|| AuthorizationError::AuthContextHasNoCards(action.into())) } } @@ -597,7 +619,9 @@ mod protobuf { use applying::Apply; use golem_common::model::account::AccountEmail; use golem_common::model::auth::AccountRole; - use golem_common::model::card::{CardId, EffectiveSurface, GrantSurface, PermissionTarget}; + use golem_common::model::card::{ + CardId, DelegationSurface, EffectiveSurface, GrantSurface, PermissionTarget, + }; fn deserialize_effective_surface( value: golem_api_grpc::proto::golem::auth::AuthEffectiveSurface, @@ -677,6 +701,24 @@ mod protobuf { .collect() } + fn deserialize_delegation_surface( + value: Option>, + ) -> Result, String> { + value + .map(|value| { + desert_rust::deserialize(&value) + .map_err(|err| format!("invalid delegation surface: {err}")) + }) + .transpose() + } + + fn serialize_delegation_surface(value: Option) -> Option> { + value.map(|value| { + desert_rust::serialize_to_byte_vec(&value) + .expect("DelegationSurface Desert serialization failed") + }) + } + impl TryFrom for UserAuthCtx { type Error = String; fn try_from( @@ -697,6 +739,7 @@ mod protobuf { account_email: AccountEmail::new(value.account_email), account_plan_id: value.plan_id.ok_or("missing plan id")?.try_into()?, effective_surface, + delegation_surface: deserialize_delegation_surface(value.delegation_surface)?, }) } } @@ -713,6 +756,7 @@ mod protobuf { .map(|ar| golem_api_grpc::proto::golem::auth::AccountRole::from(ar).into()) .collect(), effective_surface: Some(serialize_effective_surface(value.effective_surface)), + delegation_surface: serialize_delegation_surface(value.delegation_surface), } } } @@ -729,6 +773,7 @@ mod protobuf { .effective_surface .ok_or("missing effective_surface")? .apply(deserialize_effective_surface)?, + delegation_surface: deserialize_delegation_surface(value.delegation_surface)?, }) } } @@ -739,6 +784,7 @@ mod protobuf { account_id: Some(value.account_id.into()), account_email: value.account_email.into_inner(), effective_surface: Some(serialize_effective_surface(value.effective_surface)), + delegation_surface: serialize_delegation_surface(value.delegation_surface), } } } @@ -780,6 +826,7 @@ mod protobuf { .ok_or("missing target_account_plan_id")? .try_into()?, effective_surface, + delegation_surface: deserialize_delegation_surface(value.delegation_surface)?, }) } } @@ -799,6 +846,7 @@ mod protobuf { .collect(), target_account_plan_id: Some(value.target_account_plan_id.into()), effective_surface: Some(serialize_effective_surface(value.effective_surface)), + delegation_surface: serialize_delegation_surface(value.delegation_surface), } } } diff --git a/golem-service-base/src/model/auth/tests.rs b/golem-service-base/src/model/auth/tests.rs index ab541815dc..ff8b7e3cec 100644 --- a/golem-service-base/src/model/auth/tests.rs +++ b/golem-service-base/src/model/auth/tests.rs @@ -17,9 +17,9 @@ use assert2::assert; use golem_common::model::card::owner::{AccountOwnerPattern, EmptyOwnerPattern}; use golem_common::model::card::recipient::RecipientPattern; use golem_common::model::card::{ - AccountResourcePattern, AccountTokenResourcePattern, AccountTokenVerb, AccountVerb, - ClassPermissionPattern, ClassPermissionTarget, PermissionPattern, PermissionTarget, - SystemResourcePattern, SystemVerb, + AccountResourcePattern, AccountTokenResourcePattern, AccountTokenVerb, AccountVerb, CardId, + ClassPermissionPattern, ClassPermissionTarget, DelegationCard, PermissionPattern, + PermissionTarget, SystemResourcePattern, SystemVerb, }; use test_r::test; @@ -34,6 +34,7 @@ fn mk_user_ctx(roles: &[AccountRole], plan_id: PlanId, account_id: AccountId) -> account_plan_id: plan_id, account_roles: roles.iter().cloned().collect(), effective_surface: empty_effective_surface(), + delegation_surface: None, }) } @@ -128,11 +129,52 @@ fn system_auth_cannot_validate_card_derivation() { let ctx = AuthCtx::System; assert!(matches!( - ctx.effective_surface_for_card_derivation("test"), + ctx.delegation_surface_for_card_derivation("test"), Err(super::AuthorizationError::AuthContextHasNoCards(_)) )); } +#[test] +fn auth_without_delegation_surface_cannot_validate_card_derivation() { + let ctx = mk_user_ctx(&[], PlanId::new(), AccountId::new()); + + assert!(matches!( + ctx.delegation_surface_for_card_derivation("test"), + Err(super::AuthorizationError::AuthContextHasNoCards(_)) + )); + + let encoded: golem_api_grpc::proto::golem::auth::AuthCtx = ctx.clone().into(); + let decoded = AuthCtx::try_from(encoded).unwrap(); + assert!(decoded == ctx); +} + +#[test] +fn auth_context_protobuf_preserves_delegation_surface() { + let account_id = AccountId::new(); + let delegation_surface = DelegationSurface { + cards: vec![DelegationCard { + source_card_id: Some(CardId::new()), + lower_positive: vec![report_grant(RecipientPattern::Any)], + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + }], + }; + let ctx = AuthCtx::User(UserAuthCtx { + account_id, + account_email: account_email(account_id), + account_plan_id: PlanId::new(), + account_roles: BTreeSet::new(), + effective_surface: empty_effective_surface(), + delegation_surface: Some(delegation_surface), + }); + + let encoded: golem_api_grpc::proto::golem::auth::AuthCtx = ctx.clone().into(); + let decoded = AuthCtx::try_from(encoded).unwrap(); + + assert!(decoded == ctx); +} + #[test] fn user_with_effective_surface_can_authorize_permission() { let account_id = AccountId::new(); @@ -146,6 +188,7 @@ fn user_with_effective_surface_can_authorize_permission() { account_plan_id: PlanId::new(), account_roles: BTreeSet::new(), effective_surface: effective_surface_for_account(account_id, vec![grant]), + delegation_surface: None, }); assert!(ctx.authorize_permission(&target).is_ok()); @@ -173,6 +216,7 @@ fn user_with_effective_surface_can_authorize_account_token_permission() { account_plan_id: PlanId::new(), account_roles: BTreeSet::new(), effective_surface: effective_surface_for_account(account_id, vec![grant]), + delegation_surface: None, }); assert!(ctx.authorize_permission(&target).is_ok()); @@ -195,6 +239,7 @@ fn effective_surface_account_token_grant_for_different_holder_does_not_authorize account_plan_id: PlanId::new(), account_roles: BTreeSet::new(), effective_surface: effective_surface_for_account(account_id, vec![grant]), + delegation_surface: None, }); assert!(ctx.authorize_permission(&target).is_err()); @@ -216,6 +261,7 @@ fn effective_surface_account_token_target_ignores_recipient_after_holder_filteri account_plan_id: PlanId::new(), account_roles: BTreeSet::new(), effective_surface: effective_surface_for_account(account_id, vec![grant]), + delegation_surface: None, }); assert!(ctx.authorize_permission(&target).is_ok()); @@ -236,6 +282,7 @@ fn effective_surface_account_token_grant_does_not_authorize_different_owner_targ account_plan_id: PlanId::new(), account_roles: BTreeSet::new(), effective_surface: effective_surface_for_account(account_id, vec![grant]), + delegation_surface: None, }); let requested = account_token_target(AccountId::new()); @@ -266,6 +313,7 @@ fn user_with_effective_surface_can_authorize_account_permission() { account_plan_id: PlanId::new(), account_roles: BTreeSet::new(), effective_surface: effective_surface_for_account(account_id, vec![grant]), + delegation_surface: None, }); assert!(ctx.authorize_permission(&target).is_ok()); diff --git a/golem-service-base/src/storage/blob/s3.rs b/golem-service-base/src/storage/blob/s3.rs index a402211e51..9df674cd5a 100644 --- a/golem-service-base/src/storage/blob/s3.rs +++ b/golem-service-base/src/storage/blob/s3.rs @@ -1192,6 +1192,6 @@ impl http_body::Body for SizedBody { #[inline] fn size_hint(&self) -> SizeHint { - self.hint.clone() + self.hint } } diff --git a/golem-service-base/tests/lib.rs b/golem-service-base/tests/lib.rs index 1fcfdc68b8..da06d03902 100644 --- a/golem-service-base/tests/lib.rs +++ b/golem-service-base/tests/lib.rs @@ -13,5 +13,6 @@ // limitations under the License. pub mod blob_storage; +pub mod registry; test_r::enable!(); diff --git a/golem-service-base/tests/registry.rs b/golem-service-base/tests/registry.rs new file mode 100644 index 0000000000..b30c3a4e70 --- /dev/null +++ b/golem-service-base/tests/registry.rs @@ -0,0 +1,123 @@ +// Copyright 2024-2026 Golem Cloud +// +// Licensed under the Golem Source License v1.1 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://license.golem.cloud/LICENSE +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use axum::Router; +use axum::body::Body; +use axum::http::{Response, StatusCode}; +use axum::routing::post; +use chrono::Utc; +use golem_api_grpc::proto::golem::registry::v1::{ + CreateRuntimeCardResponse, CreateRuntimeCardSuccessResponse, RuntimeCardData, + create_runtime_card_response, +}; +use golem_common::model::card::{Card, CardId, CardManagedByRuntimeDerived, StoredCard}; +use golem_common::model::component::ComponentId; +use golem_common::model::environment::EnvironmentId; +use golem_common::model::{AgentId, IdempotencyKey, OplogIndex}; +use golem_service_base::clients::registry::{ + GrpcRegistryService, GrpcRegistryServiceConfig, RegistryService, RegistryServiceError, +}; +use prost::Message; +use test_r::test; + +async fn call_create_runtime_card_with_success_payload( + malformed: bool, +) -> (StoredCard, Result) { + let card = StoredCard::Concrete(Card { + card_id: CardId(uuid::Uuid::nil()), + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: Utc::now(), + expires_at: None, + system_card: false, + managed_by: None, + }); + let response_card_json = if malformed { + b"not valid JSON".to_vec() + } else { + serde_json::to_vec(&card).unwrap() + }; + let response = CreateRuntimeCardResponse { + result: Some(create_runtime_card_response::Result::Success( + CreateRuntimeCardSuccessResponse { + card: Some(RuntimeCardData { + card_id: Some(uuid::Uuid::nil().into()), + card_json: response_card_json, + }), + }, + )), + }; + let mut framed_response = Vec::with_capacity(response.encoded_len() + 5); + framed_response.push(0); + framed_response.extend_from_slice(&(response.encoded_len() as u32).to_be_bytes()); + response.encode(&mut framed_response).unwrap(); + + let app = Router::new().route( + "/golem.registry.v1.RegistryService/CreateRuntimeCard", + post(move || { + let framed_response = framed_response.clone(); + async move { + Response::builder() + .status(StatusCode::OK) + .header("content-type", "application/grpc") + .header("grpc-status", "0") + .body(Body::from(framed_response)) + .unwrap() + } + }), + ); + let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); + let port = listener.local_addr().unwrap().port(); + let server = tokio::spawn(async move { axum::serve(listener, app).await.unwrap() }); + + let service = GrpcRegistryService::new(&GrpcRegistryServiceConfig { + host: "127.0.0.1".to_string(), + port, + ..GrpcRegistryServiceConfig::default() + }); + let provenance = CardManagedByRuntimeDerived { + environment_id: EnvironmentId::new(), + agent_id: AgentId { + component_id: ComponentId::new(), + agent_id: "runtime-card-test".to_string(), + }, + invocation_key: IdempotencyKey::new("runtime-card-test".to_string()), + oplog_index: OplogIndex::from_u64(1), + }; + + let result = service.create_runtime_card(card.clone(), provenance).await; + server.abort(); + (card, result) +} + +#[test] +async fn create_runtime_card_rejects_malformed_success_payload_without_panicking() { + let call = tokio::spawn(call_create_runtime_card_with_success_payload(true)); + let (_, result) = call + .await + .expect("malformed registry responses must not panic the client"); + assert!(matches!( + result, + Err(RegistryServiceError::InternalClientError(_)) + )); +} + +#[test] +async fn create_runtime_card_decodes_success_payload() { + let (expected, result) = call_create_runtime_card_with_success_payload(false).await; + assert_eq!(result.unwrap(), expected); +} diff --git a/golem-test-framework/src/dsl/debug_render.rs b/golem-test-framework/src/dsl/debug_render.rs index 71d39a2dd1..3fb876ba27 100644 --- a/golem-test-framework/src/dsl/debug_render.rs +++ b/golem-test-framework/src/dsl/debug_render.rs @@ -126,6 +126,23 @@ pub fn debug_render_oplog_entry(entry: &PublicOplogEntry) -> String { let _ = writeln!(result, "{pad}target revision: {}", inner.target_revision,); } } + if let Some(wallet_pin) = ¶ms.wallet_pin { + let wallet_id_hash = wallet_pin + .wallet_token + .wallet_id_hash + .iter() + .map(|byte| format!("{byte:02x}")) + .collect::(); + let _ = writeln!(result, "{pad}wallet id hash: {wallet_id_hash}"); + let _ = writeln!( + result, + "{pad}wallet generation: {}", + wallet_pin.wallet_token.generation + ); + if let Some(scope_card_id) = wallet_pin.scope_card_id { + let _ = writeln!(result, "{pad}scope card: {scope_card_id}"); + } + } } PublicOplogEntry::AgentInvocationFinished(params) => { let _ = writeln!(result, "AGENT INVOCATION FINISHED"); @@ -452,11 +469,17 @@ pub fn debug_render_oplog_entry(entry: &PublicOplogEntry) -> String { params.queued_event_index ); let _ = writeln!(result, "{pad}card id: {}", params.card_id); + if let Some(generation) = params.wallet_generation { + let _ = writeln!(result, "{pad}wallet generation: {generation}"); + } } PublicOplogEntry::CardExpired(params) => { let _ = writeln!(result, "CARD EXPIRED"); let _ = writeln!(result, "{pad}at: {}", params.timestamp); let _ = writeln!(result, "{pad}card id: {}", params.card_id); + if let Some(generation) = params.wallet_generation { + let _ = writeln!(result, "{pad}wallet generation: {generation}"); + } } PublicOplogEntry::CardEventQueued(params) => { let _ = writeln!(result, "CARD EVENT QUEUED"); @@ -472,6 +495,9 @@ pub fn debug_render_oplog_entry(entry: &PublicOplogEntry) -> String { params.queued_event_index ); let _ = writeln!(result, "{pad}card id: {}", params.card_id); + if let Some(generation) = params.wallet_generation { + let _ = writeln!(result, "{pad}wallet generation: {generation}"); + } } PublicOplogEntry::CardInstallFailed(params) => { let _ = writeln!(result, "CARD INSTALL FAILED"); @@ -484,6 +510,66 @@ pub fn debug_render_oplog_entry(entry: &PublicOplogEntry) -> String { let _ = writeln!(result, "{pad}card id: {}", params.card_id); let _ = writeln!(result, "{pad}reason: {:?}", params.reason); } + PublicOplogEntry::CardDerived(params) => { + let _ = writeln!(result, "CARD DERIVED"); + let _ = writeln!(result, "{pad}at: {}", params.timestamp); + let _ = writeln!(result, "{pad}card id: {}", params.card_id); + let _ = writeln!(result, "{pad}parent ids: {:?}", params.parent_ids); + if let Some(generation) = params.wallet_generation { + let _ = writeln!(result, "{pad}wallet generation: {generation}"); + } + } + PublicOplogEntry::CardTransferStarted(params) => { + let _ = writeln!(result, "CARD TRANSFER STARTED"); + let _ = writeln!(result, "{pad}at: {}", params.timestamp); + let _ = writeln!(result, "{pad}transfer id: {}", params.transfer_id); + let _ = writeln!(result, "{pad}card id: {}", params.card_id); + let _ = writeln!(result, "{pad}target holder: {:?}", params.target_holder); + if let Some(generation) = params.source_wallet_generation { + let _ = writeln!(result, "{pad}source generation: {generation}"); + } + } + PublicOplogEntry::CardTransferred(params) => { + let _ = writeln!(result, "CARD TRANSFER ADMITTED"); + let _ = writeln!(result, "{pad}at: {}", params.timestamp); + let _ = writeln!(result, "{pad}transfer id: {}", params.transfer_id); + if let Some(source_card_id) = params.source_card_id { + let _ = writeln!(result, "{pad}source card id: {source_card_id}"); + } + let _ = writeln!( + result, + "{pad}installed card id: {}", + params.installed_card_id + ); + let _ = writeln!(result, "{pad}target holder: {:?}", params.target_holder); + if let Some(generation) = params.target_wallet_generation { + let _ = writeln!(result, "{pad}target generation: {generation}"); + } + } + PublicOplogEntry::CardRevokedCascade(params) => { + let _ = writeln!(result, "CARD REVOKED CASCADE"); + let _ = writeln!(result, "{pad}at: {}", params.timestamp); + let _ = writeln!( + result, + "{pad}revoked card ids: {:?}", + params.revoked_card_ids + ); + if let Some(generation) = params.local_wallet_generation { + let _ = writeln!(result, "{pad}local generation: {generation}"); + } + } + PublicOplogEntry::CardTransferConfirmed(params) => { + let _ = writeln!(result, "CARD TRANSFER CONFIRMED"); + let _ = writeln!(result, "{pad}at: {}", params.timestamp); + let _ = writeln!(result, "{pad}transfer id: {}", params.transfer_id); + let _ = writeln!(result, "{pad}source card id: {}", params.source_card_id); + let _ = writeln!( + result, + "{pad}installed card id: {}", + params.installed_card_id + ); + let _ = writeln!(result, "{pad}target holder: {:?}", params.target_holder); + } PublicOplogEntry::HostStreamFrame(params) => { let _ = writeln!(result, "HOST STREAM FRAME"); let _ = writeln!(result, "{pad}at: {}", params.timestamp); diff --git a/golem-test-framework/src/dsl/mod.rs b/golem-test-framework/src/dsl/mod.rs index bce8fed617..bfca37059f 100644 --- a/golem-test-framework/src/dsl/mod.rs +++ b/golem-test-framework/src/dsl/mod.rs @@ -1158,6 +1158,7 @@ pub fn is_worker_execution_error( pub fn worker_error_message(error: &WorkerExecutorError) -> String { match error { WorkerExecutorError::InvalidRequest { details } => details.clone(), + WorkerExecutorError::PermissionDenied { details } => details.clone(), WorkerExecutorError::AgentAlreadyExists { agent_id } => { format!("Worker already exists: {:?}", agent_id) } diff --git a/golem-worker-executor-test-utils/src/dsl_impl.rs b/golem-worker-executor-test-utils/src/dsl_impl.rs index 08c1e09f52..f9bb0cf2a7 100644 --- a/golem-worker-executor-test-utils/src/dsl_impl.rs +++ b/golem-worker-executor-test-utils/src/dsl_impl.rs @@ -465,6 +465,7 @@ impl TestDsl for TestWorkerExecutor { freshness_disposition: workerexecutor::v1::InvocationFreshnessDisposition::MayExist as i32, config: Vec::new(), + scope_card: None, }) .await; @@ -519,6 +520,7 @@ impl TestDsl for TestWorkerExecutor { freshness_disposition: workerexecutor::v1::InvocationFreshnessDisposition::MayExist as i32, config: Vec::new(), + scope_card: None, }) .await; diff --git a/golem-worker-executor-test-utils/src/lib.rs b/golem-worker-executor-test-utils/src/lib.rs index 3c67088e82..1316939fca 100644 --- a/golem-worker-executor-test-utils/src/lib.rs +++ b/golem-worker-executor-test-utils/src/lib.rs @@ -35,7 +35,9 @@ use golem_common::model::account::{AccountEmail, AccountId}; use golem_common::model::agent::{AgentMode, ParsedAgentId}; use golem_common::model::application::ApplicationId; use golem_common::model::auth::{AccountRole, TokenSecret}; -use golem_common::model::card::{Card, CardId, StoredCard}; +use golem_common::model::card::{ + Card, CardId, CardManagedByRuntimeDerived, StoredCard, parse_permission_fields, +}; use golem_common::model::component::ComponentRevision; use golem_common::model::component::{CanonicalFilePath, ComponentId}; use golem_common::model::environment::EnvironmentId; @@ -132,7 +134,7 @@ use golem_worker_executor::services::worker::WorkerService; use golem_worker_executor::services::worker_enumeration::WorkerEnumerationService; use golem_worker_executor::services::worker_event::WorkerEventService; use golem_worker_executor::services::worker_fork::WorkerForkService; -use golem_worker_executor::services::worker_proxy::WorkerProxy; +use golem_worker_executor::services::worker_proxy::{RemoteWorkerProxy, WorkerProxy}; use golem_worker_executor::services::{HasAll, NoAdditionalDeps, rdbms}; use golem_worker_executor::storage::keyvalue::KeyValueStorage; use golem_worker_executor::worker::{RetryDecision, Worker}; @@ -584,9 +586,27 @@ impl TestWorkerExecutor { lower: Vec::new(), upper: Vec::new(), }, + delegation_surface: None, }) } + pub async fn commit_oplog_entry_bypassing_worker_status( + &self, + agent_id: &AgentId, + entry: OplogEntry, + ) -> anyhow::Result { + let owned_agent_id = OwnedAgentId::new(self.context.default_environment_id, agent_id); + let worker = self + .additional_test_deps + .try_get_worker(&owned_agent_id) + .await + .ok_or_else(|| anyhow!("worker is not loaded: {owned_agent_id}"))?; + let oplog = golem_worker_executor::services::HasOplog::oplog(worker.as_ref()); + let oplog_index = oplog.add(entry).await; + oplog.commit(CommitLevel::Always).await; + Ok(oplog_index) + } + pub async fn store_component_with_id( &self, name: &str, @@ -975,6 +995,8 @@ type WrapKeyValueServiceFn = type WrapBlobStoreServiceFn = dyn Fn(Arc) -> Arc + Send + Sync; type WrapRpcFn = dyn Fn(Arc) -> Arc + Send + Sync; +type WrapWorkerProxyFn = dyn Fn(Arc) -> Arc + Send + Sync; +type CreateCardServiceFn = dyn Fn() -> Arc + Send + Sync; type CreateDirectInvocationAuthFn = dyn Fn() -> Arc + Send + Sync; #[derive(Clone, Default)] @@ -983,6 +1005,8 @@ pub struct TestExecutorOverrides { pub wrap_key_value_service: Option>, pub wrap_blob_store_service: Option>, pub wrap_rpc: Option>, + pub wrap_worker_proxy: Option>, + pub create_card_service: Option>, pub create_direct_invocation_auth: Option>, /// Named retry policies that the executor's `EnvironmentStateService` /// should expose to running agents (mirrors `retryPolicyDefaults` in @@ -1399,6 +1423,10 @@ impl InvocationHooks for TestWorkerCtx { .await } + async fn on_agent_invocation_finished(&mut self) { + self.durable_ctx.on_agent_invocation_finished().await + } + async fn on_invocation_failure( &mut self, full_function_name: &str, @@ -1766,9 +1794,10 @@ impl HostWasmRpc for TestWorkerCtx { self_: Resource, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result> { self.durable_ctx - .invoke_and_await(self_, method_name, input) + .invoke_and_await(self_, method_name, input, scope_card) .await } @@ -1777,8 +1806,11 @@ impl HostWasmRpc for TestWorkerCtx { self_: Resource, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result> { - self.durable_ctx.invoke(self_, method_name, input).await + self.durable_ctx + .invoke(self_, method_name, input, scope_card) + .await } async fn async_invoke_and_await( @@ -1786,9 +1818,10 @@ impl HostWasmRpc for TestWorkerCtx { self_: Resource, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result { self.durable_ctx - .async_invoke_and_await(self_, method_name, input) + .async_invoke_and_await(self_, method_name, input, scope_card) .await } @@ -1798,9 +1831,10 @@ impl HostWasmRpc for TestWorkerCtx { scheduled_time: wasmtime_wasi::p3::bindings::clocks::system_clock::Instant, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result { self.durable_ctx - .schedule_invocation(self_, scheduled_time, method_name, input) + .schedule_invocation(self_, scheduled_time, method_name, input, scope_card) .await } @@ -1810,9 +1844,10 @@ impl HostWasmRpc for TestWorkerCtx { scheduled_time: wasmtime_wasi::p3::bindings::clocks::system_clock::Instant, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result { self.durable_ctx - .schedule_cancelable_invocation(self_, scheduled_time, method_name, input) + .schedule_cancelable_invocation(self_, scheduled_time, method_name, input, scope_card) .await } @@ -1921,6 +1956,15 @@ impl Bootstrap for TestServerBootstrap { Arc::new(golem_worker_executor::services::quota::UnlimitedQuotaService) } + fn create_worker_proxy(&self, golem_config: &GolemConfig) -> Arc { + let worker_proxy = Arc::new(RemoteWorkerProxy::new(&golem_config.public_worker_api)); + if let Some(wrap) = &self.overrides.wrap_worker_proxy { + wrap(worker_proxy) + } else { + worker_proxy + } + } + fn create_environment_state_service( &self, _config: &EnvironmentStateServiceConfig, @@ -1952,7 +1996,11 @@ impl Bootstrap for TestServerBootstrap { &self, _registry_service: Arc, ) -> Arc { - Arc::new(TestCardService) + if let Some(create) = &self.overrides.create_card_service { + create() + } else { + Arc::new(TestCardService) + } } fn create_additional_deps( @@ -3539,6 +3587,7 @@ impl Rpc for FailingRpc { self_stack: InvocationContextStack, config: Vec, auth_ctx: &AuthCtx, + scope_card: Option, ) -> Result { if self .remaining_failures @@ -3562,6 +3611,7 @@ impl Rpc for FailingRpc { self_stack, config, auth_ctx, + scope_card, ) .await } @@ -3601,12 +3651,35 @@ impl Rpc for FailingRpc { pub const TEST_CARD_ID: CardId = CardId(uuid!("b7f515b3-eabb-4a39-8d94-fe6078ed441e")); +pub fn registry_test_card() -> StoredCard { + StoredCard::Concrete(Card { + card_id: TEST_CARD_ID, + parent_ids: Vec::new(), + lower_positive: vec![parse_permission_fields("card", "*", "*", "inspect", "*").unwrap()], + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: DateTime::from_timestamp_nanos(0), + expires_at: None, + system_card: false, + managed_by: None, + }) +} + pub struct TestCardService; #[async_trait] impl CardService for TestCardService { async fn record_revoked_cards(&self, _card_ids: &[CardId]) {} + async fn create_runtime_card( + &self, + card: StoredCard, + _provenance: CardManagedByRuntimeDerived, + ) -> Result { + Ok(card) + } + async fn check_cards( &self, card_ids: Vec, @@ -3615,18 +3688,7 @@ impl CardService for TestCardService { for card_id in card_ids { let card_state = if card_id == TEST_CARD_ID { - CardState::Live(Box::new(StoredCard::Concrete(Card { - card_id: TEST_CARD_ID, - parent_ids: Vec::new(), - lower_positive: Vec::new(), - lower_negative: Vec::new(), - upper_positive: Vec::new(), - upper_negative: Vec::new(), - created_at: DateTime::from_timestamp_nanos(0), - expires_at: None, - system_card: false, - managed_by: None, - }))) + CardState::Live(Box::new(registry_test_card())) } else { CardState::Unknown }; diff --git a/golem-worker-executor/benches/invocation_lowering.rs b/golem-worker-executor/benches/invocation_lowering.rs index 066f66f99d..d677c7238e 100644 --- a/golem-worker-executor/benches/invocation_lowering.rs +++ b/golem-worker-executor/benches/invocation_lowering.rs @@ -176,6 +176,7 @@ fn agent_method_invocation() -> AgentInvocation { input: method_input_value(), invocation_context: InvocationContextStack::fresh(), principal: Principal::anonymous(), + scope_card: None, } } diff --git a/golem-worker-executor/src/durable_host/concurrent/call.rs b/golem-worker-executor/src/durable_host/concurrent/call.rs index ba2a10bd6e..703b843b26 100644 --- a/golem-worker-executor/src/durable_host/concurrent/call.rs +++ b/golem-worker-executor/src/durable_host/concurrent/call.rs @@ -2883,24 +2883,153 @@ where ); update_state_to_new_component_revision_access(store, get_ctx, new_revision).await?; } - crate::durable_host::replay_state::ReplayEvent::CardInstalled { card } => { - store.with(|mut access| { + crate::durable_host::replay_state::ReplayEvent::InvocationWalletPinned { + wallet_pin, + } => { + store.with(|mut access| -> Result<(), WorkerExecutorError> { + let ctx = get_ctx(access.data_mut()); + if crate::durable_host::apply_invocation_wallet_pin( + &mut ctx.state.agent_wallet_cards, + ctx.state.wallet_id_hash, + &mut ctx.state.wallet_generation, + wallet_pin, + )? { + ctx.rederive_agent_effective_surface_from_wallet(); + } + Ok(()) + })?; + } + crate::durable_host::replay_state::ReplayEvent::CardInstalled { + card, + wallet_generation, + } => { + store.with(|mut access| -> Result<(), WorkerExecutorError> { let ctx = get_ctx(access.data_mut()); let card_id = card.card_id(); tracing::debug!(card_id = %card_id, "Applying replayed card installation"); - ctx.state.agent_wallet_cards.insert(card_id, card); - ctx.rederive_agent_effective_surface_from_wallet(); - }); + if crate::durable_host::add_wallet_card( + &mut ctx.state.agent_wallet_cards, + &mut ctx.state.wallet_generation, + card, + )? { + ctx.rederive_agent_effective_surface_from_wallet(); + } + crate::durable_host::adopt_recorded_wallet_generation( + &mut ctx.state.wallet_generation, + wallet_generation, + ) + })?; } - crate::durable_host::replay_state::ReplayEvent::CardRevoked { card_id } - | crate::durable_host::replay_state::ReplayEvent::CardExpired { card_id } => { + crate::durable_host::replay_state::ReplayEvent::CardDerived { + wallet_generation, + .. + } => { store.with(|mut access| { let ctx = get_ctx(access.data_mut()); - tracing::debug!(card_id = %card_id, "Applying replayed card removal"); - if ctx.state.agent_wallet_cards.remove(&card_id).is_some() { + crate::durable_host::adopt_recorded_wallet_generation( + &mut ctx.state.wallet_generation, + wallet_generation, + ) + })?; + } + crate::durable_host::replay_state::ReplayEvent::CardTransferStarted { + card_id, + source_holder, + source_wallet_generation, + .. + } => { + store.with(|mut access| -> Result<(), WorkerExecutorError> { + let ctx = get_ctx(access.data_mut()); + if source_holder.as_ref().is_none_or(|source_holder| { + crate::durable_host::card_holder_is_agent( + source_holder, + &ctx.owned_agent_id.agent_id, + ) + }) && crate::durable_host::transfer_started_removes_source_membership( + ctx.state.agent_wallet_cards.get(&card_id), + &source_holder, + &ctx.owned_agent_id.agent_id, + ) && crate::durable_host::remove_wallet_card( + &mut ctx.state.agent_wallet_cards, + &mut ctx.state.wallet_generation, + card_id, + )? { ctx.rederive_agent_effective_surface_from_wallet(); } - }); + crate::durable_host::adopt_recorded_wallet_generation( + &mut ctx.state.wallet_generation, + source_wallet_generation, + ) + })?; + } + crate::durable_host::replay_state::ReplayEvent::CardTransferred { + target_holder, + card, + target_wallet_generation, + .. + } => { + store.with(|mut access| -> Result<(), WorkerExecutorError> { + let ctx = get_ctx(access.data_mut()); + if crate::durable_host::card_holder_is_agent( + &target_holder, + &ctx.owned_agent_id.agent_id, + ) && crate::durable_host::add_wallet_card( + &mut ctx.state.agent_wallet_cards, + &mut ctx.state.wallet_generation, + card, + )? { + ctx.rederive_agent_effective_surface_from_wallet(); + } + crate::durable_host::adopt_recorded_wallet_generation( + &mut ctx.state.wallet_generation, + target_wallet_generation, + ) + })?; + } + crate::durable_host::replay_state::ReplayEvent::CardTransferConfirmed { .. } => {} + crate::durable_host::replay_state::ReplayEvent::CardRevokedCascade { + card_ids, + local_wallet_generation, + } => { + store.with(|mut access| -> Result<(), WorkerExecutorError> { + let ctx = get_ctx(access.data_mut()); + let wallet_changed = crate::durable_host::remove_wallet_cards( + &mut ctx.state.agent_wallet_cards, + &mut ctx.state.wallet_generation, + &card_ids, + )?; + let scope_changed = ctx.clear_invocation_scope_if_roots_include(&card_ids); + if wallet_changed || scope_changed { + ctx.rederive_agent_effective_surface_from_wallet(); + } + crate::durable_host::adopt_recorded_wallet_generation( + &mut ctx.state.wallet_generation, + local_wallet_generation, + ) + })?; + } + crate::durable_host::replay_state::ReplayEvent::CardRevoked { + card_id, + wallet_generation, + } + | crate::durable_host::replay_state::ReplayEvent::CardExpired { + card_id, + wallet_generation, + } => { + store.with(|mut access| -> Result<(), WorkerExecutorError> { + let ctx = get_ctx(access.data_mut()); + if crate::durable_host::remove_wallet_card( + &mut ctx.state.agent_wallet_cards, + &mut ctx.state.wallet_generation, + card_id, + )? { + ctx.rederive_agent_effective_surface_from_wallet(); + } + crate::durable_host::adopt_recorded_wallet_generation( + &mut ctx.state.wallet_generation, + wallet_generation, + ) + })?; } crate::durable_host::replay_state::ReplayEvent::ReplayFinished => { tracing::debug!("Replaying oplog finished"); diff --git a/golem-worker-executor/src/durable_host/concurrent/delivery.rs b/golem-worker-executor/src/durable_host/concurrent/delivery.rs index b3899bdc92..233d3a7d76 100644 --- a/golem-worker-executor/src/durable_host/concurrent/delivery.rs +++ b/golem-worker-executor/src/durable_host/concurrent/delivery.rs @@ -360,6 +360,7 @@ impl CompletionDelivery { }, oplog.clone(), golem_common::model::regions::DeletedRegions::default(), + None, ) .await?; Ok(Self { diff --git a/golem-worker-executor/src/durable_host/concurrent/tests.rs b/golem-worker-executor/src/durable_host/concurrent/tests.rs index b010ec0b90..6d4388b1b9 100644 --- a/golem-worker-executor/src/durable_host/concurrent/tests.rs +++ b/golem-worker-executor/src/durable_host/concurrent/tests.rs @@ -371,6 +371,7 @@ async fn live_delivery_token( }, seed_oplog_dyn, golem_common::model::regions::DeletedRegions::default(), + None, ) .await .expect("failed to build replay state"); @@ -854,6 +855,7 @@ async fn access_terminal_end_is_appended_before_cleanup_and_permit_release() { }, persist_oplog.clone(), golem_common::model::regions::DeletedRegions::default(), + None, ) .await .expect("failed to build replay state"); diff --git a/golem-worker-executor/src/durable_host/golem/v1x.rs b/golem-worker-executor/src/durable_host/golem/v1x.rs index b43e1912e6..c6cabe34b9 100644 --- a/golem-worker-executor/src/durable_host/golem/v1x.rs +++ b/golem-worker-executor/src/durable_host/golem/v1x.rs @@ -44,24 +44,20 @@ use crate::workerctx::{StatusManagement, WorkerCtx}; use anyhow::anyhow; use async_trait::async_trait; use golem_common::model::agent::ParsedAgentId; -use golem_common::model::card::CardId; use golem_common::model::component::{ComponentId, ComponentRevision}; -use golem_common::model::oplog::CardInstallFailure; use golem_common::model::oplog::host_functions::{ - GolemApiCompletePromise, GolemApiCreatePromise, GolemApiDeriveCard, GolemApiFork, - GolemApiForkWorker, GolemApiGenerateIdempotencyKey, GolemApiGetAgentMetadata, - GolemApiGetPromiseResult, GolemApiGetSelfMetadata, GolemApiInstallCard, - GolemApiResolveAgentIdStrict, GolemApiResolveComponentId, GolemApiRevertWorker, - GolemApiUpdateWorker, + GolemApiCompletePromise, GolemApiCreatePromise, GolemApiFork, GolemApiForkWorker, + GolemApiGenerateIdempotencyKey, GolemApiGetAgentMetadata, GolemApiGetPromiseResult, + GolemApiGetSelfMetadata, GolemApiResolveAgentIdStrict, GolemApiResolveComponentId, + GolemApiRevertWorker, GolemApiUpdateWorker, }; use golem_common::model::oplog::types::AgentMetadataForGuests; use golem_common::model::oplog::{ - DurableFunctionType, HostRequestGolemApiAgentId, HostRequestGolemApiCard, - HostRequestGolemApiComponentSlug, HostRequestGolemApiComponentSlugAndAgentName, - HostRequestGolemApiForkAgent, HostRequestGolemApiPromiseId, HostRequestGolemApiRevertAgent, - HostRequestGolemApiUpdateAgent, HostRequestNoInput, HostResponseGolemApiAgentId, - HostResponseGolemApiAgentMetadata, HostResponseGolemApiCard, HostResponseGolemApiComponentId, - HostResponseGolemApiFork, HostResponseGolemApiIdempotencyKey, HostResponseGolemApiInstallCard, + DurableFunctionType, HostRequestGolemApiAgentId, HostRequestGolemApiComponentSlug, + HostRequestGolemApiComponentSlugAndAgentName, HostRequestGolemApiForkAgent, + HostRequestGolemApiPromiseId, HostRequestGolemApiRevertAgent, HostRequestGolemApiUpdateAgent, + HostRequestNoInput, HostResponseGolemApiAgentId, HostResponseGolemApiAgentMetadata, + HostResponseGolemApiComponentId, HostResponseGolemApiFork, HostResponseGolemApiIdempotencyKey, HostResponseGolemApiPromiseCompletion, HostResponseGolemApiPromiseId, HostResponseGolemApiPromiseResult, HostResponseGolemApiSelfAgentMetadata, HostResponseGolemApiUnit, OplogEntry, PersistenceLevel, PublicOplogEntry, @@ -109,28 +105,6 @@ fn classify_worker_executor_error(err: &WorkerExecutorError) -> HostFailureKind } } -fn card_install_failure_to_wit( - failure: CardInstallFailure, -) -> golem_api_1_x::host::CardInstallError { - match failure { - CardInstallFailure::CardRevoked => golem_api_1_x::host::CardInstallError::Revoked, - CardInstallFailure::NotFound => golem_api_1_x::host::CardInstallError::NotFound, - CardInstallFailure::RecipientMismatch | CardInstallFailure::NotPermitted => { - golem_api_1_x::host::CardInstallError::NotPermitted - } - } -} - -fn card_id_to_wit(card_id: CardId) -> golem_api_1_x::host::CardId { - golem_api_1_x::host::CardId { - uuid: card_id.0.into(), - } -} - -fn card_id_from_wit(card_id: golem_api_1_x::host::CardId) -> CardId { - CardId(card_id.uuid.into()) -} - impl HostGetAgents for DurableWorkerCtx { async fn new( &mut self, @@ -731,88 +705,6 @@ impl Host for DurableWorkerCtx { Ok(result.uuid.into()) } - async fn self_card(&mut self) -> anyhow::Result> { - self.observe_function_call("golem::api", "self-card"); - Ok(self - .state - .agent_wallet_cards - .keys() - .next() - .copied() - .map(|card_id| golem_api_1_x::host::Card { - card_id: card_id_to_wit(card_id), - })) - } - - async fn derive_card( - &mut self, - card: golem_api_1_x::host::Card, - ) -> anyhow::Result> { - let card_id = card_id_from_wit(card.card_id); - let handle = CallHandle::::start( - self, - HostRequestGolemApiCard { card_id: card_id.0 }, - DurableFunctionType::ReadLocal, - ) - .await?; - - let result = handle - .run(self, async move |ctx| { - let result = if ctx.state.agent_wallet_cards.contains_key(&card_id) { - Ok(card_id.0) - } else { - Err("card is not installed in this agent wallet".to_string()) - }; - - Ok::<_, anyhow::Error>(HostResponseGolemApiCard { result }) - }) - .await?; - - Ok(result.result.map(|card_id| golem_api_1_x::host::Card { - card_id: card_id_to_wit(CardId(card_id)), - })) - } - - async fn install_card( - &mut self, - card: golem_api_1_x::host::Card, - ) -> anyhow::Result> { - let card_id = card_id_from_wit(card.card_id); - let handle = CallHandle::::start( - self, - HostRequestGolemApiCard { card_id: card_id.0 }, - DurableFunctionType::WriteLocal, - ) - .await?; - - let result = handle - .run(self, async move |ctx| { - let card = ctx - .state - .card_service - .check_cards(vec![card_id]) - .await? - .remove(&card_id); - let result = match card { - Some(crate::services::card::CardState::Live(card)) => { - ctx.apply_card_install(None, *card).await? - } - Some(crate::services::card::CardState::Revoked) => { - Err(CardInstallFailure::CardRevoked) - } - Some(crate::services::card::CardState::Unknown) => { - Err(CardInstallFailure::NotFound) - } - None => Err(CardInstallFailure::NotFound), - }; - - Ok::<_, anyhow::Error>(HostResponseGolemApiInstallCard { result }) - }) - .await?; - - Ok(result.result.map_err(card_install_failure_to_wit)) - } - async fn update_agent( &mut self, agent_id: golem_api_1_x::host::AgentId, @@ -1382,18 +1274,19 @@ impl HostGetOplog for DurableWorkerCtx { .map_err(|msg| anyhow!(msg))?; if chunk.next_oplog_index != entry.next_oplog_index { + let entries = chunk + .entries + .into_iter() + .map(TryInto::try_into) + .collect::, String>>() + .map_err(|error| { + anyhow!("cannot project oplog entry to golem:api/oplog@1.5.0: {error}") + })?; self.as_wasi_view() .table() .get_mut(&self_)? .update(chunk.next_oplog_index, chunk.current_component_revision); - Ok(Some( - chunk - .entries - .into_iter() - .map(|entry| entry.try_into()) - .collect::, String>>() - .map_err(|msg| anyhow!(msg))?, - )) + Ok(Some(entries)) } else { Ok(None) } @@ -1685,22 +1578,23 @@ impl HostSearchOplog for DurableWorkerCtx { .map_err(|msg| anyhow!(msg))?; if chunk.next_oplog_index != entry.next_oplog_index { + let entries = chunk + .entries + .into_iter() + .map(|(idx, entry)| { + let idx: golem_api_1_x::oplog::OplogIndex = idx.into(); + let entry: golem_api_1_x::oplog::PublicOplogEntry = entry.try_into()?; + Ok((idx, entry)) + }) + .collect::, String>>() + .map_err(|error| { + anyhow!("cannot project oplog entry to golem:api/oplog@1.5.0: {error}") + })?; self.as_wasi_view() .table() .get_mut(&self_)? .update(chunk.next_oplog_index, chunk.current_component_revision); - Ok(Some( - chunk - .entries - .into_iter() - .map(|(idx, entry)| { - let idx: golem_api_1_x::oplog::OplogIndex = idx.into(); - let entry: golem_api_1_x::oplog::PublicOplogEntry = entry.try_into()?; - Ok((idx, entry)) - }) - .collect::, String>>() - .map_err(|msg| anyhow!(msg))?, - )) + Ok(Some(entries)) } else { Ok(None) } @@ -1864,7 +1758,7 @@ impl OplogHost for DurableWorkerCtx { let wit_entry: golem_api_1_x::oplog::PublicOplogEntry = match public_entry.try_into() { Ok(entry) => entry, - Err(e) => return Ok(Err(e)), + Err(error) => return Ok(Err(error)), }; result.push(wit_entry); } diff --git a/golem-worker-executor/src/durable_host/mod.rs b/golem-worker-executor/src/durable_host/mod.rs index d5f439ba0c..3ccb5591df 100644 --- a/golem-worker-executor/src/durable_host/mod.rs +++ b/golem-worker-executor/src/durable_host/mod.rs @@ -28,6 +28,7 @@ pub mod io; pub mod keyvalue; mod logging; pub mod p3; +mod permissions; pub mod quota; mod random; pub mod rdbms; @@ -103,7 +104,10 @@ use golem_common::base_model::oplog::{CardInstallFailure, QueuedCardEvent}; use golem_common::model::TransactionId; use golem_common::model::account::{AccountEmail, AccountId}; use golem_common::model::agent::{AgentMode, ParsedAgentId, Principal}; -use golem_common::model::card::{CardId, StoredCard}; +use golem_common::model::card::{ + AgentCardHolder, CardHolder, CardId, InvocationWalletPin, ScopeCard, StoredCard, + WalletVersionToken, +}; use golem_common::model::component::{ AgentFilePermissions, CanonicalFilePath, ComponentId, ComponentRevision, InitialAgentFile, }; @@ -128,6 +132,7 @@ use golem_common::model::{ use golem_common::model::{PredicateValue, RetryPolicyState, RetryProperties}; use golem_common::resource_runtime::Uri; use golem_common::resource_runtime::{ResourceStore, ResourceTypeId}; +use golem_schema::schema::wit::PermissionCardHandleRep; use golem_service_base::error::worker_executor::{ GolemSpecificWasmTrap, InterruptKind, WorkerExecutorError, }; @@ -138,7 +143,7 @@ use golem_service_base::model::{ use http_body_util::BodyExt; use http_body_util::combinators::UnsyncBoxBody; use replay_state::ReplayEvent; -use std::collections::{BTreeMap, HashMap, HashSet}; +use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::error::Error; use std::fmt::{Debug, Display, Formatter}; use std::future::Future; @@ -320,7 +325,7 @@ pub(crate) fn agent_effective_surface_from_component_metadata( Ok(golem_common::model::card::agent_effective_surface_from_wallet(&context, [&card])) } -fn agent_monomorphization_context( +pub(crate) fn agent_monomorphization_context( component: &Component, owned_agent_id: &OwnedAgentId, agent_id: &ParsedAgentId, @@ -407,6 +412,52 @@ impl Drop for StoreAliveGuard { } } +const DERIVED_CARD_ID_CONTEXT: &str = "golem:permissions:derived-card-id:v1"; +const TRANSFER_ID_CONTEXT: &str = "golem:permissions:transfer-id:v1"; +const INSTALLED_CHILD_CARD_ID_CONTEXT: &str = "golem:permissions:installed-child-card-id:v1"; +const SCOPE_CARD_ID_CONTEXT: &str = "golem:permissions:scope-card-id:v1"; +const UUID_V7_MAX_TIMESTAMP: u64 = (1_u64 << 48) - 1; + +fn derive_permission_uuid( + context: &'static str, + owned_agent_id: &OwnedAgentId, + invocation_key: &IdempotencyKey, + oplog_index: OplogIndex, +) -> Uuid { + derive_permission_uuid_for_sequence( + context, + owned_agent_id, + invocation_key, + oplog_index.as_u64(), + ) +} + +fn derive_permission_uuid_for_sequence( + context: &'static str, + owned_agent_id: &OwnedAgentId, + invocation_key: &IdempotencyKey, + sequence: u64, +) -> Uuid { + let agent_name = owned_agent_id.agent_id.agent_id.as_bytes(); + let invocation_key = invocation_key.value.as_bytes(); + let mut hasher = blake3::Hasher::new_derive_key(context); + hasher.update(owned_agent_id.environment_id.0.as_bytes()); + hasher.update(owned_agent_id.agent_id.component_id.0.as_bytes()); + hasher.update(&(agent_name.len() as u64).to_be_bytes()); + hasher.update(agent_name); + hasher.update(&(invocation_key.len() as u64).to_be_bytes()); + hasher.update(invocation_key); + hasher.update(&sequence.to_be_bytes()); + + let mut bytes = [0_u8; 16]; + let timestamp = sequence.min(UUID_V7_MAX_TIMESTAMP); + bytes[..6].copy_from_slice(×tamp.to_be_bytes()[2..]); + bytes[6..].copy_from_slice(&hasher.finalize().as_bytes()[..10]); + bytes[6] = (bytes[6] & 0x0f) | 0x70; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + Uuid::from_bytes(bytes) +} + /// Guard for the per-invocation wall-clock deadline; see /// [`DurableWorkerCtx::arm_invocation_deadline`]. Holds the shared latch and the timer task; /// dropping it aborts the timer and clears the latch so the deadline never outlives its @@ -467,6 +518,58 @@ impl Drop for TailWorkDeadline { } impl DurableWorkerCtx { + pub(crate) fn derive_card_id( + &self, + invocation_key: &IdempotencyKey, + oplog_index: OplogIndex, + ) -> CardId { + CardId(derive_permission_uuid( + DERIVED_CARD_ID_CONTEXT, + &self.owned_agent_id, + invocation_key, + oplog_index, + )) + } + + pub(crate) fn derive_transfer_id( + &self, + invocation_key: &IdempotencyKey, + oplog_index: OplogIndex, + ) -> Uuid { + derive_permission_uuid( + TRANSFER_ID_CONTEXT, + &self.owned_agent_id, + invocation_key, + oplog_index, + ) + } + + pub(crate) fn derive_installed_child_card_id( + &self, + invocation_key: &IdempotencyKey, + oplog_index: OplogIndex, + ) -> CardId { + CardId(derive_permission_uuid( + INSTALLED_CHILD_CARD_ID_CONTEXT, + &self.owned_agent_id, + invocation_key, + oplog_index, + )) + } + + pub(crate) fn derive_scope_card_id( + &self, + invocation_key: &IdempotencyKey, + ordinal: u64, + ) -> CardId { + CardId(derive_permission_uuid_for_sequence( + SCOPE_CARD_ID_CONTEXT, + &self.owned_agent_id, + invocation_key, + ordinal, + )) + } + pub(crate) fn derive_idempotency_key(&mut self, oplog_index: OplogIndex) -> IdempotencyKey { let current_idempotency_key = self .state @@ -874,10 +977,25 @@ impl DurableWorkerCtx { } pub fn agent_auth_ctx(&self) -> AuthCtx { - AuthCtx::agent_with_effective_surface( + let delegation_surface = if let Some(agent_id) = self.state.agent_id.as_ref() { + let context = agent_monomorphization_context( + &self.state.component_metadata, + &self.owned_agent_id, + agent_id, + ); + golem_common::model::card::agent_delegation_surface_from_wallet( + &context, + self.state.agent_wallet_cards.values(), + ) + } else { + golem_common::model::card::DelegationSurface::default() + }; + + AuthCtx::agent_with_permission_surfaces( self.created_by(), self.created_by_email().clone(), self.agent_effective_surface(), + delegation_surface, ) } @@ -885,6 +1003,14 @@ impl DurableWorkerCtx { self.state.agent_wallet_cards.values().cloned().collect() } + pub(crate) fn wallet_id_hash(&self) -> [u8; 32] { + self.state.wallet_id_hash + } + + pub(crate) fn wallet_generation(&self) -> u64 { + self.state.wallet_generation + } + pub(crate) async fn active_agent_wallet_cards_snapshot( &mut self, ) -> Result, WorkerExecutorError> { @@ -898,7 +1024,9 @@ impl DurableWorkerCtx { .into_iter() .filter_map(|pending_event| match pending_event.event { QueuedCardEvent::Revoke(event) => Some(event.card_id), - QueuedCardEvent::Install(_) => None, + QueuedCardEvent::Install(_) + | QueuedCardEvent::TransferStarted(_) + | QueuedCardEvent::TransferReceived(_) => None, }) .collect::>(); let wallet = self @@ -929,26 +1057,104 @@ impl DurableWorkerCtx { &self.owned_agent_id, agent_id, ); - golem_common::model::card::agent_effective_surface_from_wallet( + golem_common::model::card::agent_effective_surface_from_wallet_and_scope( &context, self.state.agent_wallet_cards.values(), + self.state.invocation_scope_card.as_ref(), ) } else { golem_common::model::card::EffectiveSurface::default() }; } + fn interested_card_ids(&self) -> Vec { + let mut card_ids = self + .state + .agent_wallet_cards + .keys() + .copied() + .collect::>(); + if let Some(scope_card) = &self.state.invocation_scope_card { + card_ids.extend(scope_card.root_card_ids.iter().copied()); + } + card_ids.into_iter().collect() + } + + async fn refresh_card_interest(&self) { + self.state + .card_interest_index + .set_card_interest(self.owned_agent_id.clone(), &self.interested_card_ids()) + .await; + } + + async fn install_invocation_scope_card(&mut self, scope_card: Option) { + let (_, handles) = clear_invocation_scope_state( + &mut self.state.invocation_scope_card, + &mut self.state.invocation_scope_handles, + ); + for rep in handles { + let _ = self + .table() + .delete(Resource::::new_own(rep)); + } + self.state.invocation_scope_card = scope_card; + self.rederive_agent_effective_surface_from_wallet(); + self.refresh_card_interest().await; + } + + async fn clear_invocation_scope_card(&mut self) { + let (scope_changed, handles) = clear_invocation_scope_state( + &mut self.state.invocation_scope_card, + &mut self.state.invocation_scope_handles, + ); + for rep in handles { + let _ = self + .table() + .delete(Resource::::new_own(rep)); + } + if scope_changed { + self.rederive_agent_effective_surface_from_wallet(); + } + self.refresh_card_interest().await; + } + + fn clear_invocation_scope_if_roots_include(&mut self, card_ids: &[CardId]) -> bool { + let (scope_changed, handles) = remove_invocation_scope_for_revoked_roots( + &mut self.state.invocation_scope_card, + &mut self.state.invocation_scope_handles, + card_ids, + ); + for rep in handles { + let _ = self + .table() + .delete(Resource::::new_own(rep)); + } + scope_changed + } + async fn drain_card_events_at_boundary(&mut self) -> Result<(), WorkerExecutorError> { if !self.state.is_live() { return Ok(()); } - while let Some(pending_event) = self.pending_card_events_at_boundary().await?.first() { + loop { + let pending_events = + next_drainable_card_events(self.pending_card_events_at_boundary().await?); + let Some(pending_event) = pending_events.first() else { + break; + }; match &pending_event.event { - QueuedCardEvent::Revoke(event) => { - let card_id = event.card_id; - self.apply_card_revoked(card_id, pending_event.oplog_index, true) - .await?; + QueuedCardEvent::Revoke(_) => { + let card_ids = pending_events + .into_iter() + .filter_map(|pending_event| match pending_event.event { + QueuedCardEvent::Revoke(event) => Some(event.card_id), + QueuedCardEvent::Install(_) + | QueuedCardEvent::TransferStarted(_) + | QueuedCardEvent::TransferReceived(_) => None, + }) + .collect::>(); + self.apply_card_revoked_cascade(&card_ids, true).await?; } QueuedCardEvent::Install(event) => { let Some(card) = event.card.clone() else { @@ -960,10 +1166,58 @@ impl DurableWorkerCtx { .apply_card_install(Some(pending_event.oplog_index), card) .await?; } + QueuedCardEvent::TransferReceived(event) => { + let Some(card) = event.card.clone() else { + return Err(WorkerExecutorError::runtime( + "received card transfer is missing card payload", + )); + }; + let _ = self + .apply_received_card_transfer( + pending_event.oplog_index, + event.transfer_id, + event.source_card_id, + card, + ) + .await?; + } + QueuedCardEvent::TransferStarted(_) => { + unreachable!("filtered above") + } } } - self.remove_expired_cards().await; + self.remove_expired_cards().await?; + self.revalidate_invocation_scope_roots().await?; + Ok(()) + } + + async fn revalidate_invocation_scope_roots(&mut self) -> Result<(), WorkerExecutorError> { + let Some(scope_card) = self.state.invocation_scope_card.as_ref() else { + return Ok(()); + }; + let root_card_ids = scope_card.root_card_ids.clone(); + let states = self + .state + .card_service + .check_cards(root_card_ids.clone()) + .await?; + let mut revoked_root_ids = Vec::new(); + for card_id in root_card_ids { + match states.get(&card_id) { + Some(CardState::Live(card)) if card.card_id() == card_id => {} + Some(CardState::Revoked) => revoked_root_ids.push(card_id), + Some(CardState::Live(_)) | Some(CardState::Unknown) | None => { + return Err(WorkerExecutorError::runtime(format!( + "scope-card root {card_id} could not be re-validated at the durable boundary" + ))); + } + } + } + if !revoked_root_ids.is_empty() { + self.apply_card_revoked_cascade(&revoked_root_ids, true) + .await?; + } Ok(()) } @@ -1014,18 +1268,12 @@ impl DurableWorkerCtx { .clone()) } - pub(crate) async fn apply_card_install( + async fn admit_card_to_wallet( &mut self, - queued_event_index: Option, - card: StoredCard, + card: &StoredCard, ) -> Result, WorkerExecutorError> { let card_id = card.card_id(); - let mut candidate_wallet_card_ids = self - .state - .agent_wallet_cards - .keys() - .copied() - .collect::>(); + let mut candidate_wallet_card_ids = self.interested_card_ids(); if !candidate_wallet_card_ids.contains(&card_id) { candidate_wallet_card_ids.push(card_id); } @@ -1041,23 +1289,36 @@ impl DurableWorkerCtx { .await? .remove(&card_id); - if !matches!(card_state, Some(CardState::Live(_))) { - let wallet_card_ids = self - .state - .agent_wallet_cards - .keys() - .copied() - .collect::>(); - self.state - .card_interest_index - .set_card_interest(self.owned_agent_id.clone(), &wallet_card_ids) - .await; + let failure = match card_state { + Some(CardState::Live(registered_card)) if registered_card.as_ref() == card => None, + Some(CardState::Live(_)) => Some(CardInstallFailure::NotPermitted), + Some(CardState::Revoked) => Some(CardInstallFailure::CardRevoked), + Some(CardState::Unknown) | None => Some(CardInstallFailure::NotFound), + }; + if let Some(failure) = failure { + self.refresh_card_interest().await; + return Ok(Err(failure)); + } - let reason = match card_state { - Some(CardState::Revoked) => CardInstallFailure::CardRevoked, - _ => CardInstallFailure::NotFound, - }; + if add_wallet_card( + &mut self.state.agent_wallet_cards, + &mut self.state.wallet_generation, + card.clone(), + )? { + self.rederive_agent_effective_surface_from_wallet(); + } + self.refresh_card_interest().await; + + Ok(Ok(())) + } + pub(crate) async fn apply_card_install( + &mut self, + queued_event_index: Option, + card: StoredCard, + ) -> Result, WorkerExecutorError> { + let card_id = card.card_id(); + if let Err(reason) = self.admit_card_to_wallet(&card).await? { if let Some(queued_event_index) = queued_event_index { self.public_state .worker() @@ -1070,25 +1331,52 @@ impl DurableWorkerCtx { } Ok(Err(reason)) } else { - self.state.agent_wallet_cards.insert(card_id, card.clone()); - self.rederive_agent_effective_surface_from_wallet(); - let wallet_card_ids = self - .state - .agent_wallet_cards - .keys() - .copied() - .collect::>(); - self.state - .card_interest_index - .set_card_interest(self.owned_agent_id.clone(), &wallet_card_ids) + self.public_state + .worker() + .add_and_commit_oplog(OplogEntry::card_installed( + queued_event_index, + card, + Some(self.state.wallet_generation), + )) .await; + Ok(Ok(())) + } + } + async fn apply_received_card_transfer( + &mut self, + queued_event_index: OplogIndex, + transfer_id: uuid::Uuid, + source_card_id: Option, + card: StoredCard, + ) -> Result, WorkerExecutorError> { + let card_id = card.card_id(); + if let Err(reason) = self.admit_card_to_wallet(&card).await? { self.public_state .worker() - .add_and_commit_oplog(OplogEntry::card_installed(queued_event_index, card)) + .add_and_commit_oplog(OplogEntry::card_install_failed( + queued_event_index, + card_id, + reason, + )) .await; - Ok(Ok(())) + return Ok(Err(reason)); } + + self.public_state + .worker() + .add_and_commit_oplog(OplogEntry::card_transferred( + transfer_id, + source_card_id, + card_id, + CardHolder::Agent(AgentCardHolder { + agent_id: self.owned_agent_id.agent_id.clone(), + }), + card, + Some(self.state.wallet_generation), + )) + .await; + Ok(Ok(())) } async fn apply_card_revoked( @@ -1097,73 +1385,111 @@ impl DurableWorkerCtx { queued_event_index: OplogIndex, is_live: bool, ) -> Result<(), WorkerExecutorError> { - let was_in_wallet = self.state.agent_wallet_cards.remove(&card_id).is_some(); - - if was_in_wallet { + let was_in_wallet = remove_wallet_card( + &mut self.state.agent_wallet_cards, + &mut self.state.wallet_generation, + card_id, + )?; + + let scope_changed = self.clear_invocation_scope_if_roots_include(&[card_id]); + if was_in_wallet || scope_changed { self.rederive_agent_effective_surface_from_wallet(); } if is_live { - let wallet_card_ids = self - .state - .agent_wallet_cards - .keys() - .copied() - .collect::>(); - self.state - .card_interest_index - .set_card_interest(self.owned_agent_id.clone(), &wallet_card_ids) - .await; + self.refresh_card_interest().await; self.public_state .worker() - .add_and_commit_oplog(OplogEntry::card_revoked(queued_event_index, card_id)) + .add_and_commit_oplog(OplogEntry::card_revoked( + queued_event_index, + card_id, + Some(self.state.wallet_generation), + )) .await; } Ok(()) } - pub(crate) async fn remove_expired_cards(&mut self) { - let now = Utc::now(); - let cards_to_expire = self - .state - .agent_wallet_cards - .iter() - .filter_map(|(card_id, card)| { - card.expires_at() - .filter(|expires_at| *expires_at <= now) - .map(|_| *card_id) - }) - .collect::>(); + pub(crate) async fn apply_card_revoked_cascade( + &mut self, + card_ids: &[CardId], + commit_immediately: bool, + ) -> Result<(), WorkerExecutorError> { + let mut card_ids = card_ids.to_vec(); + card_ids.sort_unstable(); + card_ids.dedup(); + if card_ids.is_empty() { + return Ok(()); + } - if cards_to_expire.is_empty() { - return; + let wallet_changed = remove_wallet_cards( + &mut self.state.agent_wallet_cards, + &mut self.state.wallet_generation, + &card_ids, + )?; + let scope_changed = self.clear_invocation_scope_if_roots_include(&card_ids); + if wallet_changed || scope_changed { + self.rederive_agent_effective_surface_from_wallet(); } - for card_id in &cards_to_expire { - self.state.agent_wallet_cards.remove(card_id); + self.refresh_card_interest().await; + + let affected_wallets = if wallet_changed { + vec![CardHolder::Agent(AgentCardHolder { + agent_id: self.owned_agent_id.agent_id.clone(), + })] + } else { + Vec::new() + }; + let entry = OplogEntry::CardRevokedCascade { + timestamp: Timestamp::now_utc(), + revoked_card_ids: card_ids, + affected_wallets, + local_wallet_generation: Some(self.state.wallet_generation), + }; + if commit_immediately { + self.public_state.worker().add_and_commit_oplog(entry).await; + } else { + self.public_state.worker().add_to_oplog(entry).await; } - self.rederive_agent_effective_surface_from_wallet(); + Ok(()) + } - let wallet_card_ids = self - .state - .agent_wallet_cards - .keys() - .copied() - .collect::>(); - self.state - .card_interest_index - .set_card_interest(self.owned_agent_id.clone(), &wallet_card_ids) - .await; + pub(crate) async fn remove_expired_cards(&mut self) -> Result<(), WorkerExecutorError> { + let cards_to_expire = + expired_wallet_card_ids_at(&self.state.agent_wallet_cards, Utc::now()); + if cards_to_expire.is_empty() { + return Ok(()); + } + + let mut expired_card_generations = Vec::with_capacity(cards_to_expire.len()); for card_id in cards_to_expire { + if remove_wallet_card( + &mut self.state.agent_wallet_cards, + &mut self.state.wallet_generation, + card_id, + )? { + expired_card_generations.push((card_id, self.state.wallet_generation)); + } + } + + if !expired_card_generations.is_empty() { + self.rederive_agent_effective_surface_from_wallet(); + } + + self.refresh_card_interest().await; + + for (card_id, wallet_generation) in expired_card_generations { self.public_state .worker() - .add_and_commit_oplog(OplogEntry::card_expired(card_id)) + .add_and_commit_oplog(OplogEntry::card_expired(card_id, Some(wallet_generation))) .await; } + Ok(()) } pub fn parsed_agent_id(&self) -> Option { @@ -2770,9 +3096,7 @@ impl DurableWorkerCtx { .as_context_mut() .data_mut() .durable_ctx_mut() - .state - .replay_state - .drop_override_and_restart() + .restart_replay_without_snapshot() .await { warn!("Failed to restart replay state after invalid snapshot entry: {err}"); @@ -2801,9 +3125,7 @@ impl DurableWorkerCtx { .as_context_mut() .data_mut() .durable_ctx_mut() - .state - .replay_state - .drop_override_and_restart() + .restart_replay_without_snapshot() .await { warn!("Failed to restart replay state after snapshot download failure: {err}"); @@ -2962,6 +3284,25 @@ enum SnapshotRecoveryResult { } impl DurableWorkerCtx { + async fn restart_replay_without_snapshot(&mut self) -> Result<(), WorkerExecutorError> { + self.state.replay_state.drop_override_and_restart().await?; + + self.state.agent_wallet_cards = match self.state.agent_id.as_ref() { + Some(agent_id) => { + let card = agent_initial_card_from_component_metadata( + &self.state.component_metadata, + agent_id, + )?; + BTreeMap::from([(card.card_id(), card)]) + } + None => BTreeMap::new(), + }; + self.state.wallet_generation = 0; + self.rederive_agent_effective_surface_from_wallet(); + + Ok(()) + } + /// Activity tracker for Golem-spawned store background tasks; see /// [`tail_work::TailWorkTracker`]. pub fn tail_work_tracker(&self) -> tail_work::TailWorkTracker { @@ -3141,21 +3482,149 @@ impl DurableWorkerCtx { debug!("Updating the replay's current phantom id to {new_phantom_id}"); self.update_state_to_new_phantom_id(new_phantom_id).await?; } - ReplayEvent::CardInstalled { card } => { + ReplayEvent::InvocationWalletPinned { wallet_pin } => { + debug!( + generation = wallet_pin.wallet_token.generation, + card_count = wallet_pin.pinned_card_ids.len(), + "Restoring the replayed invocation wallet pin" + ); + if apply_invocation_wallet_pin( + &mut self.state.agent_wallet_cards, + self.state.wallet_id_hash, + &mut self.state.wallet_generation, + wallet_pin, + )? { + self.rederive_agent_effective_surface_from_wallet(); + } + } + ReplayEvent::CardInstalled { + card, + wallet_generation, + } => { let card_id = card.card_id(); debug!(card_id = %card_id, "Applying replayed card installation"); - self.state.agent_wallet_cards.insert(card_id, card); - self.rederive_agent_effective_surface_from_wallet(); + if add_wallet_card( + &mut self.state.agent_wallet_cards, + &mut self.state.wallet_generation, + card, + )? { + self.rederive_agent_effective_surface_from_wallet(); + } + adopt_recorded_wallet_generation( + &mut self.state.wallet_generation, + wallet_generation, + )?; + } + ReplayEvent::CardDerived { + card, + wallet_generation, + } => { + let card_id = card.card_id(); + debug!(card_id = %card_id, "Applying replayed card derivation"); + adopt_recorded_wallet_generation( + &mut self.state.wallet_generation, + wallet_generation, + )?; + } + ReplayEvent::CardTransferStarted { + card_id, + source_holder, + source_wallet_generation, + .. + } => { + if source_holder.as_ref().is_none_or(|source_holder| { + card_holder_is_agent(source_holder, &self.owned_agent_id.agent_id) + }) { + if transfer_started_removes_source_membership( + self.state.agent_wallet_cards.get(&card_id), + &source_holder, + &self.owned_agent_id.agent_id, + ) { + debug!(card_id = %card_id, "Applying replayed card transfer start"); + if remove_wallet_card( + &mut self.state.agent_wallet_cards, + &mut self.state.wallet_generation, + card_id, + )? { + self.rederive_agent_effective_surface_from_wallet(); + } + } + adopt_recorded_wallet_generation( + &mut self.state.wallet_generation, + source_wallet_generation, + )?; + } + } + ReplayEvent::CardTransferred { + target_holder, + card, + target_wallet_generation, + .. + } => { + if card_holder_is_agent(&target_holder, &self.owned_agent_id.agent_id) { + let card_id = card.card_id(); + debug!(card_id = %card_id, "Applying replayed card transfer completion"); + if add_wallet_card( + &mut self.state.agent_wallet_cards, + &mut self.state.wallet_generation, + card, + )? { + self.rederive_agent_effective_surface_from_wallet(); + } + adopt_recorded_wallet_generation( + &mut self.state.wallet_generation, + target_wallet_generation, + )?; + } } - ReplayEvent::CardRevoked { card_id } => { + ReplayEvent::CardTransferConfirmed { transfer_id, .. } => { + debug!(%transfer_id, "Applying replayed card transfer receipt"); + } + ReplayEvent::CardRevokedCascade { + card_ids, + local_wallet_generation, + } => { + debug!( + count = card_ids.len(), + "Applying replayed card revocation cascade" + ); + let wallet_changed = remove_wallet_cards( + &mut self.state.agent_wallet_cards, + &mut self.state.wallet_generation, + &card_ids, + )?; + let scope_changed = self.clear_invocation_scope_if_roots_include(&card_ids); + if wallet_changed || scope_changed { + self.rederive_agent_effective_surface_from_wallet(); + } + adopt_recorded_wallet_generation( + &mut self.state.wallet_generation, + local_wallet_generation, + )?; + } + ReplayEvent::CardRevoked { + card_id, + wallet_generation, + } => { debug!(card_id = %card_id, "Applying replayed card revocation"); self.apply_card_revoked(card_id, OplogIndex::NONE, false) .await?; + adopt_recorded_wallet_generation( + &mut self.state.wallet_generation, + wallet_generation, + )?; } - ReplayEvent::CardExpired { card_id } => { + ReplayEvent::CardExpired { + card_id, + wallet_generation, + } => { debug!(card_id = %card_id, "Applying replayed card expiry"); self.apply_card_revoked(card_id, OplogIndex::NONE, false) .await?; + adopt_recorded_wallet_generation( + &mut self.state.wallet_generation, + wallet_generation, + )?; } ReplayEvent::ReplayFinished => { debug!("Replaying oplog finished"); @@ -3209,6 +3678,7 @@ impl DurableWorkerCtx { } self.check_post_replay_wallet_liveness().await?; + permissions::retry_pending_source_card_transfers(self).await?; } } } @@ -3223,10 +3693,7 @@ impl DurableWorkerCtx { .keys() .copied() .collect::>(); - self.state - .card_interest_index - .set_card_interest(self.owned_agent_id.clone(), &wallet_card_ids) - .await; + self.refresh_card_interest().await; if wallet_card_ids.is_empty() { return Ok(()); @@ -3342,8 +3809,12 @@ impl DurableWorkerCtx { { self.state.agent_config = updated_agent_config; self.state.cached_agent_config_retry_policies = None; + replace_wallet_cards( + &mut self.state.agent_wallet_cards, + &mut self.state.wallet_generation, + initial_wallet_cards, + )?; self.state.agent_effective_surface = agent_effective_surface; - self.state.agent_wallet_cards = initial_wallet_cards; }; self.state.component_metadata = new_metadata; @@ -3489,6 +3960,19 @@ impl InvocationHooks for DurableWorkerCtx { if self.state.snapshotting_mode.is_none() { let stack = self.get_current_invocation_context().await; + let scope_card = match &invocation { + AgentInvocation::AgentMethod { scope_card, .. } => scope_card.clone(), + _ => None, + }; + if let Some(scope_card) = &scope_card { + crate::services::card::validate_scope_card( + self.state.card_service.as_ref(), + scope_card, + ) + .await?; + } + self.install_invocation_scope_card(scope_card.clone()).await; + match &mut invocation { AgentInvocation::AgentInitialization { invocation_context, .. @@ -3506,7 +3990,17 @@ impl InvocationHooks for DurableWorkerCtx { self.public_state .worker() .oplog() - .add_agent_invocation_started(invocation) + .add_agent_invocation_started( + invocation, + InvocationWalletPin { + wallet_token: WalletVersionToken { + wallet_id_hash: self.state.wallet_id_hash, + generation: self.state.wallet_generation, + }, + pinned_card_ids: self.state.agent_wallet_cards.keys().copied().collect(), + scope_card_id: scope_card.map(|card| card.scope_card_id), + }, + ) .await .unwrap_or_else(|err| { panic!( @@ -3523,6 +4017,10 @@ impl InvocationHooks for DurableWorkerCtx { Ok(()) } + async fn on_agent_invocation_finished(&mut self) { + self.clear_invocation_scope_card().await; + } + async fn on_invocation_failure( &mut self, full_function_name: &str, @@ -4191,12 +4689,28 @@ impl ExternalOperations for DurableWorkerCtx { idempotency_key, invocation_payload, invocation_context, + wallet_pin, })) => { let agent_invocation = AgentInvocation::from_parts( idempotency_key.clone(), invocation_payload, invocation_context.clone(), ); + let scope_card = match &agent_invocation { + AgentInvocation::AgentMethod { scope_card, .. } => scope_card.clone(), + _ => None, + }; + let recorded_scope_card_id = wallet_pin.and_then(|pin| pin.scope_card_id); + let payload_scope_card_id = + scope_card.as_ref().map(|card| card.scope_card_id); + if payload_scope_card_id != recorded_scope_card_id { + break Err(WorkerExecutorError::unexpected_oplog_entry( + "matching invocation scope-card payload and wallet pin", + format!( + "payload scope-card ID {payload_scope_card_id:?}, recorded scope-card ID {recorded_scope_card_id:?}" + ), + )); + } let component_metadata = store .as_context() @@ -4213,12 +4727,13 @@ impl ExternalOperations for DurableWorkerCtx { )?; let full_function_name = lowered.display_name.clone(); - store - .as_context_mut() - .data_mut() - .durable_ctx_mut() - .process_pending_replay_events() - .await?; + let mut store_context = store.as_context_mut(); + let durable_ctx = store_context.data_mut().durable_ctx_mut(); + durable_ctx.install_invocation_scope_card(scope_card).await; + if let Err(error) = durable_ctx.process_pending_replay_events().await { + durable_ctx.clear_invocation_scope_card().await; + break Err(error); + } debug!("Replaying function {}", &full_function_name); debug!( @@ -4590,6 +5105,265 @@ impl ExternalOperations for DurableWorkerCtx { } } +fn card_holder_is_agent(holder: &CardHolder, agent_id: &AgentId) -> bool { + matches!(holder, CardHolder::Agent(holder) if holder.agent_id == *agent_id) +} + +fn clear_invocation_scope_state( + scope_card: &mut Option, + scope_handles: &mut HashMap>, +) -> (bool, HashSet) { + let scope_changed = scope_card.take().is_some(); + let handles = std::mem::take(scope_handles).into_keys().collect(); + (scope_changed, handles) +} + +fn remove_invocation_scope_for_revoked_roots( + scope_card: &mut Option, + scope_handles: &mut HashMap>, + revoked_card_ids: &[CardId], +) -> (bool, HashSet) { + let affected = scope_card.as_ref().is_some_and(|scope_card| { + scope_card + .root_card_ids + .iter() + .any(|root_id| revoked_card_ids.contains(root_id)) + }); + if affected { + *scope_card = None; + } + let handles = scope_handles + .iter() + .filter_map(|(rep, root_card_ids)| { + root_card_ids + .iter() + .any(|root_id| revoked_card_ids.contains(root_id)) + .then_some(*rep) + }) + .collect::>(); + for rep in &handles { + scope_handles.remove(rep); + } + (affected, handles) +} + +fn transfer_started_removes_source_membership( + source_card: Option<&StoredCard>, + source_holder: &Option, + agent_id: &AgentId, +) -> bool { + matches!(source_card, Some(StoredCard::Concrete(_))) + && source_holder + .as_ref() + .is_none_or(|holder| card_holder_is_agent(holder, agent_id)) +} + +fn next_drainable_card_events( + pending_events: Vec, +) -> Vec { + let mut result = Vec::new(); + let mut collecting_revocations = false; + + for event in pending_events { + match &event.event { + QueuedCardEvent::TransferStarted(_) => continue, + QueuedCardEvent::Install(_) | QueuedCardEvent::TransferReceived(_) => { + if result.is_empty() { + result.push(event); + } + break; + } + QueuedCardEvent::Revoke(_) => { + if result.is_empty() { + collecting_revocations = true; + } + if collecting_revocations { + result.push(event); + } else { + break; + } + } + } + } + + result +} + +fn add_wallet_card( + wallet: &mut BTreeMap, + generation: &mut u64, + card: StoredCard, +) -> Result { + let card_id = card.card_id(); + if let Some(existing) = wallet.get(&card_id) { + return if existing == &card { + Ok(false) + } else { + Err(WorkerExecutorError::runtime(format!( + "wallet card {card_id} conflicts with its existing payload" + ))) + }; + } + *generation = generation + .checked_add(1) + .ok_or_else(|| WorkerExecutorError::runtime("wallet generation exhausted"))?; + wallet.insert(card_id, card); + Ok(true) +} + +fn remove_wallet_card( + wallet: &mut BTreeMap, + generation: &mut u64, + card_id: CardId, +) -> Result { + if !wallet.contains_key(&card_id) { + return Ok(false); + } + *generation = generation + .checked_add(1) + .ok_or_else(|| WorkerExecutorError::runtime("wallet generation exhausted"))?; + wallet.remove(&card_id); + Ok(true) +} + +fn remove_wallet_cards( + wallet: &mut BTreeMap, + generation: &mut u64, + card_ids: &[CardId], +) -> Result { + if !card_ids.iter().any(|card_id| wallet.contains_key(card_id)) { + return Ok(false); + } + let next_generation = generation + .checked_add(1) + .ok_or_else(|| WorkerExecutorError::runtime("wallet generation exhausted"))?; + + for card_id in card_ids { + wallet.remove(card_id); + } + *generation = next_generation; + Ok(true) +} + +fn expired_wallet_card_ids_at( + wallet: &BTreeMap, + now: DateTime, +) -> Vec { + wallet + .iter() + .filter_map(|(card_id, card)| { + card.expires_at() + .filter(|expires_at| *expires_at <= now) + .map(|_| *card_id) + }) + .collect() +} + +fn apply_invocation_wallet_pin( + wallet: &mut BTreeMap, + wallet_id_hash: [u8; 32], + generation: &mut u64, + wallet_pin: InvocationWalletPin, +) -> Result { + if wallet_pin.wallet_token.wallet_id_hash != wallet_id_hash { + return Err(WorkerExecutorError::unexpected_oplog_entry( + "invocation wallet pin for the local wallet", + "wallet identity hash does not match the replaying agent", + )); + } + if wallet_pin + .pinned_card_ids + .windows(2) + .any(|card_ids| card_ids[0] >= card_ids[1]) + { + return Err(WorkerExecutorError::unexpected_oplog_entry( + "canonically ordered invocation wallet pin", + "pinned card ids are not strictly increasing", + )); + } + if wallet_pin.wallet_token.generation < *generation { + return Err(WorkerExecutorError::unexpected_oplog_entry( + "non-decreasing invocation wallet generation", + format!( + "pinned generation {} is behind replayed generation {}", + wallet_pin.wallet_token.generation, *generation + ), + )); + } + + let mut pinned_wallet = BTreeMap::new(); + for card_id in wallet_pin.pinned_card_ids { + let card = wallet.get(&card_id).cloned().ok_or_else(|| { + WorkerExecutorError::unexpected_oplog_entry( + "invocation wallet pin backed by replayed card definitions", + format!("pinned card {card_id} is missing from the replayed wallet"), + ) + })?; + pinned_wallet.insert(card_id, card); + } + + let membership_changed = wallet.keys().ne(pinned_wallet.keys()); + *wallet = pinned_wallet; + *generation = wallet_pin.wallet_token.generation; + Ok(membership_changed) +} + +fn adopt_recorded_wallet_generation( + generation: &mut u64, + recorded_generation: Option, +) -> Result<(), WorkerExecutorError> { + if let Some(recorded_generation) = recorded_generation { + if recorded_generation < *generation { + return Err(WorkerExecutorError::unexpected_oplog_entry( + "non-decreasing wallet generation", + format!( + "recorded generation {recorded_generation} is behind replayed generation {}", + *generation + ), + )); + } + *generation = recorded_generation; + } + Ok(()) +} + +fn replace_wallet_cards( + wallet: &mut BTreeMap, + generation: &mut u64, + replacement: BTreeMap, +) -> Result { + let removed_ids = wallet + .keys() + .filter(|card_id| !replacement.contains_key(card_id)) + .copied() + .collect::>(); + let added = replacement + .values() + .filter(|card| !wallet.contains_key(&card.card_id())) + .count(); + let change_count = removed_ids + .len() + .checked_add(added) + .and_then(|count| u64::try_from(count).ok()) + .ok_or_else(|| WorkerExecutorError::runtime("wallet generation exhausted"))?; + if change_count == 0 { + return Ok(false); + } + let next_generation = generation + .checked_add(change_count) + .ok_or_else(|| WorkerExecutorError::runtime("wallet generation exhausted"))?; + + for card_id in removed_ids { + wallet.remove(&card_id); + } + for card in replacement.into_values() { + let card_id = card.card_id(); + wallet.entry(card_id).or_insert(card); + } + *generation = next_generation; + Ok(true) +} + fn should_restart_after_shard_assignment_change(status: &AgentStatusRecord) -> bool { matches!( status.status, @@ -4601,8 +5375,20 @@ fn should_restart_after_shard_assignment_change(status: &AgentStatusRecord) -> b mod tests { use super::*; use bytes::Bytes; + use golem_common::model::agent::AgentTypeName; + use golem_common::model::application::ApplicationName; + use golem_common::model::card::owner::AgentOwnerPattern; + use golem_common::model::card::recipient::RecipientPattern; + use golem_common::model::card::{ + AgentCardHolder, AgentClass, AgentPermissionMonomorphizationContext, AgentResourcePattern, + AgentVerb, Card, ClassPermissionPattern, ClassPermissionTarget, PermissionPattern, + PermissionTarget, PolymorphicCard, + }; + use golem_common::model::component::ComponentName; + use golem_common::model::environment::EnvironmentName; use golem_common::model::{PendingInvocationRef, PendingUpdateKind, PendingUpdateRef}; use http_body::Frame; + use std::collections::HashSet; use std::pin::Pin; use std::task::{Context, Poll, Waker}; use test_r::test; @@ -4794,6 +5580,949 @@ mod tests { } } + fn permission_id_test_inputs() -> (OwnedAgentId, IdempotencyKey) { + ( + OwnedAgentId { + environment_id: EnvironmentId( + Uuid::parse_str("00112233-4455-6677-8899-aabbccddeeff").unwrap(), + ), + agent_id: AgentId { + component_id: ComponentId( + Uuid::parse_str("ffeeddcc-bbaa-9988-7766-554433221100").unwrap(), + ), + agent_id: "cart/primary".to_string(), + }, + }, + IdempotencyKey::new("checkout-invocation".to_string()), + ) + } + + fn invocation_scope_card(root_card_ids: Vec) -> ScopeCard { + ScopeCard { + scope_card_id: CardId(Uuid::from_u128(100)), + root_card_ids, + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + } + } + + #[test] + fn unrelated_revocation_preserves_invocation_scope_and_handles() { + let scope_root = CardId(Uuid::from_u128(1)); + let unrelated = CardId(Uuid::from_u128(2)); + let mut scope_card = Some(invocation_scope_card(vec![scope_root])); + let mut handles = HashMap::from([(7, vec![scope_root])]); + + assert_eq!( + remove_invocation_scope_for_revoked_roots(&mut scope_card, &mut handles, &[unrelated],), + (false, HashSet::new()) + ); + assert!(scope_card.is_some()); + assert_eq!(handles, HashMap::from([(7, vec![scope_root])])); + } + + #[test] + fn matching_revocation_removes_scope_and_dependent_handles_only() { + let revoked_root = CardId(Uuid::from_u128(1)); + let unrelated_root = CardId(Uuid::from_u128(2)); + let mut scope_card = Some(invocation_scope_card(vec![revoked_root])); + let mut handles = HashMap::from([ + (7, vec![revoked_root]), + (11, vec![unrelated_root]), + (13, vec![revoked_root, unrelated_root]), + ]); + + assert_eq!( + remove_invocation_scope_for_revoked_roots( + &mut scope_card, + &mut handles, + &[revoked_root], + ), + (true, HashSet::from([7, 13])) + ); + assert!(scope_card.is_none()); + assert_eq!(handles, HashMap::from([(11, vec![unrelated_root])])); + } + + #[test] + fn invocation_end_clears_scope_card_and_all_invocation_handles() { + let mut scope_card = Some(invocation_scope_card(vec![CardId(Uuid::from_u128(1))])); + let mut handles = HashMap::from([ + (7, vec![CardId(Uuid::from_u128(1))]), + (11, vec![CardId(Uuid::from_u128(2))]), + ]); + + let (scope_changed, removed_handles) = + clear_invocation_scope_state(&mut scope_card, &mut handles); + + assert!(scope_changed); + assert!(scope_card.is_none()); + assert!(handles.is_empty()); + assert_eq!(removed_handles, HashSet::from([7, 11])); + } + + #[test] + fn permission_id_derivation_has_golden_vectors() { + let (owned_agent_id, invocation_key) = permission_id_test_inputs(); + let oplog_index = OplogIndex::from_u64(42); + + let card_id = derive_permission_uuid( + DERIVED_CARD_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + oplog_index, + ); + let transfer_id = derive_permission_uuid( + TRANSFER_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + oplog_index, + ); + let installed_child_id = derive_permission_uuid( + INSTALLED_CHILD_CARD_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + oplog_index, + ); + let scope_card_id = derive_permission_uuid_for_sequence( + SCOPE_CARD_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + 42, + ); + + assert_eq!( + card_id, + Uuid::parse_str("00000000-002a-7cdd-b83d-c9e9f32d880c").unwrap() + ); + assert_eq!( + transfer_id, + Uuid::parse_str("00000000-002a-7646-b8aa-b84e348196f6").unwrap() + ); + assert_eq!( + installed_child_id, + Uuid::parse_str("00000000-002a-7607-aaa4-0b04c840169d").unwrap() + ); + assert_eq!( + scope_card_id, + Uuid::parse_str("00000000-002a-7680-bbdb-7f78bd28fc43").unwrap() + ); + assert_eq!(card_id.as_bytes()[6] >> 4, 7); + assert_eq!(card_id.as_bytes()[8] >> 6, 2); + assert_eq!(scope_card_id.as_bytes()[6] >> 4, 7); + assert_eq!(scope_card_id.as_bytes()[8] >> 6, 2); + } + + #[test] + fn permission_card_ids_follow_oplog_order() { + let (owned_agent_id, invocation_key) = permission_id_test_inputs(); + let derive = |index| { + derive_permission_uuid( + DERIVED_CARD_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + OplogIndex::from_u64(index), + ) + }; + + assert!(derive(41) < derive(42)); + assert!(derive(42) < derive(43)); + } + + #[test] + fn scope_card_ids_follow_the_invocation_local_ordinal() { + let (owned_agent_id, invocation_key) = permission_id_test_inputs(); + let derive = |ordinal| { + derive_permission_uuid_for_sequence( + SCOPE_CARD_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + ordinal, + ) + }; + + assert!(derive(0) < derive(1)); + assert!(derive(1) < derive(2)); + assert_ne!(derive(0), derive(1)); + } + + #[test] + fn permission_id_derivation_accepts_the_full_oplog_index_domain() { + let (owned_agent_id, invocation_key) = permission_id_test_inputs(); + + derive_permission_uuid( + DERIVED_CARD_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + OplogIndex::from_u64(1_u64 << 48), + ); + } + + #[test] + fn permission_ids_remain_distinct_after_timestamp_saturation() { + let (owned_agent_id, invocation_key) = permission_id_test_inputs(); + let ids = [UUID_V7_MAX_TIMESTAMP, 1_u64 << 48, u64::MAX].map(|index| { + derive_permission_uuid( + DERIVED_CARD_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + OplogIndex::from_u64(index), + ) + }); + + assert_eq!(ids.into_iter().collect::>().len(), 3); + } + + #[test] + fn permission_id_domains_are_distinct() { + let (owned_agent_id, invocation_key) = permission_id_test_inputs(); + let oplog_index = OplogIndex::from_u64(42); + let ids = [ + derive_permission_uuid( + DERIVED_CARD_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + oplog_index, + ), + derive_permission_uuid( + TRANSFER_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + oplog_index, + ), + derive_permission_uuid( + INSTALLED_CHILD_CARD_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + oplog_index, + ), + derive_permission_uuid_for_sequence( + SCOPE_CARD_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + oplog_index.as_u64(), + ), + ]; + + assert_eq!(ids.into_iter().collect::>().len(), 4); + } + + #[test] + fn permission_ids_do_not_collide_across_workers() { + let (base_agent, invocation_key) = permission_id_test_inputs(); + let different_environment = OwnedAgentId { + environment_id: EnvironmentId( + Uuid::parse_str("10112233-4455-6677-8899-aabbccddeeff").unwrap(), + ), + ..base_agent.clone() + }; + let different_component = OwnedAgentId { + agent_id: AgentId { + component_id: ComponentId( + Uuid::parse_str("efeeddcc-bbaa-9988-7766-554433221100").unwrap(), + ), + ..base_agent.agent_id.clone() + }, + ..base_agent.clone() + }; + let different_name = OwnedAgentId { + agent_id: AgentId { + agent_id: "cart/secondary".to_string(), + ..base_agent.agent_id.clone() + }, + ..base_agent.clone() + }; + let oplog_index = OplogIndex::from_u64(42); + let ids = [ + base_agent, + different_environment, + different_component, + different_name, + ] + .map(|owned_agent_id| { + derive_permission_uuid( + DERIVED_CARD_ID_CONTEXT, + &owned_agent_id, + &invocation_key, + oplog_index, + ) + }); + + assert_eq!(ids.into_iter().collect::>().len(), 4); + } + + fn concrete_card(card_id: CardId) -> StoredCard { + Card { + card_id, + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: Utc::now(), + expires_at: None, + system_card: false, + managed_by: None, + } + .into() + } + + fn concrete_card_expiring_at(card_id: CardId, expires_at: Option>) -> StoredCard { + let mut card = concrete_card(card_id); + match &mut card { + StoredCard::Concrete(card) => card.expires_at = expires_at, + StoredCard::Polymorphic(_) => unreachable!(), + } + card + } + + fn agent_permission_pattern( + owner: &str, + recipient: &str, + verb: Option, + ) -> PermissionPattern { + PermissionPattern::Agent(ClassPermissionPattern:: { + verb, + owner: AgentOwnerPattern::parse(owner).unwrap(), + recipient: RecipientPattern::parse(recipient).unwrap(), + resource: AgentResourcePattern::Any, + }) + } + + fn agent_permission_card( + card_id: CardId, + owner: &str, + recipient: &str, + lower_verbs: Vec>, + upper_verbs: Vec>, + ) -> StoredCard { + Card { + card_id, + parent_ids: Vec::new(), + lower_positive: lower_verbs + .into_iter() + .map(|verb| agent_permission_pattern(owner, recipient, verb)) + .collect(), + lower_negative: Vec::new(), + upper_positive: upper_verbs + .into_iter() + .map(|verb| agent_permission_pattern(owner, recipient, verb)) + .collect(), + upper_negative: Vec::new(), + created_at: Utc::now(), + expires_at: None, + system_card: false, + managed_by: None, + } + .into() + } + + fn agent_permission_test_context() -> AgentPermissionMonomorphizationContext { + AgentPermissionMonomorphizationContext { + account: AccountEmail::from("owner@example.com"), + application: ApplicationName::try_from("shop").unwrap(), + environment: EnvironmentName::try_from("prod").unwrap(), + component: ComponentName("cart-svc".to_string()), + agent_name: "Cart(alice)".to_string(), + agent_type: AgentTypeName("Cart".to_string()), + } + } + + fn agent_permission_target(holder: &str, verb: AgentVerb) -> PermissionTarget { + PermissionTarget::Agent(ClassPermissionTarget:: { + verb: Some(verb), + owner: AgentOwnerPattern::parse(holder).unwrap(), + resource: AgentResourcePattern::Any, + }) + } + + #[test] + fn wallet_membership_helpers_bump_once_per_effective_change() { + let card_id = CardId::new(); + let card = concrete_card(card_id); + let mut wallet = BTreeMap::new(); + let mut generation = 10; + + assert!(add_wallet_card(&mut wallet, &mut generation, card.clone()).unwrap()); + assert_eq!(generation, 11); + assert!(!add_wallet_card(&mut wallet, &mut generation, card.clone()).unwrap()); + assert_eq!(generation, 11); + + let mut replacement = card.clone(); + match &mut replacement { + StoredCard::Concrete(card) => card.system_card = true, + StoredCard::Polymorphic(_) => unreachable!(), + } + assert!(add_wallet_card(&mut wallet, &mut generation, replacement).is_err()); + assert_eq!(generation, 11); + + assert!(!remove_wallet_card(&mut wallet, &mut generation, CardId::new()).unwrap()); + assert_eq!(generation, 11); + assert!(remove_wallet_card(&mut wallet, &mut generation, card_id).unwrap()); + assert_eq!(generation, 12); + } + + #[test] + fn wallet_cascade_removal_bumps_once_for_all_effective_removals() { + let first = concrete_card(CardId::new()); + let second = concrete_card(CardId::new()); + let retained = concrete_card(CardId::new()); + let mut wallet = BTreeMap::from([ + (first.card_id(), first.clone()), + (second.card_id(), second.clone()), + (retained.card_id(), retained.clone()), + ]); + let mut generation = 10; + + assert!( + remove_wallet_cards( + &mut wallet, + &mut generation, + &[first.card_id(), second.card_id(), CardId::new()], + ) + .unwrap() + ); + assert_eq!(generation, 11); + assert_eq!(wallet, BTreeMap::from([(retained.card_id(), retained)])); + + assert!( + !remove_wallet_cards( + &mut wallet, + &mut generation, + &[first.card_id(), second.card_id()], + ) + .unwrap() + ); + assert_eq!(generation, 11); + } + + #[test] + fn wallet_cascade_removal_is_atomic_when_generation_is_exhausted() { + let card = concrete_card(CardId::new()); + let original_wallet = BTreeMap::from([(card.card_id(), card.clone())]); + let mut wallet = original_wallet.clone(); + let mut generation = u64::MAX; + + assert!(remove_wallet_cards(&mut wallet, &mut generation, &[card.card_id()]).is_err()); + assert_eq!(wallet, original_wallet); + assert_eq!(generation, u64::MAX); + } + + #[test] + fn wallet_cascade_preserves_independent_floor_releases_ceiling_and_replays_identically() { + let holder = "owner@example.com/shop/prod/cart-svc/Cart(alice)"; + let recipient = "owner@example.com/shop/prod/cart-svc/Cart"; + let context = agent_permission_test_context(); + let view = agent_permission_target(holder, AgentVerb::View); + let invoke = agent_permission_target(holder, AgentVerb::Invoke); + let broad_floor = + agent_permission_card(CardId::new(), holder, recipient, vec![None], Vec::new()); + let independent_view_floor = agent_permission_card( + CardId::new(), + holder, + recipient, + vec![Some(AgentVerb::View)], + Vec::new(), + ); + let view_ceiling = agent_permission_card( + CardId::new(), + holder, + recipient, + Vec::new(), + vec![Some(AgentVerb::View)], + ); + let original_wallet = BTreeMap::from([ + (broad_floor.card_id(), broad_floor.clone()), + ( + independent_view_floor.card_id(), + independent_view_floor.clone(), + ), + (view_ceiling.card_id(), view_ceiling.clone()), + ]); + let original_surface = golem_common::model::card::agent_effective_surface_from_wallet( + &context, + original_wallet.values(), + ); + assert!(original_surface.authorize(&view).unwrap()); + assert!(!original_surface.authorize(&invoke).unwrap()); + + let mut live_wallet = original_wallet.clone(); + let mut live_generation = 12; + assert!( + remove_wallet_cards( + &mut live_wallet, + &mut live_generation, + &[broad_floor.card_id()], + ) + .unwrap() + ); + let live_surface = golem_common::model::card::agent_effective_surface_from_wallet( + &context, + live_wallet.values(), + ); + assert_eq!(live_generation, 13); + assert!(live_surface.authorize(&view).unwrap()); + assert!(!live_surface.authorize(&invoke).unwrap()); + + let mut replayed_wallet = original_wallet.clone(); + let mut replayed_generation = 12; + assert!( + remove_wallet_cards( + &mut replayed_wallet, + &mut replayed_generation, + &[broad_floor.card_id()], + ) + .unwrap() + ); + adopt_recorded_wallet_generation(&mut replayed_generation, Some(live_generation)).unwrap(); + let replayed_surface = golem_common::model::card::agent_effective_surface_from_wallet( + &context, + replayed_wallet.values(), + ); + assert_eq!(replayed_wallet, live_wallet); + assert_eq!(replayed_generation, live_generation); + assert_eq!( + replayed_surface.source_card_ids, + live_surface.source_card_ids + ); + assert_eq!( + replayed_surface.authorize(&view).unwrap(), + live_surface.authorize(&view).unwrap() + ); + assert_eq!( + replayed_surface.authorize(&invoke).unwrap(), + live_surface.authorize(&invoke).unwrap() + ); + + let mut released_wallet = original_wallet; + let mut released_generation = 12; + assert!( + remove_wallet_cards( + &mut released_wallet, + &mut released_generation, + &[view_ceiling.card_id()], + ) + .unwrap() + ); + let released_surface = golem_common::model::card::agent_effective_surface_from_wallet( + &context, + released_wallet.values(), + ); + assert_eq!(released_generation, 13); + assert!(released_surface.authorize(&view).unwrap()); + assert!(released_surface.authorize(&invoke).unwrap()); + } + + #[test] + fn wallet_generation_distinguishes_aba_membership_cycles() { + let card = concrete_card(CardId::new()); + let mut wallet = BTreeMap::new(); + let mut generation = 0; + + assert!(add_wallet_card(&mut wallet, &mut generation, card.clone()).unwrap()); + let first_contents = wallet.clone(); + let first_generation = generation; + + assert!(remove_wallet_card(&mut wallet, &mut generation, card.card_id()).unwrap()); + assert!(add_wallet_card(&mut wallet, &mut generation, card).unwrap()); + + assert_eq!(wallet, first_contents); + assert_eq!(first_generation, 1); + assert_eq!(generation, 3); + } + + #[test] + fn duplicate_wallet_delivery_does_not_bump_generation() { + let card = concrete_card(CardId::new()); + let mut wallet = BTreeMap::new(); + let mut generation = 40; + + assert!(add_wallet_card(&mut wallet, &mut generation, card.clone()).unwrap()); + assert!(!add_wallet_card(&mut wallet, &mut generation, card).unwrap()); + + assert_eq!(wallet.len(), 1); + assert_eq!(generation, 41); + } + + #[test] + fn expiry_generation_outcome_is_stable_when_replayed() { + let card = concrete_card(CardId::new()); + let card_id = card.card_id(); + let mut wallet = BTreeMap::from([(card_id, card)]); + let mut generation = 7; + + assert!(remove_wallet_card(&mut wallet, &mut generation, card_id).unwrap()); + let recorded_expiry_generation = generation; + + assert!(!remove_wallet_card(&mut wallet, &mut generation, card_id).unwrap()); + adopt_recorded_wallet_generation(&mut generation, Some(recorded_expiry_generation)) + .unwrap(); + + assert!(wallet.is_empty()); + assert_eq!(generation, 8); + } + + #[test] + fn expiry_boundary_is_inclusive_and_preserves_later_cards() { + let boundary = DateTime::from_timestamp(1_700_000_000, 123).unwrap(); + let elapsed = concrete_card_expiring_at( + CardId::new(), + Some(boundary - chrono::Duration::nanoseconds(1)), + ); + let at_boundary = concrete_card_expiring_at(CardId::new(), Some(boundary)); + let later = concrete_card_expiring_at( + CardId::new(), + Some(boundary + chrono::Duration::nanoseconds(1)), + ); + let indefinite = concrete_card(CardId::new()); + let wallet = BTreeMap::from([ + (elapsed.card_id(), elapsed.clone()), + (at_boundary.card_id(), at_boundary.clone()), + (later.card_id(), later), + (indefinite.card_id(), indefinite), + ]); + + assert_eq!( + expired_wallet_card_ids_at(&wallet, boundary) + .into_iter() + .collect::>(), + HashSet::from([elapsed.card_id(), at_boundary.card_id()]) + ); + } + + #[test] + fn recorded_expiry_events_replay_identically_with_an_earlier_clock() { + let boundary = DateTime::from_timestamp(1_700_000_000, 0).unwrap(); + let replay_clock = boundary - chrono::Duration::hours(1); + let elapsed = concrete_card_expiring_at( + CardId::new(), + Some(boundary - chrono::Duration::nanoseconds(1)), + ); + let at_boundary = concrete_card_expiring_at(CardId::new(), Some(boundary)); + let later = + concrete_card_expiring_at(CardId::new(), Some(boundary + chrono::Duration::hours(1))); + let original_wallet = BTreeMap::from([ + (elapsed.card_id(), elapsed), + (at_boundary.card_id(), at_boundary), + (later.card_id(), later), + ]); + + let mut live_wallet = original_wallet.clone(); + let mut live_generation = 7; + let mut recorded_expiries = Vec::new(); + for card_id in expired_wallet_card_ids_at(&live_wallet, boundary) { + assert!(remove_wallet_card(&mut live_wallet, &mut live_generation, card_id).unwrap()); + recorded_expiries.push((card_id, live_generation)); + } + + let mut replayed_wallet = original_wallet; + let mut replayed_generation = 7; + assert!(expired_wallet_card_ids_at(&replayed_wallet, replay_clock).is_empty()); + for (card_id, recorded_generation) in recorded_expiries { + assert!( + remove_wallet_card(&mut replayed_wallet, &mut replayed_generation, card_id) + .unwrap() + ); + adopt_recorded_wallet_generation(&mut replayed_generation, Some(recorded_generation)) + .unwrap(); + } + + assert_eq!(replayed_wallet, live_wallet); + assert_eq!(replayed_generation, live_generation); + assert_eq!(live_wallet.len(), 1); + assert_eq!(live_generation, 9); + } + + #[test] + fn conflicting_payload_for_existing_card_id_is_rejected_without_generation_change() { + let card_id = CardId::new(); + let card = concrete_card(card_id); + let mut conflicting_payload = card.clone(); + match &mut conflicting_payload { + StoredCard::Concrete(card) => card.system_card = true, + StoredCard::Polymorphic(_) => unreachable!(), + } + let mut wallet = BTreeMap::from([(card_id, card.clone())]); + let mut generation = 10; + + assert!(add_wallet_card(&mut wallet, &mut generation, conflicting_payload).is_err()); + + assert_eq!(generation, 10); + assert_eq!(wallet.get(&card_id), Some(&card)); + } + + #[test] + fn wallet_replacement_bumps_for_each_membership_delta() { + let retained = concrete_card(CardId::new()); + let mut conflicting_retained = retained.clone(); + match &mut conflicting_retained { + StoredCard::Concrete(card) => card.system_card = true, + StoredCard::Polymorphic(_) => unreachable!(), + } + let removed = concrete_card(CardId::new()); + let added = concrete_card(CardId::new()); + let mut wallet = BTreeMap::from([ + (retained.card_id(), retained.clone()), + (removed.card_id(), removed), + ]); + let replacement = BTreeMap::from([ + (conflicting_retained.card_id(), conflicting_retained), + (added.card_id(), added), + ]); + let mut generation = 20; + + assert!(replace_wallet_cards(&mut wallet, &mut generation, replacement).unwrap()); + assert_eq!(generation, 22); + assert_eq!(wallet.len(), 2); + assert_eq!(wallet.get(&retained.card_id()), Some(&retained)); + } + + #[test] + fn wallet_replacement_is_atomic_when_generation_would_overflow() { + let removed = concrete_card(CardId::new()); + let added = concrete_card(CardId::new()); + let mut wallet = BTreeMap::from([(removed.card_id(), removed)]); + let original_wallet = wallet.clone(); + let replacement = BTreeMap::from([(added.card_id(), added)]); + let mut generation = u64::MAX - 1; + + assert!(replace_wallet_cards(&mut wallet, &mut generation, replacement).is_err()); + assert_eq!((wallet, generation), (original_wallet, u64::MAX - 1)); + } + + #[test] + fn replay_adopts_recorded_wallet_generation_and_defaults_legacy_entries() { + let mut generation = 10; + + adopt_recorded_wallet_generation(&mut generation, None).unwrap(); + assert_eq!(generation, 10); + + adopt_recorded_wallet_generation(&mut generation, Some(10)).unwrap(); + assert_eq!(generation, 10); + + adopt_recorded_wallet_generation(&mut generation, Some(12)).unwrap(); + assert_eq!(generation, 12); + } + + #[test] + fn replay_rejects_decreasing_recorded_wallet_generation() { + let mut generation = 10; + + assert!(adopt_recorded_wallet_generation(&mut generation, Some(9)).is_err()); + assert_eq!(generation, 10); + } + + #[test] + fn invocation_wallet_pin_establishes_base_before_ordered_mutations() { + let wallet_id_hash = [0x42; 32]; + let base_card = concrete_card(CardId::new()); + let stale_card = concrete_card(CardId::new()); + let derived_card = concrete_card(CardId::new()); + let mut wallet = BTreeMap::from([ + (base_card.card_id(), base_card.clone()), + (stale_card.card_id(), stale_card), + ]); + let mut generation = 1; + + assert!( + apply_invocation_wallet_pin( + &mut wallet, + wallet_id_hash, + &mut generation, + InvocationWalletPin { + wallet_token: WalletVersionToken { + wallet_id_hash, + generation: 1, + }, + pinned_card_ids: vec![base_card.card_id()], + scope_card_id: Some(CardId::new()), + }, + ) + .unwrap() + ); + assert_eq!(wallet.len(), 1); + assert_eq!(wallet.get(&base_card.card_id()), Some(&base_card)); + assert_eq!(generation, 1); + assert!(!wallet.contains_key(&derived_card.card_id())); + + assert!(add_wallet_card(&mut wallet, &mut generation, derived_card.clone()).unwrap()); + adopt_recorded_wallet_generation(&mut generation, Some(2)).unwrap(); + assert_eq!(wallet.len(), 2); + assert_eq!(wallet.get(&base_card.card_id()), Some(&base_card)); + assert_eq!(wallet.get(&derived_card.card_id()), Some(&derived_card)); + assert_eq!(generation, 2); + } + + fn polymorphic_card(card_id: CardId) -> StoredCard { + StoredCard::Polymorphic(PolymorphicCard { + card_id, + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: Utc::now(), + expires_at: None, + system_card: false, + }) + } + + #[test] + fn transfer_start_removes_only_concrete_card_from_matching_source_agent() { + let agent_id = AgentId { + component_id: ComponentId(Uuid::new_v4()), + agent_id: "source-agent".to_string(), + }; + let source_holder = Some(CardHolder::Agent(AgentCardHolder { + agent_id: agent_id.clone(), + })); + let concrete = concrete_card(CardId::new()); + let polymorphic = polymorphic_card(CardId::new()); + + assert!(transfer_started_removes_source_membership( + Some(&concrete), + &source_holder, + &agent_id, + )); + assert!(!transfer_started_removes_source_membership( + Some(&polymorphic), + &source_holder, + &agent_id, + )); + assert!(transfer_started_removes_source_membership( + Some(&concrete), + &None, + &agent_id, + )); + + let different_source = Some(CardHolder::Agent(AgentCardHolder { + agent_id: AgentId { + component_id: ComponentId(Uuid::new_v4()), + agent_id: agent_id.agent_id.clone(), + }, + })); + assert!(!transfer_started_removes_source_membership( + Some(&concrete), + &different_source, + &agent_id, + )); + } + + #[test] + fn legacy_transfer_start_removes_concrete_source_membership() { + let agent_id = AgentId { + component_id: ComponentId(Uuid::new_v4()), + agent_id: "legacy-source-agent".to_string(), + }; + let concrete = concrete_card(CardId::new()); + + assert!(transfer_started_removes_source_membership( + Some(&concrete), + &None, + &agent_id, + )); + } + + #[test] + fn pending_transfer_does_not_block_later_local_card_event() { + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: AgentId { + component_id: ComponentId(Uuid::new_v4()), + agent_id: "target-agent".to_string(), + }, + }); + let transfer_card = concrete_card(CardId::new()); + let revoked_card_id = CardId::new(); + let pending_transfer = PendingCardEventRef { + timestamp: Timestamp::now_utc(), + oplog_index: OplogIndex::from_u64(1), + event: QueuedCardEvent::transfer_started(Uuid::new_v4(), transfer_card, target_holder), + }; + assert!(next_drainable_card_events(vec![pending_transfer.clone()]).is_empty()); + + let pending_events = vec![ + pending_transfer, + PendingCardEventRef { + timestamp: Timestamp::now_utc(), + oplog_index: OplogIndex::from_u64(2), + event: QueuedCardEvent::revoke(revoked_card_id), + }, + ]; + + let next = next_drainable_card_events(pending_events); + assert_eq!(next.len(), 1); + assert_eq!(next[0].oplog_index, OplogIndex::from_u64(2)); + assert!(matches!( + &next[0].event, + QueuedCardEvent::Revoke(event) if event.card_id == revoked_card_id + )); + } + + #[test] + fn received_transfer_is_drained_as_a_target_wallet_event() { + let source_card_id = CardId::new(); + let card = concrete_card(CardId::new()); + let receipt = PendingCardEventRef { + timestamp: Timestamp::now_utc(), + oplog_index: OplogIndex::from_u64(1), + event: QueuedCardEvent::transfer_received(Uuid::new_v4(), source_card_id, card.clone()), + }; + + let next = next_drainable_card_events(vec![receipt.clone()]); + + assert_eq!(next, vec![receipt]); + assert!(matches!( + &next[0].event, + QueuedCardEvent::TransferReceived(event) + if event.source_card_id == Some(source_card_id) + && event.card_id == card.card_id() + && event.card.as_ref() == Some(&card) + )); + } + + #[test] + fn pending_revocations_are_batched_without_crossing_an_install() { + let first = CardId::new(); + let second = CardId::new(); + let after_install = CardId::new(); + let install = concrete_card(CardId::new()); + let pending_events = vec![ + PendingCardEventRef { + timestamp: Timestamp::now_utc(), + oplog_index: OplogIndex::from_u64(1), + event: QueuedCardEvent::revoke(first), + }, + PendingCardEventRef { + timestamp: Timestamp::now_utc(), + oplog_index: OplogIndex::from_u64(2), + event: QueuedCardEvent::revoke(second), + }, + PendingCardEventRef { + timestamp: Timestamp::now_utc(), + oplog_index: OplogIndex::from_u64(3), + event: QueuedCardEvent::install(install), + }, + PendingCardEventRef { + timestamp: Timestamp::now_utc(), + oplog_index: OplogIndex::from_u64(4), + event: QueuedCardEvent::revoke(after_install), + }, + ]; + + let next = next_drainable_card_events(pending_events); + assert_eq!(next.len(), 2); + assert!(matches!( + &next[0].event, + QueuedCardEvent::Revoke(event) if event.card_id == first + )); + assert!(matches!( + &next[1].event, + QueuedCardEvent::Revoke(event) if event.card_id == second + )); + } + #[test] fn card_event_boundary_scan_reads_each_entry_once() { let initial_idx = OplogIndex::from_u64(10); @@ -4839,7 +6568,10 @@ mod tests { scan.fold_through( terminal_idx, - &BTreeMap::from([(terminal_idx, OplogEntry::card_revoked(queued_idx, card_id))]), + &BTreeMap::from([( + terminal_idx, + OplogEntry::card_revoked(queued_idx, card_id, None), + )]), ); assert!(scan.pending.is_empty()); @@ -6214,6 +7946,10 @@ struct PrivateDurableWorkerState { component_metadata: Component, agent_effective_surface: golem_common::model::card::EffectiveSurface, agent_wallet_cards: BTreeMap, + invocation_scope_card: Option, + invocation_scope_handles: HashMap>, + wallet_id_hash: [u8; 32], + wallet_generation: u64, card_event_boundary_scan: Option, total_linear_memory_size: u64, @@ -6360,6 +8096,9 @@ struct PrivateDurableWorkerState { /// Per-invocation RPC call limit from the account's Plan. per_invocation_rpc_call_limit: u64, + /// Zero-based ordinal of the next successfully derived invocation-local scope card. + scope_card_mint_ordinal: u64, + /// Shared per-account resource limit entry. Used to record monthly HTTP/RPC call consumption /// and to check remaining budgets from the epoch callback. resource_limit_entry: Arc, @@ -6462,8 +8201,13 @@ impl PrivateDurableWorkerState { } else { deleted_regions }; - let replay_state = - ReplayState::new(owned_agent_id.clone(), oplog.clone(), deleted_regions).await?; + let replay_state = ReplayState::new( + owned_agent_id.clone(), + oplog.clone(), + deleted_regions, + last_snapshot_index, + ) + .await?; let invocation_context = InvocationContext::new(None); let current_span_id = invocation_context.root.span_id().clone(); let dropped_call_events = tokio::sync::mpsc::unbounded_channel(); @@ -6480,17 +8224,29 @@ impl PrivateDurableWorkerState { None => Ok(BTreeMap::new()), } }; - let agent_wallet_cards = if let Some(snapshot_idx) = last_snapshot_index { - match oplog.read(snapshot_idx).await { - OplogEntry::Snapshot { active_cards, .. } => active_cards - .into_iter() - .map(|card| (card.card_id(), card)) - .collect(), - _ => initial_agent_wallet_cards()?, - } - } else { - initial_agent_wallet_cards()? - }; + let (agent_wallet_cards, wallet_generation) = + if let Some(snapshot_idx) = last_snapshot_index { + match oplog.read(snapshot_idx).await { + OplogEntry::Snapshot { + active_cards, + wallet_generation, + .. + } => ( + active_cards + .into_iter() + .map(|card| (card.card_id(), card)) + .collect(), + wallet_generation, + ), + _ => (initial_agent_wallet_cards()?, 0), + } + } else { + (initial_agent_wallet_cards()?, 0) + }; + let wallet_id_hash = CardHolder::Agent(golem_common::model::card::AgentCardHolder { + agent_id: owned_agent_id.agent_id.clone(), + }) + .wallet_id_hash(); let agent_effective_surface = if let Some(agent_id) = agent_id.as_ref() { let context = agent_monomorphization_context(&component_metadata, &owned_agent_id, agent_id); @@ -6509,6 +8265,7 @@ impl PrivateDurableWorkerState { per_invocation_http_call_limit, rpc_call_count: 0, per_invocation_rpc_call_limit, + scope_card_mint_ordinal: 0, promise_service, scheduler_service, worker_service, @@ -6549,6 +8306,10 @@ impl PrivateDurableWorkerState { component_metadata, agent_effective_surface, agent_wallet_cards, + invocation_scope_card: None, + invocation_scope_handles: HashMap::new(), + wallet_id_hash, + wallet_generation, card_event_boundary_scan: None, total_linear_memory_size, current_filesystem_storage_usage, @@ -7038,6 +8799,7 @@ impl PrivateDurableWorkerState { pub fn reset_invocation_call_counts(&mut self) { self.http_call_count = 0; self.rpc_call_count = 0; + self.scope_card_mint_ordinal = 0; // The `get_oplog_index` marker watermark is per-invocation: a marker captured in a previous // invocation only costs a graceful checkpoint fallback if jumped to, never correctness. self.min_exposed_marker = None; diff --git a/golem-worker-executor/src/durable_host/permissions/mod.rs b/golem-worker-executor/src/durable_host/permissions/mod.rs new file mode 100644 index 0000000000..37dda6f090 --- /dev/null +++ b/golem-worker-executor/src/durable_host/permissions/mod.rs @@ -0,0 +1,3690 @@ +// Copyright 2024-2026 Golem Cloud +// +// Licensed under the Golem Source License v1.1 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://license.golem.cloud/LICENSE +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Host-side binding for the opaque `golem:core/types.permission-card` +//! resource and the [`PermissionCardResolver`] boundary bridge. +//! +//! The resource itself is defined in `golem:core/types` (so it can travel +//! inside a `schema-value-tree` as an opaque owned handle) and is bound to the +//! opaque [`PermissionCardHandleRep`] by golem-schema. The only operation the +//! core interface declares for it is `drop`, which releases the handle from the +//! resource table. +//! +//! The resolver stores the trusted [`PermissionCardValuePayload`] snapshot in +//! the handle rep, optionally paired with the locally resolved [`StoredCard`]. +//! Lifting a handle consumes it and returns the snapshot; lowering a snapshot +//! materializes a fresh handle and verifies it against the local wallet when the +//! card is already known locally. No durable oplog entry is written here; the +//! durable/cross-executor representation is the snapshot embedded in the +//! surrounding value, never the live handle. + +use crate::durable_host::concurrent::{CallHandle, CallReplayOutcome, NotCancellable}; +use crate::durable_host::{DurabilityHost, DurableWorkerCtx}; +use crate::preview2::golem::permissions::derive as permissions_derive; +use crate::preview2::golem::permissions::inspect as permissions_inspect; +use crate::preview2::golem::permissions::kernel_introspection as permissions_kernel; +use crate::preview2::golem::permissions::revoke as permissions_revoke; +use crate::preview2::golem::permissions::types as permissions_types; +use crate::preview2::golem::permissions::wallet as permissions_wallet; +use crate::services::HasWorker; +use crate::services::card::{CardRevokeResult, CardState}; +use crate::services::oplog::{CommitLevel, OplogOps}; +use crate::workerctx::WorkerCtx; +use anyhow::anyhow; +use chrono::{DateTime, TimeDelta, Utc}; +use golem_common::base_model::oplog::QueuedCardEventTransfer; +use golem_common::model::account::AccountEmail; +use golem_common::model::agent::ParsedAgentId; +use golem_common::model::card::owner::AccountOwnerPattern; +use golem_common::model::card::recipient::RecipientPattern; +use golem_common::model::card::{ + AgentCardHolder, AgentPermissionMonomorphizationContext, Card, CardAlgebraError, CardClass, + CardHolder, CardId, CardManagedBy, CardManagedByRuntimeDerived, CardParseError, + CardResourcePattern, CardVerb, ClassPermissionTarget, DelegationCard, DelegationSurface, + EffectiveSurface, PermissionPattern, PermissionTarget, PolymorphicCard, + PolymorphicPermissionPattern, RenderedPermissionFields, ScopeCard, StoredCard, + WalletDerivationParent, agent_delegation_surface_from_wallet, + instantiate_polymorphic_card_for_agent, monomorphize_card_for_agent, parse_permission_fields, + permission_class_metadata, +}; +use golem_common::model::oplog::host_functions::{ + GolemPermissionsDerivePersist, GolemPermissionsInstallChildPersist, + GolemPermissionsInstallTransfer, GolemPermissionsRevokePersist, +}; +use golem_common::model::oplog::payload::types::PermissionCardRevokeError; +use golem_common::model::oplog::{ + DurableFunctionType, HostPayloadPair, HostRequest, HostRequestPermissionCardDerive, + HostRequestPermissionCardRevoke, HostRequestPermissionCardTransfer, + HostResponsePermissionCardDerived, HostResponsePermissionCardTransferComplete, + HostResponsePermissionCardsRevoked, OplogEntry, OplogIndex, QueuedCardEvent, +}; +use golem_common::model::{AgentId, IdempotencyKey, OwnedAgentId, PendingCardEventRef, Timestamp}; +use golem_common::serialization::{deserialize, serialize}; +use golem_schema::schema::schema_value::PermissionCardValuePayload; +use golem_schema::schema::wit::wire::HostPermissionCard; +use golem_schema::schema::wit::{PermissionCardHandleRep, PermissionCardResolver}; +use golem_service_base::error::worker_executor::WorkerExecutorError; +use std::collections::BTreeSet; +use uuid::Uuid; +use wasmtime::component::Resource; + +#[derive(Clone, Debug)] +enum PermissionCardEntry { + Persistent { + snapshot: PermissionCardValuePayload, + card: Option, + }, + Scope { + card: ScopeCard, + invocation_key: IdempotencyKey, + }, +} + +impl PermissionCardEntry { + fn from_card(card: StoredCard) -> Self { + Self::Persistent { + snapshot: snapshot_from_card(&card), + card: Some(card), + } + } + + fn from_snapshot(snapshot: PermissionCardValuePayload) -> Self { + Self::Persistent { + snapshot, + card: None, + } + } + + fn from_scope(card: ScopeCard, invocation_key: IdempotencyKey) -> Self { + Self::Scope { + card, + invocation_key, + } + } + + fn snapshot(&self) -> Result { + match self { + Self::Persistent { snapshot, .. } => Ok(snapshot.clone()), + Self::Scope { .. } => Err(scope_card_snapshot_error()), + } + } + + fn into_snapshot(self) -> Result { + match self { + Self::Persistent { snapshot, .. } => Ok(snapshot), + Self::Scope { .. } => Err(scope_card_snapshot_error()), + } + } + + fn cached_card(&self) -> Option { + match self { + Self::Persistent { card, .. } => card.clone(), + Self::Scope { .. } => None, + } + } + + fn scope_card(&self) -> Option<(&ScopeCard, &IdempotencyKey)> { + match self { + Self::Persistent { .. } => None, + Self::Scope { + card, + invocation_key, + } => Some((card, invocation_key)), + } + } +} + +#[derive(Clone, Debug)] +enum ResolvedPermissionCard { + Persistent(StoredCard), + Scope(ScopeCard), +} + +impl ResolvedPermissionCard { + fn card_id(&self) -> CardId { + match self { + Self::Persistent(card) => card.card_id(), + Self::Scope(card) => card.scope_card_id, + } + } + + fn parent_ids(&self) -> &[CardId] { + match self { + Self::Persistent(card) => card.parent_ids(), + Self::Scope(card) => &card.root_card_ids, + } + } + + fn expires_at(&self) -> Option> { + match self { + Self::Persistent(card) => card.expires_at(), + Self::Scope(_) => None, + } + } + + fn is_polymorphic(&self) -> bool { + matches!(self, Self::Persistent(StoredCard::Polymorphic(_))) + } + + fn into_persistent( + self, + operation: &'static str, + ) -> Result { + match self { + Self::Persistent(card) => Ok(card), + Self::Scope(_) => Err(scope_card_operation_error(operation)), + } + } +} + +impl From> for permissions_types::Timestamp { + fn from(timestamp: DateTime) -> Self { + Self { + seconds: timestamp.timestamp(), + nanoseconds: timestamp.timestamp_subsec_nanos(), + } + } +} + +fn snapshot_from_card(card: &StoredCard) -> PermissionCardValuePayload { + PermissionCardValuePayload { + card_id: card.card_id().0, + parent_ids: card.parent_ids().iter().map(|card_id| card_id.0).collect(), + expires_at: card.expires_at(), + polymorphic: matches!(card, StoredCard::Polymorphic(_)), + } +} + +fn sorted_uuids(values: impl IntoIterator) -> Vec { + let mut values = values.into_iter().collect::>(); + values.sort_unstable(); + values +} + +fn snapshot_matches_card(snapshot: &PermissionCardValuePayload, card: &StoredCard) -> bool { + snapshot.card_id == card.card_id().0 + && sorted_uuids(snapshot.parent_ids.iter().copied()) + == sorted_uuids(card.parent_ids().iter().map(|card_id| card_id.0)) + && snapshot.expires_at == card.expires_at() + && snapshot.polymorphic == matches!(card, StoredCard::Polymorphic(_)) +} + +fn snapshot_mismatch_error(card_id: Uuid) -> permissions_types::PermissionError { + permissions_types::PermissionError::NotPermitted(format!( + "permission-card snapshot for {card_id} does not match the stored card" + )) +} + +fn permission_error_to_anyhow(error: permissions_types::PermissionError) -> anyhow::Error { + anyhow!("permission-card error: {error:?}") +} + +fn worker_error_to_permission_error( + error: WorkerExecutorError, +) -> permissions_types::PermissionError { + permissions_types::PermissionError::NotPermitted(format!( + "permission-card store lookup failed: {error}" + )) +} + +fn invalid_handle_error(error: impl std::fmt::Display) -> WorkerExecutorError { + WorkerExecutorError::runtime(format!("invalid permission-card handle: {error}")) +} + +fn scope_card_snapshot_error() -> WorkerExecutorError { + WorkerExecutorError::runtime( + "scope-card handles cannot be serialized as persistent permission-card snapshots", + ) +} + +fn scope_card_operation_error(operation: &'static str) -> permissions_types::PermissionError { + permissions_types::PermissionError::NotPermitted(format!( + "{operation} does not accept scope cards" + )) +} + +fn permission_card_snapshot_from_rep( + rep: &PermissionCardHandleRep, +) -> Result { + if let Some(entry) = rep.downcast_ref::() { + entry.snapshot() + } else if let Some(snapshot) = rep.downcast_ref::() { + Ok(snapshot.clone()) + } else { + Err(WorkerExecutorError::runtime( + "permission-card resource had unexpected payload type", + )) + } +} + +fn permission_card_snapshot( + ctx: &mut DurableWorkerCtx, + handle: &Resource, +) -> Result { + let rep = ctx.table().get(handle).map_err(invalid_handle_error)?; + permission_card_snapshot_from_rep(rep) +} + +fn permission_card_cached_card( + ctx: &mut DurableWorkerCtx, + handle: &Resource, +) -> Result, WorkerExecutorError> { + let rep = ctx.table().get(handle).map_err(invalid_handle_error)?; + Ok(rep + .downcast_ref::() + .and_then(PermissionCardEntry::cached_card)) +} + +fn permission_card_scope_card( + ctx: &mut DurableWorkerCtx, + handle: &Resource, +) -> Result, WorkerExecutorError> { + let rep = ctx.table().get(handle).map_err(invalid_handle_error)?; + Ok(rep + .downcast_ref::() + .and_then(PermissionCardEntry::scope_card) + .map(|(card, invocation_key)| (card.clone(), invocation_key.clone()))) +} + +pub(crate) fn resolve_invocation_scope_card( + ctx: &mut DurableWorkerCtx, + handle: &Resource, +) -> Result { + let invocation_key = ctx + .state + .get_current_idempotency_key() + .ok_or_else(|| "scope cards require an active invocation".to_string())?; + let scope_card = permission_card_scope_card(ctx, handle) + .map_err(|error| format!("invalid permission-card handle: {error}"))?; + resolve_owned_scope_card(scope_card, &invocation_key) +} + +fn resolve_owned_scope_card( + scope_card: Option<(ScopeCard, IdempotencyKey)>, + invocation_key: &IdempotencyKey, +) -> Result { + let Some((card, owner_invocation_key)) = scope_card else { + return Err("the scope-card argument must be a scope card".to_string()); + }; + if &owner_invocation_key == invocation_key { + Ok(card) + } else { + Err("the scope-card handle belongs to a different invocation".to_string()) + } +} + +async fn resolve_permission_card( + ctx: &mut DurableWorkerCtx, + handle: &Resource, +) -> Result { + let snapshot = permission_card_snapshot(ctx, handle).map_err(|error| { + permissions_types::PermissionError::NotPermitted(format!( + "invalid permission-card handle: {error}" + )) + })?; + + if let Some(card) = permission_card_cached_card(ctx, handle).map_err(|error| { + permissions_types::PermissionError::NotPermitted(format!( + "invalid permission-card handle: {error}" + )) + })? { + if snapshot_matches_card(&snapshot, &card) { + return Ok(card); + } + return Err(snapshot_mismatch_error(snapshot.card_id)); + } + + let card_id = CardId(snapshot.card_id); + if let Some(card) = ctx.state.agent_wallet_cards.get(&card_id).cloned() { + if snapshot_matches_card(&snapshot, &card) { + return Ok(card); + } + return Err(snapshot_mismatch_error(snapshot.card_id)); + } + + let card_state = ctx + .state + .card_service + .check_cards(vec![card_id]) + .await + .map_err(worker_error_to_permission_error)? + .remove(&card_id); + + match card_state { + Some(CardState::Live(card)) => { + let card = *card; + if snapshot_matches_card(&snapshot, &card) { + Ok(card) + } else { + Err(snapshot_mismatch_error(snapshot.card_id)) + } + } + Some(CardState::Revoked) => Err(permissions_types::PermissionError::CardRevoked(format!( + "permission card {} is revoked", + card_id.0 + ))), + Some(CardState::Unknown) | None => Err(permissions_types::PermissionError::CardRevoked( + format!("permission card {} is unknown or revoked", card_id.0), + )), + } +} + +async fn resolve_permission_card_handle( + ctx: &mut DurableWorkerCtx, + handle: &Resource, +) -> Result { + let scope_card = permission_card_scope_card(ctx, handle).map_err(|error| { + permissions_types::PermissionError::NotPermitted(format!( + "invalid permission-card handle: {error}" + )) + })?; + match scope_card { + Some((card, _)) => Ok(ResolvedPermissionCard::Scope(card)), + None => resolve_permission_card(ctx, handle) + .await + .map(ResolvedPermissionCard::Persistent), + } +} + +async fn resolve_permission_card_handle_or_trap( + ctx: &mut DurableWorkerCtx, + handle: &Resource, +) -> anyhow::Result { + resolve_permission_card_handle(ctx, handle) + .await + .map_err(permission_error_to_anyhow) +} + +fn parse_pattern_grant( + g: &permissions_types::PatternGrant, +) -> Result { + parse_permission_fields(&g.class, &g.owner, &g.recipient, &g.verb, &g.resource_id) + .map_err(permission_error_from_parse) +} + +fn permission_error_from_parse(error: CardParseError) -> permissions_types::PermissionError { + match error { + CardParseError::UnknownClass(class) => { + permissions_types::PermissionError::UnknownResourceClass(class) + } + CardParseError::UnknownVerb { verb, .. } => { + permissions_types::PermissionError::InvalidVerb(verb) + } + CardParseError::InvalidOwnerPath { owner, .. } => { + permissions_types::PermissionError::InvalidOwner(owner) + } + CardParseError::InvalidRecipientPath(recipient) => { + permissions_types::PermissionError::InvalidRecipient(recipient) + } + CardParseError::Malformed(message) => { + permissions_types::PermissionError::InvalidPattern(message) + } + CardParseError::InvalidResource { resource, .. } => { + permissions_types::PermissionError::InvalidPattern(resource) + } + CardParseError::SlotVariableInConcreteGrant(value) => { + permissions_types::PermissionError::InvalidPattern(value) + } + } +} + +fn pattern_grant_from_fields(fields: RenderedPermissionFields) -> permissions_types::PatternGrant { + permissions_types::PatternGrant { + class: fields.class.to_string(), + owner: fields.owner, + recipient: fields.recipient, + verb: fields.verb, + resource_id: fields.resource, + } +} + +fn concrete_pattern_grant( + pattern: &PermissionPattern, +) -> Result { + pattern + .render_fields() + .map(pattern_grant_from_fields) + .map_err(permissions_types::PermissionError::InvalidPattern) +} + +fn polymorphic_pattern_grant( + pattern: &PolymorphicPermissionPattern, +) -> Result { + pattern + .render_fields() + .map(pattern_grant_from_fields) + .map_err(permissions_types::PermissionError::InvalidPattern) +} + +fn concrete_pattern_grants( + patterns: &[PermissionPattern], +) -> Result, permissions_types::PermissionError> { + patterns.iter().map(concrete_pattern_grant).collect() +} + +fn polymorphic_pattern_grants( + patterns: &[PolymorphicPermissionPattern], +) -> Result, permissions_types::PermissionError> { + patterns.iter().map(polymorphic_pattern_grant).collect() +} + +fn card_view( + card: &ResolvedPermissionCard, +) -> Result { + match card { + ResolvedPermissionCard::Persistent(StoredCard::Concrete(card)) => { + Ok(permissions_types::CardView { + lower_positive: concrete_pattern_grants(&card.lower_positive)?, + lower_negative: concrete_pattern_grants(&card.lower_negative)?, + upper_positive: concrete_pattern_grants(&card.upper_positive)?, + upper_negative: concrete_pattern_grants(&card.upper_negative)?, + }) + } + ResolvedPermissionCard::Persistent(StoredCard::Polymorphic(card)) => { + Ok(permissions_types::CardView { + lower_positive: polymorphic_pattern_grants(&card.lower_positive)?, + lower_negative: polymorphic_pattern_grants(&card.lower_negative)?, + upper_positive: polymorphic_pattern_grants(&card.upper_positive)?, + upper_negative: polymorphic_pattern_grants(&card.upper_negative)?, + }) + } + ResolvedPermissionCard::Scope(card) => Ok(permissions_types::CardView { + lower_positive: concrete_pattern_grants(&card.lower_positive)?, + lower_negative: concrete_pattern_grants(&card.lower_negative)?, + upper_positive: concrete_pattern_grants(&card.upper_positive)?, + upper_negative: concrete_pattern_grants(&card.upper_negative)?, + }), + } +} + +fn card_verb_name(verb: CardVerb) -> &'static str { + match verb { + CardVerb::Derive => "derive", + CardVerb::Revoke => "revoke", + CardVerb::Inspect => "inspect", + CardVerb::Install => "install", + } +} + +fn permission_error_from_algebra(error: CardAlgebraError) -> permissions_types::PermissionError { + match error { + CardAlgebraError::InvalidOwnerPath(owner) => { + permissions_types::PermissionError::InvalidOwner(owner) + } + CardAlgebraError::InvalidRecipientPath(recipient) => { + permissions_types::PermissionError::InvalidRecipient(recipient) + } + CardAlgebraError::LowerBoundTooBroad { grant } => { + permissions_types::PermissionError::LowerBoundTooBroad( + grant + .render() + .unwrap_or_else(|_| "lower-bound grant is too broad".to_string()), + ) + } + CardAlgebraError::UpperBoundTooBroad { grant } => { + permissions_types::PermissionError::UpperBoundTooBroad( + grant + .and_then(|grant| grant.render().ok()) + .unwrap_or_else(|| "upper-bound grant is too broad".to_string()), + ) + } + } +} + +fn invalid_lifespan_error(message: impl std::fmt::Display) -> permissions_types::PermissionError { + permissions_types::PermissionError::InvalidPattern(format!( + "invalid ISO-8601 lifespan: {message}" + )) +} + +fn parse_lifespan( + lifespan: Option<&permissions_types::Duration>, +) -> Result, permissions_types::PermissionError> { + let Some(lifespan) = lifespan else { + return Ok(None); + }; + if !lifespan.iso_8601.starts_with('P') { + return Err(invalid_lifespan_error( + "duration must start with the 'P' designator", + )); + } + + let duration = golem_schema::schema::canonical::duration::from_text(&lifespan.iso_8601) + .map_err(invalid_lifespan_error)?; + Ok(Some(TimeDelta::nanoseconds(duration.nanoseconds))) +} + +fn derive_expires_at( + now: DateTime, + lifespan: Option<&permissions_types::Duration>, + parent_expires_at: Option>, +) -> Result>, permissions_types::PermissionError> { + if parent_expires_at.is_some_and(|expires_at| expires_at <= now) { + return Err(permissions_types::PermissionError::CardExpired( + "cannot derive from an expired parent card".to_string(), + )); + } + + let lifespan = parse_lifespan(lifespan)?; + let Some(lifespan) = lifespan else { + return if parent_expires_at.is_some() { + Err(permissions_types::PermissionError::CardExpired( + "an indefinite child card would outlive its parent card".to_string(), + )) + } else { + Ok(None) + }; + }; + let expires_at = now + .checked_add_signed(lifespan) + .ok_or_else(|| invalid_lifespan_error("resulting expiry is out of range"))?; + + if parent_expires_at.is_some_and(|parent_expires_at| expires_at > parent_expires_at) { + return Err(permissions_types::PermissionError::CardExpired( + "child card expiry would exceed its parent card expiry".to_string(), + )); + } + + Ok(Some(expires_at)) +} + +#[derive(Clone, Debug, PartialEq, Eq)] +struct DerivedGrantSets { + lower_positive: Vec, + lower_negative: Vec, + upper_positive: Vec, + upper_negative: Vec, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +struct ScopeDerivationParent { + root_card_ids: Vec, + delegation: DelegationCard, +} + +impl ScopeDerivationParent { + fn persistent(card: &Card) -> Self { + Self { + root_card_ids: vec![card.card_id], + delegation: DelegationCard { + source_card_id: Some(card.card_id), + lower_positive: card.lower_positive.clone(), + lower_negative: card.lower_negative.clone(), + upper_positive: card.upper_positive.clone(), + upper_negative: card.upper_negative.clone(), + }, + } + } + + fn scope(card: &ScopeCard) -> Self { + Self { + root_card_ids: card.root_card_ids.clone(), + delegation: DelegationCard { + source_card_id: Some(card.scope_card_id), + lower_positive: card.lower_positive.clone(), + lower_negative: card.lower_negative.clone(), + upper_positive: card.upper_positive.clone(), + upper_negative: card.upper_negative.clone(), + }, + } + } +} + +fn parse_grants( + grants: &[permissions_types::PatternGrant], +) -> Result, permissions_types::PermissionError> { + grants.iter().map(parse_pattern_grant).collect() +} + +fn derive_grant_sets( + parent: &Card, + lower_positive_to_retain: &[permissions_types::PatternGrant], + lower_negative_to_add: &[permissions_types::PatternGrant], + upper_positive_to_retain: &[permissions_types::PatternGrant], + upper_negative_to_add: &[permissions_types::PatternGrant], +) -> Result { + let lower_positive = parse_grants(lower_positive_to_retain)?; + let mut lower_negative = parent.lower_negative.clone(); + lower_negative.extend(parse_grants(lower_negative_to_add)?); + let upper_positive = parse_grants(upper_positive_to_retain)?; + let mut upper_negative = parent.upper_negative.clone(); + upper_negative.extend(parse_grants(upper_negative_to_add)?); + + DelegationSurface::from_cards(std::slice::from_ref(parent)) + .validate_attenuation( + &lower_positive, + &lower_negative, + &upper_positive, + &upper_negative, + ) + .map_err(permission_error_from_algebra)?; + + Ok(DerivedGrantSets { + lower_positive, + lower_negative, + upper_positive, + upper_negative, + }) +} + +fn parse_derived_grant_sets( + lower_positive: &[permissions_types::PatternGrant], + lower_negative: &[permissions_types::PatternGrant], + upper_positive: &[permissions_types::PatternGrant], + upper_negative: &[permissions_types::PatternGrant], +) -> Result { + Ok(DerivedGrantSets { + lower_positive: parse_grants(lower_positive)?, + lower_negative: parse_grants(lower_negative)?, + upper_positive: parse_grants(upper_positive)?, + upper_negative: parse_grants(upper_negative)?, + }) +} + +fn build_scope_card( + scope_card_id: CardId, + parents: &[ScopeDerivationParent], + grants: DerivedGrantSets, +) -> Result { + if parents.is_empty() { + return Err(permissions_types::PermissionError::NotPermitted( + "derive-scope requires at least one parent card".to_string(), + )); + } + + DelegationSurface { + cards: parents + .iter() + .map(|parent| parent.delegation.clone()) + .collect(), + } + .validate_attenuation( + &grants.lower_positive, + &grants.lower_negative, + &grants.upper_positive, + &grants.upper_negative, + ) + .map_err(permission_error_from_algebra)?; + + let root_card_ids = parents + .iter() + .flat_map(|parent| parent.root_card_ids.iter().copied()) + .collect::>() + .into_iter() + .collect(); + + Ok(ScopeCard { + scope_card_id, + root_card_ids, + lower_positive: grants.lower_positive, + lower_negative: grants.lower_negative, + upper_positive: grants.upper_positive, + upper_negative: grants.upper_negative, + }) +} + +fn persistent_scope_parent_from_wallet( + wallet: &[StoredCard], + resolved: &StoredCard, + context: &AgentPermissionMonomorphizationContext, +) -> Result { + let Some(wallet_card) = wallet + .iter() + .find(|wallet_card| wallet_card.card_id() == resolved.card_id()) + else { + return Err(permissions_types::PermissionError::NotPermitted(format!( + "parent card {} is not in the active invocation wallet", + resolved.card_id() + ))); + }; + if wallet_card != resolved { + return Err(permissions_types::PermissionError::NotPermitted(format!( + "parent card {} does not match the active invocation wallet", + resolved.card_id() + ))); + } + let card = monomorphize_card_for_agent(wallet_card, context); + Ok(ScopeDerivationParent::persistent(&card)) +} + +async fn resolve_scope_derivation_parents( + ctx: &mut DurableWorkerCtx, + handles: &[Resource], + invocation_key: &IdempotencyKey, +) -> Result, permissions_types::PermissionError> { + let wallet = ctx + .active_agent_wallet_cards_snapshot() + .await + .map_err(worker_error_to_permission_error)?; + let Some(agent_id) = ctx.state.agent_id.as_ref() else { + return Err(permissions_types::PermissionError::NotPermitted( + "derive-scope is only available to an agent".to_string(), + )); + }; + let context = super::agent_monomorphization_context( + &ctx.state.component_metadata, + &ctx.owned_agent_id, + agent_id, + ); + + let mut parents = Vec::with_capacity(handles.len()); + for handle in handles { + if let Some((card, owner_invocation_key)) = + permission_card_scope_card(ctx, handle).map_err(worker_error_to_permission_error)? + { + if &owner_invocation_key != invocation_key { + return Err(permissions_types::PermissionError::NotPermitted( + "scope-card parent belongs to a different invocation".to_string(), + )); + } + parents.push(ScopeDerivationParent::scope(&card)); + continue; + } + + let resolved = resolve_permission_card(ctx, handle).await?; + parents.push(persistent_scope_parent_from_wallet( + &wallet, &resolved, &context, + )?); + } + + Ok(parents) +} + +fn select_wallet_derivation_parent( + wallet: &[StoredCard], + context: &golem_common::model::card::AgentPermissionMonomorphizationContext, + grants: &DerivedGrantSets, +) -> Result { + let surface = agent_delegation_surface_from_wallet(context, wallet); + let parent_id = match surface + .select_wallet_derivation_parent( + &grants.lower_positive, + &grants.lower_negative, + &grants.upper_positive, + &grants.upper_negative, + ) + .map_err(permission_error_from_algebra)? + { + WalletDerivationParent::Single(parent_id) => parent_id, + WalletDerivationParent::MultipleRequired => { + return Err( + permissions_types::PermissionError::WalletMultiSourceRequired( + "the requested child card requires more than one wallet source; derive from an explicit parent card instead" + .to_string(), + ), + ); + } + WalletDerivationParent::NotPermitted => { + return Err(permissions_types::PermissionError::NotPermitted( + "no active wallet card permits the requested derivation".to_string(), + )); + } + }; + + let parent = wallet + .iter() + .find(|card| card.card_id() == parent_id) + .expect("wallet derivation selector returned a card outside the wallet"); + Ok(monomorphize_card_for_agent(parent, context)) +} + +async fn durable_now( + ctx: &mut DurableWorkerCtx, +) -> anyhow::Result> { + let now = + as wasmtime_wasi::p2::bindings::clocks::wall_clock::Host>::now(ctx) + .await?; + let seconds = i64::try_from(now.seconds) + .map_err(|_| anyhow!("durable wall-clock timestamp is out of range"))?; + DateTime::from_timestamp(seconds, now.nanoseconds) + .ok_or_else(|| anyhow!("durable wall-clock timestamp is invalid")) +} + +async fn persist_runtime_card( + ctx: &mut DurableWorkerCtx, + derive_card_id: DeriveCardId, + build_card: BuildCard, +) -> anyhow::Result +where + Ctx: WorkerCtx, + Pair: HostPayloadPair< + Req = HostRequestPermissionCardDerive, + Resp = HostResponsePermissionCardDerived, + >, + DeriveCardId: FnOnce(&DurableWorkerCtx, &IdempotencyKey, OplogIndex) -> CardId, + BuildCard: FnOnce(CardId) -> StoredCard, +{ + let invocation_key = ctx + .state + .get_current_idempotency_key() + .ok_or_else(|| anyhow!("runtime permission-card creation requires an active invocation"))?; + // Runtime-card creation is byte-idempotent for its deterministic card ID. It therefore uses + // the re-executable write class so a committed Start without an End can safely retry; the + // generic remote-write class would make retryability depend on the guest's idempotence flag. + let begun = + CallHandle::::begin(ctx, DurableFunctionType::WriteLocal).await?; + let oplog_index = begun.begin_index(); + let card_id = derive_card_id(ctx, &invocation_key, oplog_index); + let provenance = CardManagedByRuntimeDerived { + environment_id: ctx.owned_agent_id.environment_id, + agent_id: ctx.owned_agent_id.agent_id.clone(), + invocation_key, + oplog_index, + }; + let card = build_card(card_id); + let request = HostRequestPermissionCardDerive { + card: serialize(&card).map_err(|err| { + anyhow!("failed to serialize runtime permission card {card_id}: {err}") + })?, + provenance: serialize(&provenance).map_err(|err| { + anyhow!("failed to serialize provenance for permission card {card_id}: {err}") + })?, + }; + let handle = if begun.is_live() { + begun.start_live(ctx, request).await? + } else { + begun.start_replay(ctx).await? + }; + + let card_for_creation = card.clone(); + let response = handle + .run(ctx, async move |ctx| { + let created = ctx + .state + .card_service + .create_runtime_card(card_for_creation, provenance) + .await?; + if created.card_id() != card_id { + return Err(anyhow!( + "runtime permission-card creation returned {}, expected {card_id}", + created.card_id() + )); + } + let card = serialize(&created).map_err(|err| { + anyhow!("failed to serialize runtime permission card {card_id}: {err}") + })?; + Ok::<_, anyhow::Error>(HostResponsePermissionCardDerived { card }) + }) + .await?; + + let created: StoredCard = deserialize(&response.card) + .map_err(|err| anyhow!("failed to deserialize runtime permission card {card_id}: {err}"))?; + if created.card_id() != card_id { + return Err(anyhow!( + "replayed runtime permission-card creation returned {}, expected {card_id}", + created.card_id() + )); + } + + if ctx.state.snapshotting_mode.is_none() { + let wallet_generation = Some(ctx.state.wallet_generation); + if let Some((replayed_card, replayed_generation)) = ctx + .state + .replay_state + .pending_card_derivation(card_id) + .await + { + if replayed_card != created || replayed_generation != wallet_generation { + return Err(anyhow!( + "replayed CardDerived audit event does not match permission card {card_id}" + )); + } + } else if ctx.state.is_live() { + // A replay that ended immediately after the durable response is live here as well. In + // that crash window the persisted response proves registry creation succeeded, so + // reconstruct the missing audit entry before exposing the handle. + ctx.public_state + .worker() + .add_and_commit_oplog(OplogEntry::CardDerived { + timestamp: Timestamp::now_utc(), + card: created.clone(), + wallet_generation, + }) + .await; + } else { + return Err(anyhow!( + "replayed runtime permission-card creation {card_id} is missing its CardDerived audit event" + )); + } + ctx.process_pending_replay_events().await?; + } + + Ok(created) +} + +async fn persist_derived_card( + ctx: &mut DurableWorkerCtx, + parent_id: CardId, + grants: DerivedGrantSets, + created_at: DateTime, + expires_at: Option>, +) -> anyhow::Result> { + let created = persist_runtime_card::( + ctx, + |ctx, invocation_key, oplog_index| ctx.derive_card_id(invocation_key, oplog_index), + |card_id| { + StoredCard::Concrete(Card { + card_id, + parent_ids: vec![parent_id], + lower_positive: grants.lower_positive, + lower_negative: grants.lower_negative, + upper_positive: grants.upper_positive, + upper_negative: grants.upper_negative, + created_at, + expires_at, + system_card: false, + managed_by: None, + }) + }, + ) + .await?; + + ctx.table() + .push(PermissionCardHandleRep::new( + PermissionCardEntry::from_card(created), + )) + .map_err(Into::into) +} + +#[allow( + dead_code, + reason = "kept as a standalone durable primitive; transfers persist children within their outer call" +)] +pub(crate) async fn persist_installed_child_card( + ctx: &mut DurableWorkerCtx, + source: &PolymorphicCard, + target: &AgentPermissionMonomorphizationContext, +) -> anyhow::Result { + let created_at = durable_now(ctx).await?; + persist_runtime_card::( + ctx, + |ctx, invocation_key, oplog_index| { + ctx.derive_installed_child_card_id(invocation_key, oplog_index) + }, + |child_card_id| { + StoredCard::Concrete(instantiate_polymorphic_card_for_agent( + source, + target, + child_card_id, + created_at, + )) + }, + ) + .await +} + +async fn derive_and_persist_card( + ctx: &mut DurableWorkerCtx, + parent: &Card, + grants: DerivedGrantSets, + lifespan: Option<&permissions_types::Duration>, +) -> anyhow::Result, permissions_types::PermissionError>> { + let now = durable_now(ctx).await?; + let expires_at = match derive_expires_at(now, lifespan, parent.expires_at) { + Ok(expires_at) => expires_at, + Err(error) => return Ok(Err(error)), + }; + persist_derived_card(ctx, parent.card_id, grants, now, expires_at) + .await + .map(Ok) +} + +fn ensure_card_permission( + ctx: &DurableWorkerCtx, + verb: CardVerb, + resource: CardResourcePattern, +) -> Result<(), permissions_types::PermissionError> { + ensure_card_permission_in_surface( + &ctx.state.agent_effective_surface, + &ctx.state.created_by_email, + verb, + resource, + ) +} + +fn ensure_card_permission_in_surface( + surface: &EffectiveSurface, + created_by_email: &AccountEmail, + verb: CardVerb, + resource: CardResourcePattern, +) -> Result<(), permissions_types::PermissionError> { + let request = PermissionTarget::Card(ClassPermissionTarget:: { + verb: Some(verb), + owner: AccountOwnerPattern::Account { + account: created_by_email.clone(), + }, + resource, + }); + + if surface + .authorize(&request) + .map_err(permission_error_from_algebra)? + { + Ok(()) + } else { + Err(permissions_types::PermissionError::NotPermitted(format!( + "card:{} is not permitted for this agent", + card_verb_name(verb) + ))) + } +} + +fn effective_surface_without_card( + surface: &EffectiveSurface, + excluded_card_id: CardId, +) -> EffectiveSurface { + let Some(index) = surface + .source_card_ids + .iter() + .position(|card_id| *card_id == excluded_card_id) + else { + return surface.clone(); + }; + + let mut surface = surface.clone(); + surface.source_card_ids.remove(index); + surface.lower.remove(index); + surface.upper.remove(index); + surface +} + +fn ensure_install_permission_in_surface( + surface: &EffectiveSurface, + created_by_email: &AccountEmail, + card_id: CardId, + target: &RecipientPattern, +) -> Result<(), permissions_types::PermissionError> { + ensure_card_permission_in_surface( + &effective_surface_without_card(surface, card_id), + created_by_email, + CardVerb::Install, + CardResourcePattern::InstallTarget(target.clone()), + ) +} + +fn agent_recipient_pattern(context: &AgentPermissionMonomorphizationContext) -> RecipientPattern { + RecipientPattern::Agent { + account: context.account.clone(), + application: context.application.clone(), + environment: context.environment.clone(), + component: context.component.clone(), + agent_type: context.agent_type.clone(), + } +} + +#[derive(Clone, Debug)] +struct InstallAgentTarget { + agent_id: AgentId, + context: AgentPermissionMonomorphizationContext, +} + +const UNSUPPORTED_INSTALL_TARGET_ERROR: &str = "install-card currently supports only agent targets"; + +fn require_agent_install_target( + target: permissions_types::Holder, +) -> Result { + match target { + permissions_types::Holder::Agent(target) => Ok(target.into()), + permissions_types::Holder::Account(_) | permissions_types::Holder::App(_) => { + Err(permissions_types::PermissionError::NotPermitted( + UNSUPPORTED_INSTALL_TARGET_ERROR.to_string(), + )) + } + } +} + +async fn resolve_install_target_context( + ctx: &DurableWorkerCtx, + target: AgentId, +) -> Result { + let owned_target = OwnedAgentId::new(ctx.owned_agent_id().environment_id(), &target); + let target_revision = ctx + .state + .worker_service + .get(&owned_target) + .await + .map(|metadata| { + metadata + .last_known_status + .map(|status| status.component_revision) + .unwrap_or( + metadata + .initial_worker_metadata + .last_known_status + .component_revision, + ) + }); + let component = ctx + .state + .component_service + .get_metadata(target.component_id, target_revision) + .await + .map_err(|error| { + permissions_types::PermissionError::NotPermitted(format!( + "install-card target metadata lookup failed: {error}" + )) + })?; + let agent_type = ParsedAgentId::parse_agent_type_name(&target.agent_id).map_err(|error| { + permissions_types::PermissionError::InvalidRecipient(format!( + "invalid install target agent ID: {error}" + )) + })?; + + Ok(InstallAgentTarget { + agent_id: target.clone(), + context: AgentPermissionMonomorphizationContext { + account: component.account_email, + application: component.application_name, + environment: component.environment_name, + component: component.component_name, + agent_name: target.agent_id, + agent_type, + }, + }) +} + +#[derive(Clone, Debug)] +struct CardTransferData { + transfer_id: Uuid, + source_card: StoredCard, + installed_card: StoredCard, + installed_card_provenance: Option, + target_agent_id: AgentId, +} + +impl CardTransferData { + fn request(&self) -> anyhow::Result { + Ok(HostRequestPermissionCardTransfer { + transfer_id: self.transfer_id, + source_card: serialize(&self.source_card).map_err(|error| { + anyhow!( + "failed to serialize source permission card {}: {error}", + self.source_card.card_id() + ) + })?, + installed_card: serialize(&self.installed_card).map_err(|error| { + anyhow!( + "failed to serialize installed permission card {}: {error}", + self.installed_card.card_id() + ) + })?, + installed_card_provenance: self + .installed_card_provenance + .as_ref() + .map(serialize) + .transpose() + .map_err(|error| { + anyhow!("failed to serialize installed permission-card provenance: {error}") + })?, + target_agent_id: self.target_agent_id.clone(), + }) + } + + fn from_request( + request: HostRequestPermissionCardTransfer, + ) -> Result { + let source_card: StoredCard = deserialize(&request.source_card).map_err(|error| { + WorkerExecutorError::runtime(format!( + "failed to deserialize durable source permission card: {error}" + )) + })?; + let installed_card: StoredCard = deserialize(&request.installed_card).map_err(|error| { + WorkerExecutorError::runtime(format!( + "failed to deserialize durable installed permission card: {error}" + )) + })?; + let installed_card_provenance = request + .installed_card_provenance + .map(|provenance| { + deserialize(&provenance).map_err(|error| { + WorkerExecutorError::runtime(format!( + "failed to deserialize durable installed permission-card provenance: {error}" + )) + }) + }) + .transpose()?; + + match &source_card { + StoredCard::Concrete(_) + if source_card != installed_card || installed_card_provenance.is_some() => + { + return Err(WorkerExecutorError::unexpected_oplog_entry( + "a concrete source card transferred without modification", + format!( + "source card {} and installed card {} differ", + source_card.card_id(), + installed_card.card_id() + ), + )); + } + StoredCard::Polymorphic(_) => { + let StoredCard::Concrete(installed_child) = &installed_card else { + return Err(WorkerExecutorError::unexpected_oplog_entry( + "a concrete child for a polymorphic source transfer", + "a polymorphic installed card", + )); + }; + if installed_child.parent_ids != [source_card.card_id()] { + return Err(WorkerExecutorError::unexpected_oplog_entry( + "an installed child parented directly to its polymorphic source", + format!( + "installed card {} has parents {:?}", + installed_child.card_id, installed_child.parent_ids + ), + )); + } + if installed_card_provenance.is_none() { + return Err(WorkerExecutorError::unexpected_oplog_entry( + "runtime provenance for an installed polymorphic child", + "missing provenance", + )); + } + } + StoredCard::Concrete(_) => {} + } + + Ok(Self { + transfer_id: request.transfer_id, + source_card, + installed_card, + installed_card_provenance, + target_agent_id: request.target_agent_id, + }) + } + + fn source_holder(&self, ctx: &DurableWorkerCtx) -> CardHolder { + CardHolder::Agent(AgentCardHolder { + agent_id: ctx.owned_agent_id.agent_id.clone(), + }) + } + + fn target_holder(&self) -> CardHolder { + CardHolder::Agent(AgentCardHolder { + agent_id: self.target_agent_id.clone(), + }) + } +} + +fn installed_card_matches_request( + actual: &StoredCard, + requested: &StoredCard, + provenance: Option<&CardManagedByRuntimeDerived>, +) -> bool { + if provenance.is_none() { + return actual == requested; + } + match (actual, requested) { + (StoredCard::Concrete(actual), StoredCard::Concrete(requested)) => { + actual.card_id == requested.card_id + && actual.parent_ids == requested.parent_ids + && actual.lower_positive == requested.lower_positive + && actual.lower_negative == requested.lower_negative + && actual.upper_positive == requested.upper_positive + && actual.upper_negative == requested.upper_negative + && actual.created_at.timestamp_micros() == requested.created_at.timestamp_micros() + && actual.expires_at.map(|value| value.timestamp_micros()) + == requested.expires_at.map(|value| value.timestamp_micros()) + && actual.system_card == requested.system_card + && actual.managed_by == provenance.cloned().map(CardManagedBy::RuntimeDerived) + && requested.managed_by.is_none() + } + (StoredCard::Polymorphic(actual), StoredCard::Polymorphic(requested)) => { + actual == requested + } + _ => false, + } +} + +#[derive(Clone, Debug, Default, PartialEq, Eq)] +struct SourceTransferProgress { + queued: bool, + queued_card: Option, + derived_card: Option, + started: bool, + confirmed: bool, +} + +fn transfer_progress_mismatch(message: impl std::fmt::Display) -> WorkerExecutorError { + WorkerExecutorError::unexpected_oplog_entry( + "durable permission-card transfer state matching its persisted request", + message.to_string(), + ) +} + +async fn source_transfer_progress( + ctx: &DurableWorkerCtx, + start_index: OplogIndex, + transfer: &CardTransferData, +) -> Result { + let current_index = ctx.state.oplog.current_oplog_index().await; + if current_index < start_index { + return Err(transfer_progress_mismatch(format!( + "transfer start index {start_index} is beyond current oplog index {current_index}" + ))); + } + + let entries = ctx + .state + .oplog + .read_many( + start_index, + current_index.as_u64() - start_index.as_u64() + 1, + ) + .await; + let source_card_id = transfer.source_card.card_id(); + let installed_card_id = transfer.installed_card.card_id(); + let source_holder = transfer.source_holder(ctx); + let target_holder = transfer.target_holder(); + let mut progress = SourceTransferProgress::default(); + + for entry in entries.values() { + match entry { + OplogEntry::CardDerived { card, .. } + if card.card_id() == installed_card_id + && transfer.installed_card_provenance.is_some() => + { + if !installed_card_matches_request( + card, + &transfer.installed_card, + transfer.installed_card_provenance.as_ref(), + ) { + return Err(transfer_progress_mismatch(format!( + "derived card {} conflicts with transfer {}", + installed_card_id, transfer.transfer_id + ))); + } + if progress + .derived_card + .as_ref() + .is_some_and(|existing| existing != card) + { + return Err(transfer_progress_mismatch(format!( + "transfer {} has multiple distinct derived card payloads", + transfer.transfer_id + ))); + } + progress.derived_card = Some(card.clone()); + } + OplogEntry::CardEventQueued { + event: QueuedCardEvent::TransferStarted(event), + .. + } if event.transfer_id == transfer.transfer_id => { + let Some(queued_card) = event.card.as_ref() else { + return Err(transfer_progress_mismatch(format!( + "queued transfer {} is missing its installed card payload", + transfer.transfer_id + ))); + }; + if event.card_id != source_card_id + || !installed_card_matches_request( + queued_card, + &transfer.installed_card, + transfer.installed_card_provenance.as_ref(), + ) + || event.target_holder != target_holder + { + return Err(transfer_progress_mismatch(format!( + "queued transfer {} has a conflicting payload or target", + transfer.transfer_id + ))); + } + if progress + .queued_card + .as_ref() + .is_some_and(|existing| existing != queued_card) + { + return Err(transfer_progress_mismatch(format!( + "queued transfer {} has multiple distinct installed card payloads", + transfer.transfer_id + ))); + } + progress.queued = true; + progress.queued_card = Some(queued_card.clone()); + } + OplogEntry::CardTransferStarted { + transfer_id, + card_id, + source_holder: recorded_source_holder, + target_holder: recorded_target_holder, + .. + } if *transfer_id == transfer.transfer_id => { + if *card_id != source_card_id + || recorded_source_holder.as_ref() != Some(&source_holder) + || *recorded_target_holder != target_holder + { + return Err(transfer_progress_mismatch(format!( + "source transfer intent {} conflicts with its persisted request", + transfer.transfer_id + ))); + } + progress.started = true; + } + OplogEntry::CardTransferConfirmed { + transfer_id, + source_card_id: recorded_source_card_id, + installed_card_id: recorded_installed_card_id, + target_holder: recorded_target_holder, + .. + } if *transfer_id == transfer.transfer_id => { + if *recorded_source_card_id != source_card_id + || *recorded_installed_card_id != installed_card_id + || *recorded_target_holder != target_holder + { + return Err(transfer_progress_mismatch(format!( + "source transfer receipt {} conflicts with its persisted request", + transfer.transfer_id + ))); + } + progress.confirmed = true; + } + _ => {} + } + } + + if progress.started && !progress.queued { + return Err(transfer_progress_mismatch(format!( + "source transfer intent {} has no preceding queued payload", + transfer.transfer_id + ))); + } + if progress.confirmed && !progress.started { + return Err(transfer_progress_mismatch(format!( + "source transfer receipt {} has no source intent", + transfer.transfer_id + ))); + } + if progress.queued != progress.queued_card.is_some() { + return Err(transfer_progress_mismatch(format!( + "queued transfer {} has inconsistent payload state", + transfer.transfer_id + ))); + } + if transfer.installed_card_provenance.is_some() + && (progress.queued || progress.started || progress.confirmed) + && progress.derived_card.is_none() + { + return Err(transfer_progress_mismatch(format!( + "polymorphic transfer {} has no preceding CardDerived audit event", + transfer.transfer_id + ))); + } + + Ok(progress) +} + +async fn load_card_transfer_request( + ctx: &DurableWorkerCtx, + start_index: OplogIndex, +) -> Result { + let entry = ctx.state.oplog.read(start_index).await; + let (function_name, request) = match entry { + OplogEntry::Start { + function_name, + request: Some(request), + .. + } => (function_name, request), + other => { + return Err(WorkerExecutorError::unexpected_oplog_entry( + "permission-card transfer Start with a request", + format!("{other:?}"), + )); + } + }; + if function_name != GolemPermissionsInstallTransfer::HOST_FUNCTION_NAME { + return Err(WorkerExecutorError::unexpected_oplog_entry( + GolemPermissionsInstallTransfer::FQFN, + function_name.to_string(), + )); + } + let request: HostRequest = + ctx.state + .oplog + .download_payload(request) + .await + .map_err(|error| { + WorkerExecutorError::runtime(format!( + "failed to load durable permission-card transfer request: {error}" + )) + })?; + request.try_into().map_err(|error| { + WorkerExecutorError::unexpected_oplog_entry( + "permission-card transfer request payload", + error, + ) + }) +} + +async fn complete_source_card_transfer( + ctx: &mut DurableWorkerCtx, + transfer_id: Uuid, + source_card_id: CardId, + installed_card: &StoredCard, + target_agent_id: &AgentId, + started: bool, + remove_source_membership: bool, +) -> Result<(), WorkerExecutorError> { + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: target_agent_id.clone(), + }); + + if !started { + if remove_source_membership + && super::remove_wallet_card( + &mut ctx.state.agent_wallet_cards, + &mut ctx.state.wallet_generation, + source_card_id, + )? + { + ctx.rederive_agent_effective_surface_from_wallet(); + ctx.refresh_card_interest().await; + } + + ctx.public_state + .worker() + .add_and_commit_oplog(OplogEntry::card_transfer_started( + transfer_id, + source_card_id, + Some(CardHolder::Agent(AgentCardHolder { + agent_id: ctx.owned_agent_id.agent_id.clone(), + })), + target_holder.clone(), + Some(ctx.state.wallet_generation), + )) + .await; + } + + ctx.worker_proxy() + .deliver_card_transfer( + target_agent_id, + ctx.owned_agent_id.environment_id, + transfer_id, + source_card_id, + installed_card, + ) + .await + .map_err(|error| { + WorkerExecutorError::runtime(format!( + "permission-card transfer delivery failed: {error}" + )) + })?; + + ctx.public_state + .worker() + .add_and_commit_oplog(OplogEntry::card_transfer_confirmed( + transfer_id, + source_card_id, + installed_card.card_id(), + target_holder, + )) + .await; + + Ok(()) +} + +async fn execute_source_card_transfer( + ctx: &mut DurableWorkerCtx, + start_index: OplogIndex, + transfer: &CardTransferData, +) -> anyhow::Result<()> { + ctx.process_pending_replay_events().await?; + let progress = source_transfer_progress(ctx, start_index, transfer).await?; + if progress.confirmed { + return Ok(()); + } + + let mut installed_card = progress + .queued_card + .clone() + .or_else(|| progress.derived_card.clone()) + .unwrap_or_else(|| transfer.installed_card.clone()); + if !progress.queued { + if matches!(&transfer.source_card, StoredCard::Polymorphic(_)) + && progress.derived_card.is_none() + { + let provenance = transfer.installed_card_provenance.clone().ok_or_else(|| { + anyhow!("polymorphic transfer is missing installed child provenance") + })?; + let persisted = ctx + .state + .card_service + .create_runtime_card(transfer.installed_card.clone(), provenance) + .await?; + if !installed_card_matches_request( + &persisted, + &transfer.installed_card, + transfer.installed_card_provenance.as_ref(), + ) { + return Err(anyhow!( + "persisted installed permission card {} differs from its durable transfer payload", + persisted.card_id() + )); + } + installed_card = persisted; + ctx.public_state + .worker() + .add_and_commit_oplog(OplogEntry::CardDerived { + timestamp: Timestamp::now_utc(), + card: installed_card.clone(), + wallet_generation: Some(ctx.state.wallet_generation), + }) + .await; + } + + ctx.public_state + .worker() + .add_and_commit_oplog(OplogEntry::card_event_queued( + QueuedCardEvent::transfer_started_with_source( + transfer.transfer_id, + transfer.source_card.card_id(), + installed_card.clone(), + transfer.target_holder(), + ), + )) + .await; + } + + complete_source_card_transfer( + ctx, + transfer.transfer_id, + transfer.source_card.card_id(), + &installed_card, + &transfer.target_agent_id, + progress.started, + matches!(&transfer.source_card, StoredCard::Concrete(_)), + ) + .await?; + + Ok(()) +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +struct PendingSourceTransferProgress { + started: bool, + confirmed: bool, +} + +async fn pending_source_transfer_progress( + ctx: &DurableWorkerCtx, + pending: &PendingCardEventRef, + transfer: &QueuedCardEventTransfer, + installed_card: &StoredCard, + target_agent_id: &AgentId, +) -> Result { + let current_index = ctx.state.oplog.current_oplog_index().await; + if current_index < pending.oplog_index { + return Err(transfer_progress_mismatch(format!( + "pending transfer index {} is beyond current oplog index {current_index}", + pending.oplog_index + ))); + } + + let source_holder = CardHolder::Agent(AgentCardHolder { + agent_id: ctx.owned_agent_id.agent_id.clone(), + }); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: target_agent_id.clone(), + }); + let mut progress = PendingSourceTransferProgress::default(); + let mut found_queued_event = false; + let mut next_index = pending.oplog_index; + + while next_index <= current_index { + let remaining = current_index.as_u64() - next_index.as_u64() + 1; + let count = remaining.min(1024); + let entries = ctx.state.oplog.read_many(next_index, count).await; + + for entry in entries.values() { + match entry { + OplogEntry::CardEventQueued { + event: QueuedCardEvent::TransferStarted(recorded), + .. + } if recorded.transfer_id == transfer.transfer_id => { + if recorded.card_id != transfer.card_id + || recorded.card.as_ref() != Some(installed_card) + || recorded.target_holder != target_holder + { + return Err(transfer_progress_mismatch(format!( + "queued transfer {} has a conflicting retry payload", + transfer.transfer_id + ))); + } + found_queued_event = true; + } + OplogEntry::CardTransferStarted { + transfer_id, + card_id, + source_holder: recorded_source_holder, + target_holder: recorded_target_holder, + .. + } if *transfer_id == transfer.transfer_id => { + if *card_id != transfer.card_id + || !recorded_source_holder + .as_ref() + .is_none_or(|holder| holder == &source_holder) + || *recorded_target_holder != target_holder + { + return Err(transfer_progress_mismatch(format!( + "source transfer intent {} conflicts with its queued retry payload", + transfer.transfer_id + ))); + } + progress.started = true; + } + OplogEntry::CardTransferConfirmed { + transfer_id, + source_card_id, + installed_card_id, + target_holder: recorded_target_holder, + .. + } if *transfer_id == transfer.transfer_id => { + if *source_card_id != transfer.card_id + || *installed_card_id != installed_card.card_id() + || *recorded_target_holder != target_holder + { + return Err(transfer_progress_mismatch(format!( + "source transfer receipt {} conflicts with its queued retry payload", + transfer.transfer_id + ))); + } + progress.confirmed = true; + } + _ => {} + } + } + + next_index = OplogIndex::from_u64(next_index.as_u64() + count); + } + + if !found_queued_event { + return Err(transfer_progress_mismatch(format!( + "pending transfer {} has no durable queued retry payload", + transfer.transfer_id + ))); + } + if progress.confirmed && !progress.started { + return Err(transfer_progress_mismatch(format!( + "source transfer receipt {} has no source intent", + transfer.transfer_id + ))); + } + + Ok(progress) +} + +fn pending_transfer_target_agent_id( + transfer_id: Uuid, + target_holder: &CardHolder, +) -> Result<&AgentId, WorkerExecutorError> { + match target_holder { + CardHolder::Agent(target_holder) => Ok(&target_holder.agent_id), + CardHolder::Account(_) | CardHolder::Application(_) => Err(transfer_progress_mismatch( + format!("pending transfer {transfer_id} targets an unsupported non-agent holder"), + )), + } +} + +async fn retry_pending_source_card_transfer( + ctx: &mut DurableWorkerCtx, + pending: &PendingCardEventRef, + transfer: &QueuedCardEventTransfer, +) -> Result<(), WorkerExecutorError> { + let installed_card = transfer.card.as_ref().ok_or_else(|| { + transfer_progress_mismatch(format!( + "pending transfer {} is missing its installed card payload", + transfer.transfer_id + )) + })?; + let target_agent_id = + pending_transfer_target_agent_id(transfer.transfer_id, &transfer.target_holder)?; + let progress = + pending_source_transfer_progress(ctx, pending, transfer, installed_card, target_agent_id) + .await?; + if progress.confirmed { + return Ok(()); + } + + let remove_source_membership = if transfer.card_id == installed_card.card_id() { + if !matches!(installed_card, StoredCard::Concrete(_)) { + return Err(transfer_progress_mismatch(format!( + "concrete source transfer {} carries a polymorphic installed card", + transfer.transfer_id + ))); + } + true + } else { + let StoredCard::Concrete(installed_child) = installed_card else { + return Err(transfer_progress_mismatch(format!( + "polymorphic source transfer {} carries a polymorphic installed card", + transfer.transfer_id + ))); + }; + if installed_child.parent_ids != [transfer.card_id] { + return Err(transfer_progress_mismatch(format!( + "installed card {} is not parented directly to pending transfer source {}", + installed_child.card_id, transfer.card_id + ))); + } + false + }; + + complete_source_card_transfer( + ctx, + transfer.transfer_id, + transfer.card_id, + installed_card, + target_agent_id, + progress.started, + remove_source_membership, + ) + .await +} + +pub(super) async fn retry_pending_source_card_transfers( + ctx: &mut DurableWorkerCtx, +) -> Result<(), WorkerExecutorError> { + if !ctx.state.is_live() { + return Ok(()); + } + + let pending_events = ctx.pending_card_events_at_boundary().await?; + let mut first_error = None; + for pending in pending_events { + if let QueuedCardEvent::TransferStarted(transfer) = &pending.event + && let Err(error) = retry_pending_source_card_transfer(ctx, &pending, transfer).await + && first_error.is_none() + { + first_error = Some(error); + } + } + + match first_error { + Some(error) => Err(error), + None => Ok(()), + } +} + +fn ensure_revoke_authority( + target_and_ancestor_ids: &[CardId], + active_wallet: &[StoredCard], +) -> Result<(), permissions_types::PermissionError> { + if active_wallet + .iter() + .any(|card| target_and_ancestor_ids.contains(&card.card_id())) + { + Ok(()) + } else { + Err(permissions_types::PermissionError::NotPermitted( + "revoke requires possession of the target card or one of its live ancestors" + .to_string(), + )) + } +} + +async fn permission_card_revoke_response( + ctx: &mut DurableWorkerCtx, + handle: &Resource, + card_id: CardId, +) -> Result { + if let Err(error) = ensure_card_permission(ctx, CardVerb::Revoke, CardResourcePattern::Any) { + return Ok(HostResponsePermissionCardsRevoked { + result: Err(permission_error_to_revoke_error(error)?), + }); + } + let card = match resolve_permission_card(ctx, handle).await { + Ok(card) => card, + Err(error) => { + return Ok(HostResponsePermissionCardsRevoked { + result: Err(permission_error_to_revoke_error(error)?), + }); + } + }; + if card.card_id() != card_id { + return Err(WorkerExecutorError::runtime(format!( + "permission-card revoke handle resolved to {}, expected {card_id}", + card.card_id() + ))); + } + let active_wallet = ctx.active_agent_wallet_cards_snapshot().await?; + let ancestor_ids = ctx + .state + .card_service + .live_ancestor_ids_including_self(&card) + .await?; + if let Err(error) = ensure_revoke_authority(&ancestor_ids, &active_wallet) { + return Ok(HostResponsePermissionCardsRevoked { + result: Err(permission_error_to_revoke_error(error)?), + }); + } + + let result = match ctx.state.card_service.revoke_card(card_id).await? { + CardRevokeResult::Revoked(card_ids) => { + Ok(card_ids.into_iter().map(|card_id| card_id.0).collect()) + } + CardRevokeResult::AlreadyRevoked(message) => { + Err(PermissionCardRevokeError::AlreadyRevoked(message)) + } + CardRevokeResult::NotPermitted(message) => { + Err(PermissionCardRevokeError::NotPermitted(message)) + } + }; + Ok(HostResponsePermissionCardsRevoked { result }) +} + +fn permission_error_to_revoke_error( + error: permissions_types::PermissionError, +) -> Result { + match error { + permissions_types::PermissionError::CardRevoked(message) => { + Ok(PermissionCardRevokeError::CardRevoked(message)) + } + permissions_types::PermissionError::NotPermitted(message) => { + Ok(PermissionCardRevokeError::NotPermitted(message)) + } + error => Err(WorkerExecutorError::runtime(format!( + "unexpected permission-card revoke error: {error:?}" + ))), + } +} + +async fn complete_permission_card_revoke( + mut handle: CallHandle, + ctx: &mut DurableWorkerCtx, + card_handle: &Resource, + card_id: CardId, +) -> anyhow::Result { + let response = match permission_card_revoke_response(ctx, card_handle, card_id).await { + Ok(response) => response, + Err(error) => { + handle.abandon_for_trap(); + return Err(error.into()); + } + }; + let locally_revoked_card_ids = match &response.result { + Ok(card_ids) => card_ids.iter().copied().map(CardId).collect::>(), + Err(PermissionCardRevokeError::AlreadyRevoked(_)) + | Err(PermissionCardRevokeError::CardRevoked(_)) => vec![card_id], + Err(PermissionCardRevokeError::NotPermitted(_)) => Vec::new(), + }; + if let Err(error) = ctx + .apply_card_revoked_cascade(&locally_revoked_card_ids, false) + .await + { + handle.abandon_for_trap(); + return Err(error.into()); + } + handle.complete(ctx, response).await.map_err(Into::into) +} + +async fn revoke_and_persist_card( + ctx: &mut DurableWorkerCtx, + card_handle: &Resource, +) -> anyhow::Result> { + let snapshot = match permission_card_snapshot(ctx, card_handle) { + Ok(snapshot) => snapshot, + Err(error) => { + return Ok(Err(permissions_types::PermissionError::NotPermitted( + format!("invalid permission-card handle: {error}"), + ))); + } + }; + let card_id = CardId(snapshot.card_id); + let handle = CallHandle::::start( + ctx, + HostRequestPermissionCardRevoke { card_id: card_id.0 }, + DurableFunctionType::WriteRemote, + ) + .await?; + let response = if handle.is_live() { + complete_permission_card_revoke(handle, ctx, card_handle, card_id).await? + } else { + match handle.replay(ctx).await? { + CallReplayOutcome::Replayed(response) => response, + CallReplayOutcome::Incomplete(handle) => { + complete_permission_card_revoke(handle, ctx, card_handle, card_id).await? + } + } + }; + + match response.result { + Ok(revoked_card_ids) => { + let revoked_card_ids = revoked_card_ids.into_iter().map(CardId).collect::>(); + ctx.state + .card_service + .record_revoked_cards(&revoked_card_ids) + .await; + let count = u32::try_from(revoked_card_ids.len()) + .map_err(|_| anyhow!("permission-card revoke count exceeds u32"))?; + Ok(Ok(count)) + } + Err(PermissionCardRevokeError::AlreadyRevoked(message)) => { + ctx.state + .card_service + .record_revoked_cards(&[card_id]) + .await; + Ok(Err(permissions_types::PermissionError::CardRevoked( + message, + ))) + } + Err(PermissionCardRevokeError::CardRevoked(message)) => { + ctx.state + .card_service + .record_revoked_cards(&[card_id]) + .await; + Ok(Err(permissions_types::PermissionError::CardRevoked( + message, + ))) + } + Err(PermissionCardRevokeError::NotPermitted(message)) => Ok(Err( + permissions_types::PermissionError::NotPermitted(message), + )), + } +} + +impl HostPermissionCard for DurableWorkerCtx { + async fn drop(&mut self, rep: Resource) -> anyhow::Result<()> { + DurabilityHost::observe_function_call(self, "golem::core::permission-card", "drop"); + self.state.invocation_scope_handles.remove(&rep.rep()); + self.table().delete(rep)?; + Ok(()) + } +} + +impl PermissionCardResolver for DurableWorkerCtx { + type Error = WorkerExecutorError; + + fn snapshot_permission_card_handle( + &mut self, + handle: Resource, + ) -> Result { + self.state.invocation_scope_handles.remove(&handle.rep()); + let rep = self.table().delete(handle).map_err(invalid_handle_error)?; + match rep.into_payload::() { + Ok(entry) => entry.into_snapshot(), + Err(rep) => rep + .into_payload::() + .map_err(|_| { + WorkerExecutorError::runtime( + "permission-card resource had unexpected payload type", + ) + }), + } + } + + fn permission_card_handle_from_snapshot( + &mut self, + snapshot: &PermissionCardValuePayload, + ) -> Result, Self::Error> { + let entry = if let Some(card) = self.state.agent_wallet_cards.get(&CardId(snapshot.card_id)) + { + if !snapshot_matches_card(snapshot, card) { + return Err(WorkerExecutorError::runtime(format!( + "permission-card snapshot for {} does not match the stored card", + snapshot.card_id + ))); + } + PermissionCardEntry::from_card(card.clone()) + } else { + PermissionCardEntry::from_snapshot(snapshot.clone()) + }; + + self.table() + .push(PermissionCardHandleRep::new(entry)) + .map_err(|e| { + WorkerExecutorError::runtime(format!( + "failed to create permission-card handle: {e}" + )) + }) + } + + fn drop_permission_card_handle(&mut self, handle: Resource) { + self.state.invocation_scope_handles.remove(&handle.rep()); + let _ = self.table().delete(handle); + } +} + +impl permissions_types::Host for DurableWorkerCtx { + async fn id( + &mut self, + c: Resource, + ) -> anyhow::Result { + DurabilityHost::observe_function_call(self, "golem::permissions::types", "id"); + let card = resolve_permission_card_handle_or_trap(self, &c).await?; + Ok(card.card_id().into()) + } + + async fn parents( + &mut self, + c: Resource, + ) -> anyhow::Result> { + DurabilityHost::observe_function_call(self, "golem::permissions::types", "parents"); + let card = resolve_permission_card_handle_or_trap(self, &c).await?; + Ok(card.parent_ids().iter().copied().map(Into::into).collect()) + } + + async fn expires_at( + &mut self, + c: Resource, + ) -> anyhow::Result> { + DurabilityHost::observe_function_call(self, "golem::permissions::types", "expires-at"); + let card = resolve_permission_card_handle_or_trap(self, &c).await?; + Ok(card.expires_at().map(Into::into)) + } + + async fn is_polymorphic( + &mut self, + c: Resource, + ) -> anyhow::Result { + DurabilityHost::observe_function_call(self, "golem::permissions::types", "is-polymorphic"); + let card = resolve_permission_card_handle_or_trap(self, &c).await?; + Ok(card.is_polymorphic()) + } +} + +impl permissions_inspect::Host for DurableWorkerCtx { + async fn inspect_card( + &mut self, + c: Resource, + ) -> anyhow::Result> + { + DurabilityHost::observe_function_call(self, "golem::permissions::inspect", "inspect-card"); + let result = async { + ensure_card_permission(self, CardVerb::Inspect, CardResourcePattern::Any)?; + let card = resolve_permission_card_handle(self, &c).await?; + card_view(&card) + } + .await; + Ok(result) + } +} + +impl permissions_derive::Host for DurableWorkerCtx { + async fn derive( + &mut self, + parent: Resource, + lower_positive_to_retain: Vec, + lower_negative_to_add: Vec, + upper_positive_to_retain: Vec, + upper_negative_to_add: Vec, + lifespan: Option, + ) -> anyhow::Result, permissions_types::PermissionError>> + { + DurabilityHost::observe_function_call(self, "golem::permissions::derive", "derive"); + + async { + ensure_card_permission(self, CardVerb::Derive, CardResourcePattern::Any)?; + let parent = resolve_permission_card_handle(self, &parent) + .await? + .into_persistent("derive")?; + let StoredCard::Concrete(parent) = parent else { + return Ok(Err( + permissions_types::PermissionError::CardPolymorphicNotUsable( + "derive requires a concrete parent card".to_string(), + ), + )); + }; + let grants = match derive_grant_sets( + &parent, + &lower_positive_to_retain, + &lower_negative_to_add, + &upper_positive_to_retain, + &upper_negative_to_add, + ) { + Ok(grants) => grants, + Err(error) => return Ok(Err(error)), + }; + derive_and_persist_card(self, &parent, grants, lifespan.as_ref()).await + } + .await + } + + async fn derive_from_wallet( + &mut self, + lower_positive: Vec, + lower_negative: Vec, + upper_positive: Vec, + upper_negative: Vec, + lifespan: Option, + ) -> anyhow::Result, permissions_types::PermissionError>> + { + DurabilityHost::observe_function_call( + self, + "golem::permissions::derive", + "derive-from-wallet", + ); + + async { + ensure_card_permission(self, CardVerb::Derive, CardResourcePattern::Any)?; + let grants = parse_derived_grant_sets( + &lower_positive, + &lower_negative, + &upper_positive, + &upper_negative, + )?; + let wallet = self.active_agent_wallet_cards_snapshot().await?; + let Some(agent_id) = self.state.agent_id.as_ref() else { + return Ok(Err(permissions_types::PermissionError::NotPermitted( + "derive-from-wallet is only available to an agent".to_string(), + ))); + }; + let context = super::agent_monomorphization_context( + &self.state.component_metadata, + &self.owned_agent_id, + agent_id, + ); + let parent = match select_wallet_derivation_parent(&wallet, &context, &grants) { + Ok(parent) => parent, + Err(error) => return Ok(Err(error)), + }; + derive_and_persist_card(self, &parent, grants, lifespan.as_ref()).await + } + .await + } + + async fn derive_scope( + &mut self, + parents: Vec>, + lower_positive: Vec, + lower_negative: Vec, + upper_positive: Vec, + upper_negative: Vec, + ) -> anyhow::Result, permissions_types::PermissionError>> + { + DurabilityHost::observe_function_call(self, "golem::permissions::derive", "derive-scope"); + + let result = async { + ensure_card_permission(self, CardVerb::Derive, CardResourcePattern::Any)?; + let invocation_key = self.state.get_current_idempotency_key().ok_or_else(|| { + permissions_types::PermissionError::NotPermitted( + "derive-scope requires an active invocation".to_string(), + ) + })?; + let parents = resolve_scope_derivation_parents(self, &parents, &invocation_key).await?; + let grants = parse_derived_grant_sets( + &lower_positive, + &lower_negative, + &upper_positive, + &upper_negative, + )?; + let ordinal = self.state.scope_card_mint_ordinal; + let next_ordinal = ordinal.checked_add(1).ok_or_else(|| { + permissions_types::PermissionError::NotPermitted( + "scope-card mint ordinal exhausted".to_string(), + ) + })?; + let scope_card_id = self.derive_scope_card_id(&invocation_key, ordinal); + let card = build_scope_card(scope_card_id, &parents, grants)?; + Ok((card, invocation_key, next_ordinal)) + } + .await; + let (card, invocation_key, next_ordinal) = match result { + Ok(result) => result, + Err(error) => return Ok(Err(error)), + }; + let root_card_ids = card.root_card_ids.clone(); + let handle = self.table().push(PermissionCardHandleRep::new( + PermissionCardEntry::from_scope(card, invocation_key), + ))?; + self.state + .invocation_scope_handles + .insert(handle.rep(), root_card_ids); + self.state.scope_card_mint_ordinal = next_ordinal; + Ok(Ok(handle)) + } +} + +impl permissions_revoke::Host for DurableWorkerCtx { + async fn revoke_card( + &mut self, + c: Resource, + ) -> anyhow::Result> { + DurabilityHost::observe_function_call(self, "golem::permissions::revoke", "revoke-card"); + let result = match permission_card_scope_card(self, &c) { + Ok(Some(_)) => Ok(Err(scope_card_operation_error("revoke-card"))), + Ok(None) | Err(_) => revoke_and_persist_card(self, &c).await, + }; + self.drop_permission_card_handle(c); + result + } +} + +impl permissions_wallet::Host for DurableWorkerCtx { + async fn self_wallet(&mut self) -> anyhow::Result>> { + DurabilityHost::observe_function_call(self, "golem::permissions::wallet", "self-wallet"); + let cards = self.active_agent_wallet_cards_snapshot().await?; + let mut handles = cards + .into_iter() + .map(|card| { + self.table().push(PermissionCardHandleRep::new( + PermissionCardEntry::from_card(card), + )) + }) + .collect::, _>>() + .map_err(anyhow::Error::from)?; + + if let Some(scope_card) = self.state.invocation_scope_card.clone() { + let invocation_key = self.state.get_current_idempotency_key().ok_or_else(|| { + anyhow::anyhow!("an admitted scope card requires an active invocation") + })?; + let root_card_ids = scope_card.root_card_ids.clone(); + let handle = self.table().push(PermissionCardHandleRep::new( + PermissionCardEntry::from_scope(scope_card, invocation_key), + ))?; + self.state + .invocation_scope_handles + .insert(handle.rep(), root_card_ids); + handles.push(handle); + } + + Ok(handles) + } + + async fn self_version(&mut self) -> anyhow::Result { + DurabilityHost::observe_function_call(self, "golem::permissions::wallet", "self-version"); + let _ = self.active_agent_wallet_cards_snapshot().await?; + + let wallet_id_hash = self.wallet_id_hash().to_vec(); + let generation = self.wallet_generation(); + + Ok(permissions_types::WalletVersionToken { + wallet_id_hash, + generation, + }) + } + + async fn install_card( + &mut self, + card: Resource, + target: permissions_types::Holder, + ) -> anyhow::Result> { + DurabilityHost::observe_function_call(self, "golem::permissions::wallet", "install-card"); + let result: anyhow::Result> = async { + let target = match require_agent_install_target(target) { + Ok(target) => target, + Err(error) => return Ok(Err(error)), + }; + let source_card = match resolve_permission_card_handle(self, &card).await { + Ok(card) => match card.into_persistent("install-card") { + Ok(card) => card, + Err(error) => return Ok(Err(error)), + }, + Err(error) => return Ok(Err(error)), + }; + let target = match resolve_install_target_context(self, target).await { + Ok(target) => target, + Err(error) => return Ok(Err(error)), + }; + let target_recipient = agent_recipient_pattern(&target.context); + if let Err(error) = ensure_install_permission_in_surface( + &self.state.agent_effective_surface, + &self.state.created_by_email, + source_card.card_id(), + &target_recipient, + ) { + return Ok(Err(error)); + } + + let invocation_key = self + .state + .get_current_idempotency_key() + .ok_or_else(|| anyhow!("permission-card transfer requires an active invocation"))?; + let begun = CallHandle::::begin( + self, + DurableFunctionType::WriteLocal, + ) + .await?; + let operation_index = begun.begin_index(); + let transfer_id = self.derive_transfer_id(&invocation_key, operation_index); + let (installed_card, installed_card_provenance) = match &source_card { + StoredCard::Concrete(_) => (source_card.clone(), None), + StoredCard::Polymorphic(source) => { + let created_at = durable_now(self).await?; + ( + StoredCard::Concrete(instantiate_polymorphic_card_for_agent( + source, + &target.context, + self.derive_installed_child_card_id(&invocation_key, operation_index), + created_at, + )), + Some(CardManagedByRuntimeDerived { + environment_id: self.owned_agent_id.environment_id, + agent_id: self.owned_agent_id.agent_id.clone(), + invocation_key: invocation_key.clone(), + oplog_index: operation_index, + }), + ) + } + }; + let mut transfer = CardTransferData { + transfer_id, + source_card, + installed_card, + installed_card_provenance, + target_agent_id: target.agent_id, + }; + let request = transfer.request()?; + let mut handle = if begun.is_live() { + begun.start_live(self, request).await? + } else { + begun.start_replay(self).await? + }; + if handle.is_live() { + self.public_state + .worker() + .commit_oplog_and_update_state(CommitLevel::Always) + .await; + } + let start_index = handle.start_index(); + + if !handle.is_live() { + match handle.replay(self).await? { + CallReplayOutcome::Replayed(_) => { + self.process_pending_replay_events().await?; + return Ok(Ok(())); + } + CallReplayOutcome::Incomplete(live) => { + handle = live; + transfer = CardTransferData::from_request( + load_card_transfer_request(self, start_index).await?, + )?; + } + } + } + + if let Err(error) = execute_source_card_transfer(self, start_index, &transfer).await { + handle.abandon_for_trap(); + return Err(error); + } + handle + .complete(self, HostResponsePermissionCardTransferComplete {}) + .await?; + Ok(Ok(())) + } + .await; + self.drop_permission_card_handle(card); + result + } +} + +impl permissions_kernel::Host for DurableWorkerCtx { + async fn list_modules(&mut self) -> anyhow::Result> { + DurabilityHost::observe_function_call( + self, + "golem::permissions::kernel-introspection", + "list-modules", + ); + Ok(permission_class_metadata() + .into_iter() + .map(|metadata| permissions_kernel::KernelModule { + class_name: metadata.class_name.to_string(), + verbs: metadata + .verbs + .iter() + .map(|verb| (*verb).to_string()) + .collect(), + }) + .collect()) + } + + async fn validate_grant( + &mut self, + g: permissions_types::PatternGrant, + ) -> anyhow::Result> { + DurabilityHost::observe_function_call( + self, + "golem::permissions::kernel-introspection", + "validate-grant", + ); + Ok(parse_pattern_grant(&g).map(|_| ())) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use golem_common::model::agent::AgentTypeName; + use golem_common::model::application::ApplicationName; + use golem_common::model::card::owner::PolymorphicAccountOwnerPattern; + use golem_common::model::card::recipient::RecipientPattern; + use golem_common::model::card::{ + AccountCardHolder, AgentPermissionMonomorphizationContext, ApplicationCardHolder, + PolymorphicCard, PolymorphicClassPermissionPattern, card_matches_agent_recipient, + }; + use golem_common::model::component::ComponentName; + use golem_common::model::environment::EnvironmentName; + use test_r::test; + + fn valid_filesystem_grant() -> permissions_types::PatternGrant { + permissions_types::PatternGrant { + class: "filesystem".to_string(), + owner: "alice@example.com/shop/prod/cart-svc/CartAgent".to_string(), + recipient: "alice@example.com/shop/prod/cart-svc/CartAgent".to_string(), + verb: "read".to_string(), + resource_id: "/data/**".to_string(), + } + } + + fn scope_card(card_id: CardId, root_card_ids: Vec) -> ScopeCard { + let grant = parse_pattern_grant(&valid_filesystem_grant()).unwrap(); + ScopeCard { + scope_card_id: card_id, + root_card_ids, + lower_positive: vec![grant.clone()], + lower_negative: vec![grant.clone()], + upper_positive: vec![grant.clone()], + upper_negative: vec![grant], + } + } + + fn comparable_grants( + grants: &[permissions_types::PatternGrant], + ) -> Vec<(String, String, String, String, String)> { + grants + .iter() + .map(|grant| { + ( + grant.class.clone(), + grant.owner.clone(), + grant.recipient.clone(), + grant.verb.clone(), + grant.resource_id.clone(), + ) + }) + .collect() + } + + #[test] + fn scope_and_persistent_cards_share_the_metadata_and_inspection_shape() { + let card_id = CardId(Uuid::from_u128(10)); + let parent_ids = vec![CardId(Uuid::from_u128(1)), CardId(Uuid::from_u128(2))]; + let scope = scope_card(card_id, parent_ids.clone()); + let persistent = StoredCard::Concrete(Card { + card_id, + parent_ids, + lower_positive: scope.lower_positive.clone(), + lower_negative: scope.lower_negative.clone(), + upper_positive: scope.upper_positive.clone(), + upper_negative: scope.upper_negative.clone(), + created_at: DateTime::from_timestamp(1_700_000_000, 0).unwrap(), + expires_at: None, + system_card: false, + managed_by: None, + }); + let persistent = ResolvedPermissionCard::Persistent(persistent); + let scope = ResolvedPermissionCard::Scope(scope); + + assert_eq!(scope.card_id(), persistent.card_id()); + assert_eq!(scope.parent_ids(), persistent.parent_ids()); + assert_eq!(scope.expires_at(), persistent.expires_at()); + assert_eq!(scope.is_polymorphic(), persistent.is_polymorphic()); + + let persistent_view = card_view(&persistent).unwrap(); + let scope_view = card_view(&scope).unwrap(); + assert_eq!( + comparable_grants(&scope_view.lower_positive), + comparable_grants(&persistent_view.lower_positive) + ); + assert_eq!( + comparable_grants(&scope_view.lower_negative), + comparable_grants(&persistent_view.lower_negative) + ); + assert_eq!( + comparable_grants(&scope_view.upper_positive), + comparable_grants(&persistent_view.upper_positive) + ); + assert_eq!( + comparable_grants(&scope_view.upper_negative), + comparable_grants(&persistent_view.upper_negative) + ); + } + + #[test] + fn persistent_operations_reject_scope_cards() { + let scope = scope_card(CardId(Uuid::from_u128(10)), Vec::new()); + + for operation in ["derive", "revoke-card", "install-card"] { + assert!(matches!( + ResolvedPermissionCard::Scope(scope.clone()).into_persistent(operation), + Err(permissions_types::PermissionError::NotPermitted(message)) + if message == format!("{operation} does not accept scope cards") + )); + } + } + + #[test] + fn scope_cards_cannot_use_persistent_snapshot_transport() { + let entry = PermissionCardEntry::from_scope( + scope_card( + CardId(Uuid::from_u128(10)), + vec![CardId(Uuid::from_u128(1))], + ), + IdempotencyKey::fresh(), + ); + + let error = entry.into_snapshot().unwrap_err(); + assert!(error.to_string().contains( + "scope-card handles cannot be serialized as persistent permission-card snapshots" + )); + } + + #[test] + fn scope_card_handles_are_owned_by_the_minting_invocation() { + let owner = IdempotencyKey::new("owner".to_string()); + let card = scope_card( + CardId(Uuid::from_u128(10)), + vec![CardId(Uuid::from_u128(1))], + ); + + assert_eq!( + resolve_owned_scope_card(Some((card.clone(), owner.clone())), &owner).unwrap(), + card + ); + assert!( + resolve_owned_scope_card( + Some((card, owner)), + &IdempotencyKey::new("different-invocation".to_string()), + ) + .is_err() + ); + } + + #[test] + fn persistent_cards_are_not_accepted_as_scope_card_arguments() { + assert!( + resolve_owned_scope_card(None, &IdempotencyKey::new("current-invocation".to_string()),) + .is_err() + ); + } + + fn derive_authorization_surface() -> EffectiveSurface { + let recipient = + RecipientPattern::parse("alice@example.com/shop/prod/cart-svc/CartAgent").unwrap(); + let grant = parse_pattern_grant(&permissions_types::PatternGrant { + class: "card".to_string(), + owner: "alice@example.com".to_string(), + recipient: "alice@example.com/shop/prod/cart-svc/CartAgent".to_string(), + verb: "derive".to_string(), + resource_id: "*".to_string(), + }) + .unwrap(); + let card = Card { + card_id: CardId::new(), + parent_ids: Vec::new(), + lower_positive: vec![grant], + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: DateTime::from_timestamp(1_700_000_000, 0).unwrap(), + expires_at: None, + system_card: false, + managed_by: None, + }; + + EffectiveSurface::from_cards(&[card], &recipient).unwrap() + } + + fn install_authority_card(card_id: CardId, target: &RecipientPattern) -> StoredCard { + let grant = parse_pattern_grant(&permissions_types::PatternGrant { + class: "card".to_string(), + owner: "alice@example.com".to_string(), + recipient: "alice@example.com/shop/prod/cart-svc/CartAgent".to_string(), + verb: "install".to_string(), + resource_id: target.render(), + }) + .unwrap(); + StoredCard::Concrete(Card { + card_id, + parent_ids: Vec::new(), + lower_positive: vec![grant], + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: DateTime::from_timestamp(1_700_000_000, 0).unwrap(), + expires_at: None, + system_card: false, + managed_by: None, + }) + } + + #[test] + fn account_and_application_install_targets_are_rejected_at_the_wit_host_boundary() { + let unsupported_targets = [ + permissions_types::Holder::Account(Uuid::new_v4().into()), + permissions_types::Holder::App(Uuid::new_v4().into()), + ]; + + for target in unsupported_targets { + let error = require_agent_install_target(target).unwrap_err(); + let permissions_types::PermissionError::NotPermitted(message) = error else { + panic!("unsupported install target returned {error:?}") + }; + assert_eq!(message, UNSUPPORTED_INSTALL_TARGET_ERROR); + } + } + + #[test] + fn replay_recovery_rejects_account_and_application_transfer_targets() { + let unsupported_targets = [ + CardHolder::Account(AccountCardHolder { + account_id: Uuid::new_v4(), + }), + CardHolder::Application(ApplicationCardHolder { + application_id: Uuid::new_v4(), + }), + ]; + + for target in unsupported_targets { + let transfer_id = Uuid::new_v4(); + let error = pending_transfer_target_agent_id(transfer_id, &target).unwrap_err(); + assert!( + error.to_string().contains(&format!( + "pending transfer {transfer_id} targets an unsupported non-agent holder" + )), + "unexpected replay recovery error: {error}" + ); + } + } + + #[test] + fn install_card_authority_is_scoped_to_the_concrete_target() { + let account = AccountEmail::from("alice@example.com"); + let caller = + RecipientPattern::parse("alice@example.com/shop/prod/cart-svc/CartAgent").unwrap(); + let target = + RecipientPattern::parse("alice@example.com/shop/prod/worker-svc/WorkerAgent").unwrap(); + let other_target = + RecipientPattern::parse("alice@example.com/shop/prod/other-svc/OtherAgent").unwrap(); + let authority = install_authority_card(CardId::new(), &target); + let surface = EffectiveSurface::from_cards( + &[monomorphize_card_for_agent( + &authority, + &wallet_derivation_context(), + )], + &caller, + ) + .unwrap(); + + assert!( + ensure_install_permission_in_surface(&surface, &account, CardId::new(), &target,) + .is_ok() + ); + assert!(matches!( + ensure_install_permission_in_surface(&surface, &account, CardId::new(), &other_target,), + Err(permissions_types::PermissionError::NotPermitted(_)) + )); + } + + #[test] + fn install_card_cannot_authorize_its_own_installation() { + let account = AccountEmail::from("alice@example.com"); + let caller = + RecipientPattern::parse("alice@example.com/shop/prod/cart-svc/CartAgent").unwrap(); + let target = + RecipientPattern::parse("alice@example.com/shop/prod/worker-svc/WorkerAgent").unwrap(); + let transferred_card_id = CardId::new(); + let transferred = install_authority_card(transferred_card_id, &target); + let card = monomorphize_card_for_agent(&transferred, &wallet_derivation_context()); + let surface = EffectiveSurface::from_cards(&[card], &caller).unwrap(); + + assert!(matches!( + ensure_install_permission_in_surface(&surface, &account, transferred_card_id, &target,), + Err(permissions_types::PermissionError::NotPermitted(_)) + )); + } + + #[test] + fn install_card_recipients_must_cover_the_target() { + let context = wallet_derivation_context(); + let matching_recipient = + RecipientPattern::parse("alice@example.com/shop/prod/*/*").unwrap(); + let mismatching_recipient = + RecipientPattern::parse("alice@example.com/shop/staging/*/*").unwrap(); + let matching = wallet_parent( + 1, + &permissions_types::PatternGrant { + recipient: matching_recipient.render(), + ..valid_filesystem_grant() + }, + ); + let mismatching = wallet_parent( + 2, + &permissions_types::PatternGrant { + recipient: mismatching_recipient.render(), + ..valid_filesystem_grant() + }, + ); + let matching_negative_only = StoredCard::Concrete(Card { + card_id: CardId::new(), + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: vec![ + parse_pattern_grant(&permissions_types::PatternGrant { + recipient: matching_recipient.render(), + ..valid_filesystem_grant() + }) + .unwrap(), + ], + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: DateTime::from_timestamp(1_700_000_000, 0).unwrap(), + expires_at: None, + system_card: false, + managed_by: None, + }); + let polymorphic = StoredCard::Polymorphic(PolymorphicCard { + card_id: CardId::new(), + parent_ids: Vec::new(), + lower_positive: vec![PolymorphicPermissionPattern::Card( + PolymorphicClassPermissionPattern { + verb: Some(CardVerb::Inspect), + owner: PolymorphicAccountOwnerPattern::Account, + recipient: matching_recipient, + resource: CardResourcePattern::Any, + }, + )], + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: DateTime::from_timestamp(1_700_000_000, 0).unwrap(), + expires_at: None, + system_card: false, + }); + + assert!(card_matches_agent_recipient(&matching, &context)); + assert!(card_matches_agent_recipient(&polymorphic, &context)); + assert!(!card_matches_agent_recipient(&mismatching, &context)); + assert!(!card_matches_agent_recipient( + &matching_negative_only, + &context + )); + } + + #[test] + fn installed_child_request_matches_registry_canonicalization() { + let requested = StoredCard::Concrete(Card { + card_id: CardId::new(), + parent_ids: vec![CardId::new()], + lower_positive: vec![parse_pattern_grant(&valid_filesystem_grant()).unwrap()], + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: DateTime::from_timestamp(1_700_000_000, 123_456_789).unwrap(), + expires_at: Some(DateTime::from_timestamp(1_800_000_000, 987_654_321).unwrap()), + system_card: false, + managed_by: None, + }); + let provenance = CardManagedByRuntimeDerived { + environment_id: golem_common::model::environment::EnvironmentId(Uuid::new_v4()), + agent_id: AgentId { + component_id: golem_common::model::component::ComponentId(Uuid::new_v4()), + agent_id: "source-agent".to_string(), + }, + invocation_key: IdempotencyKey::fresh(), + oplog_index: OplogIndex::from_u64(42), + }; + let mut canonical = requested.clone(); + if let StoredCard::Concrete(canonical_card) = &mut canonical { + canonical_card.created_at = + DateTime::from_timestamp(1_700_000_000, 123_456_000).unwrap(); + canonical_card.expires_at = + Some(DateTime::from_timestamp(1_800_000_000, 987_654_000).unwrap()); + canonical_card.managed_by = Some(CardManagedBy::RuntimeDerived(provenance.clone())); + } + + assert!(installed_card_matches_request( + &canonical, + &requested, + Some(&provenance), + )); + + if let StoredCard::Concrete(canonical_card) = &mut canonical { + canonical_card.parent_ids.push(CardId::new()); + } + assert!(!installed_card_matches_request( + &canonical, + &requested, + Some(&provenance), + )); + } + + #[test] + fn derive_requires_the_global_card_derive_permission() { + let account = AccountEmail::from("alice@example.com"); + let surface = derive_authorization_surface(); + + assert!( + ensure_card_permission_in_surface( + &surface, + &account, + CardVerb::Derive, + CardResourcePattern::Any, + ) + .is_ok() + ); + assert!(matches!( + ensure_card_permission_in_surface( + &EffectiveSurface::default(), + &account, + CardVerb::Derive, + CardResourcePattern::Any, + ), + Err(permissions_types::PermissionError::NotPermitted(_)) + )); + assert!(matches!( + ensure_card_permission_in_surface( + &surface, + &account, + CardVerb::Revoke, + CardResourcePattern::Any, + ), + Err(permissions_types::PermissionError::NotPermitted(_)) + )); + } + + #[test] + fn revoke_requires_possession_of_the_target_or_a_live_ancestor() { + let target = wallet_parent(3, &valid_filesystem_grant()); + let ancestor = wallet_parent(2, &valid_filesystem_grant()); + let unrelated = wallet_parent(4, &valid_filesystem_grant()); + let target_and_ancestors = [ + CardId(Uuid::from_u128(1)), + ancestor.card_id(), + target.card_id(), + ]; + + assert!( + ensure_revoke_authority(&target_and_ancestors, std::slice::from_ref(&target)).is_ok() + ); + assert!( + ensure_revoke_authority(&target_and_ancestors, std::slice::from_ref(&ancestor)).is_ok() + ); + assert!(matches!( + ensure_revoke_authority(&target_and_ancestors, std::slice::from_ref(&unrelated)), + Err(permissions_types::PermissionError::NotPermitted(_)) + )); + assert!(matches!( + ensure_revoke_authority(&target_and_ancestors, &[]), + Err(permissions_types::PermissionError::NotPermitted(_)) + )); + } + + #[test] + fn attenuation_errors_preserve_the_failed_bound() { + let grant = parse_pattern_grant(&valid_filesystem_grant()).unwrap(); + let rendered = grant.render().unwrap(); + + assert!(matches!( + permission_error_from_algebra(CardAlgebraError::LowerBoundTooBroad { + grant: Box::new(grant.clone()), + }), + permissions_types::PermissionError::LowerBoundTooBroad(message) + if message == rendered + )); + assert!(matches!( + permission_error_from_algebra(CardAlgebraError::UpperBoundTooBroad { + grant: Some(Box::new(grant)), + }), + permissions_types::PermissionError::UpperBoundTooBroad(message) + if message == rendered + )); + assert!(matches!( + permission_error_from_algebra(CardAlgebraError::UpperBoundTooBroad { grant: None }), + permissions_types::PermissionError::UpperBoundTooBroad(message) + if message == "upper-bound grant is too broad" + )); + } + + fn concrete_parent(grant: &permissions_types::PatternGrant) -> Card { + let positive = parse_pattern_grant(grant).unwrap(); + let mut lower_negative = grant.clone(); + lower_negative.resource_id = "/data/private/**".to_string(); + let mut upper_negative = grant.clone(); + upper_negative.resource_id = "/data/secret/**".to_string(); + + Card { + card_id: CardId::new(), + parent_ids: Vec::new(), + lower_positive: vec![positive.clone()], + lower_negative: vec![parse_pattern_grant(&lower_negative).unwrap()], + upper_positive: vec![positive], + upper_negative: vec![parse_pattern_grant(&upper_negative).unwrap()], + created_at: DateTime::from_timestamp(1_700_000_000, 0).unwrap(), + expires_at: None, + system_card: false, + managed_by: None, + } + } + + fn wallet_derivation_context() -> AgentPermissionMonomorphizationContext { + AgentPermissionMonomorphizationContext { + account: AccountEmail::from("alice@example.com"), + application: ApplicationName::try_from("shop").unwrap(), + environment: EnvironmentName::try_from("prod").unwrap(), + component: ComponentName("cart-svc".to_string()), + agent_name: "cart-1".to_string(), + agent_type: AgentTypeName("CartAgent".to_string()), + } + } + + fn wallet_parent(card_id: u128, grant: &permissions_types::PatternGrant) -> StoredCard { + StoredCard::Concrete(Card { + card_id: CardId(Uuid::from_u128(card_id)), + parent_ids: Vec::new(), + lower_positive: vec![parse_pattern_grant(grant).unwrap()], + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: DateTime::from_timestamp(1_700_000_000, 0).unwrap(), + expires_at: None, + system_card: false, + managed_by: None, + }) + } + + fn scope_derivation_parent( + card_id: u128, + lower_positive: &[permissions_types::PatternGrant], + upper_positive: &[permissions_types::PatternGrant], + ) -> ScopeDerivationParent { + ScopeDerivationParent::persistent(&Card { + card_id: CardId(Uuid::from_u128(card_id)), + parent_ids: Vec::new(), + lower_positive: parse_grants(lower_positive).unwrap(), + lower_negative: Vec::new(), + upper_positive: parse_grants(upper_positive).unwrap(), + upper_negative: Vec::new(), + created_at: DateTime::from_timestamp(1_700_000_000, 0).unwrap(), + expires_at: None, + system_card: false, + managed_by: None, + }) + } + + fn grant_for_resource(resource_id: &str) -> permissions_types::PatternGrant { + permissions_types::PatternGrant { + resource_id: resource_id.to_string(), + ..valid_filesystem_grant() + } + } + + #[test] + fn scope_derivation_validates_both_attenuation_bounds() { + let parent_grant = valid_filesystem_grant(); + let child_grant = grant_for_resource("/data/public/**"); + let broader_grant = grant_for_resource("/**"); + let parent = scope_derivation_parent( + 1, + std::slice::from_ref(&parent_grant), + std::slice::from_ref(&parent_grant), + ); + + let accepted = parse_derived_grant_sets( + std::slice::from_ref(&child_grant), + &[], + std::slice::from_ref(&child_grant), + &[], + ) + .unwrap(); + assert!(build_scope_card(CardId::new(), std::slice::from_ref(&parent), accepted).is_ok()); + + let broad_lower = parse_derived_grant_sets( + std::slice::from_ref(&broader_grant), + &[], + std::slice::from_ref(&child_grant), + &[], + ) + .unwrap(); + assert!(matches!( + build_scope_card(CardId::new(), std::slice::from_ref(&parent), broad_lower,), + Err(permissions_types::PermissionError::LowerBoundTooBroad(_)) + )); + + let broad_upper = parse_derived_grant_sets( + std::slice::from_ref(&child_grant), + &[], + std::slice::from_ref(&broader_grant), + &[], + ) + .unwrap(); + assert!(matches!( + build_scope_card(CardId::new(), &[parent], broad_upper), + Err(permissions_types::PermissionError::UpperBoundTooBroad(_)) + )); + } + + #[test] + fn scope_derivation_preserves_inherited_negatives_on_both_bounds() { + let parent_positive = valid_filesystem_grant(); + let child_positive = grant_for_resource("/data/public/**"); + let inherited_negative = grant_for_resource("/data/private/**"); + let additional_negative = grant_for_resource("/data/public/restricted/**"); + let mut parent = scope_derivation_parent( + 1, + std::slice::from_ref(&parent_positive), + std::slice::from_ref(&parent_positive), + ); + parent.delegation.lower_negative = + parse_grants(std::slice::from_ref(&inherited_negative)).unwrap(); + parent.delegation.upper_negative = + parse_grants(std::slice::from_ref(&inherited_negative)).unwrap(); + + let missing_lower_negative = parse_derived_grant_sets( + std::slice::from_ref(&child_positive), + &[], + std::slice::from_ref(&child_positive), + std::slice::from_ref(&inherited_negative), + ) + .unwrap(); + assert!(matches!( + build_scope_card( + CardId::new(), + std::slice::from_ref(&parent), + missing_lower_negative, + ), + Err(permissions_types::PermissionError::LowerBoundTooBroad(_)) + )); + + let missing_upper_negative = parse_derived_grant_sets( + std::slice::from_ref(&child_positive), + std::slice::from_ref(&inherited_negative), + std::slice::from_ref(&child_positive), + &[], + ) + .unwrap(); + assert!(matches!( + build_scope_card( + CardId::new(), + std::slice::from_ref(&parent), + missing_upper_negative, + ), + Err(permissions_types::PermissionError::UpperBoundTooBroad(_)) + )); + + let retained_and_added = [inherited_negative, additional_negative]; + let attenuated = parse_derived_grant_sets( + std::slice::from_ref(&child_positive), + &retained_and_added, + std::slice::from_ref(&child_positive), + &retained_and_added, + ) + .unwrap(); + assert!(build_scope_card(CardId::new(), std::slice::from_ref(&parent), attenuated).is_ok()); + } + + #[test] + fn scope_derivation_combines_positive_authority_from_multiple_parents() { + let first_grant = grant_for_resource("/data/first/**"); + let second_grant = grant_for_resource("/data/second/**"); + let first = scope_derivation_parent(1, std::slice::from_ref(&first_grant), &[]); + let second = scope_derivation_parent(2, std::slice::from_ref(&second_grant), &[]); + let grants = parse_derived_grant_sets(&[first_grant, second_grant], &[], &[], &[]).unwrap(); + + let card = build_scope_card(CardId::new(), &[first, second], grants).unwrap(); + + assert_eq!( + card.root_card_ids, + vec![CardId(Uuid::from_u128(1)), CardId(Uuid::from_u128(2))] + ); + assert_eq!(card.lower_positive.len(), 2); + } + + #[test] + fn scope_derivation_unions_and_deduplicates_roots_across_diamond_parents() { + let grant = valid_filesystem_grant(); + let first = ScopeCard { + scope_card_id: CardId(Uuid::from_u128(10)), + root_card_ids: vec![CardId(Uuid::from_u128(1)), CardId(Uuid::from_u128(2))], + lower_positive: parse_grants(std::slice::from_ref(&grant)).unwrap(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + }; + let second = ScopeCard { + scope_card_id: CardId(Uuid::from_u128(11)), + root_card_ids: vec![CardId(Uuid::from_u128(2)), CardId(Uuid::from_u128(3))], + ..first.clone() + }; + let grants = parse_derived_grant_sets(&[grant], &[], &[], &[]).unwrap(); + + let card = build_scope_card( + CardId(Uuid::from_u128(12)), + &[ + ScopeDerivationParent::scope(&first), + ScopeDerivationParent::scope(&second), + ], + grants, + ) + .unwrap(); + + assert_eq!( + card.root_card_ids, + vec![ + CardId(Uuid::from_u128(1)), + CardId(Uuid::from_u128(2)), + CardId(Uuid::from_u128(3)), + ] + ); + } + + #[test] + fn scope_card_parent_propagates_roots_and_allows_a_pure_ceiling() { + let grant = valid_filesystem_grant(); + let parent = scope_derivation_parent(1, std::slice::from_ref(&grant), &[]); + let first = build_scope_card( + CardId(Uuid::from_u128(10)), + &[parent], + parse_derived_grant_sets(std::slice::from_ref(&grant), &[], &[], &[]).unwrap(), + ) + .unwrap(); + let ceiling = grant_for_resource("/data/public/**"); + + let second = build_scope_card( + CardId(Uuid::from_u128(11)), + &[ScopeDerivationParent::scope(&first)], + parse_derived_grant_sets(&[], &[], &[ceiling], &[]).unwrap(), + ) + .unwrap(); + + assert!(second.lower_positive.is_empty()); + assert_eq!(second.root_card_ids, first.root_card_ids); + } + + #[test] + fn scope_derivation_rejects_a_persistent_parent_outside_the_wallet() { + let grant = valid_filesystem_grant(); + let wallet = [wallet_parent(1, &grant)]; + let resolved = wallet_parent(2, &grant); + + assert!(matches!( + persistent_scope_parent_from_wallet(&wallet, &resolved, &wallet_derivation_context(),), + Err(permissions_types::PermissionError::NotPermitted(_)) + )); + } + + #[test] + fn scope_derivation_requires_the_exact_pinned_parent_snapshot() { + let grant = valid_filesystem_grant(); + let wallet = [wallet_parent(1, &grant)]; + let mut changed_grant = grant; + changed_grant.resource_id = "/data/changed/**".to_string(); + let changed_snapshot = wallet_parent(1, &changed_grant); + + assert!(matches!( + persistent_scope_parent_from_wallet( + &wallet, + &changed_snapshot, + &wallet_derivation_context(), + ), + Err(permissions_types::PermissionError::NotPermitted(_)) + )); + assert!( + persistent_scope_parent_from_wallet(&wallet, &wallet[0], &wallet_derivation_context(),) + .is_ok() + ); + } + + #[test] + fn wallet_derivation_returns_the_deterministically_selected_parent() { + let parent_grant = valid_filesystem_grant(); + let mut child_grant = parent_grant.clone(); + child_grant.resource_id = "/data/public.txt".to_string(); + let wallet = [ + wallet_parent(1, &parent_grant), + wallet_parent(2, &parent_grant), + ]; + let grants = parse_derived_grant_sets(&[child_grant], &[], &[], &[]).unwrap(); + + let parent = + select_wallet_derivation_parent(&wallet, &wallet_derivation_context(), &grants) + .unwrap(); + + assert_eq!(parent.card_id, CardId(Uuid::from_u128(2))); + } + + #[test] + fn wallet_derivation_maps_multi_source_selection_to_typed_error() { + let mut first = valid_filesystem_grant(); + first.resource_id = "/data/first.txt".to_string(); + let mut second = valid_filesystem_grant(); + second.resource_id = "/data/second.txt".to_string(); + let wallet = [wallet_parent(1, &first), wallet_parent(2, &second)]; + let grants = parse_derived_grant_sets(&[first, second], &[], &[], &[]).unwrap(); + + assert!(matches!( + select_wallet_derivation_parent(&wallet, &wallet_derivation_context(), &grants,), + Err(permissions_types::PermissionError::WalletMultiSourceRequired(_)) + )); + } + + #[test] + fn wallet_derivation_rejects_an_empty_active_wallet() { + let grants = parse_derived_grant_sets(&[], &[], &[], &[]).unwrap(); + + assert!(matches!( + select_wallet_derivation_parent(&[], &wallet_derivation_context(), &grants,), + Err(permissions_types::PermissionError::NotPermitted(_)) + )); + } + + #[test] + fn wallet_derivation_selects_parents_by_raw_recipient_not_holder_projection() { + let mut grant_for_another_holder = valid_filesystem_grant(); + grant_for_another_holder.recipient = + "alice@example.com/shop/prod/cart-svc/OtherAgent".to_string(); + let wallet = [wallet_parent(1, &grant_for_another_holder)]; + let grants = parse_derived_grant_sets( + std::slice::from_ref(&grant_for_another_holder), + &[], + &[], + &[], + ) + .unwrap(); + + let parent = + select_wallet_derivation_parent(&wallet, &wallet_derivation_context(), &grants) + .expect("raw recipient delegation must be permitted"); + + assert_eq!(parent.card_id, CardId(Uuid::from_u128(1))); + } + + #[test] + fn wallet_derivation_treats_negative_lists_as_complete_child_bounds() { + let positive = valid_filesystem_grant(); + let parent = concrete_parent(&positive); + let lower_negative = concrete_pattern_grant(&parent.lower_negative[0]).unwrap(); + let upper_negative = concrete_pattern_grant(&parent.upper_negative[0]).unwrap(); + let wallet = [StoredCard::Concrete(parent.clone())]; + let incomplete = parse_derived_grant_sets( + std::slice::from_ref(&positive), + &[], + std::slice::from_ref(&positive), + std::slice::from_ref(&upper_negative), + ) + .unwrap(); + + assert!(matches!( + select_wallet_derivation_parent(&wallet, &wallet_derivation_context(), &incomplete,), + Err(permissions_types::PermissionError::LowerBoundTooBroad(_)) + )); + + let complete = parse_derived_grant_sets( + std::slice::from_ref(&positive), + std::slice::from_ref(&lower_negative), + std::slice::from_ref(&positive), + std::slice::from_ref(&upper_negative), + ) + .unwrap(); + assert_eq!( + select_wallet_derivation_parent(&wallet, &wallet_derivation_context(), &complete,) + .unwrap() + .card_id, + parent.card_id + ); + } + + #[test] + fn derive_grants_retain_positives_and_append_negatives() { + let retained = valid_filesystem_grant(); + let parent = concrete_parent(&retained); + let mut lower_negative_to_add = retained.clone(); + lower_negative_to_add.resource_id = "/data/tmp/**".to_string(); + let mut upper_negative_to_add = retained.clone(); + upper_negative_to_add.resource_id = "/data/admin/**".to_string(); + + let grants = derive_grant_sets( + &parent, + std::slice::from_ref(&retained), + std::slice::from_ref(&lower_negative_to_add), + std::slice::from_ref(&retained), + std::slice::from_ref(&upper_negative_to_add), + ) + .unwrap(); + + assert_eq!(grants.lower_positive, parent.lower_positive); + assert_eq!(grants.upper_positive, parent.upper_positive); + assert_eq!( + grants.lower_negative, + [ + parent.lower_negative.clone(), + vec![parse_pattern_grant(&lower_negative_to_add).unwrap()] + ] + .concat() + ); + assert_eq!( + grants.upper_negative, + [ + parent.upper_negative.clone(), + vec![parse_pattern_grant(&upper_negative_to_add).unwrap()] + ] + .concat() + ); + } + + #[test] + fn derive_grants_reject_a_positive_broader_than_the_parent() { + let parent_grant = valid_filesystem_grant(); + let parent = concrete_parent(&parent_grant); + let mut broader = parent_grant.clone(); + broader.resource_id = "/**".to_string(); + + assert!(matches!( + derive_grant_sets( + &parent, + &[broader], + &[], + std::slice::from_ref(&parent_grant), + &[], + ), + Err(permissions_types::PermissionError::LowerBoundTooBroad(_)) + )); + } + + #[test] + fn derive_grants_reject_an_upper_positive_broader_than_the_parent() { + let parent_grant = valid_filesystem_grant(); + let parent = concrete_parent(&parent_grant); + let mut broader = parent_grant.clone(); + broader.resource_id = "/**".to_string(); + + assert!(matches!( + derive_grant_sets( + &parent, + std::slice::from_ref(&parent_grant), + &[], + &[broader], + &[], + ), + Err(permissions_types::PermissionError::UpperBoundTooBroad(_)) + )); + } + + #[test] + fn parse_pattern_grant_rejects_invalid_structured_fields_after_separator_injection() { + let grant = permissions_types::PatternGrant { + class: "filesystem".to_string(), + owner: "acme/shop/prod/cart/agent) @ acme/shop/prod/cart/agent : read : /tmp" + .to_string(), + recipient: "not a valid recipient".to_string(), + verb: "not-a-real-verb".to_string(), + resource_id: "not a valid resource".to_string(), + }; + + assert!(parse_pattern_grant(&grant).is_err()); + } + + #[test] + fn parse_pattern_grant_accepts_valid_account_emails_in_paths() { + let grant = permissions_types::PatternGrant { + class: "filesystem".to_string(), + owner: "alice@example.com/shop/prod/cart-svc/CartAgent".to_string(), + recipient: "alice@example.com/shop/prod/cart-svc/CartAgent".to_string(), + verb: "read".to_string(), + resource_id: "/data/**".to_string(), + }; + + assert!(parse_pattern_grant(&grant).is_ok()); + } + + #[test] + fn parse_pattern_grant_accepts_valid_agent_owner_type_wildcard() { + let grant = permissions_types::PatternGrant { + class: "filesystem".to_string(), + owner: "alice@example.com/shop/prod/cart-svc/CartAgent(*)".to_string(), + recipient: "alice@example.com/shop/prod/cart-svc/CartAgent".to_string(), + verb: "read".to_string(), + resource_id: "/data/**".to_string(), + }; + + assert!(parse_pattern_grant(&grant).is_ok()); + } + + #[test] + fn concrete_pattern_grant_preserves_valid_structured_fields_with_delimiters() { + let grant = permissions_types::PatternGrant { + class: "filesystem".to_string(), + owner: "alice@example.com/shop/prod/cart-svc/CartAgent(\"id) @ spoof : read : tmp\")" + .to_string(), + recipient: "alice@example.com/shop/prod/cart-svc/CartAgent".to_string(), + verb: "read".to_string(), + resource_id: "/data/**".to_string(), + }; + + let pattern = parse_pattern_grant(&grant).expect("structured grant should be valid"); + let rendered = concrete_pattern_grant(&pattern).expect("valid pattern should inspect"); + + assert_eq!(rendered.class, grant.class); + assert_eq!(rendered.owner, grant.owner); + assert_eq!(rendered.recipient, grant.recipient); + assert_eq!(rendered.verb, grant.verb); + assert_eq!(rendered.resource_id, grant.resource_id); + } + + #[test] + fn concrete_pattern_grant_preserves_multi_segment_tool_command() { + let grant = permissions_types::PatternGrant { + class: "tool".to_string(), + owner: "alice@example.com/shop/prod/cli-tools/grep".to_string(), + recipient: "alice@example.com/shop/prod/cart-svc/CartAgent".to_string(), + verb: "invoke".to_string(), + resource_id: "search.files --pattern=* --path=src/** -in README.md".to_string(), + }; + + let pattern = parse_pattern_grant(&grant).expect("structured grant should be valid"); + let inspected = concrete_pattern_grant(&pattern).expect("valid pattern should inspect"); + let reparsed = + parse_pattern_grant(&inspected).expect("an inspected grant should remain valid"); + + assert_eq!(reparsed, pattern); + } + + #[test] + fn parse_pattern_grant_rejects_verb_suffix_that_completes_resource_separator() { + let grant = permissions_types::PatternGrant { + class: "config".to_string(), + owner: "alice@example.com/shop/prod/cart-svc/CartAgent".to_string(), + recipient: "alice@example.com/shop/prod/cart-svc/CartAgent".to_string(), + verb: "read :".to_string(), + resource_id: "ignored".to_string(), + }; + + assert!(matches!( + parse_pattern_grant(&grant), + Err(permissions_types::PermissionError::InvalidVerb(verb)) if verb == "read :" + )); + } + + fn lifespan(value: &str) -> permissions_types::Duration { + permissions_types::Duration { + iso_8601: value.to_string(), + } + } + + #[test] + fn derive_expiry_parses_fixed_iso_8601_duration() { + let now = DateTime::from_timestamp(1_700_000_000, 0).unwrap(); + + assert_eq!( + derive_expires_at(now, Some(&lifespan("P1DT2H3M4.5S")), None).unwrap(), + Some( + now + TimeDelta::days(1) + + TimeDelta::hours(2) + + TimeDelta::minutes(3) + + TimeDelta::seconds(4) + + TimeDelta::milliseconds(500) + ) + ); + assert_eq!( + derive_expires_at(now, Some(&lifespan("PT0S")), None).unwrap(), + Some(now) + ); + } + + #[test] + fn derive_expiry_rejects_non_fixed_or_malformed_duration() { + for value in ["1s", "-PT1S", "P1Y", "P1M", "P1W", "PT", ""] { + assert!( + matches!( + derive_expires_at( + DateTime::from_timestamp(1_700_000_000, 0).unwrap(), + Some(&lifespan(value)), + None, + ), + Err(permissions_types::PermissionError::InvalidPattern(_)) + ), + "{value} must be rejected" + ); + } + } + + #[test] + fn derive_expiry_enforces_parent_expiry() { + let now = DateTime::from_timestamp(1_700_000_000, 0).unwrap(); + let parent_expires_at = now + TimeDelta::hours(1); + + assert_eq!( + derive_expires_at(now, Some(&lifespan("PT1H")), Some(parent_expires_at),).unwrap(), + Some(parent_expires_at) + ); + assert!(matches!( + derive_expires_at( + now, + Some(&lifespan("PT1H0.000000001S")), + Some(parent_expires_at), + ), + Err(permissions_types::PermissionError::CardExpired(_)) + )); + assert!(matches!( + derive_expires_at(now, None, Some(parent_expires_at)), + Err(permissions_types::PermissionError::CardExpired(_)) + )); + assert!(matches!( + derive_expires_at(now, Some(&lifespan("PT0S")), Some(now)), + Err(permissions_types::PermissionError::CardExpired(_)) + )); + } + + #[test] + fn derive_expiry_handles_indefinite_parent_and_timestamp_overflow() { + let now = DateTime::from_timestamp(1_700_000_000, 0).unwrap(); + + assert_eq!(derive_expires_at(now, None, None).unwrap(), None); + assert!(matches!( + derive_expires_at( + DateTime::::MAX_UTC, + Some(&lifespan("PT0.000000001S")), + None, + ), + Err(permissions_types::PermissionError::InvalidPattern(_)) + )); + } +} diff --git a/golem-worker-executor/src/durable_host/replay_state/cursor.rs b/golem-worker-executor/src/durable_host/replay_state/cursor.rs index 85f116549a..36c0444621 100644 --- a/golem-worker-executor/src/durable_host/replay_state/cursor.rs +++ b/golem-worker-executor/src/durable_host/replay_state/cursor.rs @@ -568,14 +568,111 @@ impl CursorTx<'_> { // End (via `start_index`) we decode the response and emit `ForkReplayed` // if necessary. match oplog_entry { - OplogEntry::CardInstalled { card, .. } => { - self.record_replay_event(ReplayEvent::CardInstalled { card: card.clone() }); + OplogEntry::AgentInvocationStarted { + wallet_pin: Some(wallet_pin), + .. + } => { + self.record_replay_event(ReplayEvent::InvocationWalletPinned { + wallet_pin: wallet_pin.clone(), + }); + } + OplogEntry::CardInstalled { + card, + wallet_generation, + .. + } => { + self.record_replay_event(ReplayEvent::CardInstalled { + card: card.clone(), + wallet_generation: *wallet_generation, + }); + } + OplogEntry::CardDerived { + card, + wallet_generation, + .. + } => { + self.record_replay_event(ReplayEvent::CardDerived { + card: card.clone(), + wallet_generation: *wallet_generation, + }); + } + OplogEntry::CardTransferStarted { + transfer_id, + card_id, + source_holder, + target_holder, + source_wallet_generation, + .. + } => { + self.record_replay_event(ReplayEvent::CardTransferStarted { + transfer_id: *transfer_id, + card_id: *card_id, + source_holder: source_holder.clone(), + target_holder: target_holder.clone(), + source_wallet_generation: *source_wallet_generation, + }); + } + OplogEntry::CardTransferred { + transfer_id, + source_card_id, + installed_card_id, + target_holder, + card, + target_wallet_generation, + .. + } => { + self.record_replay_event(ReplayEvent::CardTransferred { + transfer_id: *transfer_id, + source_card_id: *source_card_id, + installed_card_id: *installed_card_id, + target_holder: target_holder.clone(), + card: card.clone(), + target_wallet_generation: *target_wallet_generation, + }); } - OplogEntry::CardRevoked { card_id, .. } => { - self.record_replay_event(ReplayEvent::CardRevoked { card_id: *card_id }); + OplogEntry::CardTransferConfirmed { + transfer_id, + source_card_id, + installed_card_id, + target_holder, + .. + } => { + self.record_replay_event(ReplayEvent::CardTransferConfirmed { + transfer_id: *transfer_id, + source_card_id: *source_card_id, + installed_card_id: *installed_card_id, + target_holder: target_holder.clone(), + }); + } + OplogEntry::CardRevokedCascade { + revoked_card_ids, + local_wallet_generation, + .. + } => { + self.record_replay_event(ReplayEvent::CardRevokedCascade { + card_ids: revoked_card_ids.clone(), + local_wallet_generation: *local_wallet_generation, + }); + } + OplogEntry::CardRevoked { + card_id, + wallet_generation, + .. + } => { + self.record_replay_event(ReplayEvent::CardRevoked { + card_id: *card_id, + wallet_generation: *wallet_generation, + }); } - OplogEntry::CardExpired { card_id, .. } => { - self.record_replay_event(ReplayEvent::CardExpired { card_id: *card_id }); + OplogEntry::CardExpired { + card_id, + wallet_generation, + .. + } => { + self.record_replay_event(ReplayEvent::CardExpired { + card_id: *card_id, + wallet_generation: *wallet_generation, + }); } OplogEntry::Start { function_name, .. } if function_name == &HostFunctionName::GolemApiFork => @@ -657,10 +754,11 @@ impl CursorTx<'_> { } pub(super) async fn get_out_of_skipped_region(&mut self) { + let initial_snapshot_skip_end = self.st.initial_snapshot_skip_end.take(); // Loop: after jumping a region, the freshly looked-up next region may start immediately // after the jump target (adjacent regions recorded separately), requiring another jump. while self.cursor.is_replay() { - match &self.st.next_skipped_region { + match self.st.next_skipped_region.clone() { Some(region) if region.start == (self.cursor.last_replayed_index().next()) => { let target = region.end.next(); // we want to continue reading _after_ the region debug!( @@ -674,6 +772,18 @@ impl CursorTx<'_> { .last_replayed_index .set(target.previous()); // so we set the last replayed index to the end of the region + let events_region = match initial_snapshot_skip_end { + Some(snapshot_end) if region.end <= snapshot_end => None, + Some(snapshot_end) => Some(OplogRegion { + start: region.start.max(snapshot_end.next()), + end: region.end, + }), + None => Some(region), + }; + if let Some(events_region) = events_region { + self.record_card_events_in_region(&events_region).await; + } + // The lookup must start *after* the just-jumped region: `find_next_deleted_region` // matches regions starting at-or-after the given index, so looking up from the // region's own end would re-find a single-entry region (start == end) and leave @@ -689,6 +799,109 @@ impl CursorTx<'_> { } } + async fn record_card_events_in_region(&mut self, region: &OplogRegion) { + let mut next = region.start; + while next <= region.end { + let remaining = region.end.as_u64() - next.as_u64() + 1; + let entries = self + .cursor + .oplog + .read_many(next, CHUNK_SIZE.min(remaining)) + .await; + let Some(last_read) = entries.keys().next_back().copied() else { + break; + }; + for entry in entries.into_values() { + match entry { + OplogEntry::CardInstalled { + card, + wallet_generation, + .. + } => self.record_replay_event(ReplayEvent::CardInstalled { + card, + wallet_generation, + }), + OplogEntry::CardDerived { + card, + wallet_generation, + .. + } => self.record_replay_event(ReplayEvent::CardDerived { + card, + wallet_generation, + }), + OplogEntry::CardTransferStarted { + transfer_id, + card_id, + source_holder, + target_holder, + source_wallet_generation, + .. + } => self.record_replay_event(ReplayEvent::CardTransferStarted { + transfer_id, + card_id, + source_holder, + target_holder, + source_wallet_generation, + }), + OplogEntry::CardTransferred { + transfer_id, + source_card_id, + installed_card_id, + target_holder, + card, + target_wallet_generation, + .. + } => self.record_replay_event(ReplayEvent::CardTransferred { + transfer_id, + source_card_id, + installed_card_id, + target_holder, + card, + target_wallet_generation, + }), + OplogEntry::CardTransferConfirmed { + transfer_id, + source_card_id, + installed_card_id, + target_holder, + .. + } => self.record_replay_event(ReplayEvent::CardTransferConfirmed { + transfer_id, + source_card_id, + installed_card_id, + target_holder, + }), + OplogEntry::CardRevokedCascade { + revoked_card_ids, + local_wallet_generation, + .. + } => self.record_replay_event(ReplayEvent::CardRevokedCascade { + card_ids: revoked_card_ids, + local_wallet_generation, + }), + OplogEntry::CardRevoked { + card_id, + wallet_generation, + .. + } => self.record_replay_event(ReplayEvent::CardRevoked { + card_id, + wallet_generation, + }), + OplogEntry::CardExpired { + card_id, + wallet_generation, + .. + } => self.record_replay_event(ReplayEvent::CardExpired { + card_id, + wallet_generation, + }), + _ => {} + } + } + next = last_read.next(); + } + } + /// Feeds the concurrent replay resolver when an `End`/`Cancelled` entry is *committed* /// (permanently consumed). Resolves only calls that are actually being awaited /// (`resolve_if_pending`), so the `End`/`Cancelled` of any call not tracked by the resolver — @@ -1007,6 +1220,7 @@ impl CursorTx<'_> { /// Resets the cursor to the start of replay after dropping a manual-update override. pub(super) async fn drop_override_and_restart(&mut self) -> Result<(), WorkerExecutorError> { self.st.skipped_regions.drop_override(); + self.st.initial_snapshot_skip_end = None; let next = self .st .skipped_regions @@ -1034,6 +1248,7 @@ impl ReplayState { owned_agent_id: OwnedAgentId, oplog: Arc, skipped_regions: DeletedRegions, + initial_snapshot_skip_end: Option, ) -> Result { let next_skipped_region = skipped_regions.find_next_deleted_region(OplogIndex::NONE); let last_oplog_index = oplog.current_oplog_index().await; @@ -1051,6 +1266,7 @@ impl ReplayState { state: Mutex::new(CursorState { skipped_regions, next_skipped_region, + initial_snapshot_skip_end, replay_buffer: VecDeque::new(), pending_fork_starts: HashSet::new(), concurrent_resolver: ConcurrentReplayResolver::default(), @@ -1331,6 +1547,25 @@ impl ReplayState { std::mem::take(&mut *self.cursor.pending_replay_events.lock().unwrap()) } + pub async fn pending_card_derivation( + &self, + card_id: CardId, + ) -> Option<(StoredCard, Option)> { + self.cursor + .pending_replay_events + .lock() + .unwrap() + .iter() + .rev() + .find_map(|event| match event { + ReplayEvent::CardDerived { + card, + wallet_generation, + } if card.card_id() == card_id => Some((card.clone(), *wallet_generation)), + _ => None, + }) + } + /// Whether some task currently holds an open cursor transaction ([`ReplayCursor::tx`]). /// /// The invocation event loop can exit while a store-spawned durable task is suspended @@ -1522,6 +1757,7 @@ impl ReplayState { trace_id, trace_states, invocation_context: spans, + wallet_pin, .. } => { let invocation_payload = self @@ -1542,6 +1778,7 @@ impl ReplayState { idempotency_key, invocation_payload, invocation_context, + wallet_pin, })); } entry if entry.is_hint() => {} diff --git a/golem-worker-executor/src/durable_host/replay_state/mod.rs b/golem-worker-executor/src/durable_host/replay_state/mod.rs index 76523b15db..318bf99929 100644 --- a/golem-worker-executor/src/durable_host/replay_state/mod.rs +++ b/golem-worker-executor/src/durable_host/replay_state/mod.rs @@ -16,7 +16,7 @@ use crate::durable_host::concurrent::{ ConcurrentReplayResolver, ReplayCallHandle, Resolution, ResolutionOutcome, }; use crate::services::oplog::{Oplog, OplogOps}; -use golem_common::model::card::{CardId, StoredCard}; +use golem_common::model::card::{CardHolder, CardId, InvocationWalletPin, StoredCard}; use golem_common::model::component::ComponentRevision; use golem_common::model::invocation_context::InvocationContextStack; use golem_common::model::oplog::host_functions::HostFunctionName; @@ -43,14 +43,59 @@ use uuid::Uuid; const CHUNK_SIZE: u64 = 1024; -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub enum ReplayEvent { ReplayFinished, - UpdateReplayed { new_revision: ComponentRevision }, - ForkReplayed { new_phantom_id: Uuid }, - CardInstalled { card: StoredCard }, - CardRevoked { card_id: CardId }, - CardExpired { card_id: CardId }, + UpdateReplayed { + new_revision: ComponentRevision, + }, + ForkReplayed { + new_phantom_id: Uuid, + }, + InvocationWalletPinned { + wallet_pin: InvocationWalletPin, + }, + CardInstalled { + card: StoredCard, + wallet_generation: Option, + }, + CardDerived { + card: StoredCard, + wallet_generation: Option, + }, + CardTransferStarted { + transfer_id: Uuid, + card_id: CardId, + source_holder: Option, + target_holder: CardHolder, + source_wallet_generation: Option, + }, + CardTransferred { + transfer_id: Uuid, + source_card_id: Option, + installed_card_id: CardId, + target_holder: CardHolder, + card: StoredCard, + target_wallet_generation: Option, + }, + CardTransferConfirmed { + transfer_id: Uuid, + source_card_id: CardId, + installed_card_id: CardId, + target_holder: CardHolder, + }, + CardRevokedCascade { + card_ids: Vec, + local_wallet_generation: Option, + }, + CardRevoked { + card_id: CardId, + wallet_generation: Option, + }, + CardExpired { + card_id: CardId, + wallet_generation: Option, + }, } #[derive(Debug, Clone)] @@ -58,6 +103,7 @@ pub struct AgentInvocationStartedEntry { pub idempotency_key: IdempotencyKey, pub invocation_payload: AgentInvocationPayload, pub invocation_context: InvocationContextStack, + pub wallet_pin: Option, } /// The outcome of [`ReplayState::claim_any_concurrent_start`]: the replay handle for the claimed @@ -180,6 +226,7 @@ struct PublishedPosition { struct CursorState { skipped_regions: DeletedRegions, next_skipped_region: Option, + initial_snapshot_skip_end: Option, /// Entries prefetched from the oplog, beginning at the next speculative cursor position. replay_buffer: VecDeque<(OplogIndex, OplogEntry)>, /// `Start` entries for `GolemApiFork` whose matching `End` has not yet been replayed. When the diff --git a/golem-worker-executor/src/durable_host/replay_state/tests.rs b/golem-worker-executor/src/durable_host/replay_state/tests.rs index 8aab031da7..f322951580 100644 --- a/golem-worker-executor/src/durable_host/replay_state/tests.rs +++ b/golem-worker-executor/src/durable_host/replay_state/tests.rs @@ -1,8 +1,12 @@ use super::*; use crate::services::oplog::{CommitLevel, OrderedOplogStart, PendingUpload}; use async_trait::async_trait; +use golem_common::model::card::{ + AgentCardHolder, Card, CardHolder, CardId, InvocationWalletPin, StoredCard, WalletVersionToken, +}; use golem_common::model::component::ComponentId; use golem_common::model::environment::EnvironmentId; +use golem_common::model::invocation_context::TraceId; use golem_common::model::oplog::payload::types::{ SerializableP3HttpBodyChunk, SerializableP3HttpConsumeBodyResult, }; @@ -11,7 +15,8 @@ use golem_common::model::oplog::{ HostResponseMonotonicClockTimestamp, HostResponseP3HttpClientConsumeBodyChunk, HostResponseP3HttpClientConsumeBodyResult, OplogPayload, PayloadId, RawOplogPayload, }; -use golem_common::model::{AgentId, Timestamp}; +use golem_common::model::regions::OplogRegion; +use golem_common::model::{AgentId, AgentInvocationPayload, IdempotencyKey, Timestamp}; use std::collections::BTreeMap; use std::time::Duration; use test_r::test; @@ -163,6 +168,33 @@ fn noop() -> OplogEntry { } } +fn stored_test_card(card_id: CardId) -> StoredCard { + StoredCard::Concrete(Card { + card_id, + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: chrono::Utc::now(), + expires_at: None, + system_card: false, + managed_by: None, + }) +} + +fn invocation_started(wallet_pin: InvocationWalletPin) -> OplogEntry { + OplogEntry::AgentInvocationStarted { + timestamp: Timestamp::now_utc(), + idempotency_key: IdempotencyKey::new("wallet-pin-replay".to_string()), + payload: OplogPayload::Inline(Box::new(AgentInvocationPayload::SaveSnapshot)), + trace_id: TraceId::generate(), + trace_states: Vec::new(), + invocation_context: Vec::new(), + wallet_pin: Some(wallet_pin), + } +} + fn start_now() -> OplogEntry { OplogEntry::Start { timestamp: Timestamp::now_utc(), @@ -213,11 +245,141 @@ async fn replay_state_over(entries: Vec) -> ReplayState { oplog.add(entry).await; } let oplog: Arc = oplog; - ReplayState::new(test_agent_id(), oplog, DeletedRegions::default()) + ReplayState::new(test_agent_id(), oplog, DeletedRegions::default(), None) .await .expect("failed to build replay state") } +#[test] +async fn permission_events_replay_after_invocation_wallet_pin() { + let owned_agent_id = test_agent_id(); + let derived_card = stored_test_card(CardId::new()); + let wallet_pin = InvocationWalletPin { + wallet_token: WalletVersionToken { + wallet_id_hash: CardHolder::Agent(AgentCardHolder { + agent_id: owned_agent_id.agent_id.clone(), + }) + .wallet_id_hash(), + generation: 0, + }, + pinned_card_ids: Vec::new(), + scope_card_id: Some(CardId::new()), + }; + let oplog = Arc::new(InMemoryOplog::new()); + for entry in [ + noop(), + invocation_started(wallet_pin.clone()), + OplogEntry::CardDerived { + timestamp: Timestamp::now_utc(), + card: derived_card.clone(), + wallet_generation: Some(0), + }, + start_now(), + ] { + oplog.add(entry).await; + } + let oplog: Arc = oplog; + let replay_state = ReplayState::new(owned_agent_id, oplog, DeletedRegions::default(), None) + .await + .expect("failed to build replay state"); + + let invocation = replay_state + .get_oplog_entry_agent_invocation_started() + .await + .expect("failed to replay invocation start") + .expect("expected invocation start"); + assert_eq!(invocation.wallet_pin, Some(wallet_pin.clone())); + assert_eq!( + replay_state + .pending_card_derivation(derived_card.card_id()) + .await, + Some((derived_card.clone(), Some(0))) + ); + assert_eq!( + replay_state.take_new_replay_events(), + vec![ + ReplayEvent::InvocationWalletPinned { wallet_pin }, + ReplayEvent::CardDerived { + card: derived_card, + wallet_generation: Some(0), + }, + ] + ); +} + +#[test] +async fn permission_events_are_recovered_from_skipped_regions() { + let transfer_id = Uuid::new_v4(); + let source_card_id = CardId::new(); + let card = stored_test_card(CardId::new()); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: test_agent_id().agent_id, + }); + let oplog = Arc::new(InMemoryOplog::new()); + for entry in [ + noop(), + OplogEntry::CardTransferred { + timestamp: Timestamp::now_utc(), + transfer_id, + source_card_id: Some(source_card_id), + installed_card_id: card.card_id(), + target_holder: target_holder.clone(), + card: card.clone(), + target_wallet_generation: Some(1), + }, + start_now(), + ] { + oplog.add(entry).await; + } + let oplog: Arc = oplog; + let skipped = DeletedRegions::from_regions([OplogRegion::from_range(2..=2)]); + let replay_state = ReplayState::new(test_agent_id(), oplog, skipped, None) + .await + .expect("failed to build replay state"); + + assert_eq!( + replay_state.take_new_replay_events(), + vec![ReplayEvent::CardTransferred { + transfer_id, + source_card_id: Some(source_card_id), + installed_card_id: card.card_id(), + target_holder, + card, + target_wallet_generation: Some(1), + }] + ); +} + +#[test] +async fn snapshot_prefix_suppresses_replayed_permission_events() { + let card = stored_test_card(CardId::new()); + let oplog = Arc::new(InMemoryOplog::new()); + for entry in [ + noop(), + OplogEntry::CardInstalled { + timestamp: Timestamp::now_utc(), + queued_event_index: None, + card, + wallet_generation: Some(1), + }, + start_now(), + ] { + oplog.add(entry).await; + } + let oplog: Arc = oplog; + let skipped = DeletedRegions::from_regions([OplogRegion::from_range(2..=2)]); + let replay_state = ReplayState::new( + test_agent_id(), + oplog, + skipped, + Some(OplogIndex::from_u64(2)), + ) + .await + .expect("failed to build replay state"); + + assert!(replay_state.take_new_replay_events().is_empty()); +} + fn stdout_log(message: &str) -> OplogEntry { OplogEntry::Log { timestamp: Timestamp::now_utc(), @@ -311,7 +473,7 @@ async fn request_matching_downloads_uncached_external_payloads() { } let oplog: Arc = oplog; - let rs = ReplayState::new(test_agent_id(), oplog, DeletedRegions::default()) + let rs = ReplayState::new(test_agent_id(), oplog, DeletedRegions::default(), None) .await .unwrap(); @@ -1251,7 +1413,7 @@ async fn marker_in_deleted_region_delivers_end_normally() { end: OplogIndex::from_u64(4), }]) .build(); - let rs = ReplayState::new(test_agent_id(), oplog, skipped) + let rs = ReplayState::new(test_agent_id(), oplog, skipped, None) .await .expect("failed to build replay state"); let handle = rs @@ -1287,7 +1449,7 @@ async fn duplicate_completion_discarded_markers_fail_construction() { oplog.add(entry).await; } let oplog: Arc = oplog; - let err = ReplayState::new(test_agent_id(), oplog, DeletedRegions::default()) + let err = ReplayState::new(test_agent_id(), oplog, DeletedRegions::default(), None) .await .expect_err("duplicate markers must fail replay state construction"); assert!( @@ -1308,9 +1470,14 @@ async fn marker_recorded_at_runtime_is_visible_to_replay() { oplog.add(entry).await; } let oplog: Arc = oplog; - let rs = ReplayState::new(test_agent_id(), oplog.clone(), DeletedRegions::default()) - .await - .expect("failed to build replay state"); + let rs = ReplayState::new( + test_agent_id(), + oplog.clone(), + DeletedRegions::default(), + None, + ) + .await + .expect("failed to build replay state"); let marker_idx = oplog.add(discarded_for(2)).await; rs.record_discarded_completion(OplogIndex::from_u64(2), marker_idx); rs.set_replay_target(marker_idx) @@ -1822,7 +1989,7 @@ async fn replay_finished_emitted_when_skipped_region_reaches_target() { start: OplogIndex::from_u64(3), end: OplogIndex::from_u64(4), }]); - let rs = ReplayState::new(test_agent_id(), oplog, skipped) + let rs = ReplayState::new(test_agent_id(), oplog, skipped, None) .await .expect("failed to build replay state"); @@ -2384,7 +2551,7 @@ async fn orphan_end_with_deleted_start_is_skipped() { start: OplogIndex::from_u64(2), end: OplogIndex::from_u64(2), }]); - let rs = ReplayState::new(test_agent_id(), oplog, skipped) + let rs = ReplayState::new(test_agent_id(), oplog, skipped, None) .await .expect("failed to build replay state"); @@ -2423,7 +2590,7 @@ async fn orphan_cancelled_with_deleted_start_is_skipped() { start: OplogIndex::from_u64(2), end: OplogIndex::from_u64(2), }]); - let rs = ReplayState::new(test_agent_id(), oplog, skipped) + let rs = ReplayState::new(test_agent_id(), oplog, skipped, None) .await .expect("failed to build replay state"); @@ -2450,7 +2617,7 @@ async fn positional_reader_skips_orphan_terminal() { start: OplogIndex::from_u64(2), end: OplogIndex::from_u64(2), }]); - let rs = ReplayState::new(test_agent_id(), oplog, skipped) + let rs = ReplayState::new(test_agent_id(), oplog, skipped, None) .await .expect("failed to build replay state"); @@ -2474,7 +2641,7 @@ async fn deleted_terminal_reports_incomplete() { start: OplogIndex::from_u64(3), end: OplogIndex::from_u64(3), }]); - let rs = ReplayState::new(test_agent_id(), oplog, skipped) + let rs = ReplayState::new(test_agent_id(), oplog, skipped, None) .await .expect("failed to build replay state"); @@ -2603,7 +2770,7 @@ async fn replay_skips_deleted_regions_fuzz() { start: OplogIndex::from_u64(s), end: OplogIndex::from_u64(e), })); - let rs = ReplayState::new(test_agent_id(), oplog, skipped) + let rs = ReplayState::new(test_agent_id(), oplog, skipped, None) .await .expect("failed to build replay state"); diff --git a/golem-worker-executor/src/durable_host/wasm_rpc/mod.rs b/golem-worker-executor/src/durable_host/wasm_rpc/mod.rs index 8bd8c88ec9..0890117d13 100644 --- a/golem-worker-executor/src/durable_host/wasm_rpc/mod.rs +++ b/golem-worker-executor/src/durable_host/wasm_rpc/mod.rs @@ -17,6 +17,7 @@ use crate::durable_host::concurrent::{ finish_span_in_memory, }; use crate::durable_host::durability::{ClassifiedHostError, HostFailureKind, InFunctionRetryHost}; +use crate::durable_host::permissions::resolve_invocation_scope_card; use crate::durable_host::{DurabilityHost, DurableWorkerCtx, InternalRetryResult}; use crate::preview2::golem::agent::host::{ AsyncInvocationWithMetadata, CancelableScheduledInvocationReceipt, CancellationToken, @@ -35,6 +36,7 @@ use futures::future::Either; use golem_common::base_model::agent::{AgentMode, Principal}; use golem_common::model::account::AccountId; use golem_common::model::agent::{InvocationFreshnessDisposition, ParsedAgentId}; +use golem_common::model::card::ScopeCard; use golem_common::model::component::ComponentRevision; use golem_common::model::environment::EnvironmentId; use golem_common::model::invocation_context::InvocationContextStack; @@ -60,7 +62,9 @@ use golem_common::schema::schema_value::SchemaValue; use golem_common::serialization::{deserialize, serialize}; use golem_common::tracing::TraceOrigin; use golem_schema::schema::wit::{ - EncodeError, decode_typed_rejecting_quota_with, decode_value_with, encode_value_with, + EncodeError, PermissionCardHandleDropper, PermissionCardHandleRep, QuotaTokenHandleDropper, + SecretHandleDropper, decode_typed_rejecting_quota_with, decode_value_with, encode_value_with, + reject_quota_handles_in_value_tree, }; use crate::durable_host::golem::agent::schema_value_tree_to_typed_constructor_parameters; @@ -141,6 +145,30 @@ fn invocation_metadata( } } +fn discard_owned_rpc_input(input: core_wire::SchemaValueTree, dropper: &mut D) +where + D: QuotaTokenHandleDropper + SecretHandleDropper + PermissionCardHandleDropper, +{ + let _ = reject_quota_handles_in_value_tree(input, dropper); +} + +fn reject_non_await_scope_card( + scope_card: &Option>, + input: core_wire::SchemaValueTree, + operation: &'static str, + dropper: &mut D, +) -> Result +where + D: QuotaTokenHandleDropper + SecretHandleDropper + PermissionCardHandleDropper, +{ + if scope_card.is_some() { + discard_owned_rpc_input(input, dropper); + Err(format!("{operation} does not accept scope cards")) + } else { + Ok(input) + } +} + impl HostWasmRpc for DurableWorkerCtx { async fn new( &mut self, @@ -365,7 +393,18 @@ impl HostWasmRpc for DurableWorkerCtx { self_: Resource, method_name: String, input: core_wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result> { + let scope_card = match scope_card { + Some(handle) => match resolve_invocation_scope_card(self, &handle) { + Ok(card) => Some(card), + Err(details) => { + discard_owned_rpc_input(input, self); + return Ok(Err(RpcError::Denied(details))); + } + }, + None => None, + }; let prepared = match prepare_rpc_invocation( self, &self_, @@ -389,7 +428,9 @@ impl HostWasmRpc for DurableWorkerCtx { &idempotency_key, )?; let metadata = invocation_metadata(&remote_agent_id, &idempotency_key); - let request = prepared.invoke_request(&remote_agent_id, &idempotency_key); + let request = + prepared.invoke_request(&remote_agent_id, &idempotency_key, scope_card.as_ref()); + let dispatched_scope_card = request.scope_card.clone(); let mut handle = if begun.is_live() { begun.start_live(self, request).await? } else { @@ -417,6 +458,7 @@ impl HostWasmRpc for DurableWorkerCtx { idempotency_key, span, handle, + dispatched_scope_card, ) .await? { @@ -433,7 +475,12 @@ impl HostWasmRpc for DurableWorkerCtx { self_: Resource, method_name: String, input: core_wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result> { + let input = match reject_non_await_scope_card(&scope_card, input, "invoke", self) { + Ok(input) => input, + Err(details) => return Ok(Err(RpcError::Denied(details))), + }; let prepared = match prepare_rpc_invocation( self, &self_, @@ -457,7 +504,7 @@ impl HostWasmRpc for DurableWorkerCtx { &idempotency_key, )?; let metadata = invocation_metadata(&remote_agent_id, &idempotency_key); - let request = prepared.invoke_request(&remote_agent_id, &idempotency_key); + let request = prepared.invoke_request(&remote_agent_id, &idempotency_key, None); let mut handle = if begun.is_live() { begun.start_live(self, request).await? } else { @@ -498,7 +545,18 @@ impl HostWasmRpc for DurableWorkerCtx { this: Resource, method_name: String, input: core_wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result { + let scope_card = match scope_card { + Some(handle) => match resolve_invocation_scope_card(self, &handle) { + Ok(card) => Some(card), + Err(details) => { + discard_owned_rpc_input(input, self); + return Err(anyhow::anyhow!("not permitted: {details}")); + } + }, + None => None, + }; // Trap immediately if the invocation is restricted to read-only side effects. self.check_read_only_allows("golem::rpc::wasm-rpc::async-invoke-and-await") .map_err(wasmtime::Error::from)?; @@ -630,6 +688,7 @@ impl HostWasmRpc for DurableWorkerCtx { input: input_value.clone(), remote_agent_type: None, remote_agent_parameters: None, + scope_card: scope_card.clone(), }; if begun.is_live() { @@ -674,6 +733,7 @@ impl HostWasmRpc for DurableWorkerCtx { span.span_id(), begin_index, initial_freshness_disposition, + scope_card, ); let fut = self.table().push(FutureInvokeResultEntry { @@ -730,7 +790,10 @@ impl HostWasmRpc for DurableWorkerCtx { scheduled_time: wasmtime_wasi::p3::bindings::clocks::system_clock::Instant, method_name: String, input: core_wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result { + let input = reject_non_await_scope_card(&scope_card, input, "schedule-invocation", self) + .map_err(|details| anyhow::anyhow!("not permitted: {details}"))?; let cancellation_token = self .schedule_cancelable_invocation_impl(this, scheduled_time, method_name, input) .await?; @@ -746,7 +809,11 @@ impl HostWasmRpc for DurableWorkerCtx { scheduled_time: wasmtime_wasi::p3::bindings::clocks::system_clock::Instant, method_name: String, input: core_wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result { + let input = + reject_non_await_scope_card(&scope_card, input, "schedule-cancelable-invocation", self) + .map_err(|details| anyhow::anyhow!("not permitted: {details}"))?; let cancellation_token = self .schedule_cancelable_invocation_impl(this, scheduled_time, method_name, input) .await?; @@ -911,6 +978,7 @@ impl DurableWorkerCtx { input: input_value, invocation_context: stack, principal: Principal::anonymous(), + scope_card: None, }); let action = if ephemeral_logical_agent_id.is_some() { ScheduledAction::InvokeEphemeral { @@ -988,6 +1056,7 @@ impl PreparedRpcInvocation { &self, remote_agent_id: &OwnedAgentId, idempotency_key: &IdempotencyKey, + scope_card: Option<&ScopeCard>, ) -> HostRequestGolemRpcInvoke { HostRequestGolemRpcInvoke { remote_agent_id: remote_agent_id.agent_id(), @@ -996,6 +1065,7 @@ impl PreparedRpcInvocation { input: self.input_value.clone(), remote_agent_type: None, remote_agent_parameters: None, + scope_card: scope_card.cloned(), } } @@ -1072,6 +1142,7 @@ async fn run_invoke_and_await( idempotency_key: IdempotencyKey, span: Arc, mut handle: CallHandle, + scope_card: Option, ) -> anyhow::Result> { let mut freshness_disposition = if known_fresh_dispatch_allowed( handle.is_live(), @@ -1138,6 +1209,7 @@ async fn run_invoke_and_await( stack, prepared.config.clone(), &auth_ctx, + scope_card.clone(), ), interrupt_signal, ) @@ -1653,6 +1725,7 @@ impl HostFutureInvokeResultWithStore &span_id, retry_point, InvocationFreshnessDisposition::MayExist, + request.scope_card.clone(), ) }); let task_result = tokio::select! { @@ -2347,6 +2420,7 @@ fn spawn_rpc_task_with_retry( auth_ctx: AuthCtx, target_activation: Option, initial_freshness_disposition: InvocationFreshnessDisposition, + scope_card: Option, ) -> AbortOnDropJoinHandle, Error>> { let first_dispatch = Arc::new(std::sync::atomic::AtomicBool::new( initial_freshness_disposition == InvocationFreshnessDisposition::KnownFresh, @@ -2385,6 +2459,7 @@ fn spawn_rpc_task_with_retry( let auth_ctx = auth_ctx.clone(); let target_activation = target_activation.clone(); let config = config.clone(); + let scope_card = scope_card.clone(); let freshness_disposition = take_dispatch_freshness(&first_dispatch); async move { let _demand = if let Some(target_activation) = target_activation { @@ -2419,6 +2494,7 @@ fn spawn_rpc_task_with_retry( stack, config, &auth_ctx, + scope_card, ) .await .map_err(RpcTaskError::Rpc)?; @@ -2486,6 +2562,7 @@ fn spawn_invoke_and_await_task( span_id: &SpanId, retry_point: OplogIndex, initial_freshness_disposition: InvocationFreshnessDisposition, + scope_card: Option, ) -> AbortOnDropJoinHandle { let retry_params = if ctx.in_atomic_region() { None @@ -2521,6 +2598,7 @@ fn spawn_invoke_and_await_task( ctx.agent_auth_ctx(), deferred_activation, initial_freshness_disposition, + scope_card, ) } @@ -2818,12 +2896,15 @@ mod tests { use crate::services::rpc::RpcError as ServiceRpcError; use async_trait::async_trait; use golem_common::data_value; + use golem_common::model::card::CardId; use golem_common::model::component::ComponentId; + use golem_schema::schema::wit::{QuotaTokenHandleRep, SecretHandleRep}; use golem_service_base::model::auth::AuthCtx; use std::sync::Mutex; use std::sync::atomic::{AtomicBool, Ordering}; use test_r::test; use uuid::Uuid; + use wasmtime::component::ResourceTable; struct FixedDemand { fingerprint: AgentFingerprint, @@ -2847,6 +2928,29 @@ mod tests { struct RecordingEnvRpc { fingerprint: AgentFingerprint, activation_env: Mutex>>, + dispatched_scope_card: Mutex>, + } + + struct TableCapabilityDropper { + table: ResourceTable, + } + + impl QuotaTokenHandleDropper for TableCapabilityDropper { + fn drop_quota_token_handle(&mut self, handle: Resource) { + let _ = self.table.delete(handle); + } + } + + impl SecretHandleDropper for TableCapabilityDropper { + fn drop_secret_handle(&mut self, handle: Resource) { + let _ = self.table.delete(handle); + } + } + + impl PermissionCardHandleDropper for TableCapabilityDropper { + fn drop_permission_card_handle(&mut self, handle: Resource) { + let _ = self.table.delete(handle); + } } #[async_trait] @@ -2879,6 +2983,7 @@ mod tests { _self_stack: InvocationContextStack, _config: Vec, _auth_ctx: &AuthCtx, + _scope_card: Option, ) -> Result { self.invoke_called.store(true, Ordering::SeqCst); Ok(SchemaValue::Tuple { elements: vec![] }) @@ -2932,6 +3037,7 @@ mod tests { _self_stack: InvocationContextStack, _config: Vec, _auth_ctx: &AuthCtx, + _scope_card: Option, ) -> Result { self.invoke_called.store(true, Ordering::SeqCst); Ok(SchemaValue::Tuple { elements: vec![] }) @@ -2986,7 +3092,9 @@ mod tests { _self_stack: InvocationContextStack, _config: Vec, _auth_ctx: &AuthCtx, + scope_card: Option, ) -> Result { + *self.dispatched_scope_card.lock().unwrap() = scope_card; Ok(SchemaValue::Tuple { elements: vec![] }) } @@ -3043,6 +3151,7 @@ mod tests { config: vec![], }), InvocationFreshnessDisposition::MayExist, + None, ) .await; @@ -3081,6 +3190,7 @@ mod tests { config: vec![], }), InvocationFreshnessDisposition::MayExist, + None, ) .await; @@ -3122,6 +3232,7 @@ mod tests { config: vec![], }), InvocationFreshnessDisposition::MayExist, + None, ) .await; @@ -3144,6 +3255,7 @@ mod tests { let rpc = Arc::new(RecordingEnvRpc { fingerprint: persisted_fingerprint, activation_env: Mutex::new(None), + dispatched_scope_card: Mutex::new(None), }); let replay_pending = WasmRpcTargetActivation::ReplayPending { target_fingerprint: persisted_fingerprint, @@ -3166,6 +3278,7 @@ mod tests { AuthCtx::system(), replay_pending.deferred_activation(), InvocationFreshnessDisposition::MayExist, + None, ) .await; @@ -3179,6 +3292,126 @@ mod tests { ); } + #[test] + async fn await_dispatch_forwards_the_resolved_scope_card_to_the_rpc_layer() { + let scope_card = ScopeCard { + scope_card_id: CardId(Uuid::from_u128(20)), + root_card_ids: vec![CardId(Uuid::from_u128(10))], + lower_positive: vec![], + lower_negative: vec![], + upper_positive: vec![], + upper_negative: vec![], + }; + let rpc = Arc::new(RecordingEnvRpc { + fingerprint: AgentFingerprint(Uuid::from_u128(30)), + activation_env: Mutex::new(None), + dispatched_scope_card: Mutex::new(None), + }); + + let result = spawn_rpc_task_with_retry::( + rpc.clone(), + OwnedAgentId::new(EnvironmentId::new(), &agent_id("target")), + IdempotencyKey::new("scope-card-dispatch".to_string()), + "run".to_string(), + SchemaValue::Tuple { elements: vec![] }, + AccountId::new(), + agent_id("caller"), + vec![], + vec![], + InvocationContextStack::fresh(), + None, + AuthCtx::system(), + None, + InvocationFreshnessDisposition::MayExist, + Some(scope_card.clone()), + ) + .await; + + result + .expect("dispatch should not fail at the host layer") + .expect("RPC invocation should succeed"); + assert_eq!(*rpc.dispatched_scope_card.lock().unwrap(), Some(scope_card)); + } + + #[test] + fn non_await_variants_reject_any_scope_card_argument() { + let scope_card = Some(Resource::::new_borrow(1)); + + for operation in [ + "invoke", + "schedule-invocation", + "schedule-cancelable-invocation", + ] { + let mut dropper = TableCapabilityDropper { + table: ResourceTable::new(), + }; + let input = || core_wire::SchemaValueTree { + value_nodes: vec![core_wire::SchemaValueNode::BoolValue(false)], + root: 0, + }; + assert!( + reject_non_await_scope_card(&scope_card, input(), operation, &mut dropper).is_err() + ); + assert!(reject_non_await_scope_card(&None, input(), operation, &mut dropper).is_ok()); + } + } + + #[test] + fn rejected_scope_card_call_consumes_owned_capabilities_from_rpc_input() { + let mut dropper = TableCapabilityDropper { + table: ResourceTable::new(), + }; + let input_quota = dropper + .table + .push(QuotaTokenHandleRep::new(())) + .expect("input quota token should be inserted"); + let input_secret = dropper + .table + .push(SecretHandleRep::new(())) + .expect("input secret should be inserted"); + let input_card = dropper + .table + .push(PermissionCardHandleRep::new(())) + .expect("input card should be inserted"); + let input_quota_rep = input_quota.rep(); + let input_secret_rep = input_secret.rep(); + let input_card_rep = input_card.rep(); + let input = core_wire::SchemaValueTree { + value_nodes: vec![ + core_wire::SchemaValueNode::QuotaTokenHandle(input_quota), + core_wire::SchemaValueNode::SecretValue(input_secret), + core_wire::SchemaValueNode::PermissionCardHandle(input_card), + core_wire::SchemaValueNode::TupleValue(vec![0, 1, 2]), + ], + root: 3, + }; + let scope_card = Some(Resource::::new_borrow(1)); + + assert!(reject_non_await_scope_card(&scope_card, input, "invoke", &mut dropper).is_err()); + assert!( + dropper + .table + .get(&Resource::::new_borrow( + input_quota_rep + )) + .is_err() + ); + assert!( + dropper + .table + .get(&Resource::::new_borrow(input_secret_rep)) + .is_err() + ); + assert!( + dropper + .table + .get(&Resource::::new_borrow( + input_card_rep + )) + .is_err() + ); + } + #[test] fn ephemeral_invocation_target_is_derived_from_the_host_call_key() { let environment_id = EnvironmentId::new(); diff --git a/golem-worker-executor/src/grpc/invocation.rs b/golem-worker-executor/src/grpc/invocation.rs index 80230bf6d4..d4e3dc41aa 100644 --- a/golem-worker-executor/src/grpc/invocation.rs +++ b/golem-worker-executor/src/grpc/invocation.rs @@ -200,6 +200,24 @@ impl ProtobufInvocationDetails } } +impl ProtobufInvocationDetails + for golem_api_grpc::proto::golem::workerexecutor::v1::DeliverCardTransferRequest +{ + fn proto_agent_id(&self) -> &Option { + &self.target_agent_id + } + + fn proto_environment_id(&self) -> &Option { + &self.environment_id + } + + fn proto_invocation_context( + &self, + ) -> &Option { + &None + } +} + pub fn from_proto_invocation_context( context: &Option, ) -> InvocationContextStack { diff --git a/golem-worker-executor/src/grpc/mod.rs b/golem-worker-executor/src/grpc/mod.rs index eab184ca95..f9b3ea8c32 100644 --- a/golem-worker-executor/src/grpc/mod.rs +++ b/golem-worker-executor/src/grpc/mod.rs @@ -14,6 +14,7 @@ mod invocation; +use crate::durable_host::agent_monomorphization_context; use crate::grpc::invocation::{CanStartWorker, from_proto_invocation_context}; use crate::model::event::InternalWorkerEvent; use crate::model::public_oplog::{ @@ -32,6 +33,9 @@ use crate::services::{ UsesAllDeps, }; use crate::worker::Worker; +pub use crate::worker::{ + PERMISSION_CARD_INSTALL_RECIPIENT_MISMATCH, PERMISSION_CARD_TRANSFER_PAYLOAD_CONFLICT, +}; use crate::workerctx::WorkerCtx; use chrono::{DateTime, Utc}; use futures::Stream; @@ -42,20 +46,22 @@ use golem_api_grpc::proto::golem::workerexecutor::v1::worker_executor_server::Wo use golem_api_grpc::proto::golem::workerexecutor::v1::{ ActivatePluginRequest, ActivatePluginResponse, CancelInvocationRequest, CancelInvocationResponse, ConnectWorkerRequest, DeactivatePluginRequest, - DeactivatePluginResponse, DeleteWorkerRequest, ForkWorkerRequest, ForkWorkerResponse, - GetAgentWalletRequest, GetAgentWalletResponse, GetAgentWalletSuccess, GetFileContentsRequest, - GetFileContentsResponse, GetFileSystemNodeRequest, GetFileSystemNodeResponse, GetOplogRequest, - GetOplogResponse, GetRunningWorkersMetadataRequest, GetRunningWorkersMetadataResponse, - GetWorkersMetadataRequest, GetWorkersMetadataResponse, InvokeAgentRequest, InvokeAgentResponse, + DeactivatePluginResponse, DeleteWorkerRequest, DeliverCardTransferRequest, + DeliverCardTransferResponse, ForkWorkerRequest, ForkWorkerResponse, GetAgentWalletRequest, + GetAgentWalletResponse, GetAgentWalletSuccess, GetFileContentsRequest, GetFileContentsResponse, + GetFileSystemNodeRequest, GetFileSystemNodeResponse, GetOplogRequest, GetOplogResponse, + GetRunningWorkersMetadataRequest, GetRunningWorkersMetadataResponse, GetWorkersMetadataRequest, + GetWorkersMetadataResponse, InvokeAgentRequest, InvokeAgentResponse, ProcessOplogEntriesRequest, ProcessOplogEntriesResponse, RevertWorkerRequest, RevertWorkerResponse, SearchOplogRequest, SearchOplogResponse, UpdateWorkerRequest, - UpdateWorkerResponse, process_oplog_entries_response, + UpdateWorkerResponse, deliver_card_transfer_response, process_oplog_entries_response, }; use golem_common::metrics::api::record_new_grpc_api_active_stream; use golem_common::model::account::AccountId; use golem_common::model::agent::{ AgentMode, InvocationFreshnessDisposition, ParsedAgentId, Principal, }; +use golem_common::model::card::{CardId, ScopeCard, StoredCard, card_matches_agent_recipient}; use golem_common::model::component::{CanonicalFilePath, ComponentId, PluginPriority}; use golem_common::model::environment::EnvironmentId; use golem_common::model::invocation_context::InvocationContextStack; @@ -1911,6 +1917,20 @@ impl + UsesAllDeps + Send + Sync + let mode = request.mode(); + let scope_card: Option = request + .scope_card + .clone() + .map(TryInto::try_into) + .transpose() + .map_err(WorkerExecutorError::permission_denied)?; + if scope_card.is_some() + && mode != golem_api_grpc::proto::golem::worker::AgentInvocationMode::Await + { + return Err(WorkerExecutorError::permission_denied( + "scope cards are supported only for invoke-and-await", + )); + } + let ik = idempotency_key.unwrap_or(IdempotencyKey::fresh()); let final_agent_id: AgentId = request .agent_id @@ -2018,6 +2038,7 @@ impl + UsesAllDeps + Send + Sync + input: method_parameters, invocation_context, principal, + scope_card, }; match mode { @@ -2221,6 +2242,82 @@ impl + UsesAllDeps + Send + Sync + Ok(()) } + async fn deliver_card_transfer_internal( + &self, + request: DeliverCardTransferRequest, + ) -> Result<(), WorkerExecutorError> { + let owned_agent_id = extract_owned_agent_id( + &request, + |request| &request.target_agent_id, + |request| &request.environment_id, + )?; + + let auth_ctx: AuthCtx = request + .auth_ctx + .clone() + .ok_or(WorkerExecutorError::invalid_request("auth_ctx not found"))? + .try_into() + .map_err(|error| { + WorkerExecutorError::invalid_request(format!("failed converting auth_ctx: {error}")) + })?; + auth_ctx + .authorize_system_only("deliver permission card transfer") + .map_err(|error| WorkerExecutorError::invalid_request(error.to_string()))?; + + let transfer_id: uuid::Uuid = request + .transfer_id + .ok_or(WorkerExecutorError::invalid_request( + "transfer_id not found", + ))? + .into(); + let source_card_id = CardId( + request + .source_card_id + .ok_or(WorkerExecutorError::invalid_request( + "source_card_id not found", + ))? + .into(), + ); + let card: StoredCard = std::panic::catch_unwind(|| desert_rust::deserialize(&request.card)) + .map_err(|_| WorkerExecutorError::invalid_request("invalid card: malformed payload"))? + .map_err(|error| { + WorkerExecutorError::invalid_request(format!("invalid card: {error}")) + })?; + + self.ensure_worker_belongs_to_this_executor(&owned_agent_id)?; + if Worker::::get_latest_metadata(self, &owned_agent_id) + .await + .is_none() + { + let component = self + .component_service() + .get_metadata(owned_agent_id.agent_id.component_id, None) + .await?; + let parsed_agent_id = + ParsedAgentId::parse(&owned_agent_id.agent_id.agent_id, &component.metadata) + .map_err(|error| { + WorkerExecutorError::invalid_request(format!("Invalid agent id: {error}")) + })?; + let target_context = + agent_monomorphization_context(&component, &owned_agent_id, &parsed_agent_id); + if !card_matches_agent_recipient(&card, &target_context) { + return Err(WorkerExecutorError::invalid_request( + PERMISSION_CARD_INSTALL_RECIPIENT_MISMATCH, + )); + } + } + + let worker = self + .get_or_create_pending_with_freshness( + &request, + InvocationFreshnessDisposition::MayExist, + ) + .await?; + worker + .receive_card_transfer(transfer_id, source_card_id, card) + .await + } + fn create_proto_metadata( metadata: AgentMetadata, last_error_and_retry_count: Option, @@ -3279,6 +3376,38 @@ impl + UsesAllDeps + Send + Sync + ), } } + + async fn deliver_card_transfer( + &self, + request: Request, + ) -> ResponseResult { + let request = request.into_inner(); + let record = recorded_grpc_api_request!( + "deliver_card_transfer", + agent_id = proto_agent_id_string(&request.target_agent_id), + ); + + let result = self + .deliver_card_transfer_internal(request) + .instrument(record.span.clone()) + .await; + + match result { + Ok(()) => record.succeed(Ok(Response::new(DeliverCardTransferResponse { + result: Some(deliver_card_transfer_response::Result::Success( + golem::common::Empty {}, + )), + }))), + Err(mut error) => record.fail( + Ok(Response::new(DeliverCardTransferResponse { + result: Some(deliver_card_transfer_response::Result::Failure( + error.clone().into(), + )), + })), + &mut error, + ), + } + } } pub struct WorkerEventStream { diff --git a/golem-worker-executor/src/lib.rs b/golem-worker-executor/src/lib.rs index 0cd38a5d89..7712bbd7ca 100644 --- a/golem-worker-executor/src/lib.rs +++ b/golem-worker-executor/src/lib.rs @@ -520,6 +520,30 @@ pub trait Bootstrap { &mut linker, DurableWorkerCtxView::durable_ctx_mut, )?; + crate::preview2::golem::permissions::types::add_to_linker::< + _, + HasSelf>, + >(&mut linker, DurableWorkerCtxView::durable_ctx_mut)?; + crate::preview2::golem::permissions::inspect::add_to_linker::< + _, + HasSelf>, + >(&mut linker, DurableWorkerCtxView::durable_ctx_mut)?; + crate::preview2::golem::permissions::derive::add_to_linker::< + _, + HasSelf>, + >(&mut linker, DurableWorkerCtxView::durable_ctx_mut)?; + crate::preview2::golem::permissions::revoke::add_to_linker::< + _, + HasSelf>, + >(&mut linker, DurableWorkerCtxView::durable_ctx_mut)?; + crate::preview2::golem::permissions::wallet::add_to_linker::< + _, + HasSelf>, + >(&mut linker, DurableWorkerCtxView::durable_ctx_mut)?; + crate::preview2::golem::permissions::kernel_introspection::add_to_linker::< + _, + HasSelf>, + >(&mut linker, DurableWorkerCtxView::durable_ctx_mut)?; golem_schema::schema::wit::wire::add_to_linker::<_, HasSelf>>( &mut linker, DurableWorkerCtxView::durable_ctx_mut, diff --git a/golem-worker-executor/src/model/mod.rs b/golem-worker-executor/src/model/mod.rs index 5dd76bd692..1968cbe63a 100644 --- a/golem-worker-executor/src/model/mod.rs +++ b/golem-worker-executor/src/model/mod.rs @@ -450,6 +450,9 @@ impl TrapType { Some(WorkerExecutorError::InvalidRequest { details }) => { make_error(AgentError::InvalidRequest(details.clone())) } + Some(WorkerExecutorError::PermissionDenied { details }) => { + make_error(AgentError::PermanentError(details.clone())) + } Some(WorkerExecutorError::ParamTypeMismatch { details }) => { make_error(AgentError::InvalidRequest(details.clone())) } @@ -976,6 +979,34 @@ mod tests { assert_eq!(decision, Some(RetryDecision::None)); } + #[test] + fn permission_denied_is_non_retriable() { + let trap = TrapType::from_error::( + &anyhow::Error::from( + golem_service_base::error::worker_executor::WorkerExecutorError::permission_denied( + "card-revoked: scope root was revoked while the invocation was queued", + ), + ), + OplogIndex::INITIAL, + false, + false, + AgentMode::Durable, + ); + + assert!(matches!( + trap, + TrapType::Error { + error: AgentError::PermanentError(ref details), + .. + } if details.starts_with("card-revoked:") + )); + + let decision = crate::durable_host::DurableWorkerCtx::< + crate::workerctx::default::Context, + >::fixed_decision_for_trap_type(&trap); + assert_eq!(decision, Some(RetryDecision::None)); + } + #[test] fn runtime_error_falls_back_to_unknown_and_is_policy_retriable() { // `WorkerExecutorError::Runtime` is a generic transient-error wrapper diff --git a/golem-worker-executor/src/model/public_oplog/mod.rs b/golem-worker-executor/src/model/public_oplog/mod.rs index 32a2beeab0..fcd7864491 100644 --- a/golem-worker-executor/src/model/public_oplog/mod.rs +++ b/golem-worker-executor/src/model/public_oplog/mod.rs @@ -28,17 +28,18 @@ use golem_common::model::lucene::Query; use golem_common::model::oplog::public_oplog_entry::{ ActivatePluginParams, AgentInvocationFinishedParams, AgentInvocationStartedParams, BeginAtomicRegionParams, BeginRemoteTransactionParams, CancelPendingInvocationParams, - CancelledParams, CardEventQueuedParams, CardExpiredParams, CardInstallFailedParams, - CardInstalledParams, CardRevokedParams, ChangePersistenceLevelParams, - CommittedRemoteTransactionParams, CompletionDiscardedParams, CreateParams, - CreateResourceParams, DeactivatePluginParams, DropResourceParams, EndAtomicRegionParams, - EndParams, ErrorParams, ExitedParams, FailedUpdateParams, FilesystemStorageUsageUpdateParams, - FinishSpanParams, GrowMemoryParams, HostStreamFrameParams, InterruptedParams, JumpParams, - LogParams, NoOpParams, OplogProcessorCheckpointParams, PendingAgentInvocationParams, - PendingUpdateParams, PreCommitRemoteTransactionParams, PreRollbackRemoteTransactionParams, - RemoveRetryPolicyParams, RestartParams, RevertParams, RolledBackRemoteTransactionParams, - SetRetryPolicyParams, SetSpanAttributeParams, SnapshotParams, StartParams, StartSpanParams, - SuccessfulUpdateParams, SuspendParams, + CancelledParams, CardDerivedParams, CardEventQueuedParams, CardExpiredParams, + CardInstallFailedParams, CardInstalledParams, CardRevokedCascadeParams, CardRevokedParams, + CardTransferConfirmedParams, CardTransferStartedParams, CardTransferredParams, + ChangePersistenceLevelParams, CommittedRemoteTransactionParams, CompletionDiscardedParams, + CreateParams, CreateResourceParams, DeactivatePluginParams, DropResourceParams, + EndAtomicRegionParams, EndParams, ErrorParams, ExitedParams, FailedUpdateParams, + FilesystemStorageUsageUpdateParams, FinishSpanParams, GrowMemoryParams, HostStreamFrameParams, + InterruptedParams, JumpParams, LogParams, NoOpParams, OplogProcessorCheckpointParams, + PendingAgentInvocationParams, PendingUpdateParams, PreCommitRemoteTransactionParams, + PreRollbackRemoteTransactionParams, RemoveRetryPolicyParams, RestartParams, RevertParams, + RolledBackRemoteTransactionParams, SetRetryPolicyParams, SetSpanAttributeParams, + SnapshotParams, StartParams, StartSpanParams, SuccessfulUpdateParams, SuspendParams, }; use golem_common::model::oplog::types::encode_span_data; use golem_common::model::oplog::{ @@ -421,6 +422,7 @@ impl PublicOplogEntryOps for PublicOplogEntry { trace_id, trace_states, invocation_context, + wallet_pin, } => { let invocation_payload: AgentInvocationPayload = oplog_service .download_payload(owned_agent_id, agent_mode, payload) @@ -448,6 +450,12 @@ impl PublicOplogEntryOps for PublicOplogEntry { AgentInvocationStartedParams { timestamp, invocation: public_invocation, + wallet_pin: wallet_pin.map(|pin| { + golem_common::model::card::PublicInvocationWalletPin { + wallet_token: pin.wallet_token, + scope_card_id: pin.scope_card_id, + } + }), }, )) } @@ -900,17 +908,22 @@ impl PublicOplogEntryOps for PublicOplogEntry { timestamp, queued_event_index, card_id, + wallet_generation, } => Ok(PublicOplogEntry::CardRevoked(CardRevokedParams { timestamp, queued_event_index, card_id, + wallet_generation, + })), + OplogEntry::CardExpired { + timestamp, + card_id, + wallet_generation, + } => Ok(PublicOplogEntry::CardExpired(CardExpiredParams { + timestamp, + card_id, + wallet_generation, })), - OplogEntry::CardExpired { timestamp, card_id } => { - Ok(PublicOplogEntry::CardExpired(CardExpiredParams { - timestamp, - card_id, - })) - } OplogEntry::HostStreamFrame { timestamp, parent_start_index, @@ -940,10 +953,12 @@ impl PublicOplogEntryOps for PublicOplogEntry { timestamp, queued_event_index, card, + wallet_generation, } => Ok(PublicOplogEntry::CardInstalled(CardInstalledParams { timestamp, queued_event_index, card_id: card.card_id(), + wallet_generation, })), OplogEntry::CardInstallFailed { timestamp, @@ -958,6 +973,75 @@ impl PublicOplogEntryOps for PublicOplogEntry { reason, }, )), + OplogEntry::CardDerived { + timestamp, + card, + wallet_generation, + } => Ok(PublicOplogEntry::CardDerived(CardDerivedParams { + timestamp, + card_id: card.card_id(), + parent_ids: card.parent_ids().to_vec(), + wallet_generation, + })), + OplogEntry::CardTransferStarted { + timestamp, + transfer_id, + card_id, + target_holder, + source_wallet_generation, + .. + } => Ok(PublicOplogEntry::CardTransferStarted( + CardTransferStartedParams { + timestamp, + transfer_id, + card_id, + target_holder, + source_wallet_generation, + }, + )), + OplogEntry::CardTransferred { + timestamp, + transfer_id, + source_card_id, + installed_card_id, + target_holder, + target_wallet_generation, + .. + } => Ok(PublicOplogEntry::CardTransferred(CardTransferredParams { + timestamp, + transfer_id, + source_card_id, + installed_card_id, + target_holder, + target_wallet_generation, + })), + OplogEntry::CardRevokedCascade { + timestamp, + revoked_card_ids, + local_wallet_generation, + .. + } => Ok(PublicOplogEntry::CardRevokedCascade( + CardRevokedCascadeParams { + timestamp, + revoked_card_ids, + local_wallet_generation, + }, + )), + OplogEntry::CardTransferConfirmed { + timestamp, + transfer_id, + source_card_id, + installed_card_id, + target_holder, + } => Ok(PublicOplogEntry::CardTransferConfirmed( + CardTransferConfirmedParams { + timestamp, + transfer_id, + source_card_id, + installed_card_id, + target_holder, + }, + )), } } } diff --git a/golem-worker-executor/src/model/public_oplog/wit.rs b/golem-worker-executor/src/model/public_oplog/wit.rs index a168e09620..b24a0f8798 100644 --- a/golem-worker-executor/src/model/public_oplog/wit.rs +++ b/golem-worker-executor/src/model/public_oplog/wit.rs @@ -13,7 +13,9 @@ // limitations under the License. use crate::preview2::golem_api_1_x::oplog; -use golem_common::base_model::oplog::{CardInstallFailure, PublicQueuedCardEvent, QueuedCardEvent}; +use golem_common::base_model::oplog::{ + CardInstallFailure, PublicQueuedCardEvent, QueuedCardEvent, QueuedCardEventCard, +}; use golem_common::model::card::CardId; use golem_common::model::environment::EnvironmentId; use golem_common::model::oplog::public_oplog_entry::{ @@ -47,8 +49,8 @@ use golem_common::schema::{ SchemaValue, TypedSchemaValue, redact_host_managed_typed_value, redact_host_managed_value, }; use golem_schema::schema::wit::{ - QuotaTokenHandleDropper, SecretHandleDropper, decode_value, encode_typed, encode_value, - reject_quota_handles_in_value_tree, wire, + PermissionCardHandleDropper, QuotaTokenHandleDropper, SecretHandleDropper, decode_value, + encode_typed, encode_value, reject_quota_handles_in_value_tree, wire, }; /// Encode a public-oplog [`TypedSchemaValue`] into the `golem:core@2.0.0` WIT @@ -83,33 +85,66 @@ fn card_id_from_wit(card_id: oplog::CardId) -> CardId { CardId(card_id.uuid.into()) } -fn queued_card_event_to_wit(value: PublicQueuedCardEvent) -> oplog::QueuedCardEvent { +fn queued_card_event_to_wit( + value: PublicQueuedCardEvent, +) -> Result { match value { - PublicQueuedCardEvent::Install(event) => { - oplog::QueuedCardEvent::Install(oplog::QueuedCardEventInstall { + PublicQueuedCardEvent::Install(event) => Ok(oplog::QueuedCardEvent::Install( + oplog::QueuedCardEventInstall { card_id: card_id_to_wit(event.card_id), - }) - } - PublicQueuedCardEvent::Revoke(event) => { - oplog::QueuedCardEvent::Revoke(oplog::QueuedCardEventRevoke { + }, + )), + PublicQueuedCardEvent::Revoke(event) => Ok(oplog::QueuedCardEvent::Revoke( + oplog::QueuedCardEventRevoke { card_id: card_id_to_wit(event.card_id), - }) + }, + )), + PublicQueuedCardEvent::TransferStarted(_) => { + Err("card transfer events are not representable in golem:api/oplog@1.5.0".to_string()) } + PublicQueuedCardEvent::TransferReceived(_) => Err( + "received card transfer events are not representable in golem:api/oplog@1.5.0" + .to_string(), + ), } } -fn raw_queued_card_event_to_wit(value: QueuedCardEvent) -> oplog::QueuedCardEvent { +fn raw_queued_card_event_to_wit(value: QueuedCardEvent) -> Result { match value { - QueuedCardEvent::Install(event) => { - oplog::QueuedCardEvent::Install(oplog::QueuedCardEventInstall { + QueuedCardEvent::Install(event) => Ok(oplog::QueuedCardEvent::Install( + oplog::QueuedCardEventInstall { card_id: card_id_to_wit(event.card_id), - }) - } - QueuedCardEvent::Revoke(event) => { - oplog::QueuedCardEvent::Revoke(oplog::QueuedCardEventRevoke { + }, + )), + QueuedCardEvent::Revoke(event) => Ok(oplog::QueuedCardEvent::Revoke( + oplog::QueuedCardEventRevoke { card_id: card_id_to_wit(event.card_id), - }) + }, + )), + QueuedCardEvent::TransferStarted(_) => { + Err("card transfer events are not representable in golem:api/oplog@1.5.0".to_string()) } + QueuedCardEvent::TransferReceived(_) => Err( + "received card transfer events are not representable in golem:api/oplog@1.5.0" + .to_string(), + ), + } +} + +fn raw_queued_card_event_from_wit( + value: oplog::QueuedCardEvent, +) -> Result { + match value { + oplog::QueuedCardEvent::Install(event) => { + Ok(QueuedCardEvent::Install(QueuedCardEventCard { + card_id: card_id_from_wit(event.card_id), + card: None, + })) + } + oplog::QueuedCardEvent::Revoke(event) => Ok(QueuedCardEvent::Revoke(QueuedCardEventCard { + card_id: card_id_from_wit(event.card_id), + card: None, + })), } } @@ -146,7 +181,7 @@ fn card_install_failure_from_wit(value: oplog::CardInstallFailure) -> CardInstal /// the first error is surfaced, so a handle in a later entry cannot leak when an /// earlier entry is rejected. pub(crate) fn reject_quota_handles_in_oplog_entries< - D: QuotaTokenHandleDropper + SecretHandleDropper, + D: QuotaTokenHandleDropper + SecretHandleDropper + PermissionCardHandleDropper, >( entries: Vec<(u64, oplog::OplogEntry)>, dropper: &mut D, @@ -279,6 +314,7 @@ impl TryFrom for oplog::PublicOplogEntry { PublicOplogEntry::AgentInvocationStarted(AgentInvocationStartedParams { timestamp, invocation, + wallet_pin: _, }) => Self::AgentInvocationStarted(oplog::AgentInvocationStartedParameters { timestamp: timestamp.into(), invocation: invocation.try_into()?, @@ -586,27 +622,31 @@ impl TryFrom for oplog::PublicOplogEntry { timestamp, queued_event_index, card_id, + wallet_generation: _, }) => Self::CardRevoked(oplog::CardRevokedParameters { timestamp: timestamp.into(), queued_event_index: queued_event_index.into(), card_id: card_id_to_wit(card_id), }), - PublicOplogEntry::CardExpired(CardExpiredParams { timestamp, card_id }) => { - Self::CardExpired(oplog::CardExpiredParameters { - timestamp: timestamp.into(), - card_id: card_id_to_wit(card_id), - }) - } + PublicOplogEntry::CardExpired(CardExpiredParams { + timestamp, + card_id, + wallet_generation: _, + }) => Self::CardExpired(oplog::CardExpiredParameters { + timestamp: timestamp.into(), + card_id: card_id_to_wit(card_id), + }), PublicOplogEntry::CardEventQueued(CardEventQueuedParams { timestamp, event }) => { Self::CardEventQueued(oplog::CardEventQueuedParameters { timestamp: timestamp.into(), - event: queued_card_event_to_wit(event), + event: queued_card_event_to_wit(event)?, }) } PublicOplogEntry::CardInstalled(CardInstalledParams { timestamp, queued_event_index, card_id, + wallet_generation: _, }) => Self::CardInstalled(oplog::CardInstalledParameters { timestamp: timestamp.into(), queued_event_index: queued_event_index.map(Into::into), @@ -623,6 +663,16 @@ impl TryFrom for oplog::PublicOplogEntry { card_id: card_id_to_wit(card_id), reason: card_install_failure_to_wit(reason), }), + PublicOplogEntry::CardDerived(_) + | PublicOplogEntry::CardTransferStarted(_) + | PublicOplogEntry::CardTransferred(_) + | PublicOplogEntry::CardRevokedCascade(_) + | PublicOplogEntry::CardTransferConfirmed(_) => { + return Err( + "permission-card lifecycle entry is not representable in golem:api/oplog@1.5.0" + .to_string(), + ); + } PublicOplogEntry::HostStreamFrame(HostStreamFrameParams { timestamp, parent_start_index, @@ -1133,6 +1183,7 @@ impl TryFrom for golem_common::model::oplog::OplogEntry { trace_id, trace_states: params.trace_states, invocation_context, + wallet_pin: None, }) } oplog::OplogEntry::AgentInvocationFinished(params) => { @@ -1374,6 +1425,7 @@ impl TryFrom for golem_common::model::oplog::OplogEntry { data: oplog_payload_from_wit(params.data), mime_type: params.mime_type, active_cards: Vec::new(), + wallet_generation: 0, }), oplog::OplogEntry::OplogProcessorCheckpoint(params) => { Ok(Self::OplogProcessorCheckpoint { @@ -1411,19 +1463,25 @@ impl TryFrom for golem_common::model::oplog::OplogEntry { params.queued_event_index, ), card_id: card_id_from_wit(params.card_id), + wallet_generation: None, }), oplog::OplogEntry::CardExpired(params) => Ok(Self::CardExpired { timestamp: timestamp_from_datetime(params.timestamp), card_id: card_id_from_wit(params.card_id), + wallet_generation: None, + }), + oplog::OplogEntry::CardEventQueued(params) => Ok(Self::CardEventQueued { + timestamp: timestamp_from_datetime(params.timestamp), + event: raw_queued_card_event_from_wit(params.event)?, + }), + oplog::OplogEntry::CardInstalled(params) => Ok(Self::CardInstalled { + timestamp: timestamp_from_datetime(params.timestamp), + queued_event_index: params + .queued_event_index + .map(golem_common::model::OplogIndex::from_u64), + card: serde_json::from_slice(¶ms.card).map_err(|err| err.to_string())?, + wallet_generation: None, }), - oplog::OplogEntry::CardEventQueued(_params) => Err( - "Converting CardEventQueued from public WIT to raw oplog entry is not supported" - .to_string(), - ), - oplog::OplogEntry::CardInstalled(_params) => Err( - "Converting CardInstalled from public WIT to raw oplog entry is not supported" - .to_string(), - ), oplog::OplogEntry::CardInstallFailed(params) => Ok(Self::CardInstallFailed { timestamp: timestamp_from_datetime(params.timestamp), queued_event_index: golem_common::model::OplogIndex::from_u64( @@ -1853,6 +1911,7 @@ impl TryFrom for oplog::OplogEntry { trace_id, trace_states, invocation_context, + wallet_pin: _, } => Ok(Self::AgentInvocationStarted( oplog::RawAgentInvocationStartedParameters { timestamp: timestamp.into(), @@ -1972,17 +2031,20 @@ impl TryFrom for oplog::OplogEntry { timestamp, queued_event_index, card_id, + wallet_generation: _, } => Ok(Self::CardRevoked(oplog::CardRevokedParameters { timestamp: timestamp.into(), queued_event_index: queued_event_index.into(), card_id: card_id_to_wit(card_id), })), - M::CardExpired { timestamp, card_id } => { - Ok(Self::CardExpired(oplog::CardExpiredParameters { - timestamp: timestamp.into(), - card_id: card_id_to_wit(card_id), - })) - } + M::CardExpired { + timestamp, + card_id, + wallet_generation: _, + } => Ok(Self::CardExpired(oplog::CardExpiredParameters { + timestamp: timestamp.into(), + card_id: card_id_to_wit(card_id), + })), M::HostStreamFrame { timestamp, parent_start_index, @@ -1997,13 +2059,14 @@ impl TryFrom for oplog::OplogEntry { M::CardEventQueued { timestamp, event } => { Ok(Self::CardEventQueued(oplog::CardEventQueuedParameters { timestamp: timestamp.into(), - event: raw_queued_card_event_to_wit(event), + event: raw_queued_card_event_to_wit(event)?, })) } M::CardInstalled { timestamp, queued_event_index, card, + wallet_generation: _, } => Ok(Self::CardInstalled(oplog::RawCardInstalledParameters { timestamp: timestamp.into(), queued_event_index: queued_event_index.map(Into::into), @@ -2022,6 +2085,14 @@ impl TryFrom for oplog::OplogEntry { reason: card_install_failure_to_wit(reason), }, )), + M::CardDerived { .. } + | M::CardTransferStarted { .. } + | M::CardTransferred { .. } + | M::CardRevokedCascade { .. } + | M::CardTransferConfirmed { .. } => Err( + "permission-card lifecycle entry is not representable in golem:api/oplog@1.5.0" + .to_string(), + ), M::CreateResource { timestamp, id, @@ -2228,3 +2299,226 @@ impl TryFrom for oplog::OplogEntry { } } } + +#[cfg(test)] +mod tests { + use super::oplog; + use golem_common::base_model::oplog::{ + QueuedCardEvent, QueuedCardEventTransfer, QueuedCardEventTransferReceived, + }; + use golem_common::model::agent::Principal; + use golem_common::model::card::{ + AccountCardHolder, ApplicationCardHolder, Card, CardHolder, CardId, InvocationWalletPin, + PublicInvocationWalletPin, WalletVersionToken, + }; + use golem_common::model::invocation_context::TraceId; + use golem_common::model::oplog::public_oplog_entry::AgentInvocationStartedParams; + use golem_common::model::oplog::{ + OplogEntry, OplogPayload, PublicAgentInvocation, PublicOplogEntry, + }; + use golem_common::model::{AgentInvocationPayload, Empty, IdempotencyKey, Timestamp}; + use golem_common::schema::SchemaValue; + use test_r::test; + use uuid::Uuid; + + fn test_card(card_id: CardId) -> Card { + Card { + card_id, + parent_ids: Vec::new(), + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + created_at: chrono::Utc::now(), + expires_at: None, + system_card: false, + managed_by: None, + } + } + + #[test] + fn legacy_wit_projection_omits_wallet_generation_outcomes() { + let timestamp = Timestamp::now_utc().rounded(); + let card = test_card(CardId::new()); + let card_id = card.card_id; + let entries = [ + ( + OplogEntry::CardInstalled { + timestamp, + queued_event_index: None, + card: card.clone().into(), + wallet_generation: Some(1), + }, + OplogEntry::CardInstalled { + timestamp, + queued_event_index: None, + card: card.clone().into(), + wallet_generation: None, + }, + ), + ( + OplogEntry::CardRevoked { + timestamp, + queued_event_index: golem_common::model::OplogIndex::NONE, + card_id, + wallet_generation: Some(3), + }, + OplogEntry::CardRevoked { + timestamp, + queued_event_index: golem_common::model::OplogIndex::NONE, + card_id, + wallet_generation: None, + }, + ), + ( + OplogEntry::CardExpired { + timestamp, + card_id, + wallet_generation: Some(4), + }, + OplogEntry::CardExpired { + timestamp, + card_id, + wallet_generation: None, + }, + ), + ]; + + for (entry, expected) in entries { + let encoded = oplog::OplogEntry::try_from(entry.clone()).unwrap(); + assert_eq!(OplogEntry::try_from(encoded).unwrap(), expected); + } + + assert!( + oplog::OplogEntry::try_from(OplogEntry::CardDerived { + timestamp, + card: card.into(), + wallet_generation: Some(2), + }) + .is_err() + ); + } + + #[test] + fn legacy_wit_projection_omits_invocation_wallet_pins() { + let wallet_token = WalletVersionToken { + wallet_id_hash: [0x42; 32], + generation: 73, + }; + let scope_card_id = CardId::new(); + let pinned_card_ids = vec![CardId::new(), CardId::new()]; + let raw_entry = OplogEntry::AgentInvocationStarted { + timestamp: Timestamp::now_utc().rounded(), + idempotency_key: IdempotencyKey::new("wallet-pin".to_string()), + payload: OplogPayload::Inline(Box::new(AgentInvocationPayload::AgentMethod { + method_name: "test".to_string(), + input: SchemaValue::Record { fields: Vec::new() }, + principal: Principal::anonymous(), + scope_card: None, + })), + trace_id: TraceId::generate(), + trace_states: Vec::new(), + invocation_context: Vec::new(), + wallet_pin: Some(InvocationWalletPin { + wallet_token: wallet_token.clone(), + pinned_card_ids: pinned_card_ids.clone(), + scope_card_id: Some(scope_card_id), + }), + }; + + let encoded = oplog::OplogEntry::try_from(raw_entry).unwrap(); + match OplogEntry::try_from(encoded).unwrap() { + OplogEntry::AgentInvocationStarted { wallet_pin, .. } => { + assert_eq!(wallet_pin, None); + } + other => panic!("expected raw invocation-started entry, got {other:?}"), + } + + let public_entry = PublicOplogEntry::AgentInvocationStarted(AgentInvocationStartedParams { + timestamp: Timestamp::now_utc().rounded(), + invocation: PublicAgentInvocation::SaveSnapshot(Empty {}), + wallet_pin: Some(PublicInvocationWalletPin { + wallet_token, + scope_card_id: Some(scope_card_id), + }), + }); + match oplog::PublicOplogEntry::try_from(public_entry).unwrap() { + oplog::PublicOplogEntry::AgentInvocationStarted(_) => {} + other => panic!("expected public invocation-started entry, got {other:?}"), + } + } + + #[test] + fn raw_card_transferred_encoders_reject_mismatched_card_id() { + let payload_card_id = CardId::new(); + let entry = OplogEntry::CardTransferred { + timestamp: Timestamp::now_utc().rounded(), + transfer_id: Uuid::new_v4(), + source_card_id: Some(payload_card_id), + installed_card_id: CardId::new(), + target_holder: CardHolder::Account(AccountCardHolder { + account_id: Uuid::new_v4(), + }), + card: test_card(payload_card_id).into(), + target_wallet_generation: None, + }; + + let protobuf_result: Result = + entry.clone().try_into(); + assert!(protobuf_result.is_err()); + + let wit_result = oplog::OplogEntry::try_from(entry); + assert!(wit_result.is_err()); + } + + #[test] + fn unsupported_transfer_holders_roundtrip_through_protobuf_but_not_legacy_wit() { + let unsupported_targets = [ + CardHolder::Account(AccountCardHolder { + account_id: Uuid::new_v4(), + }), + CardHolder::Application(ApplicationCardHolder { + application_id: Uuid::new_v4(), + }), + ]; + + for target_holder in unsupported_targets { + let payload_card_id = CardId::new(); + let entry = OplogEntry::CardEventQueued { + timestamp: Timestamp::now_utc().rounded(), + event: QueuedCardEvent::TransferStarted(QueuedCardEventTransfer { + transfer_id: Uuid::new_v4(), + card_id: CardId::new(), + card: Some(test_card(payload_card_id).into()), + target_holder, + }), + }; + + let protobuf_result: Result< + golem_api_grpc::proto::golem::worker::RawOplogEntry, + String, + > = entry.clone().try_into(); + let protobuf = protobuf_result.expect("unsupported holder transfer intent must encode"); + assert_eq!(OplogEntry::try_from(protobuf).unwrap(), entry); + + assert!(oplog::OplogEntry::try_from(entry).is_err()); + } + } + + #[test] + fn legacy_wit_rejects_received_card_transfers_without_fabricating_an_event() { + let card_id = CardId::new(); + let source_card_id = CardId::new(); + let entry = OplogEntry::CardEventQueued { + timestamp: Timestamp::now_utc().rounded(), + event: QueuedCardEvent::TransferReceived(QueuedCardEventTransferReceived { + transfer_id: Uuid::new_v4(), + source_card_id: Some(source_card_id), + card_id, + card: Some(test_card(card_id).into()), + }), + }; + + assert!(oplog::OplogEntry::try_from(entry).is_err()); + } +} diff --git a/golem-worker-executor/src/services/active_workers/mod.rs b/golem-worker-executor/src/services/active_workers/mod.rs index 97726daa3d..730dd88c70 100644 --- a/golem-worker-executor/src/services/active_workers/mod.rs +++ b/golem-worker-executor/src/services/active_workers/mod.rs @@ -288,14 +288,12 @@ impl ActiveWorkers { pub async fn notify_revoked_cards(&self, card_ids: &[CardId]) { let affected_agent_cards = self.card_interest_index.interested_agents(card_ids).await; - for (owned_agent_id, affected_card_ids) in affected_agent_cards { + for owned_agent_id in affected_agent_cards.into_keys() { let Some(worker) = self.try_get(&owned_agent_id).await else { continue; }; - for card_id in affected_card_ids { - worker.queue_card_revocation(card_id).await; - } + worker.queue_card_revocations(card_ids).await; } } diff --git a/golem-worker-executor/src/services/card.rs b/golem-worker-executor/src/services/card.rs index fc974dc2ff..64a1443876 100644 --- a/golem-worker-executor/src/services/card.rs +++ b/golem-worker-executor/src/services/card.rs @@ -15,10 +15,10 @@ use async_trait::async_trait; use chrono::Utc; use golem_common::SafeDisplay; -use golem_common::model::card::{CardId, StoredCard}; -use golem_service_base::clients::registry::RegistryService; +use golem_common::model::card::{CardId, CardManagedByRuntimeDerived, ScopeCard, StoredCard}; +use golem_service_base::clients::registry::{RegistryService, RegistryServiceError}; use golem_service_base::error::worker_executor::WorkerExecutorError; -use std::collections::{HashMap, HashSet}; +use std::collections::{BTreeSet, HashMap, HashSet}; use std::sync::Arc; use tokio::sync::RwLock; @@ -31,6 +31,31 @@ pub trait CardService: Send + Sync { card_ids: Vec, ) -> Result, WorkerExecutorError>; + async fn create_runtime_card( + &self, + _card: StoredCard, + _provenance: CardManagedByRuntimeDerived, + ) -> Result { + Err(WorkerExecutorError::runtime( + "runtime permission-card creation is not supported by this card service", + )) + } + + async fn revoke_card(&self, _card_id: CardId) -> Result { + Err(WorkerExecutorError::runtime( + "permission-card revocation is not supported by this card service", + )) + } + + async fn live_ancestor_ids_including_self( + &self, + _card: &StoredCard, + ) -> Result, WorkerExecutorError> { + Err(WorkerExecutorError::runtime( + "permission-card ancestor lookup is not supported by this card service", + )) + } + /// Drops cached live card state so the next `check_cards` re-validates /// against the registry. Called during registry invalidation cursor-expiry /// recovery, when card revocations may have been missed. @@ -45,10 +70,10 @@ pub struct CardServiceDefault { #[derive(Default)] struct CardServiceState { cards: HashMap, - /// Bumped by `invalidate_all`. A `check_cards` lookup captures this before - /// its registry fetch and refuses to write results back if it changed in - /// the meantime, so an in-flight lookup cannot repopulate a just-flushed - /// live cache with stale data. + revocation_versions: HashMap, + /// A `check_cards` lookup captures this before its registry fetch and + /// refuses to write results back if it changed in the meantime, so an + /// in-flight lookup cannot repopulate stale data. generation: u64, } @@ -65,6 +90,64 @@ pub enum CardState { Revoked, } +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum CardRevokeResult { + Revoked(Vec), + AlreadyRevoked(String), + NotPermitted(String), +} + +pub async fn validate_scope_card( + card_service: &dyn CardService, + scope_card: &ScopeCard, +) -> Result<(), WorkerExecutorError> { + if scope_card.scope_card_id.0.is_nil() { + return Err(WorkerExecutorError::permission_denied( + "not-permitted: scope-card ID must not be nil", + )); + } + if scope_card.root_card_ids.is_empty() { + return Err(WorkerExecutorError::permission_denied( + "not-permitted: scope card must reference at least one root card", + )); + } + if scope_card + .root_card_ids + .windows(2) + .any(|ids| ids[0] >= ids[1]) + { + return Err(WorkerExecutorError::permission_denied( + "not-permitted: scope-card root IDs must be strictly increasing", + )); + } + + let states = card_service + .check_cards(scope_card.root_card_ids.clone()) + .await?; + for card_id in &scope_card.root_card_ids { + match states.get(card_id) { + Some(CardState::Live(card)) if card.card_id() == *card_id => {} + Some(CardState::Live(_)) => { + return Err(WorkerExecutorError::permission_denied(format!( + "not-permitted: scope-card root {card_id} does not match the registry payload" + ))); + } + Some(CardState::Revoked) => { + return Err(WorkerExecutorError::permission_denied(format!( + "card-revoked: scope-card root {card_id} is revoked or expired" + ))); + } + Some(CardState::Unknown) | None => { + return Err(WorkerExecutorError::permission_denied(format!( + "not-permitted: scope-card root {card_id} could not be verified" + ))); + } + } + } + + Ok(()) +} + pub struct NoopCardService; #[async_trait] @@ -89,6 +172,8 @@ impl CardServiceDefault { fn record_revoked_cards_in_state(state: &mut CardServiceState, card_ids: &[CardId]) { for card_id in card_ids { + let version = state.revocation_versions.entry(*card_id).or_default(); + *version = version.wrapping_add(1); state.cards.entry(*card_id).or_default().state = CardState::Revoked; } } @@ -179,6 +264,116 @@ impl CardService for CardServiceDefault { Self::record_revoked_cards_in_state(&mut state, card_ids); } + async fn create_runtime_card( + &self, + card: StoredCard, + provenance: CardManagedByRuntimeDerived, + ) -> Result { + let card_id = card.card_id(); + let revocation_version = { + let state = self.state.read().await; + state + .revocation_versions + .get(&card_id) + .copied() + .unwrap_or_default() + }; + let card = self + .registry_service + .create_runtime_card(card, provenance) + .await + .map_err(|err| { + WorkerExecutorError::runtime(format!( + "Failed creating runtime permission card: {}", + err.to_safe_string() + )) + })?; + + let mut state = self.state.write().await; + let revocation_is_newer = state + .revocation_versions + .get(&card_id) + .copied() + .unwrap_or_default() + != revocation_version; + state.generation = state.generation.wrapping_add(1); + if !revocation_is_newer { + state.cards.entry(card_id).or_default().state = if Self::card_is_expired(&card) { + CardState::Revoked + } else { + CardState::Live(Box::new(card.clone())) + }; + } + Ok(card) + } + + async fn revoke_card(&self, card_id: CardId) -> Result { + match self.registry_service.revoke_card(card_id).await { + Ok(card_ids) => { + self.record_revoked_cards(&card_ids).await; + Ok(CardRevokeResult::Revoked(card_ids)) + } + Err(error @ RegistryServiceError::NotFound(_)) => { + self.record_revoked_cards(&[card_id]).await; + Ok(CardRevokeResult::AlreadyRevoked(error.to_safe_string())) + } + Err(error @ RegistryServiceError::AlreadyExists(_)) => { + match self.registry_service.batch_get_cards(vec![card_id]).await { + Ok(cards) if cards.iter().any(|card| card.card_id() == card_id) => { + Err(WorkerExecutorError::runtime(format!( + "Failed revoking permission card {card_id}: {}", + error.to_safe_string() + ))) + } + Ok(_) => { + self.record_revoked_cards(&[card_id]).await; + Ok(CardRevokeResult::AlreadyRevoked(error.to_safe_string())) + } + Err(lookup_error) => Err(WorkerExecutorError::runtime(format!( + "Failed confirming the state of permission card {card_id} after a concurrent revoke failure: {}", + lookup_error.to_safe_string() + ))), + } + } + Err( + error @ (RegistryServiceError::Unauthorized(_) + | RegistryServiceError::BadRequest(_)), + ) => Ok(CardRevokeResult::NotPermitted(error.to_safe_string())), + Err(error) => Err(WorkerExecutorError::runtime(format!( + "Failed revoking permission card {card_id}: {}", + error.to_safe_string() + ))), + } + } + + async fn live_ancestor_ids_including_self( + &self, + card: &StoredCard, + ) -> Result, WorkerExecutorError> { + let mut ancestors = BTreeSet::from([card.card_id()]); + let mut visited = HashSet::from([card.card_id()]); + let mut frontier = card.parent_ids().to_vec(); + + while !frontier.is_empty() { + frontier.retain(|card_id| visited.insert(*card_id)); + if frontier.is_empty() { + break; + } + + let states = self.check_cards(frontier.clone()).await?; + let mut next = Vec::new(); + for card_id in &frontier { + if let Some(CardState::Live(parent)) = states.get(card_id) { + ancestors.insert(*card_id); + next.extend_from_slice(parent.parent_ids()); + } + } + frontier = next; + } + + Ok(ancestors.into_iter().collect()) + } + async fn check_cards( &self, card_ids: Vec, @@ -263,7 +458,6 @@ mod tests { use super::*; use async_trait::async_trait; use chrono::Utc; - use golem_common::model::AgentId; use golem_common::model::agent::{AgentTypeName, RegisteredAgentType, ResolvedAgentType}; use golem_common::model::application::{ApplicationId, ApplicationName}; use golem_common::model::auth::TokenSecret; @@ -273,6 +467,7 @@ mod tests { use golem_common::model::domain_registration::Domain; use golem_common::model::environment::{EnvironmentId, EnvironmentName}; use golem_common::model::quota::{ResourceDefinition, ResourceDefinitionId, ResourceName}; + use golem_common::model::{AgentId, IdempotencyKey, OplogIndex}; use golem_service_base::clients::registry::{ RegistryInvalidationHandler, RegistryServiceError, ResourceUsageUpdate, }; @@ -291,10 +486,16 @@ mod tests { release: Arc, } + struct BlockedCardCreation { + card_id: CardId, + release: Arc, + } + struct BlockingRegistryService { existing_cards: Arc>>, stored_cards: Arc>>, lookup_started: tokio::sync::mpsc::UnboundedSender, + creation_committed: Option>, } enum ExistingCards { @@ -313,6 +514,7 @@ mod tests { struct TestRegistryService { existing_cards: ExistingCards, lookup_count: Arc, + revoke_result: Option, RegistryServiceError>>, } impl TestRegistryService { @@ -320,6 +522,7 @@ mod tests { Self { existing_cards: ExistingCards::All, lookup_count: Arc::new(AtomicUsize::new(0)), + revoke_result: None, } } @@ -327,6 +530,7 @@ mod tests { Self { existing_cards: ExistingCards::Fixed(existing_cards), lookup_count, + revoke_result: None, } } @@ -339,6 +543,23 @@ mod tests { .collect(), ), lookup_count, + revoke_result: None, + } + } + + fn with_revoked_card_ids(revoked_card_ids: Vec) -> Self { + Self { + existing_cards: ExistingCards::All, + lookup_count: Arc::new(AtomicUsize::new(0)), + revoke_result: Some(Ok(revoked_card_ids)), + } + } + + fn with_revoke_error(error: RegistryServiceError, card: StoredCard) -> Self { + Self { + existing_cards: ExistingCards::Cards(HashMap::from([(card.card_id(), card)])), + lookup_count: Arc::new(AtomicUsize::new(0)), + revoke_result: Some(Err(error)), } } @@ -349,6 +570,7 @@ mod tests { Self { existing_cards: ExistingCards::Shared(existing_cards), lookup_count, + revoke_result: None, } } @@ -382,6 +604,7 @@ mod tests { release_first_lookup, }, lookup_count, + revoke_result: None, } } @@ -495,6 +718,22 @@ mod tests { .collect()) } + async fn create_runtime_card( + &self, + card: StoredCard, + _provenance: CardManagedByRuntimeDerived, + ) -> Result { + Ok(card) + } + + async fn revoke_card(&self, card_id: CardId) -> Result, RegistryServiceError> { + self.revoke_result.clone().unwrap_or_else(|| { + Err(RegistryServiceError::NotFound(format!( + "permission card {card_id} not found" + ))) + }) + } + async fn download_component( &self, _component_id: ComponentId, @@ -713,6 +952,30 @@ mod tests { Ok(snapshot) } + async fn create_runtime_card( + &self, + card: StoredCard, + _provenance: CardManagedByRuntimeDerived, + ) -> Result { + let card_id = card.card_id(); + self.existing_cards.write().await.insert(card_id); + self.stored_cards + .write() + .await + .insert(card_id, card.clone()); + if let Some(creation_committed) = &self.creation_committed { + let release = Arc::new(tokio::sync::Notify::new()); + creation_committed + .send(BlockedCardCreation { + card_id, + release: release.clone(), + }) + .unwrap(); + release.notified().await; + } + Ok(card) + } + async fn download_component( &self, _component_id: ComponentId, @@ -867,9 +1130,13 @@ mod tests { } fn stored_card(card_id: CardId) -> StoredCard { + stored_card_with_parents(card_id, Vec::new()) + } + + fn stored_card_with_parents(card_id: CardId, parent_ids: Vec) -> StoredCard { StoredCard::Concrete(Card { card_id, - parent_ids: Vec::new(), + parent_ids, lower_positive: Vec::new(), lower_negative: Vec::new(), upper_positive: Vec::new(), @@ -881,6 +1148,35 @@ mod tests { }) } + #[test] + async fn ancestor_lookup_handles_diamond_graph() { + let root = CardId::new(); + let left = CardId::new(); + let right = CardId::new(); + let leaf = CardId::new(); + let lookup_count = Arc::new(AtomicUsize::new(0)); + let service = CardServiceDefault::new(Arc::new(TestRegistryService::with_cards( + vec![ + stored_card(root), + stored_card_with_parents(left, vec![root]), + stored_card_with_parents(right, vec![root]), + ], + lookup_count.clone(), + ))); + let leaf = stored_card_with_parents(leaf, vec![left, right]); + let mut expected = vec![root, left, right, leaf.card_id()]; + expected.sort_unstable(); + + assert_eq!( + service + .live_ancestor_ids_including_self(&leaf) + .await + .unwrap(), + expected + ); + assert_eq!(lookup_count.load(Ordering::SeqCst), 2); + } + fn assert_live(states: &HashMap, card_id: CardId) { assert!( matches!(states.get(&card_id), Some(CardState::Live(card)) if card.card_id() == card_id) @@ -918,6 +1214,132 @@ mod tests { )); } + fn scope_card_with_roots(mut root_card_ids: Vec) -> ScopeCard { + root_card_ids.sort_unstable(); + ScopeCard { + scope_card_id: CardId::new(), + root_card_ids, + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + } + } + + #[test] + async fn scope_card_admission_requires_and_accepts_all_live_roots() { + let first = CardId::new(); + let second = CardId::new(); + let service = CardServiceDefault::new(Arc::new(TestRegistryService::with_cards( + vec![stored_card(first), stored_card(second)], + Arc::new(AtomicUsize::new(0)), + ))); + + validate_scope_card(&service, &scope_card_with_roots(vec![first, second])) + .await + .unwrap(); + } + + #[test] + async fn scope_card_admission_rejects_a_revoked_root() { + let live = CardId::new(); + let revoked = CardId::new(); + let service = service(); + service.record_revoked_cards(&[revoked]).await; + + let error = validate_scope_card(&service, &scope_card_with_roots(vec![live, revoked])) + .await + .unwrap_err(); + + assert!(matches!( + error, + WorkerExecutorError::PermissionDenied { details } + if details.starts_with("card-revoked:") && details.contains(&revoked.to_string()) + )); + } + + #[test] + async fn scope_card_admission_negatively_caches_a_registry_missing_root() { + let live = CardId::new(); + let missing = CardId::new(); + let service = CardServiceDefault::new(Arc::new(TestRegistryService::with_cards( + vec![stored_card(live)], + Arc::new(AtomicUsize::new(0)), + ))); + + let error = validate_scope_card(&service, &scope_card_with_roots(vec![live, missing])) + .await + .unwrap_err(); + + assert!(matches!( + error, + WorkerExecutorError::PermissionDenied { details } + if details.starts_with("card-revoked:") && details.contains(&missing.to_string()) + )); + assert_eq!( + service + .check_cards(vec![missing]) + .await + .unwrap() + .get(&missing), + Some(&CardState::Revoked) + ); + } + + struct FailingCardService; + + #[async_trait] + impl CardService for FailingCardService { + async fn record_revoked_cards(&self, _card_ids: &[CardId]) {} + + async fn check_cards( + &self, + _card_ids: Vec, + ) -> Result, WorkerExecutorError> { + Err(WorkerExecutorError::runtime("registry unavailable")) + } + } + + #[test] + async fn scope_card_admission_propagates_liveness_service_errors() { + let error = validate_scope_card( + &FailingCardService, + &scope_card_with_roots(vec![CardId::new()]), + ) + .await + .unwrap_err(); + + assert!(matches!(error, WorkerExecutorError::Runtime { .. })); + } + + struct OmittingCardService; + + #[async_trait] + impl CardService for OmittingCardService { + async fn record_revoked_cards(&self, _card_ids: &[CardId]) {} + + async fn check_cards( + &self, + _card_ids: Vec, + ) -> Result, WorkerExecutorError> { + Ok(HashMap::new()) + } + } + + #[test] + async fn scope_card_admission_rejects_an_omitted_root_as_unverifiable() { + let root = CardId::new(); + let error = validate_scope_card(&OmittingCardService, &scope_card_with_roots(vec![root])) + .await + .unwrap_err(); + + assert!(matches!( + error, + WorkerExecutorError::PermissionDenied { details } + if details.starts_with("not-permitted:") && details.contains(&root.to_string()) + )); + } + #[test] async fn record_revoked_cards_caches_revocation() { let service = service(); @@ -928,6 +1350,199 @@ mod tests { assert_revoked(&service.check_cards(vec![card_id]).await.unwrap(), card_id); } + #[test] + async fn registry_revoke_result_immediately_invalidates_the_full_cascade() { + let target_id = CardId::new(); + let descendant_id = CardId::new(); + let revoked_card_ids = vec![target_id, descendant_id]; + let service = CardServiceDefault::new(Arc::new( + TestRegistryService::with_revoked_card_ids(revoked_card_ids.clone()), + )); + + assert_eq!( + service.revoke_card(target_id).await.unwrap(), + CardRevokeResult::Revoked(revoked_card_ids) + ); + let states = service + .check_cards(vec![target_id, descendant_id]) + .await + .unwrap(); + assert_revoked(&states, target_id); + assert_revoked(&states, descendant_id); + } + + #[test] + async fn missing_registry_revoke_target_is_a_cached_typed_revocation() { + let target_id = CardId::new(); + let service = CardServiceDefault::new(Arc::new(TestRegistryService::all_existing())); + + assert!(matches!( + service.revoke_card(target_id).await.unwrap(), + CardRevokeResult::AlreadyRevoked(_) + )); + assert_revoked( + &service.check_cards(vec![target_id]).await.unwrap(), + target_id, + ); + } + + #[test] + async fn concurrent_revoke_failure_does_not_claim_or_cache_revocation() { + let target = stored_card(CardId::new()); + let target_id = target.card_id(); + let service = CardServiceDefault::new(Arc::new(TestRegistryService::with_revoke_error( + RegistryServiceError::AlreadyExists("concurrent update".to_string()), + target, + ))); + + let result = service.revoke_card(target_id).await; + let states = service.check_cards(vec![target_id]).await.unwrap(); + assert!( + result.is_err() + && matches!(states.get(&target_id), Some(CardState::Live(card)) if card.card_id() == target_id), + "a concurrent failure does not prove that the target was revoked: result={result:?}, state={:?}", + states.get(&target_id) + ); + } + + #[test] + async fn created_runtime_card_is_immediately_cached_as_live() { + let lookup_count = Arc::new(AtomicUsize::new(0)); + let card = stored_card(CardId::new()); + let card_id = card.card_id(); + let service = CardServiceDefault::new(Arc::new(TestRegistryService::with_cards( + Vec::new(), + lookup_count.clone(), + ))); + let provenance = CardManagedByRuntimeDerived { + environment_id: EnvironmentId::new(), + agent_id: AgentId { + component_id: ComponentId::new(), + agent_id: "deriving-agent".to_string(), + }, + invocation_key: IdempotencyKey::new("derive-test".to_string()), + oplog_index: OplogIndex::from_u64(42), + }; + + assert_eq!( + service + .create_runtime_card(card.clone(), provenance) + .await + .unwrap(), + card + ); + assert_live(&service.check_cards(vec![card_id]).await.unwrap(), card_id); + assert_eq!(lookup_count.load(Ordering::SeqCst), 0); + } + + #[test] + async fn stale_missing_lookup_cannot_revoke_concurrently_created_runtime_card() { + let card = stored_card(CardId::new()); + let card_id = card.card_id(); + let existing_cards = Arc::new(RwLock::new(HashSet::new())); + let stored_cards = Arc::new(RwLock::new(HashMap::new())); + let (lookup_started, mut lookup_started_rx) = tokio::sync::mpsc::unbounded_channel(); + let service = Arc::new(CardServiceDefault::new(Arc::new(BlockingRegistryService { + existing_cards, + stored_cards, + lookup_started, + creation_committed: None, + }))); + + let lookup = tokio::spawn({ + let service = service.clone(); + async move { service.check_cards(vec![card_id]).await.unwrap() } + }); + let release_lookup = expect_blocked_lookup(&mut lookup_started_rx, &[card_id]).await; + + service + .create_runtime_card( + card, + CardManagedByRuntimeDerived { + environment_id: EnvironmentId::new(), + agent_id: AgentId { + component_id: ComponentId::new(), + agent_id: "deriving-agent".to_string(), + }, + invocation_key: IdempotencyKey::new("concurrent-derive".to_string()), + oplog_index: OplogIndex::from_u64(42), + }, + ) + .await + .unwrap(); + release_lookup.notify_one(); + + let _ = lookup.await.unwrap(); + assert_live(&service.check_cards(vec![card_id]).await.unwrap(), card_id); + } + + #[test] + async fn revocation_after_runtime_creation_commit_wins_over_delayed_response() { + let card = stored_card(CardId::new()); + let card_id = card.card_id(); + let (lookup_started, _lookup_started_rx) = tokio::sync::mpsc::unbounded_channel(); + let (creation_committed, mut creation_committed_rx) = + tokio::sync::mpsc::unbounded_channel(); + let service = Arc::new(CardServiceDefault::new(Arc::new(BlockingRegistryService { + existing_cards: Arc::new(RwLock::new(HashSet::new())), + stored_cards: Arc::new(RwLock::new(HashMap::new())), + lookup_started, + creation_committed: Some(creation_committed), + }))); + let provenance = CardManagedByRuntimeDerived { + environment_id: EnvironmentId::new(), + agent_id: AgentId { + component_id: ComponentId::new(), + agent_id: "deriving-agent".to_string(), + }, + invocation_key: IdempotencyKey::new("delayed-create-response".to_string()), + oplog_index: OplogIndex::from_u64(42), + }; + + let creation = tokio::spawn({ + let service = service.clone(); + async move { service.create_runtime_card(card, provenance).await.unwrap() } + }); + let blocked_creation = creation_committed_rx.recv().await.unwrap(); + assert_eq!(blocked_creation.card_id, card_id); + + service.record_revoked_cards(&[card_id]).await; + blocked_creation.release.notify_one(); + creation.await.unwrap(); + + assert_revoked(&service.check_cards(vec![card_id]).await.unwrap(), card_id); + } + + #[test] + async fn successful_runtime_creation_supersedes_cached_missing_state() { + let lookup_count = Arc::new(AtomicUsize::new(0)); + let card = stored_card(CardId::new()); + let card_id = card.card_id(); + let service = CardServiceDefault::new(Arc::new(TestRegistryService::with_cards( + Vec::new(), + lookup_count, + ))); + + assert_revoked(&service.check_cards(vec![card_id]).await.unwrap(), card_id); + service + .create_runtime_card( + card, + CardManagedByRuntimeDerived { + environment_id: EnvironmentId::new(), + agent_id: AgentId { + component_id: ComponentId::new(), + agent_id: "deriving-agent".to_string(), + }, + invocation_key: IdempotencyKey::new("post-lookup-derive".to_string()), + oplog_index: OplogIndex::from_u64(42), + }, + ) + .await + .unwrap(); + + assert_live(&service.check_cards(vec![card_id]).await.unwrap(), card_id); + } + #[test] async fn known_live_card_skips_repeated_registry_lookup() { let lookup_count = Arc::new(AtomicUsize::new(0)); @@ -1174,6 +1789,7 @@ mod tests { existing_cards: existing_cards.clone(), stored_cards: Arc::new(RwLock::new(HashMap::new())), lookup_started, + creation_committed: None, }))); let precache = tokio::spawn({ @@ -1236,6 +1852,7 @@ mod tests { existing_cards: existing_cards.clone(), stored_cards: Arc::new(RwLock::new(HashMap::new())), lookup_started, + creation_committed: None, }))); let lookup = tokio::spawn({ @@ -1277,6 +1894,7 @@ mod tests { existing_cards, stored_cards: Arc::new(RwLock::new(HashMap::from([(card_id, expired_card)]))), lookup_started, + creation_committed: None, }))); let lookup = tokio::spawn({ @@ -1319,6 +1937,7 @@ mod tests { existing_cards: existing_cards.clone(), stored_cards: stored_cards.clone(), lookup_started, + creation_committed: None, }))); let precache = tokio::spawn({ diff --git a/golem-worker-executor/src/services/oplog/mod.rs b/golem-worker-executor/src/services/oplog/mod.rs index ca40ef9909..89fb6e15bd 100644 --- a/golem-worker-executor/src/services/oplog/mod.rs +++ b/golem-worker-executor/src/services/oplog/mod.rs @@ -20,6 +20,7 @@ use desert_rust::BinaryCodec; use futures::future::{BoxFuture, Shared}; use golem_common::cache::{BackgroundEvictionMode, Cache, FullCacheEvictionMode}; use golem_common::model::agent::AgentMode; +use golem_common::model::card::InvocationWalletPin; use golem_common::model::component::{ComponentId, ComponentRevision}; use golem_common::model::environment::EnvironmentId; use golem_common::model::oplog::host_functions::HostFunctionName; @@ -693,6 +694,7 @@ pub trait OplogOps: Oplog { async fn add_agent_invocation_started( &self, invocation: AgentInvocation, + wallet_pin: InvocationWalletPin, ) -> Result { let (idempotency_key, invocation_payload, ctx) = invocation.into_parts(); let payload = self.upload_payload(&invocation_payload).await?; @@ -706,6 +708,7 @@ pub trait OplogOps: Oplog { trace_id, trace_states, invocation_context, + wallet_pin: Some(wallet_pin), }; self.add(entry.clone()).await; Ok(entry) diff --git a/golem-worker-executor/src/services/oplog/tests.rs b/golem-worker-executor/src/services/oplog/tests.rs index 88cb67be85..fe50b406db 100644 --- a/golem-worker-executor/src/services/oplog/tests.rs +++ b/golem-worker-executor/src/services/oplog/tests.rs @@ -27,6 +27,7 @@ use futures::stream::BoxStream; use golem_common::config::RedisConfig; use golem_common::model::account::{AccountEmail, AccountId}; use golem_common::model::agent::{AgentMode, Principal}; +use golem_common::model::card::{InvocationWalletPin, WalletVersionToken}; use golem_common::model::component::ComponentId; use golem_common::model::invocation_context::InvocationContextStack; use golem_common::model::oplog::{AgentError, LogLevel}; @@ -211,6 +212,17 @@ fn make_agent_metadata( } } +fn invocation_wallet_pin() -> InvocationWalletPin { + InvocationWalletPin { + wallet_token: WalletVersionToken { + wallet_id_hash: [0x42; 32], + generation: 7, + }, + pinned_card_ids: Vec::new(), + scope_card_id: None, + } +} + fn default_last_known_status() -> read_only_lock::arc_swap::ReadOnlyView { read_only_lock::arc_swap::ReadOnlyView::new(Arc::new(arc_swap::ArcSwap::from_pointee( AgentStatusRecord::default(), @@ -1880,15 +1892,19 @@ async fn entries_with_small_payload(_tracing: &Tracing) { let entry_start = oplog.read(start_idx).await.rounded(); let entry_end = oplog.read(end_idx).await.rounded(); let entry2 = oplog - .add_agent_invocation_started(AgentInvocation::AgentMethod { - idempotency_key: IdempotencyKey::fresh(), - method_name: "f2".to_string(), - input: SchemaValue::Record { - fields: vec![SchemaValue::String("request".to_string())], + .add_agent_invocation_started( + AgentInvocation::AgentMethod { + idempotency_key: IdempotencyKey::fresh(), + method_name: "f2".to_string(), + input: SchemaValue::Record { + fields: vec![SchemaValue::String("request".to_string())], + }, + invocation_context: InvocationContextStack::fresh_rounded(), + principal: Principal::anonymous(), + scope_card: None, }, - invocation_context: InvocationContextStack::fresh_rounded(), - principal: Principal::anonymous(), - }) + invocation_wallet_pin(), + ) .await .unwrap() .rounded(); @@ -2084,18 +2100,22 @@ async fn entries_with_large_payload(_tracing: &Tracing) { let entry_start = oplog.read(start_idx).await.rounded(); let entry_end = oplog.read(end_idx).await.rounded(); let entry2 = oplog - .add_agent_invocation_started(AgentInvocation::AgentMethod { - idempotency_key: IdempotencyKey::fresh(), - method_name: "f2".to_string(), - input: SchemaValue::Record { - fields: vec![SchemaValue::Binary(BinaryValuePayload { - bytes: large_payload2.clone(), - mime_type: None, - })], + .add_agent_invocation_started( + AgentInvocation::AgentMethod { + idempotency_key: IdempotencyKey::fresh(), + method_name: "f2".to_string(), + input: SchemaValue::Record { + fields: vec![SchemaValue::Binary(BinaryValuePayload { + bytes: large_payload2.clone(), + mime_type: None, + })], + }, + invocation_context: InvocationContextStack::fresh_rounded(), + principal: Principal::anonymous(), + scope_card: None, }, - invocation_context: InvocationContextStack::fresh_rounded(), - principal: Principal::anonymous(), - }) + invocation_wallet_pin(), + ) .await .unwrap() .rounded(); diff --git a/golem-worker-executor/src/services/rpc.rs b/golem-worker-executor/src/services/rpc.rs index 378456cb37..f12a0a7e1c 100644 --- a/golem-worker-executor/src/services/rpc.rs +++ b/golem-worker-executor/src/services/rpc.rs @@ -42,7 +42,7 @@ use golem_common::model::account::AccountId; use golem_common::model::agent::{ AgentInvocationMode, AgentPrincipal, InvocationFreshnessDisposition, Principal, }; -use golem_common::model::card::{AgentMethodName, AgentResourcePattern, AgentVerb}; +use golem_common::model::card::{AgentMethodName, AgentResourcePattern, AgentVerb, ScopeCard}; use golem_common::model::invocation_context::InvocationContextStack; use golem_common::model::oplog::types::SerializableRpcError; use golem_common::model::worker::AgentConfigEntryDto; @@ -85,6 +85,7 @@ pub trait Rpc: Send + Sync { self_stack: InvocationContextStack, config: Vec, auth_ctx: &AuthCtx, + scope_card: Option, ) -> Result; async fn invoke( @@ -183,6 +184,7 @@ impl From for RpcError { WorkerExecutorError::InvalidAccount => RpcError::Denied { details: "Invalid account".to_string(), }, + WorkerExecutorError::PermissionDenied { details } => RpcError::Denied { details }, WorkerExecutorError::InvalidRequest { details } => RpcError::ProtocolError { details }, _ => RpcError::RemoteInternalError { details: value.to_string(), @@ -343,6 +345,7 @@ impl Rpc for RemoteInvocationRpc { self_stack: InvocationContextStack, config: Vec, auth_ctx: &AuthCtx, + scope_card: Option, ) -> Result { let principal = caller_agent_principal(self_agent_id); @@ -363,6 +366,7 @@ impl Rpc for RemoteInvocationRpc { principal, owned_agent_id.environment_id, auth_ctx, + scope_card, ) .await?; @@ -408,6 +412,7 @@ impl Rpc for RemoteInvocationRpc { principal, owned_agent_id.environment_id, auth_ctx, + None, ) .await?; @@ -890,6 +895,7 @@ impl Rpc for DirectWorkerInvocationRpc { self_stack: InvocationContextStack, config: Vec, auth_ctx: &AuthCtx, + scope_card: Option, ) -> Result { let owned_agent_id = &self.canonicalize_owned_agent_id(owned_agent_id).await?; @@ -946,6 +952,7 @@ impl Rpc for DirectWorkerInvocationRpc { input: method_parameters, invocation_context: self_stack, principal, + scope_card, }; let output = worker.invoke_and_await(invocation).await?; @@ -972,6 +979,7 @@ impl Rpc for DirectWorkerInvocationRpc { self_stack, config, auth_ctx, + scope_card, ) .await } @@ -1046,6 +1054,7 @@ impl Rpc for DirectWorkerInvocationRpc { input: method_parameters, invocation_context: self_stack, principal, + scope_card: None, }; match worker.clone().invoke(invocation).await? { diff --git a/golem-worker-executor/src/services/scheduler.rs b/golem-worker-executor/src/services/scheduler.rs index 880883bf09..4e7b348305 100644 --- a/golem-worker-executor/src/services/scheduler.rs +++ b/golem-worker-executor/src/services/scheduler.rs @@ -1335,6 +1335,7 @@ mod tests { input: SchemaValue::Record { fields: vec![] }, invocation_context: InvocationContextStack::fresh(), principal: Principal::anonymous(), + scope_card: None, } } @@ -1345,6 +1346,7 @@ mod tests { input: SchemaValue::Record { fields: vec![] }, invocation_context: InvocationContextStack::fresh(), principal: Principal::anonymous(), + scope_card: None, } } diff --git a/golem-worker-executor/src/services/worker_fork.rs b/golem-worker-executor/src/services/worker_fork.rs index 1ac438040c..6ebbed4326 100644 --- a/golem-worker-executor/src/services/worker_fork.rs +++ b/golem-worker-executor/src/services/worker_fork.rs @@ -42,9 +42,11 @@ use crate::worker::Worker; use crate::workerctx::WorkerCtx; use async_trait::async_trait; use golem_common::base_model::component::ComponentRevision; +use golem_common::base_model::oplog::QueuedCardEvent; use golem_common::base_model::regions::DeletedRegionsBuilder; use golem_common::model::account::AccountId; use golem_common::model::agent::Principal; +use golem_common::model::card::{AgentCardHolder, CardHolder}; use golem_common::model::environment::EnvironmentId; use golem_common::model::invocation_context::InvocationContextStack; use golem_common::model::oplog::host_functions::GolemApiFork; @@ -621,7 +623,11 @@ impl DefaultWorkerFork { let mut deleted_regions_builder = DeletedRegionsBuilder::new(); for oplog_index in oplog_range { - let entry = source_oplog.read(oplog_index).await; + let entry = rewrite_forked_oplog_entry( + source_oplog.read(oplog_index).await, + &owned_source_agent_id.agent_id, + &owned_target_agent_id.agent_id, + ); new_oplog.add(entry.clone()).await; if let OplogEntry::Revert { dropped_region, .. } = &entry { @@ -742,6 +748,65 @@ impl DefaultWorkerFork { } } +fn rewrite_forked_agent_holder( + holder: &mut CardHolder, + source_agent_id: &AgentId, + target_agent_id: &AgentId, +) { + if matches!(holder, CardHolder::Agent(holder) if holder.agent_id == *source_agent_id) { + *holder = CardHolder::Agent(AgentCardHolder { + agent_id: target_agent_id.clone(), + }); + } +} + +fn rewrite_forked_oplog_entry( + mut entry: OplogEntry, + source_agent_id: &AgentId, + target_agent_id: &AgentId, +) -> OplogEntry { + match &mut entry { + OplogEntry::AgentInvocationStarted { + wallet_pin: Some(wallet_pin), + .. + } => { + wallet_pin.wallet_token.wallet_id_hash = CardHolder::Agent(AgentCardHolder { + agent_id: target_agent_id.clone(), + }) + .wallet_id_hash(); + } + OplogEntry::CardEventQueued { + event: QueuedCardEvent::TransferStarted(event), + .. + } => { + rewrite_forked_agent_holder(&mut event.target_holder, source_agent_id, target_agent_id) + } + OplogEntry::CardTransferStarted { + source_holder, + target_holder, + .. + } => { + if let Some(source_holder) = source_holder { + rewrite_forked_agent_holder(source_holder, source_agent_id, target_agent_id); + } + rewrite_forked_agent_holder(target_holder, source_agent_id, target_agent_id); + } + OplogEntry::CardTransferred { target_holder, .. } + | OplogEntry::CardTransferConfirmed { target_holder, .. } => { + rewrite_forked_agent_holder(target_holder, source_agent_id, target_agent_id); + } + OplogEntry::CardRevokedCascade { + affected_wallets, .. + } => { + for holder in affected_wallets { + rewrite_forked_agent_holder(holder, source_agent_id, target_agent_id); + } + } + _ => {} + } + entry +} + #[async_trait] impl WorkerForkService for DefaultWorkerFork { async fn fork( @@ -865,3 +930,100 @@ impl WorkerForkService for DefaultWorkerFork { Ok(()) } } + +#[cfg(test)] +mod tests { + use super::*; + use golem_common::model::card::{CardId, InvocationWalletPin, WalletVersionToken}; + use golem_common::model::component::ComponentId; + use golem_common::model::invocation_context::TraceId; + use golem_common::model::oplog::OplogPayload; + use golem_common::model::{AgentInvocationPayload, IdempotencyKey}; + use golem_common::schema::SchemaValue; + use test_r::test; + + fn agent_id(name: &str) -> AgentId { + AgentId { + component_id: ComponentId(Uuid::new_v4()), + agent_id: name.to_string(), + } + } + + #[test] + fn fork_rewrites_invocation_wallet_identity() { + let source = agent_id("source"); + let target = agent_id("target"); + let entry = OplogEntry::AgentInvocationStarted { + timestamp: Timestamp::now_utc(), + idempotency_key: IdempotencyKey::new("fork-wallet-pin".to_string()), + payload: OplogPayload::Inline(Box::new(AgentInvocationPayload::AgentMethod { + method_name: "test".to_string(), + input: SchemaValue::Record { fields: Vec::new() }, + principal: Principal::anonymous(), + scope_card: None, + })), + trace_id: TraceId::generate(), + trace_states: Vec::new(), + invocation_context: Vec::new(), + wallet_pin: Some(InvocationWalletPin { + wallet_token: WalletVersionToken { + wallet_id_hash: CardHolder::Agent(AgentCardHolder { + agent_id: source.clone(), + }) + .wallet_id_hash(), + generation: 7, + }, + pinned_card_ids: Vec::new(), + scope_card_id: None, + }), + }; + + match rewrite_forked_oplog_entry(entry, &source, &target) { + OplogEntry::AgentInvocationStarted { + wallet_pin: Some(wallet_pin), + .. + } => assert_eq!( + wallet_pin.wallet_token.wallet_id_hash, + CardHolder::Agent(AgentCardHolder { agent_id: target }).wallet_id_hash() + ), + other => panic!("expected pinned invocation start, got {other:?}"), + } + } + + #[test] + fn fork_rewrites_only_local_transfer_holders() { + let source = agent_id("source"); + let target = agent_id("target"); + let remote = agent_id("remote"); + let entry = OplogEntry::CardTransferStarted { + timestamp: Timestamp::now_utc(), + transfer_id: Uuid::new_v4(), + card_id: CardId::new(), + source_holder: Some(CardHolder::Agent(AgentCardHolder { + agent_id: source.clone(), + })), + target_holder: CardHolder::Agent(AgentCardHolder { + agent_id: remote.clone(), + }), + source_wallet_generation: Some(8), + }; + + match rewrite_forked_oplog_entry(entry, &source, &target) { + OplogEntry::CardTransferStarted { + source_holder, + target_holder, + .. + } => { + assert_eq!( + source_holder, + Some(CardHolder::Agent(AgentCardHolder { agent_id: target })) + ); + assert_eq!( + target_holder, + CardHolder::Agent(AgentCardHolder { agent_id: remote }) + ); + } + other => panic!("expected transfer start, got {other:?}"), + } + } +} diff --git a/golem-worker-executor/src/services/worker_proxy.rs b/golem-worker-executor/src/services/worker_proxy.rs index 477530789f..1c76ba8a99 100644 --- a/golem-worker-executor/src/services/worker_proxy.rs +++ b/golem-worker-executor/src/services/worker_proxy.rs @@ -19,17 +19,19 @@ use desert_rust::BinaryCodec; use golem_api_grpc::proto::golem::worker::v1::worker_service_client::WorkerServiceClient; use golem_api_grpc::proto::golem::worker::v1::{ AgentError, CancelInvocationRequest, CancelInvocationResponse, CompletePromiseRequest, - CompletePromiseResponse, ForkWorkerRequest, InvokeAgentRequest, InvokeAgentResponse, - LaunchNewWorkerRequest, LaunchNewWorkerResponse, ProcessOplogEntriesRequest, - ProcessOplogEntriesResponse, ResumeWorkerRequest, ResumeWorkerResponse, RevertWorkerRequest, - RevertWorkerResponse, UpdateWorkerRequest, UpdateWorkerResponse, agent_error, - cancel_invocation_response, complete_promise_response, fork_worker_response, + CompletePromiseResponse, DeliverCardTransferRequest, DeliverCardTransferResponse, + ForkWorkerRequest, InvokeAgentRequest, InvokeAgentResponse, LaunchNewWorkerRequest, + LaunchNewWorkerResponse, ProcessOplogEntriesRequest, ProcessOplogEntriesResponse, + ResumeWorkerRequest, ResumeWorkerResponse, RevertWorkerRequest, RevertWorkerResponse, + UpdateWorkerRequest, UpdateWorkerResponse, agent_error, cancel_invocation_response, + complete_promise_response, deliver_card_transfer_response, fork_worker_response, invoke_agent_response, launch_new_worker_response, process_oplog_entries_response, resume_worker_response, revert_worker_response, update_worker_response, }; use golem_api_grpc::proto::golem::worker::{CompleteParameters, UpdateMode}; use golem_common::model::account::AccountId; use golem_common::model::agent::{AgentInvocationMode, InvocationFreshnessDisposition, Principal}; +use golem_common::model::card::{CardId, ScopeCard, StoredCard}; use golem_common::model::component::ComponentRevision; use golem_common::model::environment::EnvironmentId; use golem_common::model::invocation_context::InvocationContextStack; @@ -81,8 +83,18 @@ pub trait WorkerProxy: Send + Sync { principal: Principal, environment_id: EnvironmentId, auth_ctx: &AuthCtx, + scope_card: Option, ) -> Result; + async fn deliver_card_transfer( + &self, + target_agent_id: &AgentId, + environment_id: EnvironmentId, + transfer_id: uuid::Uuid, + source_card_id: CardId, + card: &StoredCard, + ) -> Result<(), WorkerProxyError>; + async fn update( &self, owned_agent_id: &OwnedAgentId, @@ -334,6 +346,7 @@ impl WorkerProxy for RemoteWorkerProxy { principal: Principal, environment_id: EnvironmentId, auth_ctx: &AuthCtx, + scope_card: Option, ) -> Result { debug!("Invoking remote agent method {method_name} on worker {agent_id}"); @@ -347,6 +360,13 @@ impl WorkerProxy for RemoteWorkerProxy { let proto_method_parameters: golem_api_grpc::proto::golem::schema::SchemaValue = method_parameters.into(); + let proto_scope_card = scope_card + .as_ref() + .map(TryInto::try_into) + .transpose() + .map_err(|error: String| { + WorkerProxyError::InternalError(WorkerExecutorError::invalid_request(error)) + })?; let first_dispatch = AtomicBool::new(true); let response: InvokeAgentResponse = self @@ -384,6 +404,7 @@ impl WorkerProxy for RemoteWorkerProxy { environment_id: Some(environment_id.into()), freshness_disposition: proto_freshness_disposition, config: config.clone().into_iter().map(Into::into).collect(), + scope_card: proto_scope_card.clone(), })) }) .await? @@ -458,6 +479,46 @@ impl WorkerProxy for RemoteWorkerProxy { } } + async fn deliver_card_transfer( + &self, + target_agent_id: &AgentId, + environment_id: EnvironmentId, + transfer_id: uuid::Uuid, + source_card_id: CardId, + card: &StoredCard, + ) -> Result<(), WorkerProxyError> { + debug!(%target_agent_id, %transfer_id, "Delivering permission card to remote agent"); + + let card = desert_rust::serialize_to_byte_vec(card).map_err(|error| { + WorkerProxyError::InternalError(WorkerExecutorError::unknown(format!( + "Failed to serialize permission card transfer: {error}" + ))) + })?; + + let response: DeliverCardTransferResponse = self + .worker_service_client + .call("deliver_card_transfer", move |client| { + Box::pin(client.deliver_card_transfer(DeliverCardTransferRequest { + target_agent_id: Some(target_agent_id.clone().into()), + environment_id: Some(environment_id.into()), + transfer_id: Some(transfer_id.into()), + card: card.clone(), + auth_ctx: Some(AuthCtx::System.into()), + source_card_id: Some(source_card_id.0.into()), + })) + }) + .await? + .into_inner(); + + match response.result { + Some(deliver_card_transfer_response::Result::Success(_)) => Ok(()), + Some(deliver_card_transfer_response::Result::Error(error)) => Err(error.into()), + None => Err(WorkerProxyError::InternalError( + WorkerExecutorError::unknown("Empty response through the worker API"), + )), + } + } + async fn update( &self, owned_agent_id: &OwnedAgentId, @@ -667,6 +728,7 @@ impl WorkerProxy for RemoteWorkerProxy { freshness_disposition: golem_api_grpc::proto::golem::worker::v1::InvocationFreshnessDisposition::MayExist as i32, config: Vec::new(), + scope_card: None, })) }) .await? @@ -740,6 +802,7 @@ mod tests { }; use golem_api_grpc::proto::golem::worker::v1::{ForkWorkerResponse, InvokeAgentSuccess}; use golem_common::model::component::ComponentId; + use prost::Message; use std::sync::{Arc, Mutex}; use test_r::test; use tokio::net::TcpListener; @@ -749,6 +812,7 @@ mod tests { #[derive(Clone, Default)] struct FlakyWorkerService { dispositions: Arc>>, + scope_card_payloads: Arc>>>, } macro_rules! unimplemented_rpc { @@ -798,13 +862,25 @@ mod tests { ProcessOplogEntriesRequest, ProcessOplogEntriesResponse ); + unimplemented_rpc!( + deliver_card_transfer, + DeliverCardTransferRequest, + DeliverCardTransferResponse + ); async fn invoke_agent( &self, request: Request, ) -> Result, Status> { let mut dispositions = self.dispositions.lock().unwrap(); - dispositions.push(request.into_inner().freshness_disposition); + let request = request.into_inner(); + dispositions.push(request.freshness_disposition); + if let Some(scope_card) = request.scope_card { + self.scope_card_payloads + .lock() + .unwrap() + .push(scope_card.encode_to_vec()); + } if dispositions.len() == 1 { Err(Status::unavailable("ambiguous transport failure")) } else { @@ -821,6 +897,7 @@ mod tests { async fn invoke_agent_marks_retry_as_may_exist_after_ambiguous_failure() { let service = FlakyWorkerService::default(); let dispositions = service.dispositions.clone(); + let scope_card_payloads = service.scope_card_payloads.clone(); let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); let port = listener.local_addr().unwrap().port(); tokio::spawn(async move { @@ -861,6 +938,14 @@ mod tests { Principal::anonymous(), EnvironmentId::new(), &AuthCtx::System, + Some(ScopeCard { + scope_card_id: CardId::new(), + root_card_ids: vec![CardId::new()], + lower_positive: Vec::new(), + lower_negative: Vec::new(), + upper_positive: Vec::new(), + upper_negative: Vec::new(), + }), ) .await .unwrap(); @@ -874,5 +959,8 @@ mod tests { as i32, ] ); + let scope_card_payloads = scope_card_payloads.lock().unwrap(); + assert_eq!(scope_card_payloads.len(), 2); + assert_eq!(scope_card_payloads[0], scope_card_payloads[1]); } } diff --git a/golem-worker-executor/src/worker/invocation.rs b/golem-worker-executor/src/worker/invocation.rs index 13dce176dd..bb571c5b88 100644 --- a/golem-worker-executor/src/worker/invocation.rs +++ b/golem-worker-executor/src/worker/invocation.rs @@ -124,17 +124,29 @@ async fn invoke_observed( // Encode the schema-native inputs into wire trees (minting any quota-token // handles into the guest store) before the invocation is marked started, so // an encoding failure surfaces before invocation bookkeeping. - let call = materialize_call(&mut store, call)?; + let call = match materialize_call(&mut store, call) { + Ok(call) => call, + Err(error) => { + if matches!(&mode, InvocationMode::Replay) { + store.data_mut().on_agent_invocation_finished().await; + } + return Err(error); + } + }; if let InvocationMode::Live(invocation) = mode { - async { + let started = async { store .data_mut() .on_agent_invocation_started(invocation) .await } .instrument(span!(Level::INFO, "on_agent_invocation_started")) - .await?; + .await; + if let Err(error) = started { + store.data_mut().on_agent_invocation_finished().await; + return Err(error); + } } store.data_mut().set_running(); @@ -164,6 +176,8 @@ async fn invoke_observed( store.data_mut().exit_read_only_mode(); } + store.data_mut().on_agent_invocation_finished().await; + let call_result = match call_outcome { Ok(result) => result, Err(payload) => std::panic::resume_unwind(payload), @@ -1243,6 +1257,7 @@ mod tests { input, invocation_context: InvocationContextStack::fresh(), principal: Principal::anonymous(), + scope_card: None, } } diff --git a/golem-worker-executor/src/worker/invocation_loop.rs b/golem-worker-executor/src/worker/invocation_loop.rs index 52dc42344d..f084a6aad4 100644 --- a/golem-worker-executor/src/worker/invocation_loop.rs +++ b/golem-worker-executor/src/worker/invocation_loop.rs @@ -1663,11 +1663,14 @@ impl Invocation<'_, Ctx> { .data() .durable_ctx() .agent_wallet_cards_snapshot(); + let wallet_generation = + self.store.data().durable_ctx().wallet_generation(); self.parent .add_and_commit_oplog(OplogEntry::snapshot( payload, snapshot.mime_type, active_cards, + wallet_generation, )) .await; debug!("Periodic snapshot saved successfully"); diff --git a/golem-worker-executor/src/worker/mod.rs b/golem-worker-executor/src/worker/mod.rs index 9451ee9339..fc916c360c 100644 --- a/golem-worker-executor/src/worker/mod.rs +++ b/golem-worker-executor/src/worker/mod.rs @@ -25,7 +25,10 @@ pub mod status_flusher; use self::agent_config::{ ensure_required_agent_secrets_are_configured, parse_worker_creation_agent_config, }; -use crate::durable_host::{agent_effective_surface_from_component_metadata, recover_stderr_logs}; +use crate::durable_host::{ + agent_effective_surface_from_component_metadata, agent_monomorphization_context, + recover_stderr_logs, +}; use crate::metrics::storage::record_filesystem_pool_released; use crate::metrics::workers::AdmissionPhase; use crate::model::{AgentConfig, ExecutionStatus, LookupResult, ReadFileResult, TrapType}; @@ -65,7 +68,9 @@ use golem_common::model::agent::{ AgentMode, InvocationFreshnessDisposition, ParsedAgentId, Principal, Snapshotting, SnapshottingConfig, ephemeral_invocation_phantom_id, }; -use golem_common::model::card::{CardId, StoredCard}; +use golem_common::model::card::{ + AgentCardHolder, CardHolder, CardId, StoredCard, card_matches_agent_recipient, +}; use golem_common::model::component::CanonicalFilePath; use golem_common::model::component::ComponentId; use golem_common::model::component::ComponentRevision; @@ -102,6 +107,10 @@ use uuid::Uuid; use wasmtime::component::Instance; use wasmtime::{Store, UpdateDeadline}; +pub const PERMISSION_CARD_TRANSFER_PAYLOAD_CONFLICT: &str = + "permission card transfer payload conflict"; +pub const PERMISSION_CARD_INSTALL_RECIPIENT_MISMATCH: &str = "install-recipient-mismatch"; + /// Resolved read-only `AgentMethod` invocation data needed to build the /// cache key and entry. #[derive(Clone)] @@ -111,6 +120,7 @@ struct ReadOnlyContext { principal: Principal, cfg: golem_common::base_model::agent::ReadOnlyConfig, component_revision: ComponentRevision, + cacheable: bool, } /// `Ttl(0)` is folded in as it is equivalent to `NoCache`. @@ -1067,6 +1077,7 @@ impl Worker { method_name, input, principal, + scope_card, .. } = invocation else { @@ -1088,6 +1099,7 @@ impl Worker { principal: principal.clone(), cfg: cfg.clone(), component_revision, + cacheable: scope_card.is_none(), }) } @@ -1112,7 +1124,7 @@ impl Worker { // Cache HIT: still refuse on deleting / startup-failed worker. if let Some(ro) = &read_only_ctx { - let no_cache = is_no_cache(&ro.cfg.cache_policy); + let no_cache = !ro.cacheable || is_no_cache(&ro.cfg.cache_policy); if !no_cache { let cur_epoch = self.read_only_cache_epoch.load(Ordering::SeqCst); let principal_ref = if ro.cfg.uses_principal { @@ -1155,7 +1167,7 @@ impl Worker { // Subscribe before enqueue/lookup to avoid missing the completion event. let subscription = self.events().subscribe(); let observer_sub = if let Some(ro) = &read_only_ctx { - if is_no_cache(&ro.cfg.cache_policy) { + if !ro.cacheable || is_no_cache(&ro.cfg.cache_policy) { None } else { Some(self.events().subscribe()) @@ -1179,6 +1191,17 @@ impl Worker { } LookupResult::Pending => (ResultOrSubscription::Pending(subscription), None), LookupResult::New => { + if let AgentInvocation::AgentMethod { + scope_card: Some(scope_card), + .. + } = &invocation + { + crate::services::card::validate_scope_card( + self.card_service().as_ref(), + scope_card, + ) + .await?; + } // For ReadOnly the helper returns the epoch captured under the // enqueue lock; using any other epoch could store stale data. let captured = self @@ -1263,6 +1286,7 @@ impl Worker { // current-epoch entry shadow the recorded idempotency result. // Instead we handle non-`New` results inline below. let lookup_for_coalesce = if let Some(ro) = self.read_only_context_for(&invocation) + && ro.cacheable && !is_no_cache(&ro.cfg.cache_policy) { Some(( @@ -2405,7 +2429,9 @@ impl Worker { .into_iter() .filter_map(|pending_event| match pending_event.event { QueuedCardEvent::Revoke(event) => Some(event.card_id), - QueuedCardEvent::Install(_) => None, + QueuedCardEvent::Install(_) + | QueuedCardEvent::TransferStarted(_) + | QueuedCardEvent::TransferReceived(_) => None, }) .collect::>(); wallet.retain(|card| !revoked_cards.contains(&card.card_id())); @@ -2513,23 +2539,203 @@ impl Worker { } pub async fn queue_card_revocation(&self, card_id: CardId) -> Option { - let status = self.get_last_known_status().await; - let revoke_already_pending = || { - status.pending_card_events.iter().any(|pending_event| { - matches!(&pending_event.event, QueuedCardEvent::Revoke(event) if event.card_id == card_id) - }) - }; + self.queue_card_revocations(&[card_id]) + .await + .into_iter() + .next() + } - if status.revoked_cards.contains(&card_id) || revoke_already_pending() { - None - } else { - Some( - self.add_and_commit_oplog(OplogEntry::card_event_queued(QueuedCardEvent::revoke( + pub async fn queue_card_revocations(&self, card_ids: &[CardId]) -> Vec { + let status = self.get_last_known_status().await; + let pending_revocations = status + .pending_card_events + .iter() + .filter_map(|pending_event| match &pending_event.event { + QueuedCardEvent::Revoke(event) => Some(event.card_id), + QueuedCardEvent::Install(_) + | QueuedCardEvent::TransferStarted(_) + | QueuedCardEvent::TransferReceived(_) => None, + }) + .collect::>(); + let mut card_ids = card_ids + .iter() + .copied() + .filter(|card_id| { + !status.revoked_cards.contains(card_id) && !pending_revocations.contains(card_id) + }) + .collect::>(); + card_ids.sort_unstable(); + card_ids.dedup(); + + let mut queued_event_indices = Vec::with_capacity(card_ids.len()); + for card_id in card_ids { + queued_event_indices.push( + self.add_to_oplog(OplogEntry::card_event_queued(QueuedCardEvent::revoke( card_id, ))) .await, - ) + ); + } + if !queued_event_indices.is_empty() { + self.commit_oplog_and_update_state(CommitLevel::Always) + .await; } + + queued_event_indices + } + + pub async fn receive_card_transfer( + &self, + transfer_id: Uuid, + source_card_id: CardId, + card: StoredCard, + ) -> Result<(), WorkerExecutorError> { + let instance_guard = self.lock_non_stopping_worker().await; + + if instance_guard.is_deleting() { + return Err(WorkerExecutorError::invalid_request( + "Cannot deliver a permission card to a deleting worker", + )); + } + + let status = self.get_last_known_status().await; + if let Some(receipt) = + status + .pending_card_events + .iter() + .find_map(|pending_event| match &pending_event.event { + QueuedCardEvent::TransferReceived(receipt) + if receipt.transfer_id == transfer_id => + { + Some(receipt) + } + _ => None, + }) + { + let received_card = receipt.card.as_ref().ok_or_else(|| { + WorkerExecutorError::runtime( + "received permission card transfer is missing its durable payload", + ) + })?; + return if receipt + .source_card_id + .is_none_or(|recorded_source_card_id| recorded_source_card_id == source_card_id) + && received_card == &card + { + Ok(()) + } else { + Err(WorkerExecutorError::invalid_request( + PERMISSION_CARD_TRANSFER_PAYLOAD_CONFLICT, + )) + }; + } + + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: self.owned_agent_id.agent_id.clone(), + }); + let current_oplog_index = self.oplog.current_oplog_index().await; + let mut next_oplog_index = OplogIndex::INITIAL; + let mut matching_receipt_indices = HashSet::new(); + while next_oplog_index <= current_oplog_index { + let remaining = current_oplog_index.as_u64() - next_oplog_index.as_u64() + 1; + let count = remaining.min(1024); + let entries = self.oplog.read_many(next_oplog_index, count).await; + + for (oplog_index, entry) in entries { + match entry { + OplogEntry::CardEventQueued { + event: QueuedCardEvent::TransferReceived(receipt), + .. + } if receipt.transfer_id == transfer_id => { + let received_card = receipt.card.as_ref().ok_or_else(|| { + WorkerExecutorError::runtime( + "received permission card transfer is missing its durable payload", + ) + })?; + if !receipt + .source_card_id + .is_none_or(|recorded_source_card_id| { + recorded_source_card_id == source_card_id + }) + || received_card != &card + { + return Err(WorkerExecutorError::invalid_request( + PERMISSION_CARD_TRANSFER_PAYLOAD_CONFLICT, + )); + } + matching_receipt_indices.insert(oplog_index); + } + OplogEntry::CardInstallFailed { + queued_event_index, + card_id, + .. + } if matching_receipt_indices.contains(&queued_event_index) => { + return if card_id == card.card_id() { + Ok(()) + } else { + Err(WorkerExecutorError::invalid_request( + PERMISSION_CARD_TRANSFER_PAYLOAD_CONFLICT, + )) + }; + } + OplogEntry::CardTransferred { + transfer_id: recorded_transfer_id, + source_card_id: recorded_source_card_id, + installed_card_id, + target_holder: recorded_target_holder, + card: recorded_card, + .. + } if recorded_transfer_id == transfer_id + && recorded_target_holder == target_holder => + { + return if recorded_source_card_id.is_none_or(|recorded_source_card_id| { + recorded_source_card_id == source_card_id + }) && installed_card_id == card.card_id() + && recorded_card == card + { + Ok(()) + } else { + Err(WorkerExecutorError::invalid_request( + PERMISSION_CARD_TRANSFER_PAYLOAD_CONFLICT, + )) + }; + } + _ => {} + } + } + + next_oplog_index = OplogIndex::from_u64(next_oplog_index.as_u64() + count); + } + + if !matching_receipt_indices.is_empty() { + return Ok(()); + } + + let parsed_agent_id = self.parsed_agent_id.as_ref().ok_or_else(|| { + WorkerExecutorError::invalid_request("permission cards can only be delivered to agents") + })?; + let component = self.current_component.load(); + let target_context = + agent_monomorphization_context(&component, &self.owned_agent_id, parsed_agent_id); + if !card_matches_agent_recipient(&card, &target_context) { + return Err(WorkerExecutorError::invalid_request( + PERMISSION_CARD_INSTALL_RECIPIENT_MISMATCH, + )); + } + + self.add_and_commit_oplog_internal( + &instance_guard, + OplogEntry::card_event_queued(QueuedCardEvent::transfer_received( + transfer_id, + source_card_id, + card, + )), + None, + ) + .await; + + drop(instance_guard); + Ok(()) } async fn add_and_commit_oplog_internal( diff --git a/golem-worker-executor/src/worker/read_only_cache.rs b/golem-worker-executor/src/worker/read_only_cache.rs index 5c6132392e..014a58cae1 100644 --- a/golem-worker-executor/src/worker/read_only_cache.rs +++ b/golem-worker-executor/src/worker/read_only_cache.rs @@ -446,6 +446,7 @@ mod tests { input: tuple(vec![]), invocation_context: InvocationContextStack::fresh(), principal: Principal::anonymous(), + scope_card: None, }; assert_eq!( classify_invocation(None, None, &m), diff --git a/golem-worker-executor/src/worker/status.rs b/golem-worker-executor/src/worker/status.rs index 2751cb8806..742d90c75e 100644 --- a/golem-worker-executor/src/worker/status.rs +++ b/golem-worker-executor/src/worker/status.rs @@ -5,7 +5,7 @@ use golem_common::model::AgentInvocationPayload; use golem_common::model::agent::AgentMode; use golem_common::model::component::ComponentRevision; use golem_common::model::oplog::{ - AgentError, AgentResourceId, OplogEntry, OplogPayload, UpdateDescription, + AgentError, AgentResourceId, OplogEntry, OplogPayload, QueuedCardEvent, UpdateDescription, }; use golem_common::model::regions::{DeletedRegions, DeletedRegionsBuilder, OplogRegion}; use golem_common::model::{ @@ -530,6 +530,11 @@ fn calculate_latest_worker_status( OplogEntry::CardEventQueued { .. } => {} OplogEntry::CardInstalled { .. } => {} OplogEntry::CardInstallFailed { .. } => {} + OplogEntry::CardDerived { .. } => {} + OplogEntry::CardTransferStarted { .. } => {} + OplogEntry::CardTransferred { .. } => {} + OplogEntry::CardRevokedCascade { .. } => {} + OplogEntry::CardTransferConfirmed { .. } => {} OplogEntry::CardRevoked { .. } => {} OplogEntry::CardExpired { .. } => {} OplogEntry::HostStreamFrame { .. } => {} @@ -546,8 +551,17 @@ fn calculate_revoked_cards( entries: &BTreeMap, ) -> HashSet { for entry in entries.values() { - if let OplogEntry::CardRevoked { card_id, .. } = entry { - revoked_cards.insert(*card_id); + match entry { + OplogEntry::CardRevoked { card_id, .. } => { + revoked_cards.insert(*card_id); + } + OplogEntry::CardRevokedCascade { + revoked_card_ids, .. + } => revoked_cards.extend(revoked_card_ids.iter().copied()), + OplogEntry::CardInstalled { card, .. } => { + revoked_cards.remove(&card.card_id()); + } + _ => {} } } @@ -765,15 +779,80 @@ pub(crate) fn calculate_pending_card_events( queued_event_index: Some(queued_event_index), .. } => { - result.retain(|event| event.oplog_index != *queued_event_index); + result.retain(|event| { + event.oplog_index != *queued_event_index + || !matches!(event.event, QueuedCardEvent::Install(_)) + }); } OplogEntry::CardInstallFailed { queued_event_index, .. + } => { + result.retain(|event| { + event.oplog_index != *queued_event_index + || !matches!( + event.event, + QueuedCardEvent::Install(_) | QueuedCardEvent::TransferReceived(_) + ) + }); } - | OplogEntry::CardRevoked { + OplogEntry::CardRevoked { queued_event_index, .. } => { - result.retain(|event| event.oplog_index != *queued_event_index); + result.retain(|event| { + event.oplog_index != *queued_event_index + || !matches!(event.event, QueuedCardEvent::Revoke(_)) + }); + } + OplogEntry::CardRevokedCascade { + revoked_card_ids, .. + } => { + result.retain(|event| { + !matches!( + &event.event, + QueuedCardEvent::Revoke(revoke) + if revoked_card_ids.contains(&revoke.card_id) + ) + }); + } + OplogEntry::CardTransferConfirmed { + transfer_id, + source_card_id, + installed_card_id, + target_holder, + .. + } => { + result.retain(|event| { + !matches!( + &event.event, + QueuedCardEvent::TransferStarted(transfer) + if transfer.transfer_id == *transfer_id + && transfer.card_id == *source_card_id + && transfer.card.as_ref().is_some_and(|card| card.card_id() == *installed_card_id) + && transfer.target_holder == *target_holder + ) + }); + } + OplogEntry::CardTransferred { + transfer_id, + source_card_id, + installed_card_id, + card, + .. + } => { + result.retain(|event| { + !matches!( + &event.event, + QueuedCardEvent::TransferReceived(receipt) + if receipt.transfer_id == *transfer_id + && receipt.source_card_id.is_none_or(|receipt_source_card_id| { + source_card_id.is_none_or(|source_card_id| { + receipt_source_card_id == source_card_id + }) + }) + && receipt.card_id == *installed_card_id + && receipt.card.as_ref() == Some(card) + ) + }); } _ => {} } @@ -1792,6 +1871,7 @@ mod test { }, invocation_context: InvocationContextStack::fresh(), principal: Principal::anonymous(), + scope_card: None, }) .agent_invocation_finished( AgentInvocationResult::AgentInitialization, @@ -1836,6 +1916,7 @@ mod test { }, invocation_context: InvocationContextStack::fresh(), principal: Principal::anonymous(), + scope_card: None, }) .pending_invocation(AgentInvocation::AgentMethod { idempotency_key: k2.clone(), @@ -1843,6 +1924,7 @@ mod test { input: SchemaValue::Record { fields: vec![] }, invocation_context: InvocationContextStack::fresh(), principal: Principal::anonymous(), + scope_card: None, }) .cancel_pending_invocation(k1) .build(); @@ -2108,6 +2190,7 @@ mod test { method_name: function_name.to_string(), input: SchemaValue::Record { fields: request }, principal: Principal::anonymous(), + scope_card: None, }; self.add( OplogEntry::AgentInvocationStarted { @@ -2117,6 +2200,7 @@ mod test { trace_id: TraceId::generate(), trace_states: vec![], invocation_context: vec![], + wallet_pin: None, }, move |mut status| { status.current_idempotency_key = Some(idempotency_key); @@ -2221,6 +2305,7 @@ mod test { data: OplogPayload::Inline(Box::new(vec![])), mime_type: "application/octet-stream".to_string(), active_cards: Vec::new(), + wallet_generation: 0, }, move |mut status| { status.last_automatic_snapshot_index = Some(oplog_idx); @@ -3207,6 +3292,7 @@ mod test { timestamp: Timestamp::now_utc(), queued_event_index: OplogIndex::from_u64(1), card_id, + wallet_generation: None, }, )]); @@ -3273,7 +3359,7 @@ mod test { ), ( OplogIndex::from_u64(2), - OplogEntry::card_revoked(OplogIndex::from_u64(1), card_id), + OplogEntry::card_revoked(OplogIndex::from_u64(1), card_id, None), ), ]); @@ -3289,6 +3375,690 @@ mod test { assert!(status.revoked_cards.contains(&card_id)); } + #[test] + fn card_revoked_cascade_records_every_revoked_card() { + let first_card_id = golem_common::model::card::CardId::new(); + let second_card_id = golem_common::model::card::CardId::new(); + let entries = BTreeMap::from([( + OplogIndex::from_u64(1), + OplogEntry::CardRevokedCascade { + timestamp: Timestamp::now_utc(), + revoked_card_ids: vec![first_card_id, second_card_id], + affected_wallets: Vec::new(), + local_wallet_generation: None, + }, + )]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert!(status.revoked_cards.contains(&first_card_id)); + assert!(status.revoked_cards.contains(&second_card_id)); + } + + #[test] + fn installing_reused_card_id_clears_prior_revocation_status() { + let card_id = golem_common::model::card::CardId::new(); + let revoked = BTreeMap::from([( + OplogIndex::from_u64(1), + OplogEntry::CardRevokedCascade { + timestamp: Timestamp::now_utc(), + revoked_card_ids: vec![card_id], + affected_wallets: Vec::new(), + local_wallet_generation: Some(1), + }, + )]); + let status_after_revoke = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + revoked, + &RetryConfig::default(), + ) + .unwrap(); + assert!(status_after_revoke.revoked_cards.contains(&card_id)); + + let installed = BTreeMap::from([( + OplogIndex::from_u64(2), + OplogEntry::card_installed(None, test_card(card_id).into(), Some(2)), + )]); + let status_after_install = super::update_status_with_new_entries( + AgentMode::Durable, + status_after_revoke, + installed, + &RetryConfig::default(), + ) + .unwrap(); + + assert!( + !status_after_install.revoked_cards.contains(&card_id), + "a successful installation of a new live card incarnation must permit a later revocation to be queued for that card ID" + ); + } + + #[test] + fn card_revoked_cascade_completes_every_matching_pending_revoke() { + let first_card_id = golem_common::model::card::CardId::new(); + let second_card_id = golem_common::model::card::CardId::new(); + let unrelated_card_id = golem_common::model::card::CardId::new(); + let entries = BTreeMap::from([ + ( + OplogIndex::from_u64(1), + OplogEntry::card_event_queued(QueuedCardEvent::revoke(first_card_id)), + ), + ( + OplogIndex::from_u64(2), + OplogEntry::card_event_queued(QueuedCardEvent::revoke(second_card_id)), + ), + ( + OplogIndex::from_u64(3), + OplogEntry::card_event_queued(QueuedCardEvent::revoke(unrelated_card_id)), + ), + ( + OplogIndex::from_u64(4), + OplogEntry::CardRevokedCascade { + timestamp: Timestamp::now_utc(), + revoked_card_ids: vec![first_card_id, second_card_id], + affected_wallets: Vec::new(), + local_wallet_generation: Some(1), + }, + ), + ]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert_eq!(status.pending_card_events.len(), 1); + assert_eq!( + status.pending_card_events[0].event, + QueuedCardEvent::revoke(unrelated_card_id) + ); + assert!(status.revoked_cards.contains(&first_card_id)); + assert!(status.revoked_cards.contains(&second_card_id)); + } + + #[test] + fn reverted_card_revoked_cascade_still_records_revoked_cards() { + let card_id = golem_common::model::card::CardId::new(); + let entries = BTreeMap::from([ + ( + OplogIndex::from_u64(1), + OplogEntry::CardRevokedCascade { + timestamp: Timestamp::now_utc(), + revoked_card_ids: vec![card_id], + affected_wallets: Vec::new(), + local_wallet_generation: None, + }, + ), + ( + OplogIndex::from_u64(2), + OplogEntry::revert(OplogRegion { + start: OplogIndex::from_u64(1), + end: OplogIndex::from_u64(1), + }), + ), + ]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert!(status.revoked_cards.contains(&card_id)); + } + + #[test] + fn card_transfer_confirmed_removes_only_the_matching_pending_transfer() { + use golem_common::model::card::{AgentCardHolder, CardHolder}; + + let transferred_card = test_card(golem_common::model::card::CardId::new()); + let pending_card = test_card(golem_common::model::card::CardId::new()); + let completed_transfer_id = uuid::Uuid::new_v4(); + let pending_transfer_id = uuid::Uuid::new_v4(); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: golem_common::model::AgentId { + component_id: golem_common::model::component::ComponentId(uuid::Uuid::new_v4()), + agent_id: "card-transfer-target".to_string(), + }, + }); + let entries = BTreeMap::from([ + ( + OplogIndex::from_u64(1), + OplogEntry::card_event_queued(QueuedCardEvent::transfer_started( + completed_transfer_id, + transferred_card.clone(), + target_holder.clone(), + )), + ), + ( + OplogIndex::from_u64(2), + OplogEntry::card_event_queued(QueuedCardEvent::transfer_started( + pending_transfer_id, + pending_card.clone(), + target_holder.clone(), + )), + ), + ( + OplogIndex::from_u64(3), + OplogEntry::card_transfer_confirmed( + completed_transfer_id, + transferred_card.card_id, + transferred_card.card_id, + target_holder.clone(), + ), + ), + ]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert_eq!(status.pending_card_events.len(), 1); + assert_eq!( + status.pending_card_events[0].oplog_index, + OplogIndex::from_u64(2) + ); + assert!(matches!( + &status.pending_card_events[0].event, + QueuedCardEvent::TransferStarted(event) + if event.transfer_id == pending_transfer_id + && event.card_id == pending_card.card_id + && event.card.as_ref() == Some(&pending_card.clone().into()) + && event.target_holder == target_holder + )); + } + + #[test] + fn polymorphic_transfer_confirmation_matches_source_and_installed_child_ids() { + use golem_common::model::card::{AgentCardHolder, CardHolder}; + + let source_card_id = golem_common::model::card::CardId::new(); + let installed_child = test_card(golem_common::model::card::CardId::new()); + let transfer_id = uuid::Uuid::new_v4(); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: golem_common::model::AgentId { + component_id: golem_common::model::component::ComponentId(uuid::Uuid::new_v4()), + agent_id: "polymorphic-card-transfer-target".to_string(), + }, + }); + let entries = BTreeMap::from([ + ( + OplogIndex::from_u64(1), + OplogEntry::card_event_queued(QueuedCardEvent::transfer_started_with_source( + transfer_id, + source_card_id, + installed_child.clone(), + target_holder.clone(), + )), + ), + ( + OplogIndex::from_u64(2), + OplogEntry::card_transfer_confirmed( + transfer_id, + source_card_id, + installed_child.card_id, + target_holder, + ), + ), + ]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert!(status.pending_card_events.is_empty()); + } + + #[test] + fn polymorphic_transfer_confirmation_with_conflicting_source_keeps_pending_intent() { + use golem_common::model::card::{AgentCardHolder, CardHolder}; + + let source_card_id = golem_common::model::card::CardId::new(); + let installed_child = test_card(golem_common::model::card::CardId::new()); + let transfer_id = uuid::Uuid::new_v4(); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: golem_common::model::AgentId { + component_id: golem_common::model::component::ComponentId(uuid::Uuid::new_v4()), + agent_id: "polymorphic-card-transfer-target".to_string(), + }, + }); + let entries = BTreeMap::from([ + ( + OplogIndex::from_u64(1), + OplogEntry::card_event_queued(QueuedCardEvent::transfer_started_with_source( + transfer_id, + source_card_id, + installed_child.clone(), + target_holder.clone(), + )), + ), + ( + OplogIndex::from_u64(2), + OplogEntry::card_transfer_confirmed( + transfer_id, + golem_common::model::card::CardId::new(), + installed_child.card_id, + target_holder, + ), + ), + ]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert_eq!(status.pending_card_events.len(), 1); + } + + #[test] + fn received_card_transfer_is_reconstructed_as_a_distinct_target_receipt() { + let card = test_card(golem_common::model::card::CardId::new()); + let transfer_id = uuid::Uuid::new_v4(); + let source_card_id = golem_common::model::card::CardId::new(); + let entries = BTreeMap::from([( + OplogIndex::from_u64(1), + OplogEntry::card_event_queued(QueuedCardEvent::transfer_received( + transfer_id, + source_card_id, + card.clone(), + )), + )]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert_eq!(status.pending_card_events.len(), 1); + assert!(matches!( + &status.pending_card_events[0].event, + QueuedCardEvent::TransferReceived(receipt) + if receipt.transfer_id == transfer_id + && receipt.source_card_id == Some(source_card_id) + && receipt.card_id == card.card_id + && receipt.card.as_ref() == Some(&card.into()) + )); + } + + #[test] + fn target_card_transferred_clears_only_its_matching_receipt() { + use golem_common::model::card::{AgentCardHolder, CardHolder}; + + let card = test_card(golem_common::model::card::CardId::new()); + let source_card_id = golem_common::model::card::CardId::new(); + let transfer_id = uuid::Uuid::new_v4(); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: golem_common::model::AgentId { + component_id: golem_common::model::component::ComponentId(uuid::Uuid::new_v4()), + agent_id: "card-transfer-target".to_string(), + }, + }); + let entries = BTreeMap::from([ + ( + OplogIndex::from_u64(1), + OplogEntry::card_event_queued(QueuedCardEvent::transfer_received( + transfer_id, + source_card_id, + card.clone(), + )), + ), + ( + OplogIndex::from_u64(2), + OplogEntry::card_transferred( + transfer_id, + Some(source_card_id), + card.card_id, + target_holder, + card.into(), + Some(7), + ), + ), + ]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert!(status.pending_card_events.is_empty()); + } + + #[test] + fn legacy_target_card_transferred_clears_its_matching_receipt() { + use golem_common::model::card::{AgentCardHolder, CardHolder}; + + let card = test_card(golem_common::model::card::CardId::new()); + let source_card_id = golem_common::model::card::CardId::new(); + let transfer_id = uuid::Uuid::new_v4(); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: golem_common::model::AgentId { + component_id: golem_common::model::component::ComponentId(uuid::Uuid::new_v4()), + agent_id: "card-transfer-target".to_string(), + }, + }); + let entries = BTreeMap::from([ + ( + OplogIndex::from_u64(1), + OplogEntry::card_event_queued(QueuedCardEvent::transfer_received( + transfer_id, + source_card_id, + card.clone(), + )), + ), + ( + OplogIndex::from_u64(2), + OplogEntry::card_transferred( + transfer_id, + None, + card.card_id, + target_holder, + card.into(), + None, + ), + ), + ]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert!(status.pending_card_events.is_empty()); + } + + #[test] + fn target_card_transferred_with_conflicting_source_keeps_the_receipt() { + use golem_common::model::card::{AgentCardHolder, CardHolder}; + + let card = test_card(golem_common::model::card::CardId::new()); + let source_card_id = golem_common::model::card::CardId::new(); + let transfer_id = uuid::Uuid::new_v4(); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: golem_common::model::AgentId { + component_id: golem_common::model::component::ComponentId(uuid::Uuid::new_v4()), + agent_id: "card-transfer-target".to_string(), + }, + }); + let entries = BTreeMap::from([ + ( + OplogIndex::from_u64(1), + OplogEntry::card_event_queued(QueuedCardEvent::transfer_received( + transfer_id, + source_card_id, + card.clone(), + )), + ), + ( + OplogIndex::from_u64(2), + OplogEntry::card_transferred( + transfer_id, + Some(golem_common::model::card::CardId::new()), + card.card_id, + target_holder, + card.clone().into(), + Some(7), + ), + ), + ]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert_eq!(status.pending_card_events.len(), 1); + assert!(matches!( + &status.pending_card_events[0].event, + QueuedCardEvent::TransferReceived(receipt) + if receipt.transfer_id == transfer_id + && receipt.source_card_id == Some(source_card_id) + && receipt.card.as_ref() == Some(&card.into()) + )); + } + + #[test] + fn card_transfer_confirmed_with_conflicting_source_card_keeps_pending_transfer() { + use golem_common::model::card::{AgentCardHolder, CardHolder}; + + let pending_card = test_card(golem_common::model::card::CardId::new()); + let conflicting_card = test_card(golem_common::model::card::CardId::new()); + let transfer_id = uuid::Uuid::new_v4(); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: golem_common::model::AgentId { + component_id: golem_common::model::component::ComponentId(uuid::Uuid::new_v4()), + agent_id: "card-transfer-target".to_string(), + }, + }); + let entries = BTreeMap::from([ + ( + OplogIndex::from_u64(1), + OplogEntry::card_event_queued(QueuedCardEvent::transfer_started( + transfer_id, + pending_card.clone(), + target_holder.clone(), + )), + ), + ( + OplogIndex::from_u64(2), + OplogEntry::card_transfer_confirmed( + transfer_id, + conflicting_card.card_id, + conflicting_card.card_id, + target_holder, + ), + ), + ]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert_eq!(status.pending_card_events.len(), 1); + assert!(matches!( + &status.pending_card_events[0].event, + QueuedCardEvent::TransferStarted(event) + if event.transfer_id == transfer_id + && event.card_id == pending_card.card_id + && event.card.as_ref() == Some(&pending_card.clone().into()) + )); + } + + #[test] + fn card_install_failure_does_not_clear_pending_transfer() { + use golem_common::model::card::{AgentCardHolder, CardHolder}; + + let card = test_card(golem_common::model::card::CardId::new()); + let transfer_id = uuid::Uuid::new_v4(); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: golem_common::model::AgentId { + component_id: golem_common::model::component::ComponentId(uuid::Uuid::new_v4()), + agent_id: "card-transfer-target".to_string(), + }, + }); + let entries = BTreeMap::from([ + ( + OplogIndex::from_u64(1), + OplogEntry::card_event_queued(QueuedCardEvent::transfer_started( + transfer_id, + card.clone(), + target_holder.clone(), + )), + ), + ( + OplogIndex::from_u64(2), + OplogEntry::card_install_failed( + OplogIndex::from_u64(1), + card.card_id, + golem_common::base_model::oplog::CardInstallFailure::NotFound, + ), + ), + ]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert_eq!(status.pending_card_events.len(), 1); + assert_eq!( + status.pending_card_events[0].oplog_index, + OplogIndex::from_u64(1) + ); + assert!(matches!( + &status.pending_card_events[0].event, + QueuedCardEvent::TransferStarted(event) + if event.transfer_id == transfer_id + && event.card_id == card.card_id + && event.card.as_ref() == Some(&card.clone().into()) + && event.target_holder == target_holder + )); + } + + #[test] + fn target_card_transferred_does_not_clear_source_pending_transfer() { + use golem_common::model::card::{AgentCardHolder, CardHolder}; + + let card = test_card(golem_common::model::card::CardId::new()); + let transfer_id = uuid::Uuid::new_v4(); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: golem_common::model::AgentId { + component_id: golem_common::model::component::ComponentId(uuid::Uuid::new_v4()), + agent_id: "card-transfer-target".to_string(), + }, + }); + let entries = BTreeMap::from([ + ( + OplogIndex::from_u64(1), + OplogEntry::card_event_queued(QueuedCardEvent::transfer_started( + transfer_id, + card.clone(), + target_holder.clone(), + )), + ), + ( + OplogIndex::from_u64(2), + OplogEntry::card_transferred( + transfer_id, + Some(card.card_id), + card.card_id, + target_holder, + card.clone().into(), + None, + ), + ), + ]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert_eq!(status.pending_card_events.len(), 1); + assert!(matches!( + &status.pending_card_events[0].event, + QueuedCardEvent::TransferStarted(event) + if event.transfer_id == transfer_id + && event.card_id == card.card_id + && event.card.as_ref() == Some(&card.clone().into()) + )); + } + + #[test] + fn reverted_card_transfer_confirmation_still_closes_pending_transfer() { + use golem_common::model::card::{AgentCardHolder, CardHolder}; + + let card = test_card(golem_common::model::card::CardId::new()); + let transfer_id = uuid::Uuid::new_v4(); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: golem_common::model::AgentId { + component_id: golem_common::model::component::ComponentId(uuid::Uuid::new_v4()), + agent_id: "card-transfer-target".to_string(), + }, + }); + let entries = BTreeMap::from([ + ( + OplogIndex::from_u64(1), + OplogEntry::card_event_queued(QueuedCardEvent::transfer_started( + transfer_id, + card.clone(), + target_holder.clone(), + )), + ), + ( + OplogIndex::from_u64(2), + OplogEntry::card_transfer_confirmed( + transfer_id, + card.card_id, + card.card_id, + target_holder, + ), + ), + ( + OplogIndex::from_u64(3), + OplogEntry::revert(OplogRegion { + start: OplogIndex::from_u64(2), + end: OplogIndex::from_u64(2), + }), + ), + ]); + + let status = super::update_status_with_new_entries( + AgentMode::Durable, + AgentStatusRecord::default(), + entries, + &RetryConfig::default(), + ) + .unwrap(); + + assert!(status.pending_card_events.is_empty()); + } + #[test] fn card_revoked_removes_only_matching_pending_revoke_index() { let card_id = golem_common::model::card::CardId::new(); @@ -3303,7 +4073,7 @@ mod test { ), ( OplogIndex::from_u64(3), - OplogEntry::card_revoked(OplogIndex::from_u64(1), card_id), + OplogEntry::card_revoked(OplogIndex::from_u64(1), card_id, None), ), ]); @@ -3358,7 +4128,7 @@ mod test { ), ( OplogIndex::from_u64(2), - OplogEntry::card_installed(Some(OplogIndex::from_u64(1)), card.into()), + OplogEntry::card_installed(Some(OplogIndex::from_u64(1)), card.into(), None), ), ]); @@ -3442,7 +4212,7 @@ mod test { ), ( OplogIndex::from_u64(2), - OplogEntry::card_installed(Some(OplogIndex::from_u64(1)), card.into()), + OplogEntry::card_installed(Some(OplogIndex::from_u64(1)), card.into(), None), ), ( OplogIndex::from_u64(3), @@ -3474,6 +4244,7 @@ mod test { timestamp: Timestamp::now_utc(), queued_event_index: OplogIndex::from_u64(1), card_id, + wallet_generation: None, }, ), ( diff --git a/golem-worker-executor/src/workerctx/default.rs b/golem-worker-executor/src/workerctx/default.rs index 8272256b32..e73320ef6d 100644 --- a/golem-worker-executor/src/workerctx/default.rs +++ b/golem-worker-executor/src/workerctx/default.rs @@ -420,6 +420,10 @@ impl InvocationHooks for Context { .await } + async fn on_agent_invocation_finished(&mut self) { + self.durable_ctx.on_agent_invocation_finished().await + } + async fn on_invocation_failure( &mut self, full_function_name: &str, @@ -647,9 +651,10 @@ impl HostWasmRpc for Context { self_: Resource, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result> { self.durable_ctx - .invoke_and_await(self_, method_name, input) + .invoke_and_await(self_, method_name, input, scope_card) .await } @@ -658,8 +663,11 @@ impl HostWasmRpc for Context { self_: Resource, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result> { - self.durable_ctx.invoke(self_, method_name, input).await + self.durable_ctx + .invoke(self_, method_name, input, scope_card) + .await } async fn async_invoke_and_await( @@ -667,9 +675,10 @@ impl HostWasmRpc for Context { self_: Resource, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result { self.durable_ctx - .async_invoke_and_await(self_, method_name, input) + .async_invoke_and_await(self_, method_name, input, scope_card) .await } @@ -679,9 +688,10 @@ impl HostWasmRpc for Context { scheduled_time: wasmtime_wasi::p3::bindings::clocks::system_clock::Instant, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result { self.durable_ctx - .schedule_invocation(self_, scheduled_time, method_name, input) + .schedule_invocation(self_, scheduled_time, method_name, input, scope_card) .await } @@ -691,9 +701,10 @@ impl HostWasmRpc for Context { scheduled_time: wasmtime_wasi::p3::bindings::clocks::system_clock::Instant, method_name: String, input: golem_schema::schema::wit::wire::SchemaValueTree, + scope_card: Option>, ) -> anyhow::Result { self.durable_ctx - .schedule_cancelable_invocation(self_, scheduled_time, method_name, input) + .schedule_cancelable_invocation(self_, scheduled_time, method_name, input, scope_card) .await } diff --git a/golem-worker-executor/src/workerctx/mod.rs b/golem-worker-executor/src/workerctx/mod.rs index 5403220cdc..046d8ba831 100644 --- a/golem-worker-executor/src/workerctx/mod.rs +++ b/golem-worker-executor/src/workerctx/mod.rs @@ -334,6 +334,9 @@ pub trait InvocationHooks { invocation: AgentInvocation, ) -> Result<(), WorkerExecutorError>; + /// Clears invocation-scoped runtime state after the guest call returns or traps. + async fn on_agent_invocation_finished(&mut self); + /// Called when a worker invocation fails async fn on_invocation_failure( &mut self, diff --git a/golem-worker-executor/tests/agent.rs b/golem-worker-executor/tests/agent.rs index a1e48beb01..09d3129b09 100644 --- a/golem-worker-executor/tests/agent.rs +++ b/golem-worker-executor/tests/agent.rs @@ -405,6 +405,7 @@ async fn immediate_scheduled_ephemeral_invocation_reuses_completed_result( freshness_disposition: workerexecutor::v1::InvocationFreshnessDisposition::MayExist as i32, config: Vec::new(), + scope_card: None, }) .await?; @@ -455,6 +456,7 @@ async fn ephemeral_invocation_lookup_does_not_create_unknown_agent( freshness_disposition: workerexecutor::v1::InvocationFreshnessDisposition::MayExist as i32, config: Vec::new(), + scope_card: None, }) .await? .into_inner(); @@ -522,6 +524,7 @@ async fn scheduled_ephemeral_invocation_uses_schedule_time_component_revision( freshness_disposition: workerexecutor::v1::InvocationFreshnessDisposition::MayExist as i32, config: Vec::new(), + scope_card: None, }) .await?; diff --git a/golem-worker-executor/tests/api.rs b/golem-worker-executor/tests/api.rs index 6d8964fbf1..d625954737 100644 --- a/golem-worker-executor/tests/api.rs +++ b/golem-worker-executor/tests/api.rs @@ -14,32 +14,45 @@ use crate::Tracing; use anyhow::anyhow; +use async_trait::async_trait; use axum::Router; use axum::routing::get; +use chrono::{DateTime, Utc}; +use golem_api_grpc::proto::golem::worker::UpdateMode; use golem_common::model::account::AccountId; +use golem_common::model::agent::{AgentInvocationMode, InvocationFreshnessDisposition, Principal}; +use golem_common::model::card::{CardId, ScopeCard, StoredCard}; use golem_common::model::component::{ComponentDto, ComponentId, ComponentRevision}; +use golem_common::model::environment::EnvironmentId; +use golem_common::model::invocation_context::InvocationContextStack; use golem_common::model::oplog::OplogIndex; -use golem_common::model::worker::AgentMetadataDto; +use golem_common::model::worker::{ + AgentConfigEntryDto, AgentMetadataDto, RevertToOplogIndex, RevertWorkerTarget, +}; use golem_common::model::{ - AgentFilter, AgentId, AgentStatus, FilterComparator, IdempotencyKey, PromiseId, RetryConfig, - ScanCursor, StringFilterComparator, + AgentFilter, AgentFingerprint, AgentId, AgentInvocationOutput, AgentStatus, FilterComparator, + IdempotencyKey, OwnedAgentId, PromiseId, RetryConfig, ScanCursor, StringFilterComparator, }; use golem_common::schema::SchemaValue; use golem_common::schema::schema_value::{ResultValuePayload, VariantValuePayload}; use golem_common::{agent_id, data_value}; use golem_service_base::error::worker_executor::WorkerExecutorError; +use golem_service_base::model::auth::AuthCtx; use golem_test_framework::dsl::TestDsl; use golem_test_framework::dsl::{drain_connection, stdout_event_matching, stdout_events}; +use golem_worker_executor::services::worker_proxy::{WorkerProxy, WorkerProxyError}; use golem_worker_executor_test_utils::{ LastUniqueId, PrecompiledComponent, TestContext, TestExecutorOverrides, TestWorkerExecutor, - WorkerExecutorTestDependencies, start, start_customized, start_with_overrides, - start_with_redis_storage, + WorkerExecutorTestDependencies, registry_test_card, start, start_customized, + start_with_overrides, start_with_redis_storage, }; use pretty_assertions::assert_eq; use redis::Commands; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; +use std::future::Future; use std::io::Write; +use std::pin::Pin; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Arc, Mutex}; @@ -113,6 +126,1381 @@ async fn dropping_executor_releases_services( Ok(()) } +async fn deliver_card_transfer( + executor: &TestWorkerExecutor, + request: golem_api_grpc::proto::golem::workerexecutor::v1::DeliverCardTransferRequest, +) -> anyhow::Result> { + use golem_api_grpc::proto::golem::workerexecutor::v1::deliver_card_transfer_response; + + let response = executor + .client + .clone() + .deliver_card_transfer(request) + .await? + .into_inner(); + match response.result { + Some(deliver_card_transfer_response::Result::Success(_)) => Ok(Ok(())), + Some(deliver_card_transfer_response::Result::Failure(error)) => Ok(Err( + WorkerExecutorError::try_from(error).map_err(|error| anyhow!(error))?, + )), + None => Err(anyhow!("permission card delivery returned no result")), + } +} + +async fn get_agent_wallet_cards( + executor: &TestWorkerExecutor, + agent_id: &AgentId, +) -> anyhow::Result>> { + use golem_api_grpc::proto::golem::workerexecutor::v1::{ + GetAgentWalletRequest, get_agent_wallet_response, + }; + + let response = executor + .client + .clone() + .get_agent_wallet(GetAgentWalletRequest { + agent_id: Some(agent_id.clone().into()), + component_owner_account_id: Some(executor.context.account_id.into()), + environment_id: Some(executor.context.default_environment_id.into()), + auth_ctx: Some(executor.auth_ctx().into()), + principal: None, + }) + .await? + .into_inner(); + match response.result { + Some(get_agent_wallet_response::Result::Success(success)) => Ok(success.wallet_cards), + Some(get_agent_wallet_response::Result::Failure(error)) => { + Err(anyhow!("failed to read agent wallet: {error:?}")) + } + None => Err(anyhow!("get agent wallet returned no result")), + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +struct RecordedCardTransfer { + target_agent_id: AgentId, + environment_id: EnvironmentId, + transfer_id: uuid::Uuid, + source_card_id: CardId, + card: StoredCard, +} + +type LocalCardTransferDelivery = dyn Fn( + AgentId, + EnvironmentId, + uuid::Uuid, + CardId, + StoredCard, + ) -> Pin> + Send>> + + Send + + Sync; + +struct RecordingWorkerProxy { + inner: Arc, + transfers: Arc>>, + forward_transfers: bool, + lost_response_transfer_ids: Arc>>, + local_delivery: Option>>>>, +} + +#[async_trait] +impl WorkerProxy for RecordingWorkerProxy { + async fn start( + &self, + owned_agent_id: &OwnedAgentId, + caller_agent_id: &AgentId, + caller_env: HashMap, + caller_stack: InvocationContextStack, + config: Vec, + principal: Principal, + auth_ctx: &AuthCtx, + ) -> Result { + self.inner + .start( + owned_agent_id, + caller_agent_id, + caller_env, + caller_stack, + config, + principal, + auth_ctx, + ) + .await + } + + async fn invoke_agent( + &self, + agent_id: &AgentId, + method_name: String, + method_parameters: SchemaValue, + mode: AgentInvocationMode, + schedule_at: Option>, + idempotency_key: Option, + freshness_disposition: InvocationFreshnessDisposition, + caller_agent_id: AgentId, + caller_env: HashMap, + caller_stack: InvocationContextStack, + config: Vec, + principal: Principal, + environment_id: EnvironmentId, + auth_ctx: &AuthCtx, + scope_card: Option, + ) -> Result { + self.inner + .invoke_agent( + agent_id, + method_name, + method_parameters, + mode, + schedule_at, + idempotency_key, + freshness_disposition, + caller_agent_id, + caller_env, + caller_stack, + config, + principal, + environment_id, + auth_ctx, + scope_card, + ) + .await + } + + async fn deliver_card_transfer( + &self, + target_agent_id: &AgentId, + environment_id: EnvironmentId, + transfer_id: uuid::Uuid, + source_card_id: CardId, + card: &StoredCard, + ) -> Result<(), WorkerProxyError> { + self.transfers.lock().unwrap().push(RecordedCardTransfer { + target_agent_id: target_agent_id.clone(), + environment_id, + transfer_id, + source_card_id, + card: card.clone(), + }); + if !self.forward_transfers { + return Ok(()); + } + + let result = if let Some(local_delivery) = &self.local_delivery { + let local_delivery = local_delivery.lock().unwrap().clone().ok_or_else(|| { + WorkerProxyError::InternalError(WorkerExecutorError::runtime( + "local card-transfer delivery is not connected", + )) + })?; + local_delivery( + target_agent_id.clone(), + environment_id, + transfer_id, + source_card_id, + card.clone(), + ) + .await + } else { + self.inner + .deliver_card_transfer( + target_agent_id, + environment_id, + transfer_id, + source_card_id, + card, + ) + .await + }; + if result.is_ok() + && self + .lost_response_transfer_ids + .lock() + .unwrap() + .remove(&transfer_id) + { + Err(WorkerProxyError::InternalError( + WorkerExecutorError::runtime("simulated lost card-transfer response"), + )) + } else { + result + } + } + + async fn update( + &self, + owned_agent_id: &OwnedAgentId, + target_revision: ComponentRevision, + mode: UpdateMode, + disable_wakeup: bool, + auth_ctx: &AuthCtx, + ) -> Result<(), WorkerProxyError> { + self.inner + .update( + owned_agent_id, + target_revision, + mode, + disable_wakeup, + auth_ctx, + ) + .await + } + + async fn resume( + &self, + owned_agent_id: &AgentId, + force: bool, + auth_ctx: &AuthCtx, + ) -> Result<(), WorkerProxyError> { + self.inner.resume(owned_agent_id, force, auth_ctx).await + } + + async fn fork_worker( + &self, + source_agent_id: &AgentId, + target_agent_id: &AgentId, + oplog_index_cutoff: &OplogIndex, + auth_ctx: &AuthCtx, + ) -> Result<(), WorkerProxyError> { + self.inner + .fork_worker( + source_agent_id, + target_agent_id, + oplog_index_cutoff, + auth_ctx, + ) + .await + } + + async fn revert( + &self, + agent_id: &AgentId, + target: RevertWorkerTarget, + auth_ctx: &AuthCtx, + ) -> Result<(), WorkerProxyError> { + self.inner.revert(agent_id, target, auth_ctx).await + } + + async fn complete_promise( + &self, + promise_id: PromiseId, + data: Vec, + auth_ctx: &AuthCtx, + ) -> Result { + self.inner + .complete_promise(promise_id, data, auth_ctx) + .await + } + + async fn cancel_invocation( + &self, + agent_id: &AgentId, + idempotency_key: IdempotencyKey, + auth_ctx: &AuthCtx, + ) -> Result { + self.inner + .cancel_invocation(agent_id, idempotency_key, auth_ctx) + .await + } + + async fn lookup_invocation_status( + &self, + agent_id: &AgentId, + idempotency_key: IdempotencyKey, + environment_id: Option, + auth_ctx: &AuthCtx, + ) -> Result { + self.inner + .lookup_invocation_status(agent_id, idempotency_key, environment_id, auth_ctx) + .await + } + + async fn process_oplog_entries( + &self, + target_agent_id: &AgentId, + environment_id: EnvironmentId, + component_revision: ComponentRevision, + idempotency_key: IdempotencyKey, + account_id: AccountId, + config: Vec<(String, String)>, + metadata: golem_api_grpc::proto::golem::worker::AgentMetadata, + first_entry_index: OplogIndex, + entries: Vec, + auth_ctx: &AuthCtx, + ) -> Result<(), WorkerProxyError> { + self.inner + .process_oplog_entries( + target_agent_id, + environment_id, + component_revision, + idempotency_key, + account_id, + config, + metadata, + first_entry_index, + entries, + auth_ctx, + ) + .await + } +} + +fn connect_local_card_transfer_delivery( + local_delivery: &Arc>>>, + executor: &TestWorkerExecutor, +) { + let client = executor.client.clone(); + *local_delivery.lock().unwrap() = Some(Arc::new( + move |target_agent_id, environment_id, transfer_id, source_card_id, card| { + let mut client = client.clone(); + Box::pin(async move { + use golem_api_grpc::proto::golem::workerexecutor::v1::{ + DeliverCardTransferRequest, deliver_card_transfer_response, + }; + + let response = client + .deliver_card_transfer(DeliverCardTransferRequest { + target_agent_id: Some(target_agent_id.into()), + environment_id: Some(environment_id.into()), + transfer_id: Some(transfer_id.into()), + card: desert_rust::serialize_to_byte_vec(&card).map_err(|error| { + WorkerProxyError::InternalError(WorkerExecutorError::unknown(format!( + "failed to serialize local card transfer: {error}" + ))) + })?, + auth_ctx: Some(AuthCtx::System.into()), + source_card_id: Some(source_card_id.0.into()), + }) + .await? + .into_inner(); + match response.result { + Some(deliver_card_transfer_response::Result::Success(_)) => Ok(()), + Some(deliver_card_transfer_response::Result::Failure(error)) => { + Err(WorkerProxyError::InternalError( + WorkerExecutorError::try_from(error).map_err(|error| { + WorkerProxyError::InternalError(WorkerExecutorError::unknown(error)) + })?, + )) + } + None => Err(WorkerProxyError::InternalError( + WorkerExecutorError::unknown( + "local permission-card delivery returned no result", + ), + )), + } + }) + }, + )); +} + +#[test] +#[tracing::instrument] +#[timeout("8m")] +async fn card_transfer_recipient_mismatch_does_not_create_target( + last_unique_id: &LastUniqueId, + deps: &WorkerExecutorTestDependencies, + #[tagged_as("agent_counters")] agent_counters: &PrecompiledComponent, + _tracing: &Tracing, +) -> anyhow::Result<()> { + use golem_api_grpc::proto::golem::workerexecutor::v1::DeliverCardTransferRequest; + use golem_common::model::card::{Card, CardId, StoredCard, parse_permission_fields}; + use golem_service_base::model::auth::AuthCtx; + use golem_worker_executor::grpc::PERMISSION_CARD_INSTALL_RECIPIENT_MISMATCH; + + let context = TestContext::new(last_unique_id); + let executor = start(deps, &context).await?; + let component = executor + .component_dep(&context.default_environment_id, agent_counters) + .store() + .await?; + let target_agent_id = AgentId { + component_id: component.id, + agent_id: agent_id!("Counter", "recipient-mismatch-new-target").to_string(), + }; + assert_eq!( + executor.get_worker_metadata_opt(&target_agent_id).await?, + None + ); + + let card = StoredCard::Concrete(Card { + card_id: CardId::new(), + parent_ids: vec![], + lower_positive: vec![parse_permission_fields( + "card", + "*", + "nobody@example.com/*/*/*/*", + "inspect", + "*", + )?], + lower_negative: vec![], + upper_positive: vec![], + upper_negative: vec![], + created_at: chrono::Utc::now(), + expires_at: None, + system_card: false, + managed_by: None, + }); + + assert_eq!( + deliver_card_transfer( + &executor, + DeliverCardTransferRequest { + target_agent_id: Some(target_agent_id.clone().into()), + environment_id: Some(context.default_environment_id.into()), + transfer_id: Some(uuid::Uuid::new_v4().into()), + card: desert_rust::serialize_to_byte_vec(&card)?, + auth_ctx: Some(AuthCtx::System.into()), + source_card_id: Some(CardId::new().0.into()), + }, + ) + .await?, + Err(WorkerExecutorError::invalid_request( + PERMISSION_CARD_INSTALL_RECIPIENT_MISMATCH + )) + ); + assert_eq!( + executor.get_worker_metadata_opt(&target_agent_id).await?, + None, + "recipient validation must happen before creating or mutating the target" + ); + + Ok(()) +} + +#[test] +#[tracing::instrument] +#[timeout("8m")] +async fn card_transfer_delivery_is_durable_idempotent_and_rejects_payload_conflicts( + last_unique_id: &LastUniqueId, + deps: &WorkerExecutorTestDependencies, + #[tagged_as("agent_counters")] agent_counters: &PrecompiledComponent, + _tracing: &Tracing, +) -> anyhow::Result<()> { + use futures::future::join_all; + use golem_api_grpc::proto::golem::workerexecutor::v1::DeliverCardTransferRequest; + use golem_common::base_model::oplog::{PublicQueuedCardEvent, QueuedCardEvent}; + use golem_common::model::card::{ + CardId, EffectiveSurface, StoredCard, parse_permission_fields, + }; + use golem_common::model::oplog::{PublicOplogEntry, PublicOplogEntryWithIndex}; + use golem_service_base::model::auth::{AuthCtx, UserAuthCtx}; + use golem_worker_executor::grpc::{ + PERMISSION_CARD_INSTALL_RECIPIENT_MISMATCH, PERMISSION_CARD_TRANSFER_PAYLOAD_CONFLICT, + }; + + let context = TestContext::new(last_unique_id); + let executor = start(deps, &context).await?; + let component = executor + .component_dep(&context.default_environment_id, agent_counters) + .store() + .await?; + let target_agent_id = executor + .start_agent( + &component.id, + agent_id!("Counter", "permission-transfer-target"), + ) + .await?; + let mut wallet_before = get_agent_wallet_cards(&executor, &target_agent_id).await?; + wallet_before.sort(); + let oplog_before = executor.oplog_max_index(&target_agent_id).await?; + + let transfer_id = uuid::Uuid::new_v4(); + let source_card_id = CardId::new(); + let card = registry_test_card(); + let request = DeliverCardTransferRequest { + target_agent_id: Some(target_agent_id.clone().into()), + environment_id: Some(context.default_environment_id.into()), + transfer_id: Some(transfer_id.into()), + card: desert_rust::serialize_to_byte_vec(&card)?, + auth_ctx: Some(AuthCtx::System.into()), + source_card_id: Some(source_card_id.0.into()), + }; + + assert_eq!( + deliver_card_transfer(&executor, request.clone()).await?, + Ok(()) + ); + assert_eq!( + deliver_card_transfer(&executor, request.clone()).await?, + Ok(()) + ); + + let count_receipts = |entries: &[PublicOplogEntryWithIndex], + expected_transfer_id: uuid::Uuid| { + entries + .iter() + .filter(|entry| { + matches!( + &entry.entry, + PublicOplogEntry::CardEventQueued(params) + if matches!( + ¶ms.event, + PublicQueuedCardEvent::TransferReceived(receipt) + if receipt.transfer_id == expected_transfer_id + ) + ) + }) + .count() + }; + let entries = executor + .get_oplog(&target_agent_id, OplogIndex::INITIAL) + .await?; + assert_eq!(count_receipts(&entries, transfer_id), 1); + + let detached_status_transfer_id = uuid::Uuid::new_v4(); + executor + .commit_oplog_entry_bypassing_worker_status( + &target_agent_id, + golem_common::model::oplog::OplogEntry::card_event_queued( + QueuedCardEvent::transfer_received( + detached_status_transfer_id, + source_card_id, + card.clone(), + ), + ), + ) + .await?; + assert_eq!( + deliver_card_transfer( + &executor, + DeliverCardTransferRequest { + transfer_id: Some(detached_status_transfer_id.into()), + ..request.clone() + }, + ) + .await?, + Ok(()), + "the durable receipt must deduplicate a retry when cached status does not contain it" + ); + let entries = executor + .get_oplog(&target_agent_id, OplogIndex::INITIAL) + .await?; + assert_eq!(count_receipts(&entries, detached_status_transfer_id), 1); + + let mismatching_transfer_id = uuid::Uuid::new_v4(); + let mut mismatching_card = card.clone(); + match &mut mismatching_card { + StoredCard::Concrete(card) => { + card.lower_positive = vec![parse_permission_fields( + "card", + "*", + "nobody@example.com/*/*/*/*", + "inspect", + "*", + )?]; + } + StoredCard::Polymorphic(_) => unreachable!(), + } + assert_eq!( + deliver_card_transfer( + &executor, + DeliverCardTransferRequest { + transfer_id: Some(mismatching_transfer_id.into()), + card: desert_rust::serialize_to_byte_vec(&mismatching_card)?, + ..request.clone() + }, + ) + .await?, + Err(WorkerExecutorError::invalid_request( + PERMISSION_CARD_INSTALL_RECIPIENT_MISMATCH + )) + ); + + let mut conflicting_card = card.clone(); + match &mut conflicting_card { + StoredCard::Concrete(card) => card.system_card = true, + StoredCard::Polymorphic(_) => unreachable!(), + } + let conflicting_request = DeliverCardTransferRequest { + card: desert_rust::serialize_to_byte_vec(&conflicting_card)?, + ..request.clone() + }; + assert_eq!( + deliver_card_transfer(&executor, conflicting_request.clone()).await?, + Err(WorkerExecutorError::invalid_request( + PERMISSION_CARD_TRANSFER_PAYLOAD_CONFLICT + )) + ); + + let non_system_auth = AuthCtx::User(UserAuthCtx { + account_id: context.account_id, + account_email: golem_common::model::account::AccountEmail::new("caller@golem"), + account_plan_id: context.account_plan_id, + account_roles: context.account_roles.clone(), + effective_surface: EffectiveSurface::default(), + delegation_surface: None, + }); + let non_system_transfer_id = uuid::Uuid::new_v4(); + assert!(matches!( + deliver_card_transfer( + &executor, + DeliverCardTransferRequest { + transfer_id: Some(non_system_transfer_id.into()), + auth_ctx: Some(non_system_auth.into()), + ..request.clone() + }, + ) + .await?, + Err(WorkerExecutorError::InvalidRequest { .. }) + )); + let malformed_transfer_id = uuid::Uuid::new_v4(); + assert!(matches!( + deliver_card_transfer( + &executor, + DeliverCardTransferRequest { + transfer_id: Some(malformed_transfer_id.into()), + card: b"not-a-card".to_vec(), + ..request.clone() + }, + ) + .await?, + Err(WorkerExecutorError::InvalidRequest { .. }) + )); + let panicking_payload_transfer_id = uuid::Uuid::new_v4(); + let mut panicking_payload = vec![0, 0, 0]; + panicking_payload.extend_from_slice(&[0; 16]); + panicking_payload.push(0x03); + assert!(matches!( + deliver_card_transfer( + &executor, + DeliverCardTransferRequest { + transfer_id: Some(panicking_payload_transfer_id.into()), + card: panicking_payload, + ..request.clone() + }, + ) + .await?, + Err(WorkerExecutorError::InvalidRequest { .. }) + )); + + drop(executor); + let executor = start(deps, &context).await?; + + assert_eq!( + deliver_card_transfer(&executor, request.clone()).await?, + Ok(()) + ); + assert_eq!( + deliver_card_transfer(&executor, conflicting_request.clone()).await?, + Err(WorkerExecutorError::invalid_request( + PERMISSION_CARD_TRANSFER_PAYLOAD_CONFLICT + )) + ); + + let concurrent_transfer_id = uuid::Uuid::new_v4(); + let concurrent_request = DeliverCardTransferRequest { + transfer_id: Some(concurrent_transfer_id.into()), + ..request.clone() + }; + let identical_results = join_all((0..8).map(|_| { + let executor = executor.clone(); + let request = concurrent_request.clone(); + async move { deliver_card_transfer(&executor, request).await } + })) + .await; + for result in identical_results { + assert_eq!(result?, Ok(())); + } + + let conflicting_transfer_id = uuid::Uuid::new_v4(); + let conflicting_source_card_id = CardId::new(); + let concurrent_conflict_requests = [ + DeliverCardTransferRequest { + transfer_id: Some(conflicting_transfer_id.into()), + ..request.clone() + }, + DeliverCardTransferRequest { + transfer_id: Some(conflicting_transfer_id.into()), + source_card_id: Some(conflicting_source_card_id.0.into()), + ..request.clone() + }, + ]; + let conflict_results = join_all(concurrent_conflict_requests.map(|request| { + let executor = executor.clone(); + async move { deliver_card_transfer(&executor, request).await } + })) + .await; + let mut accepted = 0; + let mut conflicted = 0; + for result in conflict_results { + match result? { + Ok(()) => accepted += 1, + Err(error) + if error + == WorkerExecutorError::invalid_request( + PERMISSION_CARD_TRANSFER_PAYLOAD_CONFLICT, + ) => + { + conflicted += 1 + } + Err(error) => return Err(anyhow!("unexpected concurrent delivery error: {error}")), + } + } + assert_eq!((accepted, conflicted), (1, 1)); + + let entries = executor + .get_oplog(&target_agent_id, OplogIndex::INITIAL) + .await?; + assert_eq!(count_receipts(&entries, transfer_id), 1); + assert_eq!(count_receipts(&entries, detached_status_transfer_id), 1); + assert_eq!(count_receipts(&entries, concurrent_transfer_id), 1); + assert_eq!(count_receipts(&entries, conflicting_transfer_id), 1); + assert_eq!(count_receipts(&entries, mismatching_transfer_id), 0); + assert_eq!(count_receipts(&entries, non_system_transfer_id), 0); + assert_eq!(count_receipts(&entries, malformed_transfer_id), 0); + assert_eq!(count_receipts(&entries, panicking_payload_transfer_id), 0); + assert!( + entries + .iter() + .filter(|entry| entry.oplog_index > oplog_before) + .all(|entry| !matches!( + entry.entry, + PublicOplogEntry::CardInstalled(_) + | PublicOplogEntry::CardDerived(_) + | PublicOplogEntry::CardTransferred(_) + )) + ); + + let mut wallet_after = get_agent_wallet_cards(&executor, &target_agent_id).await?; + wallet_after.sort(); + wallet_before + .push(golem_common::serialization::serialize(&card).map_err(|error| anyhow!(error))?); + wallet_before.sort(); + assert_eq!(wallet_after, wallet_before); + + let entries = executor + .get_oplog(&target_agent_id, OplogIndex::INITIAL) + .await?; + let transferred = |expected_transfer_id| { + entries + .iter() + .filter_map(|entry| match &entry.entry { + PublicOplogEntry::CardTransferred(params) + if params.transfer_id == expected_transfer_id => + { + Some(params) + } + _ => None, + }) + .collect::>() + }; + let original_transfer = transferred(transfer_id); + let detached_status_transfer = transferred(detached_status_transfer_id); + let concurrent_transfer = transferred(concurrent_transfer_id); + let conflict_winner = transferred(conflicting_transfer_id); + assert_eq!(original_transfer.len(), 1); + assert_eq!(detached_status_transfer.len(), 1); + assert_eq!(concurrent_transfer.len(), 1); + assert_eq!(conflict_winner.len(), 1); + assert_eq!(original_transfer[0].source_card_id, Some(source_card_id)); + assert_eq!(original_transfer[0].installed_card_id, card.card_id()); + assert_eq!(concurrent_transfer[0].installed_card_id, card.card_id()); + assert_eq!(conflict_winner[0].installed_card_id, card.card_id()); + let target_generation = original_transfer[0] + .target_wallet_generation + .expect("target transfer admission must record its wallet generation"); + assert!( + [ + detached_status_transfer[0], + concurrent_transfer[0], + conflict_winner[0], + ] + .into_iter() + .all(|transfer| transfer.target_wallet_generation == Some(target_generation)), + "reinstalling the same card through another transfer must not bump the target generation" + ); + + assert_eq!( + deliver_card_transfer(&executor, request.clone()).await?, + Ok(()), + "an exact retry after target admission must reuse the terminal receipt" + ); + assert_eq!( + deliver_card_transfer(&executor, conflicting_request).await?, + Err(WorkerExecutorError::invalid_request( + PERMISSION_CARD_TRANSFER_PAYLOAD_CONFLICT + )) + ); + let entries_after_terminal_retry = executor + .get_oplog(&target_agent_id, OplogIndex::INITIAL) + .await?; + assert_eq!( + count_receipts(&entries_after_terminal_retry, transfer_id), + 1 + ); + assert_eq!( + entries_after_terminal_retry + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardTransferred(params) if params.transfer_id == transfer_id + )) + .count(), + 1 + ); + + let failed_transfer_id = uuid::Uuid::new_v4(); + let mut unregistered_card = card.clone(); + match &mut unregistered_card { + StoredCard::Concrete(card) => card.card_id = CardId::new(), + StoredCard::Polymorphic(_) => unreachable!(), + } + let failed_request = DeliverCardTransferRequest { + transfer_id: Some(failed_transfer_id.into()), + card: desert_rust::serialize_to_byte_vec(&unregistered_card)?, + ..request.clone() + }; + assert_eq!( + deliver_card_transfer(&executor, failed_request.clone()).await?, + Ok(()) + ); + let _ = get_agent_wallet_cards(&executor, &target_agent_id).await?; + assert_eq!( + deliver_card_transfer(&executor, failed_request.clone()).await?, + Ok(()), + "an exact retry after terminal admission failure must reuse the failed receipt" + ); + let mut conflicting_failed_card = unregistered_card; + match &mut conflicting_failed_card { + StoredCard::Concrete(card) => card.system_card = !card.system_card, + StoredCard::Polymorphic(_) => unreachable!(), + } + assert_eq!( + deliver_card_transfer( + &executor, + DeliverCardTransferRequest { + card: desert_rust::serialize_to_byte_vec(&conflicting_failed_card)?, + ..failed_request + }, + ) + .await?, + Err(WorkerExecutorError::invalid_request( + PERMISSION_CARD_TRANSFER_PAYLOAD_CONFLICT + )) + ); + let entries_after_failed_retry = executor + .get_oplog(&target_agent_id, OplogIndex::INITIAL) + .await?; + assert_eq!( + count_receipts(&entries_after_failed_retry, failed_transfer_id), + 1 + ); + let failed_receipt_index = entries_after_failed_retry + .iter() + .find_map(|entry| match &entry.entry { + PublicOplogEntry::CardEventQueued(params) + if matches!( + ¶ms.event, + PublicQueuedCardEvent::TransferReceived(receipt) + if receipt.transfer_id == failed_transfer_id + ) => + { + Some(entry.oplog_index) + } + _ => None, + }) + .expect("failed transfer must retain its durable receipt in the oplog"); + assert_eq!( + entries_after_failed_retry + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardInstallFailed(params) + if params.queued_event_index == failed_receipt_index + )) + .count(), + 1, + "retrying a terminally failed transfer must not repeat target admission" + ); + + Ok(()) +} + +#[test] +#[tracing::instrument] +#[timeout("8m")] +async fn pending_source_card_transfers_resume_only_after_replay_reaches_live_mode( + last_unique_id: &LastUniqueId, + deps: &WorkerExecutorTestDependencies, + #[tagged_as("agent_counters")] agent_counters: &PrecompiledComponent, + _tracing: &Tracing, +) -> anyhow::Result<()> { + use golem_common::base_model::oplog::{PublicQueuedCardEvent, QueuedCardEvent}; + use golem_common::model::card::{AgentCardHolder, CardHolder}; + use golem_common::model::oplog::{OplogEntry, PublicOplogEntry}; + + let recorded_transfers = Arc::new(Mutex::new(Vec::new())); + let lost_response_transfer_ids = Arc::new(Mutex::new(HashSet::new())); + let overrides = TestExecutorOverrides { + wrap_worker_proxy: Some(Arc::new({ + let recorded_transfers = recorded_transfers.clone(); + let lost_response_transfer_ids = lost_response_transfer_ids.clone(); + move |inner| { + Arc::new(RecordingWorkerProxy { + inner, + transfers: recorded_transfers.clone(), + forward_transfers: false, + lost_response_transfer_ids: lost_response_transfer_ids.clone(), + local_delivery: None, + }) + } + })), + ..Default::default() + }; + let context = TestContext::new(last_unique_id); + let executor = start_with_overrides(deps, &context, overrides.clone()).await?; + let component = executor + .component_dep(&context.default_environment_id, agent_counters) + .store() + .await?; + let run_id = uuid::Uuid::new_v4(); + let source_agent_id = executor + .start_agent( + &component.id, + agent_id!("Counter", format!("pending-transfer-source-{run_id}")), + ) + .await?; + let _ = get_agent_wallet_cards(&executor, &source_agent_id).await?; + let target_agent_id = AgentId { + component_id: component.id, + agent_id: agent_id!("Counter", format!("pending-transfer-target-{run_id}")).to_string(), + }; + let source_holder = CardHolder::Agent(AgentCardHolder { + agent_id: source_agent_id.clone(), + }); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: target_agent_id.clone(), + }); + let card = registry_test_card(); + let pending_transfer_id = uuid::Uuid::new_v4(); + let started_transfer_id = uuid::Uuid::new_v4(); + let completed_transfer_id = uuid::Uuid::new_v4(); + + executor + .commit_oplog_entry_bypassing_worker_status( + &source_agent_id, + OplogEntry::card_event_queued(QueuedCardEvent::transfer_started_with_source( + pending_transfer_id, + card.card_id(), + card.clone(), + target_holder.clone(), + )), + ) + .await?; + executor + .commit_oplog_entry_bypassing_worker_status( + &source_agent_id, + OplogEntry::card_event_queued(QueuedCardEvent::transfer_started_with_source( + completed_transfer_id, + card.card_id(), + card.clone(), + target_holder.clone(), + )), + ) + .await?; + executor + .commit_oplog_entry_bypassing_worker_status( + &source_agent_id, + OplogEntry::card_event_queued(QueuedCardEvent::transfer_started_with_source( + started_transfer_id, + card.card_id(), + card.clone(), + target_holder.clone(), + )), + ) + .await?; + executor + .commit_oplog_entry_bypassing_worker_status( + &source_agent_id, + OplogEntry::card_transfer_started( + started_transfer_id, + card.card_id(), + Some(source_holder.clone()), + target_holder.clone(), + Some(0), + ), + ) + .await?; + executor + .commit_oplog_entry_bypassing_worker_status( + &source_agent_id, + OplogEntry::card_transfer_started( + completed_transfer_id, + card.card_id(), + Some(source_holder), + target_holder.clone(), + Some(0), + ), + ) + .await?; + let pre_recovery_index = executor + .commit_oplog_entry_bypassing_worker_status( + &source_agent_id, + OplogEntry::card_transfer_confirmed( + completed_transfer_id, + card.card_id(), + card.card_id(), + target_holder, + ), + ) + .await?; + assert!(recorded_transfers.lock().unwrap().is_empty()); + + drop(executor); + let executor = start_with_overrides(deps, &context, overrides.clone()).await?; + let _ = get_agent_wallet_cards(&executor, &source_agent_id).await?; + + assert_eq!( + *recorded_transfers.lock().unwrap(), + [pending_transfer_id, started_transfer_id].map(|transfer_id| RecordedCardTransfer { + target_agent_id: target_agent_id.clone(), + environment_id: context.default_environment_id, + transfer_id, + source_card_id: card.card_id(), + card: card.clone(), + }), + "only unconfirmed source transfers should be delivered after replay" + ); + + let entries = executor + .get_oplog(&source_agent_id, OplogIndex::INITIAL) + .await?; + for transfer_id in [ + pending_transfer_id, + started_transfer_id, + completed_transfer_id, + ] { + assert_eq!( + entries + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardEventQueued(params) + if matches!( + ¶ms.event, + PublicQueuedCardEvent::TransferStarted(transfer) + if transfer.transfer_id == transfer_id + ) + )) + .count(), + 1, + "recovery must not duplicate the queued source retry payload" + ); + assert_eq!( + entries + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardTransferStarted(transfer) + if transfer.transfer_id == transfer_id + )) + .count(), + 1, + "recovery must append at most one source intent" + ); + assert_eq!( + entries + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardTransferConfirmed(transfer) + if transfer.transfer_id == transfer_id + )) + .count(), + 1, + "recovery must append at most one source confirmation" + ); + } + + drop(executor); + let executor = start_with_overrides(deps, &context, overrides.clone()).await?; + let _ = get_agent_wallet_cards(&executor, &source_agent_id).await?; + assert_eq!( + recorded_transfers.lock().unwrap().len(), + 2, + "a confirmed source transfer must not be delivered on a later replay" + ); + + executor + .revert( + &source_agent_id, + RevertWorkerTarget::RevertToOplogIndex(RevertToOplogIndex { + last_oplog_index: pre_recovery_index, + }), + ) + .await?; + let _ = get_agent_wallet_cards(&executor, &source_agent_id).await?; + assert_eq!( + recorded_transfers.lock().unwrap().len(), + 2, + "reverting source terminal entries must preserve the externally completed transfer" + ); + + drop(executor); + let executor = start_with_overrides(deps, &context, overrides).await?; + let _ = get_agent_wallet_cards(&executor, &source_agent_id).await?; + assert_eq!( + recorded_transfers.lock().unwrap().len(), + 2, + "a source revert followed by replay must not redeliver completed transfers" + ); + + Ok(()) +} + +#[test] +#[tracing::instrument] +#[timeout("8m")] +async fn lost_card_transfer_response_converges_after_source_and_target_restart( + last_unique_id: &LastUniqueId, + deps: &WorkerExecutorTestDependencies, + #[tagged_as("agent_counters")] agent_counters: &PrecompiledComponent, + _tracing: &Tracing, +) -> anyhow::Result<()> { + use golem_common::base_model::oplog::{PublicQueuedCardEvent, QueuedCardEvent}; + use golem_common::model::card::{AgentCardHolder, CardHolder}; + use golem_common::model::oplog::{OplogEntry, PublicOplogEntry}; + + let recorded_transfers = Arc::new(Mutex::new(Vec::new())); + let transfer_id = uuid::Uuid::new_v4(); + let lost_response_transfer_ids = Arc::new(Mutex::new(HashSet::from([transfer_id]))); + let local_delivery = Arc::new(Mutex::new(None)); + let overrides = TestExecutorOverrides { + wrap_worker_proxy: Some(Arc::new({ + let recorded_transfers = recorded_transfers.clone(); + let lost_response_transfer_ids = lost_response_transfer_ids.clone(); + let local_delivery = local_delivery.clone(); + move |inner| { + Arc::new(RecordingWorkerProxy { + inner, + transfers: recorded_transfers.clone(), + forward_transfers: true, + lost_response_transfer_ids: lost_response_transfer_ids.clone(), + local_delivery: Some(local_delivery.clone()), + }) + } + })), + ..Default::default() + }; + let context = TestContext::new(last_unique_id); + let executor = start_with_overrides(deps, &context, overrides.clone()).await?; + connect_local_card_transfer_delivery(&local_delivery, &executor); + let component = executor + .component_dep(&context.default_environment_id, agent_counters) + .store() + .await?; + let run_id = uuid::Uuid::new_v4(); + let source_agent_id = executor + .start_agent( + &component.id, + agent_id!("Counter", format!("lost-response-source-{run_id}")), + ) + .await?; + let target_agent_id = executor + .start_agent( + &component.id, + agent_id!("Counter", format!("lost-response-target-{run_id}")), + ) + .await?; + let _ = get_agent_wallet_cards(&executor, &source_agent_id).await?; + let _ = get_agent_wallet_cards(&executor, &target_agent_id).await?; + + let card = registry_test_card(); + let target_holder = CardHolder::Agent(AgentCardHolder { + agent_id: target_agent_id.clone(), + }); + let source_holder = CardHolder::Agent(AgentCardHolder { + agent_id: source_agent_id.clone(), + }); + executor + .commit_oplog_entry_bypassing_worker_status( + &source_agent_id, + OplogEntry::card_event_queued(QueuedCardEvent::transfer_started_with_source( + transfer_id, + card.card_id(), + card.clone(), + target_holder.clone(), + )), + ) + .await?; + executor + .commit_oplog_entry_bypassing_worker_status( + &source_agent_id, + OplogEntry::card_transfer_started( + transfer_id, + card.card_id(), + Some(source_holder), + target_holder, + Some(0), + ), + ) + .await?; + + drop(executor); + let executor = start_with_overrides(deps, &context, overrides.clone()).await?; + connect_local_card_transfer_delivery(&local_delivery, &executor); + let first_recovery_error = get_agent_wallet_cards(&executor, &source_agent_id) + .await + .expect_err("losing the target response must leave source recovery pending"); + assert!( + format!("{first_recovery_error:#}").contains("simulated lost card-transfer response"), + "unexpected source recovery failure: {first_recovery_error:#}" + ); + let _ = get_agent_wallet_cards(&executor, &target_agent_id).await?; + + let expected_transfer = RecordedCardTransfer { + target_agent_id: target_agent_id.clone(), + environment_id: context.default_environment_id, + transfer_id, + source_card_id: card.card_id(), + card: card.clone(), + }; + assert_eq!( + *recorded_transfers.lock().unwrap(), + vec![expected_transfer.clone()], + "the first replay retry must reach the target before its response is lost" + ); + let source_entries = executor + .get_oplog(&source_agent_id, OplogIndex::INITIAL) + .await?; + assert_eq!( + source_entries + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardTransferConfirmed(transfer) + if transfer.transfer_id == transfer_id + )) + .count(), + 0, + "the source must not confirm a transfer whose success response was lost" + ); + let target_entries = executor + .get_oplog(&target_agent_id, OplogIndex::INITIAL) + .await?; + assert_eq!( + target_entries + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardEventQueued(params) + if matches!( + ¶ms.event, + PublicQueuedCardEvent::TransferReceived(receipt) + if receipt.transfer_id == transfer_id + ) + )) + .count(), + 1, + "the target must durably retain the delivery whose response was lost" + ); + assert_eq!( + target_entries + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardTransferred(transfer) + if transfer.transfer_id == transfer_id + )) + .count(), + 1, + "target admission must complete exactly once before both sides restart" + ); + + drop(executor); + let executor = start_with_overrides(deps, &context, overrides.clone()).await?; + connect_local_card_transfer_delivery(&local_delivery, &executor); + let _ = get_agent_wallet_cards(&executor, &source_agent_id).await?; + let _ = get_agent_wallet_cards(&executor, &target_agent_id).await?; + assert_eq!( + *recorded_transfers.lock().unwrap(), + vec![expected_transfer.clone(), expected_transfer], + "source recovery must retry the exact durable transfer payload" + ); + + let source_entries = executor + .get_oplog(&source_agent_id, OplogIndex::INITIAL) + .await?; + assert_eq!( + source_entries + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardEventQueued(params) + if matches!( + ¶ms.event, + PublicQueuedCardEvent::TransferStarted(transfer) + if transfer.transfer_id == transfer_id + ) + )) + .count(), + 1 + ); + assert_eq!( + source_entries + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardTransferStarted(transfer) + if transfer.transfer_id == transfer_id + )) + .count(), + 1 + ); + assert_eq!( + source_entries + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardTransferConfirmed(transfer) + if transfer.transfer_id == transfer_id + )) + .count(), + 1 + ); + let target_entries = executor + .get_oplog(&target_agent_id, OplogIndex::INITIAL) + .await?; + assert_eq!( + target_entries + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardEventQueued(params) + if matches!( + ¶ms.event, + PublicQueuedCardEvent::TransferReceived(receipt) + if receipt.transfer_id == transfer_id + ) + )) + .count(), + 1 + ); + assert_eq!( + target_entries + .iter() + .filter(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardTransferred(transfer) + if transfer.transfer_id == transfer_id + )) + .count(), + 1 + ); + + drop(executor); + let executor = start_with_overrides(deps, &context, overrides).await?; + connect_local_card_transfer_delivery(&local_delivery, &executor); + let _ = get_agent_wallet_cards(&executor, &source_agent_id).await?; + let _ = get_agent_wallet_cards(&executor, &target_agent_id).await?; + assert_eq!( + recorded_transfers.lock().unwrap().len(), + 2, + "the confirmed source transfer must remain terminal on later replay" + ); + + Ok(()) +} + #[test] #[tracing::instrument] #[timeout("4m")] @@ -3707,6 +5095,7 @@ async fn worker_created_by_reflects_component_owner_not_caller( lower: Vec::new(), upper: Vec::new(), }, + delegation_surface: None, }) .into(); @@ -3801,6 +5190,7 @@ async fn worker_environment_reflects_component_not_caller( lower: Vec::new(), upper: Vec::new(), }, + delegation_surface: None, }) .into(); @@ -3946,6 +5336,7 @@ async fn resource_limits_initialized_for_component_owner_not_caller( lower: Vec::new(), upper: Vec::new(), }, + delegation_surface: None, }) .into(); diff --git a/golem-worker-executor/tests/durability.rs b/golem-worker-executor/tests/durability.rs index e485fc935e..9cf6daedfc 100644 --- a/golem-worker-executor/tests/durability.rs +++ b/golem-worker-executor/tests/durability.rs @@ -25,8 +25,8 @@ use golem_common::{agent_id, data_value}; use golem_test_framework::dsl::TestDsl; use golem_worker_executor::services::golem_config::SnapshotPolicy; use golem_worker_executor_test_utils::{ - LastUniqueId, PrecompiledComponent, TEST_CARD_ID, TestContext, WorkerExecutorTestDependencies, - start, start_with_snapshot_policy, + LastUniqueId, PrecompiledComponent, TestContext, WorkerExecutorTestDependencies, start, + start_with_snapshot_policy, }; use pretty_assertions::assert_eq; use serde::Deserialize; @@ -418,80 +418,6 @@ async fn snapshot_based_recovery( Ok(()) } -#[test] -#[tracing::instrument] -async fn snapshot_based_recovery_preserves_installed_cards( - last_unique_id: &LastUniqueId, - deps: &WorkerExecutorTestDependencies, - #[tagged_as("host_api_tests")] host_api_tests: &PrecompiledComponent, - _tracing: &Tracing, -) -> anyhow::Result<()> { - let context = TestContext::new(last_unique_id); - let executor = start_with_snapshot_policy( - deps, - &context, - SnapshotPolicy::EveryNInvocation { count: 1 }, - ) - .await?; - - let component = executor - .component_dep(&context.default_environment_id, host_api_tests) - .store() - .await?; - let agent_id = agent_id!("SnapshotCardRecoveryAgent"); - let worker_id = executor - .start_agent(&component.id, agent_id.clone()) - .await?; - - let (high_bits, low_bits) = TEST_CARD_ID.0.as_u64_pair(); - let installed = executor - .invoke_and_await_agent( - &component, - &agent_id, - "install_card_by_id", - data_value!(high_bits, low_bits), - ) - .await? - .into_typed::()?; - assert!(installed, "test card should install"); - - let oplog = executor.get_oplog(&worker_id, OplogIndex::INITIAL).await?; - let snapshot_count = oplog - .iter() - .filter(|entry| matches!(&entry.entry, PublicOplogEntry::Snapshot(_))) - .count(); - assert!( - snapshot_count >= 1, - "Expected at least one snapshot before restart, got {snapshot_count}" - ); - - drop(executor); - let executor = start_with_snapshot_policy( - deps, - &context, - SnapshotPolicy::EveryNInvocation { count: 1 }, - ) - .await?; - - let still_usable = executor - .invoke_and_await_agent( - &component, - &agent_id, - "derive_card_by_id", - data_value!(high_bits, low_bits), - ) - .await? - .into_typed::()?; - - assert!( - still_usable, - "installed card should remain in the agent wallet after snapshot recovery" - ); - - drop(executor); - Ok(()) -} - #[test] #[tracing::instrument] async fn snapshot_based_recovery_preserves_state_across_multiple_restarts( diff --git a/golem-worker-executor/tests/lib.rs b/golem-worker-executor/tests/lib.rs index d5fed32862..00fa884055 100644 --- a/golem-worker-executor/tests/lib.rs +++ b/golem-worker-executor/tests/lib.rs @@ -52,6 +52,7 @@ pub mod retry_policies; pub mod revert; pub mod rpc; pub mod scalability; +pub mod scope_cards; pub mod storage_quota; pub mod transactions; pub mod wasi; @@ -103,6 +104,7 @@ tag_suite!(retry_policies, group2); tag_suite!(durability, group3); tag_suite!(rpc, group3); +tag_suite!(scope_cards, group3); tag_suite!(wasi, group3); tag_suite!(scalability, group3); tag_suite!(revert, group3); diff --git a/golem-worker-executor/tests/scope_cards.rs b/golem-worker-executor/tests/scope_cards.rs new file mode 100644 index 0000000000..683372f9fa --- /dev/null +++ b/golem-worker-executor/tests/scope_cards.rs @@ -0,0 +1,476 @@ +// Copyright 2024-2026 Golem Cloud +// +// Licensed under the Golem Source License v1.1 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://license.golem.cloud/LICENSE +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::Tracing; +use async_trait::async_trait; +use golem_common::model::card::{ + CardId, CardManagedByRuntimeDerived, PolymorphicPermissionPattern, StoredCard, + parse_polymorphic_permission, +}; +use golem_common::model::oplog::{OplogIndex, PublicOplogEntry}; +use golem_common::model::{AgentStatus, IdempotencyKey, PromiseId}; +use golem_common::{agent_id, data_value}; +use golem_schema::model::CardId as SchemaCardId; +use golem_service_base::error::worker_executor::WorkerExecutorError; +use golem_test_framework::dsl::TestDsl; +use golem_worker_executor::services::card::{CardService, CardState}; +use golem_worker_executor_test_utils::{ + LastUniqueId, PrecompiledComponent, TestContext, TestExecutorOverrides, TestWorkerExecutor, + WorkerExecutorTestDependencies, start_with_overrides, +}; +use std::collections::HashMap; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::{Arc, RwLock}; +use std::time::Duration; +use test_r::{inherit_test_dep, test, timeout}; + +inherit_test_dep!(WorkerExecutorTestDependencies); +inherit_test_dep!(LastUniqueId); +inherit_test_dep!( + #[tagged_as("host_api_tests")] + PrecompiledComponent +); +inherit_test_dep!(Tracing); + +fn scope_card_initial_permissions() -> Vec { + vec![ + parse_polymorphic_permission("card(*) @ * : derive : *").unwrap(), + parse_polymorphic_permission("card(*) @ * : inspect : *").unwrap(), + ] +} + +#[derive(Default)] +struct ScopeCardAuthority { + revoked: AtomicBool, + root_card: RwLock>, +} + +impl ScopeCardAuthority { + fn set_root_card(&self, card: StoredCard) { + *self.root_card.write().expect("root-card lock poisoned") = Some(card); + } + + fn root_card(&self) -> Option { + self.root_card + .read() + .expect("root-card lock poisoned") + .clone() + } + + fn root_card_id(&self) -> Option { + self.root_card().map(|card| card.card_id()) + } + + fn revoke(&self) { + self.revoked.store(true, Ordering::SeqCst); + } +} + +struct ScopeCardService { + authority: Arc, +} + +#[async_trait] +impl CardService for ScopeCardService { + async fn record_revoked_cards(&self, card_ids: &[CardId]) { + if self + .authority + .root_card_id() + .is_some_and(|root_card_id| card_ids.contains(&root_card_id)) + { + self.authority.revoke(); + } + } + + async fn create_runtime_card( + &self, + card: StoredCard, + _provenance: CardManagedByRuntimeDerived, + ) -> Result { + Ok(card) + } + + async fn check_cards( + &self, + card_ids: Vec, + ) -> Result, WorkerExecutorError> { + let root_card = self.authority.root_card().ok_or_else(|| { + WorkerExecutorError::runtime("scope-card test root was not configured") + })?; + let root_card_id = root_card.card_id(); + let root_is_revoked = self.authority.revoked.load(Ordering::SeqCst); + Ok(card_ids + .into_iter() + .map(|card_id| { + let state = if card_id == root_card_id { + if root_is_revoked { + CardState::Revoked + } else { + CardState::Live(Box::new(root_card.clone())) + } + } else { + CardState::Unknown + }; + (card_id, state) + }) + .collect()) + } +} + +async fn start_scope_card_executor( + deps: &WorkerExecutorTestDependencies, + context: &TestContext, + authority: Arc, +) -> anyhow::Result { + start_with_overrides( + deps, + context, + TestExecutorOverrides { + create_card_service: Some(Arc::new(move || { + Arc::new(ScopeCardService { + authority: authority.clone(), + }) + })), + ..Default::default() + }, + ) + .await +} + +fn configure_scope_card_root( + authority: &ScopeCardAuthority, + component: &golem_common::model::component::ComponentDto, + agent_id: &golem_common::model::agent::ParsedAgentId, +) -> anyhow::Result { + let card = component + .metadata + .agent_type_initial_permission_card(&agent_id.agent_type) + .cloned() + .ok_or_else(|| anyhow::anyhow!("missing scope-card test initial card"))?; + let card = StoredCard::Polymorphic(card); + let card_id = card.card_id(); + authority.set_root_card(card); + Ok(card_id) +} + +async fn assert_scope_absent( + executor: &TestWorkerExecutor, + component: &golem_common::model::component::ComponentDto, + target: &golem_common::model::agent::ParsedAgentId, + scope_card_id: SchemaCardId, +) -> anyhow::Result<()> { + let present = executor + .invoke_and_await_agent(component, target, "has_card", data_value!(scope_card_id)) + .await? + .into_typed::()?; + assert!(!present, "scope card must not survive invocation end"); + Ok(()) +} + +#[test] +#[timeout("2m")] +#[tracing::instrument] +async fn scope_cards_are_delivered_by_both_await_variants_and_removed_at_end( + last_unique_id: &LastUniqueId, + deps: &WorkerExecutorTestDependencies, + #[tagged_as("host_api_tests")] host_api_tests: &PrecompiledComponent, + _tracing: &Tracing, +) -> anyhow::Result<()> { + let context = TestContext::new(last_unique_id); + let authority = Arc::new(ScopeCardAuthority::default()); + let executor = start_scope_card_executor(deps, &context, authority.clone()).await?; + let component = executor + .component_dep(&context.default_environment_id, host_api_tests) + .update_agent_provision_config("ScopeCardAgent", |config| { + config + .initial_permissions + .lower_bound + .positive + .extend(scope_card_initial_permissions()); + }) + .store() + .await?; + let caller = agent_id!("ScopeCardAgent", "await-caller"); + let target_name = "await-target"; + let target = agent_id!("ScopeCardAgent", target_name); + configure_scope_card_root(&authority, &component, &caller)?; + let caller_worker = executor.start_agent(&component.id, caller.clone()).await?; + let target_worker = executor.start_agent(&component.id, target.clone()).await?; + + let (present, parent_matches, inspect_matches, scope_card_id) = executor + .invoke_and_await_agent( + &component, + &caller, + "invoke_and_await_scope", + data_value!(target_name), + ) + .await? + .into_typed::<(bool, bool, bool, SchemaCardId)>()?; + assert_eq!( + (present, parent_matches, inspect_matches), + (true, true, true) + ); + assert_scope_absent(&executor, &component, &target, scope_card_id).await?; + + let (present, parent_matches, inspect_matches, scope_card_id) = executor + .invoke_and_await_agent( + &component, + &caller, + "async_invoke_and_await_scope", + data_value!(target_name), + ) + .await? + .into_typed::<(bool, bool, bool, SchemaCardId)>()?; + assert_eq!( + (present, parent_matches, inspect_matches), + (true, true, true) + ); + assert_scope_absent(&executor, &component, &target, scope_card_id).await?; + + executor.check_oplog_is_queryable(&caller_worker).await?; + executor.check_oplog_is_queryable(&target_worker).await?; + Ok(()) +} + +#[test] +#[timeout("2m")] +#[tracing::instrument] +async fn scope_cards_reject_non_await_and_persistent_arguments( + last_unique_id: &LastUniqueId, + deps: &WorkerExecutorTestDependencies, + #[tagged_as("host_api_tests")] host_api_tests: &PrecompiledComponent, + _tracing: &Tracing, +) -> anyhow::Result<()> { + let context = TestContext::new(last_unique_id); + let authority = Arc::new(ScopeCardAuthority::default()); + let executor = start_scope_card_executor(deps, &context, authority.clone()).await?; + let component = executor + .component_dep(&context.default_environment_id, host_api_tests) + .update_agent_provision_config("ScopeCardAgent", |config| { + config + .initial_permissions + .lower_bound + .positive + .extend(scope_card_initial_permissions()); + }) + .store() + .await?; + let caller = agent_id!("ScopeCardAgent", "rejection-caller"); + configure_scope_card_root(&authority, &component, &caller)?; + executor.start_agent(&component.id, caller.clone()).await?; + + let invoke_denied = executor + .invoke_and_await_agent( + &component, + &caller, + "invoke_scope_is_denied", + data_value!("rejection-target"), + ) + .await? + .into_typed::()?; + assert!(invoke_denied, "fire-and-forget scope card should be denied"); + + let persistent_denied = executor + .invoke_and_await_agent( + &component, + &caller, + "persistent_scope_is_denied", + data_value!("rejection-target"), + ) + .await? + .into_typed::()?; + assert!( + persistent_denied, + "a persistent card must not be accepted as the scope-card argument" + ); + + for (method, caller_name) in [ + ("schedule_scope", "schedule-caller"), + ("schedule_cancelable_scope", "cancelable-schedule-caller"), + ] { + let schedule_caller = agent_id!("ScopeCardAgent", caller_name); + executor + .start_agent(&component.id, schedule_caller.clone()) + .await?; + let error = executor + .invoke_and_await_agent( + &component, + &schedule_caller, + method, + data_value!("rejection-target"), + ) + .await + .expect_err("scheduled scope-card invocation should fail"); + assert!( + error.to_string().contains("does not accept scope cards"), + "unexpected {method} error: {error:#}" + ); + } + + Ok(()) +} + +#[test] +#[timeout("2m")] +#[tracing::instrument] +async fn scope_card_revocation_removes_authority_at_the_next_boundary( + last_unique_id: &LastUniqueId, + deps: &WorkerExecutorTestDependencies, + #[tagged_as("host_api_tests")] host_api_tests: &PrecompiledComponent, + _tracing: &Tracing, +) -> anyhow::Result<()> { + let context = TestContext::new(last_unique_id); + let authority = Arc::new(ScopeCardAuthority::default()); + let executor = start_scope_card_executor(deps, &context, authority.clone()).await?; + let component = executor + .component_dep(&context.default_environment_id, host_api_tests) + .update_agent_provision_config("ScopeCardAgent", |config| { + config + .initial_permissions + .lower_bound + .positive + .extend(scope_card_initial_permissions()); + }) + .store() + .await?; + let caller = agent_id!("ScopeCardAgent", "revocation-caller"); + let target_name = "revocation-target"; + let target = agent_id!("ScopeCardAgent", target_name); + let root_card_id = configure_scope_card_root(&authority, &component, &caller)?; + let target_worker = executor.start_agent(&component.id, target.clone()).await?; + executor.start_agent(&component.id, caller.clone()).await?; + let release = executor + .invoke_and_await_agent(&component, &target, "create_release_promise", data_value!()) + .await? + .into_typed::()?; + let key = IdempotencyKey::fresh(); + let params = data_value!(target_name, release.clone()); + + executor + .invoke_agent_with_key( + &component, + &caller, + &key, + "invoke_scope_after_promise", + params.clone(), + ) + .await?; + executor + .wait_for_status( + &target_worker, + AgentStatus::Suspended, + Duration::from_secs(10), + ) + .await?; + authority.revoke(); + executor.complete_promise(&release, vec![1]).await?; + + let (before, after, scope_card_id) = executor + .invoke_and_await_agent_with_key( + &component, + &caller, + &key, + "invoke_scope_after_promise", + params, + ) + .await? + .into_typed::<(bool, bool, SchemaCardId)>()?; + assert_eq!((before, after), (true, false)); + assert_scope_absent(&executor, &component, &target, scope_card_id).await?; + + let target_oplog = executor + .get_oplog(&target_worker, OplogIndex::INITIAL) + .await?; + assert!(target_oplog.iter().any(|entry| matches!( + &entry.entry, + PublicOplogEntry::CardRevokedCascade(params) + if params.revoked_card_ids.contains(&root_card_id) + ))); + Ok(()) +} + +#[test] +#[timeout("2m")] +#[tracing::instrument] +async fn scope_card_delivery_and_cleanup_survive_crash_replay( + last_unique_id: &LastUniqueId, + deps: &WorkerExecutorTestDependencies, + #[tagged_as("host_api_tests")] host_api_tests: &PrecompiledComponent, + _tracing: &Tracing, +) -> anyhow::Result<()> { + let context = TestContext::new(last_unique_id); + let authority = Arc::new(ScopeCardAuthority::default()); + let executor = start_scope_card_executor(deps, &context, authority.clone()).await?; + let component = executor + .component_dep(&context.default_environment_id, host_api_tests) + .update_agent_provision_config("ScopeCardAgent", |config| { + config + .initial_permissions + .lower_bound + .positive + .extend(scope_card_initial_permissions()); + }) + .store() + .await?; + let caller = agent_id!("ScopeCardAgent", "replay-caller"); + let target_name = "replay-target"; + let target = agent_id!("ScopeCardAgent", target_name); + configure_scope_card_root(&authority, &component, &caller)?; + let caller_worker = executor.start_agent(&component.id, caller.clone()).await?; + let target_worker = executor.start_agent(&component.id, target.clone()).await?; + let release = executor + .invoke_and_await_agent(&component, &target, "create_release_promise", data_value!()) + .await? + .into_typed::()?; + let key = IdempotencyKey::fresh(); + let params = data_value!(target_name, release.clone()); + + executor + .invoke_agent_with_key( + &component, + &caller, + &key, + "invoke_scope_after_promise", + params.clone(), + ) + .await?; + executor + .wait_for_status( + &target_worker, + AgentStatus::Suspended, + Duration::from_secs(10), + ) + .await?; + executor.check_oplog_is_queryable(&caller_worker).await?; + executor.check_oplog_is_queryable(&target_worker).await?; + drop(executor); + + let executor = start_scope_card_executor(deps, &context, authority).await?; + executor.complete_promise(&release, vec![1]).await?; + let (before, after, scope_card_id) = executor + .invoke_and_await_agent_with_key( + &component, + &caller, + &key, + "invoke_scope_after_promise", + params, + ) + .await? + .into_typed::<(bool, bool, SchemaCardId)>()?; + assert_eq!((before, after), (true, true)); + assert_scope_absent(&executor, &component, &target, scope_card_id).await?; + executor.check_oplog_is_queryable(&caller_worker).await?; + executor.check_oplog_is_queryable(&target_worker).await?; + Ok(()) +} diff --git a/golem-worker-service/src/custom_api/call_agent/mod.rs b/golem-worker-service/src/custom_api/call_agent/mod.rs index b2c7a07a05..f00486ec63 100644 --- a/golem-worker-service/src/custom_api/call_agent/mod.rs +++ b/golem-worker-service/src/custom_api/call_agent/mod.rs @@ -134,6 +134,7 @@ impl CallAgentHandler { AuthCtx::System, proto_principal, Some(resolved_route.route.environment_id), + None, ) .await?; diff --git a/golem-worker-service/src/grpcapi/mod.rs b/golem-worker-service/src/grpcapi/mod.rs index 0a849cbdd0..afa89a20f2 100644 --- a/golem-worker-service/src/grpcapi/mod.rs +++ b/golem-worker-service/src/grpcapi/mod.rs @@ -251,6 +251,9 @@ pub fn error_to_status(error: AgentError) -> Status { worker_execution_error::Error::InvocationFailed(_) => { "Invocation Failed".to_string() } + worker_execution_error::Error::PermissionDenied(err) => { + format!("Permission Denied: {}", err.details) + } }; Status::internal(message) } diff --git a/golem-worker-service/src/grpcapi/worker.rs b/golem-worker-service/src/grpcapi/worker.rs index 5740849494..bc8986327b 100644 --- a/golem-worker-service/src/grpcapi/worker.rs +++ b/golem-worker-service/src/grpcapi/worker.rs @@ -19,16 +19,18 @@ use golem_api_grpc::proto::golem::common::Empty; use golem_api_grpc::proto::golem::worker::v1::worker_service_server::WorkerService as GrpcWorkerService; use golem_api_grpc::proto::golem::worker::v1::{ AgentError as GrpcAgentError, CancelInvocationRequest, CancelInvocationResponse, - CompletePromiseRequest, CompletePromiseResponse, ForkWorkerRequest, ForkWorkerResponse, - InvokeAgentRequest, InvokeAgentResponse, InvokeAgentSuccess, LaunchNewWorkerRequest, - LaunchNewWorkerResponse, LaunchNewWorkerSuccessResponse, ProcessOplogEntriesRequest, - ProcessOplogEntriesResponse, ResumeWorkerRequest, ResumeWorkerResponse, RevertWorkerRequest, - RevertWorkerResponse, UpdateWorkerRequest, UpdateWorkerResponse, cancel_invocation_response, - complete_promise_response, fork_worker_response, invoke_agent_response, - launch_new_worker_response, process_oplog_entries_response, resume_worker_response, - revert_worker_response, update_worker_response, + CompletePromiseRequest, CompletePromiseResponse, DeliverCardTransferRequest, + DeliverCardTransferResponse, ForkWorkerRequest, ForkWorkerResponse, InvokeAgentRequest, + InvokeAgentResponse, InvokeAgentSuccess, LaunchNewWorkerRequest, LaunchNewWorkerResponse, + LaunchNewWorkerSuccessResponse, ProcessOplogEntriesRequest, ProcessOplogEntriesResponse, + ResumeWorkerRequest, ResumeWorkerResponse, RevertWorkerRequest, RevertWorkerResponse, + UpdateWorkerRequest, UpdateWorkerResponse, cancel_invocation_response, + complete_promise_response, deliver_card_transfer_response, fork_worker_response, + invoke_agent_response, launch_new_worker_response, process_oplog_entries_response, + resume_worker_response, revert_worker_response, update_worker_response, }; use golem_common::model::agent::InvocationFreshnessDisposition; +use golem_common::model::card::{CardId, StoredCard}; use golem_common::model::component::{ComponentId, ComponentRevision}; use golem_common::model::oplog::OplogIndex; use golem_common::model::worker::AgentConfigEntryDto; @@ -324,6 +326,33 @@ impl GrpcWorkerService for WorkerGrpcApi { result: Some(response), })) } + + async fn deliver_card_transfer( + &self, + request: Request, + ) -> Result, Status> { + let (_, _, request) = request.into_parts(); + let record = recorded_grpc_api_request!( + "deliver_card_transfer", + agent_id = proto_agent_id_string(&request.target_agent_id), + ); + + let response = match self + .deliver_card_transfer_inner(request) + .instrument(record.span.clone()) + .await + { + Ok(()) => record.succeed(deliver_card_transfer_response::Result::Success(Empty {})), + Err(error) => record.fail( + deliver_card_transfer_response::Result::Error(error.clone()), + &mut WorkerTraceErrorKind(&error), + ), + }; + + Ok(Response::new(DeliverCardTransferResponse { + result: Some(response), + })) + } } impl WorkerGrpcApi { @@ -489,8 +518,8 @@ impl WorkerGrpcApi { .map(|entry| entry.try_into().map_err(WorkerServiceError::TypeChecker)) .collect::, _>>()?; - let is_lookup = - request.mode() == golem_api_grpc::proto::golem::worker::AgentInvocationMode::Lookup; + let mode = request.mode(); + let is_lookup = mode == golem_api_grpc::proto::golem::worker::AgentInvocationMode::Lookup; let auth: AuthCtx = request .auth_ctx @@ -498,6 +527,18 @@ impl WorkerGrpcApi { .try_into() .map_err(|e| bad_request_error(format!("failed converting auth_ctx: {e}")))?; let trusted_internal_caller = matches!(&auth, AuthCtx::System | AuthCtx::Agent(_)); + if request.scope_card.is_some() && !trusted_internal_caller { + return Err(bad_request_error( + "scope cards are accepted only from trusted internal callers", + )); + } + if request.scope_card.is_some() + && mode != golem_api_grpc::proto::golem::worker::AgentInvocationMode::Await + { + return Err(bad_request_error( + "scope cards are supported only for invoke-and-await", + )); + } let freshness_disposition = sanitize_invocation_freshness_disposition( request.freshness_disposition, trusted_internal_caller, @@ -544,6 +585,7 @@ impl WorkerGrpcApi { auth, principal, environment_id, + request.scope_card, ) .await?; @@ -624,6 +666,50 @@ impl WorkerGrpcApi { Ok(()) } + async fn deliver_card_transfer_inner( + &self, + request: DeliverCardTransferRequest, + ) -> Result<(), GrpcAgentError> { + let auth: AuthCtx = request + .auth_ctx + .ok_or(bad_request_error("auth_ctx not found"))? + .try_into() + .map_err(|error| bad_request_error(format!("failed converting auth_ctx: {error}")))?; + auth.authorize_system_only("deliver permission card transfer")?; + + let target_agent_id = validate_protobuf_agent_id(request.target_agent_id)?; + let environment_id = request + .environment_id + .ok_or_else(|| bad_request_error("Missing environment_id"))? + .try_into() + .map_err(|error| bad_request_error(format!("invalid environment_id: {error}")))?; + let transfer_id = request + .transfer_id + .ok_or_else(|| bad_request_error("Missing transfer_id"))? + .into(); + let source_card_id = CardId( + request + .source_card_id + .ok_or_else(|| bad_request_error("Missing source_card_id"))? + .into(), + ); + let card: StoredCard = desert_rust::deserialize(&request.card) + .map_err(|error| bad_request_error(format!("invalid card: {error}")))?; + + self.worker_service + .deliver_card_transfer( + &target_agent_id, + environment_id, + transfer_id, + source_card_id, + card, + auth, + ) + .await?; + + Ok(()) + } + async fn cancel_invocation_inner( &self, request: CancelInvocationRequest, diff --git a/golem-worker-service/src/mcp/invoke/resource.rs b/golem-worker-service/src/mcp/invoke/resource.rs index e7bb29913d..fbbc893b4b 100644 --- a/golem-worker-service/src/mcp/invoke/resource.rs +++ b/golem-worker-service/src/mcp/invoke/resource.rs @@ -109,6 +109,7 @@ pub async fn invoke_resource( auth_ctx, proto_principal, None, + None, ) .await .map_err(|e| { diff --git a/golem-worker-service/src/mcp/invoke/test_support.rs b/golem-worker-service/src/mcp/invoke/test_support.rs index 0809bb3f58..5aa036b74f 100644 --- a/golem-worker-service/src/mcp/invoke/test_support.rs +++ b/golem-worker-service/src/mcp/invoke/test_support.rs @@ -511,12 +511,25 @@ impl WorkerClient for RecordingWorkerClient { _: AccountId, _: AuthCtx, _: golem_api_grpc::proto::golem::component::Principal, + _: Option, ) -> WorkerResult { self.agent_ids.lock().unwrap().push(agent_id.clone()); self.method_params.lock().unwrap().push(method_params); Ok(self.invocation_output.clone()) } + async fn deliver_card_transfer( + &self, + _: &AgentId, + _: EnvironmentId, + _: uuid::Uuid, + _: golem_common::model::card::CardId, + _: golem_common::model::card::StoredCard, + _: AuthCtx, + ) -> WorkerResult<()> { + unimplemented!() + } + async fn process_oplog_entries( &self, _: &AgentId, diff --git a/golem-worker-service/src/mcp/invoke/tool.rs b/golem-worker-service/src/mcp/invoke/tool.rs index 40f414eef0..00abb5a807 100644 --- a/golem-worker-service/src/mcp/invoke/tool.rs +++ b/golem-worker-service/src/mcp/invoke/tool.rs @@ -118,6 +118,7 @@ pub async fn invoke_tool( auth_ctx, proto_principal, None, + None, ) .await .map_err(|e| { diff --git a/golem-worker-service/src/service/worker/client.rs b/golem-worker-service/src/service/worker/client.rs index 697d26b05f..b624620abf 100644 --- a/golem-worker-service/src/service/worker/client.rs +++ b/golem-worker-service/src/service/worker/client.rs @@ -26,14 +26,14 @@ use golem_api_grpc::proto::golem::workerexecutor; use golem_api_grpc::proto::golem::workerexecutor::v1::worker_executor_client::WorkerExecutorClient; use golem_api_grpc::proto::golem::workerexecutor::v1::{ ActivatePluginRequest, CancelInvocationRequest, CompletePromiseRequest, ConnectWorkerRequest, - CreateWorkerRequest, DeactivatePluginRequest, ForkWorkerRequest, InterruptWorkerRequest, - ProcessOplogEntriesRequest, ResumeWorkerRequest, RevertWorkerRequest, SearchOplogResponse, - UpdateWorkerRequest, + CreateWorkerRequest, DeactivatePluginRequest, DeliverCardTransferRequest, ForkWorkerRequest, + InterruptWorkerRequest, ProcessOplogEntriesRequest, ResumeWorkerRequest, RevertWorkerRequest, + SearchOplogResponse, UpdateWorkerRequest, }; use golem_common::model::RetryConfig; use golem_common::model::account::{AccountEmail, AccountId}; use golem_common::model::agent::InvocationFreshnessDisposition; -use golem_common::model::card::StoredCard; +use golem_common::model::card::{CardId, StoredCard}; use golem_common::model::component::{ CanonicalFilePath, ComponentId, ComponentRevision, PluginPriority, }; @@ -260,8 +260,19 @@ pub trait WorkerClient: Send + Sync { account_id: AccountId, auth_ctx: AuthCtx, principal: golem_api_grpc::proto::golem::component::Principal, + scope_card: Option, ) -> WorkerResult; + async fn deliver_card_transfer( + &self, + target_agent_id: &AgentId, + environment_id: EnvironmentId, + transfer_id: uuid::Uuid, + source_card_id: CardId, + card: StoredCard, + auth_ctx: AuthCtx, + ) -> WorkerResult<()>; + async fn process_oplog_entries( &self, target_agent_id: &AgentId, @@ -1383,6 +1394,7 @@ impl WorkerClient for WorkerExecutorWorkerClient { account_id: AccountId, auth_ctx: AuthCtx, principal: golem_api_grpc::proto::golem::component::Principal, + scope_card: Option, ) -> WorkerResult { let agent_id = agent_id.clone(); let agent_id_clone = agent_id.clone(); @@ -1419,6 +1431,7 @@ impl WorkerClient for WorkerExecutorWorkerClient { } }, config: config.clone().into_iter().map(Into::into).collect(), + scope_card: scope_card.clone(), }, )) }, @@ -1482,6 +1495,63 @@ impl WorkerClient for WorkerExecutorWorkerClient { Ok(result) } + async fn deliver_card_transfer( + &self, + target_agent_id: &AgentId, + environment_id: EnvironmentId, + transfer_id: uuid::Uuid, + source_card_id: CardId, + card: StoredCard, + auth_ctx: AuthCtx, + ) -> WorkerResult<()> { + let target_agent_id = target_agent_id.clone(); + let card = desert_rust::serialize_to_byte_vec(&card) + .map_err(|error| WorkerServiceError::Internal(error.to_string()))?; + + self.call_worker_executor( + target_agent_id.clone(), + "deliver_card_transfer", + move |worker_executor_client| { + let target_agent_id = target_agent_id.clone(); + let card = card.clone(); + let auth_ctx = auth_ctx.clone(); + Box::pin( + worker_executor_client.deliver_card_transfer(DeliverCardTransferRequest { + target_agent_id: Some(target_agent_id.into()), + environment_id: Some(environment_id.into()), + transfer_id: Some(transfer_id.into()), + card, + auth_ctx: Some(auth_ctx.into()), + source_card_id: Some(source_card_id.0.into()), + }), + ) + }, + |response| match response.into_inner() { + workerexecutor::v1::DeliverCardTransferResponse { + result: + Some( + workerexecutor::v1::deliver_card_transfer_response::Result::Success(_), + ), + } => Ok(()), + workerexecutor::v1::DeliverCardTransferResponse { + result: + Some( + workerexecutor::v1::deliver_card_transfer_response::Result::Failure( + error, + ), + ), + } => Err(error.into()), + workerexecutor::v1::DeliverCardTransferResponse { .. } => { + Err("Empty response".into()) + } + }, + WorkerServiceError::InternalCallError, + ) + .await?; + + Ok(()) + } + async fn process_oplog_entries( &self, target_agent_id: &AgentId, diff --git a/golem-worker-service/src/service/worker/error.rs b/golem-worker-service/src/service/worker/error.rs index 3911e955b5..c8a93ab4ef 100644 --- a/golem-worker-service/src/service/worker/error.rs +++ b/golem-worker-service/src/service/worker/error.rs @@ -130,6 +130,12 @@ impl From for golem_api_grpc::proto::golem::worker::v1::agen code: api::error_code::COMPONENT_NOT_FOUND.to_string(), }) } + WorkerServiceError::GolemError(WorkerExecutorError::PermissionDenied { .. }) => { + Self::Unauthorized(ErrorBody { + error: error.to_safe_string(), + code: api::error_code::AUTH_UNAUTHORIZED.to_string(), + }) + } WorkerServiceError::BadFileType(_) => Self::BadRequest(ErrorsBody { errors: vec![error.to_safe_string()], diff --git a/golem-worker-service/src/service/worker/service.rs b/golem-worker-service/src/service/worker/service.rs index 3be7d2c6e4..169d4efcd6 100644 --- a/golem-worker-service/src/service/worker/service.rs +++ b/golem-worker-service/src/service/worker/service.rs @@ -33,8 +33,8 @@ use golem_common::model::agent::{ }; use golem_common::model::card::owner::{AgentOwnerLeafPattern, AgentOwnerPattern}; use golem_common::model::card::{ - AgentMethodName, AgentResourcePattern, AgentVerb, ClassPermissionTarget, PermissionTarget, - StoredCard, + AgentMethodName, AgentResourcePattern, AgentVerb, CardId, ClassPermissionTarget, + PermissionTarget, StoredCard, }; use golem_common::model::component::{ CanonicalFilePath, ComponentId, ComponentName, ComponentRevision, PluginPriority, @@ -49,6 +49,7 @@ use golem_common::model::worker::{AgentMetadataDto, RevertWorkerTarget}; use golem_common::model::{AgentFilter, AgentFingerprint, AgentId, IdempotencyKey, ScanCursor}; use golem_common::schema::json_input_schema_value_to_typed_schema_value; use golem_common::schema::{SchemaType, TypedSchemaValue}; +use golem_service_base::error::worker_executor::WorkerExecutorError; use golem_service_base::model::auth::AuthCtx; use golem_service_base::model::component::Component; use golem_service_base::model::{ComponentFileSystemNode, GetOplogResponse}; @@ -920,6 +921,43 @@ impl WorkerService { .await } + pub async fn deliver_card_transfer( + &self, + target_agent_id: &AgentId, + environment_id: EnvironmentId, + transfer_id: uuid::Uuid, + source_card_id: CardId, + card: StoredCard, + auth_ctx: AuthCtx, + ) -> WorkerResult<()> { + auth_ctx + .authorize_system_only("deliver permission card transfer") + .map_err(AuthServiceError::Unauthorized)?; + + let component = self + .component_service + .get_current_by_id(target_agent_id.component_id) + .await?; + if component.environment_id != environment_id { + return Err(WorkerExecutorError::invalid_request(format!( + "target agent environment mismatch: expected {}, got {}", + component.environment_id, environment_id + )) + .into()); + } + + self.worker_client + .deliver_card_transfer( + target_agent_id, + environment_id, + transfer_id, + source_card_id, + card, + auth_ctx, + ) + .await + } + pub async fn invoke_agent( &self, agent_id: &AgentId, @@ -935,6 +973,7 @@ impl WorkerService { auth_ctx: AuthCtx, principal: golem_api_grpc::proto::golem::component::Principal, known_environment_id: Option, + scope_card: Option, ) -> WorkerResult { let component = self .component_service @@ -958,6 +997,7 @@ impl WorkerService { account_id, auth_ctx.clone(), principal, + scope_card, |final_agent_id| { authorize_agent_permission( &auth_ctx, @@ -997,6 +1037,7 @@ impl WorkerService { account_id: AccountId, auth_ctx: AuthCtx, principal: golem_api_grpc::proto::golem::component::Principal, + scope_card: Option, authorize: impl FnOnce(&AgentId) -> WorkerResult<()>, ) -> WorkerResult { let observation_only = @@ -1031,6 +1072,7 @@ impl WorkerService { account_id, auth_ctx, principal, + scope_card, ) .await?; output.agent_id.get_or_insert(agent_id); @@ -1252,6 +1294,7 @@ impl WorkerService { component_owner_account_id, auth.clone(), principal, + None, |final_agent_id| { auth.authorize_permission(&PermissionTarget::Agent(ClassPermissionTarget { owner: AgentOwnerPattern::Agent { @@ -1357,7 +1400,10 @@ mod tests { ResolvedAgentType, Snapshotting, ephemeral_invocation_phantom_id, }; use golem_common::model::application::{ApplicationId, ApplicationName}; - use golem_common::model::card::{AgentVerb, StoredCard}; + use golem_common::model::card::{ + AgentPluginName, AgentResourcePattern, AgentVerb, Card, CardId, EffectiveSurface, + PermissionPattern, StoredCard, + }; use golem_common::model::component::{ CanonicalFilePath, ComponentId, ComponentName, ComponentRevision, PluginPriority, }; @@ -1840,8 +1886,11 @@ mod tests { } } + type RecordedCardTransfer = (AgentId, EnvironmentId, Uuid, CardId, StoredCard, AuthCtx); + struct RecordingWorkerClient { created_agent_ids: Mutex>, + delivered_card_transfers: Mutex>, invocations: Mutex>, invocation_output: AgentInvocationOutput, } @@ -1850,6 +1899,7 @@ mod tests { fn new(invocation_output: AgentInvocationOutput) -> Self { Self { created_agent_ids: Mutex::new(Vec::new()), + delivered_card_transfers: Mutex::new(Vec::new()), invocations: Mutex::new(Vec::new()), invocation_output, } @@ -1866,6 +1916,10 @@ mod tests { fn invocations(&self) -> Vec<(AgentId, IdempotencyKey, InvocationFreshnessDisposition)> { self.invocations.lock().unwrap().clone() } + + fn delivered_card_transfers(&self) -> Vec { + self.delivered_card_transfers.lock().unwrap().clone() + } } #[async_trait] @@ -2093,6 +2147,7 @@ mod tests { _: AccountId, _: AuthCtx, _: golem_api_grpc::proto::golem::component::Principal, + _: Option, ) -> WorkerResult { self.invocations.lock().unwrap().push(( agent_id.clone(), @@ -2102,6 +2157,26 @@ mod tests { Ok(self.invocation_output.clone()) } + async fn deliver_card_transfer( + &self, + target_agent_id: &AgentId, + environment_id: EnvironmentId, + transfer_id: uuid::Uuid, + source_card_id: CardId, + card: StoredCard, + auth_ctx: AuthCtx, + ) -> WorkerResult<()> { + self.delivered_card_transfers.lock().unwrap().push(( + target_agent_id.clone(), + environment_id, + transfer_id, + source_card_id, + card, + auth_ctx, + )); + Ok(()) + } + async fn process_oplog_entries( &self, _: &AgentId, @@ -2125,6 +2200,7 @@ mod tests { agent_type_name: AgentTypeName, component_id: ComponentId, component_revision: ComponentRevision, + environment_id: EnvironmentId, } impl RestHarness { @@ -2188,6 +2264,7 @@ mod tests { agent_type_name, component_id, component_revision, + environment_id, } } @@ -2296,6 +2373,21 @@ mod tests { SchemaValue::Record { fields: vec![] } } + fn test_card() -> StoredCard { + StoredCard::Concrete(Card { + card_id: CardId::new(), + parent_ids: vec![], + lower_positive: vec![], + lower_negative: vec![], + upper_positive: vec![], + upper_negative: vec![], + created_at: Utc::now(), + expires_at: None, + system_card: false, + managed_by: None, + }) + } + fn phantom_id(agent_id: &AgentId) -> Option { agent_id .agent_id @@ -2324,6 +2416,113 @@ mod tests { ); } + #[test] + async fn card_transfer_delivery_is_system_only_and_preserves_retry_identity() { + let harness = RestHarness::new(AgentMode::Durable); + let target_agent_id = AgentId { + component_id: harness.component_id, + agent_id: "permission-transfer-target".to_string(), + }; + let transfer_id = Uuid::new_v4(); + let source_card_id = CardId::new(); + let card = test_card(); + + for _ in 0..2 { + harness + .worker_service + .deliver_card_transfer( + &target_agent_id, + harness.environment_id, + transfer_id, + source_card_id, + card.clone(), + AuthCtx::System, + ) + .await + .unwrap(); + } + + assert_eq!( + harness.worker_client.delivered_card_transfers(), + vec![ + ( + target_agent_id.clone(), + harness.environment_id, + transfer_id, + source_card_id, + card.clone(), + AuthCtx::System, + ), + ( + target_agent_id.clone(), + harness.environment_id, + transfer_id, + source_card_id, + card.clone(), + AuthCtx::System, + ), + ] + ); + + let non_system_auth = AuthCtx::agent_with_effective_surface( + AccountId::new(), + AccountEmail::new("caller@golem"), + EffectiveSurface::default(), + ); + assert!( + harness + .worker_service + .deliver_card_transfer( + &target_agent_id, + harness.environment_id, + transfer_id, + source_card_id, + card, + non_system_auth, + ) + .await + .is_err() + ); + assert_eq!( + harness.worker_client.delivered_card_transfers().len(), + 2, + "a non-system request must not reach the executor client" + ); + } + + #[test] + fn card_transfer_wire_payload_preserves_authority_resource_kind() { + let mut permission: PermissionPattern = + "agent(acme/shop/prod/cart/agent) @ acme/shop/prod/cart/agent : activate-plugin : plugin-a" + .parse() + .unwrap(); + match &mut permission { + PermissionPattern::Agent(permission) => { + permission.resource = + AgentResourcePattern::PluginName(AgentPluginName("plugin-a".to_string())); + } + _ => unreachable!(), + } + + let card = StoredCard::Concrete(Card { + card_id: CardId::new(), + parent_ids: vec![], + lower_positive: vec![permission], + lower_negative: vec![], + upper_positive: vec![], + upper_negative: vec![], + created_at: Utc::now(), + expires_at: None, + system_card: false, + managed_by: None, + }); + + let wire_payload = desert_rust::serialize_to_byte_vec(&card).unwrap(); + let decoded: StoredCard = desert_rust::deserialize(&wire_payload).unwrap(); + + assert_eq!(decoded, card, "the transfer payload must preserve the card"); + } + #[test] async fn create_agent_rest_auto_generates_phantom_for_ephemeral_agents() { let harness = RestHarness::new(AgentMode::Ephemeral); @@ -2476,6 +2675,7 @@ mod tests { AuthCtx::system(), Principal::anonymous().into(), None, + None, ) .await .unwrap(); diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index bad65ca9e3..5a4e61d3b0 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -15,6 +15,7 @@ autotests = false golem-api-grpc = { workspace = true } golem-client = { workspace = true } golem-common = { workspace = true } +golem-schema = { workspace = true } golem-service-base = { workspace = true } golem-test-framework = { workspace = true } diff --git a/integration-tests/tests/lib.rs b/integration-tests/tests/lib.rs index 5b38c61781..330a02ef08 100644 --- a/integration-tests/tests/lib.rs +++ b/integration-tests/tests/lib.rs @@ -18,6 +18,7 @@ mod capabilities; mod custom_api; mod fork; mod otlp_plugin; +mod permissions; mod plugins; mod quota; mod rich_types; @@ -45,6 +46,7 @@ tag_suite!(otlp_plugin, group7); tag_suite!(plugins, group7); tag_suite!(custom_api, group10); +tag_suite!(permissions, group10); tag_suite!(quota, group10); tag_suite!(rich_types, group10); tag_suite!(capabilities, group10); @@ -70,6 +72,7 @@ matrix_suite!(fork, db, EnvBasedTestDependencies); matrix_suite!(api, db, EnvBasedTestDependencies); matrix_suite!(agent_config, db, EnvBasedTestDependencies); matrix_suite!(custom_api, db, EnvBasedTestDependencies); +matrix_suite!(permissions, db, EnvBasedTestDependencies); matrix_suite!(quota, db, EnvBasedTestDependencies); matrix_suite!(rich_types, db, EnvBasedTestDependencies); matrix_suite!(capabilities, db, EnvBasedTestDependencies); diff --git a/integration-tests/tests/permissions.rs b/integration-tests/tests/permissions.rs new file mode 100644 index 0000000000..fb793d1313 --- /dev/null +++ b/integration-tests/tests/permissions.rs @@ -0,0 +1,246 @@ +// Copyright 2024-2026 Golem Cloud +// +// Licensed under the Golem Source License v1.1 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://license.golem.cloud/LICENSE +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::Tracing; +use golem_client::api::{RegistryServiceClient, WorkerClient}; +use golem_client::model::StoredCard; +use golem_common::model::agent::AgentTypeName; +use golem_common::model::card::parse_polymorphic_permission; +use golem_common::model::card::recipient::RecipientPattern; +use golem_common::model::component::ComponentName; +use golem_common::model::{AgentStatus, IdempotencyKey, PromiseId}; +use golem_common::{agent_id, data_value}; +use golem_schema::model::{CardId as SchemaCardId, ComponentId as SchemaComponentId}; +use golem_test_framework::config::{EnvBasedTestDependencies, TestDependencies}; +use golem_test_framework::dsl::{TestDsl, TestDslExtended}; +use std::time::Duration; +use test_r::{inherit_test_dep, test, timeout}; +use uuid::Uuid; + +inherit_test_dep!(Tracing); +inherit_test_dep!(EnvBasedTestDependencies); + +fn card_id(card: &StoredCard) -> Uuid { + match card { + StoredCard::Concrete(card) => card.card_id, + StoredCard::Polymorphic(card) => card.card_id, + } +} + +fn parent_ids(card: &StoredCard) -> &[Uuid] { + match card { + StoredCard::Concrete(card) => &card.parent_ids, + StoredCard::Polymorphic(card) => &card.parent_ids, + } +} + +#[test] +#[timeout("8m")] +#[tracing::instrument] +async fn permission_cards_work_across_services_and_replay( + deps: &EnvBasedTestDependencies, + _tracing: &Tracing, +) -> anyhow::Result<()> { + let user = deps.user().await?; + let (app, env) = user.app_and_env().await?; + let component_name = "permissions-e2e"; + let install_target = RecipientPattern::Agent { + account: user.account_email.clone(), + application: app.name.clone(), + environment: env.name.clone(), + component: ComponentName(component_name.to_string()), + agent_type: AgentTypeName("ScopeCardAgent".to_string()), + }; + let account = user.account_email.as_str(); + let component = user + .component(&env.id, "golem_it_host_api_tests_release") + .name(component_name) + .try_update_agent_provision_config("ScopeCardAgent", |config| { + for grant in [ + format!("card({account}) @ * : derive : *"), + format!("card({account}) @ * : inspect : *"), + format!("card({account}) @ * : revoke : *"), + format!( + "card({account}) @ * : install : {}", + install_target.render() + ), + ] { + config + .initial_permissions + .lower_bound + .positive + .push(parse_polymorphic_permission(&grant)?); + } + Ok::<_, golem_common::model::card::CardParseError>(()) + })? + .store() + .await?; + let caller = agent_id!("ScopeCardAgent", "permissions-caller"); + let target = agent_id!("ScopeCardAgent", "permissions-target"); + let caller_worker = user.start_agent(&component.id, caller.clone()).await?; + user.start_agent(&component.id, target.clone()).await?; + + let initial_card_id = component + .metadata + .agent_type_initial_permission_card(&AgentTypeName("ScopeCardAgent".to_string())) + .expect("ScopeCardAgent initial card is missing") + .card_id + .0; + let worker_client = user + .deps + .worker_service() + .worker_http_client(&user.token) + .await; + let caller_wallet = worker_client + .get_agent_wallet(&component.id.0, &caller.to_string()) + .await?; + assert!( + caller_wallet + .iter() + .any(|card| card_id(card) == initial_card_id), + "the deployed initial card must be installed before guest code runs" + ); + + let registry_client = user.registry_service_client().await; + let stored_initial = registry_client.get_card(&initial_card_id).await?; + assert_eq!(card_id(&stored_initial), initial_card_id); + + let (scope_present, scope_parent_matches, scope_grants_match, scope_card_id) = user + .invoke_and_await_agent( + &component, + &caller, + "invoke_and_await_scope", + data_value!("permissions-target"), + ) + .await? + .into_typed::<(bool, bool, bool, SchemaCardId)>()?; + assert_eq!( + (scope_present, scope_parent_matches, scope_grants_match), + (true, true, true) + ); + assert!( + !user + .invoke_and_await_agent(&component, &target, "has_card", data_value!(scope_card_id),) + .await? + .into_typed::()?, + "the exact scope card must not survive invocation end" + ); + + let component_id = SchemaComponentId::from(component.id.0); + let (parent_id, child_id) = user + .invoke_and_await_agent( + &component, + &caller, + "derive_and_install_chain", + data_value!(component_id, caller.to_string(), target.to_string()), + ) + .await? + .into_typed::<(SchemaCardId, SchemaCardId)>()?; + let stored_parent = registry_client.get_card(&parent_id.uuid).await?; + let stored_child = registry_client.get_card(&child_id.uuid).await?; + assert_eq!(parent_ids(&stored_parent), &[initial_card_id]); + assert_eq!(parent_ids(&stored_child), &[parent_id.uuid]); + assert!( + user.invoke_and_await_agent(&component, &target, "has_card", data_value!(child_id),) + .await? + .into_typed::()?, + "the transferred child must be installed in the target wallet" + ); + + let release = user + .invoke_and_await_agent(&component, &caller, "create_release_promise", data_value!()) + .await? + .into_typed::()?; + let replay_key = IdempotencyKey::fresh(); + let replay_params = data_value!(component_id, target.to_string(), release.clone()); + user.invoke_agent_with_key( + &component, + &caller, + &replay_key, + "derive_and_install_after_promise", + replay_params.clone(), + ) + .await?; + user.wait_for_status( + &caller_worker, + AgentStatus::Suspended, + Duration::from_secs(30), + ) + .await?; + user.simulated_crash(&caller_worker).await?; + user.complete_promise(&release, vec![1]).await?; + let replay_card_id = user + .invoke_and_await_agent_with_key( + &component, + &caller, + &replay_key, + "derive_and_install_after_promise", + replay_params, + ) + .await? + .into_typed::()?; + assert_eq!( + card_id(®istry_client.get_card(&replay_card_id.uuid).await?), + replay_card_id.uuid + ); + assert!( + user.invoke_and_await_agent(&component, &target, "has_card", data_value!(replay_card_id),) + .await? + .into_typed::()?, + "the replayed transfer must install exactly the derived card" + ); + + let revoked = user + .invoke_and_await_agent( + &component, + &caller, + "revoke_card_by_id", + data_value!(parent_id), + ) + .await? + .into_typed::()?; + assert_eq!(revoked, 2, "revocation must cut the parent and child"); + assert!( + !user + .invoke_and_await_agent(&component, &target, "has_card", data_value!(child_id),) + .await? + .into_typed::()?, + "the revoked child must be removed at the target's next boundary" + ); + + let caller_wallet = worker_client + .get_agent_wallet(&component.id.0, &caller.to_string()) + .await?; + let target_wallet = worker_client + .get_agent_wallet(&component.id.0, &target.to_string()) + .await?; + assert!( + !caller_wallet + .iter() + .any(|card| card_id(card) == parent_id.uuid) + ); + assert!( + !target_wallet + .iter() + .any(|card| card_id(card) == child_id.uuid) + ); + assert!( + target_wallet + .iter() + .any(|card| card_id(card) == replay_card_id.uuid), + "the unrelated replayed transfer must remain installed" + ); + + Ok(()) +} diff --git a/integration-tests/tests/worker.rs b/integration-tests/tests/worker.rs index b9173ce15d..be0a59fb54 100644 --- a/integration-tests/tests/worker.rs +++ b/integration-tests/tests/worker.rs @@ -26,12 +26,7 @@ use golem_common::model::account::{AccountRevision, AccountSetPlan}; use golem_common::model::account_usage::SetStorageLimit; use golem_common::model::component::{AgentFilePermissions, CanonicalFilePath, ComponentId}; use golem_common::model::oplog::public_oplog_entry::AgentInvocationStartedParams; -use golem_common::model::oplog::{ - OplogIndex, PublicAgentInvocation, PublicOplogEntry, PublicQueuedCardEvent, -}; -use golem_common::model::permission_share::{ - PermissionShareCreation, PermissionShareData, PermissionShareName, -}; +use golem_common::model::oplog::{OplogIndex, PublicOplogEntry}; use golem_common::model::worker::{ AgentConfigEntryDto, AgentFileSystemNode, AgentFileSystemNodeKind, }; @@ -60,15 +55,6 @@ use uuid::Uuid; inherit_test_dep!(Tracing); inherit_test_dep!(EnvBasedTestDependencies); -fn permission_share_data(permission: &str) -> PermissionShareData { - PermissionShareData { - lower_positive: vec![permission.to_string()], - lower_negative: Vec::new(), - upper_positive: Vec::new(), - upper_negative: Vec::new(), - } -} - /// REST/JSON invocation of a method whose only declared input is the /// auto-injected `principal` field. The caller supplies no parameters (the /// host injects the principal out of band), so the invocation must succeed — @@ -186,359 +172,6 @@ async fn dynamic_worker_creation( Ok(()) } -#[test] -#[tracing::instrument] -#[timeout("4m")] -async fn card_host_api_roundtrip( - deps: &EnvBasedTestDependencies, - _tracing: &Tracing, -) -> anyhow::Result<()> { - let user = deps.user().await?; - let (_, env) = user.app_and_env().await?; - let component = user - .component(&env.id, "golem_it_host_api_tests_release") - .name("golem-it:host-api-tests") - .store() - .await?; - let agent_id = agent_id!("GolemHostApi", "card-host-api-roundtrip"); - let _agent_id = user.start_agent(&component.id, agent_id.clone()).await?; - - let result = user - .invoke_and_await_agent(&component, &agent_id, "card_api_roundtrip", data_value!()) - .await? - .into_return_value() - .ok_or_else(|| anyhow!("expected return value"))?; - - assert_eq!( - result, - SchemaValue::Record { - fields: vec![ - SchemaValue::Bool(true), - SchemaValue::Bool(true), - SchemaValue::Bool(true), - SchemaValue::Bool(true), - ] - } - ); - - Ok(()) -} - -#[test] -#[tracing::instrument] -#[timeout("4m")] -async fn card_host_api_observes_revocation( - deps: &EnvBasedTestDependencies, - _tracing: &Tracing, -) -> anyhow::Result<()> { - let owner = deps.user().await?; - let target = deps.user().await?; - let (_, target_env) = target.app_and_env().await?; - - let share = owner - .registry_service_client() - .await - .create_permission_share( - &owner.account_id.0, - &PermissionShareCreation { - target_account_email: target.account_email.clone(), - name: PermissionShareName("card-host-api-revocation".to_string()), - data: permission_share_data(&format!( - "application({}/card-host-api-revocation) @ {} : view :", - owner.account_email.as_str(), - target.account_email.as_str() - )), - }, - ) - .await?; - let card_id = share - .current_card_id - .ok_or_else(|| anyhow!("permission share did not create a card"))?; - let (high_bits, low_bits) = card_id.0.as_u64_pair(); - - let component = target - .component(&target_env.id, "golem_it_host_api_tests_release") - .name("golem-it:host-api-tests") - .store() - .await?; - let agent_id = agent_id!("GolemHostApi", "card-host-api-revocation"); - let _agent_id = target.start_agent(&component.id, agent_id.clone()).await?; - - let install_result = target - .invoke_and_await_agent( - &component, - &agent_id, - "install_card_by_id", - data_value!(high_bits, low_bits), - ) - .await? - .into_return_value() - .ok_or_else(|| anyhow!("expected install return value"))?; - assert_eq!(install_result, SchemaValue::Bool(true)); - - let derive_before_revoke = target - .invoke_and_await_agent( - &component, - &agent_id, - "derive_card_by_id", - data_value!(high_bits, low_bits), - ) - .await? - .into_return_value() - .ok_or_else(|| anyhow!("expected derive return value"))?; - assert_eq!(derive_before_revoke, SchemaValue::Bool(true)); - - owner - .registry_service_client() - .await - .delete_permission_share(&share.id.0, share.revision.into()) - .await?; - - let mut revoked_observed = false; - for _ in 0..40 { - let derive_after_revoke = target - .invoke_and_await_agent( - &component, - &agent_id, - "derive_card_by_id", - data_value!(high_bits, low_bits), - ) - .await? - .into_return_value() - .ok_or_else(|| anyhow!("expected derive return value"))?; - if derive_after_revoke == SchemaValue::Bool(false) { - revoked_observed = true; - break; - } - sleep(Duration::from_millis(250)).await; - } - - assert!(revoked_observed, "revoked card remained installed"); - - Ok(()) -} - -#[test] -#[tracing::instrument] -#[timeout("4m")] -async fn card_host_api_observes_revocation_during_invocation( - deps: &EnvBasedTestDependencies, - _tracing: &Tracing, -) -> anyhow::Result<()> { - let owner = deps.user().await?; - let target = deps.user().await?; - let (_, target_env) = target.app_and_env().await?; - - let share = owner - .registry_service_client() - .await - .create_permission_share( - &owner.account_id.0, - &PermissionShareCreation { - target_account_email: target.account_email.clone(), - name: PermissionShareName("card-mid-invocation-revocation".to_string()), - data: permission_share_data(&format!( - "application({}/card-mid-invocation-revocation) @ {} : view :", - owner.account_email.as_str(), - target.account_email.as_str() - )), - }, - ) - .await?; - let card_id = share - .current_card_id - .ok_or_else(|| anyhow!("permission share did not create a card"))?; - let (high_bits, low_bits) = card_id.0.as_u64_pair(); - - let component = target - .component(&target_env.id, "golem_it_host_api_tests_release") - .name("golem-it:host-api-tests") - .store() - .await?; - let agent_id = agent_id!("GolemHostApi", "card-mid-invocation-revocation"); - let target_agent_id = target.start_agent(&component.id, agent_id.clone()).await?; - - let install_result = target - .invoke_and_await_agent( - &component, - &agent_id, - "install_card_by_id", - data_value!(high_bits, low_bits), - ) - .await? - .into_return_value() - .ok_or_else(|| anyhow!("expected install return value"))?; - assert_eq!(install_result, SchemaValue::Bool(true)); - - let release_promise = target - .invoke_and_await_agent(&component, &agent_id, "create_promise", data_value!()) - .await? - .into_return_value() - .ok_or_else(|| anyhow!("expected release promise"))?; - let release_promise = ::from_value(&release_promise) - .map_err(|error| anyhow!("{error}"))?; - - let invocation = { - let target = target.clone(); - let component = component.clone(); - let agent_id = agent_id.clone(); - let release_promise = release_promise.clone(); - tokio::spawn( - async move { - target - .invoke_and_await_agent( - &component, - &agent_id, - "derive_card_after_promise", - data_value!(high_bits, low_bits, release_promise), - ) - .await - } - .in_current_span(), - ) - }; - - target - .wait_for_status( - &target_agent_id, - AgentStatus::Running, - Duration::from_secs(10), - ) - .await?; - sleep(Duration::from_millis(250)).await; - - owner - .registry_service_client() - .await - .delete_permission_share(&share.id.0, share.revision.into()) - .await?; - - target - .complete_promise(&release_promise, b"release".to_vec()) - .await?; - - let invocation = tokio::time::timeout(Duration::from_secs(30), invocation) - .await - .map_err(|_| anyhow!("bounded invocation did not finish"))?; - let result = invocation?? - .into_return_value() - .ok_or_else(|| anyhow!("expected mid-invocation revocation result"))?; - assert_eq!( - result, - SchemaValue::Record { - fields: vec![SchemaValue::Bool(true), SchemaValue::Bool(false)] - } - ); - - target - .wait_for_status(&target_agent_id, AgentStatus::Idle, Duration::from_secs(10)) - .await?; - - let oplog = target - .get_oplog(&target_agent_id, OplogIndex::INITIAL) - .await?; - - let invocation_started_index = oplog - .iter() - .find_map(|entry| match &entry.entry { - PublicOplogEntry::AgentInvocationStarted(AgentInvocationStartedParams { - invocation: PublicAgentInvocation::AgentMethodInvocation(params), - .. - }) if params.method_name == "derive_card_after_promise" => Some(entry.oplog_index), - _ => None, - }) - .ok_or_else(|| anyhow!("missing invocation start entry"))?; - let queued_event_index = oplog - .iter() - .find_map(|entry| match &entry.entry { - PublicOplogEntry::CardEventQueued(params) - if matches!( - ¶ms.event, - PublicQueuedCardEvent::Revoke(event) if event.card_id == card_id - ) => - { - Some(entry.oplog_index) - } - _ => None, - }) - .ok_or_else(|| anyhow!("card revocation was not queued"))?; - let revoked_event_index = oplog - .iter() - .find_map(|entry| match &entry.entry { - PublicOplogEntry::CardRevoked(params) - if params.queued_event_index == queued_event_index && params.card_id == card_id => - { - Some(entry.oplog_index) - } - _ => None, - }) - .ok_or_else(|| anyhow!("queued card revocation was not applied"))?; - let invocation_finished_index = oplog - .iter() - .find_map(|entry| match &entry.entry { - PublicOplogEntry::AgentInvocationFinished(params) - if params.method_name.as_deref() == Some("derive_card_after_promise") => - { - Some(entry.oplog_index) - } - _ => None, - }) - .ok_or_else(|| anyhow!("missing invocation finish entry"))?; - - let random_boundary_before_queue_index = oplog - .iter() - .find_map(|entry| { - (entry.oplog_index > invocation_started_index - && entry.oplog_index < queued_event_index - && matches!( - &entry.entry, - PublicOplogEntry::Start(params) if params.function_name.contains("random") - )) - .then_some(entry.oplog_index) - }) - .ok_or_else(|| { - anyhow!("card revocation was queued before the first random-call durable boundary") - })?; - let random_boundary_after_revoke_index = oplog - .iter() - .find_map(|entry| { - (entry.oplog_index > revoked_event_index - && entry.oplog_index < invocation_finished_index - && matches!( - &entry.entry, - PublicOplogEntry::Start(params) if params.function_name.contains("random") - )) - .then_some(entry.oplog_index) - }) - .ok_or_else(|| { - anyhow!("no random-call durable boundary processed the queued revocation") - })?; - let derive_after_revoke_index = oplog - .iter() - .find_map(|entry| { - (entry.oplog_index > revoked_event_index - && entry.oplog_index < invocation_finished_index - && matches!( - &entry.entry, - PublicOplogEntry::Start(params) if params.function_name.contains("derive-card") - )) - .then_some(entry.oplog_index) - }) - .ok_or_else(|| anyhow!("card derivation did not run after the revocation was applied"))?; - - assert!( - invocation_started_index < random_boundary_before_queue_index - && random_boundary_before_queue_index < queued_event_index - && queued_event_index < revoked_event_index - && revoked_event_index < random_boundary_after_revoke_index - && random_boundary_after_revoke_index < derive_after_revoke_index - && derive_after_revoke_index < invocation_finished_index, - "card revocation was not processed between durable boundaries of the invocation" - ); - - Ok(()) -} - #[test] #[tracing::instrument] #[timeout("4m")] diff --git a/openapi/golem-registry-service.yaml b/openapi/golem-registry-service.yaml index b5492192bc..dfd60d2f10 100644 --- a/openapi/golem-registry-service.yaml +++ b/openapi/golem-registry-service.yaml @@ -8671,6 +8671,18 @@ components: properties: required: type: boolean + AgentId: + type: object + title: AgentId + required: + - componentId + - agentId + properties: + componentId: + type: string + format: uuid + agentId: + type: string AgentMethodSchema: type: object required: @@ -9749,6 +9761,7 @@ components: - $ref: '#/components/schemas/CardManagedBy_CardManagedByEnvironmentDefault' - $ref: '#/components/schemas/CardManagedBy_CardManagedByPermissionShare' - $ref: '#/components/schemas/CardManagedBy_CardManagedByAgentInitial' + - $ref: '#/components/schemas/CardManagedBy_CardManagedByRuntimeDerived' discriminator: propertyName: type mapping: @@ -9756,6 +9769,7 @@ components: EnvironmentDefault: '#/components/schemas/CardManagedBy_CardManagedByEnvironmentDefault' PermissionShare: '#/components/schemas/CardManagedBy_CardManagedByPermissionShare' AgentInitial: '#/components/schemas/CardManagedBy_CardManagedByAgentInitial' + RuntimeDerived: '#/components/schemas/CardManagedBy_CardManagedByRuntimeDerived' CardManagedByAccountRoot: type: object title: CardManagedByAccountRoot @@ -9799,6 +9813,25 @@ components: permissionShareId: type: string format: uuid + CardManagedByRuntimeDerived: + type: object + title: CardManagedByRuntimeDerived + required: + - environmentId + - agentId + - invocationKey + - oplogIndex + properties: + environmentId: + type: string + format: uuid + agentId: + $ref: '#/components/schemas/AgentId' + invocationKey: + type: string + oplogIndex: + type: integer + format: uint64 CardManagedBy_CardManagedByAccountRoot: allOf: - type: object @@ -9847,6 +9880,18 @@ components: - PermissionShare example: PermissionShare - $ref: '#/components/schemas/CardManagedByPermissionShare' + CardManagedBy_CardManagedByRuntimeDerived: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - RuntimeDerived + example: RuntimeDerived + - $ref: '#/components/schemas/CardManagedByRuntimeDerived' ComponentCreation: type: object title: ComponentCreation @@ -11686,6 +11731,33 @@ components: properties: variableName: type: string + PermissionCardSpec: + type: object + required: + - polymorphic + properties: + polymorphic: + type: boolean + PermissionCardValuePayload: + type: object + required: + - cardId + - polymorphic + properties: + cardId: + type: string + format: uuid + parentIds: + type: array + items: + type: string + format: uuid + expiresAt: + type: string + format: date-time + nullable: true + polymorphic: + type: boolean PermissionShare: type: object title: PermissionShare @@ -13192,6 +13264,24 @@ components: $ref: '#/components/schemas/QuotaTokenSpec' metadata: $ref: '#/components/schemas/MetadataEnvelope' + - type: object + required: + - kind + - value + properties: + kind: + type: string + enum: + - permission-card + value: + type: object + required: + - spec + properties: + spec: + $ref: '#/components/schemas/PermissionCardSpec' + metadata: + $ref: '#/components/schemas/MetadataEnvelope' - type: object required: - kind @@ -13693,6 +13783,17 @@ components: - quota-token value: $ref: '#/components/schemas/QuotaTokenValuePayload' + - type: object + required: + - kind + - value + properties: + kind: + type: string + enum: + - permission-card + value: + $ref: '#/components/schemas/PermissionCardValuePayload' SecretSpec: type: object properties: diff --git a/openapi/golem-service.yaml b/openapi/golem-service.yaml index 2430a12d4f..08b8a5b172 100644 --- a/openapi/golem-service.yaml +++ b/openapi/golem-service.yaml @@ -10591,6 +10591,15 @@ paths: - Token: [] components: schemas: + AccountCardHolder: + title: AccountCardHolder + type: object + properties: + accountId: + type: string + format: uuid + required: + - accountId ActivatePluginResponse: title: ActivatePluginResponse type: object @@ -10604,6 +10613,14 @@ components: $ref: '#/components/schemas/AgentFilter' required: - filters + AgentCardHolder: + title: AgentCardHolder + type: object + properties: + agentId: + $ref: '#/components/schemas/AgentId' + required: + - agentId AgentConfigEntryDto: title: AgentConfigEntryDto type: object @@ -11823,6 +11840,15 @@ components: required: - limitMs - inner + ApplicationCardHolder: + title: ApplicationCardHolder + type: object + properties: + applicationId: + type: string + format: uuid + required: + - applicationId BinaryRestrictions: type: object properties: @@ -11907,6 +11933,54 @@ components: - upperNegative - createdAt - systemCard + CardHolder: + discriminator: + propertyName: type + mapping: + Account: '#/components/schemas/CardHolder_AccountCardHolder' + Application: '#/components/schemas/CardHolder_ApplicationCardHolder' + Agent: '#/components/schemas/CardHolder_AgentCardHolder' + type: object + oneOf: + - $ref: '#/components/schemas/CardHolder_AccountCardHolder' + - $ref: '#/components/schemas/CardHolder_ApplicationCardHolder' + - $ref: '#/components/schemas/CardHolder_AgentCardHolder' + CardHolder_AccountCardHolder: + allOf: + - type: object + properties: + type: + example: Account + type: string + enum: + - Account + required: + - type + - $ref: '#/components/schemas/AccountCardHolder' + CardHolder_AgentCardHolder: + allOf: + - type: object + properties: + type: + example: Agent + type: string + enum: + - Agent + required: + - type + - $ref: '#/components/schemas/AgentCardHolder' + CardHolder_ApplicationCardHolder: + allOf: + - type: object + properties: + type: + example: Application + type: string + enum: + - Application + required: + - type + - $ref: '#/components/schemas/ApplicationCardHolder' CardInstallFailure: type: string enum: @@ -11922,12 +11996,14 @@ components: EnvironmentDefault: '#/components/schemas/CardManagedBy_CardManagedByEnvironmentDefault' PermissionShare: '#/components/schemas/CardManagedBy_CardManagedByPermissionShare' AgentInitial: '#/components/schemas/CardManagedBy_CardManagedByAgentInitial' + RuntimeDerived: '#/components/schemas/CardManagedBy_CardManagedByRuntimeDerived' type: object oneOf: - $ref: '#/components/schemas/CardManagedBy_CardManagedByAccountRoot' - $ref: '#/components/schemas/CardManagedBy_CardManagedByEnvironmentDefault' - $ref: '#/components/schemas/CardManagedBy_CardManagedByPermissionShare' - $ref: '#/components/schemas/CardManagedBy_CardManagedByAgentInitial' + - $ref: '#/components/schemas/CardManagedBy_CardManagedByRuntimeDerived' CardManagedByAccountRoot: title: CardManagedByAccountRoot type: object @@ -11971,6 +12047,25 @@ components: format: uuid required: - permissionShareId + CardManagedByRuntimeDerived: + title: CardManagedByRuntimeDerived + type: object + properties: + environmentId: + type: string + format: uuid + agentId: + $ref: '#/components/schemas/AgentId' + invocationKey: + type: string + oplogIndex: + type: integer + format: uint64 + required: + - environmentId + - agentId + - invocationKey + - oplogIndex CardManagedBy_CardManagedByAccountRoot: allOf: - type: object @@ -12019,6 +12114,18 @@ components: required: - type - $ref: '#/components/schemas/CardManagedByPermissionShare' + CardManagedBy_CardManagedByRuntimeDerived: + allOf: + - type: object + properties: + type: + example: RuntimeDerived + type: string + enum: + - RuntimeDerived + required: + - type + - $ref: '#/components/schemas/CardManagedByRuntimeDerived' CompleteParameters: title: CompleteParameters type: object @@ -12593,6 +12700,33 @@ components: required: - timestamp - targetRevision + PermissionCardSpec: + type: object + properties: + polymorphic: + type: boolean + required: + - polymorphic + PermissionCardValuePayload: + type: object + properties: + cardId: + type: string + format: uuid + parentIds: + type: array + items: + type: string + format: uuid + expiresAt: + nullable: true + type: string + format: date-time + polymorphic: + type: boolean + required: + - cardId + - polymorphic PersistenceLevel: type: string enum: @@ -12946,6 +13080,17 @@ components: type: string required: - spanId + PublicInvocationWalletPin: + title: PublicInvocationWalletPin + type: object + properties: + walletToken: + $ref: '#/components/schemas/WalletVersionToken' + scopeCardId: + type: string + format: uuid + required: + - walletToken PublicLocalSpanData: title: PublicLocalSpanData type: object @@ -13048,6 +13193,11 @@ components: CardInstallFailed: '#/components/schemas/PublicOplogEntry_r#CardInstallFailedParams' CardRevoked: '#/components/schemas/PublicOplogEntry_r#CardRevokedParams' CardExpired: '#/components/schemas/PublicOplogEntry_r#CardExpiredParams' + CardDerived: '#/components/schemas/PublicOplogEntry_r#CardDerivedParams' + CardTransferStarted: '#/components/schemas/PublicOplogEntry_r#CardTransferStartedParams' + CardTransferred: '#/components/schemas/PublicOplogEntry_r#CardTransferredParams' + CardRevokedCascade: '#/components/schemas/PublicOplogEntry_r#CardRevokedCascadeParams' + CardTransferConfirmed: '#/components/schemas/PublicOplogEntry_r#CardTransferConfirmedParams' HostStreamFrame: '#/components/schemas/PublicOplogEntry_r#HostStreamFrameParams' CompletionDiscarded: '#/components/schemas/PublicOplogEntry_r#CompletionDiscardedParams' type: object @@ -13098,6 +13248,11 @@ components: - $ref: '#/components/schemas/PublicOplogEntry_r#CardInstallFailedParams' - $ref: '#/components/schemas/PublicOplogEntry_r#CardRevokedParams' - $ref: '#/components/schemas/PublicOplogEntry_r#CardExpiredParams' + - $ref: '#/components/schemas/PublicOplogEntry_r#CardDerivedParams' + - $ref: '#/components/schemas/PublicOplogEntry_r#CardTransferStartedParams' + - $ref: '#/components/schemas/PublicOplogEntry_r#CardTransferredParams' + - $ref: '#/components/schemas/PublicOplogEntry_r#CardRevokedCascadeParams' + - $ref: '#/components/schemas/PublicOplogEntry_r#CardTransferConfirmedParams' - $ref: '#/components/schemas/PublicOplogEntry_r#HostStreamFrameParams' - $ref: '#/components/schemas/PublicOplogEntry_r#CompletionDiscardedParams' PublicOplogEntryWithIndex: @@ -13196,6 +13351,18 @@ components: required: - type - $ref: '#/components/schemas/r#CancelledParams' + PublicOplogEntry_r#CardDerivedParams: + allOf: + - type: object + properties: + type: + example: CardDerived + type: string + enum: + - CardDerived + required: + - type + - $ref: '#/components/schemas/r#CardDerivedParams' PublicOplogEntry_r#CardEventQueuedParams: allOf: - type: object @@ -13244,6 +13411,18 @@ components: required: - type - $ref: '#/components/schemas/r#CardInstalledParams' + PublicOplogEntry_r#CardRevokedCascadeParams: + allOf: + - type: object + properties: + type: + example: CardRevokedCascade + type: string + enum: + - CardRevokedCascade + required: + - type + - $ref: '#/components/schemas/r#CardRevokedCascadeParams' PublicOplogEntry_r#CardRevokedParams: allOf: - type: object @@ -13256,6 +13435,42 @@ components: required: - type - $ref: '#/components/schemas/r#CardRevokedParams' + PublicOplogEntry_r#CardTransferConfirmedParams: + allOf: + - type: object + properties: + type: + example: CardTransferConfirmed + type: string + enum: + - CardTransferConfirmed + required: + - type + - $ref: '#/components/schemas/r#CardTransferConfirmedParams' + PublicOplogEntry_r#CardTransferStartedParams: + allOf: + - type: object + properties: + type: + example: CardTransferStarted + type: string + enum: + - CardTransferStarted + required: + - type + - $ref: '#/components/schemas/r#CardTransferStartedParams' + PublicOplogEntry_r#CardTransferredParams: + allOf: + - type: object + properties: + type: + example: CardTransferred + type: string + enum: + - CardTransferred + required: + - type + - $ref: '#/components/schemas/r#CardTransferredParams' PublicOplogEntry_r#ChangePersistenceLevelParams: allOf: - type: object @@ -13694,10 +13909,14 @@ components: mapping: Install: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventCard' Revoke: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventCard' + TransferStarted: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventTransfer' + TransferReceived: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventTransferReceived' type: object oneOf: - $ref: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventCard' - $ref: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventCard' + - $ref: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventTransfer' + - $ref: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventTransferReceived' PublicQueuedCardEventCard: title: PublicQueuedCardEventCard type: object @@ -13707,6 +13926,35 @@ components: format: uuid required: - cardId + PublicQueuedCardEventTransfer: + title: PublicQueuedCardEventTransfer + type: object + properties: + transferId: + type: string + format: uuid + cardId: + type: string + format: uuid + targetHolder: + $ref: '#/components/schemas/CardHolder' + required: + - transferId + - cardId + - targetHolder + PublicQueuedCardEventTransferReceived: + title: PublicQueuedCardEventTransferReceived + type: object + properties: + transferId: + type: string + format: uuid + cardId: + type: string + format: uuid + required: + - transferId + - cardId PublicQueuedCardEvent_PublicQueuedCardEventCard: allOf: - type: object @@ -13719,6 +13967,30 @@ components: required: - type - $ref: '#/components/schemas/PublicQueuedCardEventCard' + PublicQueuedCardEvent_PublicQueuedCardEventTransfer: + allOf: + - type: object + properties: + type: + example: TransferStarted + type: string + enum: + - TransferStarted + required: + - type + - $ref: '#/components/schemas/PublicQueuedCardEventTransfer' + PublicQueuedCardEvent_PublicQueuedCardEventTransferReceived: + allOf: + - type: object + properties: + type: + example: TransferReceived + type: string + enum: + - TransferReceived + required: + - type + - $ref: '#/components/schemas/PublicQueuedCardEventTransferReceived' PublicRetryPolicyState: description: |- API-facing representation of a [`RetryPolicyState`](crate::model::retry_policy::RetryPolicyState), @@ -14913,6 +15185,24 @@ components: required: - kind - value + - type: object + properties: + kind: + type: string + enum: + - permission-card + value: + type: object + properties: + spec: + $ref: '#/components/schemas/PermissionCardSpec' + metadata: + $ref: '#/components/schemas/MetadataEnvelope' + required: + - spec + required: + - kind + - value - type: object properties: kind: @@ -15414,6 +15704,17 @@ components: required: - kind - value + - type: object + properties: + kind: + type: string + enum: + - permission-card + value: + $ref: '#/components/schemas/PermissionCardValuePayload' + required: + - kind + - value SecretSpec: type: object properties: @@ -15723,6 +16024,23 @@ components: type: string required: - version + WalletVersionToken: + title: WalletVersionToken + type: object + properties: + walletIdHash: + type: array + items: + type: integer + format: uint8 + minLength: 32 + maxLength: 32 + generation: + type: integer + format: uint64 + required: + - walletIdHash + - generation WorkerCreationResponse: title: WorkerCreationResponse type: object @@ -15831,6 +16149,8 @@ components: format: date-time invocation: $ref: '#/components/schemas/PublicAgentInvocation' + walletPin: + $ref: '#/components/schemas/PublicInvocationWalletPin' required: - timestamp - invocation @@ -15882,6 +16202,28 @@ components: required: - timestamp - startIndex + r#CardDerivedParams: + title: r#CardDerivedParams + type: object + properties: + timestamp: + type: string + format: date-time + cardId: + type: string + format: uuid + parentIds: + type: array + items: + type: string + format: uuid + walletGeneration: + type: integer + format: uint64 + required: + - timestamp + - cardId + - parentIds r#CardEventQueuedParams: title: r#CardEventQueuedParams type: object @@ -15904,6 +16246,9 @@ components: cardId: type: string format: uuid + walletGeneration: + type: integer + format: uint64 required: - timestamp - cardId @@ -15940,9 +16285,31 @@ components: cardId: type: string format: uuid + walletGeneration: + type: integer + format: uint64 required: - timestamp - cardId + r#CardRevokedCascadeParams: + title: r#CardRevokedCascadeParams + type: object + properties: + timestamp: + type: string + format: date-time + revokedCardIds: + type: array + items: + type: string + format: uuid + localWalletGeneration: + description: New generation of the wallet that owns this oplog entry. + type: integer + format: uint64 + required: + - timestamp + - revokedCardIds r#CardRevokedParams: title: r#CardRevokedParams type: object @@ -15956,10 +16323,92 @@ components: cardId: type: string format: uuid + walletGeneration: + type: integer + format: uint64 required: - timestamp - queuedEventIndex - cardId + r#CardTransferConfirmedParams: + title: r#CardTransferConfirmedParams + type: object + properties: + timestamp: + type: string + format: date-time + transferId: + description: Identifies a target-admission receipt recorded by the source agent. + type: string + format: uuid + sourceCardId: + type: string + format: uuid + installedCardId: + type: string + format: uuid + targetHolder: + $ref: '#/components/schemas/CardHolder' + required: + - timestamp + - transferId + - sourceCardId + - installedCardId + - targetHolder + r#CardTransferStartedParams: + title: r#CardTransferStartedParams + type: object + properties: + timestamp: + type: string + format: date-time + transferId: + description: Identifies a transfer intent recorded by its source agent. + type: string + format: uuid + cardId: + type: string + format: uuid + targetHolder: + $ref: '#/components/schemas/CardHolder' + sourceWalletGeneration: + description: New generation of the source wallet that owns this oplog entry. + type: integer + format: uint64 + required: + - timestamp + - transferId + - cardId + - targetHolder + r#CardTransferredParams: + title: r#CardTransferredParams + type: object + properties: + timestamp: + type: string + format: date-time + transferId: + description: Identifies a target admission recorded by the target agent. + type: string + format: uuid + sourceCardId: + description: Source card identity, absent only on legacy entries. + type: string + format: uuid + installedCardId: + type: string + format: uuid + targetHolder: + $ref: '#/components/schemas/CardHolder' + targetWalletGeneration: + description: New generation of the target wallet that owns this oplog entry. + type: integer + format: uint64 + required: + - timestamp + - transferId + - installedCardId + - targetHolder r#ChangePersistenceLevelParams: title: r#ChangePersistenceLevelParams type: object diff --git a/openapi/golem-worker-service.yaml b/openapi/golem-worker-service.yaml index 7289adef6e..b8a298aee0 100644 --- a/openapi/golem-worker-service.yaml +++ b/openapi/golem-worker-service.yaml @@ -2059,6 +2059,15 @@ paths: operationId: create_agent components: schemas: + AccountCardHolder: + type: object + title: AccountCardHolder + required: + - accountId + properties: + accountId: + type: string + format: uuid ActivatePluginResponse: type: object title: ActivatePluginResponse @@ -2072,6 +2081,14 @@ components: type: array items: $ref: '#/components/schemas/AgentFilter' + AgentCardHolder: + type: object + title: AgentCardHolder + required: + - agentId + properties: + agentId: + $ref: '#/components/schemas/AgentId' AgentConfigEntryDto: type: object title: AgentConfigEntryDto @@ -3291,6 +3308,15 @@ components: format: uint64 inner: $ref: '#/components/schemas/ApiRetryPolicy' + ApplicationCardHolder: + type: object + title: ApplicationCardHolder + required: + - applicationId + properties: + applicationId: + type: string + format: uuid BinaryRestrictions: type: object properties: @@ -3375,6 +3401,54 @@ components: type: boolean managedBy: $ref: '#/components/schemas/CardManagedBy' + CardHolder: + type: object + oneOf: + - $ref: '#/components/schemas/CardHolder_AccountCardHolder' + - $ref: '#/components/schemas/CardHolder_ApplicationCardHolder' + - $ref: '#/components/schemas/CardHolder_AgentCardHolder' + discriminator: + propertyName: type + mapping: + Account: '#/components/schemas/CardHolder_AccountCardHolder' + Application: '#/components/schemas/CardHolder_ApplicationCardHolder' + Agent: '#/components/schemas/CardHolder_AgentCardHolder' + CardHolder_AccountCardHolder: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - Account + example: Account + - $ref: '#/components/schemas/AccountCardHolder' + CardHolder_AgentCardHolder: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - Agent + example: Agent + - $ref: '#/components/schemas/AgentCardHolder' + CardHolder_ApplicationCardHolder: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - Application + example: Application + - $ref: '#/components/schemas/ApplicationCardHolder' CardInstallFailure: type: string enum: @@ -3389,6 +3463,7 @@ components: - $ref: '#/components/schemas/CardManagedBy_CardManagedByEnvironmentDefault' - $ref: '#/components/schemas/CardManagedBy_CardManagedByPermissionShare' - $ref: '#/components/schemas/CardManagedBy_CardManagedByAgentInitial' + - $ref: '#/components/schemas/CardManagedBy_CardManagedByRuntimeDerived' discriminator: propertyName: type mapping: @@ -3396,6 +3471,7 @@ components: EnvironmentDefault: '#/components/schemas/CardManagedBy_CardManagedByEnvironmentDefault' PermissionShare: '#/components/schemas/CardManagedBy_CardManagedByPermissionShare' AgentInitial: '#/components/schemas/CardManagedBy_CardManagedByAgentInitial' + RuntimeDerived: '#/components/schemas/CardManagedBy_CardManagedByRuntimeDerived' CardManagedByAccountRoot: type: object title: CardManagedByAccountRoot @@ -3439,6 +3515,25 @@ components: permissionShareId: type: string format: uuid + CardManagedByRuntimeDerived: + type: object + title: CardManagedByRuntimeDerived + required: + - environmentId + - agentId + - invocationKey + - oplogIndex + properties: + environmentId: + type: string + format: uuid + agentId: + $ref: '#/components/schemas/AgentId' + invocationKey: + type: string + oplogIndex: + type: integer + format: uint64 CardManagedBy_CardManagedByAccountRoot: allOf: - type: object @@ -3487,6 +3582,18 @@ components: - PermissionShare example: PermissionShare - $ref: '#/components/schemas/CardManagedByPermissionShare' + CardManagedBy_CardManagedByRuntimeDerived: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - RuntimeDerived + example: RuntimeDerived + - $ref: '#/components/schemas/CardManagedByRuntimeDerived' CompleteParameters: type: object title: CompleteParameters @@ -4061,6 +4168,33 @@ components: targetRevision: type: integer format: uint64 + PermissionCardSpec: + type: object + required: + - polymorphic + properties: + polymorphic: + type: boolean + PermissionCardValuePayload: + type: object + required: + - cardId + - polymorphic + properties: + cardId: + type: string + format: uuid + parentIds: + type: array + items: + type: string + format: uuid + expiresAt: + type: string + format: date-time + nullable: true + polymorphic: + type: boolean PersistenceLevel: type: string enum: @@ -4414,6 +4548,17 @@ components: properties: spanId: type: string + PublicInvocationWalletPin: + type: object + title: PublicInvocationWalletPin + required: + - walletToken + properties: + walletToken: + $ref: '#/components/schemas/WalletVersionToken' + scopeCardId: + type: string + format: uuid PublicLocalSpanData: type: object title: PublicLocalSpanData @@ -4515,6 +4660,11 @@ components: - $ref: '#/components/schemas/PublicOplogEntry_r#CardInstallFailedParams' - $ref: '#/components/schemas/PublicOplogEntry_r#CardRevokedParams' - $ref: '#/components/schemas/PublicOplogEntry_r#CardExpiredParams' + - $ref: '#/components/schemas/PublicOplogEntry_r#CardDerivedParams' + - $ref: '#/components/schemas/PublicOplogEntry_r#CardTransferStartedParams' + - $ref: '#/components/schemas/PublicOplogEntry_r#CardTransferredParams' + - $ref: '#/components/schemas/PublicOplogEntry_r#CardRevokedCascadeParams' + - $ref: '#/components/schemas/PublicOplogEntry_r#CardTransferConfirmedParams' - $ref: '#/components/schemas/PublicOplogEntry_r#HostStreamFrameParams' - $ref: '#/components/schemas/PublicOplogEntry_r#CompletionDiscardedParams' discriminator: @@ -4566,6 +4716,11 @@ components: CardInstallFailed: '#/components/schemas/PublicOplogEntry_r#CardInstallFailedParams' CardRevoked: '#/components/schemas/PublicOplogEntry_r#CardRevokedParams' CardExpired: '#/components/schemas/PublicOplogEntry_r#CardExpiredParams' + CardDerived: '#/components/schemas/PublicOplogEntry_r#CardDerivedParams' + CardTransferStarted: '#/components/schemas/PublicOplogEntry_r#CardTransferStartedParams' + CardTransferred: '#/components/schemas/PublicOplogEntry_r#CardTransferredParams' + CardRevokedCascade: '#/components/schemas/PublicOplogEntry_r#CardRevokedCascadeParams' + CardTransferConfirmed: '#/components/schemas/PublicOplogEntry_r#CardTransferConfirmedParams' HostStreamFrame: '#/components/schemas/PublicOplogEntry_r#HostStreamFrameParams' CompletionDiscarded: '#/components/schemas/PublicOplogEntry_r#CompletionDiscardedParams' PublicOplogEntryWithIndex: @@ -4664,6 +4819,18 @@ components: - Cancelled example: Cancelled - $ref: '#/components/schemas/r#CancelledParams' + PublicOplogEntry_r#CardDerivedParams: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - CardDerived + example: CardDerived + - $ref: '#/components/schemas/r#CardDerivedParams' PublicOplogEntry_r#CardEventQueuedParams: allOf: - type: object @@ -4712,6 +4879,18 @@ components: - CardInstalled example: CardInstalled - $ref: '#/components/schemas/r#CardInstalledParams' + PublicOplogEntry_r#CardRevokedCascadeParams: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - CardRevokedCascade + example: CardRevokedCascade + - $ref: '#/components/schemas/r#CardRevokedCascadeParams' PublicOplogEntry_r#CardRevokedParams: allOf: - type: object @@ -4724,6 +4903,42 @@ components: - CardRevoked example: CardRevoked - $ref: '#/components/schemas/r#CardRevokedParams' + PublicOplogEntry_r#CardTransferConfirmedParams: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - CardTransferConfirmed + example: CardTransferConfirmed + - $ref: '#/components/schemas/r#CardTransferConfirmedParams' + PublicOplogEntry_r#CardTransferStartedParams: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - CardTransferStarted + example: CardTransferStarted + - $ref: '#/components/schemas/r#CardTransferStartedParams' + PublicOplogEntry_r#CardTransferredParams: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - CardTransferred + example: CardTransferred + - $ref: '#/components/schemas/r#CardTransferredParams' PublicOplogEntry_r#ChangePersistenceLevelParams: allOf: - type: object @@ -5161,11 +5376,15 @@ components: oneOf: - $ref: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventCard' - $ref: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventCard' + - $ref: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventTransfer' + - $ref: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventTransferReceived' discriminator: propertyName: type mapping: Install: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventCard' Revoke: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventCard' + TransferStarted: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventTransfer' + TransferReceived: '#/components/schemas/PublicQueuedCardEvent_PublicQueuedCardEventTransferReceived' PublicQueuedCardEventCard: type: object title: PublicQueuedCardEventCard @@ -5175,6 +5394,35 @@ components: cardId: type: string format: uuid + PublicQueuedCardEventTransfer: + type: object + title: PublicQueuedCardEventTransfer + required: + - transferId + - cardId + - targetHolder + properties: + transferId: + type: string + format: uuid + cardId: + type: string + format: uuid + targetHolder: + $ref: '#/components/schemas/CardHolder' + PublicQueuedCardEventTransferReceived: + type: object + title: PublicQueuedCardEventTransferReceived + required: + - transferId + - cardId + properties: + transferId: + type: string + format: uuid + cardId: + type: string + format: uuid PublicQueuedCardEvent_PublicQueuedCardEventCard: allOf: - type: object @@ -5187,6 +5435,30 @@ components: - Revoke example: Revoke - $ref: '#/components/schemas/PublicQueuedCardEventCard' + PublicQueuedCardEvent_PublicQueuedCardEventTransfer: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - TransferStarted + example: TransferStarted + - $ref: '#/components/schemas/PublicQueuedCardEventTransfer' + PublicQueuedCardEvent_PublicQueuedCardEventTransferReceived: + allOf: + - type: object + required: + - type + properties: + type: + type: string + enum: + - TransferReceived + example: TransferReceived + - $ref: '#/components/schemas/PublicQueuedCardEventTransferReceived' PublicRetryPolicyState: type: object description: |- @@ -6381,6 +6653,24 @@ components: $ref: '#/components/schemas/QuotaTokenSpec' metadata: $ref: '#/components/schemas/MetadataEnvelope' + - type: object + required: + - kind + - value + properties: + kind: + type: string + enum: + - permission-card + value: + type: object + required: + - spec + properties: + spec: + $ref: '#/components/schemas/PermissionCardSpec' + metadata: + $ref: '#/components/schemas/MetadataEnvelope' - type: object required: - kind @@ -6882,6 +7172,17 @@ components: - quota-token value: $ref: '#/components/schemas/QuotaTokenValuePayload' + - type: object + required: + - kind + - value + properties: + kind: + type: string + enum: + - permission-card + value: + $ref: '#/components/schemas/PermissionCardValuePayload' SecretSpec: type: object properties: @@ -7191,6 +7492,23 @@ components: properties: version: type: string + WalletVersionToken: + type: object + title: WalletVersionToken + required: + - walletIdHash + - generation + properties: + walletIdHash: + type: array + items: + type: integer + format: uint8 + maxLength: 32 + minLength: 32 + generation: + type: integer + format: uint64 WorkerCreationResponse: type: object title: WorkerCreationResponse @@ -7302,6 +7620,8 @@ components: format: date-time invocation: $ref: '#/components/schemas/PublicAgentInvocation' + walletPin: + $ref: '#/components/schemas/PublicInvocationWalletPin' r#BeginAtomicRegionParams: type: object title: r#BeginAtomicRegionParams @@ -7350,6 +7670,28 @@ components: format: uint64 partial: $ref: '#/components/schemas/TypedSchemaValue' + r#CardDerivedParams: + type: object + title: r#CardDerivedParams + required: + - timestamp + - cardId + - parentIds + properties: + timestamp: + type: string + format: date-time + cardId: + type: string + format: uuid + parentIds: + type: array + items: + type: string + format: uuid + walletGeneration: + type: integer + format: uint64 r#CardEventQueuedParams: type: object title: r#CardEventQueuedParams @@ -7375,6 +7717,9 @@ components: cardId: type: string format: uuid + walletGeneration: + type: integer + format: uint64 r#CardInstallFailedParams: type: object title: r#CardInstallFailedParams @@ -7411,6 +7756,28 @@ components: cardId: type: string format: uuid + walletGeneration: + type: integer + format: uint64 + r#CardRevokedCascadeParams: + type: object + title: r#CardRevokedCascadeParams + required: + - timestamp + - revokedCardIds + properties: + timestamp: + type: string + format: date-time + revokedCardIds: + type: array + items: + type: string + format: uuid + localWalletGeneration: + type: integer + format: uint64 + description: New generation of the wallet that owns this oplog entry. r#CardRevokedParams: type: object title: r#CardRevokedParams @@ -7428,6 +7795,88 @@ components: cardId: type: string format: uuid + walletGeneration: + type: integer + format: uint64 + r#CardTransferConfirmedParams: + type: object + title: r#CardTransferConfirmedParams + required: + - timestamp + - transferId + - sourceCardId + - installedCardId + - targetHolder + properties: + timestamp: + type: string + format: date-time + transferId: + type: string + format: uuid + description: Identifies a target-admission receipt recorded by the source agent. + sourceCardId: + type: string + format: uuid + installedCardId: + type: string + format: uuid + targetHolder: + $ref: '#/components/schemas/CardHolder' + r#CardTransferStartedParams: + type: object + title: r#CardTransferStartedParams + required: + - timestamp + - transferId + - cardId + - targetHolder + properties: + timestamp: + type: string + format: date-time + transferId: + type: string + format: uuid + description: Identifies a transfer intent recorded by its source agent. + cardId: + type: string + format: uuid + targetHolder: + $ref: '#/components/schemas/CardHolder' + sourceWalletGeneration: + type: integer + format: uint64 + description: New generation of the source wallet that owns this oplog entry. + r#CardTransferredParams: + type: object + title: r#CardTransferredParams + required: + - timestamp + - transferId + - installedCardId + - targetHolder + properties: + timestamp: + type: string + format: date-time + transferId: + type: string + format: uuid + description: Identifies a target admission recorded by the target agent. + sourceCardId: + type: string + format: uuid + description: Source card identity, absent only on legacy entries. + installedCardId: + type: string + format: uuid + targetHolder: + $ref: '#/components/schemas/CardHolder' + targetWalletGeneration: + type: integer + format: uint64 + description: New generation of the target wallet that owns this oplog entry. r#ChangePersistenceLevelParams: type: object title: r#ChangePersistenceLevelParams diff --git a/sdks/moonbit/golem_sdk/gen/ffi.mbt b/sdks/moonbit/golem_sdk/gen/ffi.mbt index e35c7d7c5c..f9211b1149 100644 --- a/sdks/moonbit/golem_sdk/gen/ffi.mbt +++ b/sdks/moonbit/golem_sdk/gen/ffi.mbt @@ -2,166 +2,129 @@ ///| pub fn mbt_ffi_cabi_realloc( - src_offset : Int, - src_size : Int, - _dst_alignment : Int, - dst_size : Int, +src_offset : Int, +src_size : Int, +_dst_alignment : Int, +dst_size : Int, ) -> Int { - // malloc - if src_offset == 0 && src_size == 0 { - return mbt_ffi_malloc(dst_size) - } - // free - if dst_size == 0 { - mbt_ffi_free(src_offset) - return 0 - } - // realloc - let dst = mbt_ffi_malloc(dst_size) - mbt_ffi_copy( - dst, - src_offset, - if src_size < dst_size { - src_size - } else { - dst_size - }, - ) - mbt_ffi_free(src_offset) - dst + // malloc + if src_offset == 0 && src_size == 0 { + return mbt_ffi_malloc(dst_size) + } + // free + if dst_size == 0 { + mbt_ffi_free(src_offset) + return 0 + } + // realloc + let dst = mbt_ffi_malloc(dst_size) + mbt_ffi_copy(dst, src_offset, if src_size < dst_size { src_size } else { dst_size }) + mbt_ffi_free(src_offset) + dst } ///| extern "wasm" fn mbt_ffi_copy(dest : Int, src : Int, len : Int) = - #|(func (param i32) (param i32) (param i32) local.get 0 local.get 1 local.get 2 memory.copy) +#|(func (param i32) (param i32) (param i32) local.get 0 local.get 1 local.get 2 memory.copy) ///| extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#|(func (param i32) local.get 0 call $moonbit.decref) -///| #doc(hidden) pub fn wasmExportInitialize(p0 : Int) -> Int { - @guest0.wasmExportInitialize(p0) + @guest0.wasmExportInitialize(p0) } -///| #doc(hidden) -pub fn wasmExportAsyncInitialize( - event_raw : Int, - waitable : Int, - code : Int, -) -> Int { - @guest0.wasmExportAsyncInitialize(event_raw, waitable, code) +pub fn wasmExportGetTool(p0 : Int, p1 : Int) -> Int { + @guest.wasmExportGetTool(p0, p1) } -///| #doc(hidden) -pub fn wasmExportInvokeGolemToolGuest(p0 : Int) -> Int { - @guest.wasmExportInvokeGolemToolGuest(p0) +pub fn wasmExportLoad(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int { + @load-snapshot.wasmExportLoad(p0, p1, p2, p3) } -///| #doc(hidden) -pub fn wasmExportSave() -> Int { - @save-snapshot.wasmExportSave() +pub fn wasmExportDiscoverAgentTypes() -> Int { + @guest0.wasmExportDiscoverAgentTypes() } -///| #doc(hidden) -pub fn wasmExportAsyncInvokeGolemToolGuest( - event_raw : Int, - waitable : Int, - code : Int, -) -> Int { - @guest.wasmExportAsyncInvokeGolemToolGuest(event_raw, waitable, code) +pub fn wasmExportGetToolPostReturn(p0 : Int) -> Unit { + @guest.wasmExportGetToolPostReturn(p0) } -///| #doc(hidden) -pub fn wasmExportGetToolPostReturn(p0 : Int) -> Unit { - @guest.wasmExportGetToolPostReturn(p0) +pub fn wasmExportGetDefinition() -> Int { + @guest0.wasmExportGetDefinition() } -///| #doc(hidden) -pub fn wasmExportDiscoverTools() -> Int { - @guest.wasmExportDiscoverTools() +pub fn wasmExportGetDefinitionPostReturn(p0 : Int) -> Unit { + @guest0.wasmExportGetDefinitionPostReturn(p0) } -///| #doc(hidden) -pub fn wasmExportGetTool(p0 : Int, p1 : Int) -> Int { - @guest.wasmExportGetTool(p0, p1) +pub fn wasmExportInvokeGolemToolGuest(p0 : Int) -> Int { + @guest.wasmExportInvokeGolemToolGuest(p0) } -///| #doc(hidden) -pub fn wasmExportAsyncInvokeGolemAgentGuest( - event_raw : Int, - waitable : Int, - code : Int, -) -> Int { - @guest0.wasmExportAsyncInvokeGolemAgentGuest(event_raw, waitable, code) +pub fn wasmExportInvokeGolemAgentGuest(p0 : Int) -> Int { + @guest0.wasmExportInvokeGolemAgentGuest(p0) } -///| #doc(hidden) -pub fn wasmExportDiscoverAgentTypesPostReturn(p0 : Int) -> Unit { - @guest0.wasmExportDiscoverAgentTypesPostReturn(p0) +pub fn wasmExportAsyncInitialize(event_raw : Int, waitable : Int, code : Int) -> Int { + @guest0.wasmExportAsyncInitialize(event_raw, waitable, code) } -///| #doc(hidden) -pub fn wasmExportAsyncSave(event_raw : Int, waitable : Int, code : Int) -> Int { - @save-snapshot.wasmExportAsyncSave(event_raw, waitable, code) +pub fn wasmExportDiscoverTools() -> Int { + @guest.wasmExportDiscoverTools() } -///| #doc(hidden) pub fn wasmExportAsyncLoad(event_raw : Int, waitable : Int, code : Int) -> Int { - @load-snapshot.wasmExportAsyncLoad(event_raw, waitable, code) + @load-snapshot.wasmExportAsyncLoad(event_raw, waitable, code) } -///| #doc(hidden) -pub fn wasmExportGetDefinition() -> Int { - @guest0.wasmExportGetDefinition() +pub fn wasmExportAsyncInvokeGolemAgentGuest(event_raw : Int, waitable : Int, code : Int) -> Int { + @guest0.wasmExportAsyncInvokeGolemAgentGuest(event_raw, waitable, code) } -///| #doc(hidden) pub fn wasmExportDiscoverToolsPostReturn(p0 : Int) -> Unit { - @guest.wasmExportDiscoverToolsPostReturn(p0) + @guest.wasmExportDiscoverToolsPostReturn(p0) } -///| #doc(hidden) -pub fn wasmExportGetDefinitionPostReturn(p0 : Int) -> Unit { - @guest0.wasmExportGetDefinitionPostReturn(p0) +pub fn wasmExportDiscoverAgentTypesPostReturn(p0 : Int) -> Unit { + @guest0.wasmExportDiscoverAgentTypesPostReturn(p0) } -///| #doc(hidden) -pub fn wasmExportInvokeGolemAgentGuest(p0 : Int) -> Int { - @guest0.wasmExportInvokeGolemAgentGuest(p0) +pub fn wasmExportSave() -> Int { + @save-snapshot.wasmExportSave() } -///| #doc(hidden) -pub fn wasmExportDiscoverAgentTypes() -> Int { - @guest0.wasmExportDiscoverAgentTypes() +pub fn wasmExportAsyncInvokeGolemToolGuest(event_raw : Int, waitable : Int, code : Int) -> Int { + @guest.wasmExportAsyncInvokeGolemToolGuest(event_raw, waitable, code) } -///| #doc(hidden) -pub fn wasmExportLoad(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int { - @load-snapshot.wasmExportLoad(p0, p1, p2, p3) +pub fn wasmExportAsyncSave(event_raw : Int, waitable : Int, code : Int) -> Int { + @save-snapshot.wasmExportAsyncSave(event_raw, waitable, code) } + diff --git a/sdks/moonbit/golem_sdk/gen/interface/golem/agent/guest/ffi.mbt b/sdks/moonbit/golem_sdk/gen/interface/golem/agent/guest/ffi.mbt index afe2fee203..a4b7209866 100644 --- a/sdks/moonbit/golem_sdk/gen/interface/golem/agent/guest/ffi.mbt +++ b/sdks/moonbit/golem_sdk/gen/interface/golem/agent/guest/ffi.mbt @@ -1,13431 +1,13961 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| #doc(hidden) pub fn wasmExportInitialize(p0 : Int) -> Int { - @async-core.with_waitableset(async fn() { - @async-core.with_task_group(async fn(background_group) { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 0), - mbt_ffi_load32(p0 + 4), - ) - - let array26 : Array[@types.SchemaValueNode] = [] - for index27 = 0; index27 < mbt_ffi_load32(p0 + 12); index27 = index27 + 1 { - let iter_base = mbt_ffi_load32(p0 + 8) + index27 * 32 - - let lifted25 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8).land(0xFFFF).reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result0) - } - 13 => { - let array : Array[Int] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 12) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index * 4 - - array.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array) - } - 14 => { - let lifted : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1 : Array[Bool] = [] - for index2 = 0 - index2 < mbt_ffi_load32(iter_base + 12) - index2 = index2 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index2 * 1 - - array1.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1) - } - 17 => { - let array3 : Array[Int] = [] - for index4 = 0 - index4 < mbt_ffi_load32(iter_base + 12) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index4 * 4 - - array3.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array3) - } - 18 => { - let array5 : Array[Int] = [] - for index6 = 0 - index6 < mbt_ffi_load32(iter_base + 12) - index6 = index6 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index6 * 4 - - array5.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array5) - } - 19 => { - let array7 : Array[Int] = [] - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 12) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index8 * 4 - - array7.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array7) - } - 20 => { - let array9 : Array[@types.MapEntry] = [] - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 12) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index10 * 8 - - array9.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array9) - } - 21 => { - let lifted11 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted11) - } - 22 => { - let lifted14 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted12 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted12) - } - 1 => { - let lifted13 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @async-core.with_waitableset(async fn() { + @async-core.with_task_group(async fn(background_group) { - @types.ResultValuePayload::ErrValue(lifted13) - } - _ => panic() - } + let result = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 0), mbt_ffi_load32((p0) + 4)) - @types.SchemaValueNode::ResultValue(lifted14) - } - 23 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let array26 : Array[@types.SchemaValueNode] = []; + for index27 = 0; index27 < (mbt_ffi_load32((p0) + 12)); index27 = index27 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 8)) + (index27 * 32) - let lifted17 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result16 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + let lifted25 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - Option::Some(result16) - } - _ => panic() - } + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result15, - language: lifted17, - }) - } - 24 => { - let result18 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted20 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result19) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result18, - mime_type: lifted20, - }) - } - 25 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result21) - } - 26 => { - let result22 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result22) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result23, - }) - } - 30 => { - let result24 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result24, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } - - array26.push(lifted25) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - - let lifted45 = match mbt_ffi_load8_u(p0 + 24) { - 0 => { - let result28 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 32), - mbt_ffi_load32(p0 + 36), - ) - - let result29 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 40), - mbt_ffi_load32(p0 + 44), - ) - - let lifted31 : String? = match mbt_ffi_load8_u(p0 + 48) { - 0 => Option::None - 1 => { - let result30 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 52), - mbt_ffi_load32(p0 + 56), - ) + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - Option::Some(result30) - } - _ => panic() - } + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - let lifted33 : String? = match mbt_ffi_load8_u(p0 + 60) { - 0 => Option::None - 1 => { - let result32 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 64), - mbt_ffi_load32(p0 + 68), - ) + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - Option::Some(result32) - } - _ => panic() - } + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - let lifted34 : Bool? = match mbt_ffi_load8_u(p0 + 72) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load8_u(p0 + 73) != 0) - _ => panic() - } + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - let lifted36 : String? = match mbt_ffi_load8_u(p0 + 76) { - 0 => Option::None - 1 => { - let result35 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 80), - mbt_ffi_load32(p0 + 84), - ) + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - Option::Some(result35) - } - _ => panic() - } + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - let lifted38 : String? = match mbt_ffi_load8_u(p0 + 88) { - 0 => Option::None - 1 => { - let result37 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 92), - mbt_ffi_load32(p0 + 96), - ) + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - Option::Some(result37) - } - _ => panic() - } + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - let lifted40 : String? = match mbt_ffi_load8_u(p0 + 100) { - 0 => Option::None - 1 => { - let result39 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 104), - mbt_ffi_load32(p0 + 108), - ) + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - Option::Some(result39) - } - _ => panic() - } + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - let lifted42 : String? = match mbt_ffi_load8_u(p0 + 112) { - 0 => Option::None - 1 => { - let result41 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 116), - mbt_ffi_load32(p0 + 120), - ) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(result41) - } - _ => panic() - } - - let result43 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 124), - mbt_ffi_load32(p0 + 128), - ) - - @common.Principal::Oidc(@common.OidcPrincipal::{ - sub: result28, - issuer: result29, - email: lifted31, - name: lifted33, - email_verified: lifted34, - given_name: lifted36, - family_name: lifted38, - picture: lifted40, - preferred_username: lifted42, - claims: result43, - }) - } - 1 => { - let result44 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 48), - mbt_ffi_load32(p0 + 52), - ) - - @common.Principal::Agent(@common.AgentPrincipal::{ - agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(p0 + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(p0 + 40).reinterpret_as_uint64(), - }, - }, - agent_id: result44, - }, - }) - } - 2 => - @common.Principal::GolemUser(@common.GolemUserPrincipal::{ - account_id: @types.AccountId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(p0 + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(p0 + 40).reinterpret_as_uint64(), - }, - }, - }) - 3 => @common.Principal::Anonymous - _ => panic() - } + @types.SchemaValueNode::StringValue(result0) + } + 13 => { - let return_result : Ref[Result[Unit, @common.AgentError]?] = Ref(None) - return_result.val = Some( - initialize( - result, - @types.SchemaValueTree::{ - value_nodes: array26, - root: mbt_ffi_load32(p0 + 16), - }, - lifted45, - background_group, - ), - ) - initialize_task_return(return_result) - }) - }) -} + let array : Array[Int] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index * 4) -///| -fn wasmExportAsyncInitializeTaskReturn( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, - p7 : Int, - p8 : Int, - p9 : Int, -) = "[export]golem:agent/guest@2.0.0" "[task-return]initialize" + array.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) -///| -fn initialize_task_return( - return_result : Ref[Result[Unit, @common.AgentError]?], -) -> Unit { - match return_result.val { - Some(return_value) => { - let cleanup_list : Array[Int] = [] - - let ( - lowered502, - lowered503, - lowered504, - lowered505, - lowered506, - lowered507, - lowered508, - lowered509, - lowered510, - lowered511, - ) = match return_value { - Ok(_payload) => (0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - Err(payload46) => { - let ( - lowered, - lowered494, - lowered495, - lowered496, - lowered497, - lowered498, - lowered499, - lowered500, - lowered501, - ) = match payload46 { - InvalidInput(payload47) => { - let ptr = mbt_ffi_str2ptr(payload47) - cleanup_list.push(ptr) - - (0, ptr, payload47.length(), 0, 0, 0, 0, 0, 0) - } - InvalidMethod(payload48) => { - let ptr49 = mbt_ffi_str2ptr(payload48) - cleanup_list.push(ptr49) - - (1, ptr49, payload48.length(), 0, 0, 0, 0, 0, 0) - } - InvalidType(payload50) => { - let ptr51 = mbt_ffi_str2ptr(payload50) - cleanup_list.push(ptr51) - - (2, ptr51, payload50.length(), 0, 0, 0, 0, 0, 0) - } - InvalidAgentId(payload52) => { - let ptr53 = mbt_ffi_str2ptr(payload52) - cleanup_list.push(ptr53) - - (3, ptr53, payload52.length(), 0, 0, 0, 0, 0, 0) - } - CustomError(payload54) => { - let address415 = mbt_ffi_malloc( - payload54.graph.type_nodes.length() * 144, - ) - for index416 = 0 - index416 < payload54.graph.type_nodes.length() - index416 = index416 + 1 { - let iter_elem : @types.SchemaTypeNode = payload54.graph.type_nodes[index416] - let iter_base = address415 + index416 * 144 - - match iter_elem.body { - RefType(payload55) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store32(iter_base + 8, payload55) - - () - } - BoolType => { - mbt_ffi_store8(iter_base + 0, 1) + @types.SchemaValueNode::RecordValue(array) + } + 14 => { - () - } - S8Type(payload57) => { - mbt_ffi_store8(iter_base + 0, 2) + let lifted : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - match payload57 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - () - } - Some(payload59) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted}) + } + 15 => { - match payload59.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - () - } - Some(payload61) => { - mbt_ffi_store8(iter_base + 16, 1) + let array1 : Array[Bool] = []; + for index2 = 0; index2 < (mbt_ffi_load32((iter_base) + 12)); index2 = index2 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2 * 1) - match payload61 { - Signed(payload62) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload62) + array1.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () + @types.SchemaValueNode::FlagsValue(array1) } - Unsigned(payload63) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload63.reinterpret_as_int64(), - ) + 17 => { - () - } - FloatBits(payload64) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload64.reinterpret_as_int64(), - ) + let array3 : Array[Int] = []; + for index4 = 0; index4 < (mbt_ffi_load32((iter_base) + 12)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index4 * 4) + + array3.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () + @types.SchemaValueNode::TupleValue(array3) } - } + 18 => { - () - } - } + let array5 : Array[Int] = []; + for index6 = 0; index6 < (mbt_ffi_load32((iter_base) + 12)); index6 = index6 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index6 * 4) + + array5.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload59.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaValueNode::ListValue(array5) + } + 19 => { - () - } - Some(payload66) => { - mbt_ffi_store8(iter_base + 40, 1) + let array7 : Array[Int] = []; + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 12)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index8 * 4) - match payload66 { - Signed(payload67) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload67) + array7.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () + @types.SchemaValueNode::FixedListValue(array7) } - Unsigned(payload68) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload68.reinterpret_as_int64(), - ) + 20 => { + + let array9 : Array[@types.MapEntry] = []; + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 12)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index10 * 8) - () + array9.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array9) } - FloatBits(payload69) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload69.reinterpret_as_int64(), - ) + 21 => { + + let lifted11 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted11) } - } + 22 => { - () - } - } + let lifted14 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - match payload59.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted12 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - Some(payload71) => { - mbt_ffi_store8(iter_base + 64, 1) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let ptr72 = mbt_ffi_str2ptr(payload71) - mbt_ffi_store32(iter_base + 72, payload71.length()) - mbt_ffi_store32(iter_base + 68, ptr72) - cleanup_list.push(ptr72) + @types.ResultValuePayload::OkValue(lifted12) + } + 1 => { - () - } - } + let lifted13 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - () - } - S16Type(payload73) => { - mbt_ffi_store8(iter_base + 0, 3) + @types.ResultValuePayload::ErrValue(lifted13) + } + _ => panic() + } - match payload73 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::ResultValue(lifted14) + } + 23 => { - () - } - Some(payload75) => { - mbt_ffi_store8(iter_base + 8, 1) + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload75.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted17 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload77) => { - mbt_ffi_store8(iter_base + 16, 1) + let result16 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - match payload77 { - Signed(payload78) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload78) + Option::Some(result16) + } + _ => panic() + } - () + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result15, language : lifted17}) } - Unsigned(payload79) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload79.reinterpret_as_int64(), - ) + 24 => { - () - } - FloatBits(payload80) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload80.reinterpret_as_int64(), - ) + let result18 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () + let lifted20 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result19) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result18, mime_type : lifted20}) } - } + 25 => { - () - } - } + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload75.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaValueNode::PathValue(result21) + } + 26 => { - () - } - Some(payload82) => { - mbt_ffi_store8(iter_base + 40, 1) + let result22 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload82 { - Signed(payload83) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload83) + @types.SchemaValueNode::UrlValue(result22) + } + 27 => { - () + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) } - Unsigned(payload84) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload84.reinterpret_as_int64(), - ) + 28 => { - () + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) } - FloatBits(payload85) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload85.reinterpret_as_int64(), - ) + 29 => { - () + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result23}) } - } + 30 => { - () - } - } + let result24 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload75.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result24, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - () - } - Some(payload87) => { - mbt_ffi_store8(iter_base + 64, 1) + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - let ptr88 = mbt_ffi_str2ptr(payload87) - mbt_ffi_store32(iter_base + 72, payload87.length()) - mbt_ffi_store32(iter_base + 68, ptr88) - cleanup_list.push(ptr88) + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - () - } + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() } - () - } - } - - () + array26.push(lifted25) } - S32Type(payload89) => { - mbt_ffi_store8(iter_base + 0, 4) + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) - match payload89 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let lifted45 = match (mbt_ffi_load8_u((p0) + 24)) { + 0 => { - () - } - Some(payload91) => { - mbt_ffi_store8(iter_base + 8, 1) + let result28 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 32), mbt_ffi_load32((p0) + 36)) - match payload91.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let result29 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 40), mbt_ffi_load32((p0) + 44)) - () - } - Some(payload93) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted31 : String? = match mbt_ffi_load8_u((p0) + 48) { + 0 => Option::None + 1 => { - match payload93 { - Signed(payload94) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload94) + let result30 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 52), mbt_ffi_load32((p0) + 56)) - () + Option::Some(result30) + } + _ => panic() } - Unsigned(payload95) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload95.reinterpret_as_int64(), - ) - () + let lifted33 : String? = match mbt_ffi_load8_u((p0) + 60) { + 0 => Option::None + 1 => { + + let result32 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 64), mbt_ffi_load32((p0) + 68)) + + Option::Some(result32) + } + _ => panic() } - FloatBits(payload96) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload96.reinterpret_as_int64(), - ) - () + let lifted34 : Bool? = match mbt_ffi_load8_u((p0) + 72) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load8_u((p0) + 73) != 0)) + } + _ => panic() } - } - () - } - } + let lifted36 : String? = match mbt_ffi_load8_u((p0) + 76) { + 0 => Option::None + 1 => { + + let result35 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 80), mbt_ffi_load32((p0) + 84)) - match payload91.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + Option::Some(result35) + } + _ => panic() + } - () - } - Some(payload98) => { - mbt_ffi_store8(iter_base + 40, 1) + let lifted38 : String? = match mbt_ffi_load8_u((p0) + 88) { + 0 => Option::None + 1 => { - match payload98 { - Signed(payload99) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload99) + let result37 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 92), mbt_ffi_load32((p0) + 96)) - () + Option::Some(result37) + } + _ => panic() } - Unsigned(payload100) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload100.reinterpret_as_int64(), - ) - () + let lifted40 : String? = match mbt_ffi_load8_u((p0) + 100) { + 0 => Option::None + 1 => { + + let result39 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 104), mbt_ffi_load32((p0) + 108)) + + Option::Some(result39) + } + _ => panic() } - FloatBits(payload101) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload101.reinterpret_as_int64(), - ) - () + let lifted42 : String? = match mbt_ffi_load8_u((p0) + 112) { + 0 => Option::None + 1 => { + + let result41 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 116), mbt_ffi_load32((p0) + 120)) + + Option::Some(result41) + } + _ => panic() } - } - () - } + let result43 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 124), mbt_ffi_load32((p0) + 128)) + + @common.Principal::Oidc(@common.OidcPrincipal::{sub : result28, issuer : result29, email : lifted31, name : lifted33, email_verified : lifted34, given_name : lifted36, family_name : lifted38, picture : lifted40, preferred_username : lifted42, claims : result43}) + } + 1 => { + + let result44 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 48), mbt_ffi_load32((p0) + 52)) + + @common.Principal::Agent(@common.AgentPrincipal::{agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((p0) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((p0) + 40)).reinterpret_as_uint64()}}, agent_id : result44}}) + } + 2 => { + + @common.Principal::GolemUser(@common.GolemUserPrincipal::{account_id : @types.AccountId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((p0) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((p0) + 40)).reinterpret_as_uint64()}}}) + } + 3 => { + + @common.Principal::Anonymous } + _ => panic() + } + + let return_result: Ref[Result[Unit, @common.AgentError]?] = Ref(None) + return_result.val = Some(initialize(result, @types.SchemaValueTree::{value_nodes : array26, root : mbt_ffi_load32((p0) + 16)}, lifted45, background_group)) + initialize_task_return(return_result) + + }) + }) +} + +fn wasmExportAsyncInitializeTaskReturn(p0: Int, p1: Int, p2: Int, p3: Int, p4: Int, p5: Int, p6: Int, p7: Int, p8: Int, p9: Int) = "[export]golem:agent/guest@2.0.0" "[task-return]initialize" - match payload91.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) +fn initialize_task_return(return_result: Ref[Result[Unit, @common.AgentError]?]) -> Unit { - () - } - Some(payload103) => { - mbt_ffi_store8(iter_base + 64, 1) + match return_result.val { + Some(return_value) => { - let ptr104 = mbt_ffi_str2ptr(payload103) - mbt_ffi_store32(iter_base + 72, payload103.length()) - mbt_ffi_store32(iter_base + 68, ptr104) - cleanup_list.push(ptr104) + let cleanup_list : Array[Int] = [] - () - } + let (lowered505,lowered506,lowered507,lowered508,lowered509,lowered510,lowered511,lowered512,lowered513,lowered514) = match return_value { + Ok(_payload) => { + + ((0), 0, 0, 0, 0, 0, 0, 0, 0, 0) } + Err(payload46) => { - () - } - } + let (lowered,lowered497,lowered498,lowered499,lowered500,lowered501,lowered502,lowered503,lowered504) = match payload46 { + InvalidInput(payload47) => { - () - } - S64Type(payload105) => { - mbt_ffi_store8(iter_base + 0, 5) + let ptr = mbt_ffi_str2ptr(payload47) + cleanup_list.push(ptr) - match payload105 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + ((0), ptr, payload47.length(), 0, 0, 0, 0, 0, 0) + } + InvalidMethod(payload48) => { - () - } - Some(payload107) => { - mbt_ffi_store8(iter_base + 8, 1) + let ptr49 = mbt_ffi_str2ptr(payload48) + cleanup_list.push(ptr49) - match payload107.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + ((1), ptr49, payload48.length(), 0, 0, 0, 0, 0, 0) + } + InvalidType(payload50) => { - () - } - Some(payload109) => { - mbt_ffi_store8(iter_base + 16, 1) + let ptr51 = mbt_ffi_str2ptr(payload50) + cleanup_list.push(ptr51) - match payload109 { - Signed(payload110) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload110) + ((2), ptr51, payload50.length(), 0, 0, 0, 0, 0, 0) + } + InvalidAgentId(payload52) => { - () - } - Unsigned(payload111) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload111.reinterpret_as_int64(), - ) + let ptr53 = mbt_ffi_str2ptr(payload52) + cleanup_list.push(ptr53) - () - } - FloatBits(payload112) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload112.reinterpret_as_int64(), - ) + ((3), ptr53, payload52.length(), 0, 0, 0, 0, 0, 0) + } + CustomError(payload54) => { - () - } - } + let address416 = mbt_ffi_malloc((((payload54).graph).type_nodes).length() * 144); + for index417 = 0; index417 < (((payload54).graph).type_nodes).length(); index417 = index417 + 1 { + let iter_elem : @types.SchemaTypeNode = (((payload54).graph).type_nodes)[(index417)] + let iter_base = address416 + (index417 * 144); - () - } - } + match (iter_elem).body { + RefType(payload55) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store32((iter_base) + 8, payload55) - match payload107.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + BoolType => { + mbt_ffi_store8((iter_base) + 0, (1)) - () - } - Some(payload114) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + S8Type(payload57) => { + mbt_ffi_store8((iter_base) + 0, (2)) - match payload114 { - Signed(payload115) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload115) + match (payload57) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - Unsigned(payload116) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload116.reinterpret_as_int64(), - ) + () + } + Some(payload59) => { + mbt_ffi_store8((iter_base) + 8, (1)) - () - } - FloatBits(payload117) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload117.reinterpret_as_int64(), - ) + match ((payload59).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload61) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload61 { + Signed(payload62) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload62) - () + () + } + Unsigned(payload63) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload63).reinterpret_as_int64()) + + () + } + FloatBits(payload64) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload64).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload59).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload66) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload66 { + Signed(payload67) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload67) + + () + } + Unsigned(payload68) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload68).reinterpret_as_int64()) + + () + } + FloatBits(payload69) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload69).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload59).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload71) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr72 = mbt_ffi_str2ptr(payload71) + mbt_ffi_store32((iter_base) + 72, payload71.length()) + mbt_ffi_store32((iter_base) + 68, ptr72) + cleanup_list.push(ptr72) + + () + } + } + + () + } + } + + () + } + S16Type(payload73) => { + mbt_ffi_store8((iter_base) + 0, (3)) + + match (payload73) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload75) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload75).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload77) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload77 { + Signed(payload78) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload78) + + () + } + Unsigned(payload79) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload79).reinterpret_as_int64()) + + () + } + FloatBits(payload80) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload80).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload75).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload82) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload82 { + Signed(payload83) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload83) + + () + } + Unsigned(payload84) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload84).reinterpret_as_int64()) + + () + } + FloatBits(payload85) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload85).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload75).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload87) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr88 = mbt_ffi_str2ptr(payload87) + mbt_ffi_store32((iter_base) + 72, payload87.length()) + mbt_ffi_store32((iter_base) + 68, ptr88) + cleanup_list.push(ptr88) + + () + } + } + + () + } + } + + () + } + S32Type(payload89) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + match (payload89) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload91) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload91).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload93) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload93 { + Signed(payload94) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload94) + + () + } + Unsigned(payload95) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload95).reinterpret_as_int64()) + + () + } + FloatBits(payload96) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload96).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload91).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload98) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload98 { + Signed(payload99) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload99) + + () + } + Unsigned(payload100) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload100).reinterpret_as_int64()) + + () + } + FloatBits(payload101) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload101).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload91).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload103) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr104 = mbt_ffi_str2ptr(payload103) + mbt_ffi_store32((iter_base) + 72, payload103.length()) + mbt_ffi_store32((iter_base) + 68, ptr104) + cleanup_list.push(ptr104) + + () + } + } + + () + } + } + + () + } + S64Type(payload105) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + match (payload105) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload107) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload107).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload109) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload109 { + Signed(payload110) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload110) + + () + } + Unsigned(payload111) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload111).reinterpret_as_int64()) + + () + } + FloatBits(payload112) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload112).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload107).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload114) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload114 { + Signed(payload115) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload115) + + () + } + Unsigned(payload116) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload116).reinterpret_as_int64()) + + () + } + FloatBits(payload117) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload117).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload107).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload119) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr120 = mbt_ffi_str2ptr(payload119) + mbt_ffi_store32((iter_base) + 72, payload119.length()) + mbt_ffi_store32((iter_base) + 68, ptr120) + cleanup_list.push(ptr120) + + () + } + } + + () + } + } + + () + } + U8Type(payload121) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + match (payload121) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload123) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload123).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload125) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload125 { + Signed(payload126) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload126) + + () + } + Unsigned(payload127) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload127).reinterpret_as_int64()) + + () + } + FloatBits(payload128) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload128).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload123).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload130) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload130 { + Signed(payload131) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload131) + + () + } + Unsigned(payload132) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload132).reinterpret_as_int64()) + + () + } + FloatBits(payload133) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload133).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload123).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload135) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr136 = mbt_ffi_str2ptr(payload135) + mbt_ffi_store32((iter_base) + 72, payload135.length()) + mbt_ffi_store32((iter_base) + 68, ptr136) + cleanup_list.push(ptr136) + + () + } + } + + () + } + } + + () + } + U16Type(payload137) => { + mbt_ffi_store8((iter_base) + 0, (7)) + + match (payload137) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload139) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload139).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload141) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload141 { + Signed(payload142) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload142) + + () + } + Unsigned(payload143) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload143).reinterpret_as_int64()) + + () + } + FloatBits(payload144) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload144).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload139).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload146) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload146 { + Signed(payload147) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload147) + + () + } + Unsigned(payload148) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload148).reinterpret_as_int64()) + + () + } + FloatBits(payload149) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload149).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload139).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload151) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr152 = mbt_ffi_str2ptr(payload151) + mbt_ffi_store32((iter_base) + 72, payload151.length()) + mbt_ffi_store32((iter_base) + 68, ptr152) + cleanup_list.push(ptr152) + + () + } + } + + () + } + } + + () + } + U32Type(payload153) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + match (payload153) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload155) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload155).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload157) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload157 { + Signed(payload158) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload158) + + () + } + Unsigned(payload159) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload159).reinterpret_as_int64()) + + () + } + FloatBits(payload160) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload160).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload155).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload162) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload162 { + Signed(payload163) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload163) + + () + } + Unsigned(payload164) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload164).reinterpret_as_int64()) + + () + } + FloatBits(payload165) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload165).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload155).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload167) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr168 = mbt_ffi_str2ptr(payload167) + mbt_ffi_store32((iter_base) + 72, payload167.length()) + mbt_ffi_store32((iter_base) + 68, ptr168) + cleanup_list.push(ptr168) + + () + } + } + + () + } + } + + () + } + U64Type(payload169) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + match (payload169) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload171) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload171).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload173) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload173 { + Signed(payload174) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload174) + + () + } + Unsigned(payload175) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload175).reinterpret_as_int64()) + + () + } + FloatBits(payload176) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload176).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload171).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload178) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload178 { + Signed(payload179) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload179) + + () + } + Unsigned(payload180) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload180).reinterpret_as_int64()) + + () + } + FloatBits(payload181) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload181).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload171).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload183) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr184 = mbt_ffi_str2ptr(payload183) + mbt_ffi_store32((iter_base) + 72, payload183.length()) + mbt_ffi_store32((iter_base) + 68, ptr184) + cleanup_list.push(ptr184) + + () + } + } + + () + } + } + + () + } + F32Type(payload185) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + match (payload185) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload187) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload187).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload189) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload189 { + Signed(payload190) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload190) + + () + } + Unsigned(payload191) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload191).reinterpret_as_int64()) + + () + } + FloatBits(payload192) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload192).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload187).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload194) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload194 { + Signed(payload195) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload195) + + () + } + Unsigned(payload196) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload196).reinterpret_as_int64()) + + () + } + FloatBits(payload197) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload197).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload187).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload199) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr200 = mbt_ffi_str2ptr(payload199) + mbt_ffi_store32((iter_base) + 72, payload199.length()) + mbt_ffi_store32((iter_base) + 68, ptr200) + cleanup_list.push(ptr200) + + () + } + } + + () + } + } + + () + } + F64Type(payload201) => { + mbt_ffi_store8((iter_base) + 0, (11)) + + match (payload201) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload203) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload203).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload205) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload205 { + Signed(payload206) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload206) + + () + } + Unsigned(payload207) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload207).reinterpret_as_int64()) + + () + } + FloatBits(payload208) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload208).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload203).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload210) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload210 { + Signed(payload211) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload211) + + () + } + Unsigned(payload212) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload212).reinterpret_as_int64()) + + () + } + FloatBits(payload213) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload213).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload203).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload215) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr216 = mbt_ffi_str2ptr(payload215) + mbt_ffi_store32((iter_base) + 72, payload215.length()) + mbt_ffi_store32((iter_base) + 68, ptr216) + cleanup_list.push(ptr216) + + () + } + } + + () + } + } + + () + } + CharType => { + mbt_ffi_store8((iter_base) + 0, (12)) + + () + } + StringType => { + mbt_ffi_store8((iter_base) + 0, (13)) + + () + } + RecordType(payload219) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let address239 = mbt_ffi_malloc((payload219).length() * 68); + for index240 = 0; index240 < (payload219).length(); index240 = index240 + 1 { + let iter_elem : @types.NamedFieldType = (payload219)[(index240)] + let iter_base = address239 + (index240 * 68); + + let ptr220 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr220) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload222) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr223 = mbt_ffi_str2ptr(payload222) + mbt_ffi_store32((iter_base) + 20, payload222.length()) + mbt_ffi_store32((iter_base) + 16, ptr223) + cleanup_list.push(ptr223) + + () + } + } + + let address = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index225 = 0; index225 < (((iter_elem).metadata).aliases).length(); index225 = index225 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index225)] + let iter_base = address + (index225 * 8); + + let ptr224 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr224) + cleanup_list.push(ptr224) + + } + mbt_ffi_store32((iter_base) + 28, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 24, address) + + let address227 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index228 = 0; index228 < (((iter_elem).metadata).examples).length(); index228 = index228 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index228)] + let iter_base = address227 + (index228 * 8); + + let ptr226 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr226) + cleanup_list.push(ptr226) + + } + mbt_ffi_store32((iter_base) + 36, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 32, address227) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload230) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + let ptr231 = mbt_ffi_str2ptr(payload230) + mbt_ffi_store32((iter_base) + 48, payload230.length()) + mbt_ffi_store32((iter_base) + 44, ptr231) + cleanup_list.push(ptr231) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 52, (0)) + + () + } + Some(payload233) => { + mbt_ffi_store8((iter_base) + 52, (1)) + + match payload233 { + Multimodal => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 56, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 56, (2)) + + () + } + Other(payload237) => { + mbt_ffi_store8((iter_base) + 56, (3)) + + let ptr238 = mbt_ffi_str2ptr(payload237) + mbt_ffi_store32((iter_base) + 64, payload237.length()) + mbt_ffi_store32((iter_base) + 60, ptr238) + cleanup_list.push(ptr238) + + () + } + } + + () + } + } + cleanup_list.push(ptr220) + cleanup_list.push(address) + cleanup_list.push(address227) + + } + mbt_ffi_store32((iter_base) + 12, (payload219).length()) + mbt_ffi_store32((iter_base) + 8, address239) + cleanup_list.push(address239) + + () + } + VariantType(payload241) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let address264 = mbt_ffi_malloc((payload241).length() * 72); + for index265 = 0; index265 < (payload241).length(); index265 = index265 + 1 { + let iter_elem : @types.VariantCaseType = (payload241)[(index265)] + let iter_base = address264 + (index265 * 72); + + let ptr242 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr242) + + match ((iter_elem).payload) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload244) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload244) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload246) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr247 = mbt_ffi_str2ptr(payload246) + mbt_ffi_store32((iter_base) + 24, payload246.length()) + mbt_ffi_store32((iter_base) + 20, ptr247) + cleanup_list.push(ptr247) + + () + } + } + + let address249 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index250 = 0; index250 < (((iter_elem).metadata).aliases).length(); index250 = index250 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index250)] + let iter_base = address249 + (index250 * 8); + + let ptr248 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr248) + cleanup_list.push(ptr248) + + } + mbt_ffi_store32((iter_base) + 32, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 28, address249) + + let address252 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index253 = 0; index253 < (((iter_elem).metadata).examples).length(); index253 = index253 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index253)] + let iter_base = address252 + (index253 * 8); + + let ptr251 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr251) + cleanup_list.push(ptr251) + + } + mbt_ffi_store32((iter_base) + 40, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 36, address252) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 44, (0)) + + () + } + Some(payload255) => { + mbt_ffi_store8((iter_base) + 44, (1)) + + let ptr256 = mbt_ffi_str2ptr(payload255) + mbt_ffi_store32((iter_base) + 52, payload255.length()) + mbt_ffi_store32((iter_base) + 48, ptr256) + cleanup_list.push(ptr256) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload258) => { + mbt_ffi_store8((iter_base) + 56, (1)) + + match payload258 { + Multimodal => { + mbt_ffi_store8((iter_base) + 60, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 60, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 60, (2)) + + () + } + Other(payload262) => { + mbt_ffi_store8((iter_base) + 60, (3)) + + let ptr263 = mbt_ffi_str2ptr(payload262) + mbt_ffi_store32((iter_base) + 68, payload262.length()) + mbt_ffi_store32((iter_base) + 64, ptr263) + cleanup_list.push(ptr263) + + () + } + } + + () + } + } + cleanup_list.push(ptr242) + cleanup_list.push(address249) + cleanup_list.push(address252) + + } + mbt_ffi_store32((iter_base) + 12, (payload241).length()) + mbt_ffi_store32((iter_base) + 8, address264) + cleanup_list.push(address264) + + () + } + EnumType(payload266) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address268 = mbt_ffi_malloc((payload266).length() * 8); + for index269 = 0; index269 < (payload266).length(); index269 = index269 + 1 { + let iter_elem : String = (payload266)[(index269)] + let iter_base = address268 + (index269 * 8); + + let ptr267 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr267) + cleanup_list.push(ptr267) + + } + mbt_ffi_store32((iter_base) + 12, (payload266).length()) + mbt_ffi_store32((iter_base) + 8, address268) + cleanup_list.push(address268) + + () + } + FlagsType(payload270) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address272 = mbt_ffi_malloc((payload270).length() * 8); + for index273 = 0; index273 < (payload270).length(); index273 = index273 + 1 { + let iter_elem : String = (payload270)[(index273)] + let iter_base = address272 + (index273 * 8); + + let ptr271 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr271) + cleanup_list.push(ptr271) + + } + mbt_ffi_store32((iter_base) + 12, (payload270).length()) + mbt_ffi_store32((iter_base) + 8, address272) + cleanup_list.push(address272) + + () + } + TupleType(payload274) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address275 = mbt_ffi_malloc((payload274).length() * 4); + for index276 = 0; index276 < (payload274).length(); index276 = index276 + 1 { + let iter_elem : Int = (payload274)[(index276)] + let iter_base = address275 + (index276 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload274).length()) + mbt_ffi_store32((iter_base) + 8, address275) + cleanup_list.push(address275) + + () + } + ListType(payload277) => { + mbt_ffi_store8((iter_base) + 0, (19)) + mbt_ffi_store32((iter_base) + 8, payload277) + + () + } + FixedListType(payload278) => { + mbt_ffi_store8((iter_base) + 0, (20)) + mbt_ffi_store32((iter_base) + 8, (payload278).element) + mbt_ffi_store32((iter_base) + 12, ((payload278).length).reinterpret_as_int()) + + () + } + MapType(payload279) => { + mbt_ffi_store8((iter_base) + 0, (21)) + mbt_ffi_store32((iter_base) + 8, (payload279).key) + mbt_ffi_store32((iter_base) + 12, (payload279).value) + + () + } + OptionType(payload280) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store32((iter_base) + 8, payload280) + + () + } + ResultType(payload281) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match ((payload281).ok) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload283) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload283) + + () + } + } + + match ((payload281).err) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload285) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload285) + + () + } + } + + () + } + TextType(payload286) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match ((payload286).languages) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload288) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address290 = mbt_ffi_malloc((payload288).length() * 8); + for index291 = 0; index291 < (payload288).length(); index291 = index291 + 1 { + let iter_elem : String = (payload288)[(index291)] + let iter_base = address290 + (index291 * 8); + + let ptr289 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr289) + cleanup_list.push(ptr289) + + } + mbt_ffi_store32((iter_base) + 16, (payload288).length()) + mbt_ffi_store32((iter_base) + 12, address290) + cleanup_list.push(address290) + + () + } + } + + match ((payload286).min_length) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload293) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload293).reinterpret_as_int()) + + () + } + } + + match ((payload286).max_length) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload295) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload295).reinterpret_as_int()) + + () + } + } + + match ((payload286).regex) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload297) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr298 = mbt_ffi_str2ptr(payload297) + mbt_ffi_store32((iter_base) + 44, payload297.length()) + mbt_ffi_store32((iter_base) + 40, ptr298) + cleanup_list.push(ptr298) + + () + } + } + + () + } + BinaryType(payload299) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + match ((payload299).mime_types) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload301) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address303 = mbt_ffi_malloc((payload301).length() * 8); + for index304 = 0; index304 < (payload301).length(); index304 = index304 + 1 { + let iter_elem : String = (payload301)[(index304)] + let iter_base = address303 + (index304 * 8); + + let ptr302 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr302) + cleanup_list.push(ptr302) + + } + mbt_ffi_store32((iter_base) + 16, (payload301).length()) + mbt_ffi_store32((iter_base) + 12, address303) + cleanup_list.push(address303) + + () + } + } + + match ((payload299).min_bytes) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload306) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload306).reinterpret_as_int()) + + () + } + } + + match ((payload299).max_bytes) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload308) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload308).reinterpret_as_int()) + + () + } + } + + () + } + PathType(payload309) => { + mbt_ffi_store8((iter_base) + 0, (26)) + mbt_ffi_store8((iter_base) + 8, (payload309).direction.ordinal()) + mbt_ffi_store8((iter_base) + 9, (payload309).kind.ordinal()) + + match ((payload309).allowed_mime_types) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload311) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let address313 = mbt_ffi_malloc((payload311).length() * 8); + for index314 = 0; index314 < (payload311).length(); index314 = index314 + 1 { + let iter_elem : String = (payload311)[(index314)] + let iter_base = address313 + (index314 * 8); + + let ptr312 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr312) + cleanup_list.push(ptr312) + + } + mbt_ffi_store32((iter_base) + 20, (payload311).length()) + mbt_ffi_store32((iter_base) + 16, address313) + cleanup_list.push(address313) + + () + } + } + + match ((payload309).allowed_extensions) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload316) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let address318 = mbt_ffi_malloc((payload316).length() * 8); + for index319 = 0; index319 < (payload316).length(); index319 = index319 + 1 { + let iter_elem : String = (payload316)[(index319)] + let iter_base = address318 + (index319 * 8); + + let ptr317 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr317) + cleanup_list.push(ptr317) + + } + mbt_ffi_store32((iter_base) + 32, (payload316).length()) + mbt_ffi_store32((iter_base) + 28, address318) + cleanup_list.push(address318) + + () + } + } + + () + } + UrlType(payload320) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + match ((payload320).allowed_schemes) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload322) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address324 = mbt_ffi_malloc((payload322).length() * 8); + for index325 = 0; index325 < (payload322).length(); index325 = index325 + 1 { + let iter_elem : String = (payload322)[(index325)] + let iter_base = address324 + (index325 * 8); + + let ptr323 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr323) + cleanup_list.push(ptr323) + + } + mbt_ffi_store32((iter_base) + 16, (payload322).length()) + mbt_ffi_store32((iter_base) + 12, address324) + cleanup_list.push(address324) + + () + } + } + + match ((payload320).allowed_hosts) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload327) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let address329 = mbt_ffi_malloc((payload327).length() * 8); + for index330 = 0; index330 < (payload327).length(); index330 = index330 + 1 { + let iter_elem : String = (payload327)[(index330)] + let iter_base = address329 + (index330 * 8); + + let ptr328 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr328) + cleanup_list.push(ptr328) + + } + mbt_ffi_store32((iter_base) + 28, (payload327).length()) + mbt_ffi_store32((iter_base) + 24, address329) + cleanup_list.push(address329) + + () + } + } + + () + } + DatetimeType => { + mbt_ffi_store8((iter_base) + 0, (28)) + + () + } + DurationType => { + mbt_ffi_store8((iter_base) + 0, (29)) + + () + } + QuantityType(payload333) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr334 = mbt_ffi_str2ptr((payload333).base_unit) + mbt_ffi_store32((iter_base) + 12, (payload333).base_unit.length()) + mbt_ffi_store32((iter_base) + 8, ptr334) + + let address336 = mbt_ffi_malloc(((payload333).allowed_suffixes).length() * 8); + for index337 = 0; index337 < ((payload333).allowed_suffixes).length(); index337 = index337 + 1 { + let iter_elem : String = ((payload333).allowed_suffixes)[(index337)] + let iter_base = address336 + (index337 * 8); + + let ptr335 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr335) + cleanup_list.push(ptr335) + + } + mbt_ffi_store32((iter_base) + 20, ((payload333).allowed_suffixes).length()) + mbt_ffi_store32((iter_base) + 16, address336) + + match ((payload333).min) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload339) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload339).mantissa) + mbt_ffi_store32((iter_base) + 40, (payload339).scale) + + let ptr340 = mbt_ffi_str2ptr((payload339).unit) + mbt_ffi_store32((iter_base) + 48, (payload339).unit.length()) + mbt_ffi_store32((iter_base) + 44, ptr340) + cleanup_list.push(ptr340) + + () + } + } + + match ((payload333).max) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload342) => { + mbt_ffi_store8((iter_base) + 56, (1)) + mbt_ffi_store64((iter_base) + 64, (payload342).mantissa) + mbt_ffi_store32((iter_base) + 72, (payload342).scale) + + let ptr343 = mbt_ffi_str2ptr((payload342).unit) + mbt_ffi_store32((iter_base) + 80, (payload342).unit.length()) + mbt_ffi_store32((iter_base) + 76, ptr343) + cleanup_list.push(ptr343) + + () + } + } + cleanup_list.push(ptr334) + cleanup_list.push(address336) + + () + } + UnionType(payload344) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let address380 = mbt_ffi_malloc(((payload344).branches).length() * 92); + for index381 = 0; index381 < ((payload344).branches).length(); index381 = index381 + 1 { + let iter_elem : @types.UnionBranch = ((payload344).branches)[(index381)] + let iter_base = address380 + (index381 * 92); + + let ptr345 = mbt_ffi_str2ptr((iter_elem).tag) + mbt_ffi_store32((iter_base) + 4, (iter_elem).tag.length()) + mbt_ffi_store32((iter_base) + 0, ptr345) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (iter_elem).discriminator { + Prefix(payload346) => { + mbt_ffi_store8((iter_base) + 12, (0)) + + let ptr347 = mbt_ffi_str2ptr(payload346) + mbt_ffi_store32((iter_base) + 20, payload346.length()) + mbt_ffi_store32((iter_base) + 16, ptr347) + cleanup_list.push(ptr347) + + () + } + Suffix(payload348) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr349 = mbt_ffi_str2ptr(payload348) + mbt_ffi_store32((iter_base) + 20, payload348.length()) + mbt_ffi_store32((iter_base) + 16, ptr349) + cleanup_list.push(ptr349) + + () + } + Contains(payload350) => { + mbt_ffi_store8((iter_base) + 12, (2)) + + let ptr351 = mbt_ffi_str2ptr(payload350) + mbt_ffi_store32((iter_base) + 20, payload350.length()) + mbt_ffi_store32((iter_base) + 16, ptr351) + cleanup_list.push(ptr351) + + () + } + Regex(payload352) => { + mbt_ffi_store8((iter_base) + 12, (3)) + + let ptr353 = mbt_ffi_str2ptr(payload352) + mbt_ffi_store32((iter_base) + 20, payload352.length()) + mbt_ffi_store32((iter_base) + 16, ptr353) + cleanup_list.push(ptr353) + + () + } + FieldEquals(payload354) => { + mbt_ffi_store8((iter_base) + 12, (4)) + + let ptr355 = mbt_ffi_str2ptr((payload354).field_name) + mbt_ffi_store32((iter_base) + 20, (payload354).field_name.length()) + mbt_ffi_store32((iter_base) + 16, ptr355) + + match ((payload354).literal) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload357) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let ptr358 = mbt_ffi_str2ptr(payload357) + mbt_ffi_store32((iter_base) + 32, payload357.length()) + mbt_ffi_store32((iter_base) + 28, ptr358) + cleanup_list.push(ptr358) + + () + } + } + cleanup_list.push(ptr355) + + () + } + FieldAbsent(payload359) => { + mbt_ffi_store8((iter_base) + 12, (5)) + + let ptr360 = mbt_ffi_str2ptr(payload359) + mbt_ffi_store32((iter_base) + 20, payload359.length()) + mbt_ffi_store32((iter_base) + 16, ptr360) + cleanup_list.push(ptr360) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload362) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr363 = mbt_ffi_str2ptr(payload362) + mbt_ffi_store32((iter_base) + 44, payload362.length()) + mbt_ffi_store32((iter_base) + 40, ptr363) + cleanup_list.push(ptr363) + + () + } + } + + let address365 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index366 = 0; index366 < (((iter_elem).metadata).aliases).length(); index366 = index366 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index366)] + let iter_base = address365 + (index366 * 8); + + let ptr364 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr364) + cleanup_list.push(ptr364) + + } + mbt_ffi_store32((iter_base) + 52, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 48, address365) + + let address368 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index369 = 0; index369 < (((iter_elem).metadata).examples).length(); index369 = index369 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index369)] + let iter_base = address368 + (index369 * 8); + + let ptr367 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr367) + cleanup_list.push(ptr367) + + } + mbt_ffi_store32((iter_base) + 60, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 56, address368) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload371) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr372 = mbt_ffi_str2ptr(payload371) + mbt_ffi_store32((iter_base) + 72, payload371.length()) + mbt_ffi_store32((iter_base) + 68, ptr372) + cleanup_list.push(ptr372) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 76, (0)) + + () + } + Some(payload374) => { + mbt_ffi_store8((iter_base) + 76, (1)) + + match payload374 { + Multimodal => { + mbt_ffi_store8((iter_base) + 80, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 80, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 80, (2)) + + () + } + Other(payload378) => { + mbt_ffi_store8((iter_base) + 80, (3)) + + let ptr379 = mbt_ffi_str2ptr(payload378) + mbt_ffi_store32((iter_base) + 88, payload378.length()) + mbt_ffi_store32((iter_base) + 84, ptr379) + cleanup_list.push(ptr379) + + () + } + } + + () + } + } + cleanup_list.push(ptr345) + cleanup_list.push(address365) + cleanup_list.push(address368) + + } + mbt_ffi_store32((iter_base) + 12, ((payload344).branches).length()) + mbt_ffi_store32((iter_base) + 8, address380) + cleanup_list.push(address380) + + () + } + SecretType(payload382) => { + mbt_ffi_store8((iter_base) + 0, (32)) + mbt_ffi_store32((iter_base) + 8, (payload382).inner) + + match ((payload382).category) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload384) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr385 = mbt_ffi_str2ptr(payload384) + mbt_ffi_store32((iter_base) + 20, payload384.length()) + mbt_ffi_store32((iter_base) + 16, ptr385) + cleanup_list.push(ptr385) + + () + } + } + + () + } + QuotaTokenType(payload386) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + match ((payload386).resource_name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload388) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr389 = mbt_ffi_str2ptr(payload388) + mbt_ffi_store32((iter_base) + 16, payload388.length()) + mbt_ffi_store32((iter_base) + 12, ptr389) + cleanup_list.push(ptr389) + + () + } + } + + () + } + PermissionCardType(payload390) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store8((iter_base) + 8, (if (payload390).polymorphic { 1 } else { 0 })) + + () + } + FutureType(payload391) => { + mbt_ffi_store8((iter_base) + 0, (35)) + + match (payload391) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload393) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload393) + + () + } + } + + () + } + StreamType(payload394) => { + mbt_ffi_store8((iter_base) + 0, (36)) + + match (payload394) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload396) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload396) + + () + } + } + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 88, (0)) + + () + } + Some(payload398) => { + mbt_ffi_store8((iter_base) + 88, (1)) + + let ptr399 = mbt_ffi_str2ptr(payload398) + mbt_ffi_store32((iter_base) + 96, payload398.length()) + mbt_ffi_store32((iter_base) + 92, ptr399) + cleanup_list.push(ptr399) + + () + } + } + + let address401 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index402 = 0; index402 < (((iter_elem).metadata).aliases).length(); index402 = index402 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index402)] + let iter_base = address401 + (index402 * 8); + + let ptr400 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr400) + cleanup_list.push(ptr400) + + } + mbt_ffi_store32((iter_base) + 104, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 100, address401) + + let address404 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index405 = 0; index405 < (((iter_elem).metadata).examples).length(); index405 = index405 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index405)] + let iter_base = address404 + (index405 * 8); + + let ptr403 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr403) + cleanup_list.push(ptr403) + + } + mbt_ffi_store32((iter_base) + 112, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 108, address404) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 116, (0)) + + () + } + Some(payload407) => { + mbt_ffi_store8((iter_base) + 116, (1)) + + let ptr408 = mbt_ffi_str2ptr(payload407) + mbt_ffi_store32((iter_base) + 124, payload407.length()) + mbt_ffi_store32((iter_base) + 120, ptr408) + cleanup_list.push(ptr408) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 128, (0)) + + () + } + Some(payload410) => { + mbt_ffi_store8((iter_base) + 128, (1)) + + match payload410 { + Multimodal => { + mbt_ffi_store8((iter_base) + 132, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 132, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 132, (2)) + + () + } + Other(payload414) => { + mbt_ffi_store8((iter_base) + 132, (3)) + + let ptr415 = mbt_ffi_str2ptr(payload414) + mbt_ffi_store32((iter_base) + 140, payload414.length()) + mbt_ffi_store32((iter_base) + 136, ptr415) + cleanup_list.push(ptr415) + + () + } + } + + () + } + } + cleanup_list.push(address401) + cleanup_list.push(address404) + + } + + let address422 = mbt_ffi_malloc((((payload54).graph).defs).length() * 24); + for index423 = 0; index423 < (((payload54).graph).defs).length(); index423 = index423 + 1 { + let iter_elem : @types.SchemaTypeDef = (((payload54).graph).defs)[(index423)] + let iter_base = address422 + (index423 * 24); + + let ptr418 = mbt_ffi_str2ptr((iter_elem).id) + mbt_ffi_store32((iter_base) + 4, (iter_elem).id.length()) + mbt_ffi_store32((iter_base) + 0, ptr418) + + match ((iter_elem).name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload420) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr421 = mbt_ffi_str2ptr(payload420) + mbt_ffi_store32((iter_base) + 16, payload420.length()) + mbt_ffi_store32((iter_base) + 12, ptr421) + cleanup_list.push(ptr421) + + () + } + } + mbt_ffi_store32((iter_base) + 20, (iter_elem).body) + cleanup_list.push(ptr418) + + } + + let address495 = mbt_ffi_malloc((((payload54).value).value_nodes).length() * 32); + for index496 = 0; index496 < (((payload54).value).value_nodes).length(); index496 = index496 + 1 { + let iter_elem : @types.SchemaValueNode = (((payload54).value).value_nodes)[(index496)] + let iter_base = address495 + (index496 * 32); + + match iter_elem { + BoolValue(payload424) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload424 { 1 } else { 0 })) + + () + } + S8Value(payload425) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload425)) + + () + } + S16Value(payload426) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload426)) + + () + } + S32Value(payload427) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload427) + + () + } + S64Value(payload428) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload428) + + () + } + U8Value(payload429) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload429).to_int()) + + () + } + U16Value(payload430) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload430).reinterpret_as_int()) + + () + } + U32Value(payload431) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload431).reinterpret_as_int()) + + () + } + U64Value(payload432) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload432).reinterpret_as_int64()) + + () + } + F32Value(payload433) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload433) + + () + } + F64Value(payload434) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload434) + + () + } + CharValue(payload435) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload435).to_int()) + + () + } + StringValue(payload436) => { + mbt_ffi_store8((iter_base) + 0, (12)) + + let ptr437 = mbt_ffi_str2ptr(payload436) + mbt_ffi_store32((iter_base) + 12, payload436.length()) + mbt_ffi_store32((iter_base) + 8, ptr437) + cleanup_list.push(ptr437) + + () + } + RecordValue(payload438) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let address439 = mbt_ffi_malloc((payload438).length() * 4); + for index440 = 0; index440 < (payload438).length(); index440 = index440 + 1 { + let iter_elem : Int = (payload438)[(index440)] + let iter_base = address439 + (index440 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload438).length()) + mbt_ffi_store32((iter_base) + 8, address439) + cleanup_list.push(address439) + + () + } + VariantValue(payload441) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload441).case).reinterpret_as_int()) + + match ((payload441).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload443) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload443) + + () + } + } + + () + } + EnumValue(payload444) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload444).reinterpret_as_int()) + + () + } + FlagsValue(payload445) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address446 = mbt_ffi_malloc((payload445).length() * 1); + for index447 = 0; index447 < (payload445).length(); index447 = index447 + 1 { + let iter_elem : Bool = (payload445)[(index447)] + let iter_base = address446 + (index447 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload445).length()) + mbt_ffi_store32((iter_base) + 8, address446) + cleanup_list.push(address446) + + () + } + TupleValue(payload448) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address449 = mbt_ffi_malloc((payload448).length() * 4); + for index450 = 0; index450 < (payload448).length(); index450 = index450 + 1 { + let iter_elem : Int = (payload448)[(index450)] + let iter_base = address449 + (index450 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload448).length()) + mbt_ffi_store32((iter_base) + 8, address449) + cleanup_list.push(address449) + + () + } + ListValue(payload451) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address452 = mbt_ffi_malloc((payload451).length() * 4); + for index453 = 0; index453 < (payload451).length(); index453 = index453 + 1 { + let iter_elem : Int = (payload451)[(index453)] + let iter_base = address452 + (index453 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload451).length()) + mbt_ffi_store32((iter_base) + 8, address452) + cleanup_list.push(address452) + + () + } + FixedListValue(payload454) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address455 = mbt_ffi_malloc((payload454).length() * 4); + for index456 = 0; index456 < (payload454).length(); index456 = index456 + 1 { + let iter_elem : Int = (payload454)[(index456)] + let iter_base = address455 + (index456 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload454).length()) + mbt_ffi_store32((iter_base) + 8, address455) + cleanup_list.push(address455) + + () + } + MapValue(payload457) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let address458 = mbt_ffi_malloc((payload457).length() * 8); + for index459 = 0; index459 < (payload457).length(); index459 = index459 + 1 { + let iter_elem : @types.MapEntry = (payload457)[(index459)] + let iter_base = address458 + (index459 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload457).length()) + mbt_ffi_store32((iter_base) + 8, address458) + cleanup_list.push(address458) + + () + } + OptionValue(payload460) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + match (payload460) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload462) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload462) + + () + } + } + + () + } + ResultValue(payload463) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload463 { + OkValue(payload464) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload464) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload466) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload466) + + () + } + } + + () + } + ErrValue(payload467) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload467) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload469) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload469) + + () + } + } + + () + } + } + + () + } + TextValue(payload470) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr471 = mbt_ffi_str2ptr((payload470).text) + mbt_ffi_store32((iter_base) + 12, (payload470).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr471) + + match ((payload470).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload473) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr474 = mbt_ffi_str2ptr(payload473) + mbt_ffi_store32((iter_base) + 24, payload473.length()) + mbt_ffi_store32((iter_base) + 20, ptr474) + cleanup_list.push(ptr474) + + () + } + } + cleanup_list.push(ptr471) + + () + } + BinaryValue(payload475) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr476 = mbt_ffi_bytes2ptr((payload475).bytes) + + mbt_ffi_store32((iter_base) + 12, (payload475).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr476) + + match ((payload475).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload478) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr479 = mbt_ffi_str2ptr(payload478) + mbt_ffi_store32((iter_base) + 24, payload478.length()) + mbt_ffi_store32((iter_base) + 20, ptr479) + cleanup_list.push(ptr479) + + () + } + } + cleanup_list.push(ptr476) + + () + } + PathValue(payload480) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr481 = mbt_ffi_str2ptr(payload480) + mbt_ffi_store32((iter_base) + 12, payload480.length()) + mbt_ffi_store32((iter_base) + 8, ptr481) + cleanup_list.push(ptr481) + + () + } + UrlValue(payload482) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr483 = mbt_ffi_str2ptr(payload482) + mbt_ffi_store32((iter_base) + 12, payload482.length()) + mbt_ffi_store32((iter_base) + 8, ptr483) + cleanup_list.push(ptr483) + + () + } + DatetimeValue(payload484) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload484).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload484).nanoseconds).reinterpret_as_int()) + + () + } + DurationValue(payload485) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload485).nanoseconds) + + () + } + QuantityValueNode(payload486) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload486).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload486).scale) + + let ptr487 = mbt_ffi_str2ptr((payload486).unit) + mbt_ffi_store32((iter_base) + 24, (payload486).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr487) + cleanup_list.push(ptr487) + + () + } + UnionValue(payload488) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr489 = mbt_ffi_str2ptr((payload488).tag) + mbt_ffi_store32((iter_base) + 12, (payload488).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr489) + mbt_ffi_store32((iter_base) + 16, (payload488).body) + cleanup_list.push(ptr489) + + () + } + SecretValue(payload490) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let @types.Secret(handle) = payload490 + mbt_ffi_store32((iter_base) + 8, handle) + + () + } + QuotaTokenHandle(payload491) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let @types.QuotaToken(handle492) = payload491 + mbt_ffi_store32((iter_base) + 8, handle492) + + () + } + PermissionCardHandle(payload493) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let @types.PermissionCard(handle494) = payload493 + mbt_ffi_store32((iter_base) + 8, handle494) + + () + } + } + + } + cleanup_list.push(address416) + cleanup_list.push(address422) + cleanup_list.push(address495) + + ((4), address416, (((payload54).graph).type_nodes).length(), address422, (((payload54).graph).defs).length(), ((payload54).graph).root, address495, (((payload54).value).value_nodes).length(), ((payload54).value).root) + } } - } - () - } + ((1), lowered, lowered497, lowered498, lowered499, lowered500, lowered501, lowered502, lowered503, lowered504) } + } - match payload107.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + wasmExportAsyncInitializeTaskReturn(lowered505, lowered506, lowered507, lowered508, lowered509, lowered510, lowered511, lowered512, lowered513, lowered514) - () - } - Some(payload119) => { - mbt_ffi_store8(iter_base + 64, 1) + cleanup_list.each(mbt_ffi_free) - let ptr120 = mbt_ffi_str2ptr(payload119) - mbt_ffi_store32(iter_base + 72, payload119.length()) - mbt_ffi_store32(iter_base + 68, ptr120) - cleanup_list.push(ptr120) + @async-core.task_returned() - () - } - } + } + None => () + } - () - } - } +} - () - } - U8Type(payload121) => { - mbt_ffi_store8(iter_base + 0, 6) +#doc(hidden) +pub fn wasmExportAsyncInitialize(event_raw : Int, waitable : Int, code : Int) -> Int { + @async-core.cb(event_raw, waitable, code) +} - match payload121 { - None => { - mbt_ffi_store8(iter_base + 8, 0) +#doc(hidden) +pub fn wasmExportInvokeGolemAgentGuest(p0 : Int) -> Int { + @async-core.with_waitableset(async fn() { + @async-core.with_task_group(async fn(background_group) { - () - } - Some(payload123) => { - mbt_ffi_store8(iter_base + 8, 1) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 0), mbt_ffi_load32((p0) + 4)) - match payload123.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let array26 : Array[@types.SchemaValueNode] = []; + for index27 = 0; index27 < (mbt_ffi_load32((p0) + 12)); index27 = index27 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 8)) + (index27 * 32) - () - } - Some(payload125) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted25 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - match payload125 { - Signed(payload126) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload126) + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - () + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) } - Unsigned(payload127) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload127.reinterpret_as_int64(), - ) + 2 => { - () + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) } - FloatBits(payload128) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload128.reinterpret_as_int64(), - ) + 3 => { - () + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) } - } + 4 => { - () - } - } + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - match payload123.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - () - } - Some(payload130) => { - mbt_ffi_store8(iter_base + 40, 1) + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - match payload130 { - Signed(payload131) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload131) + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - () + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) } - Unsigned(payload132) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload132.reinterpret_as_int64(), - ) + 9 => { - () + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) } - FloatBits(payload133) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload133.reinterpret_as_int64(), - ) + 10 => { - () + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) } - } + 11 => { - () - } - } + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - match payload123.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Some(payload135) => { - mbt_ffi_store8(iter_base + 64, 1) + @types.SchemaValueNode::StringValue(result0) + } + 13 => { - let ptr136 = mbt_ffi_str2ptr(payload135) - mbt_ffi_store32(iter_base + 72, payload135.length()) - mbt_ffi_store32(iter_base + 68, ptr136) - cleanup_list.push(ptr136) + let array : Array[Int] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index * 4) - () - } - } + array.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } + @types.SchemaValueNode::RecordValue(array) + } + 14 => { - () - } - U16Type(payload137) => { - mbt_ffi_store8(iter_base + 0, 7) + let lifted : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - match payload137 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - () - } - Some(payload139) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted}) + } + 15 => { - match payload139.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - () - } - Some(payload141) => { - mbt_ffi_store8(iter_base + 16, 1) + let array1 : Array[Bool] = []; + for index2 = 0; index2 < (mbt_ffi_load32((iter_base) + 12)); index2 = index2 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2 * 1) - match payload141 { - Signed(payload142) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload142) + array1.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () + @types.SchemaValueNode::FlagsValue(array1) } - Unsigned(payload143) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload143.reinterpret_as_int64(), - ) + 17 => { - () - } - FloatBits(payload144) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload144.reinterpret_as_int64(), - ) + let array3 : Array[Int] = []; + for index4 = 0; index4 < (mbt_ffi_load32((iter_base) + 12)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index4 * 4) + + array3.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () + @types.SchemaValueNode::TupleValue(array3) } - } + 18 => { - () - } - } + let array5 : Array[Int] = []; + for index6 = 0; index6 < (mbt_ffi_load32((iter_base) + 12)); index6 = index6 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index6 * 4) + + array5.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload139.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaValueNode::ListValue(array5) + } + 19 => { - () - } - Some(payload146) => { - mbt_ffi_store8(iter_base + 40, 1) + let array7 : Array[Int] = []; + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 12)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index8 * 4) - match payload146 { - Signed(payload147) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload147) + array7.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () + @types.SchemaValueNode::FixedListValue(array7) } - Unsigned(payload148) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload148.reinterpret_as_int64(), - ) + 20 => { + + let array9 : Array[@types.MapEntry] = []; + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 12)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index10 * 8) - () + array9.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array9) } - FloatBits(payload149) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload149.reinterpret_as_int64(), - ) + 21 => { + + let lifted11 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted11) } - } + 22 => { - () - } - } + let lifted14 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - match payload139.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted12 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - Some(payload151) => { - mbt_ffi_store8(iter_base + 64, 1) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let ptr152 = mbt_ffi_str2ptr(payload151) - mbt_ffi_store32(iter_base + 72, payload151.length()) - mbt_ffi_store32(iter_base + 68, ptr152) - cleanup_list.push(ptr152) + @types.ResultValuePayload::OkValue(lifted12) + } + 1 => { - () - } - } + let lifted13 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - () - } - U32Type(payload153) => { - mbt_ffi_store8(iter_base + 0, 8) + @types.ResultValuePayload::ErrValue(lifted13) + } + _ => panic() + } - match payload153 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::ResultValue(lifted14) + } + 23 => { - () - } - Some(payload155) => { - mbt_ffi_store8(iter_base + 8, 1) + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload155.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted17 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload157) => { - mbt_ffi_store8(iter_base + 16, 1) + let result16 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - match payload157 { - Signed(payload158) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload158) + Option::Some(result16) + } + _ => panic() + } - () + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result15, language : lifted17}) } - Unsigned(payload159) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload159.reinterpret_as_int64(), - ) + 24 => { - () - } - FloatBits(payload160) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload160.reinterpret_as_int64(), - ) + let result18 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted20 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () + Option::Some(result19) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result18, mime_type : lifted20}) } - } + 25 => { - () - } - } + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload155.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaValueNode::PathValue(result21) + } + 26 => { - () - } - Some(payload162) => { - mbt_ffi_store8(iter_base + 40, 1) + let result22 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload162 { - Signed(payload163) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload163) + @types.SchemaValueNode::UrlValue(result22) + } + 27 => { - () + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) } - Unsigned(payload164) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload164.reinterpret_as_int64(), - ) + 28 => { - () + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) } - FloatBits(payload165) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload165.reinterpret_as_int64(), - ) + 29 => { - () + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result23}) } - } + 30 => { - () - } - } + let result24 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload155.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result24, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - () - } - Some(payload167) => { - mbt_ffi_store8(iter_base + 64, 1) + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - let ptr168 = mbt_ffi_str2ptr(payload167) - mbt_ffi_store32(iter_base + 72, payload167.length()) - mbt_ffi_store32(iter_base + 68, ptr168) - cleanup_list.push(ptr168) + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - () - } + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() } - () - } - } - - () + array26.push(lifted25) } - U64Type(payload169) => { - mbt_ffi_store8(iter_base + 0, 9) + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) - match payload169 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let lifted45 = match (mbt_ffi_load8_u((p0) + 24)) { + 0 => { - () - } - Some(payload171) => { - mbt_ffi_store8(iter_base + 8, 1) + let result28 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 32), mbt_ffi_load32((p0) + 36)) - match payload171.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let result29 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 40), mbt_ffi_load32((p0) + 44)) - () - } - Some(payload173) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted31 : String? = match mbt_ffi_load8_u((p0) + 48) { + 0 => Option::None + 1 => { - match payload173 { - Signed(payload174) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload174) + let result30 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 52), mbt_ffi_load32((p0) + 56)) - () + Option::Some(result30) + } + _ => panic() } - Unsigned(payload175) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload175.reinterpret_as_int64(), - ) - () - } - FloatBits(payload176) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload176.reinterpret_as_int64(), - ) + let lifted33 : String? = match mbt_ffi_load8_u((p0) + 60) { + 0 => Option::None + 1 => { - () + let result32 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 64), mbt_ffi_load32((p0) + 68)) + + Option::Some(result32) + } + _ => panic() } - } - () - } - } + let lifted34 : Bool? = match mbt_ffi_load8_u((p0) + 72) { + 0 => Option::None + 1 => { - match payload171.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + Option::Some((mbt_ffi_load8_u((p0) + 73) != 0)) + } + _ => panic() + } - () - } - Some(payload178) => { - mbt_ffi_store8(iter_base + 40, 1) + let lifted36 : String? = match mbt_ffi_load8_u((p0) + 76) { + 0 => Option::None + 1 => { - match payload178 { - Signed(payload179) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload179) + let result35 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 80), mbt_ffi_load32((p0) + 84)) - () + Option::Some(result35) + } + _ => panic() } - Unsigned(payload180) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload180.reinterpret_as_int64(), - ) - () - } - FloatBits(payload181) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload181.reinterpret_as_int64(), - ) + let lifted38 : String? = match mbt_ffi_load8_u((p0) + 88) { + 0 => Option::None + 1 => { - () + let result37 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 92), mbt_ffi_load32((p0) + 96)) + + Option::Some(result37) + } + _ => panic() } - } - () - } - } + let lifted40 : String? = match mbt_ffi_load8_u((p0) + 100) { + 0 => Option::None + 1 => { - match payload171.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let result39 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 104), mbt_ffi_load32((p0) + 108)) - () - } - Some(payload183) => { - mbt_ffi_store8(iter_base + 64, 1) + Option::Some(result39) + } + _ => panic() + } - let ptr184 = mbt_ffi_str2ptr(payload183) - mbt_ffi_store32(iter_base + 72, payload183.length()) - mbt_ffi_store32(iter_base + 68, ptr184) - cleanup_list.push(ptr184) + let lifted42 : String? = match mbt_ffi_load8_u((p0) + 112) { + 0 => Option::None + 1 => { - () - } - } + let result41 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 116), mbt_ffi_load32((p0) + 120)) - () - } - } + Option::Some(result41) + } + _ => panic() + } - () - } - F32Type(payload185) => { - mbt_ffi_store8(iter_base + 0, 10) + let result43 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 124), mbt_ffi_load32((p0) + 128)) - match payload185 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @common.Principal::Oidc(@common.OidcPrincipal::{sub : result28, issuer : result29, email : lifted31, name : lifted33, email_verified : lifted34, given_name : lifted36, family_name : lifted38, picture : lifted40, preferred_username : lifted42, claims : result43}) + } + 1 => { - () - } - Some(payload187) => { - mbt_ffi_store8(iter_base + 8, 1) + let result44 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 48), mbt_ffi_load32((p0) + 52)) - match payload187.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @common.Principal::Agent(@common.AgentPrincipal::{agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((p0) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((p0) + 40)).reinterpret_as_uint64()}}, agent_id : result44}}) + } + 2 => { - () - } - Some(payload189) => { - mbt_ffi_store8(iter_base + 16, 1) + @common.Principal::GolemUser(@common.GolemUserPrincipal::{account_id : @types.AccountId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((p0) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((p0) + 40)).reinterpret_as_uint64()}}}) + } + 3 => { - match payload189 { - Signed(payload190) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload190) + @common.Principal::Anonymous + } + _ => panic() + } - () - } - Unsigned(payload191) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload191.reinterpret_as_int64(), - ) + let return_result: Ref[Result[@types.SchemaValueTree?, @common.AgentError]?] = Ref(None) + return_result.val = Some(invoke(result, @types.SchemaValueTree::{value_nodes : array26, root : mbt_ffi_load32((p0) + 16)}, lifted45, background_group)) + invoke_task_return(return_result) - () - } - FloatBits(payload192) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload192.reinterpret_as_int64(), - ) + }) + }) +} - () +fn wasmExportAsyncInvokeGolemAgentGuestTaskReturn(p0: Int, p1: Int, p2: Int, p3: Int, p4: Int, p5: Int, p6: Int, p7: Int, p8: Int, p9: Int) = "[export]golem:agent/guest@2.0.0" "[task-return]invoke" + +fn invoke_task_return(return_result: Ref[Result[@types.SchemaValueTree?, @common.AgentError]?]) -> Unit { + + match return_result.val { + Some(return_value) => { + + let cleanup_list : Array[Int] = [] + + let (lowered585,lowered586,lowered587,lowered588,lowered589,lowered590,lowered591,lowered592,lowered593,lowered594) = match return_value { + Ok(payload) => { + + let (lowered, lowered119, lowered120, lowered121) = match (payload) { + None => { + + ((0), 0, 0, 0) + } + Some(payload47) => { + + let address117 = mbt_ffi_malloc(((payload47).value_nodes).length() * 32); + for index118 = 0; index118 < ((payload47).value_nodes).length(); index118 = index118 + 1 { + let iter_elem : @types.SchemaValueNode = ((payload47).value_nodes)[(index118)] + let iter_base = address117 + (index118 * 32); + + match iter_elem { + BoolValue(payload48) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload48 { 1 } else { 0 })) + + () + } + S8Value(payload49) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload49)) + + () + } + S16Value(payload50) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload50)) + + () + } + S32Value(payload51) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload51) + + () + } + S64Value(payload52) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload52) + + () + } + U8Value(payload53) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload53).to_int()) + + () + } + U16Value(payload54) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload54).reinterpret_as_int()) + + () + } + U32Value(payload55) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload55).reinterpret_as_int()) + + () + } + U64Value(payload56) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload56).reinterpret_as_int64()) + + () + } + F32Value(payload57) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload57) + + () + } + F64Value(payload58) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload58) + + () + } + CharValue(payload59) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload59).to_int()) + + () + } + StringValue(payload60) => { + mbt_ffi_store8((iter_base) + 0, (12)) + + let ptr = mbt_ffi_str2ptr(payload60) + mbt_ffi_store32((iter_base) + 12, payload60.length()) + mbt_ffi_store32((iter_base) + 8, ptr) + cleanup_list.push(ptr) + + () + } + RecordValue(payload61) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let address = mbt_ffi_malloc((payload61).length() * 4); + for index62 = 0; index62 < (payload61).length(); index62 = index62 + 1 { + let iter_elem : Int = (payload61)[(index62)] + let iter_base = address + (index62 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload61).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + VariantValue(payload63) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload63).case).reinterpret_as_int()) + + match ((payload63).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload65) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload65) + + () + } + } + + () + } + EnumValue(payload66) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload66).reinterpret_as_int()) + + () + } + FlagsValue(payload67) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address68 = mbt_ffi_malloc((payload67).length() * 1); + for index69 = 0; index69 < (payload67).length(); index69 = index69 + 1 { + let iter_elem : Bool = (payload67)[(index69)] + let iter_base = address68 + (index69 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload67).length()) + mbt_ffi_store32((iter_base) + 8, address68) + cleanup_list.push(address68) + + () + } + TupleValue(payload70) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address71 = mbt_ffi_malloc((payload70).length() * 4); + for index72 = 0; index72 < (payload70).length(); index72 = index72 + 1 { + let iter_elem : Int = (payload70)[(index72)] + let iter_base = address71 + (index72 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload70).length()) + mbt_ffi_store32((iter_base) + 8, address71) + cleanup_list.push(address71) + + () + } + ListValue(payload73) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address74 = mbt_ffi_malloc((payload73).length() * 4); + for index75 = 0; index75 < (payload73).length(); index75 = index75 + 1 { + let iter_elem : Int = (payload73)[(index75)] + let iter_base = address74 + (index75 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload73).length()) + mbt_ffi_store32((iter_base) + 8, address74) + cleanup_list.push(address74) + + () + } + FixedListValue(payload76) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address77 = mbt_ffi_malloc((payload76).length() * 4); + for index78 = 0; index78 < (payload76).length(); index78 = index78 + 1 { + let iter_elem : Int = (payload76)[(index78)] + let iter_base = address77 + (index78 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload76).length()) + mbt_ffi_store32((iter_base) + 8, address77) + cleanup_list.push(address77) + + () + } + MapValue(payload79) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let address80 = mbt_ffi_malloc((payload79).length() * 8); + for index81 = 0; index81 < (payload79).length(); index81 = index81 + 1 { + let iter_elem : @types.MapEntry = (payload79)[(index81)] + let iter_base = address80 + (index81 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload79).length()) + mbt_ffi_store32((iter_base) + 8, address80) + cleanup_list.push(address80) + + () + } + OptionValue(payload82) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + match (payload82) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload84) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload84) + + () + } + } + + () + } + ResultValue(payload85) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload85 { + OkValue(payload86) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload86) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload88) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload88) + + () + } + } + + () + } + ErrValue(payload89) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload89) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload91) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload91) + + () + } + } + + () + } + } + + () + } + TextValue(payload92) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr93 = mbt_ffi_str2ptr((payload92).text) + mbt_ffi_store32((iter_base) + 12, (payload92).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr93) + + match ((payload92).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload95) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr96 = mbt_ffi_str2ptr(payload95) + mbt_ffi_store32((iter_base) + 24, payload95.length()) + mbt_ffi_store32((iter_base) + 20, ptr96) + cleanup_list.push(ptr96) + + () + } + } + cleanup_list.push(ptr93) + + () + } + BinaryValue(payload97) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr98 = mbt_ffi_bytes2ptr((payload97).bytes) + + mbt_ffi_store32((iter_base) + 12, (payload97).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr98) + + match ((payload97).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload100) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr101 = mbt_ffi_str2ptr(payload100) + mbt_ffi_store32((iter_base) + 24, payload100.length()) + mbt_ffi_store32((iter_base) + 20, ptr101) + cleanup_list.push(ptr101) + + () + } + } + cleanup_list.push(ptr98) + + () + } + PathValue(payload102) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr103 = mbt_ffi_str2ptr(payload102) + mbt_ffi_store32((iter_base) + 12, payload102.length()) + mbt_ffi_store32((iter_base) + 8, ptr103) + cleanup_list.push(ptr103) + + () + } + UrlValue(payload104) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr105 = mbt_ffi_str2ptr(payload104) + mbt_ffi_store32((iter_base) + 12, payload104.length()) + mbt_ffi_store32((iter_base) + 8, ptr105) + cleanup_list.push(ptr105) + + () + } + DatetimeValue(payload106) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload106).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload106).nanoseconds).reinterpret_as_int()) + + () + } + DurationValue(payload107) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload107).nanoseconds) + + () + } + QuantityValueNode(payload108) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload108).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload108).scale) + + let ptr109 = mbt_ffi_str2ptr((payload108).unit) + mbt_ffi_store32((iter_base) + 24, (payload108).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr109) + cleanup_list.push(ptr109) + + () + } + UnionValue(payload110) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr111 = mbt_ffi_str2ptr((payload110).tag) + mbt_ffi_store32((iter_base) + 12, (payload110).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr111) + mbt_ffi_store32((iter_base) + 16, (payload110).body) + cleanup_list.push(ptr111) + + () + } + SecretValue(payload112) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let @types.Secret(handle) = payload112 + mbt_ffi_store32((iter_base) + 8, handle) + + () + } + QuotaTokenHandle(payload113) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let @types.QuotaToken(handle114) = payload113 + mbt_ffi_store32((iter_base) + 8, handle114) + + () + } + PermissionCardHandle(payload115) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let @types.PermissionCard(handle116) = payload115 + mbt_ffi_store32((iter_base) + 8, handle116) + + () + } + } + + } + cleanup_list.push(address117) + + ((1), address117, ((payload47).value_nodes).length(), (payload47).root) + } } - } - () - } + ((0), lowered, lowered119, lowered120, lowered121, 0, 0, 0, 0, 0) } + Err(payload122) => { - match payload187.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let (lowered576,lowered577,lowered578,lowered579,lowered580,lowered581,lowered582,lowered583,lowered584) = match payload122 { + InvalidInput(payload123) => { - () - } - Some(payload194) => { - mbt_ffi_store8(iter_base + 40, 1) + let ptr124 = mbt_ffi_str2ptr(payload123) + cleanup_list.push(ptr124) - match payload194 { - Signed(payload195) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload195) + ((0), ptr124, payload123.length(), 0, 0, 0, 0, 0, 0) + } + InvalidMethod(payload125) => { - () + let ptr126 = mbt_ffi_str2ptr(payload125) + cleanup_list.push(ptr126) + + ((1), ptr126, payload125.length(), 0, 0, 0, 0, 0, 0) + } + InvalidType(payload127) => { + + let ptr128 = mbt_ffi_str2ptr(payload127) + cleanup_list.push(ptr128) + + ((2), ptr128, payload127.length(), 0, 0, 0, 0, 0, 0) + } + InvalidAgentId(payload129) => { + + let ptr130 = mbt_ffi_str2ptr(payload129) + cleanup_list.push(ptr130) + + ((3), ptr130, payload129.length(), 0, 0, 0, 0, 0, 0) + } + CustomError(payload131) => { + + let address494 = mbt_ffi_malloc((((payload131).graph).type_nodes).length() * 144); + for index495 = 0; index495 < (((payload131).graph).type_nodes).length(); index495 = index495 + 1 { + let iter_elem : @types.SchemaTypeNode = (((payload131).graph).type_nodes)[(index495)] + let iter_base = address494 + (index495 * 144); + + match (iter_elem).body { + RefType(payload132) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store32((iter_base) + 8, payload132) + + () + } + BoolType => { + mbt_ffi_store8((iter_base) + 0, (1)) + + () + } + S8Type(payload134) => { + mbt_ffi_store8((iter_base) + 0, (2)) + + match (payload134) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload136) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload136).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload138) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload138 { + Signed(payload139) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload139) + + () + } + Unsigned(payload140) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload140).reinterpret_as_int64()) + + () + } + FloatBits(payload141) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload141).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload136).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload143) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload143 { + Signed(payload144) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload144) + + () + } + Unsigned(payload145) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload145).reinterpret_as_int64()) + + () + } + FloatBits(payload146) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload146).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload136).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload148) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr149 = mbt_ffi_str2ptr(payload148) + mbt_ffi_store32((iter_base) + 72, payload148.length()) + mbt_ffi_store32((iter_base) + 68, ptr149) + cleanup_list.push(ptr149) + + () + } + } + + () + } + } + + () + } + S16Type(payload150) => { + mbt_ffi_store8((iter_base) + 0, (3)) + + match (payload150) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload152) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload152).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload154) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload154 { + Signed(payload155) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload155) + + () + } + Unsigned(payload156) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload156).reinterpret_as_int64()) + + () + } + FloatBits(payload157) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload157).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload152).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload159) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload159 { + Signed(payload160) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload160) + + () + } + Unsigned(payload161) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload161).reinterpret_as_int64()) + + () + } + FloatBits(payload162) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload162).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload152).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload164) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr165 = mbt_ffi_str2ptr(payload164) + mbt_ffi_store32((iter_base) + 72, payload164.length()) + mbt_ffi_store32((iter_base) + 68, ptr165) + cleanup_list.push(ptr165) + + () + } + } + + () + } + } + + () + } + S32Type(payload166) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + match (payload166) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload168) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload168).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload170) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload170 { + Signed(payload171) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload171) + + () + } + Unsigned(payload172) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload172).reinterpret_as_int64()) + + () + } + FloatBits(payload173) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload173).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload168).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload175) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload175 { + Signed(payload176) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload176) + + () + } + Unsigned(payload177) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload177).reinterpret_as_int64()) + + () + } + FloatBits(payload178) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload178).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload168).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload180) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr181 = mbt_ffi_str2ptr(payload180) + mbt_ffi_store32((iter_base) + 72, payload180.length()) + mbt_ffi_store32((iter_base) + 68, ptr181) + cleanup_list.push(ptr181) + + () + } + } + + () + } + } + + () + } + S64Type(payload182) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + match (payload182) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload184) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload184).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload186) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload186 { + Signed(payload187) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload187) + + () + } + Unsigned(payload188) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload188).reinterpret_as_int64()) + + () + } + FloatBits(payload189) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload189).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload184).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload191) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload191 { + Signed(payload192) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload192) + + () + } + Unsigned(payload193) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload193).reinterpret_as_int64()) + + () + } + FloatBits(payload194) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload194).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload184).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload196) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr197 = mbt_ffi_str2ptr(payload196) + mbt_ffi_store32((iter_base) + 72, payload196.length()) + mbt_ffi_store32((iter_base) + 68, ptr197) + cleanup_list.push(ptr197) + + () + } + } + + () + } + } + + () + } + U8Type(payload198) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + match (payload198) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload200) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload200).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload202) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload202 { + Signed(payload203) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload203) + + () + } + Unsigned(payload204) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload204).reinterpret_as_int64()) + + () + } + FloatBits(payload205) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload205).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload200).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload207) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload207 { + Signed(payload208) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload208) + + () + } + Unsigned(payload209) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload209).reinterpret_as_int64()) + + () + } + FloatBits(payload210) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload210).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload200).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload212) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr213 = mbt_ffi_str2ptr(payload212) + mbt_ffi_store32((iter_base) + 72, payload212.length()) + mbt_ffi_store32((iter_base) + 68, ptr213) + cleanup_list.push(ptr213) + + () + } + } + + () + } + } + + () + } + U16Type(payload214) => { + mbt_ffi_store8((iter_base) + 0, (7)) + + match (payload214) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload216) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload216).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload218) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload218 { + Signed(payload219) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload219) + + () + } + Unsigned(payload220) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload220).reinterpret_as_int64()) + + () + } + FloatBits(payload221) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload221).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload216).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload223) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload223 { + Signed(payload224) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload224) + + () + } + Unsigned(payload225) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload225).reinterpret_as_int64()) + + () + } + FloatBits(payload226) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload226).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload216).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload228) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr229 = mbt_ffi_str2ptr(payload228) + mbt_ffi_store32((iter_base) + 72, payload228.length()) + mbt_ffi_store32((iter_base) + 68, ptr229) + cleanup_list.push(ptr229) + + () + } + } + + () + } + } + + () + } + U32Type(payload230) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + match (payload230) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload232) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload232).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload234) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload234 { + Signed(payload235) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload235) + + () + } + Unsigned(payload236) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload236).reinterpret_as_int64()) + + () + } + FloatBits(payload237) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload237).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload232).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload239) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload239 { + Signed(payload240) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload240) + + () + } + Unsigned(payload241) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload241).reinterpret_as_int64()) + + () + } + FloatBits(payload242) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload242).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload232).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload244) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr245 = mbt_ffi_str2ptr(payload244) + mbt_ffi_store32((iter_base) + 72, payload244.length()) + mbt_ffi_store32((iter_base) + 68, ptr245) + cleanup_list.push(ptr245) + + () + } + } + + () + } + } + + () + } + U64Type(payload246) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + match (payload246) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload248) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload248).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload250) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload250 { + Signed(payload251) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload251) + + () + } + Unsigned(payload252) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload252).reinterpret_as_int64()) + + () + } + FloatBits(payload253) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload253).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload248).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload255) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload255 { + Signed(payload256) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload256) + + () + } + Unsigned(payload257) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload257).reinterpret_as_int64()) + + () + } + FloatBits(payload258) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload258).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload248).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload260) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr261 = mbt_ffi_str2ptr(payload260) + mbt_ffi_store32((iter_base) + 72, payload260.length()) + mbt_ffi_store32((iter_base) + 68, ptr261) + cleanup_list.push(ptr261) + + () + } + } + + () + } + } + + () + } + F32Type(payload262) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + match (payload262) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload264) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload264).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload266) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload266 { + Signed(payload267) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload267) + + () + } + Unsigned(payload268) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload268).reinterpret_as_int64()) + + () + } + FloatBits(payload269) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload269).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload264).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload271) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload271 { + Signed(payload272) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload272) + + () + } + Unsigned(payload273) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload273).reinterpret_as_int64()) + + () + } + FloatBits(payload274) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload274).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload264).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload276) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr277 = mbt_ffi_str2ptr(payload276) + mbt_ffi_store32((iter_base) + 72, payload276.length()) + mbt_ffi_store32((iter_base) + 68, ptr277) + cleanup_list.push(ptr277) + + () + } + } + + () + } + } + + () + } + F64Type(payload278) => { + mbt_ffi_store8((iter_base) + 0, (11)) + + match (payload278) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload280) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload280).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload282) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload282 { + Signed(payload283) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload283) + + () + } + Unsigned(payload284) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload284).reinterpret_as_int64()) + + () + } + FloatBits(payload285) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload285).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload280).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload287) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload287 { + Signed(payload288) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload288) + + () + } + Unsigned(payload289) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload289).reinterpret_as_int64()) + + () + } + FloatBits(payload290) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload290).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload280).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload292) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr293 = mbt_ffi_str2ptr(payload292) + mbt_ffi_store32((iter_base) + 72, payload292.length()) + mbt_ffi_store32((iter_base) + 68, ptr293) + cleanup_list.push(ptr293) + + () + } + } + + () + } + } + + () + } + CharType => { + mbt_ffi_store8((iter_base) + 0, (12)) + + () + } + StringType => { + mbt_ffi_store8((iter_base) + 0, (13)) + + () + } + RecordType(payload296) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let address317 = mbt_ffi_malloc((payload296).length() * 68); + for index318 = 0; index318 < (payload296).length(); index318 = index318 + 1 { + let iter_elem : @types.NamedFieldType = (payload296)[(index318)] + let iter_base = address317 + (index318 * 68); + + let ptr297 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr297) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload299) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr300 = mbt_ffi_str2ptr(payload299) + mbt_ffi_store32((iter_base) + 20, payload299.length()) + mbt_ffi_store32((iter_base) + 16, ptr300) + cleanup_list.push(ptr300) + + () + } + } + + let address302 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index303 = 0; index303 < (((iter_elem).metadata).aliases).length(); index303 = index303 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index303)] + let iter_base = address302 + (index303 * 8); + + let ptr301 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr301) + cleanup_list.push(ptr301) + + } + mbt_ffi_store32((iter_base) + 28, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 24, address302) + + let address305 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index306 = 0; index306 < (((iter_elem).metadata).examples).length(); index306 = index306 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index306)] + let iter_base = address305 + (index306 * 8); + + let ptr304 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr304) + cleanup_list.push(ptr304) + + } + mbt_ffi_store32((iter_base) + 36, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 32, address305) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload308) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + let ptr309 = mbt_ffi_str2ptr(payload308) + mbt_ffi_store32((iter_base) + 48, payload308.length()) + mbt_ffi_store32((iter_base) + 44, ptr309) + cleanup_list.push(ptr309) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 52, (0)) + + () + } + Some(payload311) => { + mbt_ffi_store8((iter_base) + 52, (1)) + + match payload311 { + Multimodal => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 56, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 56, (2)) + + () + } + Other(payload315) => { + mbt_ffi_store8((iter_base) + 56, (3)) + + let ptr316 = mbt_ffi_str2ptr(payload315) + mbt_ffi_store32((iter_base) + 64, payload315.length()) + mbt_ffi_store32((iter_base) + 60, ptr316) + cleanup_list.push(ptr316) + + () + } + } + + () + } + } + cleanup_list.push(ptr297) + cleanup_list.push(address302) + cleanup_list.push(address305) + + } + mbt_ffi_store32((iter_base) + 12, (payload296).length()) + mbt_ffi_store32((iter_base) + 8, address317) + cleanup_list.push(address317) + + () + } + VariantType(payload319) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let address342 = mbt_ffi_malloc((payload319).length() * 72); + for index343 = 0; index343 < (payload319).length(); index343 = index343 + 1 { + let iter_elem : @types.VariantCaseType = (payload319)[(index343)] + let iter_base = address342 + (index343 * 72); + + let ptr320 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr320) + + match ((iter_elem).payload) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload322) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload322) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload324) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr325 = mbt_ffi_str2ptr(payload324) + mbt_ffi_store32((iter_base) + 24, payload324.length()) + mbt_ffi_store32((iter_base) + 20, ptr325) + cleanup_list.push(ptr325) + + () + } + } + + let address327 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index328 = 0; index328 < (((iter_elem).metadata).aliases).length(); index328 = index328 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index328)] + let iter_base = address327 + (index328 * 8); + + let ptr326 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr326) + cleanup_list.push(ptr326) + + } + mbt_ffi_store32((iter_base) + 32, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 28, address327) + + let address330 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index331 = 0; index331 < (((iter_elem).metadata).examples).length(); index331 = index331 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index331)] + let iter_base = address330 + (index331 * 8); + + let ptr329 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr329) + cleanup_list.push(ptr329) + + } + mbt_ffi_store32((iter_base) + 40, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 36, address330) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 44, (0)) + + () + } + Some(payload333) => { + mbt_ffi_store8((iter_base) + 44, (1)) + + let ptr334 = mbt_ffi_str2ptr(payload333) + mbt_ffi_store32((iter_base) + 52, payload333.length()) + mbt_ffi_store32((iter_base) + 48, ptr334) + cleanup_list.push(ptr334) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload336) => { + mbt_ffi_store8((iter_base) + 56, (1)) + + match payload336 { + Multimodal => { + mbt_ffi_store8((iter_base) + 60, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 60, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 60, (2)) + + () + } + Other(payload340) => { + mbt_ffi_store8((iter_base) + 60, (3)) + + let ptr341 = mbt_ffi_str2ptr(payload340) + mbt_ffi_store32((iter_base) + 68, payload340.length()) + mbt_ffi_store32((iter_base) + 64, ptr341) + cleanup_list.push(ptr341) + + () + } + } + + () + } + } + cleanup_list.push(ptr320) + cleanup_list.push(address327) + cleanup_list.push(address330) + + } + mbt_ffi_store32((iter_base) + 12, (payload319).length()) + mbt_ffi_store32((iter_base) + 8, address342) + cleanup_list.push(address342) + + () + } + EnumType(payload344) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address346 = mbt_ffi_malloc((payload344).length() * 8); + for index347 = 0; index347 < (payload344).length(); index347 = index347 + 1 { + let iter_elem : String = (payload344)[(index347)] + let iter_base = address346 + (index347 * 8); + + let ptr345 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr345) + cleanup_list.push(ptr345) + + } + mbt_ffi_store32((iter_base) + 12, (payload344).length()) + mbt_ffi_store32((iter_base) + 8, address346) + cleanup_list.push(address346) + + () + } + FlagsType(payload348) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address350 = mbt_ffi_malloc((payload348).length() * 8); + for index351 = 0; index351 < (payload348).length(); index351 = index351 + 1 { + let iter_elem : String = (payload348)[(index351)] + let iter_base = address350 + (index351 * 8); + + let ptr349 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr349) + cleanup_list.push(ptr349) + + } + mbt_ffi_store32((iter_base) + 12, (payload348).length()) + mbt_ffi_store32((iter_base) + 8, address350) + cleanup_list.push(address350) + + () + } + TupleType(payload352) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address353 = mbt_ffi_malloc((payload352).length() * 4); + for index354 = 0; index354 < (payload352).length(); index354 = index354 + 1 { + let iter_elem : Int = (payload352)[(index354)] + let iter_base = address353 + (index354 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload352).length()) + mbt_ffi_store32((iter_base) + 8, address353) + cleanup_list.push(address353) + + () + } + ListType(payload355) => { + mbt_ffi_store8((iter_base) + 0, (19)) + mbt_ffi_store32((iter_base) + 8, payload355) + + () + } + FixedListType(payload356) => { + mbt_ffi_store8((iter_base) + 0, (20)) + mbt_ffi_store32((iter_base) + 8, (payload356).element) + mbt_ffi_store32((iter_base) + 12, ((payload356).length).reinterpret_as_int()) + + () + } + MapType(payload357) => { + mbt_ffi_store8((iter_base) + 0, (21)) + mbt_ffi_store32((iter_base) + 8, (payload357).key) + mbt_ffi_store32((iter_base) + 12, (payload357).value) + + () + } + OptionType(payload358) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store32((iter_base) + 8, payload358) + + () + } + ResultType(payload359) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match ((payload359).ok) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload361) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload361) + + () + } + } + + match ((payload359).err) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload363) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload363) + + () + } + } + + () + } + TextType(payload364) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match ((payload364).languages) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload366) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address368 = mbt_ffi_malloc((payload366).length() * 8); + for index369 = 0; index369 < (payload366).length(); index369 = index369 + 1 { + let iter_elem : String = (payload366)[(index369)] + let iter_base = address368 + (index369 * 8); + + let ptr367 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr367) + cleanup_list.push(ptr367) + + } + mbt_ffi_store32((iter_base) + 16, (payload366).length()) + mbt_ffi_store32((iter_base) + 12, address368) + cleanup_list.push(address368) + + () + } + } + + match ((payload364).min_length) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload371) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload371).reinterpret_as_int()) + + () + } + } + + match ((payload364).max_length) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload373) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload373).reinterpret_as_int()) + + () + } + } + + match ((payload364).regex) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload375) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr376 = mbt_ffi_str2ptr(payload375) + mbt_ffi_store32((iter_base) + 44, payload375.length()) + mbt_ffi_store32((iter_base) + 40, ptr376) + cleanup_list.push(ptr376) + + () + } + } + + () + } + BinaryType(payload377) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + match ((payload377).mime_types) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload379) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address381 = mbt_ffi_malloc((payload379).length() * 8); + for index382 = 0; index382 < (payload379).length(); index382 = index382 + 1 { + let iter_elem : String = (payload379)[(index382)] + let iter_base = address381 + (index382 * 8); + + let ptr380 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr380) + cleanup_list.push(ptr380) + + } + mbt_ffi_store32((iter_base) + 16, (payload379).length()) + mbt_ffi_store32((iter_base) + 12, address381) + cleanup_list.push(address381) + + () + } + } + + match ((payload377).min_bytes) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload384) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload384).reinterpret_as_int()) + + () + } + } + + match ((payload377).max_bytes) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload386) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload386).reinterpret_as_int()) + + () + } + } + + () + } + PathType(payload387) => { + mbt_ffi_store8((iter_base) + 0, (26)) + mbt_ffi_store8((iter_base) + 8, (payload387).direction.ordinal()) + mbt_ffi_store8((iter_base) + 9, (payload387).kind.ordinal()) + + match ((payload387).allowed_mime_types) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload389) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let address391 = mbt_ffi_malloc((payload389).length() * 8); + for index392 = 0; index392 < (payload389).length(); index392 = index392 + 1 { + let iter_elem : String = (payload389)[(index392)] + let iter_base = address391 + (index392 * 8); + + let ptr390 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr390) + cleanup_list.push(ptr390) + + } + mbt_ffi_store32((iter_base) + 20, (payload389).length()) + mbt_ffi_store32((iter_base) + 16, address391) + cleanup_list.push(address391) + + () + } + } + + match ((payload387).allowed_extensions) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload394) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let address396 = mbt_ffi_malloc((payload394).length() * 8); + for index397 = 0; index397 < (payload394).length(); index397 = index397 + 1 { + let iter_elem : String = (payload394)[(index397)] + let iter_base = address396 + (index397 * 8); + + let ptr395 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr395) + cleanup_list.push(ptr395) + + } + mbt_ffi_store32((iter_base) + 32, (payload394).length()) + mbt_ffi_store32((iter_base) + 28, address396) + cleanup_list.push(address396) + + () + } + } + + () + } + UrlType(payload398) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + match ((payload398).allowed_schemes) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload400) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address402 = mbt_ffi_malloc((payload400).length() * 8); + for index403 = 0; index403 < (payload400).length(); index403 = index403 + 1 { + let iter_elem : String = (payload400)[(index403)] + let iter_base = address402 + (index403 * 8); + + let ptr401 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr401) + cleanup_list.push(ptr401) + + } + mbt_ffi_store32((iter_base) + 16, (payload400).length()) + mbt_ffi_store32((iter_base) + 12, address402) + cleanup_list.push(address402) + + () + } + } + + match ((payload398).allowed_hosts) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload405) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let address407 = mbt_ffi_malloc((payload405).length() * 8); + for index408 = 0; index408 < (payload405).length(); index408 = index408 + 1 { + let iter_elem : String = (payload405)[(index408)] + let iter_base = address407 + (index408 * 8); + + let ptr406 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr406) + cleanup_list.push(ptr406) + + } + mbt_ffi_store32((iter_base) + 28, (payload405).length()) + mbt_ffi_store32((iter_base) + 24, address407) + cleanup_list.push(address407) + + () + } + } + + () + } + DatetimeType => { + mbt_ffi_store8((iter_base) + 0, (28)) + + () + } + DurationType => { + mbt_ffi_store8((iter_base) + 0, (29)) + + () + } + QuantityType(payload411) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr412 = mbt_ffi_str2ptr((payload411).base_unit) + mbt_ffi_store32((iter_base) + 12, (payload411).base_unit.length()) + mbt_ffi_store32((iter_base) + 8, ptr412) + + let address414 = mbt_ffi_malloc(((payload411).allowed_suffixes).length() * 8); + for index415 = 0; index415 < ((payload411).allowed_suffixes).length(); index415 = index415 + 1 { + let iter_elem : String = ((payload411).allowed_suffixes)[(index415)] + let iter_base = address414 + (index415 * 8); + + let ptr413 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr413) + cleanup_list.push(ptr413) + + } + mbt_ffi_store32((iter_base) + 20, ((payload411).allowed_suffixes).length()) + mbt_ffi_store32((iter_base) + 16, address414) + + match ((payload411).min) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload417) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload417).mantissa) + mbt_ffi_store32((iter_base) + 40, (payload417).scale) + + let ptr418 = mbt_ffi_str2ptr((payload417).unit) + mbt_ffi_store32((iter_base) + 48, (payload417).unit.length()) + mbt_ffi_store32((iter_base) + 44, ptr418) + cleanup_list.push(ptr418) + + () + } + } + + match ((payload411).max) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload420) => { + mbt_ffi_store8((iter_base) + 56, (1)) + mbt_ffi_store64((iter_base) + 64, (payload420).mantissa) + mbt_ffi_store32((iter_base) + 72, (payload420).scale) + + let ptr421 = mbt_ffi_str2ptr((payload420).unit) + mbt_ffi_store32((iter_base) + 80, (payload420).unit.length()) + mbt_ffi_store32((iter_base) + 76, ptr421) + cleanup_list.push(ptr421) + + () + } + } + cleanup_list.push(ptr412) + cleanup_list.push(address414) + + () + } + UnionType(payload422) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let address458 = mbt_ffi_malloc(((payload422).branches).length() * 92); + for index459 = 0; index459 < ((payload422).branches).length(); index459 = index459 + 1 { + let iter_elem : @types.UnionBranch = ((payload422).branches)[(index459)] + let iter_base = address458 + (index459 * 92); + + let ptr423 = mbt_ffi_str2ptr((iter_elem).tag) + mbt_ffi_store32((iter_base) + 4, (iter_elem).tag.length()) + mbt_ffi_store32((iter_base) + 0, ptr423) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (iter_elem).discriminator { + Prefix(payload424) => { + mbt_ffi_store8((iter_base) + 12, (0)) + + let ptr425 = mbt_ffi_str2ptr(payload424) + mbt_ffi_store32((iter_base) + 20, payload424.length()) + mbt_ffi_store32((iter_base) + 16, ptr425) + cleanup_list.push(ptr425) + + () + } + Suffix(payload426) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr427 = mbt_ffi_str2ptr(payload426) + mbt_ffi_store32((iter_base) + 20, payload426.length()) + mbt_ffi_store32((iter_base) + 16, ptr427) + cleanup_list.push(ptr427) + + () + } + Contains(payload428) => { + mbt_ffi_store8((iter_base) + 12, (2)) + + let ptr429 = mbt_ffi_str2ptr(payload428) + mbt_ffi_store32((iter_base) + 20, payload428.length()) + mbt_ffi_store32((iter_base) + 16, ptr429) + cleanup_list.push(ptr429) + + () + } + Regex(payload430) => { + mbt_ffi_store8((iter_base) + 12, (3)) + + let ptr431 = mbt_ffi_str2ptr(payload430) + mbt_ffi_store32((iter_base) + 20, payload430.length()) + mbt_ffi_store32((iter_base) + 16, ptr431) + cleanup_list.push(ptr431) + + () + } + FieldEquals(payload432) => { + mbt_ffi_store8((iter_base) + 12, (4)) + + let ptr433 = mbt_ffi_str2ptr((payload432).field_name) + mbt_ffi_store32((iter_base) + 20, (payload432).field_name.length()) + mbt_ffi_store32((iter_base) + 16, ptr433) + + match ((payload432).literal) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload435) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let ptr436 = mbt_ffi_str2ptr(payload435) + mbt_ffi_store32((iter_base) + 32, payload435.length()) + mbt_ffi_store32((iter_base) + 28, ptr436) + cleanup_list.push(ptr436) + + () + } + } + cleanup_list.push(ptr433) + + () + } + FieldAbsent(payload437) => { + mbt_ffi_store8((iter_base) + 12, (5)) + + let ptr438 = mbt_ffi_str2ptr(payload437) + mbt_ffi_store32((iter_base) + 20, payload437.length()) + mbt_ffi_store32((iter_base) + 16, ptr438) + cleanup_list.push(ptr438) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload440) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr441 = mbt_ffi_str2ptr(payload440) + mbt_ffi_store32((iter_base) + 44, payload440.length()) + mbt_ffi_store32((iter_base) + 40, ptr441) + cleanup_list.push(ptr441) + + () + } + } + + let address443 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index444 = 0; index444 < (((iter_elem).metadata).aliases).length(); index444 = index444 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index444)] + let iter_base = address443 + (index444 * 8); + + let ptr442 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr442) + cleanup_list.push(ptr442) + + } + mbt_ffi_store32((iter_base) + 52, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 48, address443) + + let address446 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index447 = 0; index447 < (((iter_elem).metadata).examples).length(); index447 = index447 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index447)] + let iter_base = address446 + (index447 * 8); + + let ptr445 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr445) + cleanup_list.push(ptr445) + + } + mbt_ffi_store32((iter_base) + 60, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 56, address446) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload449) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr450 = mbt_ffi_str2ptr(payload449) + mbt_ffi_store32((iter_base) + 72, payload449.length()) + mbt_ffi_store32((iter_base) + 68, ptr450) + cleanup_list.push(ptr450) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 76, (0)) + + () + } + Some(payload452) => { + mbt_ffi_store8((iter_base) + 76, (1)) + + match payload452 { + Multimodal => { + mbt_ffi_store8((iter_base) + 80, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 80, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 80, (2)) + + () + } + Other(payload456) => { + mbt_ffi_store8((iter_base) + 80, (3)) + + let ptr457 = mbt_ffi_str2ptr(payload456) + mbt_ffi_store32((iter_base) + 88, payload456.length()) + mbt_ffi_store32((iter_base) + 84, ptr457) + cleanup_list.push(ptr457) + + () + } + } + + () + } + } + cleanup_list.push(ptr423) + cleanup_list.push(address443) + cleanup_list.push(address446) + + } + mbt_ffi_store32((iter_base) + 12, ((payload422).branches).length()) + mbt_ffi_store32((iter_base) + 8, address458) + cleanup_list.push(address458) + + () + } + SecretType(payload460) => { + mbt_ffi_store8((iter_base) + 0, (32)) + mbt_ffi_store32((iter_base) + 8, (payload460).inner) + + match ((payload460).category) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload462) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr463 = mbt_ffi_str2ptr(payload462) + mbt_ffi_store32((iter_base) + 20, payload462.length()) + mbt_ffi_store32((iter_base) + 16, ptr463) + cleanup_list.push(ptr463) + + () + } + } + + () + } + QuotaTokenType(payload464) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + match ((payload464).resource_name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload466) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr467 = mbt_ffi_str2ptr(payload466) + mbt_ffi_store32((iter_base) + 16, payload466.length()) + mbt_ffi_store32((iter_base) + 12, ptr467) + cleanup_list.push(ptr467) + + () + } + } + + () + } + PermissionCardType(payload468) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store8((iter_base) + 8, (if (payload468).polymorphic { 1 } else { 0 })) + + () + } + FutureType(payload469) => { + mbt_ffi_store8((iter_base) + 0, (35)) + + match (payload469) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload471) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload471) + + () + } + } + + () + } + StreamType(payload472) => { + mbt_ffi_store8((iter_base) + 0, (36)) + + match (payload472) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload474) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload474) + + () + } + } + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 88, (0)) + + () + } + Some(payload476) => { + mbt_ffi_store8((iter_base) + 88, (1)) + + let ptr477 = mbt_ffi_str2ptr(payload476) + mbt_ffi_store32((iter_base) + 96, payload476.length()) + mbt_ffi_store32((iter_base) + 92, ptr477) + cleanup_list.push(ptr477) + + () + } + } + + let address479 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index480 = 0; index480 < (((iter_elem).metadata).aliases).length(); index480 = index480 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index480)] + let iter_base = address479 + (index480 * 8); + + let ptr478 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr478) + cleanup_list.push(ptr478) + + } + mbt_ffi_store32((iter_base) + 104, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 100, address479) + + let address482 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index483 = 0; index483 < (((iter_elem).metadata).examples).length(); index483 = index483 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index483)] + let iter_base = address482 + (index483 * 8); + + let ptr481 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr481) + cleanup_list.push(ptr481) + + } + mbt_ffi_store32((iter_base) + 112, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 108, address482) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 116, (0)) + + () + } + Some(payload485) => { + mbt_ffi_store8((iter_base) + 116, (1)) + + let ptr486 = mbt_ffi_str2ptr(payload485) + mbt_ffi_store32((iter_base) + 124, payload485.length()) + mbt_ffi_store32((iter_base) + 120, ptr486) + cleanup_list.push(ptr486) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 128, (0)) + + () + } + Some(payload488) => { + mbt_ffi_store8((iter_base) + 128, (1)) + + match payload488 { + Multimodal => { + mbt_ffi_store8((iter_base) + 132, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 132, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 132, (2)) + + () + } + Other(payload492) => { + mbt_ffi_store8((iter_base) + 132, (3)) + + let ptr493 = mbt_ffi_str2ptr(payload492) + mbt_ffi_store32((iter_base) + 140, payload492.length()) + mbt_ffi_store32((iter_base) + 136, ptr493) + cleanup_list.push(ptr493) + + () + } + } + + () + } + } + cleanup_list.push(address479) + cleanup_list.push(address482) + + } + + let address500 = mbt_ffi_malloc((((payload131).graph).defs).length() * 24); + for index501 = 0; index501 < (((payload131).graph).defs).length(); index501 = index501 + 1 { + let iter_elem : @types.SchemaTypeDef = (((payload131).graph).defs)[(index501)] + let iter_base = address500 + (index501 * 24); + + let ptr496 = mbt_ffi_str2ptr((iter_elem).id) + mbt_ffi_store32((iter_base) + 4, (iter_elem).id.length()) + mbt_ffi_store32((iter_base) + 0, ptr496) + + match ((iter_elem).name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload498) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr499 = mbt_ffi_str2ptr(payload498) + mbt_ffi_store32((iter_base) + 16, payload498.length()) + mbt_ffi_store32((iter_base) + 12, ptr499) + cleanup_list.push(ptr499) + + () + } + } + mbt_ffi_store32((iter_base) + 20, (iter_elem).body) + cleanup_list.push(ptr496) + + } + + let address574 = mbt_ffi_malloc((((payload131).value).value_nodes).length() * 32); + for index575 = 0; index575 < (((payload131).value).value_nodes).length(); index575 = index575 + 1 { + let iter_elem : @types.SchemaValueNode = (((payload131).value).value_nodes)[(index575)] + let iter_base = address574 + (index575 * 32); + + match iter_elem { + BoolValue(payload502) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload502 { 1 } else { 0 })) + + () + } + S8Value(payload503) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload503)) + + () + } + S16Value(payload504) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload504)) + + () + } + S32Value(payload505) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload505) + + () + } + S64Value(payload506) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload506) + + () + } + U8Value(payload507) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload507).to_int()) + + () + } + U16Value(payload508) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload508).reinterpret_as_int()) + + () + } + U32Value(payload509) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload509).reinterpret_as_int()) + + () + } + U64Value(payload510) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload510).reinterpret_as_int64()) + + () + } + F32Value(payload511) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload511) + + () + } + F64Value(payload512) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload512) + + () + } + CharValue(payload513) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload513).to_int()) + + () + } + StringValue(payload514) => { + mbt_ffi_store8((iter_base) + 0, (12)) + + let ptr515 = mbt_ffi_str2ptr(payload514) + mbt_ffi_store32((iter_base) + 12, payload514.length()) + mbt_ffi_store32((iter_base) + 8, ptr515) + cleanup_list.push(ptr515) + + () + } + RecordValue(payload516) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let address517 = mbt_ffi_malloc((payload516).length() * 4); + for index518 = 0; index518 < (payload516).length(); index518 = index518 + 1 { + let iter_elem : Int = (payload516)[(index518)] + let iter_base = address517 + (index518 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload516).length()) + mbt_ffi_store32((iter_base) + 8, address517) + cleanup_list.push(address517) + + () + } + VariantValue(payload519) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload519).case).reinterpret_as_int()) + + match ((payload519).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload521) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload521) + + () + } + } + + () + } + EnumValue(payload522) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload522).reinterpret_as_int()) + + () + } + FlagsValue(payload523) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address524 = mbt_ffi_malloc((payload523).length() * 1); + for index525 = 0; index525 < (payload523).length(); index525 = index525 + 1 { + let iter_elem : Bool = (payload523)[(index525)] + let iter_base = address524 + (index525 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload523).length()) + mbt_ffi_store32((iter_base) + 8, address524) + cleanup_list.push(address524) + + () + } + TupleValue(payload526) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address527 = mbt_ffi_malloc((payload526).length() * 4); + for index528 = 0; index528 < (payload526).length(); index528 = index528 + 1 { + let iter_elem : Int = (payload526)[(index528)] + let iter_base = address527 + (index528 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload526).length()) + mbt_ffi_store32((iter_base) + 8, address527) + cleanup_list.push(address527) + + () + } + ListValue(payload529) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address530 = mbt_ffi_malloc((payload529).length() * 4); + for index531 = 0; index531 < (payload529).length(); index531 = index531 + 1 { + let iter_elem : Int = (payload529)[(index531)] + let iter_base = address530 + (index531 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload529).length()) + mbt_ffi_store32((iter_base) + 8, address530) + cleanup_list.push(address530) + + () + } + FixedListValue(payload532) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address533 = mbt_ffi_malloc((payload532).length() * 4); + for index534 = 0; index534 < (payload532).length(); index534 = index534 + 1 { + let iter_elem : Int = (payload532)[(index534)] + let iter_base = address533 + (index534 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload532).length()) + mbt_ffi_store32((iter_base) + 8, address533) + cleanup_list.push(address533) + + () + } + MapValue(payload535) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let address536 = mbt_ffi_malloc((payload535).length() * 8); + for index537 = 0; index537 < (payload535).length(); index537 = index537 + 1 { + let iter_elem : @types.MapEntry = (payload535)[(index537)] + let iter_base = address536 + (index537 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload535).length()) + mbt_ffi_store32((iter_base) + 8, address536) + cleanup_list.push(address536) + + () + } + OptionValue(payload538) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + match (payload538) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload540) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload540) + + () + } + } + + () + } + ResultValue(payload541) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload541 { + OkValue(payload542) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload542) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload544) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload544) + + () + } + } + + () + } + ErrValue(payload545) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload545) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload547) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload547) + + () + } + } + + () + } + } + + () + } + TextValue(payload548) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr549 = mbt_ffi_str2ptr((payload548).text) + mbt_ffi_store32((iter_base) + 12, (payload548).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr549) + + match ((payload548).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload551) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr552 = mbt_ffi_str2ptr(payload551) + mbt_ffi_store32((iter_base) + 24, payload551.length()) + mbt_ffi_store32((iter_base) + 20, ptr552) + cleanup_list.push(ptr552) + + () + } + } + cleanup_list.push(ptr549) + + () + } + BinaryValue(payload553) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr554 = mbt_ffi_bytes2ptr((payload553).bytes) + + mbt_ffi_store32((iter_base) + 12, (payload553).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr554) + + match ((payload553).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload556) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr557 = mbt_ffi_str2ptr(payload556) + mbt_ffi_store32((iter_base) + 24, payload556.length()) + mbt_ffi_store32((iter_base) + 20, ptr557) + cleanup_list.push(ptr557) + + () + } + } + cleanup_list.push(ptr554) + + () + } + PathValue(payload558) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr559 = mbt_ffi_str2ptr(payload558) + mbt_ffi_store32((iter_base) + 12, payload558.length()) + mbt_ffi_store32((iter_base) + 8, ptr559) + cleanup_list.push(ptr559) + + () + } + UrlValue(payload560) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr561 = mbt_ffi_str2ptr(payload560) + mbt_ffi_store32((iter_base) + 12, payload560.length()) + mbt_ffi_store32((iter_base) + 8, ptr561) + cleanup_list.push(ptr561) + + () + } + DatetimeValue(payload562) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload562).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload562).nanoseconds).reinterpret_as_int()) + + () + } + DurationValue(payload563) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload563).nanoseconds) + + () + } + QuantityValueNode(payload564) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload564).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload564).scale) + + let ptr565 = mbt_ffi_str2ptr((payload564).unit) + mbt_ffi_store32((iter_base) + 24, (payload564).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr565) + cleanup_list.push(ptr565) + + () + } + UnionValue(payload566) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr567 = mbt_ffi_str2ptr((payload566).tag) + mbt_ffi_store32((iter_base) + 12, (payload566).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr567) + mbt_ffi_store32((iter_base) + 16, (payload566).body) + cleanup_list.push(ptr567) + + () + } + SecretValue(payload568) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let @types.Secret(handle569) = payload568 + mbt_ffi_store32((iter_base) + 8, handle569) + + () + } + QuotaTokenHandle(payload570) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let @types.QuotaToken(handle571) = payload570 + mbt_ffi_store32((iter_base) + 8, handle571) + + () + } + PermissionCardHandle(payload572) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let @types.PermissionCard(handle573) = payload572 + mbt_ffi_store32((iter_base) + 8, handle573) + + () + } + } + + } + cleanup_list.push(address494) + cleanup_list.push(address500) + cleanup_list.push(address574) + + ((4), address494, (((payload131).graph).type_nodes).length(), address500, (((payload131).graph).defs).length(), ((payload131).graph).root, address574, (((payload131).value).value_nodes).length(), ((payload131).value).root) + } } - Unsigned(payload196) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload196.reinterpret_as_int64(), - ) - () - } - FloatBits(payload197) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload197.reinterpret_as_int64(), - ) + ((1), lowered576, lowered577, lowered578, lowered579, lowered580, lowered581, lowered582, lowered583, lowered584) + } + } - () - } - } + wasmExportAsyncInvokeGolemAgentGuestTaskReturn(lowered585, lowered586, lowered587, lowered588, lowered589, lowered590, lowered591, lowered592, lowered593, lowered594) - () - } - } + cleanup_list.each(mbt_ffi_free) - match payload187.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + @async-core.task_returned() - () - } - Some(payload199) => { - mbt_ffi_store8(iter_base + 64, 1) + } + None => () + } - let ptr200 = mbt_ffi_str2ptr(payload199) - mbt_ffi_store32(iter_base + 72, payload199.length()) - mbt_ffi_store32(iter_base + 68, ptr200) - cleanup_list.push(ptr200) +} - () - } - } +#doc(hidden) +pub fn wasmExportAsyncInvokeGolemAgentGuest(event_raw : Int, waitable : Int, code : Int) -> Int { + @async-core.cb(event_raw, waitable, code) +} - () - } - } +#doc(hidden) +pub fn wasmExportGetDefinition() -> Int { - () - } - F64Type(payload201) => { - mbt_ffi_store8(iter_base + 0, 11) + let (result) : (@common.AgentType) = get_definition(); + let return_area = mbt_ffi_malloc(176) + __wit_bindgen_lower_t399((return_area) + 0, result) + let ret = return_area + return ret - match payload201 { - None => { - mbt_ffi_store8(iter_base + 8, 0) +} - () - } - Some(payload203) => { - mbt_ffi_store8(iter_base + 8, 1) +#doc(hidden) +pub fn wasmExportGetDefinitionPostReturn(p0 : Int) -> Unit { + mbt_ffi_free(mbt_ffi_load32((p0) + 0)) + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + mbt_ffi_free(mbt_ffi_load32((p0) + 16)) - match payload203.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + for index19 = 0; index19 < (mbt_ffi_load32((p0) + 28)); index19 = index19 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 24)) + (index19 * 144) - () - } - Some(payload205) => { - mbt_ffi_store8(iter_base + 16, 1) + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { - match payload205 { - Signed(payload206) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload206) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Unsigned(payload207) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload207.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - FloatBits(payload208) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload208.reinterpret_as_int64(), - ) + } + _ => panic() + } - () } - } - - () - } + _ => panic() } - match payload203.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload210) => { - mbt_ffi_store8(iter_base + 40, 1) + } + 3 => { - match payload210 { - Signed(payload211) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload211) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Unsigned(payload212) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload212.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - FloatBits(payload213) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload213.reinterpret_as_int64(), - ) + } + _ => panic() + } - () } - } - - () - } + _ => panic() } - match payload203.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + } + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload215) => { - mbt_ffi_store8(iter_base + 64, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr216 = mbt_ffi_str2ptr(payload215) - mbt_ffi_store32(iter_base + 72, payload215.length()) - mbt_ffi_store32(iter_base + 68, ptr216) - cleanup_list.push(ptr216) + } + _ => panic() + } - () - } + } + _ => panic() } - () - } - } - - () } - CharType => { - mbt_ffi_store8(iter_base + 0, 12) + 5 => { - () - } - StringType => { - mbt_ffi_store8(iter_base + 0, 13) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - RecordType(payload219) => { - mbt_ffi_store8(iter_base + 0, 14) - - let address239 = mbt_ffi_malloc(payload219.length() * 68) - for index240 = 0 - index240 < payload219.length() - index240 = index240 + 1 { - let iter_elem : @types.NamedFieldType = payload219[index240] - let iter_base = address239 + index240 * 68 - - let ptr220 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr220) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload222) => { - mbt_ffi_store8(iter_base + 12, 1) - - let ptr223 = mbt_ffi_str2ptr(payload222) - mbt_ffi_store32(iter_base + 20, payload222.length()) - mbt_ffi_store32(iter_base + 16, ptr223) - cleanup_list.push(ptr223) - - () - } - } - - let address = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index225 = 0 - index225 < iter_elem.metadata.aliases.length() - index225 = index225 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index225] - let iter_base = address + index225 * 8 - - let ptr224 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr224) - cleanup_list.push(ptr224) - } - mbt_ffi_store32( - iter_base + 28, - iter_elem.metadata.aliases.length(), - ) - mbt_ffi_store32(iter_base + 24, address) - - let address227 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index228 = 0 - index228 < iter_elem.metadata.examples.length() - index228 = index228 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index228] - let iter_base = address227 + index228 * 8 - - let ptr226 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr226) - cleanup_list.push(ptr226) - } - mbt_ffi_store32( - iter_base + 36, - iter_elem.metadata.examples.length(), - ) - mbt_ffi_store32(iter_base + 32, address227) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () + } + _ => panic() + } + + } + _ => panic() } - Some(payload230) => { - mbt_ffi_store8(iter_base + 40, 1) - let ptr231 = mbt_ffi_str2ptr(payload230) - mbt_ffi_store32(iter_base + 48, payload230.length()) - mbt_ffi_store32(iter_base + 44, ptr231) - cleanup_list.push(ptr231) + } + 6 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 52, 0) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - Some(payload233) => { - mbt_ffi_store8(iter_base + 52, 1) + } + _ => panic() + } - match payload233 { - Multimodal => { - mbt_ffi_store8(iter_base + 56, 0) + } + _ => panic() + } - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 56, 1) + } + 7 => { - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 56, 2) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Other(payload237) => { - mbt_ffi_store8(iter_base + 56, 3) - - let ptr238 = mbt_ffi_str2ptr(payload237) - mbt_ffi_store32( - iter_base + 64, - payload237.length(), - ) - mbt_ffi_store32(iter_base + 60, ptr238) - cleanup_list.push(ptr238) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - } + } + _ => panic() + } - () + } + _ => panic() } - } - cleanup_list.push(ptr220) - cleanup_list.push(address) - cleanup_list.push(address227) - } - mbt_ffi_store32(iter_base + 12, payload219.length()) - mbt_ffi_store32(iter_base + 8, address239) - cleanup_list.push(address239) - () } - VariantType(payload241) => { - mbt_ffi_store8(iter_base + 0, 15) + 8 => { - let address264 = mbt_ffi_malloc(payload241.length() * 72) - for index265 = 0 - index265 < payload241.length() - index265 = index265 + 1 { - let iter_elem : @types.VariantCaseType = payload241[index265] - let iter_base = address264 + index265 * 72 + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - let ptr242 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr242) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - match iter_elem.payload { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + _ => panic() + } - () + } + _ => panic() } - Some(payload244) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload244) - () - } - } + } + 9 => { - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload246) => { - mbt_ffi_store8(iter_base + 16, 1) - - let ptr247 = mbt_ffi_str2ptr(payload246) - mbt_ffi_store32(iter_base + 24, payload246.length()) - mbt_ffi_store32(iter_base + 20, ptr247) - cleanup_list.push(ptr247) - - () - } - } - - let address249 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index250 = 0 - index250 < iter_elem.metadata.aliases.length() - index250 = index250 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index250] - let iter_base = address249 + index250 * 8 - - let ptr248 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr248) - cleanup_list.push(ptr248) - } - mbt_ffi_store32( - iter_base + 32, - iter_elem.metadata.aliases.length(), - ) - mbt_ffi_store32(iter_base + 28, address249) - - let address252 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index253 = 0 - index253 < iter_elem.metadata.examples.length() - index253 = index253 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index253] - let iter_base = address252 + index253 * 8 - - let ptr251 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr251) - cleanup_list.push(ptr251) - } - mbt_ffi_store32( - iter_base + 40, - iter_elem.metadata.examples.length(), - ) - mbt_ffi_store32(iter_base + 36, address252) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 44, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload255) => { - mbt_ffi_store8(iter_base + 44, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr256 = mbt_ffi_str2ptr(payload255) - mbt_ffi_store32(iter_base + 52, payload255.length()) - mbt_ffi_store32(iter_base + 48, ptr256) - cleanup_list.push(ptr256) + } + _ => panic() + } - () + } + _ => panic() } - } - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 56, 0) + } + 10 => { - () - } - Some(payload258) => { - mbt_ffi_store8(iter_base + 56, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload258 { - Multimodal => { - mbt_ffi_store8(iter_base + 60, 0) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 60, 1) + } + _ => panic() + } - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 60, 2) + } + _ => panic() + } - () - } - Other(payload262) => { - mbt_ffi_store8(iter_base + 60, 3) - - let ptr263 = mbt_ffi_str2ptr(payload262) - mbt_ffi_store32( - iter_base + 68, - payload262.length(), - ) - mbt_ffi_store32(iter_base + 64, ptr263) - cleanup_list.push(ptr263) + } + 11 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - } - cleanup_list.push(ptr242) - cleanup_list.push(address249) - cleanup_list.push(address252) - } - mbt_ffi_store32(iter_base + 12, payload241.length()) - mbt_ffi_store32(iter_base + 8, address264) - cleanup_list.push(address264) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - EnumType(payload266) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address268 = mbt_ffi_malloc(payload266.length() * 8) - for index269 = 0 - index269 < payload266.length() - index269 = index269 + 1 { - let iter_elem : String = payload266[index269] - let iter_base = address268 + index269 * 8 - - let ptr267 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr267) - cleanup_list.push(ptr267) - } - mbt_ffi_store32(iter_base + 12, payload266.length()) - mbt_ffi_store32(iter_base + 8, address268) - cleanup_list.push(address268) - - () - } - FlagsType(payload270) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address272 = mbt_ffi_malloc(payload270.length() * 8) - for index273 = 0 - index273 < payload270.length() - index273 = index273 + 1 { - let iter_elem : String = payload270[index273] - let iter_base = address272 + index273 * 8 - - let ptr271 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr271) - cleanup_list.push(ptr271) - } - mbt_ffi_store32(iter_base + 12, payload270.length()) - mbt_ffi_store32(iter_base + 8, address272) - cleanup_list.push(address272) - - () - } - TupleType(payload274) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address275 = mbt_ffi_malloc(payload274.length() * 4) - for index276 = 0 - index276 < payload274.length() - index276 = index276 + 1 { - let iter_elem : Int = payload274[index276] - let iter_base = address275 + index276 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload274.length()) - mbt_ffi_store32(iter_base + 8, address275) - cleanup_list.push(address275) - - () - } - ListType(payload277) => { - mbt_ffi_store8(iter_base + 0, 19) - mbt_ffi_store32(iter_base + 8, payload277) + } + _ => panic() + } - () - } - FixedListType(payload278) => { - mbt_ffi_store8(iter_base + 0, 20) - mbt_ffi_store32(iter_base + 8, payload278.element) - mbt_ffi_store32( - iter_base + 12, - payload278.length.reinterpret_as_int(), - ) - - () - } - MapType(payload279) => { - mbt_ffi_store8(iter_base + 0, 21) - mbt_ffi_store32(iter_base + 8, payload279.key) - mbt_ffi_store32(iter_base + 12, payload279.value) + } + _ => panic() + } - () } - OptionType(payload280) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store32(iter_base + 8, payload280) + 12 => () + 13 => () + 14 => { - () - } - ResultType(payload281) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload281.ok { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload283) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload283) - - () - } - } - - match payload281.err { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload285) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload285) - - () - } - } - - () - } - TextType(payload286) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload286.languages { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload288) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address290 = mbt_ffi_malloc(payload288.length() * 8) - for index291 = 0 - index291 < payload288.length() - index291 = index291 + 1 { - let iter_elem : String = payload288[index291] - let iter_base = address290 + index291 * 8 - - let ptr289 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr289) - cleanup_list.push(ptr289) - } - mbt_ffi_store32(iter_base + 16, payload288.length()) - mbt_ffi_store32(iter_base + 12, address290) - cleanup_list.push(address290) - - () - } - } - - match payload286.min_length { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload293) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32( - iter_base + 24, - payload293.reinterpret_as_int(), - ) - - () - } - } - - match payload286.max_length { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload295) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32( - iter_base + 32, - payload295.reinterpret_as_int(), - ) - - () - } - } - - match payload286.regex { - None => { - mbt_ffi_store8(iter_base + 36, 0) - - () - } - Some(payload297) => { - mbt_ffi_store8(iter_base + 36, 1) - - let ptr298 = mbt_ffi_str2ptr(payload297) - mbt_ffi_store32(iter_base + 44, payload297.length()) - mbt_ffi_store32(iter_base + 40, ptr298) - cleanup_list.push(ptr298) - - () - } - } - - () - } - BinaryType(payload299) => { - mbt_ffi_store8(iter_base + 0, 25) - - match payload299.mime_types { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload301) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address303 = mbt_ffi_malloc(payload301.length() * 8) - for index304 = 0 - index304 < payload301.length() - index304 = index304 + 1 { - let iter_elem : String = payload301[index304] - let iter_base = address303 + index304 * 8 - - let ptr302 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr302) - cleanup_list.push(ptr302) - } - mbt_ffi_store32(iter_base + 16, payload301.length()) - mbt_ffi_store32(iter_base + 12, address303) - cleanup_list.push(address303) - - () - } - } - - match payload299.min_bytes { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload306) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32( - iter_base + 24, - payload306.reinterpret_as_int(), - ) - - () - } - } - - match payload299.max_bytes { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload308) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32( - iter_base + 32, - payload308.reinterpret_as_int(), - ) - - () - } - } - - () - } - PathType(payload309) => { - mbt_ffi_store8(iter_base + 0, 26) - mbt_ffi_store8( - iter_base + 8, - payload309.direction.ordinal(), - ) - mbt_ffi_store8(iter_base + 9, payload309.kind.ordinal()) - - match payload309.allowed_mime_types { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload311) => { - mbt_ffi_store8(iter_base + 12, 1) - - let address313 = mbt_ffi_malloc(payload311.length() * 8) - for index314 = 0 - index314 < payload311.length() - index314 = index314 + 1 { - let iter_elem : String = payload311[index314] - let iter_base = address313 + index314 * 8 - - let ptr312 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr312) - cleanup_list.push(ptr312) - } - mbt_ffi_store32(iter_base + 20, payload311.length()) - mbt_ffi_store32(iter_base + 16, address313) - cleanup_list.push(address313) - - () - } - } - - match payload309.allowed_extensions { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload316) => { - mbt_ffi_store8(iter_base + 24, 1) - - let address318 = mbt_ffi_malloc(payload316.length() * 8) - for index319 = 0 - index319 < payload316.length() - index319 = index319 + 1 { - let iter_elem : String = payload316[index319] - let iter_base = address318 + index319 * 8 - - let ptr317 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr317) - cleanup_list.push(ptr317) - } - mbt_ffi_store32(iter_base + 32, payload316.length()) - mbt_ffi_store32(iter_base + 28, address318) - cleanup_list.push(address318) - - () - } - } - - () - } - UrlType(payload320) => { - mbt_ffi_store8(iter_base + 0, 27) - - match payload320.allowed_schemes { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload322) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address324 = mbt_ffi_malloc(payload322.length() * 8) - for index325 = 0 - index325 < payload322.length() - index325 = index325 + 1 { - let iter_elem : String = payload322[index325] - let iter_base = address324 + index325 * 8 - - let ptr323 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr323) - cleanup_list.push(ptr323) - } - mbt_ffi_store32(iter_base + 16, payload322.length()) - mbt_ffi_store32(iter_base + 12, address324) - cleanup_list.push(address324) - - () - } - } - - match payload320.allowed_hosts { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload327) => { - mbt_ffi_store8(iter_base + 20, 1) - - let address329 = mbt_ffi_malloc(payload327.length() * 8) - for index330 = 0 - index330 < payload327.length() - index330 = index330 + 1 { - let iter_elem : String = payload327[index330] - let iter_base = address329 + index330 * 8 - - let ptr328 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr328) - cleanup_list.push(ptr328) - } - mbt_ffi_store32(iter_base + 28, payload327.length()) - mbt_ffi_store32(iter_base + 24, address329) - cleanup_list.push(address329) - - () - } - } - - () - } - DatetimeType => { - mbt_ffi_store8(iter_base + 0, 28) + for index1 = 0; index1 < (mbt_ffi_load32((iter_base) + 12)); index1 = index1 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - DurationType => { - mbt_ffi_store8(iter_base + 0, 29) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - QuantityType(payload333) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr334 = mbt_ffi_str2ptr(payload333.base_unit) - mbt_ffi_store32( - iter_base + 12, - payload333.base_unit.length(), - ) - mbt_ffi_store32(iter_base + 8, ptr334) - - let address336 = mbt_ffi_malloc( - payload333.allowed_suffixes.length() * 8, - ) - for index337 = 0 - index337 < payload333.allowed_suffixes.length() - index337 = index337 + 1 { - let iter_elem : String = payload333.allowed_suffixes[index337] - let iter_base = address336 + index337 * 8 - - let ptr335 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr335) - cleanup_list.push(ptr335) - } - mbt_ffi_store32( - iter_base + 20, - payload333.allowed_suffixes.length(), - ) - mbt_ffi_store32(iter_base + 16, address336) - - match payload333.min { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload339) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload339.mantissa) - mbt_ffi_store32(iter_base + 40, payload339.scale) - - let ptr340 = mbt_ffi_str2ptr(payload339.unit) - mbt_ffi_store32( - iter_base + 48, - payload339.unit.length(), - ) - mbt_ffi_store32(iter_base + 44, ptr340) - cleanup_list.push(ptr340) - - () - } - } - - match payload333.max { - None => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - Some(payload342) => { - mbt_ffi_store8(iter_base + 56, 1) - mbt_ffi_store64(iter_base + 64, payload342.mantissa) - mbt_ffi_store32(iter_base + 72, payload342.scale) - - let ptr343 = mbt_ffi_str2ptr(payload342.unit) - mbt_ffi_store32( - iter_base + 80, - payload342.unit.length(), - ) - mbt_ffi_store32(iter_base + 76, ptr343) - cleanup_list.push(ptr343) - - () - } - } - cleanup_list.push(ptr334) - cleanup_list.push(address336) - - () - } - UnionType(payload344) => { - mbt_ffi_store8(iter_base + 0, 31) + } + _ => panic() + } - let address380 = mbt_ffi_malloc( - payload344.branches.length() * 92, - ) - for index381 = 0 - index381 < payload344.branches.length() - index381 = index381 + 1 { - let iter_elem : @types.UnionBranch = payload344.branches[index381] - let iter_base = address380 + index381 * 92 + for index = 0; index < (mbt_ffi_load32((iter_base) + 28)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr345 = mbt_ffi_str2ptr(iter_elem.tag) - mbt_ffi_store32(iter_base + 4, iter_elem.tag.length()) - mbt_ffi_store32(iter_base + 0, ptr345) - mbt_ffi_store32(iter_base + 8, iter_elem.body) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - match iter_elem.discriminator { - Prefix(payload346) => { - mbt_ffi_store8(iter_base + 12, 0) + for index0 = 0; index0 < (mbt_ffi_load32((iter_base) + 36)); index0 = index0 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index0 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr347 = mbt_ffi_str2ptr(payload346) - mbt_ffi_store32(iter_base + 20, payload346.length()) - mbt_ffi_store32(iter_base + 16, ptr347) - cleanup_list.push(ptr347) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - () - } - Suffix(payload348) => { - mbt_ffi_store8(iter_base + 12, 1) + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - let ptr349 = mbt_ffi_str2ptr(payload348) - mbt_ffi_store32(iter_base + 20, payload348.length()) - mbt_ffi_store32(iter_base + 16, ptr349) - cleanup_list.push(ptr349) + } + _ => panic() + } - () - } - Contains(payload350) => { - mbt_ffi_store8(iter_base + 12, 2) + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { - let ptr351 = mbt_ffi_str2ptr(payload350) - mbt_ffi_store32(iter_base + 20, payload350.length()) - mbt_ffi_store32(iter_base + 16, ptr351) - cleanup_list.push(ptr351) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) - () - } - Regex(payload352) => { - mbt_ffi_store8(iter_base + 12, 3) + } + _ => panic() + } - let ptr353 = mbt_ffi_str2ptr(payload352) - mbt_ffi_store32(iter_base + 20, payload352.length()) - mbt_ffi_store32(iter_base + 16, ptr353) - cleanup_list.push(ptr353) + } + _ => panic() + } - () } - FieldEquals(payload354) => { - mbt_ffi_store8(iter_base + 12, 4) - - let ptr355 = mbt_ffi_str2ptr(payload354.field_name) - mbt_ffi_store32( - iter_base + 20, - payload354.field_name.length(), - ) - mbt_ffi_store32(iter_base + 16, ptr355) - - match payload354.literal { - None => { - mbt_ffi_store8(iter_base + 24, 0) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Some(payload357) => { - mbt_ffi_store8(iter_base + 24, 1) - - let ptr358 = mbt_ffi_str2ptr(payload357) - mbt_ffi_store32( - iter_base + 32, - payload357.length(), - ) - mbt_ffi_store32(iter_base + 28, ptr358) - cleanup_list.push(ptr358) + } + 15 => { - () - } - } - cleanup_list.push(ptr355) + for index4 = 0; index4 < (mbt_ffi_load32((iter_base) + 12)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index4 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - FieldAbsent(payload359) => { - mbt_ffi_store8(iter_base + 12, 5) + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) - let ptr360 = mbt_ffi_str2ptr(payload359) - mbt_ffi_store32(iter_base + 20, payload359.length()) - mbt_ffi_store32(iter_base + 16, ptr360) - cleanup_list.push(ptr360) + } + _ => panic() + } - () - } - } + for index2 = 0; index2 < (mbt_ffi_load32((iter_base) + 32)); index2 = index2 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 36, 0) - - () - } - Some(payload362) => { - mbt_ffi_store8(iter_base + 36, 1) - - let ptr363 = mbt_ffi_str2ptr(payload362) - mbt_ffi_store32(iter_base + 44, payload362.length()) - mbt_ffi_store32(iter_base + 40, ptr363) - cleanup_list.push(ptr363) - - () - } - } - - let address365 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index366 = 0 - index366 < iter_elem.metadata.aliases.length() - index366 = index366 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index366] - let iter_base = address365 + index366 * 8 - - let ptr364 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr364) - cleanup_list.push(ptr364) - } - mbt_ffi_store32( - iter_base + 52, - iter_elem.metadata.aliases.length(), - ) - mbt_ffi_store32(iter_base + 48, address365) - - let address368 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index369 = 0 - index369 < iter_elem.metadata.examples.length() - index369 = index369 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index369] - let iter_base = address368 + index369 * 8 - - let ptr367 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr367) - cleanup_list.push(ptr367) - } - mbt_ffi_store32( - iter_base + 60, - iter_elem.metadata.examples.length(), - ) - mbt_ffi_store32(iter_base + 56, address368) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 64, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () - } - Some(payload371) => { - mbt_ffi_store8(iter_base + 64, 1) + for index3 = 0; index3 < (mbt_ffi_load32((iter_base) + 40)); index3 = index3 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index3 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr372 = mbt_ffi_str2ptr(payload371) - mbt_ffi_store32(iter_base + 72, payload371.length()) - mbt_ffi_store32(iter_base + 68, ptr372) - cleanup_list.push(ptr372) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - () - } - } + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 76, 0) + } + _ => panic() + } - () - } - Some(payload374) => { - mbt_ffi_store8(iter_base + 76, 1) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { - match payload374 { - Multimodal => { - mbt_ffi_store8(iter_base + 80, 0) + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 80, 1) + } + _ => panic() + } - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 80, 2) + } + _ => panic() + } - () - } - Other(payload378) => { - mbt_ffi_store8(iter_base + 80, 3) - - let ptr379 = mbt_ffi_str2ptr(payload378) - mbt_ffi_store32( - iter_base + 88, - payload378.length(), - ) - mbt_ffi_store32(iter_base + 84, ptr379) - cleanup_list.push(ptr379) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } - - () - } - } - cleanup_list.push(ptr345) - cleanup_list.push(address365) - cleanup_list.push(address368) - } - mbt_ffi_store32( - iter_base + 12, - payload344.branches.length(), - ) - mbt_ffi_store32(iter_base + 8, address380) - cleanup_list.push(address380) - - () } - SecretType(payload382) => { - mbt_ffi_store8(iter_base + 0, 32) - mbt_ffi_store32(iter_base + 8, payload382.inner) - - match payload382.category { - None => { - mbt_ffi_store8(iter_base + 12, 0) + 16 => { - () - } - Some(payload384) => { - mbt_ffi_store8(iter_base + 12, 1) + for index5 = 0; index5 < (mbt_ffi_load32((iter_base) + 12)); index5 = index5 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index5 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr385 = mbt_ffi_str2ptr(payload384) - mbt_ffi_store32(iter_base + 20, payload384.length()) - mbt_ffi_store32(iter_base + 16, ptr385) - cleanup_list.push(ptr385) - - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () } - QuotaTokenType(payload386) => { - mbt_ffi_store8(iter_base + 0, 33) + 17 => { - match payload386.resource_name { - None => { - mbt_ffi_store8(iter_base + 8, 0) + for index6 = 0; index6 < (mbt_ffi_load32((iter_base) + 12)); index6 = index6 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index6 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload388) => { - mbt_ffi_store8(iter_base + 8, 1) - - let ptr389 = mbt_ffi_str2ptr(payload388) - mbt_ffi_store32(iter_base + 16, payload388.length()) - mbt_ffi_store32(iter_base + 12, ptr389) - cleanup_list.push(ptr389) - - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () } - FutureType(payload390) => { - mbt_ffi_store8(iter_base + 0, 34) + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload390 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { - () - } - Some(payload392) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload392) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - } + for index7 = 0; index7 < (mbt_ffi_load32((iter_base) + 16)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index7 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - StreamType(payload393) => { - mbt_ffi_store8(iter_base + 0, 35) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - match payload393 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + _ => panic() + } - () - } - Some(payload395) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload395) + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - () - } - } + } + _ => panic() + } - () } - } - - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 88, 0) + 25 => { - () - } - Some(payload397) => { - mbt_ffi_store8(iter_base + 88, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - let ptr398 = mbt_ffi_str2ptr(payload397) - mbt_ffi_store32(iter_base + 96, payload397.length()) - mbt_ffi_store32(iter_base + 92, ptr398) - cleanup_list.push(ptr398) + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 16)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index8 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } - - let address400 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index401 = 0 - index401 < iter_elem.metadata.aliases.length() - index401 = index401 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index401] - let iter_base = address400 + index401 * 8 - - let ptr399 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr399) - cleanup_list.push(ptr399) - } - mbt_ffi_store32( - iter_base + 104, - iter_elem.metadata.aliases.length(), - ) - mbt_ffi_store32(iter_base + 100, address400) - - let address403 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index404 = 0 - index404 < iter_elem.metadata.examples.length() - index404 = index404 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index404] - let iter_base = address403 + index404 * 8 - - let ptr402 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr402) - cleanup_list.push(ptr402) - } - mbt_ffi_store32( - iter_base + 112, - iter_elem.metadata.examples.length(), - ) - mbt_ffi_store32(iter_base + 108, address403) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 116, 0) - - () - } - Some(payload406) => { - mbt_ffi_store8(iter_base + 116, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let ptr407 = mbt_ffi_str2ptr(payload406) - mbt_ffi_store32(iter_base + 124, payload406.length()) - mbt_ffi_store32(iter_base + 120, ptr407) - cleanup_list.push(ptr407) + } + _ => panic() + } - () } - } + 26 => { - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 128, 0) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { - () - } - Some(payload409) => { - mbt_ffi_store8(iter_base + 128, 1) - - match payload409 { - Multimodal => { - mbt_ffi_store8(iter_base + 132, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 132, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 132, 2) - - () - } - Other(payload413) => { - mbt_ffi_store8(iter_base + 132, 3) - - let ptr414 = mbt_ffi_str2ptr(payload413) - mbt_ffi_store32(iter_base + 140, payload413.length()) - mbt_ffi_store32(iter_base + 136, ptr414) - cleanup_list.push(ptr414) - - () - } - } - - () - } - } - cleanup_list.push(address400) - cleanup_list.push(address403) - } - - let address421 = mbt_ffi_malloc( - payload54.graph.defs.length() * 24, - ) - for index422 = 0 - index422 < payload54.graph.defs.length() - index422 = index422 + 1 { - let iter_elem : @types.SchemaTypeDef = payload54.graph.defs[index422] - let iter_base = address421 + index422 * 24 - - let ptr417 = mbt_ffi_str2ptr(iter_elem.id) - mbt_ffi_store32(iter_base + 4, iter_elem.id.length()) - mbt_ffi_store32(iter_base + 0, ptr417) - - match iter_elem.name { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload419) => { - mbt_ffi_store8(iter_base + 8, 1) + for index9 = 0; index9 < (mbt_ffi_load32((iter_base) + 20)); index9 = index9 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index9 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr420 = mbt_ffi_str2ptr(payload419) - mbt_ffi_store32(iter_base + 16, payload419.length()) - mbt_ffi_store32(iter_base + 12, ptr420) - cleanup_list.push(ptr420) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - } - mbt_ffi_store32(iter_base + 20, iter_elem.body) - cleanup_list.push(ptr417) - } - - let address492 = mbt_ffi_malloc( - payload54.value.value_nodes.length() * 32, - ) - for index493 = 0 - index493 < payload54.value.value_nodes.length() - index493 = index493 + 1 { - let iter_elem : @types.SchemaValueNode = payload54.value.value_nodes[index493] - let iter_base = address492 + index493 * 32 - - match iter_elem { - BoolValue(payload423) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8( - iter_base + 8, - if payload423 { - 1 - } else { - 0 - }, - ) - - () - } - S8Value(payload424) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload424)) + } + _ => panic() + } - () - } - S16Value(payload425) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload425)) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { - () - } - S32Value(payload426) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload426) + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 32)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index10 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - S64Value(payload427) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload427) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () - } - U8Value(payload428) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload428.to_int()) + } + _ => panic() + } - () } - U16Value(payload429) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16( - iter_base + 8, - payload429.reinterpret_as_int(), - ) - - () - } - U32Value(payload430) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32( - iter_base + 8, - payload430.reinterpret_as_int(), - ) - - () - } - U64Value(payload431) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64( - iter_base + 8, - payload431.reinterpret_as_int64(), - ) - - () - } - F32Value(payload432) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload432) + 27 => { - () - } - F64Value(payload433) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload433) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - CharValue(payload434) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload434.to_int()) + for index11 = 0; index11 < (mbt_ffi_load32((iter_base) + 16)); index11 = index11 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index11 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - StringValue(payload435) => { - mbt_ffi_store8(iter_base + 0, 12) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let ptr436 = mbt_ffi_str2ptr(payload435) - mbt_ffi_store32(iter_base + 12, payload435.length()) - mbt_ffi_store32(iter_base + 8, ptr436) - cleanup_list.push(ptr436) + } + _ => panic() + } - () - } - RecordValue(payload437) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address438 = mbt_ffi_malloc(payload437.length() * 4) - for index439 = 0 - index439 < payload437.length() - index439 = index439 + 1 { - let iter_elem : Int = payload437[index439] - let iter_base = address438 + index439 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload437.length()) - mbt_ffi_store32(iter_base + 8, address438) - cleanup_list.push(address438) - - () - } - VariantValue(payload440) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32( - iter_base + 8, - payload440.case.reinterpret_as_int(), - ) - - match payload440.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload442) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload442) - - () - } - } - - () - } - EnumValue(payload443) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32( - iter_base + 8, - payload443.reinterpret_as_int(), - ) - - () - } - FlagsValue(payload444) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address445 = mbt_ffi_malloc(payload444.length() * 1) - for index446 = 0 - index446 < payload444.length() - index446 = index446 + 1 { - let iter_elem : Bool = payload444[index446] - let iter_base = address445 + index446 * 1 - mbt_ffi_store8( - iter_base + 0, - if iter_elem { - 1 - } else { - 0 - }, - ) - } - mbt_ffi_store32(iter_base + 12, payload444.length()) - mbt_ffi_store32(iter_base + 8, address445) - cleanup_list.push(address445) - - () - } - TupleValue(payload447) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address448 = mbt_ffi_malloc(payload447.length() * 4) - for index449 = 0 - index449 < payload447.length() - index449 = index449 + 1 { - let iter_elem : Int = payload447[index449] - let iter_base = address448 + index449 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload447.length()) - mbt_ffi_store32(iter_base + 8, address448) - cleanup_list.push(address448) - - () - } - ListValue(payload450) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address451 = mbt_ffi_malloc(payload450.length() * 4) - for index452 = 0 - index452 < payload450.length() - index452 = index452 + 1 { - let iter_elem : Int = payload450[index452] - let iter_base = address451 + index452 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload450.length()) - mbt_ffi_store32(iter_base + 8, address451) - cleanup_list.push(address451) - - () - } - FixedListValue(payload453) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address454 = mbt_ffi_malloc(payload453.length() * 4) - for index455 = 0 - index455 < payload453.length() - index455 = index455 + 1 { - let iter_elem : Int = payload453[index455] - let iter_base = address454 + index455 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload453.length()) - mbt_ffi_store32(iter_base + 8, address454) - cleanup_list.push(address454) - - () - } - MapValue(payload456) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address457 = mbt_ffi_malloc(payload456.length() * 8) - for index458 = 0 - index458 < payload456.length() - index458 = index458 + 1 { - let iter_elem : @types.MapEntry = payload456[index458] - let iter_base = address457 + index458 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload456.length()) - mbt_ffi_store32(iter_base + 8, address457) - cleanup_list.push(address457) - - () - } - OptionValue(payload459) => { - mbt_ffi_store8(iter_base + 0, 21) + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { - match payload459 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + for index12 = 0; index12 < (mbt_ffi_load32((iter_base) + 28)); index12 = index12 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index12 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload461) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload461) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - () - } - } + } + _ => panic() + } - () } - ResultValue(payload462) => { - mbt_ffi_store8(iter_base + 0, 22) - - match payload462 { - OkValue(payload463) => { - mbt_ffi_store8(iter_base + 8, 0) + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload463 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + for index13 = 0; index13 < (mbt_ffi_load32((iter_base) + 20)); index13 = index13 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index13 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload465) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload465) - - () - } } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - ErrValue(payload466) => { - mbt_ffi_store8(iter_base + 8, 1) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - match payload466 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + } + _ => panic() + } - () - } - Some(payload468) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload468) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) - () - } + } + _ => panic() } - () - } - } - - () } - TextValue(payload469) => { - mbt_ffi_store8(iter_base + 0, 23) + 31 => { - let ptr470 = mbt_ffi_str2ptr(payload469.text) - mbt_ffi_store32(iter_base + 12, payload469.text.length()) - mbt_ffi_store32(iter_base + 8, ptr470) + for index16 = 0; index16 < (mbt_ffi_load32((iter_base) + 12)); index16 = index16 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index16 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload469.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - Some(payload472) => { - mbt_ffi_store8(iter_base + 16, 1) + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let ptr473 = mbt_ffi_str2ptr(payload472) - mbt_ffi_store32(iter_base + 24, payload472.length()) - mbt_ffi_store32(iter_base + 20, ptr473) - cleanup_list.push(ptr473) + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - } - cleanup_list.push(ptr470) + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - BinaryValue(payload474) => { - mbt_ffi_store8(iter_base + 0, 24) + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let ptr475 = mbt_ffi_bytes2ptr(payload474.bytes) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - mbt_ffi_store32(iter_base + 12, payload474.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr475) + } + _ => panic() + } - match payload474.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - Some(payload477) => { - mbt_ffi_store8(iter_base + 16, 1) + } + _ => panic() + } - let ptr478 = mbt_ffi_str2ptr(payload477) - mbt_ffi_store32(iter_base + 24, payload477.length()) - mbt_ffi_store32(iter_base + 20, ptr478) - cleanup_list.push(ptr478) + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - () - } - } - cleanup_list.push(ptr475) + } + _ => panic() + } - () - } - PathValue(payload479) => { - mbt_ffi_store8(iter_base + 0, 25) + for index14 = 0; index14 < (mbt_ffi_load32((iter_base) + 52)); index14 = index14 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index14 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr480 = mbt_ffi_str2ptr(payload479) - mbt_ffi_store32(iter_base + 12, payload479.length()) - mbt_ffi_store32(iter_base + 8, ptr480) - cleanup_list.push(ptr480) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - () - } - UrlValue(payload481) => { - mbt_ffi_store8(iter_base + 0, 26) + for index15 = 0; index15 < (mbt_ffi_load32((iter_base) + 60)); index15 = index15 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index15 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr482 = mbt_ffi_str2ptr(payload481) - mbt_ffi_store32(iter_base + 12, payload481.length()) - mbt_ffi_store32(iter_base + 8, ptr482) - cleanup_list.push(ptr482) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - () - } - DatetimeValue(payload483) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload483.seconds) - mbt_ffi_store32( - iter_base + 16, - payload483.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload484) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload484.nanoseconds) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - QuantityValueNode(payload485) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload485.mantissa) - mbt_ffi_store32(iter_base + 16, payload485.scale) + } + _ => panic() + } - let ptr486 = mbt_ffi_str2ptr(payload485.unit) - mbt_ffi_store32(iter_base + 24, payload485.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr486) - cleanup_list.push(ptr486) + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { - () - } - UnionValue(payload487) => { - mbt_ffi_store8(iter_base + 0, 30) + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) - let ptr488 = mbt_ffi_str2ptr(payload487.tag) - mbt_ffi_store32(iter_base + 12, payload487.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr488) - mbt_ffi_store32(iter_base + 16, payload487.body) - cleanup_list.push(ptr488) + } + _ => panic() + } - () - } - SecretValue(payload489) => { - mbt_ffi_store8(iter_base + 0, 31) + } + _ => panic() + } - let @types.Secret(handle) = payload489 - mbt_ffi_store32(iter_base + 8, handle) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () } - QuotaTokenHandle(payload490) => { - mbt_ffi_store8(iter_base + 0, 32) + 32 => { - let @types.QuotaToken(handle491) = payload490 - mbt_ffi_store32(iter_base + 8, handle491) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } - () } - } - } - cleanup_list.push(address415) - cleanup_list.push(address421) - cleanup_list.push(address492) - - ( - 4, - address415, - payload54.graph.type_nodes.length(), - address421, - payload54.graph.defs.length(), - payload54.graph.root, - address492, - payload54.value.value_nodes.length(), - payload54.value.root, - ) - } - } - - ( - 1, lowered, lowered494, lowered495, lowered496, lowered497, lowered498, - lowered499, lowered500, lowered501, - ) - } - } + 33 => { - wasmExportAsyncInitializeTaskReturn( - lowered502, lowered503, lowered504, lowered505, lowered506, lowered507, lowered508, - lowered509, lowered510, lowered511, - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - cleanup_list.each(mbt_ffi_free) + } + _ => panic() + } - @async-core.task_returned() - } - None => () - } -} + } + 34 => () + 35 => () + 36 => () + _ => panic() + } -///| -#doc(hidden) -pub fn wasmExportAsyncInitialize( - event_raw : Int, - waitable : Int, - code : Int, -) -> Int { - @async-core.cb(event_raw, waitable, code) -} + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) -///| -#doc(hidden) -pub fn wasmExportInvokeGolemAgentGuest(p0 : Int) -> Int { - @async-core.with_waitableset(async fn() { - @async-core.with_task_group(async fn(background_group) { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 0), - mbt_ffi_load32(p0 + 4), - ) - - let array26 : Array[@types.SchemaValueNode] = [] - for index27 = 0; index27 < mbt_ffi_load32(p0 + 12); index27 = index27 + 1 { - let iter_base = mbt_ffi_load32(p0 + 8) + index27 * 32 - - let lifted25 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8).land(0xFFFF).reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result0) - } - 13 => { - let array : Array[Int] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 12) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index * 4 - - array.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array) - } - 14 => { - let lifted : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1 : Array[Bool] = [] - for index2 = 0 - index2 < mbt_ffi_load32(iter_base + 12) - index2 = index2 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index2 * 1 - - array1.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1) - } - 17 => { - let array3 : Array[Int] = [] - for index4 = 0 - index4 < mbt_ffi_load32(iter_base + 12) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index4 * 4 - - array3.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array3) - } - 18 => { - let array5 : Array[Int] = [] - for index6 = 0 - index6 < mbt_ffi_load32(iter_base + 12) - index6 = index6 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index6 * 4 - - array5.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array5) - } - 19 => { - let array7 : Array[Int] = [] - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 12) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index8 * 4 - - array7.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array7) - } - 20 => { - let array9 : Array[@types.MapEntry] = [] - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 12) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index10 * 8 - - array9.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array9) - } - 21 => { - let lifted11 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted11) - } - 22 => { - let lifted14 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted12 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted12) - } - 1 => { - let lifted13 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) + } _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted13) - } - _ => panic() } - @types.SchemaValueNode::ResultValue(lifted14) - } - 23 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + for index17 = 0; index17 < (mbt_ffi_load32((iter_base) + 104)); index17 = index17 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index17 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let lifted17 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result16 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result16) - } - _ => panic() } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result15, - language: lifted17, - }) - } - 24 => { - let result18 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted20 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result19) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result18, - mime_type: lifted20, - }) - } - 25 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result21) - } - 26 => { - let result22 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result22) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result23, - }) - } - 30 => { - let result24 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result24, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } - - array26.push(lifted25) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - - let lifted45 = match mbt_ffi_load8_u(p0 + 24) { - 0 => { - let result28 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 32), - mbt_ffi_load32(p0 + 36), - ) - - let result29 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 40), - mbt_ffi_load32(p0 + 44), - ) - - let lifted31 : String? = match mbt_ffi_load8_u(p0 + 48) { - 0 => Option::None - 1 => { - let result30 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 52), - mbt_ffi_load32(p0 + 56), - ) + for index18 = 0; index18 < (mbt_ffi_load32((iter_base) + 112)); index18 = index18 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index18 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - Option::Some(result30) } - _ => panic() - } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - let lifted33 : String? = match mbt_ffi_load8_u(p0 + 60) { - 0 => Option::None - 1 => { - let result32 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 64), - mbt_ffi_load32(p0 + 68), - ) + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) - Option::Some(result32) + } + _ => panic() } - _ => panic() - } - let lifted34 : Bool? = match mbt_ffi_load8_u(p0 + 72) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load8_u(p0 + 73) != 0) - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { - let lifted36 : String? = match mbt_ffi_load8_u(p0 + 76) { - 0 => Option::None - 1 => { - let result35 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 80), - mbt_ffi_load32(p0 + 84), - ) + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } - Option::Some(result35) + } + _ => panic() } - _ => panic() - } - let lifted38 : String? = match mbt_ffi_load8_u(p0 + 88) { - 0 => Option::None - 1 => { - let result37 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 92), - mbt_ffi_load32(p0 + 96), - ) + } + mbt_ffi_free(mbt_ffi_load32((p0) + 24)) + + for index20 = 0; index20 < (mbt_ffi_load32((p0) + 36)); index20 = index20 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 32)) + (index20 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - Option::Some(result37) + } + _ => panic() } - _ => panic() - } - let lifted40 : String? = match mbt_ffi_load8_u(p0 + 100) { - 0 => Option::None + } + mbt_ffi_free(mbt_ffi_load32((p0) + 32)) + + match (mbt_ffi_load8_u((p0) + 44)) { + 0 => () 1 => { - let result39 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 104), - mbt_ffi_load32(p0 + 108), - ) + mbt_ffi_free(mbt_ffi_load32((p0) + 48)) - Option::Some(result39) } _ => panic() - } + } + mbt_ffi_free(mbt_ffi_load32((p0) + 56)) - let lifted42 : String? = match mbt_ffi_load8_u(p0 + 112) { - 0 => Option::None + match (mbt_ffi_load8_u((p0) + 64)) { + 0 => () 1 => { - let result41 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 116), - mbt_ffi_load32(p0 + 120), - ) + mbt_ffi_free(mbt_ffi_load32((p0) + 68)) - Option::Some(result41) } _ => panic() - } - - let result43 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 124), - mbt_ffi_load32(p0 + 128), - ) - - @common.Principal::Oidc(@common.OidcPrincipal::{ - sub: result28, - issuer: result29, - email: lifted31, - name: lifted33, - email_verified: lifted34, - given_name: lifted36, - family_name: lifted38, - picture: lifted40, - preferred_username: lifted42, - claims: result43, - }) - } - 1 => { - let result44 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 48), - mbt_ffi_load32(p0 + 52), - ) - - @common.Principal::Agent(@common.AgentPrincipal::{ - agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(p0 + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(p0 + 40).reinterpret_as_uint64(), - }, - }, - agent_id: result44, - }, - }) - } - 2 => - @common.Principal::GolemUser(@common.GolemUserPrincipal::{ - account_id: @types.AccountId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(p0 + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(p0 + 40).reinterpret_as_uint64(), - }, - }, - }) - 3 => @common.Principal::Anonymous - _ => panic() } - let return_result : Ref[ - Result[@types.SchemaValueTree?, @common.AgentError]?, - ] = Ref(None) - return_result.val = Some( - invoke( - result, - @types.SchemaValueTree::{ - value_nodes: array26, - root: mbt_ffi_load32(p0 + 16), - }, - lifted45, - background_group, - ), - ) - invoke_task_return(return_result) - }) - }) -} - -///| -fn wasmExportAsyncInvokeGolemAgentGuestTaskReturn( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, - p7 : Int, - p8 : Int, - p9 : Int, -) = "[export]golem:agent/guest@2.0.0" "[task-return]invoke" - -///| -fn invoke_task_return( - return_result : Ref[Result[@types.SchemaValueTree?, @common.AgentError]?], -) -> Unit { - match return_result.val { - Some(return_value) => { - let cleanup_list : Array[Int] = [] - - let ( - lowered580, - lowered581, - lowered582, - lowered583, - lowered584, - lowered585, - lowered586, - lowered587, - lowered588, - lowered589, - ) = match return_value { - Ok(payload) => { - let (lowered, lowered117, lowered118, lowered119) = match payload { - None => (0, 0, 0, 0) - Some(payload47) => { - let address115 = mbt_ffi_malloc( - payload47.value_nodes.length() * 32, - ) - for index116 = 0 - index116 < payload47.value_nodes.length() - index116 = index116 + 1 { - let iter_elem : @types.SchemaValueNode = payload47.value_nodes[index116] - let iter_base = address115 + index116 * 32 - - match iter_elem { - BoolValue(payload48) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload48 { 1 } else { 0 }) - - () - } - S8Value(payload49) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload49)) + match (mbt_ffi_load8_u((p0) + 76)) { + 0 => { - () - } - S16Value(payload50) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload50)) + for index23 = 0; index23 < (mbt_ffi_load32((p0) + 84)); index23 = index23 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 80)) + (index23 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - S32Value(payload51) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload51) + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) - () - } - S64Value(payload52) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload52) + } + _ => panic() + } - () - } - U8Value(payload53) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload53.to_int()) + for index21 = 0; index21 < (mbt_ffi_load32((iter_base) + 32)); index21 = index21 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index21 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - U16Value(payload54) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16( - iter_base + 8, - payload54.reinterpret_as_int(), - ) - - () - } - U32Value(payload55) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32( - iter_base + 8, - payload55.reinterpret_as_int(), - ) - - () - } - U64Value(payload56) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64( - iter_base + 8, - payload56.reinterpret_as_int64(), - ) - - () - } - F32Value(payload57) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload57) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () - } - F64Value(payload58) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload58) + for index22 = 0; index22 < (mbt_ffi_load32((iter_base) + 40)); index22 = index22 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index22 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - CharValue(payload59) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload59.to_int()) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - () - } - StringValue(payload60) => { - mbt_ffi_store8(iter_base + 0, 12) + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - let ptr = mbt_ffi_str2ptr(payload60) - mbt_ffi_store32(iter_base + 12, payload60.length()) - mbt_ffi_store32(iter_base + 8, ptr) - cleanup_list.push(ptr) + } + _ => panic() + } - () - } - RecordValue(payload61) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address = mbt_ffi_malloc(payload61.length() * 4) - for index62 = 0 - index62 < payload61.length() - index62 = index62 + 1 { - let iter_elem : Int = payload61[index62] - let iter_base = address + index62 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload61.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - VariantValue(payload63) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32( - iter_base + 8, - payload63.case.reinterpret_as_int(), - ) - - match payload63.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload65) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload65) - - () - } - } - - () - } - EnumValue(payload66) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32( - iter_base + 8, - payload66.reinterpret_as_int(), - ) - - () - } - FlagsValue(payload67) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address68 = mbt_ffi_malloc(payload67.length() * 1) - for index69 = 0 - index69 < payload67.length() - index69 = index69 + 1 { - let iter_elem : Bool = payload67[index69] - let iter_base = address68 + index69 * 1 - mbt_ffi_store8( - iter_base + 0, - if iter_elem { - 1 - } else { - 0 - }, - ) - } - mbt_ffi_store32(iter_base + 12, payload67.length()) - mbt_ffi_store32(iter_base + 8, address68) - cleanup_list.push(address68) - - () - } - TupleValue(payload70) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address71 = mbt_ffi_malloc(payload70.length() * 4) - for index72 = 0 - index72 < payload70.length() - index72 = index72 + 1 { - let iter_elem : Int = payload70[index72] - let iter_base = address71 + index72 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload70.length()) - mbt_ffi_store32(iter_base + 8, address71) - cleanup_list.push(address71) - - () - } - ListValue(payload73) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address74 = mbt_ffi_malloc(payload73.length() * 4) - for index75 = 0 - index75 < payload73.length() - index75 = index75 + 1 { - let iter_elem : Int = payload73[index75] - let iter_base = address74 + index75 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload73.length()) - mbt_ffi_store32(iter_base + 8, address74) - cleanup_list.push(address74) - - () - } - FixedListValue(payload76) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address77 = mbt_ffi_malloc(payload76.length() * 4) - for index78 = 0 - index78 < payload76.length() - index78 = index78 + 1 { - let iter_elem : Int = payload76[index78] - let iter_base = address77 + index78 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload76.length()) - mbt_ffi_store32(iter_base + 8, address77) - cleanup_list.push(address77) - - () - } - MapValue(payload79) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address80 = mbt_ffi_malloc(payload79.length() * 8) - for index81 = 0 - index81 < payload79.length() - index81 = index81 + 1 { - let iter_elem : @types.MapEntry = payload79[index81] - let iter_base = address80 + index81 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload79.length()) - mbt_ffi_store32(iter_base + 8, address80) - cleanup_list.push(address80) - - () - } - OptionValue(payload82) => { - mbt_ffi_store8(iter_base + 0, 21) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { - match payload82 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - () - } - Some(payload84) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload84) + } + _ => panic() + } - () - } - } + } + _ => panic() + } - () } - ResultValue(payload85) => { - mbt_ffi_store8(iter_base + 0, 22) - - match payload85 { - OkValue(payload86) => { - mbt_ffi_store8(iter_base + 8, 0) - - match payload86 { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload88) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload88) + mbt_ffi_free(mbt_ffi_load32((p0) + 80)) - () - } - } + } + _ => panic() + } - () - } - ErrValue(payload89) => { - mbt_ffi_store8(iter_base + 8, 1) + for index32 = 0; index32 < (mbt_ffi_load32((p0) + 92)); index32 = index32 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 88)) + (index32 * 88) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload89 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + for index28 = 0; index28 < (mbt_ffi_load32((iter_base) + 20)); index28 = index28 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index28 * 48) - () - } - Some(payload91) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload91) + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - () - } } - - () - } - } - - () + _ => panic() } - TextValue(payload92) => { - mbt_ffi_store8(iter_base + 0, 23) - let ptr93 = mbt_ffi_str2ptr(payload92.text) - mbt_ffi_store32(iter_base + 12, payload92.text.length()) - mbt_ffi_store32(iter_base + 8, ptr93) + for index24 = 0; index24 < (mbt_ffi_load32((iter_base) + 16)); index24 = index24 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index24 * 12) - match payload92.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload95) => { - mbt_ffi_store8(iter_base + 16, 1) + } + 1 => () + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - let ptr96 = mbt_ffi_str2ptr(payload95) - mbt_ffi_store32(iter_base + 24, payload95.length()) - mbt_ffi_store32(iter_base + 20, ptr96) - cleanup_list.push(ptr96) + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - () - } - } - cleanup_list.push(ptr93) + } + _ => panic() + } - () } - BinaryValue(payload97) => { - mbt_ffi_store8(iter_base + 0, 24) - - let ptr98 = mbt_ffi_bytes2ptr(payload97.bytes) - - mbt_ffi_store32(iter_base + 12, payload97.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr98) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - match payload97.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + for index25 = 0; index25 < (mbt_ffi_load32((iter_base) + 24)); index25 = index25 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index25 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Some(payload100) => { - mbt_ffi_store8(iter_base + 16, 1) - - let ptr101 = mbt_ffi_str2ptr(payload100) - mbt_ffi_store32(iter_base + 24, payload100.length()) - mbt_ffi_store32(iter_base + 20, ptr101) - cleanup_list.push(ptr101) - - () - } - } - cleanup_list.push(ptr98) - - () } - PathValue(payload102) => { - mbt_ffi_store8(iter_base + 0, 25) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) - let ptr103 = mbt_ffi_str2ptr(payload102) - mbt_ffi_store32(iter_base + 12, payload102.length()) - mbt_ffi_store32(iter_base + 8, ptr103) - cleanup_list.push(ptr103) + for index26 = 0; index26 < (mbt_ffi_load32((iter_base) + 32)); index26 = index26 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index26 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () } - UrlValue(payload104) => { - mbt_ffi_store8(iter_base + 0, 26) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let ptr105 = mbt_ffi_str2ptr(payload104) - mbt_ffi_store32(iter_base + 12, payload104.length()) - mbt_ffi_store32(iter_base + 8, ptr105) - cleanup_list.push(ptr105) + for index27 = 0; index27 < (mbt_ffi_load32((iter_base) + 44)); index27 = index27 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index27 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - DatetimeValue(payload106) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload106.seconds) - mbt_ffi_store32( - iter_base + 16, - payload106.nanoseconds.reinterpret_as_int(), - ) - - () } - DurationValue(payload107) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload107.nanoseconds) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - () - } - QuantityValueNode(payload108) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload108.mantissa) - mbt_ffi_store32(iter_base + 16, payload108.scale) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let ptr109 = mbt_ffi_str2ptr(payload108.unit) - mbt_ffi_store32(iter_base + 24, payload108.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr109) - cleanup_list.push(ptr109) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () } - UnionValue(payload110) => { - mbt_ffi_store8(iter_base + 0, 30) + _ => panic() + } - let ptr111 = mbt_ffi_str2ptr(payload110.tag) - mbt_ffi_store32(iter_base + 12, payload110.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr111) - mbt_ffi_store32(iter_base + 16, payload110.body) - cleanup_list.push(ptr111) + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => { - () - } - SecretValue(payload112) => { - mbt_ffi_store8(iter_base + 0, 31) + for index31 = 0; index31 < (mbt_ffi_load32((iter_base) + 44)); index31 = index31 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index31 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let @types.Secret(handle) = payload112 - mbt_ffi_store32(iter_base + 8, handle) + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) - () - } - QuotaTokenHandle(payload113) => { - mbt_ffi_store8(iter_base + 0, 32) + } + _ => panic() + } - let @types.QuotaToken(handle114) = payload113 - mbt_ffi_store32(iter_base + 8, handle114) + for index29 = 0; index29 < (mbt_ffi_load32((iter_base) + 32)); index29 = index29 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index29 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } - } - cleanup_list.push(address115) - - (1, address115, payload47.value_nodes.length(), payload47.root) - } - } - - (0, lowered, lowered117, lowered118, lowered119, 0, 0, 0, 0, 0) - } - Err(payload120) => { - let ( - lowered571, - lowered572, - lowered573, - lowered574, - lowered575, - lowered576, - lowered577, - lowered578, - lowered579, - ) = match payload120 { - InvalidInput(payload121) => { - let ptr122 = mbt_ffi_str2ptr(payload121) - cleanup_list.push(ptr122) - - (0, ptr122, payload121.length(), 0, 0, 0, 0, 0, 0) - } - InvalidMethod(payload123) => { - let ptr124 = mbt_ffi_str2ptr(payload123) - cleanup_list.push(ptr124) - - (1, ptr124, payload123.length(), 0, 0, 0, 0, 0, 0) - } - InvalidType(payload125) => { - let ptr126 = mbt_ffi_str2ptr(payload125) - cleanup_list.push(ptr126) - - (2, ptr126, payload125.length(), 0, 0, 0, 0, 0, 0) - } - InvalidAgentId(payload127) => { - let ptr128 = mbt_ffi_str2ptr(payload127) - cleanup_list.push(ptr128) - - (3, ptr128, payload127.length(), 0, 0, 0, 0, 0, 0) - } - CustomError(payload129) => { - let address491 = mbt_ffi_malloc( - payload129.graph.type_nodes.length() * 144, - ) - for index492 = 0 - index492 < payload129.graph.type_nodes.length() - index492 = index492 + 1 { - let iter_elem : @types.SchemaTypeNode = payload129.graph.type_nodes[index492] - let iter_base = address491 + index492 * 144 - - match iter_elem.body { - RefType(payload130) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store32(iter_base + 8, payload130) - - () - } - BoolType => { - mbt_ffi_store8(iter_base + 0, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () - } - S8Type(payload132) => { - mbt_ffi_store8(iter_base + 0, 2) + for index30 = 0; index30 < (mbt_ffi_load32((iter_base) + 40)); index30 = index30 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index30 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload132 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - () - } - Some(payload134) => { - mbt_ffi_store8(iter_base + 8, 1) + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - match payload134.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + _ => panic() + } - () - } - Some(payload136) => { - mbt_ffi_store8(iter_base + 16, 1) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { - match payload136 { - Signed(payload137) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload137) + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - () - } - Unsigned(payload138) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload138.reinterpret_as_int64(), - ) + } + _ => panic() + } - () + } + _ => panic() } - FloatBits(payload139) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload139.reinterpret_as_int64(), - ) - () - } - } - - () - } } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - match payload134.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + } + _ => panic() + } - () - } - Some(payload141) => { - mbt_ffi_store8(iter_base + 40, 1) + } + mbt_ffi_free(mbt_ffi_load32((p0) + 88)) - match payload141 { - Signed(payload142) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload142) + for index67 = 0; index67 < (mbt_ffi_load32((p0) + 100)); index67 = index67 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 96)) + (index67 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Unsigned(payload143) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload143.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - FloatBits(payload144) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload144.reinterpret_as_int64(), - ) + } + _ => panic() + } - () - } - } + for index53 = 0; index53 < (mbt_ffi_load32((iter_base) + 24)); index53 = index53 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index53 * 144) - () - } - } + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { - match payload134.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload146) => { - mbt_ffi_store8(iter_base + 64, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr147 = mbt_ffi_str2ptr(payload146) - mbt_ffi_store32(iter_base + 72, payload146.length()) - mbt_ffi_store32(iter_base + 68, ptr147) - cleanup_list.push(ptr147) + } + _ => panic() + } - () - } - } + } + _ => panic() + } - () - } - } + } + 3 => { - () - } - S16Type(payload148) => { - mbt_ffi_store8(iter_base + 0, 3) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload148 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - Some(payload150) => { - mbt_ffi_store8(iter_base + 8, 1) + } + _ => panic() + } - match payload150.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + _ => panic() + } - () - } - Some(payload152) => { - mbt_ffi_store8(iter_base + 16, 1) + } + 4 => { - match payload152 { - Signed(payload153) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload153) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Unsigned(payload154) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload154.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - FloatBits(payload155) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload155.reinterpret_as_int64(), - ) + } + _ => panic() + } - () + } + _ => panic() } - } - () - } } + 5 => { - match payload150.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload157) => { - mbt_ffi_store8(iter_base + 40, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - match payload157 { - Signed(payload158) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload158) + } + _ => panic() + } - () + } + _ => panic() } - Unsigned(payload159) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload159.reinterpret_as_int64(), - ) - () - } - FloatBits(payload160) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload160.reinterpret_as_int64(), - ) + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() } - } - () - } } + 7 => { - match payload150.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload162) => { - mbt_ffi_store8(iter_base + 64, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr163 = mbt_ffi_str2ptr(payload162) - mbt_ffi_store32(iter_base + 72, payload162.length()) - mbt_ffi_store32(iter_base + 68, ptr163) - cleanup_list.push(ptr163) + } + _ => panic() + } - () - } - } + } + _ => panic() + } - () - } - } + } + 8 => { - () - } - S32Type(payload164) => { - mbt_ffi_store8(iter_base + 0, 4) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload164 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - Some(payload166) => { - mbt_ffi_store8(iter_base + 8, 1) + } + _ => panic() + } - match payload166.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + _ => panic() + } - () - } - Some(payload168) => { - mbt_ffi_store8(iter_base + 16, 1) + } + 9 => { - match payload168 { - Signed(payload169) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload169) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Unsigned(payload170) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload170.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - FloatBits(payload171) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload171.reinterpret_as_int64(), - ) + } + _ => panic() + } - () + } + _ => panic() } - } - () - } } + 10 => { - match payload166.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload173) => { - mbt_ffi_store8(iter_base + 40, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - match payload173 { - Signed(payload174) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload174) + } + _ => panic() + } - () + } + _ => panic() } - Unsigned(payload175) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload175.reinterpret_as_int64(), - ) - () - } - FloatBits(payload176) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload176.reinterpret_as_int64(), - ) + } + 11 => { - () + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() } - } - () - } } + 12 => () + 13 => () + 14 => { - match payload166.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + for index35 = 0; index35 < (mbt_ffi_load32((iter_base) + 12)); index35 = index35 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index35 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload178) => { - mbt_ffi_store8(iter_base + 64, 1) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let ptr179 = mbt_ffi_str2ptr(payload178) - mbt_ffi_store32(iter_base + 72, payload178.length()) - mbt_ffi_store32(iter_base + 68, ptr179) - cleanup_list.push(ptr179) + } + _ => panic() + } - () - } - } + for index33 = 0; index33 < (mbt_ffi_load32((iter_base) + 28)); index33 = index33 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index33 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - () - } - S64Type(payload180) => { - mbt_ffi_store8(iter_base + 0, 5) + for index34 = 0; index34 < (mbt_ffi_load32((iter_base) + 36)); index34 = index34 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index34 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload180 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - () - } - Some(payload182) => { - mbt_ffi_store8(iter_base + 8, 1) + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - match payload182.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + _ => panic() + } - () - } - Some(payload184) => { - mbt_ffi_store8(iter_base + 16, 1) + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { - match payload184 { - Signed(payload185) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload185) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) - () - } - Unsigned(payload186) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload186.reinterpret_as_int64(), - ) + } + _ => panic() + } - () - } - FloatBits(payload187) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload187.reinterpret_as_int64(), - ) + } + _ => panic() + } - () } - } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } } + 15 => { - match payload182.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + for index38 = 0; index38 < (mbt_ffi_load32((iter_base) + 12)); index38 = index38 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index38 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload189) => { - mbt_ffi_store8(iter_base + 40, 1) + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) - match payload189 { - Signed(payload190) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload190) + } + _ => panic() + } - () - } - Unsigned(payload191) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload191.reinterpret_as_int64(), - ) + for index36 = 0; index36 < (mbt_ffi_load32((iter_base) + 32)); index36 = index36 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index36 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - FloatBits(payload192) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload192.reinterpret_as_int64(), - ) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () - } - } + for index37 = 0; index37 < (mbt_ffi_load32((iter_base) + 40)); index37 = index37 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index37 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - match payload182.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - () - } - Some(payload194) => { - mbt_ffi_store8(iter_base + 64, 1) + } + _ => panic() + } - let ptr195 = mbt_ffi_str2ptr(payload194) - mbt_ffi_store32(iter_base + 72, payload194.length()) - mbt_ffi_store32(iter_base + 68, ptr195) - cleanup_list.push(ptr195) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - () - } - } + } + _ => panic() + } - () - } - U8Type(payload196) => { - mbt_ffi_store8(iter_base + 0, 6) + } + _ => panic() + } - match payload196 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Some(payload198) => { - mbt_ffi_store8(iter_base + 8, 1) + } + 16 => { - match payload198.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + for index39 = 0; index39 < (mbt_ffi_load32((iter_base) + 12)); index39 = index39 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index39 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload200) => { - mbt_ffi_store8(iter_base + 16, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload200 { - Signed(payload201) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload201) + } + 17 => { - () - } - Unsigned(payload202) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload202.reinterpret_as_int64(), - ) + for index40 = 0; index40 < (mbt_ffi_load32((iter_base) + 12)); index40 = index40 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index40 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () } - FloatBits(payload203) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload203.reinterpret_as_int64(), - ) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { - match payload198.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload205) => { - mbt_ffi_store8(iter_base + 40, 1) + for index41 = 0; index41 < (mbt_ffi_load32((iter_base) + 16)); index41 = index41 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index41 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload205 { - Signed(payload206) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload206) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () + } + _ => panic() } - Unsigned(payload207) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload207.reinterpret_as_int64(), - ) - () - } - FloatBits(payload208) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload208.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - () + } + _ => panic() } - } - () - } } + 25 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload198.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + for index42 = 0; index42 < (mbt_ffi_load32((iter_base) + 16)); index42 = index42 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index42 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload210) => { - mbt_ffi_store8(iter_base + 64, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let ptr211 = mbt_ffi_str2ptr(payload210) - mbt_ffi_store32(iter_base + 72, payload210.length()) - mbt_ffi_store32(iter_base + 68, ptr211) - cleanup_list.push(ptr211) + } + _ => panic() + } - () - } } + 26 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { - () - } - U16Type(payload212) => { - mbt_ffi_store8(iter_base + 0, 7) + for index43 = 0; index43 < (mbt_ffi_load32((iter_base) + 20)); index43 = index43 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index43 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload212 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - Some(payload214) => { - mbt_ffi_store8(iter_base + 8, 1) + } + _ => panic() + } - match payload214.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { - () - } - Some(payload216) => { - mbt_ffi_store8(iter_base + 16, 1) + for index44 = 0; index44 < (mbt_ffi_load32((iter_base) + 32)); index44 = index44 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index44 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload216 { - Signed(payload217) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload217) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () + } + _ => panic() } - Unsigned(payload218) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload218.reinterpret_as_int64(), - ) - () + } + 27 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index45 = 0; index45 < (mbt_ffi_load32((iter_base) + 16)); index45 = index45 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index45 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() } - FloatBits(payload219) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload219.reinterpret_as_int64(), - ) - () + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { + + for index46 = 0; index46 < (mbt_ffi_load32((iter_base) + 28)); index46 = index46 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index46 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + _ => panic() } - } - () - } } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload214.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + for index47 = 0; index47 < (mbt_ffi_load32((iter_base) + 20)); index47 = index47 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index47 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload221) => { - mbt_ffi_store8(iter_base + 40, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - match payload221 { - Signed(payload222) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload222) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - () + } + _ => panic() } - Unsigned(payload223) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload223.reinterpret_as_int64(), - ) - () - } - FloatBits(payload224) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload224.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) - () + } + _ => panic() } - } - () - } } + 31 => { - match payload214.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + for index50 = 0; index50 < (mbt_ffi_load32((iter_base) + 12)); index50 = index50 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index50 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload226) => { - mbt_ffi_store8(iter_base + 64, 1) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let ptr227 = mbt_ffi_str2ptr(payload226) - mbt_ffi_store32(iter_base + 72, payload226.length()) - mbt_ffi_store32(iter_base + 68, ptr227) - cleanup_list.push(ptr227) + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - } + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - } + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - U32Type(payload228) => { - mbt_ffi_store8(iter_base + 0, 8) + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - match payload228 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () - } - Some(payload230) => { - mbt_ffi_store8(iter_base + 8, 1) + } + _ => panic() + } - match payload230.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - Some(payload232) => { - mbt_ffi_store8(iter_base + 16, 1) + } + _ => panic() + } - match payload232 { - Signed(payload233) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload233) + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - () - } - Unsigned(payload234) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload234.reinterpret_as_int64(), - ) + } + _ => panic() + } - () - } - FloatBits(payload235) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload235.reinterpret_as_int64(), - ) + for index48 = 0; index48 < (mbt_ffi_load32((iter_base) + 52)); index48 = index48 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index48 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - () - } - } + for index49 = 0; index49 < (mbt_ffi_load32((iter_base) + 60)); index49 = index49 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index49 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload230.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - () - } - Some(payload237) => { - mbt_ffi_store8(iter_base + 40, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - match payload237 { - Signed(payload238) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload238) + } + _ => panic() + } - () - } - Unsigned(payload239) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload239.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { - () - } - FloatBits(payload240) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload240.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } - () } - } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } } + 32 => { - match payload230.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload242) => { - mbt_ffi_store8(iter_base + 64, 1) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let ptr243 = mbt_ffi_str2ptr(payload242) - mbt_ffi_store32(iter_base + 72, payload242.length()) - mbt_ffi_store32(iter_base + 68, ptr243) - cleanup_list.push(ptr243) + } + _ => panic() + } - () - } } + 33 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - U64Type(payload244) => { - mbt_ffi_store8(iter_base + 0, 9) + } + _ => panic() + } - match payload244 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + 34 => () + 35 => () + 36 => () + _ => panic() + } - () - } - Some(payload246) => { - mbt_ffi_store8(iter_base + 8, 1) + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) - match payload246.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + _ => panic() + } - () - } - Some(payload248) => { - mbt_ffi_store8(iter_base + 16, 1) + for index51 = 0; index51 < (mbt_ffi_load32((iter_base) + 104)); index51 = index51 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index51 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload248 { - Signed(payload249) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload249) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - () - } - Unsigned(payload250) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload250.reinterpret_as_int64(), - ) + for index52 = 0; index52 < (mbt_ffi_load32((iter_base) + 112)); index52 = index52 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index52 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - FloatBits(payload251) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload251.reinterpret_as_int64(), - ) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - () - } - } + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) - () - } } + _ => panic() + } - match payload246.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload253) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload253 { - Signed(payload254) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload254) - - () - } - Unsigned(payload255) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload255.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { - () - } - FloatBits(payload256) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload256.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) - () + } + _ => panic() } - } - () - } } + _ => panic() + } - match payload246.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) - () - } - Some(payload258) => { - mbt_ffi_store8(iter_base + 64, 1) + for index54 = 0; index54 < (mbt_ffi_load32((iter_base) + 32)); index54 = index54 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index54 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr259 = mbt_ffi_str2ptr(payload258) - mbt_ffi_store32(iter_base + 72, payload258.length()) - mbt_ffi_store32(iter_base + 68, ptr259) - cleanup_list.push(ptr259) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } } + _ => panic() + } - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - () } - F32Type(payload260) => { - mbt_ffi_store8(iter_base + 0, 10) + _ => panic() + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) - match payload260 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - () - } - Some(payload262) => { - mbt_ffi_store8(iter_base + 8, 1) + } + _ => panic() + } - match payload262.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + match (mbt_ffi_load8_u((iter_base) + 72)) { + 0 => { - () - } - Some(payload264) => { - mbt_ffi_store8(iter_base + 16, 1) + for index57 = 0; index57 < (mbt_ffi_load32((iter_base) + 80)); index57 = index57 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 76)) + (index57 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload264 { - Signed(payload265) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload265) + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) - () + } + _ => panic() } - Unsigned(payload266) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload266.reinterpret_as_int64(), - ) - () - } - FloatBits(payload267) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload267.reinterpret_as_int64(), - ) + for index55 = 0; index55 < (mbt_ffi_load32((iter_base) + 32)); index55 = index55 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index55 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () } - } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () - } - } - - match payload262.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + for index56 = 0; index56 < (mbt_ffi_load32((iter_base) + 40)); index56 = index56 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index56 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload269) => { - mbt_ffi_store8(iter_base + 40, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - match payload269 { - Signed(payload270) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload270) + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - () + } + _ => panic() } - Unsigned(payload271) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload271.reinterpret_as_int64(), - ) - () - } - FloatBits(payload272) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload272.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { - () + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() } - } - () - } } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + } + _ => panic() + } - match payload262.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + for index66 = 0; index66 < (mbt_ffi_load32((iter_base) + 88)); index66 = index66 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 84)) + (index66 * 88) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Some(payload274) => { - mbt_ffi_store8(iter_base + 64, 1) + for index62 = 0; index62 < (mbt_ffi_load32((iter_base) + 20)); index62 = index62 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index62 * 48) - let ptr275 = mbt_ffi_str2ptr(payload274) - mbt_ffi_store32(iter_base + 72, payload274.length()) - mbt_ffi_store32(iter_base + 68, ptr275) - cleanup_list.push(ptr275) + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - () - } + } + _ => panic() } - () - } - } + for index58 = 0; index58 < (mbt_ffi_load32((iter_base) + 16)); index58 = index58 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index58 * 12) - () - } - F64Type(payload276) => { - mbt_ffi_store8(iter_base + 0, 11) + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - match payload276 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + 1 => () + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload278) => { - mbt_ffi_store8(iter_base + 8, 1) + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - match payload278.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + _ => panic() + } - () - } - Some(payload280) => { - mbt_ffi_store8(iter_base + 16, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - match payload280 { - Signed(payload281) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload281) + for index59 = 0; index59 < (mbt_ffi_load32((iter_base) + 24)); index59 = index59 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index59 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Unsigned(payload282) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload282.reinterpret_as_int64(), - ) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) - () - } - FloatBits(payload283) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload283.reinterpret_as_int64(), - ) + for index60 = 0; index60 < (mbt_ffi_load32((iter_base) + 32)); index60 = index60 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index60 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index61 = 0; index61 < (mbt_ffi_load32((iter_base) + 44)); index61 = index61 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index61 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - match payload278.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - Some(payload285) => { - mbt_ffi_store8(iter_base + 40, 1) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - match payload285 { - Signed(payload286) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload286) + } + _ => panic() + } - () - } - Unsigned(payload287) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload287.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => { - () - } - FloatBits(payload288) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload288.reinterpret_as_int64(), - ) + for index65 = 0; index65 < (mbt_ffi_load32((iter_base) + 44)); index65 = index65 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index65 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) - () - } - } + } + _ => panic() + } - match payload278.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + for index63 = 0; index63 < (mbt_ffi_load32((iter_base) + 32)); index63 = index63 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index63 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload290) => { - mbt_ffi_store8(iter_base + 64, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let ptr291 = mbt_ffi_str2ptr(payload290) - mbt_ffi_store32(iter_base + 72, payload290.length()) - mbt_ffi_store32(iter_base + 68, ptr291) - cleanup_list.push(ptr291) + for index64 = 0; index64 < (mbt_ffi_load32((iter_base) + 40)); index64 = index64 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index64 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - () - } - } + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - () - } - CharType => { - mbt_ffi_store8(iter_base + 0, 12) + } + _ => panic() + } - () - } - StringType => { - mbt_ffi_store8(iter_base + 0, 13) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { - () - } - RecordType(payload294) => { - mbt_ffi_store8(iter_base + 0, 14) - - let address315 = mbt_ffi_malloc(payload294.length() * 68) - for index316 = 0 - index316 < payload294.length() - index316 = index316 + 1 { - let iter_elem : @types.NamedFieldType = payload294[index316] - let iter_base = address315 + index316 * 68 - - let ptr295 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr295) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload297) => { - mbt_ffi_store8(iter_base + 12, 1) - - let ptr298 = mbt_ffi_str2ptr(payload297) - mbt_ffi_store32(iter_base + 20, payload297.length()) - mbt_ffi_store32(iter_base + 16, ptr298) - cleanup_list.push(ptr298) - - () - } - } - - let address300 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index301 = 0 - index301 < iter_elem.metadata.aliases.length() - index301 = index301 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index301] - let iter_base = address300 + index301 * 8 - - let ptr299 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr299) - cleanup_list.push(ptr299) - } - mbt_ffi_store32( - iter_base + 28, - iter_elem.metadata.aliases.length(), - ) - mbt_ffi_store32(iter_base + 24, address300) - - let address303 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index304 = 0 - index304 < iter_elem.metadata.examples.length() - index304 = index304 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index304] - let iter_base = address303 + index304 * 8 - - let ptr302 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr302) - cleanup_list.push(ptr302) - } - mbt_ffi_store32( - iter_base + 36, - iter_elem.metadata.examples.length(), - ) - mbt_ffi_store32(iter_base + 32, address303) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - () - } - Some(payload306) => { - mbt_ffi_store8(iter_base + 40, 1) + } + _ => panic() + } - let ptr307 = mbt_ffi_str2ptr(payload306) - mbt_ffi_store32(iter_base + 48, payload306.length()) - mbt_ffi_store32(iter_base + 44, ptr307) - cleanup_list.push(ptr307) + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - () } - } + _ => panic() + } - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 52, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) - () - } - Some(payload309) => { - mbt_ffi_store8(iter_base + 52, 1) + } + mbt_ffi_free(mbt_ffi_load32((p0) + 96)) - match payload309 { - Multimodal => { - mbt_ffi_store8(iter_base + 56, 0) + match (mbt_ffi_load8_u((p0) + 108)) { + 0 => () + 1 => { - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 56, 1) + for index68 = 0; index68 < (mbt_ffi_load32((p0) + 116)); index68 = index68 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 112)) + (index68 * 12) - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 56, 2) + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - () - } - Other(payload313) => { - mbt_ffi_store8(iter_base + 56, 3) - - let ptr314 = mbt_ffi_str2ptr(payload313) - mbt_ffi_store32( - iter_base + 64, - payload313.length(), - ) - mbt_ffi_store32(iter_base + 60, ptr314) - cleanup_list.push(ptr314) + } + 1 => () + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - () - } - } + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - () + } + _ => panic() } - } - cleanup_list.push(ptr295) - cleanup_list.push(address300) - cleanup_list.push(address303) - } - mbt_ffi_store32(iter_base + 12, payload294.length()) - mbt_ffi_store32(iter_base + 8, address315) - cleanup_list.push(address315) - () } - VariantType(payload317) => { - mbt_ffi_store8(iter_base + 0, 15) + mbt_ffi_free(mbt_ffi_load32((p0) + 112)) - let address340 = mbt_ffi_malloc(payload317.length() * 72) - for index341 = 0 - index341 < payload317.length() - index341 = index341 + 1 { - let iter_elem : @types.VariantCaseType = payload317[index341] - let iter_base = address340 + index341 * 72 + for index69 = 0; index69 < (mbt_ffi_load32((p0) + 128)); index69 = index69 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 124)) + (index69 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr318 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr318) + } + mbt_ffi_free(mbt_ffi_load32((p0) + 124)) - match iter_elem.payload { - None => { - mbt_ffi_store8(iter_base + 8, 0) + for index70 = 0; index70 < (mbt_ffi_load32((p0) + 136)); index70 = index70 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 132)) + (index70 * 12) - () - } - Some(payload320) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload320) + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - () - } - } + } + 1 => () + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload322) => { - mbt_ffi_store8(iter_base + 16, 1) - - let ptr323 = mbt_ffi_str2ptr(payload322) - mbt_ffi_store32(iter_base + 24, payload322.length()) - mbt_ffi_store32(iter_base + 20, ptr323) - cleanup_list.push(ptr323) - - () - } - } - - let address325 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index326 = 0 - index326 < iter_elem.metadata.aliases.length() - index326 = index326 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index326] - let iter_base = address325 + index326 * 8 - - let ptr324 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr324) - cleanup_list.push(ptr324) - } - mbt_ffi_store32( - iter_base + 32, - iter_elem.metadata.aliases.length(), - ) - mbt_ffi_store32(iter_base + 28, address325) - - let address328 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index329 = 0 - index329 < iter_elem.metadata.examples.length() - index329 = index329 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index329] - let iter_base = address328 + index329 * 8 - - let ptr327 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr327) - cleanup_list.push(ptr327) - } - mbt_ffi_store32( - iter_base + 40, - iter_elem.metadata.examples.length(), - ) - mbt_ffi_store32(iter_base + 36, address328) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 44, 0) + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - () + } + _ => panic() } - Some(payload331) => { - mbt_ffi_store8(iter_base + 44, 1) - let ptr332 = mbt_ffi_str2ptr(payload331) - mbt_ffi_store32(iter_base + 52, payload331.length()) - mbt_ffi_store32(iter_base + 48, ptr332) - cleanup_list.push(ptr332) + } + mbt_ffi_free(mbt_ffi_load32((p0) + 132)) - () - } - } + } + _ => panic() + } - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 56, 0) + for index72 = 0; index72 < (mbt_ffi_load32((p0) + 172)); index72 = index72 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 168)) + (index72 * 16) - () - } - Some(payload334) => { - mbt_ffi_store8(iter_base + 56, 1) + for index71 = 0; index71 < (mbt_ffi_load32((iter_base) + 8)); index71 = index71 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index71 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload334 { - Multimodal => { - mbt_ffi_store8(iter_base + 60, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 60, 1) + } + mbt_ffi_free(mbt_ffi_load32((p0) + 168)) - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 60, 2) +} - () - } - Other(payload338) => { - mbt_ffi_store8(iter_base + 60, 3) - - let ptr339 = mbt_ffi_str2ptr(payload338) - mbt_ffi_store32( - iter_base + 68, - payload338.length(), - ) - mbt_ffi_store32(iter_base + 64, ptr339) - cleanup_list.push(ptr339) +#doc(hidden) +pub fn wasmExportDiscoverAgentTypes() -> Int { - () - } - } + let (result) : (Result[Array[@common.AgentType], @common.AgentError]) = discover_agent_types(); + let return_area = mbt_ffi_malloc(40) - () - } - } - cleanup_list.push(ptr318) - cleanup_list.push(address325) - cleanup_list.push(address328) - } - mbt_ffi_store32(iter_base + 12, payload317.length()) - mbt_ffi_store32(iter_base + 8, address340) - cleanup_list.push(address340) + match result { + Ok(payload) => { + mbt_ffi_store8((return_area) + 0, (0)) - () - } - EnumType(payload342) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address344 = mbt_ffi_malloc(payload342.length() * 8) - for index345 = 0 - index345 < payload342.length() - index345 = index345 + 1 { - let iter_elem : String = payload342[index345] - let iter_base = address344 + index345 * 8 - - let ptr343 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr343) - cleanup_list.push(ptr343) - } - mbt_ffi_store32(iter_base + 12, payload342.length()) - mbt_ffi_store32(iter_base + 8, address344) - cleanup_list.push(address344) - - () - } - FlagsType(payload346) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address348 = mbt_ffi_malloc(payload346.length() * 8) - for index349 = 0 - index349 < payload346.length() - index349 = index349 + 1 { - let iter_elem : String = payload346[index349] - let iter_base = address348 + index349 * 8 - - let ptr347 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr347) - cleanup_list.push(ptr347) - } - mbt_ffi_store32(iter_base + 12, payload346.length()) - mbt_ffi_store32(iter_base + 8, address348) - cleanup_list.push(address348) - - () - } - TupleType(payload350) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address351 = mbt_ffi_malloc(payload350.length() * 4) - for index352 = 0 - index352 < payload350.length() - index352 = index352 + 1 { - let iter_elem : Int = payload350[index352] - let iter_base = address351 + index352 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload350.length()) - mbt_ffi_store32(iter_base + 8, address351) - cleanup_list.push(address351) - - () - } - ListType(payload353) => { - mbt_ffi_store8(iter_base + 0, 19) - mbt_ffi_store32(iter_base + 8, payload353) + let address = mbt_ffi_malloc((payload).length() * 176); + for index = 0; index < (payload).length(); index = index + 1 { + let iter_elem : @common.AgentType = (payload)[(index)] + let iter_base = address + (index * 176); + __wit_bindgen_lower_t399((iter_base) + 0, iter_elem) - () - } - FixedListType(payload354) => { - mbt_ffi_store8(iter_base + 0, 20) - mbt_ffi_store32(iter_base + 8, payload354.element) - mbt_ffi_store32( - iter_base + 12, - payload354.length.reinterpret_as_int(), - ) - - () } - MapType(payload355) => { - mbt_ffi_store8(iter_base + 0, 21) - mbt_ffi_store32(iter_base + 8, payload355.key) - mbt_ffi_store32(iter_base + 12, payload355.value) + mbt_ffi_store32((return_area) + 8, (payload).length()) + mbt_ffi_store32((return_area) + 4, address) - () - } - OptionType(payload356) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store32(iter_base + 8, payload356) + () + } + Err(payload0) => { + mbt_ffi_store8((return_area) + 0, (1)) + __wit_bindgen_lower_t402((return_area) + 4, payload0) - () - } - ResultType(payload357) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload357.ok { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload359) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload359) - - () - } - } - - match payload357.err { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload361) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload361) - - () - } - } - - () - } - TextType(payload362) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload362.languages { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload364) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address366 = mbt_ffi_malloc(payload364.length() * 8) - for index367 = 0 - index367 < payload364.length() - index367 = index367 + 1 { - let iter_elem : String = payload364[index367] - let iter_base = address366 + index367 * 8 - - let ptr365 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr365) - cleanup_list.push(ptr365) - } - mbt_ffi_store32(iter_base + 16, payload364.length()) - mbt_ffi_store32(iter_base + 12, address366) - cleanup_list.push(address366) - - () - } - } - - match payload362.min_length { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload369) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32( - iter_base + 24, - payload369.reinterpret_as_int(), - ) - - () - } - } - - match payload362.max_length { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload371) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32( - iter_base + 32, - payload371.reinterpret_as_int(), - ) - - () - } - } - - match payload362.regex { - None => { - mbt_ffi_store8(iter_base + 36, 0) - - () - } - Some(payload373) => { - mbt_ffi_store8(iter_base + 36, 1) - - let ptr374 = mbt_ffi_str2ptr(payload373) - mbt_ffi_store32(iter_base + 44, payload373.length()) - mbt_ffi_store32(iter_base + 40, ptr374) - cleanup_list.push(ptr374) - - () - } - } - - () - } - BinaryType(payload375) => { - mbt_ffi_store8(iter_base + 0, 25) - - match payload375.mime_types { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload377) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address379 = mbt_ffi_malloc(payload377.length() * 8) - for index380 = 0 - index380 < payload377.length() - index380 = index380 + 1 { - let iter_elem : String = payload377[index380] - let iter_base = address379 + index380 * 8 - - let ptr378 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr378) - cleanup_list.push(ptr378) - } - mbt_ffi_store32(iter_base + 16, payload377.length()) - mbt_ffi_store32(iter_base + 12, address379) - cleanup_list.push(address379) - - () - } - } - - match payload375.min_bytes { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload382) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32( - iter_base + 24, - payload382.reinterpret_as_int(), - ) - - () - } - } - - match payload375.max_bytes { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload384) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32( - iter_base + 32, - payload384.reinterpret_as_int(), - ) - - () - } - } - - () - } - PathType(payload385) => { - mbt_ffi_store8(iter_base + 0, 26) - mbt_ffi_store8( - iter_base + 8, - payload385.direction.ordinal(), - ) - mbt_ffi_store8(iter_base + 9, payload385.kind.ordinal()) - - match payload385.allowed_mime_types { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload387) => { - mbt_ffi_store8(iter_base + 12, 1) - - let address389 = mbt_ffi_malloc(payload387.length() * 8) - for index390 = 0 - index390 < payload387.length() - index390 = index390 + 1 { - let iter_elem : String = payload387[index390] - let iter_base = address389 + index390 * 8 - - let ptr388 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr388) - cleanup_list.push(ptr388) - } - mbt_ffi_store32(iter_base + 20, payload387.length()) - mbt_ffi_store32(iter_base + 16, address389) - cleanup_list.push(address389) - - () - } - } - - match payload385.allowed_extensions { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload392) => { - mbt_ffi_store8(iter_base + 24, 1) - - let address394 = mbt_ffi_malloc(payload392.length() * 8) - for index395 = 0 - index395 < payload392.length() - index395 = index395 + 1 { - let iter_elem : String = payload392[index395] - let iter_base = address394 + index395 * 8 - - let ptr393 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr393) - cleanup_list.push(ptr393) - } - mbt_ffi_store32(iter_base + 32, payload392.length()) - mbt_ffi_store32(iter_base + 28, address394) - cleanup_list.push(address394) - - () - } - } - - () - } - UrlType(payload396) => { - mbt_ffi_store8(iter_base + 0, 27) - - match payload396.allowed_schemes { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload398) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address400 = mbt_ffi_malloc(payload398.length() * 8) - for index401 = 0 - index401 < payload398.length() - index401 = index401 + 1 { - let iter_elem : String = payload398[index401] - let iter_base = address400 + index401 * 8 - - let ptr399 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr399) - cleanup_list.push(ptr399) - } - mbt_ffi_store32(iter_base + 16, payload398.length()) - mbt_ffi_store32(iter_base + 12, address400) - cleanup_list.push(address400) - - () - } - } - - match payload396.allowed_hosts { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload403) => { - mbt_ffi_store8(iter_base + 20, 1) - - let address405 = mbt_ffi_malloc(payload403.length() * 8) - for index406 = 0 - index406 < payload403.length() - index406 = index406 + 1 { - let iter_elem : String = payload403[index406] - let iter_base = address405 + index406 * 8 - - let ptr404 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr404) - cleanup_list.push(ptr404) - } - mbt_ffi_store32(iter_base + 28, payload403.length()) - mbt_ffi_store32(iter_base + 24, address405) - cleanup_list.push(address405) - - () - } - } - - () - } - DatetimeType => { - mbt_ffi_store8(iter_base + 0, 28) + () + } + } + let ret = return_area + return ret - () - } - DurationType => { - mbt_ffi_store8(iter_base + 0, 29) +} - () - } - QuantityType(payload409) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr410 = mbt_ffi_str2ptr(payload409.base_unit) - mbt_ffi_store32( - iter_base + 12, - payload409.base_unit.length(), - ) - mbt_ffi_store32(iter_base + 8, ptr410) - - let address412 = mbt_ffi_malloc( - payload409.allowed_suffixes.length() * 8, - ) - for index413 = 0 - index413 < payload409.allowed_suffixes.length() - index413 = index413 + 1 { - let iter_elem : String = payload409.allowed_suffixes[index413] - let iter_base = address412 + index413 * 8 - - let ptr411 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr411) - cleanup_list.push(ptr411) - } - mbt_ffi_store32( - iter_base + 20, - payload409.allowed_suffixes.length(), - ) - mbt_ffi_store32(iter_base + 16, address412) - - match payload409.min { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload415) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload415.mantissa) - mbt_ffi_store32(iter_base + 40, payload415.scale) - - let ptr416 = mbt_ffi_str2ptr(payload415.unit) - mbt_ffi_store32( - iter_base + 48, - payload415.unit.length(), - ) - mbt_ffi_store32(iter_base + 44, ptr416) - cleanup_list.push(ptr416) - - () - } - } - - match payload409.max { - None => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - Some(payload418) => { - mbt_ffi_store8(iter_base + 56, 1) - mbt_ffi_store64(iter_base + 64, payload418.mantissa) - mbt_ffi_store32(iter_base + 72, payload418.scale) - - let ptr419 = mbt_ffi_str2ptr(payload418.unit) - mbt_ffi_store32( - iter_base + 80, - payload418.unit.length(), - ) - mbt_ffi_store32(iter_base + 76, ptr419) - cleanup_list.push(ptr419) - - () - } - } - cleanup_list.push(ptr410) - cleanup_list.push(address412) - - () - } - UnionType(payload420) => { - mbt_ffi_store8(iter_base + 0, 31) +#doc(hidden) +pub fn wasmExportDiscoverAgentTypesPostReturn(p0 : Int) -> Unit { - let address456 = mbt_ffi_malloc( - payload420.branches.length() * 92, - ) - for index457 = 0 - index457 < payload420.branches.length() - index457 = index457 + 1 { - let iter_elem : @types.UnionBranch = payload420.branches[index457] - let iter_base = address456 + index457 * 92 + match (mbt_ffi_load8_u((p0) + 0)) { + 0 => { - let ptr421 = mbt_ffi_str2ptr(iter_elem.tag) - mbt_ffi_store32(iter_base + 4, iter_elem.tag.length()) - mbt_ffi_store32(iter_base + 0, ptr421) - mbt_ffi_store32(iter_base + 8, iter_elem.body) + for index73 = 0; index73 < (mbt_ffi_load32((p0) + 8)); index73 = index73 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 4)) + (index73 * 176) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - match iter_elem.discriminator { - Prefix(payload422) => { - mbt_ffi_store8(iter_base + 12, 0) + for index19 = 0; index19 < (mbt_ffi_load32((iter_base) + 28)); index19 = index19 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index19 * 144) - let ptr423 = mbt_ffi_str2ptr(payload422) - mbt_ffi_store32(iter_base + 20, payload422.length()) - mbt_ffi_store32(iter_base + 16, ptr423) - cleanup_list.push(ptr423) + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { - () - } - Suffix(payload424) => { - mbt_ffi_store8(iter_base + 12, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - let ptr425 = mbt_ffi_str2ptr(payload424) - mbt_ffi_store32(iter_base + 20, payload424.length()) - mbt_ffi_store32(iter_base + 16, ptr425) - cleanup_list.push(ptr425) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - Contains(payload426) => { - mbt_ffi_store8(iter_base + 12, 2) + } + _ => panic() + } - let ptr427 = mbt_ffi_str2ptr(payload426) - mbt_ffi_store32(iter_base + 20, payload426.length()) - mbt_ffi_store32(iter_base + 16, ptr427) - cleanup_list.push(ptr427) + } + _ => panic() + } - () - } - Regex(payload428) => { - mbt_ffi_store8(iter_base + 12, 3) + } + 3 => { - let ptr429 = mbt_ffi_str2ptr(payload428) - mbt_ffi_store32(iter_base + 20, payload428.length()) - mbt_ffi_store32(iter_base + 16, ptr429) - cleanup_list.push(ptr429) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - FieldEquals(payload430) => { - mbt_ffi_store8(iter_base + 12, 4) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr431 = mbt_ffi_str2ptr(payload430.field_name) - mbt_ffi_store32( - iter_base + 20, - payload430.field_name.length(), - ) - mbt_ffi_store32(iter_base + 16, ptr431) + } + _ => panic() + } - match payload430.literal { - None => { - mbt_ffi_store8(iter_base + 24, 0) + } + _ => panic() + } - () - } - Some(payload433) => { - mbt_ffi_store8(iter_base + 24, 1) - - let ptr434 = mbt_ffi_str2ptr(payload433) - mbt_ffi_store32( - iter_base + 32, - payload433.length(), - ) - mbt_ffi_store32(iter_base + 28, ptr434) - cleanup_list.push(ptr434) + } + 4 => { - () - } - } - cleanup_list.push(ptr431) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - FieldAbsent(payload435) => { - mbt_ffi_store8(iter_base + 12, 5) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr436 = mbt_ffi_str2ptr(payload435) - mbt_ffi_store32(iter_base + 20, payload435.length()) - mbt_ffi_store32(iter_base + 16, ptr436) - cleanup_list.push(ptr436) + } + _ => panic() + } - () - } - } + } + _ => panic() + } - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 36, 0) - - () - } - Some(payload438) => { - mbt_ffi_store8(iter_base + 36, 1) - - let ptr439 = mbt_ffi_str2ptr(payload438) - mbt_ffi_store32(iter_base + 44, payload438.length()) - mbt_ffi_store32(iter_base + 40, ptr439) - cleanup_list.push(ptr439) - - () - } - } - - let address441 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index442 = 0 - index442 < iter_elem.metadata.aliases.length() - index442 = index442 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index442] - let iter_base = address441 + index442 * 8 - - let ptr440 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr440) - cleanup_list.push(ptr440) - } - mbt_ffi_store32( - iter_base + 52, - iter_elem.metadata.aliases.length(), - ) - mbt_ffi_store32(iter_base + 48, address441) - - let address444 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index445 = 0 - index445 < iter_elem.metadata.examples.length() - index445 = index445 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index445] - let iter_base = address444 + index445 * 8 - - let ptr443 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr443) - cleanup_list.push(ptr443) - } - mbt_ffi_store32( - iter_base + 60, - iter_elem.metadata.examples.length(), - ) - mbt_ffi_store32(iter_base + 56, address444) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 64, 0) + } + 5 => { - () - } - Some(payload447) => { - mbt_ffi_store8(iter_base + 64, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - let ptr448 = mbt_ffi_str2ptr(payload447) - mbt_ffi_store32(iter_base + 72, payload447.length()) - mbt_ffi_store32(iter_base + 68, ptr448) - cleanup_list.push(ptr448) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - } + } + _ => panic() + } - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 76, 0) + } + _ => panic() + } - () - } - Some(payload450) => { - mbt_ffi_store8(iter_base + 76, 1) + } + 6 => { - match payload450 { - Multimodal => { - mbt_ffi_store8(iter_base + 80, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 80, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 80, 2) + } + _ => panic() + } - () - } - Other(payload454) => { - mbt_ffi_store8(iter_base + 80, 3) - - let ptr455 = mbt_ffi_str2ptr(payload454) - mbt_ffi_store32( - iter_base + 88, - payload454.length(), - ) - mbt_ffi_store32(iter_base + 84, ptr455) - cleanup_list.push(ptr455) + } + _ => panic() + } - () - } - } - - () - } - } - cleanup_list.push(ptr421) - cleanup_list.push(address441) - cleanup_list.push(address444) - } - mbt_ffi_store32( - iter_base + 12, - payload420.branches.length(), - ) - mbt_ffi_store32(iter_base + 8, address456) - cleanup_list.push(address456) - - () - } - SecretType(payload458) => { - mbt_ffi_store8(iter_base + 0, 32) - mbt_ffi_store32(iter_base + 8, payload458.inner) + } + 7 => { - match payload458.category { - None => { - mbt_ffi_store8(iter_base + 12, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload460) => { - mbt_ffi_store8(iter_base + 12, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr461 = mbt_ffi_str2ptr(payload460) - mbt_ffi_store32(iter_base + 20, payload460.length()) - mbt_ffi_store32(iter_base + 16, ptr461) - cleanup_list.push(ptr461) + } + _ => panic() + } - () - } - } + } + _ => panic() + } - () - } - QuotaTokenType(payload462) => { - mbt_ffi_store8(iter_base + 0, 33) + } + 8 => { - match payload462.resource_name { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload464) => { - mbt_ffi_store8(iter_base + 8, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr465 = mbt_ffi_str2ptr(payload464) - mbt_ffi_store32(iter_base + 16, payload464.length()) - mbt_ffi_store32(iter_base + 12, ptr465) - cleanup_list.push(ptr465) + } + _ => panic() + } - () - } - } + } + _ => panic() + } - () - } - FutureType(payload466) => { - mbt_ffi_store8(iter_base + 0, 34) + } + 9 => { - match payload466 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload468) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload468) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - } + } + _ => panic() + } - () - } - StreamType(payload469) => { - mbt_ffi_store8(iter_base + 0, 35) + } + _ => panic() + } - match payload469 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + 10 => { - () - } - Some(payload471) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload471) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - } + } + _ => panic() + } - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 88, 0) + } + _ => panic() + } - () - } - Some(payload473) => { - mbt_ffi_store8(iter_base + 88, 1) + } + 11 => { - let ptr474 = mbt_ffi_str2ptr(payload473) - mbt_ffi_store32(iter_base + 96, payload473.length()) - mbt_ffi_store32(iter_base + 92, ptr474) - cleanup_list.push(ptr474) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - } - - let address476 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index477 = 0 - index477 < iter_elem.metadata.aliases.length() - index477 = index477 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index477] - let iter_base = address476 + index477 * 8 - - let ptr475 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr475) - cleanup_list.push(ptr475) - } - mbt_ffi_store32( - iter_base + 104, - iter_elem.metadata.aliases.length(), - ) - mbt_ffi_store32(iter_base + 100, address476) - - let address479 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index480 = 0 - index480 < iter_elem.metadata.examples.length() - index480 = index480 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index480] - let iter_base = address479 + index480 * 8 - - let ptr478 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr478) - cleanup_list.push(ptr478) - } - mbt_ffi_store32( - iter_base + 112, - iter_elem.metadata.examples.length(), - ) - mbt_ffi_store32(iter_base + 108, address479) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 116, 0) - - () - } - Some(payload482) => { - mbt_ffi_store8(iter_base + 116, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr483 = mbt_ffi_str2ptr(payload482) - mbt_ffi_store32(iter_base + 124, payload482.length()) - mbt_ffi_store32(iter_base + 120, ptr483) - cleanup_list.push(ptr483) + } + _ => panic() + } - () - } - } + } + _ => panic() + } - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 128, 0) + } + 12 => () + 13 => () + 14 => { + + for index1 = 0; index1 < (mbt_ffi_load32((iter_base) + 12)); index1 = index1 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index = 0; index < (mbt_ffi_load32((iter_base) + 28)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index0 = 0; index0 < (mbt_ffi_load32((iter_base) + 36)); index0 = index0 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index0 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - () - } - Some(payload485) => { - mbt_ffi_store8(iter_base + 128, 1) - - match payload485 { - Multimodal => { - mbt_ffi_store8(iter_base + 132, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 132, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 132, 2) - - () - } - Other(payload489) => { - mbt_ffi_store8(iter_base + 132, 3) - - let ptr490 = mbt_ffi_str2ptr(payload489) - mbt_ffi_store32(iter_base + 140, payload489.length()) - mbt_ffi_store32(iter_base + 136, ptr490) - cleanup_list.push(ptr490) - - () - } - } - - () - } - } - cleanup_list.push(address476) - cleanup_list.push(address479) - } - - let address497 = mbt_ffi_malloc( - payload129.graph.defs.length() * 24, - ) - for index498 = 0 - index498 < payload129.graph.defs.length() - index498 = index498 + 1 { - let iter_elem : @types.SchemaTypeDef = payload129.graph.defs[index498] - let iter_base = address497 + index498 * 24 - - let ptr493 = mbt_ffi_str2ptr(iter_elem.id) - mbt_ffi_store32(iter_base + 4, iter_elem.id.length()) - mbt_ffi_store32(iter_base + 0, ptr493) - - match iter_elem.name { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload495) => { - mbt_ffi_store8(iter_base + 8, 1) + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - let ptr496 = mbt_ffi_str2ptr(payload495) - mbt_ffi_store32(iter_base + 16, payload495.length()) - mbt_ffi_store32(iter_base + 12, ptr496) - cleanup_list.push(ptr496) + } + _ => panic() + } - () - } - } - mbt_ffi_store32(iter_base + 20, iter_elem.body) - cleanup_list.push(ptr493) - } - - let address569 = mbt_ffi_malloc( - payload129.value.value_nodes.length() * 32, - ) - for index570 = 0 - index570 < payload129.value.value_nodes.length() - index570 = index570 + 1 { - let iter_elem : @types.SchemaValueNode = payload129.value.value_nodes[index570] - let iter_base = address569 + index570 * 32 - - match iter_elem { - BoolValue(payload499) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8( - iter_base + 8, - if payload499 { - 1 - } else { - 0 - }, - ) - - () - } - S8Value(payload500) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload500)) + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { - () - } - S16Value(payload501) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload501)) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) - () - } - S32Value(payload502) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload502) + } + _ => panic() + } - () - } - S64Value(payload503) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload503) + } + _ => panic() + } - () - } - U8Value(payload504) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload504.to_int()) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index4 = 0; index4 < (mbt_ffi_load32((iter_base) + 12)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index4 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index2 = 0; index2 < (mbt_ffi_load32((iter_base) + 32)); index2 = index2 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - U16Value(payload505) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16( - iter_base + 8, - payload505.reinterpret_as_int(), - ) - - () - } - U32Value(payload506) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32( - iter_base + 8, - payload506.reinterpret_as_int(), - ) - - () - } - U64Value(payload507) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64( - iter_base + 8, - payload507.reinterpret_as_int64(), - ) - - () - } - F32Value(payload508) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload508) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index3 = 0; index3 < (mbt_ffi_load32((iter_base) + 40)); index3 = index3 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index3 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - () - } - F64Value(payload509) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload509) + } + _ => panic() + } - () - } - CharValue(payload510) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload510.to_int()) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { - () - } - StringValue(payload511) => { - mbt_ffi_store8(iter_base + 0, 12) + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - let ptr512 = mbt_ffi_str2ptr(payload511) - mbt_ffi_store32(iter_base + 12, payload511.length()) - mbt_ffi_store32(iter_base + 8, ptr512) - cleanup_list.push(ptr512) + } + _ => panic() + } - () - } - RecordValue(payload513) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address514 = mbt_ffi_malloc(payload513.length() * 4) - for index515 = 0 - index515 < payload513.length() - index515 = index515 + 1 { - let iter_elem : Int = payload513[index515] - let iter_base = address514 + index515 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload513.length()) - mbt_ffi_store32(iter_base + 8, address514) - cleanup_list.push(address514) - - () - } - VariantValue(payload516) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32( - iter_base + 8, - payload516.case.reinterpret_as_int(), - ) - - match payload516.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload518) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload518) - - () - } - } - - () - } - EnumValue(payload519) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32( - iter_base + 8, - payload519.reinterpret_as_int(), - ) - - () - } - FlagsValue(payload520) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address521 = mbt_ffi_malloc(payload520.length() * 1) - for index522 = 0 - index522 < payload520.length() - index522 = index522 + 1 { - let iter_elem : Bool = payload520[index522] - let iter_base = address521 + index522 * 1 - mbt_ffi_store8( - iter_base + 0, - if iter_elem { - 1 - } else { - 0 - }, - ) - } - mbt_ffi_store32(iter_base + 12, payload520.length()) - mbt_ffi_store32(iter_base + 8, address521) - cleanup_list.push(address521) - - () - } - TupleValue(payload523) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address524 = mbt_ffi_malloc(payload523.length() * 4) - for index525 = 0 - index525 < payload523.length() - index525 = index525 + 1 { - let iter_elem : Int = payload523[index525] - let iter_base = address524 + index525 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload523.length()) - mbt_ffi_store32(iter_base + 8, address524) - cleanup_list.push(address524) - - () - } - ListValue(payload526) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address527 = mbt_ffi_malloc(payload526.length() * 4) - for index528 = 0 - index528 < payload526.length() - index528 = index528 + 1 { - let iter_elem : Int = payload526[index528] - let iter_base = address527 + index528 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload526.length()) - mbt_ffi_store32(iter_base + 8, address527) - cleanup_list.push(address527) - - () - } - FixedListValue(payload529) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address530 = mbt_ffi_malloc(payload529.length() * 4) - for index531 = 0 - index531 < payload529.length() - index531 = index531 + 1 { - let iter_elem : Int = payload529[index531] - let iter_base = address530 + index531 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload529.length()) - mbt_ffi_store32(iter_base + 8, address530) - cleanup_list.push(address530) - - () - } - MapValue(payload532) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address533 = mbt_ffi_malloc(payload532.length() * 8) - for index534 = 0 - index534 < payload532.length() - index534 = index534 + 1 { - let iter_elem : @types.MapEntry = payload532[index534] - let iter_base = address533 + index534 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload532.length()) - mbt_ffi_store32(iter_base + 8, address533) - cleanup_list.push(address533) - - () - } - OptionValue(payload535) => { - mbt_ffi_store8(iter_base + 0, 21) + } + _ => panic() + } - match payload535 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Some(payload537) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload537) + } + 16 => { - () - } - } + for index5 = 0; index5 < (mbt_ffi_load32((iter_base) + 12)); index5 = index5 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index5 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - ResultValue(payload538) => { - mbt_ffi_store8(iter_base + 0, 22) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload538 { - OkValue(payload539) => { - mbt_ffi_store8(iter_base + 8, 0) + } + 17 => { - match payload539 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + for index6 = 0; index6 < (mbt_ffi_load32((iter_base) + 12)); index6 = index6 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index6 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload541) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload541) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - ErrValue(payload542) => { - mbt_ffi_store8(iter_base + 8, 1) + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { - match payload542 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload544) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload544) + for index7 = 0; index7 < (mbt_ffi_load32((iter_base) + 16)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index7 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - } + } + _ => panic() + } - () - } - TextValue(payload545) => { - mbt_ffi_store8(iter_base + 0, 23) + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - let ptr546 = mbt_ffi_str2ptr(payload545.text) - mbt_ffi_store32(iter_base + 12, payload545.text.length()) - mbt_ffi_store32(iter_base + 8, ptr546) + } + _ => panic() + } - match payload545.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + 25 => { - () - } - Some(payload548) => { - mbt_ffi_store8(iter_base + 16, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - let ptr549 = mbt_ffi_str2ptr(payload548) - mbt_ffi_store32(iter_base + 24, payload548.length()) - mbt_ffi_store32(iter_base + 20, ptr549) - cleanup_list.push(ptr549) + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 16)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index8 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } - cleanup_list.push(ptr546) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - BinaryValue(payload550) => { - mbt_ffi_store8(iter_base + 0, 24) + } + _ => panic() + } - let ptr551 = mbt_ffi_bytes2ptr(payload550.bytes) + } + 26 => { - mbt_ffi_store32(iter_base + 12, payload550.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr551) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { - match payload550.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + for index9 = 0; index9 < (mbt_ffi_load32((iter_base) + 20)); index9 = index9 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index9 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload553) => { - mbt_ffi_store8(iter_base + 16, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let ptr554 = mbt_ffi_str2ptr(payload553) - mbt_ffi_store32(iter_base + 24, payload553.length()) - mbt_ffi_store32(iter_base + 20, ptr554) - cleanup_list.push(ptr554) + } + _ => panic() + } - () - } - } - cleanup_list.push(ptr551) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { - () - } - PathValue(payload555) => { - mbt_ffi_store8(iter_base + 0, 25) + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 32)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index10 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr556 = mbt_ffi_str2ptr(payload555) - mbt_ffi_store32(iter_base + 12, payload555.length()) - mbt_ffi_store32(iter_base + 8, ptr556) - cleanup_list.push(ptr556) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () - } - UrlValue(payload557) => { - mbt_ffi_store8(iter_base + 0, 26) + } + _ => panic() + } - let ptr558 = mbt_ffi_str2ptr(payload557) - mbt_ffi_store32(iter_base + 12, payload557.length()) - mbt_ffi_store32(iter_base + 8, ptr558) - cleanup_list.push(ptr558) + } + 27 => { - () - } - DatetimeValue(payload559) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload559.seconds) - mbt_ffi_store32( - iter_base + 16, - payload559.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload560) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload560.nanoseconds) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - QuantityValueNode(payload561) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload561.mantissa) - mbt_ffi_store32(iter_base + 16, payload561.scale) + for index11 = 0; index11 < (mbt_ffi_load32((iter_base) + 16)); index11 = index11 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index11 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr562 = mbt_ffi_str2ptr(payload561.unit) - mbt_ffi_store32(iter_base + 24, payload561.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr562) - cleanup_list.push(ptr562) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - UnionValue(payload563) => { - mbt_ffi_store8(iter_base + 0, 30) + } + _ => panic() + } - let ptr564 = mbt_ffi_str2ptr(payload563.tag) - mbt_ffi_store32(iter_base + 12, payload563.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr564) - mbt_ffi_store32(iter_base + 16, payload563.body) - cleanup_list.push(ptr564) + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { - () - } - SecretValue(payload565) => { - mbt_ffi_store8(iter_base + 0, 31) + for index12 = 0; index12 < (mbt_ffi_load32((iter_base) + 28)); index12 = index12 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index12 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let @types.Secret(handle566) = payload565 - mbt_ffi_store32(iter_base + 8, handle566) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - () - } - QuotaTokenHandle(payload567) => { - mbt_ffi_store8(iter_base + 0, 32) + } + _ => panic() + } - let @types.QuotaToken(handle568) = payload567 - mbt_ffi_store32(iter_base + 8, handle568) + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } - } - cleanup_list.push(address491) - cleanup_list.push(address497) - cleanup_list.push(address569) - - ( - 4, - address491, - payload129.graph.type_nodes.length(), - address497, - payload129.graph.defs.length(), - payload129.graph.root, - address569, - payload129.value.value_nodes.length(), - payload129.value.root, - ) - } - } - - ( - 1, lowered571, lowered572, lowered573, lowered574, lowered575, lowered576, - lowered577, lowered578, lowered579, - ) - } - } + for index13 = 0; index13 < (mbt_ffi_load32((iter_base) + 20)); index13 = index13 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index13 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - wasmExportAsyncInvokeGolemAgentGuestTaskReturn( - lowered580, lowered581, lowered582, lowered583, lowered584, lowered585, lowered586, - lowered587, lowered588, lowered589, - ) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - cleanup_list.each(mbt_ffi_free) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - @async-core.task_returned() - } - None => () - } -} + } + _ => panic() + } -///| -#doc(hidden) -pub fn wasmExportAsyncInvokeGolemAgentGuest( - event_raw : Int, - waitable : Int, - code : Int, -) -> Int { - @async-core.cb(event_raw, waitable, code) -} + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) -///| -#doc(hidden) -pub fn wasmExportGetDefinition() -> Int { - let result : @common.AgentType = get_definition() - let return_area = mbt_ffi_malloc(176) - __wit_bindgen_lower_t402(return_area + 0, result) - let ret = return_area - return ret -} + } + _ => panic() + } -///| -#doc(hidden) -pub fn wasmExportGetDefinitionPostReturn(p0 : Int) -> Unit { - mbt_ffi_free(mbt_ffi_load32(p0 + 0)) - mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - mbt_ffi_free(mbt_ffi_load32(p0 + 16)) - - for index19 = 0; index19 < mbt_ffi_load32(p0 + 28); index19 = index19 + 1 { - let iter_base = mbt_ffi_load32(p0 + 24) + index19 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index1 = 0 - index1 < mbt_ffi_load32(iter_base + 12) - index1 = index1 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index1 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - for index = 0 - index < mbt_ffi_load32(iter_base + 28) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index0 = 0 - index0 < mbt_ffi_load32(iter_base + 36) - index0 = index0 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index0 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } + } + 31 => { - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index4 = 0 - index4 < mbt_ffi_load32(iter_base + 12) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index4 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index2 = 0 - index2 < mbt_ffi_load32(iter_base + 32) - index2 = index2 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index2 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index3 = 0 - index3 < mbt_ffi_load32(iter_base + 40) - index3 = index3 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index3 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + for index16 = 0; index16 < (mbt_ffi_load32((iter_base) + 12)); index16 = index16 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index16 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index5 = 0 - index5 < mbt_ffi_load32(iter_base + 12) - index5 = index5 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index5 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index6 = 0 - index6 < mbt_ffi_load32(iter_base + 12) - index6 = index6 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index6 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index7 = 0 - index7 < mbt_ffi_load32(iter_base + 16) - index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index7 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 16) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index8 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index9 = 0 - index9 < mbt_ffi_load32(iter_base + 20) - index9 = index9 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index9 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 32) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index10 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index11 = 0 - index11 < mbt_ffi_load32(iter_base + 16) - index11 = index11 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index11 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index12 = 0 - index12 < mbt_ffi_load32(iter_base + 28) - index12 = index12 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index12 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index13 = 0 - index13 < mbt_ffi_load32(iter_base + 20) - index13 = index13 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index13 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index16 = 0 - index16 < mbt_ffi_load32(iter_base + 12) - index16 = index16 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index16 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - - for index14 = 0 - index14 < mbt_ffi_load32(iter_base + 52) - index14 = index14 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index14 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - for index15 = 0 - index15 < mbt_ffi_load32(iter_base + 60) - index15 = index15 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index15 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index17 = 0 - index17 < mbt_ffi_load32(iter_base + 104) - index17 = index17 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index17 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index18 = 0 - index18 < mbt_ffi_load32(iter_base + 112) - index18 = index18 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index18 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 24)) - - for index20 = 0; index20 < mbt_ffi_load32(p0 + 36); index20 = index20 + 1 { - let iter_base = mbt_ffi_load32(p0 + 32) + index20 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 32)) - - match mbt_ffi_load8_u(p0 + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(p0 + 48)) - _ => panic() - } - mbt_ffi_free(mbt_ffi_load32(p0 + 56)) - - match mbt_ffi_load8_u(p0 + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(p0 + 68)) - _ => panic() - } - - match mbt_ffi_load8_u(p0 + 76) { - 0 => { - for index23 = 0; index23 < mbt_ffi_load32(p0 + 84); index23 = index23 + 1 { - let iter_base = mbt_ffi_load32(p0 + 80) + index23 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index21 = 0 - index21 < mbt_ffi_load32(iter_base + 32) - index21 = index21 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index21 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index22 = 0 - index22 < mbt_ffi_load32(iter_base + 40) - index22 = index22 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index22 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 80)) - } - _ => panic() - } - - for index32 = 0; index32 < mbt_ffi_load32(p0 + 92); index32 = index32 + 1 { - let iter_base = mbt_ffi_load32(p0 + 88) + index32 * 88 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index28 = 0 - index28 < mbt_ffi_load32(iter_base + 20) - index28 = index28 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index28 * 48 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - _ => panic() - } + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - for index24 = 0 - index24 < mbt_ffi_load32(iter_base + 16) - index24 = index24 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index24 * 12 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => () - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - for index25 = 0 - index25 < mbt_ffi_load32(iter_base + 24) - index25 = index25 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index25 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - for index26 = 0 - index26 < mbt_ffi_load32(iter_base + 32) - index26 = index26 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index26 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - for index27 = 0 - index27 < mbt_ffi_load32(iter_base + 44) - index27 = index27 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index27 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => { - for index31 = 0 - index31 < mbt_ffi_load32(iter_base + 44) - index31 = index31 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index31 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index29 = 0 - index29 < mbt_ffi_load32(iter_base + 32) - index29 = index29 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index29 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index30 = 0 - index30 < mbt_ffi_load32(iter_base + 40) - index30 = index30 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index30 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index14 = 0; index14 < (mbt_ffi_load32((iter_base) + 52)); index14 = index14 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index14 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index15 = 0; index15 < (mbt_ffi_load32((iter_base) + 60)); index15 = index15 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index15 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 88)) - - for index67 = 0; index67 < mbt_ffi_load32(p0 + 100); index67 = index67 + 1 { - let iter_base = mbt_ffi_load32(p0 + 96) + index67 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - for index53 = 0 - index53 < mbt_ffi_load32(iter_base + 24) - index53 = index53 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index53 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index35 = 0 - index35 < mbt_ffi_load32(iter_base + 12) - index35 = index35 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index35 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - for index33 = 0 - index33 < mbt_ffi_load32(iter_base + 28) - index33 = index33 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index33 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index34 = 0 - index34 < mbt_ffi_load32(iter_base + 36) - index34 = index34 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index34 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index38 = 0 - index38 < mbt_ffi_load32(iter_base + 12) - index38 = index38 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index38 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index36 = 0 - index36 < mbt_ffi_load32(iter_base + 32) - index36 = index36 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index36 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index37 = 0 - index37 < mbt_ffi_load32(iter_base + 40) - index37 = index37 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index37 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index39 = 0 - index39 < mbt_ffi_load32(iter_base + 12) - index39 = index39 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index39 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index40 = 0 - index40 < mbt_ffi_load32(iter_base + 12) - index40 = index40 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index40 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index41 = 0 - index41 < mbt_ffi_load32(iter_base + 16) - index41 = index41 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index41 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index42 = 0 - index42 < mbt_ffi_load32(iter_base + 16) - index42 = index42 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index42 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index43 = 0 - index43 < mbt_ffi_load32(iter_base + 20) - index43 = index43 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index43 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } + } + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index44 = 0 - index44 < mbt_ffi_load32(iter_base + 32) - index44 = index44 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index44 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index45 = 0 - index45 < mbt_ffi_load32(iter_base + 16) - index45 = index45 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index45 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } + for index17 = 0; index17 < (mbt_ffi_load32((iter_base) + 104)); index17 = index17 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index17 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index46 = 0 - index46 < mbt_ffi_load32(iter_base + 28) - index46 = index46 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index46 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index47 = 0 - index47 < mbt_ffi_load32(iter_base + 20) - index47 = index47 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index47 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index50 = 0 - index50 < mbt_ffi_load32(iter_base + 12) - index50 = index50 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index50 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + for index18 = 0; index18 < (mbt_ffi_load32((iter_base) + 112)); index18 = index18 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index18 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - for index48 = 0 - index48 < mbt_ffi_load32(iter_base + 52) - index48 = index48 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index48 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) - for index49 = 0 - index49 < mbt_ffi_load32(iter_base + 60) - index49 = index49 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index49 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) + } + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } + } + _ => panic() + } - for index51 = 0 - index51 < mbt_ffi_load32(iter_base + 104) - index51 = index51 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index51 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + } + _ => panic() + } - for index52 = 0 - index52 < mbt_ffi_load32(iter_base + 112) - index52 = index52 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index52 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } + for index20 = 0; index20 < (mbt_ffi_load32((iter_base) + 36)); index20 = index20 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index20 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - for index54 = 0 - index54 < mbt_ffi_load32(iter_base + 32) - index54 = index54 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index54 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 72) { - 0 => { - for index57 = 0 - index57 < mbt_ffi_load32(iter_base + 80) - index57 = index57 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 76) + index57 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index55 = 0 - index55 < mbt_ffi_load32(iter_base + 32) - index55 = index55 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index55 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index56 = 0 - index56 < mbt_ffi_load32(iter_base + 40) - index56 = index56 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index56 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - } - _ => panic() - } - - for index66 = 0 - index66 < mbt_ffi_load32(iter_base + 88) - index66 = index66 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 84) + index66 * 88 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index62 = 0 - index62 < mbt_ffi_load32(iter_base + 20) - index62 = index62 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index62 * 48 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - _ => panic() - } - - for index58 = 0 - index58 < mbt_ffi_load32(iter_base + 16) - index58 = index58 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index58 * 12 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => () - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - for index59 = 0 - index59 < mbt_ffi_load32(iter_base + 24) - index59 = index59 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index59 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - for index60 = 0 - index60 < mbt_ffi_load32(iter_base + 32) - index60 = index60 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index60 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index61 = 0 - index61 < mbt_ffi_load32(iter_base + 44) - index61 = index61 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index61 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) + } + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => { - for index65 = 0 - index65 < mbt_ffi_load32(iter_base + 44) - index65 = index65 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index65 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + } + _ => panic() + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - for index63 = 0 - index63 < mbt_ffi_load32(iter_base + 32) - index63 = index63 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index63 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - for index64 = 0 - index64 < mbt_ffi_load32(iter_base + 40) - index64 = index64 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index64 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) + } + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => { - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 96)) - - match mbt_ffi_load8_u(p0 + 108) { - 0 => () - 1 => { - for index68 = 0; index68 < mbt_ffi_load32(p0 + 116); index68 = index68 + 1 { - let iter_base = mbt_ffi_load32(p0 + 112) + index68 * 12 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => () - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 112)) + for index23 = 0; index23 < (mbt_ffi_load32((iter_base) + 84)); index23 = index23 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 80)) + (index23 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - for index69 = 0; index69 < mbt_ffi_load32(p0 + 128); index69 = index69 + 1 { - let iter_base = mbt_ffi_load32(p0 + 124) + index69 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 124)) - - for index70 = 0; index70 < mbt_ffi_load32(p0 + 136); index70 = index70 + 1 { - let iter_base = mbt_ffi_load32(p0 + 132) + index70 * 12 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => () - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 132)) - } - _ => panic() - } - - for index72 = 0; index72 < mbt_ffi_load32(p0 + 172); index72 = index72 + 1 { - let iter_base = mbt_ffi_load32(p0 + 168) + index72 * 16 - - for index71 = 0 - index71 < mbt_ffi_load32(iter_base + 8) - index71 = index71 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index71 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 168)) -} + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) -///| -#doc(hidden) -pub fn wasmExportDiscoverAgentTypes() -> Int { - let result : Result[Array[@common.AgentType], @common.AgentError] = discover_agent_types() - let return_area = mbt_ffi_malloc(40) - - match result { - Ok(payload) => { - mbt_ffi_store8(return_area + 0, 0) - - let address = mbt_ffi_malloc(payload.length() * 176) - for index = 0; index < payload.length(); index = index + 1 { - let iter_elem : @common.AgentType = payload[index] - let iter_base = address + index * 176 - __wit_bindgen_lower_t402(iter_base + 0, iter_elem) - } - mbt_ffi_store32(return_area + 8, payload.length()) - mbt_ffi_store32(return_area + 4, address) - - () - } - Err(payload0) => { - mbt_ffi_store8(return_area + 0, 1) - __wit_bindgen_lower_t405(return_area + 4, payload0) - - () - } - } - let ret = return_area - return ret -} + } + _ => panic() + } -///| -#doc(hidden) -pub fn wasmExportDiscoverAgentTypesPostReturn(p0 : Int) -> Unit { - match mbt_ffi_load8_u(p0 + 0) { - 0 => { - for index73 = 0; index73 < mbt_ffi_load32(p0 + 8); index73 = index73 + 1 { - let iter_base = mbt_ffi_load32(p0 + 4) + index73 * 176 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - for index19 = 0 - index19 < mbt_ffi_load32(iter_base + 28) - index19 = index19 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index19 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index1 = 0 - index1 < mbt_ffi_load32(iter_base + 12) - index1 = index1 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index1 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - for index = 0 - index < mbt_ffi_load32(iter_base + 28) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index0 = 0 - index0 < mbt_ffi_load32(iter_base + 36) - index0 = index0 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index0 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } + for index21 = 0; index21 < (mbt_ffi_load32((iter_base) + 32)); index21 = index21 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index21 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index4 = 0 - index4 < mbt_ffi_load32(iter_base + 12) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index4 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index2 = 0 - index2 < mbt_ffi_load32(iter_base + 32) - index2 = index2 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index2 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index3 = 0 - index3 < mbt_ffi_load32(iter_base + 40) - index3 = index3 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index3 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index5 = 0 - index5 < mbt_ffi_load32(iter_base + 12) - index5 = index5 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index5 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index6 = 0 - index6 < mbt_ffi_load32(iter_base + 12) - index6 = index6 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index6 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index7 = 0 - index7 < mbt_ffi_load32(iter_base + 16) - index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index7 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 16) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index8 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index9 = 0 - index9 < mbt_ffi_load32(iter_base + 20) - index9 = index9 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index9 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 32) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index10 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index11 = 0 - index11 < mbt_ffi_load32(iter_base + 16) - index11 = index11 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index11 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index12 = 0 - index12 < mbt_ffi_load32(iter_base + 28) - index12 = index12 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index12 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index13 = 0 - index13 < mbt_ffi_load32(iter_base + 20) - index13 = index13 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index13 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index16 = 0 - index16 < mbt_ffi_load32(iter_base + 12) - index16 = index16 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index16 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) + for index22 = 0; index22 < (mbt_ffi_load32((iter_base) + 40)); index22 = index22 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index22 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - - for index14 = 0 - index14 < mbt_ffi_load32(iter_base + 52) - index14 = index14 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index14 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - for index15 = 0 - index15 < mbt_ffi_load32(iter_base + 60) - index15 = index15 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index15 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } + } + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index17 = 0 - index17 < mbt_ffi_load32(iter_base + 104) - index17 = index17 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index17 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index18 = 0 - index18 < mbt_ffi_load32(iter_base + 112) - index18 = index18 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index18 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 80)) + + } + _ => panic() + } + + for index32 = 0; index32 < (mbt_ffi_load32((iter_base) + 92)); index32 = index32 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 88)) + (index32 * 88) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index28 = 0; index28 < (mbt_ffi_load32((iter_base) + 20)); index28 = index28 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index28 * 48) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + _ => panic() + } + + for index24 = 0; index24 < (mbt_ffi_load32((iter_base) + 16)); index24 = index24 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index24 * 12) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => () + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + for index25 = 0; index25 < (mbt_ffi_load32((iter_base) + 24)); index25 = index25 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index25 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + for index26 = 0; index26 < (mbt_ffi_load32((iter_base) + 32)); index26 = index26 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index26 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index27 = 0; index27 < (mbt_ffi_load32((iter_base) + 44)); index27 = index27 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index27 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => { + + for index31 = 0; index31 < (mbt_ffi_load32((iter_base) + 44)); index31 = index31 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index31 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index29 = 0; index29 < (mbt_ffi_load32((iter_base) + 32)); index29 = index29 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index29 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index30 = 0; index30 < (mbt_ffi_load32((iter_base) + 40)); index30 = index30 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index30 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + + for index67 = 0; index67 < (mbt_ffi_load32((iter_base) + 100)); index67 = index67 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 96)) + (index67 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + for index53 = 0; index53 < (mbt_ffi_load32((iter_base) + 24)); index53 = index53 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index53 * 144) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 3 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 5 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 7 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 8 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 9 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 10 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 11 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 12 => () + 13 => () + 14 => { + + for index35 = 0; index35 < (mbt_ffi_load32((iter_base) + 12)); index35 = index35 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index35 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index33 = 0; index33 < (mbt_ffi_load32((iter_base) + 28)); index33 = index33 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index33 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index34 = 0; index34 < (mbt_ffi_load32((iter_base) + 36)); index34 = index34 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index34 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index38 = 0; index38 < (mbt_ffi_load32((iter_base) + 12)); index38 = index38 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index38 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index36 = 0; index36 < (mbt_ffi_load32((iter_base) + 32)); index36 = index36 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index36 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index37 = 0; index37 < (mbt_ffi_load32((iter_base) + 40)); index37 = index37 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index37 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 16 => { + + for index39 = 0; index39 < (mbt_ffi_load32((iter_base) + 12)); index39 = index39 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index39 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + + for index40 = 0; index40 < (mbt_ffi_load32((iter_base) + 12)); index40 = index40 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index40 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index41 = 0; index41 < (mbt_ffi_load32((iter_base) + 16)); index41 = index41 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index41 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + } + 25 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index42 = 0; index42 < (mbt_ffi_load32((iter_base) + 16)); index42 = index42 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index42 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 26 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + + for index43 = 0; index43 < (mbt_ffi_load32((iter_base) + 20)); index43 = index43 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index43 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + + for index44 = 0; index44 < (mbt_ffi_load32((iter_base) + 32)); index44 = index44 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index44 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 27 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index45 = 0; index45 < (mbt_ffi_load32((iter_base) + 16)); index45 = index45 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index45 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { + + for index46 = 0; index46 < (mbt_ffi_load32((iter_base) + 28)); index46 = index46 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index46 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index47 = 0; index47 < (mbt_ffi_load32((iter_base) + 20)); index47 = index47 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index47 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + } + _ => panic() + } + + } + 31 => { + + for index50 = 0; index50 < (mbt_ffi_load32((iter_base) + 12)); index50 = index50 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index50 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index48 = 0; index48 < (mbt_ffi_load32((iter_base) + 52)); index48 = index48 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index48 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index49 = 0; index49 < (mbt_ffi_load32((iter_base) + 60)); index49 = index49 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index49 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index51 = 0; index51 < (mbt_ffi_load32((iter_base) + 104)); index51 = index51 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index51 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index52 = 0; index52 < (mbt_ffi_load32((iter_base) + 112)); index52 = index52 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index52 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + for index54 = 0; index54 < (mbt_ffi_load32((iter_base) + 32)); index54 = index54 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index54 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 72)) { + 0 => { + + for index57 = 0; index57 < (mbt_ffi_load32((iter_base) + 80)); index57 = index57 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 76)) + (index57 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index55 = 0; index55 < (mbt_ffi_load32((iter_base) + 32)); index55 = index55 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index55 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index56 = 0; index56 < (mbt_ffi_load32((iter_base) + 40)); index56 = index56 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index56 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + } + _ => panic() + } + + for index66 = 0; index66 < (mbt_ffi_load32((iter_base) + 88)); index66 = index66 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 84)) + (index66 * 88) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index62 = 0; index62 < (mbt_ffi_load32((iter_base) + 20)); index62 = index62 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index62 * 48) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + _ => panic() + } + + for index58 = 0; index58 < (mbt_ffi_load32((iter_base) + 16)); index58 = index58 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index58 * 12) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => () + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + for index59 = 0; index59 < (mbt_ffi_load32((iter_base) + 24)); index59 = index59 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index59 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + for index60 = 0; index60 < (mbt_ffi_load32((iter_base) + 32)); index60 = index60 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index60 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index61 = 0; index61 < (mbt_ffi_load32((iter_base) + 44)); index61 = index61 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index61 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => { + + for index65 = 0; index65 < (mbt_ffi_load32((iter_base) + 44)); index65 = index65 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index65 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index63 = 0; index63 < (mbt_ffi_load32((iter_base) + 32)); index63 = index63 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index63 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index64 = 0; index64 < (mbt_ffi_load32((iter_base) + 40)); index64 = index64 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index64 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 96)) + + match (mbt_ffi_load8_u((iter_base) + 108)) { + 0 => () + 1 => { + + for index68 = 0; index68 < (mbt_ffi_load32((iter_base) + 116)); index68 = index68 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 112)) + (index68 * 12) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => () + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 112)) + + for index69 = 0; index69 < (mbt_ffi_load32((iter_base) + 128)); index69 = index69 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 124)) + (index69 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 124)) + + for index70 = 0; index70 < (mbt_ffi_load32((iter_base) + 136)); index70 = index70 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 132)) + (index70 * 12) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => () + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 132)) + + } + _ => panic() + } + + for index72 = 0; index72 < (mbt_ffi_load32((iter_base) + 172)); index72 = index72 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 168)) + (index72 * 16) + + for index71 = 0; index71 < (mbt_ffi_load32((iter_base) + 8)); index71 = index71 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index71 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 168)) + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 4)) + + } + 1 => { + + match (mbt_ffi_load8_u((p0) + 4)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 4 => { + + for index94 = 0; index94 < (mbt_ffi_load32((p0) + 12)); index94 = index94 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 8)) + (index94 * 144) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 3 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 5 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 7 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 8 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 9 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 10 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 11 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 12 => () + 13 => () + 14 => { + + for index76 = 0; index76 < (mbt_ffi_load32((iter_base) + 12)); index76 = index76 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index76 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index74 = 0; index74 < (mbt_ffi_load32((iter_base) + 28)); index74 = index74 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index74 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index75 = 0; index75 < (mbt_ffi_load32((iter_base) + 36)); index75 = index75 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index75 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index79 = 0; index79 < (mbt_ffi_load32((iter_base) + 12)); index79 = index79 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index79 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index77 = 0; index77 < (mbt_ffi_load32((iter_base) + 32)); index77 = index77 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index77 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index78 = 0; index78 < (mbt_ffi_load32((iter_base) + 40)); index78 = index78 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index78 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 16 => { + + for index80 = 0; index80 < (mbt_ffi_load32((iter_base) + 12)); index80 = index80 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index80 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + + for index81 = 0; index81 < (mbt_ffi_load32((iter_base) + 12)); index81 = index81 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index81 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index82 = 0; index82 < (mbt_ffi_load32((iter_base) + 16)); index82 = index82 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index82 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + } + 25 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index83 = 0; index83 < (mbt_ffi_load32((iter_base) + 16)); index83 = index83 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index83 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 26 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + + for index84 = 0; index84 < (mbt_ffi_load32((iter_base) + 20)); index84 = index84 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index84 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + + for index85 = 0; index85 < (mbt_ffi_load32((iter_base) + 32)); index85 = index85 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index85 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 27 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index86 = 0; index86 < (mbt_ffi_load32((iter_base) + 16)); index86 = index86 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index86 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { + + for index87 = 0; index87 < (mbt_ffi_load32((iter_base) + 28)); index87 = index87 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index87 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index88 = 0; index88 < (mbt_ffi_load32((iter_base) + 20)); index88 = index88 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index88 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + } + _ => panic() + } + + } + 31 => { + + for index91 = 0; index91 < (mbt_ffi_load32((iter_base) + 12)); index91 = index91 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index91 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index89 = 0; index89 < (mbt_ffi_load32((iter_base) + 52)); index89 = index89 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index89 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index90 = 0; index90 < (mbt_ffi_load32((iter_base) + 60)); index90 = index90 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index90 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index92 = 0; index92 < (mbt_ffi_load32((iter_base) + 104)); index92 = index92 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index92 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index93 = 0; index93 < (mbt_ffi_load32((iter_base) + 112)); index93 = index93 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index93 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + for index95 = 0; index95 < (mbt_ffi_load32((p0) + 20)); index95 = index95 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 16)) + (index95 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 16)) + + for index96 = 0; index96 < (mbt_ffi_load32((p0) + 32)); index96 = index96 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 28)) + (index96 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 28)) + + } + _ => panic() + } + + } _ => panic() - } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t5(ptr : Int, value : @types.Datetime) -> Unit { + mbt_ffi_store64((ptr) + 0, (value).seconds) + mbt_ffi_store32((ptr) + 8, ((value).nanoseconds).reinterpret_as_int()) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t17(ptr : Int, value : @types.SchemaTypeDef) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).id) + mbt_ffi_store32((ptr) + 4, (value).id.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + match ((value).name) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) + + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 16, payload1.length()) + mbt_ffi_store32((ptr) + 12, ptr2) + + () + } + } + mbt_ffi_store32((ptr) + 20, (value).body) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t18(ptr : Int, value : @types.Role) -> Unit { + + match value { + Multimodal => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((ptr) + 0, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((ptr) + 0, (2)) + + () + } + Other(payload2) => { + mbt_ffi_store8((ptr) + 0, (3)) + + let ptr3 = mbt_ffi_str2ptr(payload2) + mbt_ffi_store32((ptr) + 8, payload2.length()) + mbt_ffi_store32((ptr) + 4, ptr3) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t21(ptr : Int, value : @types.MetadataEnvelope) -> Unit { + + match ((value).doc) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let ptr1 = mbt_ffi_str2ptr(payload0) + mbt_ffi_store32((ptr) + 8, payload0.length()) + mbt_ffi_store32((ptr) + 4, ptr1) + + () + } + } + + let address = mbt_ffi_malloc(((value).aliases).length() * 8); + for index = 0; index < ((value).aliases).length(); index = index + 1 { + let iter_elem : String = ((value).aliases)[(index)] + let iter_base = address + (index * 8); + + let ptr2 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr2) + + } + mbt_ffi_store32((ptr) + 16, ((value).aliases).length()) + mbt_ffi_store32((ptr) + 12, address) + + let address4 = mbt_ffi_malloc(((value).examples).length() * 8); + for index5 = 0; index5 < ((value).examples).length(); index5 = index5 + 1 { + let iter_elem : String = ((value).examples)[(index5)] + let iter_base = address4 + (index5 * 8); + + let ptr3 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr3) + + } + mbt_ffi_store32((ptr) + 24, ((value).examples).length()) + mbt_ffi_store32((ptr) + 20, address4) + + match ((value).deprecated) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload7) => { + mbt_ffi_store8((ptr) + 28, (1)) + + let ptr8 = mbt_ffi_str2ptr(payload7) + mbt_ffi_store32((ptr) + 36, payload7.length()) + mbt_ffi_store32((ptr) + 32, ptr8) + + () + } + } + + match ((value).role) { + None => { + mbt_ffi_store8((ptr) + 40, (0)) + + () + } + Some(payload10) => { + mbt_ffi_store8((ptr) + 40, (1)) + __wit_bindgen_lower_t18((ptr) + 44, payload10) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t22(ptr : Int, value : @types.NamedFieldType) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).name) + mbt_ffi_store32((ptr) + 4, (value).name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + mbt_ffi_store32((ptr) + 8, (value).body) + __wit_bindgen_lower_t21((ptr) + 12, (value).metadata) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t24(ptr : Int, value : @types.VariantCaseType) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).name) + mbt_ffi_store32((ptr) + 4, (value).name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + match ((value).payload) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) + mbt_ffi_store32((ptr) + 12, payload1) + + () + } + } + __wit_bindgen_lower_t21((ptr) + 16, (value).metadata) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t25(ptr : Int, value : @types.FixedListSpec) -> Unit { + mbt_ffi_store32((ptr) + 0, (value).element) + mbt_ffi_store32((ptr) + 4, ((value).length).reinterpret_as_int()) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t26(ptr : Int, value : @types.MapSpec) -> Unit { + mbt_ffi_store32((ptr) + 0, (value).key) + mbt_ffi_store32((ptr) + 4, (value).value) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t27(ptr : Int, value : @types.ResultSpec) -> Unit { + + match ((value).ok) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + mbt_ffi_store32((ptr) + 4, payload0) + + () + } + } + + match ((value).err) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload2) => { + mbt_ffi_store8((ptr) + 8, (1)) + mbt_ffi_store32((ptr) + 12, payload2) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t28(ptr : Int, value : @types.NumericBound) -> Unit { + + match value { + Signed(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + mbt_ffi_store64((ptr) + 8, payload) + + () + } + Unsigned(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + mbt_ffi_store64((ptr) + 8, (payload0).reinterpret_as_int64()) + + () + } + FloatBits(payload1) => { + mbt_ffi_store8((ptr) + 0, (2)) + mbt_ffi_store64((ptr) + 8, (payload1).reinterpret_as_int64()) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t30(ptr : Int, value : @types.NumericRestrictions) -> Unit { + + match ((value).min) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + __wit_bindgen_lower_t28((ptr) + 8, payload0) + + () + } + } + + match ((value).max) { + None => { + mbt_ffi_store8((ptr) + 24, (0)) + + () + } + Some(payload2) => { + mbt_ffi_store8((ptr) + 24, (1)) + __wit_bindgen_lower_t28((ptr) + 32, payload2) + + () + } + } + + match ((value).unit) { + None => { + mbt_ffi_store8((ptr) + 48, (0)) + + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 48, (1)) + + let ptr5 = mbt_ffi_str2ptr(payload4) + mbt_ffi_store32((ptr) + 56, payload4.length()) + mbt_ffi_store32((ptr) + 52, ptr5) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t33(ptr : Int, value : @types.TextRestrictions) -> Unit { + + match ((value).languages) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let address = mbt_ffi_malloc((payload0).length() * 8); + for index = 0; index < (payload0).length(); index = index + 1 { + let iter_elem : String = (payload0)[(index)] + let iter_base = address + (index * 8); + + let ptr1 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + } + mbt_ffi_store32((ptr) + 8, (payload0).length()) + mbt_ffi_store32((ptr) + 4, address) + + () + } + } + + match ((value).min_length) { + None => { + mbt_ffi_store8((ptr) + 12, (0)) - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + () + } + Some(payload3) => { + mbt_ffi_store8((ptr) + 12, (1)) + mbt_ffi_store32((ptr) + 16, (payload3).reinterpret_as_int()) + + () + } + } + + match ((value).max_length) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) + + () + } + Some(payload5) => { + mbt_ffi_store8((ptr) + 20, (1)) + mbt_ffi_store32((ptr) + 24, (payload5).reinterpret_as_int()) + + () + } + } + + match ((value).regex) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload7) => { + mbt_ffi_store8((ptr) + 28, (1)) + + let ptr8 = mbt_ffi_str2ptr(payload7) + mbt_ffi_store32((ptr) + 36, payload7.length()) + mbt_ffi_store32((ptr) + 32, ptr8) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t34(ptr : Int, value : @types.BinaryRestrictions) -> Unit { + + match ((value).mime_types) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let address = mbt_ffi_malloc((payload0).length() * 8); + for index = 0; index < (payload0).length(); index = index + 1 { + let iter_elem : String = (payload0)[(index)] + let iter_base = address + (index * 8); + + let ptr1 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + } + mbt_ffi_store32((ptr) + 8, (payload0).length()) + mbt_ffi_store32((ptr) + 4, address) + + () + } + } + + match ((value).min_bytes) { + None => { + mbt_ffi_store8((ptr) + 12, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((ptr) + 12, (1)) + mbt_ffi_store32((ptr) + 16, (payload3).reinterpret_as_int()) + + () + } + } + + match ((value).max_bytes) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) + + () + } + Some(payload5) => { + mbt_ffi_store8((ptr) + 20, (1)) + mbt_ffi_store32((ptr) + 24, (payload5).reinterpret_as_int()) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t37(ptr : Int, value : @types.PathSpec) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).direction.ordinal()) + mbt_ffi_store8((ptr) + 1, (value).kind.ordinal()) + + match ((value).allowed_mime_types) { + None => { + mbt_ffi_store8((ptr) + 4, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 4, (1)) + + let address = mbt_ffi_malloc((payload0).length() * 8); + for index = 0; index < (payload0).length(); index = index + 1 { + let iter_elem : String = (payload0)[(index)] + let iter_base = address + (index * 8); + + let ptr1 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + } + mbt_ffi_store32((ptr) + 12, (payload0).length()) + mbt_ffi_store32((ptr) + 8, address) + + () + } + } + + match ((value).allowed_extensions) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let address5 = mbt_ffi_malloc((payload3).length() * 8); + for index6 = 0; index6 < (payload3).length(); index6 = index6 + 1 { + let iter_elem : String = (payload3)[(index6)] + let iter_base = address5 + (index6 * 8); + + let ptr4 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr4) + + } + mbt_ffi_store32((ptr) + 24, (payload3).length()) + mbt_ffi_store32((ptr) + 20, address5) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t38(ptr : Int, value : @types.UrlRestrictions) -> Unit { + + match ((value).allowed_schemes) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let address = mbt_ffi_malloc((payload0).length() * 8); + for index = 0; index < (payload0).length(); index = index + 1 { + let iter_elem : String = (payload0)[(index)] + let iter_base = address + (index * 8); + + let ptr1 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + } + mbt_ffi_store32((ptr) + 8, (payload0).length()) + mbt_ffi_store32((ptr) + 4, address) + + () + } + } + + match ((value).allowed_hosts) { + None => { + mbt_ffi_store8((ptr) + 12, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((ptr) + 12, (1)) + + let address5 = mbt_ffi_malloc((payload3).length() * 8); + for index6 = 0; index6 < (payload3).length(); index6 = index6 + 1 { + let iter_elem : String = (payload3)[(index6)] + let iter_base = address5 + (index6 * 8); + + let ptr4 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr4) + + } + mbt_ffi_store32((ptr) + 20, (payload3).length()) + mbt_ffi_store32((ptr) + 16, address5) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t39(ptr : Int, value : @types.QuantityValue) -> Unit { + mbt_ffi_store64((ptr) + 0, (value).mantissa) + mbt_ffi_store32((ptr) + 8, (value).scale) + + let ptr0 = mbt_ffi_str2ptr((value).unit) + mbt_ffi_store32((ptr) + 16, (value).unit.length()) + mbt_ffi_store32((ptr) + 12, ptr0) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t41(ptr : Int, value : @types.QuantitySpec) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).base_unit) + mbt_ffi_store32((ptr) + 4, (value).base_unit.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + let address = mbt_ffi_malloc(((value).allowed_suffixes).length() * 8); + for index = 0; index < ((value).allowed_suffixes).length(); index = index + 1 { + let iter_elem : String = ((value).allowed_suffixes)[(index)] + let iter_base = address + (index * 8); + + let ptr1 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + } + mbt_ffi_store32((ptr) + 12, ((value).allowed_suffixes).length()) + mbt_ffi_store32((ptr) + 8, address) + + match ((value).min) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload2) => { + mbt_ffi_store8((ptr) + 16, (1)) + __wit_bindgen_lower_t39((ptr) + 24, payload2) + + () + } + } + + match ((value).max) { + None => { + mbt_ffi_store8((ptr) + 48, (0)) + + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 48, (1)) + __wit_bindgen_lower_t39((ptr) + 56, payload4) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t42(ptr : Int, value : @types.FieldDiscriminator) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).field_name) + mbt_ffi_store32((ptr) + 4, (value).field_name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + match ((value).literal) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) + + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 16, payload1.length()) + mbt_ffi_store32((ptr) + 12, ptr2) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t43(ptr : Int, value : @types.DiscriminatorRule) -> Unit { + + match value { + Prefix(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + + let ptr0 = mbt_ffi_str2ptr(payload) + mbt_ffi_store32((ptr) + 8, payload.length()) + mbt_ffi_store32((ptr) + 4, ptr0) + + () + } + Suffix(payload1) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 8, payload1.length()) + mbt_ffi_store32((ptr) + 4, ptr2) + + () + } + Contains(payload3) => { + mbt_ffi_store8((ptr) + 0, (2)) + + let ptr4 = mbt_ffi_str2ptr(payload3) + mbt_ffi_store32((ptr) + 8, payload3.length()) + mbt_ffi_store32((ptr) + 4, ptr4) + + () + } + Regex(payload5) => { + mbt_ffi_store8((ptr) + 0, (3)) + + let ptr6 = mbt_ffi_str2ptr(payload5) + mbt_ffi_store32((ptr) + 8, payload5.length()) + mbt_ffi_store32((ptr) + 4, ptr6) + + () + } + FieldEquals(payload7) => { + mbt_ffi_store8((ptr) + 0, (4)) + __wit_bindgen_lower_t42((ptr) + 4, payload7) + + () + } + FieldAbsent(payload8) => { + mbt_ffi_store8((ptr) + 0, (5)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((ptr) + 8, payload8.length()) + mbt_ffi_store32((ptr) + 4, ptr9) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t44(ptr : Int, value : @types.UnionBranch) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).tag) + mbt_ffi_store32((ptr) + 4, (value).tag.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + mbt_ffi_store32((ptr) + 8, (value).body) + __wit_bindgen_lower_t43((ptr) + 12, (value).discriminator) + __wit_bindgen_lower_t21((ptr) + 36, (value).metadata) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t46(ptr : Int, value : @types.UnionSpec) -> Unit { + + let address = mbt_ffi_malloc(((value).branches).length() * 92); + for index = 0; index < ((value).branches).length(); index = index + 1 { + let iter_elem : @types.UnionBranch = ((value).branches)[(index)] + let iter_base = address + (index * 92); + __wit_bindgen_lower_t44((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 4, ((value).branches).length()) + mbt_ffi_store32((ptr) + 0, address) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t47(ptr : Int, value : @types.SecretSpec) -> Unit { + mbt_ffi_store32((ptr) + 0, (value).inner) + + match ((value).category) { + None => { + mbt_ffi_store8((ptr) + 4, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 4, (1)) + + let ptr1 = mbt_ffi_str2ptr(payload0) + mbt_ffi_store32((ptr) + 12, payload0.length()) + mbt_ffi_store32((ptr) + 8, ptr1) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t48(ptr : Int, value : @types.QuotaTokenSpec) -> Unit { + + match ((value).resource_name) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let ptr1 = mbt_ffi_str2ptr(payload0) + mbt_ffi_store32((ptr) + 8, payload0.length()) + mbt_ffi_store32((ptr) + 4, ptr1) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t49(ptr : Int, value : @types.PermissionCardSpec) -> Unit { + mbt_ffi_store8((ptr) + 0, (if (value).polymorphic { 1 } else { 0 })) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t54(ptr : Int, value : @types.SchemaTypeBody) -> Unit { + + match value { + RefType(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + mbt_ffi_store32((ptr) + 8, payload) + + () + } + BoolType => { + mbt_ffi_store8((ptr) + 0, (1)) + + () + } + S8Type(payload1) => { + mbt_ffi_store8((ptr) + 0, (2)) + + match (payload1) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload3) + + () + } + } + + () + } + S16Type(payload4) => { + mbt_ffi_store8((ptr) + 0, (3)) + + match (payload4) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload6) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload6) + + () + } + } + + () + } + S32Type(payload7) => { + mbt_ffi_store8((ptr) + 0, (4)) + + match (payload7) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload9) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload9) + + () + } + } + + () + } + S64Type(payload10) => { + mbt_ffi_store8((ptr) + 0, (5)) + + match (payload10) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload12) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload12) + + () + } + } + + () + } + U8Type(payload13) => { + mbt_ffi_store8((ptr) + 0, (6)) + + match (payload13) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload15) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload15) + + () + } + } + + () + } + U16Type(payload16) => { + mbt_ffi_store8((ptr) + 0, (7)) - for index20 = 0 - index20 < mbt_ffi_load32(iter_base + 36) - index20 = index20 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index20 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + match (payload16) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 76) { - 0 => { - for index23 = 0 - index23 < mbt_ffi_load32(iter_base + 84) - index23 = index23 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 80) + index23 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index21 = 0 - index21 < mbt_ffi_load32(iter_base + 32) - index21 = index21 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index21 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index22 = 0 - index22 < mbt_ffi_load32(iter_base + 40) - index22 = index22 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index22 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() + () + } + Some(payload18) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload18) + + () + } } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 80)) - } - _ => panic() - } - - for index32 = 0 - index32 < mbt_ffi_load32(iter_base + 92) - index32 = index32 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 88) + index32 * 88 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index28 = 0 - index28 < mbt_ffi_load32(iter_base + 20) - index28 = index28 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index28 * 48 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - _ => panic() - } - - for index24 = 0 - index24 < mbt_ffi_load32(iter_base + 16) - index24 = index24 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index24 * 12 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => () - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - for index25 = 0 - index25 < mbt_ffi_load32(iter_base + 24) - index25 = index25 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index25 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - for index26 = 0 - index26 < mbt_ffi_load32(iter_base + 32) - index26 = index26 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index26 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index27 = 0 - index27 < mbt_ffi_load32(iter_base + 44) - index27 = index27 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index27 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - match mbt_ffi_load8_u(iter_base + 36) { - 0 => { - for index31 = 0 - index31 < mbt_ffi_load32(iter_base + 44) - index31 = index31 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index31 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () + } + U32Type(payload19) => { + mbt_ffi_store8((ptr) + 0, (8)) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index29 = 0 - index29 < mbt_ffi_load32(iter_base + 32) - index29 = index29 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index29 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index30 = 0 - index30 < mbt_ffi_load32(iter_base + 40) - index30 = index30 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index30 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + match (payload19) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) + () + } + Some(payload21) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload21) + + () + } + } + + () } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) + U64Type(payload22) => { + mbt_ffi_store8((ptr) + 0, (9)) - for index67 = 0 - index67 < mbt_ffi_load32(iter_base + 100) - index67 = index67 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 96) + index67 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + match (payload22) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - for index53 = 0 - index53 < mbt_ffi_load32(iter_base + 24) - index53 = index53 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index53 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index35 = 0 - index35 < mbt_ffi_load32(iter_base + 12) - index35 = index35 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index35 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + () + } + Some(payload24) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload24) - for index33 = 0 - index33 < mbt_ffi_load32(iter_base + 28) - index33 = index33 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index33 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () + } } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - for index34 = 0 - index34 < mbt_ffi_load32(iter_base + 36) - index34 = index34 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index34 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) + () + } + F32Type(payload25) => { + mbt_ffi_store8((ptr) + 0, (10)) - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } + match (payload25) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() + () + } + Some(payload27) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload27) + + () + } } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index38 = 0 - index38 < mbt_ffi_load32(iter_base + 12) - index38 = index38 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index38 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() + + () + } + F64Type(payload28) => { + mbt_ffi_store8((ptr) + 0, (11)) + + match (payload28) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload30) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload30) + + () + } } - for index36 = 0 - index36 < mbt_ffi_load32(iter_base + 32) - index36 = index36 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index36 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () + } + CharType => { + mbt_ffi_store8((ptr) + 0, (12)) + + () + } + StringType => { + mbt_ffi_store8((ptr) + 0, (13)) + + () + } + RecordType(payload33) => { + mbt_ffi_store8((ptr) + 0, (14)) + + let address = mbt_ffi_malloc((payload33).length() * 68); + for index = 0; index < (payload33).length(); index = index + 1 { + let iter_elem : @types.NamedFieldType = (payload33)[(index)] + let iter_base = address + (index * 68); + __wit_bindgen_lower_t22((iter_base) + 0, iter_elem) + } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + mbt_ffi_store32((ptr) + 12, (payload33).length()) + mbt_ffi_store32((ptr) + 8, address) + + () + } + VariantType(payload34) => { + mbt_ffi_store8((ptr) + 0, (15)) + + let address35 = mbt_ffi_malloc((payload34).length() * 72); + for index36 = 0; index36 < (payload34).length(); index36 = index36 + 1 { + let iter_elem : @types.VariantCaseType = (payload34)[(index36)] + let iter_base = address35 + (index36 * 72); + __wit_bindgen_lower_t24((iter_base) + 0, iter_elem) - for index37 = 0 - index37 < mbt_ffi_load32(iter_base + 40) - index37 = index37 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index37 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) + mbt_ffi_store32((ptr) + 12, (payload34).length()) + mbt_ffi_store32((ptr) + 8, address35) + + () + } + EnumType(payload37) => { + mbt_ffi_store8((ptr) + 0, (16)) + + let address39 = mbt_ffi_malloc((payload37).length() * 8); + for index40 = 0; index40 < (payload37).length(); index40 = index40 + 1 { + let iter_elem : String = (payload37)[(index40)] + let iter_base = address39 + (index40 * 8); + + let ptr38 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr38) - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() } + mbt_ffi_store32((ptr) + 12, (payload37).length()) + mbt_ffi_store32((ptr) + 8, address39) + + () + } + FlagsType(payload41) => { + mbt_ffi_store8((ptr) + 0, (17)) + + let address43 = mbt_ffi_malloc((payload41).length() * 8); + for index44 = 0; index44 < (payload41).length(); index44 = index44 + 1 { + let iter_elem : String = (payload41)[(index44)] + let iter_base = address43 + (index44 * 8); + + let ptr42 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr42) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index39 = 0 - index39 < mbt_ffi_load32(iter_base + 12) - index39 = index39 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index39 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index40 = 0 - index40 < mbt_ffi_load32(iter_base + 12) - index40 = index40 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index40 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index41 = 0 - index41 < mbt_ffi_load32(iter_base + 16) - index41 = index41 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index41 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + mbt_ffi_store32((ptr) + 12, (payload41).length()) + mbt_ffi_store32((ptr) + 8, address43) + + () + } + TupleType(payload45) => { + mbt_ffi_store8((ptr) + 0, (18)) + + let address46 = mbt_ffi_malloc((payload45).length() * 4); + for index47 = 0; index47 < (payload45).length(); index47 = index47 + 1 { + let iter_elem : Int = (payload45)[(index47)] + let iter_base = address46 + (index47 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + } - _ => panic() - } + mbt_ffi_store32((ptr) + 12, (payload45).length()) + mbt_ffi_store32((ptr) + 8, address46) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index42 = 0 - index42 < mbt_ffi_load32(iter_base + 16) - index42 = index42 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index42 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + () + } + ListType(payload48) => { + mbt_ffi_store8((ptr) + 0, (19)) + mbt_ffi_store32((ptr) + 8, payload48) + + () + } + FixedListType(payload49) => { + mbt_ffi_store8((ptr) + 0, (20)) + __wit_bindgen_lower_t25((ptr) + 8, payload49) + + () + } + MapType(payload50) => { + mbt_ffi_store8((ptr) + 0, (21)) + __wit_bindgen_lower_t26((ptr) + 8, payload50) + + () + } + OptionType(payload51) => { + mbt_ffi_store8((ptr) + 0, (22)) + mbt_ffi_store32((ptr) + 8, payload51) + + () + } + ResultType(payload52) => { + mbt_ffi_store8((ptr) + 0, (23)) + __wit_bindgen_lower_t27((ptr) + 8, payload52) + + () + } + TextType(payload53) => { + mbt_ffi_store8((ptr) + 0, (24)) + __wit_bindgen_lower_t33((ptr) + 8, payload53) + + () + } + BinaryType(payload54) => { + mbt_ffi_store8((ptr) + 0, (25)) + __wit_bindgen_lower_t34((ptr) + 8, payload54) + + () + } + PathType(payload55) => { + mbt_ffi_store8((ptr) + 0, (26)) + __wit_bindgen_lower_t37((ptr) + 8, payload55) + + () + } + UrlType(payload56) => { + mbt_ffi_store8((ptr) + 0, (27)) + __wit_bindgen_lower_t38((ptr) + 8, payload56) + + () + } + DatetimeType => { + mbt_ffi_store8((ptr) + 0, (28)) + + () + } + DurationType => { + mbt_ffi_store8((ptr) + 0, (29)) + + () + } + QuantityType(payload59) => { + mbt_ffi_store8((ptr) + 0, (30)) + __wit_bindgen_lower_t41((ptr) + 8, payload59) + + () + } + UnionType(payload60) => { + mbt_ffi_store8((ptr) + 0, (31)) + __wit_bindgen_lower_t46((ptr) + 8, payload60) + + () + } + SecretType(payload61) => { + mbt_ffi_store8((ptr) + 0, (32)) + __wit_bindgen_lower_t47((ptr) + 8, payload61) + + () + } + QuotaTokenType(payload62) => { + mbt_ffi_store8((ptr) + 0, (33)) + __wit_bindgen_lower_t48((ptr) + 8, payload62) + + () + } + PermissionCardType(payload63) => { + mbt_ffi_store8((ptr) + 0, (34)) + __wit_bindgen_lower_t49((ptr) + 8, payload63) + + () + } + FutureType(payload64) => { + mbt_ffi_store8((ptr) + 0, (35)) + + match (payload64) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload66) => { + mbt_ffi_store8((ptr) + 8, (1)) + mbt_ffi_store32((ptr) + 12, payload66) + + () + } } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index43 = 0 - index43 < mbt_ffi_load32(iter_base + 20) - index43 = index43 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index43 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) + + () + } + StreamType(payload67) => { + mbt_ffi_store8((ptr) + 0, (36)) + + match (payload67) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload69) => { + mbt_ffi_store8((ptr) + 8, (1)) + mbt_ffi_store32((ptr) + 12, payload69) + + () + } } - _ => panic() - } - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index44 = 0 - index44 < mbt_ffi_load32(iter_base + 32) - index44 = index44 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index44 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t55(ptr : Int, value : @types.SchemaTypeNode) -> Unit { + __wit_bindgen_lower_t54((ptr) + 0, (value).body) + __wit_bindgen_lower_t21((ptr) + 88, (value).metadata) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t58(ptr : Int, value : @types.SchemaGraph) -> Unit { + + let address = mbt_ffi_malloc(((value).type_nodes).length() * 144); + for index = 0; index < ((value).type_nodes).length(); index = index + 1 { + let iter_elem : @types.SchemaTypeNode = ((value).type_nodes)[(index)] + let iter_base = address + (index * 144); + __wit_bindgen_lower_t55((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 4, ((value).type_nodes).length()) + mbt_ffi_store32((ptr) + 0, address) + + let address0 = mbt_ffi_malloc(((value).defs).length() * 24); + for index1 = 0; index1 < ((value).defs).length(); index1 = index1 + 1 { + let iter_elem : @types.SchemaTypeDef = ((value).defs)[(index1)] + let iter_base = address0 + (index1 * 24); + __wit_bindgen_lower_t17((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 12, ((value).defs).length()) + mbt_ffi_store32((ptr) + 8, address0) + mbt_ffi_store32((ptr) + 16, (value).root) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t60(ptr : Int, value : @types.VariantValuePayload) -> Unit { + mbt_ffi_store32((ptr) + 0, ((value).case).reinterpret_as_int()) + + match ((value).payload) { + None => { + mbt_ffi_store8((ptr) + 4, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 4, (1)) + mbt_ffi_store32((ptr) + 8, payload0) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t61(ptr : Int, value : @types.MapEntry) -> Unit { + mbt_ffi_store32((ptr) + 0, (value).key) + mbt_ffi_store32((ptr) + 4, (value).value) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t62(ptr : Int, value : @types.ResultValuePayload) -> Unit { + + match value { + OkValue(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + + match (payload) { + None => { + mbt_ffi_store8((ptr) + 4, (0)) + + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 4, (1)) + mbt_ffi_store32((ptr) + 8, payload1) + + () + } } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index45 = 0 - index45 < mbt_ffi_load32(iter_base + 16) - index45 = index45 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index45 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + + () + } + ErrValue(payload2) => { + mbt_ffi_store8((ptr) + 0, (1)) + + match (payload2) { + None => { + mbt_ffi_store8((ptr) + 4, (0)) + + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 4, (1)) + mbt_ffi_store32((ptr) + 8, payload4) + + () + } } - _ => panic() - } - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index46 = 0 - index46 < mbt_ffi_load32(iter_base + 28) - index46 = index46 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index46 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index47 = 0 - index47 < mbt_ffi_load32(iter_base + 20) - index47 = index47 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index47 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t63(ptr : Int, value : @types.TextValuePayload) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).text) + mbt_ffi_store32((ptr) + 4, (value).text.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + match ((value).language) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) + + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 16, payload1.length()) + mbt_ffi_store32((ptr) + 12, ptr2) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t65(ptr : Int, value : @types.BinaryValuePayload) -> Unit { + + let ptr0 = mbt_ffi_bytes2ptr((value).bytes) + + mbt_ffi_store32((ptr) + 4, (value).bytes.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + match ((value).mime_type) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) + + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 16, payload1.length()) + mbt_ffi_store32((ptr) + 12, ptr2) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t66(ptr : Int, value : @types.DurationValuePayload) -> Unit { + mbt_ffi_store64((ptr) + 0, (value).nanoseconds) + +} - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index50 = 0 - index50 < mbt_ffi_load32(iter_base + 12) - index50 = index50 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index50 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } +#doc(hidden) +fn __wit_bindgen_lower_t67(ptr : Int, value : @types.UnionValuePayload) -> Unit { - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } + let ptr0 = mbt_ffi_str2ptr((value).tag) + mbt_ffi_store32((ptr) + 4, (value).tag.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + mbt_ffi_store32((ptr) + 8, (value).body) - for index48 = 0 - index48 < mbt_ffi_load32(iter_base + 52) - index48 = index48 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index48 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) +} - for index49 = 0 - index49 < mbt_ffi_load32(iter_base + 60) - index49 = index49 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index49 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) +#doc(hidden) +fn __wit_bindgen_lower_t74(ptr : Int, value : @types.SchemaValueNode) -> Unit { - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } + match value { + BoolValue(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + mbt_ffi_store8((ptr) + 8, (if payload { 1 } else { 0 })) - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() + () } + S8Value(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + mbt_ffi_store8((ptr) + 8, mbt_ffi_extend8(payload0)) - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() + () } + S16Value(payload1) => { + mbt_ffi_store8((ptr) + 0, (2)) + mbt_ffi_store16((ptr) + 8, mbt_ffi_extend16(payload1)) - for index51 = 0 - index51 < mbt_ffi_load32(iter_base + 104) - index51 = index51 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index51 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + S32Value(payload2) => { + mbt_ffi_store8((ptr) + 0, (3)) + mbt_ffi_store32((ptr) + 8, payload2) - for index52 = 0 - index52 < mbt_ffi_load32(iter_base + 112) - index52 = index52 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index52 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) + S64Value(payload3) => { + mbt_ffi_store8((ptr) + 0, (4)) + mbt_ffi_store64((ptr) + 8, payload3) - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() + () } + U8Value(payload4) => { + mbt_ffi_store8((ptr) + 0, (5)) + mbt_ffi_store8((ptr) + 8, (payload4).to_int()) - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() + () } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) + U16Value(payload5) => { + mbt_ffi_store8((ptr) + 0, (6)) + mbt_ffi_store16((ptr) + 8, (payload5).reinterpret_as_int()) - for index54 = 0 - index54 < mbt_ffi_load32(iter_base + 32) - index54 = index54 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index54 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () + } + U32Value(payload6) => { + mbt_ffi_store8((ptr) + 0, (7)) + mbt_ffi_store32((ptr) + 8, (payload6).reinterpret_as_int()) - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() + () } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + U64Value(payload7) => { + mbt_ffi_store8((ptr) + 0, (8)) + mbt_ffi_store64((ptr) + 8, (payload7).reinterpret_as_int64()) - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) + () + } + F32Value(payload8) => { + mbt_ffi_store8((ptr) + 0, (9)) + mbt_ffi_storef32((ptr) + 8, payload8) - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } + () + } + F64Value(payload9) => { + mbt_ffi_store8((ptr) + 0, (10)) + mbt_ffi_storef64((ptr) + 8, payload9) - match mbt_ffi_load8_u(iter_base + 72) { - 0 => { - for index57 = 0 - index57 < mbt_ffi_load32(iter_base + 80) - index57 = index57 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 76) + index57 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () + } + CharValue(payload10) => { + mbt_ffi_store8((ptr) + 0, (11)) + mbt_ffi_store32((ptr) + 8, (payload10).to_int()) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index55 = 0 - index55 < mbt_ffi_load32(iter_base + 32) - index55 = index55 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index55 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index56 = 0 - index56 < mbt_ffi_load32(iter_base + 40) - index56 = index56 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index56 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + () + } + StringValue(payload11) => { + mbt_ffi_store8((ptr) + 0, (12)) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) + let ptr12 = mbt_ffi_str2ptr(payload11) + mbt_ffi_store32((ptr) + 12, payload11.length()) + mbt_ffi_store32((ptr) + 8, ptr12) + + () } - _ => panic() - } - - for index66 = 0 - index66 < mbt_ffi_load32(iter_base + 88) - index66 = index66 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 84) + index66 * 88 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index62 = 0 - index62 < mbt_ffi_load32(iter_base + 20) - index62 = index62 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index62 * 48 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - _ => panic() - } - - for index58 = 0 - index58 < mbt_ffi_load32(iter_base + 16) - index58 = index58 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index58 * 12 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => () - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - for index59 = 0 - index59 < mbt_ffi_load32(iter_base + 24) - index59 = index59 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index59 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - for index60 = 0 - index60 < mbt_ffi_load32(iter_base + 32) - index60 = index60 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index60 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index61 = 0 - index61 < mbt_ffi_load32(iter_base + 44) - index61 = index61 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index61 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => { - for index65 = 0 - index65 < mbt_ffi_load32(iter_base + 44) - index65 = index65 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index65 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + RecordValue(payload13) => { + mbt_ffi_store8((ptr) + 0, (13)) - for index63 = 0 - index63 < mbt_ffi_load32(iter_base + 32) - index63 = index63 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index63 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let address = mbt_ffi_malloc((payload13).length() * 4); + for index = 0; index < (payload13).length(); index = index + 1 { + let iter_elem : Int = (payload13)[(index)] + let iter_base = address + (index * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - for index64 = 0 - index64 < mbt_ffi_load32(iter_base + 40) - index64 = index64 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index64 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) + mbt_ffi_store32((ptr) + 12, (payload13).length()) + mbt_ffi_store32((ptr) + 8, address) - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + () + } + VariantValue(payload14) => { + mbt_ffi_store8((ptr) + 0, (14)) + __wit_bindgen_lower_t60((ptr) + 8, payload14) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 96)) - - match mbt_ffi_load8_u(iter_base + 108) { - 0 => () - 1 => { - for index68 = 0 - index68 < mbt_ffi_load32(iter_base + 116) - index68 = index68 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 112) + index68 * 12 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => () - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 112)) - - for index69 = 0 - index69 < mbt_ffi_load32(iter_base + 128) - index69 = index69 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 124) + index69 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 124)) - - for index70 = 0 - index70 < mbt_ffi_load32(iter_base + 136) - index70 = index70 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 132) + index70 * 12 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => () - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 132)) - } - _ => panic() - } - - for index72 = 0 - index72 < mbt_ffi_load32(iter_base + 172) - index72 = index72 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 168) + index72 * 16 - - for index71 = 0 - index71 < mbt_ffi_load32(iter_base + 8) - index71 = index71 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index71 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 168)) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 4)) - } - 1 => - match mbt_ffi_load8_u(p0 + 4) { - 0 => mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - 1 => mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - 2 => mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - 3 => mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - 4 => { - for index94 = 0 - index94 < mbt_ffi_load32(p0 + 12) - index94 = index94 + 1 { - let iter_base = mbt_ffi_load32(p0 + 8) + index94 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index76 = 0 - index76 < mbt_ffi_load32(iter_base + 12) - index76 = index76 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index76 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + () + } + EnumValue(payload15) => { + mbt_ffi_store8((ptr) + 0, (15)) + mbt_ffi_store32((ptr) + 8, (payload15).reinterpret_as_int()) - for index74 = 0 - index74 < mbt_ffi_load32(iter_base + 28) - index74 = index74 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index74 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + () + } + FlagsValue(payload16) => { + mbt_ffi_store8((ptr) + 0, (16)) - for index75 = 0 - index75 < mbt_ffi_load32(iter_base + 36) - index75 = index75 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index75 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) + let address17 = mbt_ffi_malloc((payload16).length() * 1); + for index18 = 0; index18 < (payload16).length(); index18 = index18 + 1 { + let iter_elem : Bool = (payload16)[(index18)] + let iter_base = address17 + (index18 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() } + mbt_ffi_store32((ptr) + 12, (payload16).length()) + mbt_ffi_store32((ptr) + 8, address17) - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index79 = 0 - index79 < mbt_ffi_load32(iter_base + 12) - index79 = index79 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index79 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + () + } + TupleValue(payload19) => { + mbt_ffi_store8((ptr) + 0, (17)) - for index77 = 0 - index77 < mbt_ffi_load32(iter_base + 32) - index77 = index77 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index77 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let address20 = mbt_ffi_malloc((payload19).length() * 4); + for index21 = 0; index21 < (payload19).length(); index21 = index21 + 1 { + let iter_elem : Int = (payload19)[(index21)] + let iter_base = address20 + (index21 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - for index78 = 0 - index78 < mbt_ffi_load32(iter_base + 40) - index78 = index78 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index78 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) + mbt_ffi_store32((ptr) + 12, (payload19).length()) + mbt_ffi_store32((ptr) + 8, address20) - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + () + } + ListValue(payload22) => { + mbt_ffi_store8((ptr) + 0, (18)) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index80 = 0 - index80 < mbt_ffi_load32(iter_base + 12) - index80 = index80 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index80 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index81 = 0 - index81 < mbt_ffi_load32(iter_base + 12) - index81 = index81 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index81 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index82 = 0 - index82 < mbt_ffi_load32(iter_base + 16) - index82 = index82 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index82 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } + let address23 = mbt_ffi_malloc((payload22).length() * 4); + for index24 = 0; index24 < (payload22).length(); index24 = index24 + 1 { + let iter_elem : Int = (payload22)[(index24)] + let iter_base = address23 + (index24 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index83 = 0 - index83 < mbt_ffi_load32(iter_base + 16) - index83 = index83 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index83 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index84 = 0 - index84 < mbt_ffi_load32(iter_base + 20) - index84 = index84 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index84 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) } - _ => panic() - } + mbt_ffi_store32((ptr) + 12, (payload22).length()) + mbt_ffi_store32((ptr) + 8, address23) - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index85 = 0 - index85 < mbt_ffi_load32(iter_base + 32) - index85 = index85 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index85 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index86 = 0 - index86 < mbt_ffi_load32(iter_base + 16) - index86 = index86 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index86 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } + () + } + FixedListValue(payload25) => { + mbt_ffi_store8((ptr) + 0, (19)) - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index87 = 0 - index87 < mbt_ffi_load32(iter_base + 28) - index87 = index87 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index87 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index88 = 0 - index88 < mbt_ffi_load32(iter_base + 20) - index88 = index88 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index88 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } + let address26 = mbt_ffi_malloc((payload25).length() * 4); + for index27 = 0; index27 < (payload25).length(); index27 = index27 + 1 { + let iter_elem : Int = (payload25)[(index27)] + let iter_base = address26 + (index27 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index91 = 0 - index91 < mbt_ffi_load32(iter_base + 12) - index91 = index91 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index91 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() } + mbt_ffi_store32((ptr) + 12, (payload25).length()) + mbt_ffi_store32((ptr) + 8, address26) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } + () + } + MapValue(payload28) => { + mbt_ffi_store8((ptr) + 0, (20)) - for index89 = 0 - index89 < mbt_ffi_load32(iter_base + 52) - index89 = index89 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index89 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let address29 = mbt_ffi_malloc((payload28).length() * 8); + for index30 = 0; index30 < (payload28).length(); index30 = index30 + 1 { + let iter_elem : @types.MapEntry = (payload28)[(index30)] + let iter_base = address29 + (index30 * 8); + __wit_bindgen_lower_t61((iter_base) + 0, iter_elem) - for index90 = 0 - index90 < mbt_ffi_load32(iter_base + 60) - index90 = index90 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index90 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) + mbt_ffi_store32((ptr) + 12, (payload28).length()) + mbt_ffi_store32((ptr) + 8, address29) - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } + () + } + OptionValue(payload31) => { + mbt_ffi_store8((ptr) + 0, (21)) - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() + match (payload31) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload33) => { + mbt_ffi_store8((ptr) + 8, (1)) + mbt_ffi_store32((ptr) + 12, payload33) + + () + } } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() + + () } + ResultValue(payload34) => { + mbt_ffi_store8((ptr) + 0, (22)) + __wit_bindgen_lower_t62((ptr) + 8, payload34) - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() + () } + TextValue(payload35) => { + mbt_ffi_store8((ptr) + 0, (23)) + __wit_bindgen_lower_t63((ptr) + 8, payload35) - for index92 = 0 - index92 < mbt_ffi_load32(iter_base + 104) - index92 = index92 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index92 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + BinaryValue(payload36) => { + mbt_ffi_store8((ptr) + 0, (24)) + __wit_bindgen_lower_t65((ptr) + 8, payload36) - for index93 = 0 - index93 < mbt_ffi_load32(iter_base + 112) - index93 = index93 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index93 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) + PathValue(payload37) => { + mbt_ffi_store8((ptr) + 0, (25)) + + let ptr38 = mbt_ffi_str2ptr(payload37) + mbt_ffi_store32((ptr) + 12, payload37.length()) + mbt_ffi_store32((ptr) + 8, ptr38) - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() + () } + UrlValue(payload39) => { + mbt_ffi_store8((ptr) + 0, (26)) - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - - for index95 = 0 - index95 < mbt_ffi_load32(p0 + 20) - index95 = index95 + 1 { - let iter_base = mbt_ffi_load32(p0 + 16) + index95 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 16)) - - for index96 = 0 - index96 < mbt_ffi_load32(p0 + 32) - index96 = index96 + 1 { - let iter_base = mbt_ffi_load32(p0 + 28) + index96 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let ptr40 = mbt_ffi_str2ptr(payload39) + mbt_ffi_store32((ptr) + 12, payload39.length()) + mbt_ffi_store32((ptr) + 8, ptr40) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 28)) - } - _ => panic() + () + } + DatetimeValue(payload41) => { + mbt_ffi_store8((ptr) + 0, (27)) + __wit_bindgen_lower_t5((ptr) + 8, payload41) + + () + } + DurationValue(payload42) => { + mbt_ffi_store8((ptr) + 0, (28)) + __wit_bindgen_lower_t66((ptr) + 8, payload42) + + () + } + QuantityValueNode(payload43) => { + mbt_ffi_store8((ptr) + 0, (29)) + __wit_bindgen_lower_t39((ptr) + 8, payload43) + + () + } + UnionValue(payload44) => { + mbt_ffi_store8((ptr) + 0, (30)) + __wit_bindgen_lower_t67((ptr) + 8, payload44) + + () + } + SecretValue(payload45) => { + mbt_ffi_store8((ptr) + 0, (31)) + + let @types.Secret(handle) = payload45 + mbt_ffi_store32((ptr) + 8, handle) + + () + } + QuotaTokenHandle(payload46) => { + mbt_ffi_store8((ptr) + 0, (32)) + + let @types.QuotaToken(handle47) = payload46 + mbt_ffi_store32((ptr) + 8, handle47) + + () + } + PermissionCardHandle(payload48) => { + mbt_ffi_store8((ptr) + 0, (33)) + + let @types.PermissionCard(handle49) = payload48 + mbt_ffi_store32((ptr) + 8, handle49) + + () + } } - _ => panic() - } + } -///| #doc(hidden) -fn __wit_bindgen_lower_t5(ptr : Int, value : @types.Datetime) -> Unit { - mbt_ffi_store64(ptr + 0, value.seconds) - mbt_ffi_store32(ptr + 8, value.nanoseconds.reinterpret_as_int()) +fn __wit_bindgen_lower_t76(ptr : Int, value : @types.SchemaValueTree) -> Unit { + + let address = mbt_ffi_malloc(((value).value_nodes).length() * 32); + for index = 0; index < ((value).value_nodes).length(); index = index + 1 { + let iter_elem : @types.SchemaValueNode = ((value).value_nodes)[(index)] + let iter_base = address + (index * 32); + __wit_bindgen_lower_t74((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 4, ((value).value_nodes).length()) + mbt_ffi_store32((ptr) + 0, address) + mbt_ffi_store32((ptr) + 8, (value).root) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t16(ptr : Int, value : @types.SchemaTypeDef) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.id) - mbt_ffi_store32(ptr + 4, value.id.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - match value.name { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 16, payload1.length()) - mbt_ffi_store32(ptr + 12, ptr2) - - () - } - } - mbt_ffi_store32(ptr + 20, value.body) +fn __wit_bindgen_lower_t77(ptr : Int, value : @types.TypedSchemaValue) -> Unit { + __wit_bindgen_lower_t58((ptr) + 0, (value).graph) + __wit_bindgen_lower_t76((ptr) + 20, (value).value) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t17(ptr : Int, value : @types.Role) -> Unit { - match value { - Multimodal => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(ptr + 0, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(ptr + 0, 2) - - () - } - Other(payload2) => { - mbt_ffi_store8(ptr + 0, 3) - - let ptr3 = mbt_ffi_str2ptr(payload2) - mbt_ffi_store32(ptr + 8, payload2.length()) - mbt_ffi_store32(ptr + 4, ptr3) - - () - } - } +fn __wit_bindgen_lower_t358(ptr : Int, value : @common.FieldSource) -> Unit { + + match value { + UserSupplied => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + AutoInjected(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + mbt_ffi_store8((ptr) + 1, payload0.ordinal()) + + () + } + } + } -///| #doc(hidden) -fn __wit_bindgen_lower_t20(ptr : Int, value : @types.MetadataEnvelope) -> Unit { - match value.doc { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - let ptr1 = mbt_ffi_str2ptr(payload0) - mbt_ffi_store32(ptr + 8, payload0.length()) - mbt_ffi_store32(ptr + 4, ptr1) - - () - } - } - - let address = mbt_ffi_malloc(value.aliases.length() * 8) - for index = 0; index < value.aliases.length(); index = index + 1 { - let iter_elem : String = value.aliases[index] - let iter_base = address + index * 8 - - let ptr2 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr2) - } - mbt_ffi_store32(ptr + 16, value.aliases.length()) - mbt_ffi_store32(ptr + 12, address) - - let address4 = mbt_ffi_malloc(value.examples.length() * 8) - for index5 = 0; index5 < value.examples.length(); index5 = index5 + 1 { - let iter_elem : String = value.examples[index5] - let iter_base = address4 + index5 * 8 - - let ptr3 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr3) - } - mbt_ffi_store32(ptr + 24, value.examples.length()) - mbt_ffi_store32(ptr + 20, address4) - - match value.deprecated { - None => { - mbt_ffi_store8(ptr + 28, 0) - - () - } - Some(payload7) => { - mbt_ffi_store8(ptr + 28, 1) - - let ptr8 = mbt_ffi_str2ptr(payload7) - mbt_ffi_store32(ptr + 36, payload7.length()) - mbt_ffi_store32(ptr + 32, ptr8) - - () - } - } - - match value.role { - None => { - mbt_ffi_store8(ptr + 40, 0) - - () - } - Some(payload10) => { - mbt_ffi_store8(ptr + 40, 1) - __wit_bindgen_lower_t17(ptr + 44, payload10) - - () - } - } +fn __wit_bindgen_lower_t359(ptr : Int, value : @common.NamedField) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).name) + mbt_ffi_store32((ptr) + 4, (value).name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + __wit_bindgen_lower_t358((ptr) + 8, (value).source) + mbt_ffi_store32((ptr) + 12, (value).schema) + __wit_bindgen_lower_t21((ptr) + 16, (value).metadata) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t21(ptr : Int, value : @types.NamedFieldType) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.name) - mbt_ffi_store32(ptr + 4, value.name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - mbt_ffi_store32(ptr + 8, value.body) - __wit_bindgen_lower_t20(ptr + 12, value.metadata) +fn __wit_bindgen_lower_t361(ptr : Int, value : @common.InputSchema) -> Unit { + + match value { + Parameters(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + + let address = mbt_ffi_malloc((payload).length() * 72); + for index = 0; index < (payload).length(); index = index + 1 { + let iter_elem : @common.NamedField = (payload)[(index)] + let iter_base = address + (index * 72); + __wit_bindgen_lower_t359((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 8, (payload).length()) + mbt_ffi_store32((ptr) + 4, address) + + () + } + } + } -///| #doc(hidden) -fn __wit_bindgen_lower_t23(ptr : Int, value : @types.VariantCaseType) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.name) - mbt_ffi_store32(ptr + 4, value.name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - match value.payload { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) - mbt_ffi_store32(ptr + 12, payload1) - - () - } - } - __wit_bindgen_lower_t20(ptr + 16, value.metadata) +fn __wit_bindgen_lower_t362(ptr : Int, value : @common.OutputSchema) -> Unit { + + match value { + Unit => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Single(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + mbt_ffi_store32((ptr) + 4, payload0) + + () + } + } + } -///| #doc(hidden) -fn __wit_bindgen_lower_t24(ptr : Int, value : @types.FixedListSpec) -> Unit { - mbt_ffi_store32(ptr + 0, value.element) - mbt_ffi_store32(ptr + 4, value.length.reinterpret_as_int()) +fn __wit_bindgen_lower_t363(ptr : Int, value : @common.CachePolicy) -> Unit { + + match value { + NoCache => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + UntilWrite => { + mbt_ffi_store8((ptr) + 0, (1)) + + () + } + Ttl(payload1) => { + mbt_ffi_store8((ptr) + 0, (2)) + mbt_ffi_store64((ptr) + 8, (payload1).reinterpret_as_int64()) + + () + } + } + } -///| #doc(hidden) -fn __wit_bindgen_lower_t25(ptr : Int, value : @types.MapSpec) -> Unit { - mbt_ffi_store32(ptr + 0, value.key) - mbt_ffi_store32(ptr + 4, value.value) +fn __wit_bindgen_lower_t364(ptr : Int, value : @common.ReadOnlyConfig) -> Unit { + __wit_bindgen_lower_t363((ptr) + 0, (value).cache_policy) + mbt_ffi_store8((ptr) + 16, (if (value).uses_principal { 1 } else { 0 })) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t26(ptr : Int, value : @types.ResultSpec) -> Unit { - match value.ok { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - mbt_ffi_store32(ptr + 4, payload0) - - () - } - } - - match value.err { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload2) => { - mbt_ffi_store8(ptr + 8, 1) - mbt_ffi_store32(ptr + 12, payload2) - - () - } - } +fn __wit_bindgen_lower_t366(ptr : Int, value : @common.CorsOptions) -> Unit { + + let address = mbt_ffi_malloc(((value).allowed_patterns).length() * 8); + for index = 0; index < ((value).allowed_patterns).length(); index = index + 1 { + let iter_elem : String = ((value).allowed_patterns)[(index)] + let iter_base = address + (index * 8); + + let ptr0 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr0) + + } + mbt_ffi_store32((ptr) + 4, ((value).allowed_patterns).length()) + mbt_ffi_store32((ptr) + 0, address) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t27(ptr : Int, value : @types.NumericBound) -> Unit { - match value { - Signed(payload) => { - mbt_ffi_store8(ptr + 0, 0) - mbt_ffi_store64(ptr + 8, payload) - - () - } - Unsigned(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - mbt_ffi_store64(ptr + 8, payload0.reinterpret_as_int64()) - - () - } - FloatBits(payload1) => { - mbt_ffi_store8(ptr + 0, 2) - mbt_ffi_store64(ptr + 8, payload1.reinterpret_as_int64()) - - () - } - } -} +fn __wit_bindgen_lower_t367(ptr : Int, value : @common.HttpMethod) -> Unit { + + match value { + Get => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Head => { + mbt_ffi_store8((ptr) + 0, (1)) + + () + } + Post => { + mbt_ffi_store8((ptr) + 0, (2)) + + () + } + Put => { + mbt_ffi_store8((ptr) + 0, (3)) + + () + } + Delete => { + mbt_ffi_store8((ptr) + 0, (4)) + + () + } + Connect => { + mbt_ffi_store8((ptr) + 0, (5)) + + () + } + Options => { + mbt_ffi_store8((ptr) + 0, (6)) + + () + } + Trace => { + mbt_ffi_store8((ptr) + 0, (7)) + + () + } + Patch => { + mbt_ffi_store8((ptr) + 0, (8)) + + () + } + Custom(payload8) => { + mbt_ffi_store8((ptr) + 0, (9)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t29( - ptr : Int, - value : @types.NumericRestrictions, -) -> Unit { - match value.min { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - __wit_bindgen_lower_t27(ptr + 8, payload0) - - () - } - } - - match value.max { - None => { - mbt_ffi_store8(ptr + 24, 0) - - () - } - Some(payload2) => { - mbt_ffi_store8(ptr + 24, 1) - __wit_bindgen_lower_t27(ptr + 32, payload2) - - () - } - } - - match value.unit { - None => { - mbt_ffi_store8(ptr + 48, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 48, 1) - - let ptr5 = mbt_ffi_str2ptr(payload4) - mbt_ffi_store32(ptr + 56, payload4.length()) - mbt_ffi_store32(ptr + 52, ptr5) - - () - } - } -} + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((ptr) + 8, payload8.length()) + mbt_ffi_store32((ptr) + 4, ptr9) -///| -#doc(hidden) -fn __wit_bindgen_lower_t32(ptr : Int, value : @types.TextRestrictions) -> Unit { - match value.languages { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - let address = mbt_ffi_malloc(payload0.length() * 8) - for index = 0; index < payload0.length(); index = index + 1 { - let iter_elem : String = payload0[index] - let iter_base = address + index * 8 - - let ptr1 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr1) + () + } } - mbt_ffi_store32(ptr + 8, payload0.length()) - mbt_ffi_store32(ptr + 4, address) - - () - } - } - - match value.min_length { - None => { - mbt_ffi_store8(ptr + 12, 0) - - () - } - Some(payload3) => { - mbt_ffi_store8(ptr + 12, 1) - mbt_ffi_store32(ptr + 16, payload3.reinterpret_as_int()) - - () - } - } - - match value.max_length { - None => { - mbt_ffi_store8(ptr + 20, 0) - - () - } - Some(payload5) => { - mbt_ffi_store8(ptr + 20, 1) - mbt_ffi_store32(ptr + 24, payload5.reinterpret_as_int()) - - () - } - } - - match value.regex { - None => { - mbt_ffi_store8(ptr + 28, 0) - - () - } - Some(payload7) => { - mbt_ffi_store8(ptr + 28, 1) - - let ptr8 = mbt_ffi_str2ptr(payload7) - mbt_ffi_store32(ptr + 36, payload7.length()) - mbt_ffi_store32(ptr + 32, ptr8) - - () - } - } -} -///| -#doc(hidden) -fn __wit_bindgen_lower_t33( - ptr : Int, - value : @types.BinaryRestrictions, -) -> Unit { - match value.mime_types { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - let address = mbt_ffi_malloc(payload0.length() * 8) - for index = 0; index < payload0.length(); index = index + 1 { - let iter_elem : String = payload0[index] - let iter_base = address + index * 8 - - let ptr1 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr1) - } - mbt_ffi_store32(ptr + 8, payload0.length()) - mbt_ffi_store32(ptr + 4, address) - - () - } - } - - match value.min_bytes { - None => { - mbt_ffi_store8(ptr + 12, 0) - - () - } - Some(payload3) => { - mbt_ffi_store8(ptr + 12, 1) - mbt_ffi_store32(ptr + 16, payload3.reinterpret_as_int()) - - () - } - } - - match value.max_bytes { - None => { - mbt_ffi_store8(ptr + 20, 0) - - () - } - Some(payload5) => { - mbt_ffi_store8(ptr + 20, 1) - mbt_ffi_store32(ptr + 24, payload5.reinterpret_as_int()) - - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t36(ptr : Int, value : @types.PathSpec) -> Unit { - mbt_ffi_store8(ptr + 0, value.direction.ordinal()) - mbt_ffi_store8(ptr + 1, value.kind.ordinal()) - - match value.allowed_mime_types { - None => { - mbt_ffi_store8(ptr + 4, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 4, 1) - - let address = mbt_ffi_malloc(payload0.length() * 8) - for index = 0; index < payload0.length(); index = index + 1 { - let iter_elem : String = payload0[index] - let iter_base = address + index * 8 - - let ptr1 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr1) - } - mbt_ffi_store32(ptr + 12, payload0.length()) - mbt_ffi_store32(ptr + 8, address) - - () - } - } - - match value.allowed_extensions { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload3) => { - mbt_ffi_store8(ptr + 16, 1) - - let address5 = mbt_ffi_malloc(payload3.length() * 8) - for index6 = 0; index6 < payload3.length(); index6 = index6 + 1 { - let iter_elem : String = payload3[index6] - let iter_base = address5 + index6 * 8 - - let ptr4 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr4) - } - mbt_ffi_store32(ptr + 24, payload3.length()) - mbt_ffi_store32(ptr + 20, address5) +fn __wit_bindgen_lower_t369(ptr : Int, value : @common.PathVariable) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).variable_name) + mbt_ffi_store32((ptr) + 4, (value).variable_name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t37(ptr : Int, value : @types.UrlRestrictions) -> Unit { - match value.allowed_schemes { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - let address = mbt_ffi_malloc(payload0.length() * 8) - for index = 0; index < payload0.length(); index = index + 1 { - let iter_elem : String = payload0[index] - let iter_base = address + index * 8 - - let ptr1 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr1) - } - mbt_ffi_store32(ptr + 8, payload0.length()) - mbt_ffi_store32(ptr + 4, address) - - () - } - } - - match value.allowed_hosts { - None => { - mbt_ffi_store8(ptr + 12, 0) - - () - } - Some(payload3) => { - mbt_ffi_store8(ptr + 12, 1) - - let address5 = mbt_ffi_malloc(payload3.length() * 8) - for index6 = 0; index6 < payload3.length(); index6 = index6 + 1 { - let iter_elem : String = payload3[index6] - let iter_base = address5 + index6 * 8 - - let ptr4 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr4) - } - mbt_ffi_store32(ptr + 20, payload3.length()) - mbt_ffi_store32(ptr + 16, address5) +fn __wit_bindgen_lower_t370(ptr : Int, value : @common.PathSegment) -> Unit { - () - } - } -} + match value { + Literal(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t38(ptr : Int, value : @types.QuantityValue) -> Unit { - mbt_ffi_store64(ptr + 0, value.mantissa) - mbt_ffi_store32(ptr + 8, value.scale) + let ptr0 = mbt_ffi_str2ptr(payload) + mbt_ffi_store32((ptr) + 8, payload.length()) + mbt_ffi_store32((ptr) + 4, ptr0) - let ptr0 = mbt_ffi_str2ptr(value.unit) - mbt_ffi_store32(ptr + 16, value.unit.length()) - mbt_ffi_store32(ptr + 12, ptr0) -} + () + } + SystemVariable(payload1) => { + mbt_ffi_store8((ptr) + 0, (1)) + mbt_ffi_store8((ptr) + 4, payload1.ordinal()) -///| -#doc(hidden) -fn __wit_bindgen_lower_t40(ptr : Int, value : @types.QuantitySpec) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.base_unit) - mbt_ffi_store32(ptr + 4, value.base_unit.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - let address = mbt_ffi_malloc(value.allowed_suffixes.length() * 8) - for index = 0; index < value.allowed_suffixes.length(); index = index + 1 { - let iter_elem : String = value.allowed_suffixes[index] - let iter_base = address + index * 8 - - let ptr1 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr1) - } - mbt_ffi_store32(ptr + 12, value.allowed_suffixes.length()) - mbt_ffi_store32(ptr + 8, address) - - match value.min { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload2) => { - mbt_ffi_store8(ptr + 16, 1) - __wit_bindgen_lower_t38(ptr + 24, payload2) - - () - } - } - - match value.max { - None => { - mbt_ffi_store8(ptr + 48, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 48, 1) - __wit_bindgen_lower_t38(ptr + 56, payload4) - - () - } - } -} + () + } + PathVariable(payload2) => { + mbt_ffi_store8((ptr) + 0, (2)) + __wit_bindgen_lower_t369((ptr) + 4, payload2) -///| -#doc(hidden) -fn __wit_bindgen_lower_t41( - ptr : Int, - value : @types.FieldDiscriminator, -) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.field_name) - mbt_ffi_store32(ptr + 4, value.field_name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - match value.literal { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 16, payload1.length()) - mbt_ffi_store32(ptr + 12, ptr2) - - () - } - } -} + () + } + RemainingPathVariable(payload3) => { + mbt_ffi_store8((ptr) + 0, (3)) + __wit_bindgen_lower_t369((ptr) + 4, payload3) -///| -#doc(hidden) -fn __wit_bindgen_lower_t42(ptr : Int, value : @types.DiscriminatorRule) -> Unit { - match value { - Prefix(payload) => { - mbt_ffi_store8(ptr + 0, 0) - - let ptr0 = mbt_ffi_str2ptr(payload) - mbt_ffi_store32(ptr + 8, payload.length()) - mbt_ffi_store32(ptr + 4, ptr0) - - () - } - Suffix(payload1) => { - mbt_ffi_store8(ptr + 0, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 8, payload1.length()) - mbt_ffi_store32(ptr + 4, ptr2) - - () - } - Contains(payload3) => { - mbt_ffi_store8(ptr + 0, 2) - - let ptr4 = mbt_ffi_str2ptr(payload3) - mbt_ffi_store32(ptr + 8, payload3.length()) - mbt_ffi_store32(ptr + 4, ptr4) - - () - } - Regex(payload5) => { - mbt_ffi_store8(ptr + 0, 3) - - let ptr6 = mbt_ffi_str2ptr(payload5) - mbt_ffi_store32(ptr + 8, payload5.length()) - mbt_ffi_store32(ptr + 4, ptr6) - - () - } - FieldEquals(payload7) => { - mbt_ffi_store8(ptr + 0, 4) - __wit_bindgen_lower_t41(ptr + 4, payload7) - - () - } - FieldAbsent(payload8) => { - mbt_ffi_store8(ptr + 0, 5) - - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(ptr + 8, payload8.length()) - mbt_ffi_store32(ptr + 4, ptr9) - - () - } - } -} + () + } + } -///| -#doc(hidden) -fn __wit_bindgen_lower_t43(ptr : Int, value : @types.UnionBranch) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.tag) - mbt_ffi_store32(ptr + 4, value.tag.length()) - mbt_ffi_store32(ptr + 0, ptr0) - mbt_ffi_store32(ptr + 8, value.body) - __wit_bindgen_lower_t42(ptr + 12, value.discriminator) - __wit_bindgen_lower_t20(ptr + 36, value.metadata) } -///| #doc(hidden) -fn __wit_bindgen_lower_t45(ptr : Int, value : @types.UnionSpec) -> Unit { - let address = mbt_ffi_malloc(value.branches.length() * 92) - for index = 0; index < value.branches.length(); index = index + 1 { - let iter_elem : @types.UnionBranch = value.branches[index] - let iter_base = address + index * 92 - __wit_bindgen_lower_t43(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 4, value.branches.length()) - mbt_ffi_store32(ptr + 0, address) +fn __wit_bindgen_lower_t371(ptr : Int, value : @common.HeaderVariable) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).header_name) + mbt_ffi_store32((ptr) + 4, (value).header_name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + let ptr1 = mbt_ffi_str2ptr((value).variable_name) + mbt_ffi_store32((ptr) + 12, (value).variable_name.length()) + mbt_ffi_store32((ptr) + 8, ptr1) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t46(ptr : Int, value : @types.SecretSpec) -> Unit { - mbt_ffi_store32(ptr + 0, value.inner) - - match value.category { - None => { - mbt_ffi_store8(ptr + 4, 0) +fn __wit_bindgen_lower_t372(ptr : Int, value : @common.QueryVariable) -> Unit { - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 4, 1) + let ptr0 = mbt_ffi_str2ptr((value).query_param_name) + mbt_ffi_store32((ptr) + 4, (value).query_param_name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) - let ptr1 = mbt_ffi_str2ptr(payload0) - mbt_ffi_store32(ptr + 12, payload0.length()) - mbt_ffi_store32(ptr + 8, ptr1) + let ptr1 = mbt_ffi_str2ptr((value).variable_name) + mbt_ffi_store32((ptr) + 12, (value).variable_name.length()) + mbt_ffi_store32((ptr) + 8, ptr1) - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t47(ptr : Int, value : @types.QuotaTokenSpec) -> Unit { - match value.resource_name { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - let ptr1 = mbt_ffi_str2ptr(payload0) - mbt_ffi_store32(ptr + 8, payload0.length()) - mbt_ffi_store32(ptr + 4, ptr1) - - () - } - } +fn __wit_bindgen_lower_t373(ptr : Int, value : @common.AuthDetails) -> Unit { + mbt_ffi_store8((ptr) + 0, (if (value).required { 1 } else { 0 })) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t52(ptr : Int, value : @types.SchemaTypeBody) -> Unit { - match value { - RefType(payload) => { - mbt_ffi_store8(ptr + 0, 0) - mbt_ffi_store32(ptr + 8, payload) - - () - } - BoolType => { - mbt_ffi_store8(ptr + 0, 1) - - () - } - S8Type(payload1) => { - mbt_ffi_store8(ptr + 0, 2) - - match payload1 { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload3) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload3) - - () - } - } +fn __wit_bindgen_lower_t376(ptr : Int, value : @common.HttpMountDetails) -> Unit { - () - } - S16Type(payload4) => { - mbt_ffi_store8(ptr + 0, 3) + let address = mbt_ffi_malloc(((value).path_prefix).length() * 12); + for index = 0; index < ((value).path_prefix).length(); index = index + 1 { + let iter_elem : @common.PathSegment = ((value).path_prefix)[(index)] + let iter_base = address + (index * 12); + __wit_bindgen_lower_t370((iter_base) + 0, iter_elem) - match payload4 { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload6) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload6) - - () - } } + mbt_ffi_store32((ptr) + 4, ((value).path_prefix).length()) + mbt_ffi_store32((ptr) + 0, address) - () - } - S32Type(payload7) => { - mbt_ffi_store8(ptr + 0, 4) + match ((value).auth_details) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t373((ptr) + 9, payload0) - match payload7 { - None => { - mbt_ffi_store8(ptr + 8, 0) + () + } + } + mbt_ffi_store8((ptr) + 10, (if (value).phantom_agent { 1 } else { 0 })) + __wit_bindgen_lower_t366((ptr) + 12, (value).cors_options) - () - } - Some(payload9) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload9) + let address1 = mbt_ffi_malloc(((value).webhook_suffix).length() * 12); + for index2 = 0; index2 < ((value).webhook_suffix).length(); index2 = index2 + 1 { + let iter_elem : @common.PathSegment = ((value).webhook_suffix)[(index2)] + let iter_base = address1 + (index2 * 12); + __wit_bindgen_lower_t370((iter_base) + 0, iter_elem) - () - } } + mbt_ffi_store32((ptr) + 24, ((value).webhook_suffix).length()) + mbt_ffi_store32((ptr) + 20, address1) - () - } - S64Type(payload10) => { - mbt_ffi_store8(ptr + 0, 5) +} - match payload10 { - None => { - mbt_ffi_store8(ptr + 8, 0) +#doc(hidden) +fn __wit_bindgen_lower_t379(ptr : Int, value : @common.HttpEndpointDetails) -> Unit { + __wit_bindgen_lower_t367((ptr) + 0, (value).http_method) - () - } - Some(payload12) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload12) + let address = mbt_ffi_malloc(((value).path_suffix).length() * 12); + for index = 0; index < ((value).path_suffix).length(); index = index + 1 { + let iter_elem : @common.PathSegment = ((value).path_suffix)[(index)] + let iter_base = address + (index * 12); + __wit_bindgen_lower_t370((iter_base) + 0, iter_elem) - () - } } + mbt_ffi_store32((ptr) + 16, ((value).path_suffix).length()) + mbt_ffi_store32((ptr) + 12, address) - () - } - U8Type(payload13) => { - mbt_ffi_store8(ptr + 0, 6) + let address0 = mbt_ffi_malloc(((value).header_vars).length() * 16); + for index1 = 0; index1 < ((value).header_vars).length(); index1 = index1 + 1 { + let iter_elem : @common.HeaderVariable = ((value).header_vars)[(index1)] + let iter_base = address0 + (index1 * 16); + __wit_bindgen_lower_t371((iter_base) + 0, iter_elem) - match payload13 { - None => { - mbt_ffi_store8(ptr + 8, 0) + } + mbt_ffi_store32((ptr) + 24, ((value).header_vars).length()) + mbt_ffi_store32((ptr) + 20, address0) - () - } - Some(payload15) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload15) + let address2 = mbt_ffi_malloc(((value).query_vars).length() * 16); + for index3 = 0; index3 < ((value).query_vars).length(); index3 = index3 + 1 { + let iter_elem : @common.QueryVariable = ((value).query_vars)[(index3)] + let iter_base = address2 + (index3 * 16); + __wit_bindgen_lower_t372((iter_base) + 0, iter_elem) - () - } } + mbt_ffi_store32((ptr) + 32, ((value).query_vars).length()) + mbt_ffi_store32((ptr) + 28, address2) - () - } - U16Type(payload16) => { - mbt_ffi_store8(ptr + 0, 7) - - match payload16 { - None => { - mbt_ffi_store8(ptr + 8, 0) + match ((value).auth_details) { + None => { + mbt_ffi_store8((ptr) + 36, (0)) - () - } - Some(payload18) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload18) + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 36, (1)) + __wit_bindgen_lower_t373((ptr) + 37, payload4) - () - } + () + } } + __wit_bindgen_lower_t366((ptr) + 40, (value).cors_options) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t383(ptr : Int, value : @common.AgentMethod) -> Unit { - () - } - U32Type(payload19) => { - mbt_ffi_store8(ptr + 0, 8) + let ptr0 = mbt_ffi_str2ptr((value).name) + mbt_ffi_store32((ptr) + 4, (value).name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) - match payload19 { - None => { - mbt_ffi_store8(ptr + 8, 0) + let ptr1 = mbt_ffi_str2ptr((value).description) + mbt_ffi_store32((ptr) + 12, (value).description.length()) + mbt_ffi_store32((ptr) + 8, ptr1) - () - } - Some(payload21) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload21) + let address = mbt_ffi_malloc(((value).http_endpoint).length() * 48); + for index = 0; index < ((value).http_endpoint).length(); index = index + 1 { + let iter_elem : @common.HttpEndpointDetails = ((value).http_endpoint)[(index)] + let iter_base = address + (index * 48); + __wit_bindgen_lower_t379((iter_base) + 0, iter_elem) - () - } } + mbt_ffi_store32((ptr) + 20, ((value).http_endpoint).length()) + mbt_ffi_store32((ptr) + 16, address) - () - } - U64Type(payload22) => { - mbt_ffi_store8(ptr + 0, 9) + match ((value).prompt_hint) { + None => { + mbt_ffi_store8((ptr) + 24, (0)) - match payload22 { - None => { - mbt_ffi_store8(ptr + 8, 0) + () + } + Some(payload2) => { + mbt_ffi_store8((ptr) + 24, (1)) - () - } - Some(payload24) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload24) + let ptr3 = mbt_ffi_str2ptr(payload2) + mbt_ffi_store32((ptr) + 32, payload2.length()) + mbt_ffi_store32((ptr) + 28, ptr3) - () - } + () + } } + __wit_bindgen_lower_t361((ptr) + 36, (value).input_schema) + __wit_bindgen_lower_t362((ptr) + 48, (value).output_schema) - () - } - F32Type(payload25) => { - mbt_ffi_store8(ptr + 0, 10) + match ((value).read_only) { + None => { + mbt_ffi_store8((ptr) + 56, (0)) - match payload25 { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload27) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload27) + () + } + Some(payload5) => { + mbt_ffi_store8((ptr) + 56, (1)) + __wit_bindgen_lower_t364((ptr) + 64, payload5) - () - } + () + } } - () - } - F64Type(payload28) => { - mbt_ffi_store8(ptr + 0, 11) +} - match payload28 { - None => { - mbt_ffi_store8(ptr + 8, 0) +#doc(hidden) +fn __wit_bindgen_lower_t389(ptr : Int, value : @common.AgentConstructor) -> Unit { - () - } - Some(payload30) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload30) + match ((value).name) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) - () - } - } + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) - () - } - CharType => { - mbt_ffi_store8(ptr + 0, 12) - - () - } - StringType => { - mbt_ffi_store8(ptr + 0, 13) - - () - } - RecordType(payload33) => { - mbt_ffi_store8(ptr + 0, 14) - - let address = mbt_ffi_malloc(payload33.length() * 68) - for index = 0; index < payload33.length(); index = index + 1 { - let iter_elem : @types.NamedFieldType = payload33[index] - let iter_base = address + index * 68 - __wit_bindgen_lower_t21(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload33.length()) - mbt_ffi_store32(ptr + 8, address) - - () - } - VariantType(payload34) => { - mbt_ffi_store8(ptr + 0, 15) - - let address35 = mbt_ffi_malloc(payload34.length() * 72) - for index36 = 0; index36 < payload34.length(); index36 = index36 + 1 { - let iter_elem : @types.VariantCaseType = payload34[index36] - let iter_base = address35 + index36 * 72 - __wit_bindgen_lower_t23(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload34.length()) - mbt_ffi_store32(ptr + 8, address35) - - () - } - EnumType(payload37) => { - mbt_ffi_store8(ptr + 0, 16) - - let address39 = mbt_ffi_malloc(payload37.length() * 8) - for index40 = 0; index40 < payload37.length(); index40 = index40 + 1 { - let iter_elem : String = payload37[index40] - let iter_base = address39 + index40 * 8 - - let ptr38 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr38) - } - mbt_ffi_store32(ptr + 12, payload37.length()) - mbt_ffi_store32(ptr + 8, address39) - - () - } - FlagsType(payload41) => { - mbt_ffi_store8(ptr + 0, 17) - - let address43 = mbt_ffi_malloc(payload41.length() * 8) - for index44 = 0; index44 < payload41.length(); index44 = index44 + 1 { - let iter_elem : String = payload41[index44] - let iter_base = address43 + index44 * 8 - - let ptr42 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr42) - } - mbt_ffi_store32(ptr + 12, payload41.length()) - mbt_ffi_store32(ptr + 8, address43) - - () - } - TupleType(payload45) => { - mbt_ffi_store8(ptr + 0, 18) - - let address46 = mbt_ffi_malloc(payload45.length() * 4) - for index47 = 0; index47 < payload45.length(); index47 = index47 + 1 { - let iter_elem : Int = payload45[index47] - let iter_base = address46 + index47 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload45.length()) - mbt_ffi_store32(ptr + 8, address46) - - () - } - ListType(payload48) => { - mbt_ffi_store8(ptr + 0, 19) - mbt_ffi_store32(ptr + 8, payload48) - - () - } - FixedListType(payload49) => { - mbt_ffi_store8(ptr + 0, 20) - __wit_bindgen_lower_t24(ptr + 8, payload49) - - () - } - MapType(payload50) => { - mbt_ffi_store8(ptr + 0, 21) - __wit_bindgen_lower_t25(ptr + 8, payload50) - - () - } - OptionType(payload51) => { - mbt_ffi_store8(ptr + 0, 22) - mbt_ffi_store32(ptr + 8, payload51) - - () - } - ResultType(payload52) => { - mbt_ffi_store8(ptr + 0, 23) - __wit_bindgen_lower_t26(ptr + 8, payload52) - - () - } - TextType(payload53) => { - mbt_ffi_store8(ptr + 0, 24) - __wit_bindgen_lower_t32(ptr + 8, payload53) - - () - } - BinaryType(payload54) => { - mbt_ffi_store8(ptr + 0, 25) - __wit_bindgen_lower_t33(ptr + 8, payload54) - - () - } - PathType(payload55) => { - mbt_ffi_store8(ptr + 0, 26) - __wit_bindgen_lower_t36(ptr + 8, payload55) - - () - } - UrlType(payload56) => { - mbt_ffi_store8(ptr + 0, 27) - __wit_bindgen_lower_t37(ptr + 8, payload56) - - () - } - DatetimeType => { - mbt_ffi_store8(ptr + 0, 28) - - () - } - DurationType => { - mbt_ffi_store8(ptr + 0, 29) - - () - } - QuantityType(payload59) => { - mbt_ffi_store8(ptr + 0, 30) - __wit_bindgen_lower_t40(ptr + 8, payload59) - - () - } - UnionType(payload60) => { - mbt_ffi_store8(ptr + 0, 31) - __wit_bindgen_lower_t45(ptr + 8, payload60) - - () - } - SecretType(payload61) => { - mbt_ffi_store8(ptr + 0, 32) - __wit_bindgen_lower_t46(ptr + 8, payload61) - - () - } - QuotaTokenType(payload62) => { - mbt_ffi_store8(ptr + 0, 33) - __wit_bindgen_lower_t47(ptr + 8, payload62) - - () - } - FutureType(payload63) => { - mbt_ffi_store8(ptr + 0, 34) - - match payload63 { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload65) => { - mbt_ffi_store8(ptr + 8, 1) - mbt_ffi_store32(ptr + 12, payload65) - - () - } + let ptr1 = mbt_ffi_str2ptr(payload0) + mbt_ffi_store32((ptr) + 8, payload0.length()) + mbt_ffi_store32((ptr) + 4, ptr1) + + () + } } - () - } - StreamType(payload66) => { - mbt_ffi_store8(ptr + 0, 35) + let ptr2 = mbt_ffi_str2ptr((value).description) + mbt_ffi_store32((ptr) + 16, (value).description.length()) + mbt_ffi_store32((ptr) + 12, ptr2) - match payload66 { - None => { - mbt_ffi_store8(ptr + 8, 0) + match ((value).prompt_hint) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) - () - } - Some(payload68) => { - mbt_ffi_store8(ptr + 8, 1) - mbt_ffi_store32(ptr + 12, payload68) + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 20, (1)) + + let ptr5 = mbt_ffi_str2ptr(payload4) + mbt_ffi_store32((ptr) + 28, payload4.length()) + mbt_ffi_store32((ptr) + 24, ptr5) - () - } + () + } } + __wit_bindgen_lower_t361((ptr) + 32, (value).input_schema) - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t53(ptr : Int, value : @types.SchemaTypeNode) -> Unit { - __wit_bindgen_lower_t52(ptr + 0, value.body) - __wit_bindgen_lower_t20(ptr + 88, value.metadata) -} +fn __wit_bindgen_lower_t391(ptr : Int, value : @common.AgentDependency) -> Unit { -///| -#doc(hidden) -fn __wit_bindgen_lower_t56(ptr : Int, value : @types.SchemaGraph) -> Unit { - let address = mbt_ffi_malloc(value.type_nodes.length() * 144) - for index = 0; index < value.type_nodes.length(); index = index + 1 { - let iter_elem : @types.SchemaTypeNode = value.type_nodes[index] - let iter_base = address + index * 144 - __wit_bindgen_lower_t53(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 4, value.type_nodes.length()) - mbt_ffi_store32(ptr + 0, address) - - let address0 = mbt_ffi_malloc(value.defs.length() * 24) - for index1 = 0; index1 < value.defs.length(); index1 = index1 + 1 { - let iter_elem : @types.SchemaTypeDef = value.defs[index1] - let iter_base = address0 + index1 * 24 - __wit_bindgen_lower_t16(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, value.defs.length()) - mbt_ffi_store32(ptr + 8, address0) - mbt_ffi_store32(ptr + 16, value.root) -} + let ptr0 = mbt_ffi_str2ptr((value).type_name) + mbt_ffi_store32((ptr) + 4, (value).type_name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) -///| -#doc(hidden) -fn __wit_bindgen_lower_t58( - ptr : Int, - value : @types.VariantValuePayload, -) -> Unit { - mbt_ffi_store32(ptr + 0, value.case.reinterpret_as_int()) - - match value.payload { - None => { - mbt_ffi_store8(ptr + 4, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 4, 1) - mbt_ffi_store32(ptr + 8, payload0) - - () - } - } -} + match ((value).description) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) + + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 16, payload1.length()) + mbt_ffi_store32((ptr) + 12, ptr2) + + () + } + } + __wit_bindgen_lower_t58((ptr) + 20, (value).schema) + __wit_bindgen_lower_t389((ptr) + 40, (value).constructor_) + + let address = mbt_ffi_malloc(((value).methods).length() * 88); + for index = 0; index < ((value).methods).length(); index = index + 1 { + let iter_elem : @common.AgentMethod = ((value).methods)[(index)] + let iter_base = address + (index * 88); + __wit_bindgen_lower_t383((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 88, ((value).methods).length()) + mbt_ffi_store32((ptr) + 84, address) -///| -#doc(hidden) -fn __wit_bindgen_lower_t59(ptr : Int, value : @types.MapEntry) -> Unit { - mbt_ffi_store32(ptr + 0, value.key) - mbt_ffi_store32(ptr + 4, value.value) } -///| #doc(hidden) -fn __wit_bindgen_lower_t60( - ptr : Int, - value : @types.ResultValuePayload, -) -> Unit { - match value { - OkValue(payload) => { - mbt_ffi_store8(ptr + 0, 0) - - match payload { - None => { - mbt_ffi_store8(ptr + 4, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 4, 1) - mbt_ffi_store32(ptr + 8, payload1) - - () - } - } +fn __wit_bindgen_lower_t392(ptr : Int, value : @common.SnapshottingConfig) -> Unit { - () - } - ErrValue(payload2) => { - mbt_ffi_store8(ptr + 0, 1) + match value { + Default => { + mbt_ffi_store8((ptr) + 0, (0)) - match payload2 { - None => { - mbt_ffi_store8(ptr + 4, 0) + () + } + Periodic(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + mbt_ffi_store64((ptr) + 8, (payload0).reinterpret_as_int64()) - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 4, 1) - mbt_ffi_store32(ptr + 8, payload4) + () + } + EveryNInvocation(payload1) => { + mbt_ffi_store8((ptr) + 0, (2)) + mbt_ffi_store16((ptr) + 8, (payload1).reinterpret_as_int()) - () - } + () + } } - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t61(ptr : Int, value : @types.TextValuePayload) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.text) - mbt_ffi_store32(ptr + 4, value.text.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - match value.language { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 16, payload1.length()) - mbt_ffi_store32(ptr + 12, ptr2) - - () - } - } -} +fn __wit_bindgen_lower_t393(ptr : Int, value : @common.Snapshotting) -> Unit { -///| -#doc(hidden) -fn __wit_bindgen_lower_t63( - ptr : Int, - value : @types.BinaryValuePayload, -) -> Unit { - let ptr0 = mbt_ffi_bytes2ptr(value.bytes) - - mbt_ffi_store32(ptr + 4, value.bytes.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - match value.mime_type { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 16, payload1.length()) - mbt_ffi_store32(ptr + 12, ptr2) - - () - } - } -} + match value { + Disabled => { + mbt_ffi_store8((ptr) + 0, (0)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t64( - ptr : Int, - value : @types.DurationValuePayload, -) -> Unit { - mbt_ffi_store64(ptr + 0, value.nanoseconds) -} + () + } + Enabled(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + __wit_bindgen_lower_t392((ptr) + 8, payload0) + + () + } + } -///| -#doc(hidden) -fn __wit_bindgen_lower_t65(ptr : Int, value : @types.UnionValuePayload) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.tag) - mbt_ffi_store32(ptr + 4, value.tag.length()) - mbt_ffi_store32(ptr + 0, ptr0) - mbt_ffi_store32(ptr + 8, value.body) } -///| #doc(hidden) -fn __wit_bindgen_lower_t71(ptr : Int, value : @types.SchemaValueNode) -> Unit { - match value { - BoolValue(payload) => { - mbt_ffi_store8(ptr + 0, 0) - mbt_ffi_store8(ptr + 8, if payload { 1 } else { 0 }) - - () - } - S8Value(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - mbt_ffi_store8(ptr + 8, mbt_ffi_extend8(payload0)) - - () - } - S16Value(payload1) => { - mbt_ffi_store8(ptr + 0, 2) - mbt_ffi_store16(ptr + 8, mbt_ffi_extend16(payload1)) - - () - } - S32Value(payload2) => { - mbt_ffi_store8(ptr + 0, 3) - mbt_ffi_store32(ptr + 8, payload2) - - () - } - S64Value(payload3) => { - mbt_ffi_store8(ptr + 0, 4) - mbt_ffi_store64(ptr + 8, payload3) - - () - } - U8Value(payload4) => { - mbt_ffi_store8(ptr + 0, 5) - mbt_ffi_store8(ptr + 8, payload4.to_int()) - - () - } - U16Value(payload5) => { - mbt_ffi_store8(ptr + 0, 6) - mbt_ffi_store16(ptr + 8, payload5.reinterpret_as_int()) - - () - } - U32Value(payload6) => { - mbt_ffi_store8(ptr + 0, 7) - mbt_ffi_store32(ptr + 8, payload6.reinterpret_as_int()) - - () - } - U64Value(payload7) => { - mbt_ffi_store8(ptr + 0, 8) - mbt_ffi_store64(ptr + 8, payload7.reinterpret_as_int64()) - - () - } - F32Value(payload8) => { - mbt_ffi_store8(ptr + 0, 9) - mbt_ffi_storef32(ptr + 8, payload8) - - () - } - F64Value(payload9) => { - mbt_ffi_store8(ptr + 0, 10) - mbt_ffi_storef64(ptr + 8, payload9) - - () - } - CharValue(payload10) => { - mbt_ffi_store8(ptr + 0, 11) - mbt_ffi_store32(ptr + 8, payload10.to_int()) - - () - } - StringValue(payload11) => { - mbt_ffi_store8(ptr + 0, 12) - - let ptr12 = mbt_ffi_str2ptr(payload11) - mbt_ffi_store32(ptr + 12, payload11.length()) - mbt_ffi_store32(ptr + 8, ptr12) - - () - } - RecordValue(payload13) => { - mbt_ffi_store8(ptr + 0, 13) - - let address = mbt_ffi_malloc(payload13.length() * 4) - for index = 0; index < payload13.length(); index = index + 1 { - let iter_elem : Int = payload13[index] - let iter_base = address + index * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload13.length()) - mbt_ffi_store32(ptr + 8, address) - - () - } - VariantValue(payload14) => { - mbt_ffi_store8(ptr + 0, 14) - __wit_bindgen_lower_t58(ptr + 8, payload14) - - () - } - EnumValue(payload15) => { - mbt_ffi_store8(ptr + 0, 15) - mbt_ffi_store32(ptr + 8, payload15.reinterpret_as_int()) - - () - } - FlagsValue(payload16) => { - mbt_ffi_store8(ptr + 0, 16) - - let address17 = mbt_ffi_malloc(payload16.length() * 1) - for index18 = 0; index18 < payload16.length(); index18 = index18 + 1 { - let iter_elem : Bool = payload16[index18] - let iter_base = address17 + index18 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(ptr + 12, payload16.length()) - mbt_ffi_store32(ptr + 8, address17) - - () - } - TupleValue(payload19) => { - mbt_ffi_store8(ptr + 0, 17) - - let address20 = mbt_ffi_malloc(payload19.length() * 4) - for index21 = 0; index21 < payload19.length(); index21 = index21 + 1 { - let iter_elem : Int = payload19[index21] - let iter_base = address20 + index21 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload19.length()) - mbt_ffi_store32(ptr + 8, address20) - - () - } - ListValue(payload22) => { - mbt_ffi_store8(ptr + 0, 18) - - let address23 = mbt_ffi_malloc(payload22.length() * 4) - for index24 = 0; index24 < payload22.length(); index24 = index24 + 1 { - let iter_elem : Int = payload22[index24] - let iter_base = address23 + index24 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload22.length()) - mbt_ffi_store32(ptr + 8, address23) - - () - } - FixedListValue(payload25) => { - mbt_ffi_store8(ptr + 0, 19) - - let address26 = mbt_ffi_malloc(payload25.length() * 4) - for index27 = 0; index27 < payload25.length(); index27 = index27 + 1 { - let iter_elem : Int = payload25[index27] - let iter_base = address26 + index27 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload25.length()) - mbt_ffi_store32(ptr + 8, address26) - - () - } - MapValue(payload28) => { - mbt_ffi_store8(ptr + 0, 20) - - let address29 = mbt_ffi_malloc(payload28.length() * 8) - for index30 = 0; index30 < payload28.length(); index30 = index30 + 1 { - let iter_elem : @types.MapEntry = payload28[index30] - let iter_base = address29 + index30 * 8 - __wit_bindgen_lower_t59(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload28.length()) - mbt_ffi_store32(ptr + 8, address29) - - () - } - OptionValue(payload31) => { - mbt_ffi_store8(ptr + 0, 21) - - match payload31 { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload33) => { - mbt_ffi_store8(ptr + 8, 1) - mbt_ffi_store32(ptr + 12, payload33) - - () - } +fn __wit_bindgen_lower_t395(ptr : Int, value : @common.AgentConfigDeclaration) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).source.ordinal()) + + let address = mbt_ffi_malloc(((value).path).length() * 8); + for index = 0; index < ((value).path).length(); index = index + 1 { + let iter_elem : String = ((value).path)[(index)] + let iter_base = address + (index * 8); + + let ptr0 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr0) + } + mbt_ffi_store32((ptr) + 8, ((value).path).length()) + mbt_ffi_store32((ptr) + 4, address) + mbt_ffi_store32((ptr) + 12, (value).value_type) - () - } - ResultValue(payload34) => { - mbt_ffi_store8(ptr + 0, 22) - __wit_bindgen_lower_t60(ptr + 8, payload34) - - () - } - TextValue(payload35) => { - mbt_ffi_store8(ptr + 0, 23) - __wit_bindgen_lower_t61(ptr + 8, payload35) - - () - } - BinaryValue(payload36) => { - mbt_ffi_store8(ptr + 0, 24) - __wit_bindgen_lower_t63(ptr + 8, payload36) - - () - } - PathValue(payload37) => { - mbt_ffi_store8(ptr + 0, 25) - - let ptr38 = mbt_ffi_str2ptr(payload37) - mbt_ffi_store32(ptr + 12, payload37.length()) - mbt_ffi_store32(ptr + 8, ptr38) - - () - } - UrlValue(payload39) => { - mbt_ffi_store8(ptr + 0, 26) - - let ptr40 = mbt_ffi_str2ptr(payload39) - mbt_ffi_store32(ptr + 12, payload39.length()) - mbt_ffi_store32(ptr + 8, ptr40) - - () - } - DatetimeValue(payload41) => { - mbt_ffi_store8(ptr + 0, 27) - __wit_bindgen_lower_t5(ptr + 8, payload41) - - () - } - DurationValue(payload42) => { - mbt_ffi_store8(ptr + 0, 28) - __wit_bindgen_lower_t64(ptr + 8, payload42) - - () - } - QuantityValueNode(payload43) => { - mbt_ffi_store8(ptr + 0, 29) - __wit_bindgen_lower_t38(ptr + 8, payload43) - - () - } - UnionValue(payload44) => { - mbt_ffi_store8(ptr + 0, 30) - __wit_bindgen_lower_t65(ptr + 8, payload44) - - () - } - SecretValue(payload45) => { - mbt_ffi_store8(ptr + 0, 31) - - let @types.Secret(handle) = payload45 - mbt_ffi_store32(ptr + 8, handle) - - () - } - QuotaTokenHandle(payload46) => { - mbt_ffi_store8(ptr + 0, 32) - - let @types.QuotaToken(handle47) = payload46 - mbt_ffi_store32(ptr + 8, handle47) - - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t73(ptr : Int, value : @types.SchemaValueTree) -> Unit { - let address = mbt_ffi_malloc(value.value_nodes.length() * 32) - for index = 0; index < value.value_nodes.length(); index = index + 1 { - let iter_elem : @types.SchemaValueNode = value.value_nodes[index] - let iter_base = address + index * 32 - __wit_bindgen_lower_t71(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 4, value.value_nodes.length()) - mbt_ffi_store32(ptr + 0, address) - mbt_ffi_store32(ptr + 8, value.root) -} +fn __wit_bindgen_lower_t399(ptr : Int, value : @common.AgentType) -> Unit { -///| -#doc(hidden) -fn __wit_bindgen_lower_t74(ptr : Int, value : @types.TypedSchemaValue) -> Unit { - __wit_bindgen_lower_t56(ptr + 0, value.graph) - __wit_bindgen_lower_t73(ptr + 20, value.value) -} + let ptr0 = mbt_ffi_str2ptr((value).type_name) + mbt_ffi_store32((ptr) + 4, (value).type_name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) -///| -#doc(hidden) -fn __wit_bindgen_lower_t361(ptr : Int, value : @common.FieldSource) -> Unit { - match value { - UserSupplied => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - AutoInjected(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - mbt_ffi_store8(ptr + 1, payload0.ordinal()) - - () - } - } -} + let ptr1 = mbt_ffi_str2ptr((value).description) + mbt_ffi_store32((ptr) + 12, (value).description.length()) + mbt_ffi_store32((ptr) + 8, ptr1) -///| -#doc(hidden) -fn __wit_bindgen_lower_t362(ptr : Int, value : @common.NamedField) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.name) - mbt_ffi_store32(ptr + 4, value.name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - __wit_bindgen_lower_t361(ptr + 8, value.source) - mbt_ffi_store32(ptr + 12, value.schema) - __wit_bindgen_lower_t20(ptr + 16, value.metadata) -} + let ptr2 = mbt_ffi_str2ptr((value).source_language) + mbt_ffi_store32((ptr) + 20, (value).source_language.length()) + mbt_ffi_store32((ptr) + 16, ptr2) + __wit_bindgen_lower_t58((ptr) + 24, (value).schema) + __wit_bindgen_lower_t389((ptr) + 44, (value).constructor_) + + let address = mbt_ffi_malloc(((value).methods).length() * 88); + for index = 0; index < ((value).methods).length(); index = index + 1 { + let iter_elem : @common.AgentMethod = ((value).methods)[(index)] + let iter_base = address + (index * 88); + __wit_bindgen_lower_t383((iter_base) + 0, iter_elem) -///| -#doc(hidden) -fn __wit_bindgen_lower_t364(ptr : Int, value : @common.InputSchema) -> Unit { - match value { - Parameters(payload) => { - mbt_ffi_store8(ptr + 0, 0) - - let address = mbt_ffi_malloc(payload.length() * 72) - for index = 0; index < payload.length(); index = index + 1 { - let iter_elem : @common.NamedField = payload[index] - let iter_base = address + index * 72 - __wit_bindgen_lower_t362(iter_base + 0, iter_elem) } - mbt_ffi_store32(ptr + 8, payload.length()) - mbt_ffi_store32(ptr + 4, address) + mbt_ffi_store32((ptr) + 92, ((value).methods).length()) + mbt_ffi_store32((ptr) + 88, address) - () - } - } -} + let address3 = mbt_ffi_malloc(((value).dependencies).length() * 92); + for index4 = 0; index4 < ((value).dependencies).length(); index4 = index4 + 1 { + let iter_elem : @common.AgentDependency = ((value).dependencies)[(index4)] + let iter_base = address3 + (index4 * 92); + __wit_bindgen_lower_t391((iter_base) + 0, iter_elem) -///| -#doc(hidden) -fn __wit_bindgen_lower_t365(ptr : Int, value : @common.OutputSchema) -> Unit { - match value { - Unit => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Single(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - mbt_ffi_store32(ptr + 4, payload0) - - () - } - } -} + } + mbt_ffi_store32((ptr) + 100, ((value).dependencies).length()) + mbt_ffi_store32((ptr) + 96, address3) + mbt_ffi_store8((ptr) + 104, (value).mode.ordinal()) -///| -#doc(hidden) -fn __wit_bindgen_lower_t366(ptr : Int, value : @common.CachePolicy) -> Unit { - match value { - NoCache => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - UntilWrite => { - mbt_ffi_store8(ptr + 0, 1) - - () - } - Ttl(payload1) => { - mbt_ffi_store8(ptr + 0, 2) - mbt_ffi_store64(ptr + 8, payload1.reinterpret_as_int64()) - - () - } - } -} + match ((value).http_mount) { + None => { + mbt_ffi_store8((ptr) + 108, (0)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t367(ptr : Int, value : @common.ReadOnlyConfig) -> Unit { - __wit_bindgen_lower_t366(ptr + 0, value.cache_policy) - mbt_ffi_store8(ptr + 16, if value.uses_principal { 1 } else { 0 }) -} + () + } + Some(payload5) => { + mbt_ffi_store8((ptr) + 108, (1)) + __wit_bindgen_lower_t376((ptr) + 112, payload5) -///| -#doc(hidden) -fn __wit_bindgen_lower_t369(ptr : Int, value : @common.CorsOptions) -> Unit { - let address = mbt_ffi_malloc(value.allowed_patterns.length() * 8) - for index = 0; index < value.allowed_patterns.length(); index = index + 1 { - let iter_elem : String = value.allowed_patterns[index] - let iter_base = address + index * 8 - - let ptr0 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr0) - } - mbt_ffi_store32(ptr + 4, value.allowed_patterns.length()) - mbt_ffi_store32(ptr + 0, address) -} + () + } + } + __wit_bindgen_lower_t393((ptr) + 144, (value).snapshotting) -///| -#doc(hidden) -fn __wit_bindgen_lower_t370(ptr : Int, value : @common.HttpMethod) -> Unit { - match value { - Get => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Head => { - mbt_ffi_store8(ptr + 0, 1) - - () - } - Post => { - mbt_ffi_store8(ptr + 0, 2) - - () - } - Put => { - mbt_ffi_store8(ptr + 0, 3) - - () - } - Delete => { - mbt_ffi_store8(ptr + 0, 4) - - () - } - Connect => { - mbt_ffi_store8(ptr + 0, 5) - - () - } - Options => { - mbt_ffi_store8(ptr + 0, 6) - - () - } - Trace => { - mbt_ffi_store8(ptr + 0, 7) - - () - } - Patch => { - mbt_ffi_store8(ptr + 0, 8) - - () - } - Custom(payload8) => { - mbt_ffi_store8(ptr + 0, 9) - - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(ptr + 8, payload8.length()) - mbt_ffi_store32(ptr + 4, ptr9) - - () - } - } -} + let address6 = mbt_ffi_malloc(((value).config).length() * 16); + for index7 = 0; index7 < ((value).config).length(); index7 = index7 + 1 { + let iter_elem : @common.AgentConfigDeclaration = ((value).config)[(index7)] + let iter_base = address6 + (index7 * 16); + __wit_bindgen_lower_t395((iter_base) + 0, iter_elem) -///| -#doc(hidden) -fn __wit_bindgen_lower_t372(ptr : Int, value : @common.PathVariable) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.variable_name) - mbt_ffi_store32(ptr + 4, value.variable_name.length()) - mbt_ffi_store32(ptr + 0, ptr0) -} + } + mbt_ffi_store32((ptr) + 172, ((value).config).length()) + mbt_ffi_store32((ptr) + 168, address6) -///| -#doc(hidden) -fn __wit_bindgen_lower_t373(ptr : Int, value : @common.PathSegment) -> Unit { - match value { - Literal(payload) => { - mbt_ffi_store8(ptr + 0, 0) - - let ptr0 = mbt_ffi_str2ptr(payload) - mbt_ffi_store32(ptr + 8, payload.length()) - mbt_ffi_store32(ptr + 4, ptr0) - - () - } - SystemVariable(payload1) => { - mbt_ffi_store8(ptr + 0, 1) - mbt_ffi_store8(ptr + 4, payload1.ordinal()) - - () - } - PathVariable(payload2) => { - mbt_ffi_store8(ptr + 0, 2) - __wit_bindgen_lower_t372(ptr + 4, payload2) - - () - } - RemainingPathVariable(payload3) => { - mbt_ffi_store8(ptr + 0, 3) - __wit_bindgen_lower_t372(ptr + 4, payload3) - - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t374(ptr : Int, value : @common.HeaderVariable) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.header_name) - mbt_ffi_store32(ptr + 4, value.header_name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - let ptr1 = mbt_ffi_str2ptr(value.variable_name) - mbt_ffi_store32(ptr + 12, value.variable_name.length()) - mbt_ffi_store32(ptr + 8, ptr1) -} +fn __wit_bindgen_lower_t402(ptr : Int, value : @common.AgentError) -> Unit { -///| -#doc(hidden) -fn __wit_bindgen_lower_t375(ptr : Int, value : @common.QueryVariable) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.query_param_name) - mbt_ffi_store32(ptr + 4, value.query_param_name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - let ptr1 = mbt_ffi_str2ptr(value.variable_name) - mbt_ffi_store32(ptr + 12, value.variable_name.length()) - mbt_ffi_store32(ptr + 8, ptr1) -} + match value { + InvalidInput(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t376(ptr : Int, value : @common.AuthDetails) -> Unit { - mbt_ffi_store8(ptr + 0, if value.required { 1 } else { 0 }) -} + let ptr0 = mbt_ffi_str2ptr(payload) + mbt_ffi_store32((ptr) + 8, payload.length()) + mbt_ffi_store32((ptr) + 4, ptr0) -///| -#doc(hidden) -fn __wit_bindgen_lower_t379( - ptr : Int, - value : @common.HttpMountDetails, -) -> Unit { - let address = mbt_ffi_malloc(value.path_prefix.length() * 12) - for index = 0; index < value.path_prefix.length(); index = index + 1 { - let iter_elem : @common.PathSegment = value.path_prefix[index] - let iter_base = address + index * 12 - __wit_bindgen_lower_t373(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 4, value.path_prefix.length()) - mbt_ffi_store32(ptr + 0, address) - - match value.auth_details { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t376(ptr + 9, payload0) - - () - } - } - mbt_ffi_store8(ptr + 10, if value.phantom_agent { 1 } else { 0 }) - __wit_bindgen_lower_t369(ptr + 12, value.cors_options) - - let address1 = mbt_ffi_malloc(value.webhook_suffix.length() * 12) - for index2 = 0; index2 < value.webhook_suffix.length(); index2 = index2 + 1 { - let iter_elem : @common.PathSegment = value.webhook_suffix[index2] - let iter_base = address1 + index2 * 12 - __wit_bindgen_lower_t373(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 24, value.webhook_suffix.length()) - mbt_ffi_store32(ptr + 20, address1) -} + () + } + InvalidMethod(payload1) => { + mbt_ffi_store8((ptr) + 0, (1)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t382( - ptr : Int, - value : @common.HttpEndpointDetails, -) -> Unit { - __wit_bindgen_lower_t370(ptr + 0, value.http_method) - - let address = mbt_ffi_malloc(value.path_suffix.length() * 12) - for index = 0; index < value.path_suffix.length(); index = index + 1 { - let iter_elem : @common.PathSegment = value.path_suffix[index] - let iter_base = address + index * 12 - __wit_bindgen_lower_t373(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 16, value.path_suffix.length()) - mbt_ffi_store32(ptr + 12, address) - - let address0 = mbt_ffi_malloc(value.header_vars.length() * 16) - for index1 = 0; index1 < value.header_vars.length(); index1 = index1 + 1 { - let iter_elem : @common.HeaderVariable = value.header_vars[index1] - let iter_base = address0 + index1 * 16 - __wit_bindgen_lower_t374(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 24, value.header_vars.length()) - mbt_ffi_store32(ptr + 20, address0) - - let address2 = mbt_ffi_malloc(value.query_vars.length() * 16) - for index3 = 0; index3 < value.query_vars.length(); index3 = index3 + 1 { - let iter_elem : @common.QueryVariable = value.query_vars[index3] - let iter_base = address2 + index3 * 16 - __wit_bindgen_lower_t375(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 32, value.query_vars.length()) - mbt_ffi_store32(ptr + 28, address2) - - match value.auth_details { - None => { - mbt_ffi_store8(ptr + 36, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 36, 1) - __wit_bindgen_lower_t376(ptr + 37, payload4) - - () - } - } - __wit_bindgen_lower_t369(ptr + 40, value.cors_options) -} + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 8, payload1.length()) + mbt_ffi_store32((ptr) + 4, ptr2) -///| -#doc(hidden) -fn __wit_bindgen_lower_t386(ptr : Int, value : @common.AgentMethod) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.name) - mbt_ffi_store32(ptr + 4, value.name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - let ptr1 = mbt_ffi_str2ptr(value.description) - mbt_ffi_store32(ptr + 12, value.description.length()) - mbt_ffi_store32(ptr + 8, ptr1) - - let address = mbt_ffi_malloc(value.http_endpoint.length() * 48) - for index = 0; index < value.http_endpoint.length(); index = index + 1 { - let iter_elem : @common.HttpEndpointDetails = value.http_endpoint[index] - let iter_base = address + index * 48 - __wit_bindgen_lower_t382(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 20, value.http_endpoint.length()) - mbt_ffi_store32(ptr + 16, address) - - match value.prompt_hint { - None => { - mbt_ffi_store8(ptr + 24, 0) - - () - } - Some(payload2) => { - mbt_ffi_store8(ptr + 24, 1) - - let ptr3 = mbt_ffi_str2ptr(payload2) - mbt_ffi_store32(ptr + 32, payload2.length()) - mbt_ffi_store32(ptr + 28, ptr3) - - () - } - } - __wit_bindgen_lower_t364(ptr + 36, value.input_schema) - __wit_bindgen_lower_t365(ptr + 48, value.output_schema) - - match value.read_only { - None => { - mbt_ffi_store8(ptr + 56, 0) - - () - } - Some(payload5) => { - mbt_ffi_store8(ptr + 56, 1) - __wit_bindgen_lower_t367(ptr + 64, payload5) - - () - } - } -} + () + } + InvalidType(payload3) => { + mbt_ffi_store8((ptr) + 0, (2)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t392( - ptr : Int, - value : @common.AgentConstructor, -) -> Unit { - match value.name { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - let ptr1 = mbt_ffi_str2ptr(payload0) - mbt_ffi_store32(ptr + 8, payload0.length()) - mbt_ffi_store32(ptr + 4, ptr1) - - () - } - } - - let ptr2 = mbt_ffi_str2ptr(value.description) - mbt_ffi_store32(ptr + 16, value.description.length()) - mbt_ffi_store32(ptr + 12, ptr2) - - match value.prompt_hint { - None => { - mbt_ffi_store8(ptr + 20, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 20, 1) - - let ptr5 = mbt_ffi_str2ptr(payload4) - mbt_ffi_store32(ptr + 28, payload4.length()) - mbt_ffi_store32(ptr + 24, ptr5) - - () - } - } - __wit_bindgen_lower_t364(ptr + 32, value.input_schema) -} + let ptr4 = mbt_ffi_str2ptr(payload3) + mbt_ffi_store32((ptr) + 8, payload3.length()) + mbt_ffi_store32((ptr) + 4, ptr4) -///| -#doc(hidden) -fn __wit_bindgen_lower_t394(ptr : Int, value : @common.AgentDependency) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.type_name) - mbt_ffi_store32(ptr + 4, value.type_name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - match value.description { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 16, payload1.length()) - mbt_ffi_store32(ptr + 12, ptr2) - - () - } - } - __wit_bindgen_lower_t56(ptr + 20, value.schema) - __wit_bindgen_lower_t392(ptr + 40, value.constructor_) - - let address = mbt_ffi_malloc(value.methods.length() * 88) - for index = 0; index < value.methods.length(); index = index + 1 { - let iter_elem : @common.AgentMethod = value.methods[index] - let iter_base = address + index * 88 - __wit_bindgen_lower_t386(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 88, value.methods.length()) - mbt_ffi_store32(ptr + 84, address) -} + () + } + InvalidAgentId(payload5) => { + mbt_ffi_store8((ptr) + 0, (3)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t395( - ptr : Int, - value : @common.SnapshottingConfig, -) -> Unit { - match value { - Default => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Periodic(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - mbt_ffi_store64(ptr + 8, payload0.reinterpret_as_int64()) - - () - } - EveryNInvocation(payload1) => { - mbt_ffi_store8(ptr + 0, 2) - mbt_ffi_store16(ptr + 8, payload1.reinterpret_as_int()) - - () - } - } -} + let ptr6 = mbt_ffi_str2ptr(payload5) + mbt_ffi_store32((ptr) + 8, payload5.length()) + mbt_ffi_store32((ptr) + 4, ptr6) -///| -#doc(hidden) -fn __wit_bindgen_lower_t396(ptr : Int, value : @common.Snapshotting) -> Unit { - match value { - Disabled => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Enabled(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - __wit_bindgen_lower_t395(ptr + 8, payload0) - - () - } - } -} + () + } + CustomError(payload7) => { + mbt_ffi_store8((ptr) + 0, (4)) + __wit_bindgen_lower_t77((ptr) + 4, payload7) + + () + } + } -///| -#doc(hidden) -fn __wit_bindgen_lower_t398( - ptr : Int, - value : @common.AgentConfigDeclaration, -) -> Unit { - mbt_ffi_store8(ptr + 0, value.source.ordinal()) - - let address = mbt_ffi_malloc(value.path.length() * 8) - for index = 0; index < value.path.length(); index = index + 1 { - let iter_elem : String = value.path[index] - let iter_base = address + index * 8 - - let ptr0 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr0) - } - mbt_ffi_store32(ptr + 8, value.path.length()) - mbt_ffi_store32(ptr + 4, address) - mbt_ffi_store32(ptr + 12, value.value_type) } ///| -#doc(hidden) -fn __wit_bindgen_lower_t402(ptr : Int, value : @common.AgentType) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.type_name) - mbt_ffi_store32(ptr + 4, value.type_name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - let ptr1 = mbt_ffi_str2ptr(value.description) - mbt_ffi_store32(ptr + 12, value.description.length()) - mbt_ffi_store32(ptr + 8, ptr1) - - let ptr2 = mbt_ffi_str2ptr(value.source_language) - mbt_ffi_store32(ptr + 20, value.source_language.length()) - mbt_ffi_store32(ptr + 16, ptr2) - __wit_bindgen_lower_t56(ptr + 24, value.schema) - __wit_bindgen_lower_t392(ptr + 44, value.constructor_) - - let address = mbt_ffi_malloc(value.methods.length() * 88) - for index = 0; index < value.methods.length(); index = index + 1 { - let iter_elem : @common.AgentMethod = value.methods[index] - let iter_base = address + index * 88 - __wit_bindgen_lower_t386(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 92, value.methods.length()) - mbt_ffi_store32(ptr + 88, address) - - let address3 = mbt_ffi_malloc(value.dependencies.length() * 92) - for index4 = 0; index4 < value.dependencies.length(); index4 = index4 + 1 { - let iter_elem : @common.AgentDependency = value.dependencies[index4] - let iter_base = address3 + index4 * 92 - __wit_bindgen_lower_t394(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 100, value.dependencies.length()) - mbt_ffi_store32(ptr + 96, address3) - mbt_ffi_store8(ptr + 104, value.mode.ordinal()) - - match value.http_mount { - None => { - mbt_ffi_store8(ptr + 108, 0) - - () - } - Some(payload5) => { - mbt_ffi_store8(ptr + 108, 1) - __wit_bindgen_lower_t379(ptr + 112, payload5) - - () - } - } - __wit_bindgen_lower_t396(ptr + 144, value.snapshotting) - - let address6 = mbt_ffi_malloc(value.config.length() * 16) - for index7 = 0; index7 < value.config.length(); index7 = index7 + 1 { - let iter_elem : @common.AgentConfigDeclaration = value.config[index7] - let iter_base = address6 + index7 * 16 - __wit_bindgen_lower_t398(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 172, value.config.length()) - mbt_ffi_store32(ptr + 168, address6) -} +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -#doc(hidden) -fn __wit_bindgen_lower_t405(ptr : Int, value : @common.AgentError) -> Unit { - match value { - InvalidInput(payload) => { - mbt_ffi_store8(ptr + 0, 0) - - let ptr0 = mbt_ffi_str2ptr(payload) - mbt_ffi_store32(ptr + 8, payload.length()) - mbt_ffi_store32(ptr + 4, ptr0) - - () - } - InvalidMethod(payload1) => { - mbt_ffi_store8(ptr + 0, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 8, payload1.length()) - mbt_ffi_store32(ptr + 4, ptr2) - - () - } - InvalidType(payload3) => { - mbt_ffi_store8(ptr + 0, 2) - - let ptr4 = mbt_ffi_str2ptr(payload3) - mbt_ffi_store32(ptr + 8, payload3.length()) - mbt_ffi_store32(ptr + 4, ptr4) - - () - } - InvalidAgentId(payload5) => { - mbt_ffi_store8(ptr + 0, 3) - - let ptr6 = mbt_ffi_str2ptr(payload5) - mbt_ffi_store32(ptr + 8, payload5.length()) - mbt_ffi_store32(ptr + 4, ptr6) - - () - } - CustomError(payload7) => { - mbt_ffi_store8(ptr + 0, 4) - __wit_bindgen_lower_t74(ptr + 4, payload7) - - () - } - } -} +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend16_s) +#|(func (param i32) (result i32) local.get 0 i32.extend16_s) ///| -extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_s) +extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_u) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_s) ///| extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) - -///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) - -///| -extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) +#|(func (param i32) (result i64) local.get 0 i64.load) ///| extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = +#|(func (param i32) (result f64) local.get 0 f64.load) ///| -extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = - #|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) +extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = +#|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) ///| extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_s) +#|(func (param i32) (result i32) local.get 0 i32.load16_s) ///| -extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = - #|(func (param i32) (result f32) local.get 0 f32.load) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) +extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = +#|(func (param i32) (result f32) local.get 0 f32.load) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = +#|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +#owned(bytes) +extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = - #|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = - #|(func (param i32) (result f64) local.get 0 f64.load) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) ///| -#owned(bytes) -extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend8_s) ///| -extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend8_s) +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) + diff --git a/sdks/moonbit/golem_sdk/gen/interface/golem/agent/guest/top.mbt b/sdks/moonbit/golem_sdk/gen/interface/golem/agent/guest/top.mbt index 4c7a922e0c..bb8ff0c381 100644 --- a/sdks/moonbit/golem_sdk/gen/interface/golem/agent/guest/top.mbt +++ b/sdks/moonbit/golem_sdk/gen/interface/golem/agent/guest/top.mbt @@ -1,5 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Initializes the agent of a given type with the given constructor parameters. /// If called a second time, it fails. @@ -7,33 +6,18 @@ /// `input` is a value tree whose root encodes the constructor's parameter /// list (one record field per declared `named-field`, in declaration order). /// The guest interprets it against its own constructor `input-schema`. -declare pub async fn initialize( - agent_type : String, - input : @types.SchemaValueTree, - principal : @common.Principal, - background_group : @async-core.TaskGroup[Unit], -) -> Result[Unit, @common.AgentError] - +declare pub async fn initialize(agent_type : String, input : @types.SchemaValueTree, principal : @common.Principal, background_group : @async-core.TaskGroup[Unit]) -> Result[Unit, @common.AgentError] ///| /// Invokes an agent. If create was not called before, it fails. /// /// `input` is a value tree whose root encodes the method's parameter list. /// The result is `none` when the method's `output-schema` is `unit`, and /// `some(value)` for a `single` output. -declare pub async fn invoke( - method_name : String, - input : @types.SchemaValueTree, - principal : @common.Principal, - background_group : @async-core.TaskGroup[Unit], -) -> Result[@types.SchemaValueTree?, @common.AgentError] - +declare pub async fn invoke(method_name : String, input : @types.SchemaValueTree, principal : @common.Principal, background_group : @async-core.TaskGroup[Unit]) -> Result[@types.SchemaValueTree?, @common.AgentError] ///| /// Gets the agent type. If create was not called before, it fails declare pub fn get_definition() -> @common.AgentType - ///| /// Gets the agent types defined by this component -declare pub fn discover_agent_types() -> Result[ - Array[@common.AgentType], - @common.AgentError, -] +declare pub fn discover_agent_types() -> Result[Array[@common.AgentType], @common.AgentError] + diff --git a/sdks/moonbit/golem_sdk/gen/interface/golem/api/load-snapshot/ffi.mbt b/sdks/moonbit/golem_sdk/gen/interface/golem/api/load-snapshot/ffi.mbt index 94092ad353..5228394626 100644 --- a/sdks/moonbit/golem_sdk/gen/interface/golem/api/load-snapshot/ffi.mbt +++ b/sdks/moonbit/golem_sdk/gen/interface/golem/api/load-snapshot/ffi.mbt @@ -1,80 +1,82 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| #doc(hidden) pub fn wasmExportLoad(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int { - @async-core.with_waitableset(async fn() { - @async-core.with_task_group(async fn(background_group) { - let result = mbt_ffi_ptr2bytes(p0, p1) - - let result0 = mbt_ffi_ptr2str(p2, p3) - - let return_result : Ref[Result[Unit, String]?] = Ref(None) - return_result.val = Some( - load( - @host.Snapshot::{ payload: result, mime_type: result0 }, - background_group, - ), - ) - load_task_return(return_result) - }) - }) + @async-core.with_waitableset(async fn() { + @async-core.with_task_group(async fn(background_group) { + + let result = mbt_ffi_ptr2bytes(p0, p1) + + let result0 = mbt_ffi_ptr2str(p2, p3) + + let return_result: Ref[Result[Unit, String]?] = Ref(None) + return_result.val = Some(load(@host.Snapshot::{payload : result, mime_type : result0}, background_group)) + load_task_return(return_result) + + }) + }) } -///| -fn wasmExportAsyncLoadTaskReturn(p0 : Int, p1 : Int, p2 : Int) = "[export]golem:api/load-snapshot@1.5.0" "[task-return]load" +fn wasmExportAsyncLoadTaskReturn(p0: Int, p1: Int, p2: Int) = "[export]golem:api/load-snapshot@1.5.0" "[task-return]load" -///| -fn load_task_return(return_result : Ref[Result[Unit, String]?]) -> Unit { - match return_result.val { - Some(return_value) => { - let cleanup_list : Array[Int] = [] - - let (lowered, lowered2, lowered3) = match return_value { - Ok(_payload) => (0, 0, 0) - Err(payload1) => { - let ptr = mbt_ffi_str2ptr(payload1) - cleanup_list.push(ptr) - - (1, ptr, payload1.length()) - } - } +fn load_task_return(return_result: Ref[Result[Unit, String]?]) -> Unit { + + match return_result.val { + Some(return_value) => { + + let cleanup_list : Array[Int] = [] + + let (lowered,lowered2,lowered3) = match return_value { + Ok(_payload) => { + + ((0), 0, 0) + } + Err(payload1) => { + + let ptr = mbt_ffi_str2ptr(payload1) + cleanup_list.push(ptr) + + ((1), ptr, payload1.length()) + } + } - wasmExportAsyncLoadTaskReturn(lowered, lowered2, lowered3) + wasmExportAsyncLoadTaskReturn(lowered, lowered2, lowered3) - cleanup_list.each(mbt_ffi_free) + cleanup_list.each(mbt_ffi_free) + + @async-core.task_returned() + + } + None => () + } - @async-core.task_returned() - } - None => () - } } -///| #doc(hidden) pub fn wasmExportAsyncLoad(event_raw : Int, waitable : Int, code : Int) -> Int { - @async-core.cb(event_raw, waitable, code) + @async-core.cb(event_raw, waitable, code) } -///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) - ///| #owned(str) extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) + +///| +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) + diff --git a/sdks/moonbit/golem_sdk/gen/interface/golem/api/load-snapshot/top.mbt b/sdks/moonbit/golem_sdk/gen/interface/golem/api/load-snapshot/top.mbt index 826f5c23b2..7564136d97 100644 --- a/sdks/moonbit/golem_sdk/gen/interface/golem/api/load-snapshot/top.mbt +++ b/sdks/moonbit/golem_sdk/gen/interface/golem/api/load-snapshot/top.mbt @@ -1,9 +1,6 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Tries to load a user-defined snapshot, setting up the agent's state based on it. /// The function can return with a failure to indicate that the update is not possible. -declare pub async fn load( - snapshot : @host.Snapshot, - background_group : @async-core.TaskGroup[Unit], -) -> Result[Unit, String] +declare pub async fn load(snapshot : @host.Snapshot, background_group : @async-core.TaskGroup[Unit]) -> Result[Unit, String] + diff --git a/sdks/moonbit/golem_sdk/gen/interface/golem/api/loadSnapshot/ffi.mbt b/sdks/moonbit/golem_sdk/gen/interface/golem/api/loadSnapshot/ffi.mbt new file mode 100644 index 0000000000..3022fa5311 --- /dev/null +++ b/sdks/moonbit/golem_sdk/gen/interface/golem/api/loadSnapshot/ffi.mbt @@ -0,0 +1,90 @@ +// Generated by `wit-bindgen` 0.58.0. DO NOT EDIT! + +///| +#doc(hidden) +pub fn wasmExportLoad(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int { + let result = mbt_ffi_ptr2bytes(p0, p1) + + let result0 = mbt_ffi_ptr2str(p2, p3) + + let result1 : Result[Unit, String] = load(@host.Snapshot::{ + payload: result, + mime_type: result0, + }) + let return_area = mbt_ffi_malloc(12) + + match result1 { + Ok(_payload) => { + mbt_ffi_store8(return_area + 0, 0) + + () + } + Err(payload2) => { + mbt_ffi_store8(return_area + 0, 1) + + let ptr = mbt_ffi_str2ptr(payload2) + mbt_ffi_store32(return_area + 8, payload2.length()) + mbt_ffi_store32(return_area + 4, ptr) + + () + } + } + let ret = return_area + return ret +} + +///| +#doc(hidden) +pub fn wasmExportLoadPostReturn(p0 : Int) -> Unit { + match mbt_ffi_load8_u(p0 + 0) { + 0 => () + 1 => mbt_ffi_free(mbt_ffi_load32(p0 + 4)) + _ => panic() + } +} + +///| +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = + #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) + +///| +extern "wasm" fn mbt_ffi_free(position : Int) = + #|(func (param i32) local.get 0 call $moonbit.decref) + +///| +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = + #|(func (param i32) (result i32) local.get 0 i32.load8_u) + +///| +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = + #|(func (param i32) (result i32) (local i32) + #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc + #| local.tee 1 i32.const 0 call $moonbit.init_array8 + #| local.get 1) + +///| +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = + #|(func (param i32) (param i32) (result i32) + #| local.get 0 + #| local.get 1 call $moonbit.init_array16 + #| local.get 0) + +///| +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = + #|(func (param i32) (param i32) (result i32) + #| local.get 0 + #| local.get 1 call $moonbit.init_array8 + #| local.get 0) + +///| +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = + #|(func (param i32) (result i32) local.get 0) + +///| +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = + #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) + +///| +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = + #|(func (param i32) (result i32) local.get 0 i32.load) diff --git a/sdks/moonbit/golem_sdk/gen/interface/golem/api/save-snapshot/ffi.mbt b/sdks/moonbit/golem_sdk/gen/interface/golem/api/save-snapshot/ffi.mbt index 8df0bf3980..ccb8ae8be9 100644 --- a/sdks/moonbit/golem_sdk/gen/interface/golem/api/save-snapshot/ffi.mbt +++ b/sdks/moonbit/golem_sdk/gen/interface/golem/api/save-snapshot/ffi.mbt @@ -1,53 +1,51 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| #doc(hidden) pub fn wasmExportSave() -> Int { - @async-core.with_waitableset(async fn() { - @async-core.with_task_group(async fn(background_group) { - let return_result : Ref[@host.Snapshot?] = Ref(None) - return_result.val = Some(save(background_group)) - save_task_return(return_result) - }) - }) + @async-core.with_waitableset(async fn() { + @async-core.with_task_group(async fn(background_group) { + + let return_result: Ref[@host.Snapshot?] = Ref(None) + return_result.val = Some(save(background_group)) + save_task_return(return_result) + + }) + }) } -///| -fn wasmExportAsyncSaveTaskReturn(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "[export]golem:api/save-snapshot@1.5.0" "[task-return]save" +fn wasmExportAsyncSaveTaskReturn(p0: Int, p1: Int, p2: Int, p3: Int) = "[export]golem:api/save-snapshot@1.5.0" "[task-return]save" + +fn save_task_return(return_result: Ref[@host.Snapshot?]) -> Unit { + + match return_result.val { + Some(return_value) => { + + let ptr = mbt_ffi_bytes2ptr((return_value).payload) + + let ptr0 = mbt_ffi_str2ptr((return_value).mime_type) + + wasmExportAsyncSaveTaskReturn(ptr, (return_value).payload.length(), ptr0, (return_value).mime_type.length()) + + @async-core.task_returned() + + } + None => () + } -///| -fn save_task_return(return_result : Ref[@host.Snapshot?]) -> Unit { - match return_result.val { - Some(return_value) => { - let ptr = mbt_ffi_bytes2ptr(return_value.payload) - - let ptr0 = mbt_ffi_str2ptr(return_value.mime_type) - - wasmExportAsyncSaveTaskReturn( - ptr, - return_value.payload.length(), - ptr0, - return_value.mime_type.length(), - ) - - @async-core.task_returned() - } - None => () - } } -///| #doc(hidden) pub fn wasmExportAsyncSave(event_raw : Int, waitable : Int, code : Int) -> Int { - @async-core.cb(event_raw, waitable, code) + @async-core.cb(event_raw, waitable, code) } ///| #owned(bytes) extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| #owned(str) extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) + diff --git a/sdks/moonbit/golem_sdk/gen/interface/golem/api/save-snapshot/top.mbt b/sdks/moonbit/golem_sdk/gen/interface/golem/api/save-snapshot/top.mbt index 331bddcfe2..e2bde2f9e8 100644 --- a/sdks/moonbit/golem_sdk/gen/interface/golem/api/save-snapshot/top.mbt +++ b/sdks/moonbit/golem_sdk/gen/interface/golem/api/save-snapshot/top.mbt @@ -1,7 +1,5 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Saves the component's state into a user-defined snapshot -declare pub async fn save( - background_group : @async-core.TaskGroup[Unit], -) -> @host.Snapshot +declare pub async fn save(background_group : @async-core.TaskGroup[Unit]) -> @host.Snapshot + diff --git a/sdks/moonbit/golem_sdk/gen/interface/golem/api/saveSnapshot/ffi.mbt b/sdks/moonbit/golem_sdk/gen/interface/golem/api/saveSnapshot/ffi.mbt new file mode 100644 index 0000000000..f8c6379c76 --- /dev/null +++ b/sdks/moonbit/golem_sdk/gen/interface/golem/api/saveSnapshot/ffi.mbt @@ -0,0 +1,55 @@ +// Generated by `wit-bindgen` 0.58.0. DO NOT EDIT! + +///| +#doc(hidden) +pub fn wasmExportSave() -> Int { + let result : @host.Snapshot = save() + let return_area = mbt_ffi_malloc(16) + + let ptr = mbt_ffi_bytes2ptr(result.payload) + + mbt_ffi_store32(return_area + 4, result.payload.length()) + mbt_ffi_store32(return_area + 0, ptr) + + let ptr0 = mbt_ffi_str2ptr(result.mime_type) + mbt_ffi_store32(return_area + 12, result.mime_type.length()) + mbt_ffi_store32(return_area + 8, ptr0) + let ret = return_area + return ret +} + +///| +#doc(hidden) +pub fn wasmExportSavePostReturn(p0 : Int) -> Unit { + mbt_ffi_free(mbt_ffi_load32(p0 + 0)) + mbt_ffi_free(mbt_ffi_load32(p0 + 8)) +} + +///| +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = + #|(func (param i32) (result i32) (local i32) + #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc + #| local.tee 1 i32.const 0 call $moonbit.init_array8 + #| local.get 1) + +///| +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = + #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) + +///| +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = + #|(func (param i32) (result i32) local.get 0) + +///| +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = + #|(func (param i32) (result i32) local.get 0 i32.load) + +///| +#owned(bytes) +extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = + #|(func (param i32) (result i32) local.get 0) + +///| +extern "wasm" fn mbt_ffi_free(position : Int) = + #|(func (param i32) local.get 0 call $moonbit.decref) diff --git a/sdks/moonbit/golem_sdk/gen/interface/golem/tool/guest/ffi.mbt b/sdks/moonbit/golem_sdk/gen/interface/golem/tool/guest/ffi.mbt index 133252758c..eefbfe0087 100644 --- a/sdks/moonbit/golem_sdk/gen/interface/golem/tool/guest/ffi.mbt +++ b/sdks/moonbit/golem_sdk/gen/interface/golem/tool/guest/ffi.mbt @@ -1,10327 +1,11789 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| #doc(hidden) pub fn wasmExportDiscoverTools() -> Int { - let result : Result[Array[@common.Tool], @common.ToolError] = discover_tools() - let return_area = mbt_ffi_malloc(40) - - match result { - Ok(payload) => { - mbt_ffi_store8(return_area + 0, 0) - - let address = mbt_ffi_malloc(payload.length() * 36) - for index = 0; index < payload.length(); index = index + 1 { - let iter_elem : @common.Tool = payload[index] - let iter_base = address + index * 36 - __wit_bindgen_lower_t510(iter_base + 0, iter_elem) + + let (result) : (Result[Array[@common.Tool], @common.ToolError]) = discover_tools(); + let return_area = mbt_ffi_malloc(40) + + match result { + Ok(payload) => { + mbt_ffi_store8((return_area) + 0, (0)) + + let address = mbt_ffi_malloc((payload).length() * 36); + for index = 0; index < (payload).length(); index = index + 1 { + let iter_elem : @common.Tool = (payload)[(index)] + let iter_base = address + (index * 36); + __wit_bindgen_lower_t510((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((return_area) + 8, (payload).length()) + mbt_ffi_store32((return_area) + 4, address) + + () + } + Err(payload0) => { + mbt_ffi_store8((return_area) + 0, (1)) + __wit_bindgen_lower_t511((return_area) + 4, payload0) + + () + } } - mbt_ffi_store32(return_area + 8, payload.length()) - mbt_ffi_store32(return_area + 4, address) - - () - } - Err(payload0) => { - mbt_ffi_store8(return_area + 0, 1) - __wit_bindgen_lower_t511(return_area + 4, payload0) - - () - } - } - let ret = return_area - return ret + let ret = return_area + return ret + } -///| #doc(hidden) pub fn wasmExportDiscoverToolsPostReturn(p0 : Int) -> Unit { - match mbt_ffi_load8_u(p0 + 0) { - 0 => { - for index69 = 0; index69 < mbt_ffi_load32(p0 + 8); index69 = index69 + 1 { - let iter_base = mbt_ffi_load32(p0 + 4) + index69 * 36 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - for index46 = 0 - index46 < mbt_ffi_load32(iter_base + 12) - index46 = index46 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index46 * 324 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - for index = 0 - index < mbt_ffi_load32(iter_base + 12) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index0 = 0 - index0 < mbt_ffi_load32(iter_base + 36) - index0 = index0 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index0 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - for index4 = 0 - index4 < mbt_ffi_load32(iter_base + 44) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index4 * 112 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - for index1 = 0 - index1 < mbt_ffi_load32(iter_base + 20) - index1 = index1 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index1 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - for index2 = 0 - index2 < mbt_ffi_load32(iter_base + 44) - index2 = index2 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index2 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - match mbt_ffi_load8_u(iter_base + 48) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => { - for index3 = 0 - index3 < mbt_ffi_load32(iter_base + 88) - index3 = index3 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 84) + index3 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() + + match (mbt_ffi_load8_u((p0) + 0)) { + 0 => { + + for index69 = 0; index69 < (mbt_ffi_load32((p0) + 8)); index69 = index69 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 4)) + (index69 * 36) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + for index46 = 0; index46 < (mbt_ffi_load32((iter_base) + 12)); index46 = index46 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index46 * 324) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + for index = 0; index < (mbt_ffi_load32((iter_base) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index0 = 0; index0 < (mbt_ffi_load32((iter_base) + 36)); index0 = index0 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index0 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + for index4 = 0; index4 < (mbt_ffi_load32((iter_base) + 44)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index4 * 112) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + for index1 = 0; index1 < (mbt_ffi_load32((iter_base) + 20)); index1 = index1 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + for index2 = 0; index2 < (mbt_ffi_load32((iter_base) + 44)); index2 = index2 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index2 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => { + + for index3 = 0; index3 < (mbt_ffi_load32((iter_base) + 88)); index3 = index3 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 84)) + (index3 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 100)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 104)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + for index7 = 0; index7 < (mbt_ffi_load32((iter_base) + 52)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index7 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + for index5 = 0; index5 < (mbt_ffi_load32((iter_base) + 20)); index5 = index5 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index5 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + for index6 = 0; index6 < (mbt_ffi_load32((iter_base) + 44)); index6 = index6 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index6 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 72)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index10 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 28)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index8 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + match (mbt_ffi_load8_u((iter_base) + 32)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => () + 1 => { + + for index9 = 0; index9 < (mbt_ffi_load32((iter_base) + 56)); index9 = index9 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 52)) + (index9 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 80)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 96)) + + for index11 = 0; index11 < (mbt_ffi_load32((iter_base) + 108)); index11 = index11 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 104)) + (index11 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 104)) + + match (mbt_ffi_load8_u((iter_base) + 112)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 116)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 140)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 144)) + + } + _ => panic() + } + + } + _ => panic() + } + + for index15 = 0; index15 < (mbt_ffi_load32((iter_base) + 160)); index15 = index15 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 156)) + (index15 * 112) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + for index12 = 0; index12 < (mbt_ffi_load32((iter_base) + 20)); index12 = index12 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index12 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + for index13 = 0; index13 < (mbt_ffi_load32((iter_base) + 44)); index13 = index13 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index13 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => { + + for index14 = 0; index14 < (mbt_ffi_load32((iter_base) + 88)); index14 = index14 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 84)) + (index14 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 100)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 104)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 156)) + + for index18 = 0; index18 < (mbt_ffi_load32((iter_base) + 168)); index18 = index18 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 164)) + (index18 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + for index16 = 0; index16 < (mbt_ffi_load32((iter_base) + 20)); index16 = index16 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index16 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + for index17 = 0; index17 < (mbt_ffi_load32((iter_base) + 44)); index17 = index17 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index17 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 164)) + + for index36 = 0; index36 < (mbt_ffi_load32((iter_base) + 176)); index36 = index36 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 172)) + (index36 * 28) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + for index20 = 0; index20 < (mbt_ffi_load32((iter_base) + 8)); index20 = index20 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index20 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index19 = 0; index19 < (mbt_ffi_load32((iter_base) + 16)); index19 = index19 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index19 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + + for index22 = 0; index22 < (mbt_ffi_load32((iter_base) + 8)); index22 = index22 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index22 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index21 = 0; index21 < (mbt_ffi_load32((iter_base) + 16)); index21 = index21 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index21 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 2 => { + + for index24 = 0; index24 < (mbt_ffi_load32((iter_base) + 8)); index24 = index24 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index24 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index23 = 0; index23 < (mbt_ffi_load32((iter_base) + 16)); index23 = index23 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index23 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 3 => { + + for index27 = 0; index27 < (mbt_ffi_load32((iter_base) + 8)); index27 = index27 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index27 * 8) + + for index26 = 0; index26 < (mbt_ffi_load32((iter_base) + 4)); index26 = index26 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index26 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index25 = 0; index25 < (mbt_ffi_load32((iter_base) + 16)); index25 = index25 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index25 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 4 => { + + for index29 = 0; index29 < (mbt_ffi_load32((iter_base) + 12)); index29 = index29 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index29 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index28 = 0; index28 < (mbt_ffi_load32((iter_base) + 16)); index28 = index28 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index28 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index31 = 0; index31 < (mbt_ffi_load32((iter_base) + 24)); index31 = index31 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index31 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index30 = 0; index30 < (mbt_ffi_load32((iter_base) + 16)); index30 = index30 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index30 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 5 => { + + for index33 = 0; index33 < (mbt_ffi_load32((iter_base) + 12)); index33 = index33 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index33 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index32 = 0; index32 < (mbt_ffi_load32((iter_base) + 16)); index32 = index32 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index32 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index35 = 0; index35 < (mbt_ffi_load32((iter_base) + 20)); index35 = index35 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index35 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index34 = 0; index34 < (mbt_ffi_load32((iter_base) + 16)); index34 = index34 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index34 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 172)) + + match (mbt_ffi_load8_u((iter_base) + 180)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 184)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 192)) + + for index37 = 0; index37 < (mbt_ffi_load32((iter_base) + 204)); index37 = index37 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 200)) + (index37 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 200)) + + for index38 = 0; index38 < (mbt_ffi_load32((iter_base) + 212)); index38 = index38 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 208)) + (index38 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 208)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 220)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 224)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 232)) + + for index39 = 0; index39 < (mbt_ffi_load32((iter_base) + 244)); index39 = index39 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 240)) + (index39 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 240)) + + for index40 = 0; index40 < (mbt_ffi_load32((iter_base) + 252)); index40 = index40 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 248)) + (index40 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 248)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 260)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 268)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 276)) + + for index41 = 0; index41 < (mbt_ffi_load32((iter_base) + 288)); index41 = index41 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 284)) + (index41 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 284)) + + for index43 = 0; index43 < (mbt_ffi_load32((iter_base) + 296)); index43 = index43 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 292)) + (index43 * 32) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + for index42 = 0; index42 < (mbt_ffi_load32((iter_base) + 28)); index42 = index42 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index42 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 292)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 300)) + + } + _ => panic() + } + + for index45 = 0; index45 < (mbt_ffi_load32((iter_base) + 312)); index45 = index45 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 308)) + (index45 * 44) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + for index44 = 0; index44 < (mbt_ffi_load32((iter_base) + 28)); index44 = index44 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index44 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 308)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index67 = 0; index67 < (mbt_ffi_load32((iter_base) + 20)); index67 = index67 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index67 * 144) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 3 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 5 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 7 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 8 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 9 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 10 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 11 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 12 => () + 13 => () + 14 => { + + for index49 = 0; index49 < (mbt_ffi_load32((iter_base) + 12)); index49 = index49 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index49 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index47 = 0; index47 < (mbt_ffi_load32((iter_base) + 28)); index47 = index47 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index47 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index48 = 0; index48 < (mbt_ffi_load32((iter_base) + 36)); index48 = index48 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index48 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index52 = 0; index52 < (mbt_ffi_load32((iter_base) + 12)); index52 = index52 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index52 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index50 = 0; index50 < (mbt_ffi_load32((iter_base) + 32)); index50 = index50 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index50 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index51 = 0; index51 < (mbt_ffi_load32((iter_base) + 40)); index51 = index51 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index51 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 16 => { + + for index53 = 0; index53 < (mbt_ffi_load32((iter_base) + 12)); index53 = index53 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index53 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + + for index54 = 0; index54 < (mbt_ffi_load32((iter_base) + 12)); index54 = index54 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index54 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index55 = 0; index55 < (mbt_ffi_load32((iter_base) + 16)); index55 = index55 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index55 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + } + 25 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index56 = 0; index56 < (mbt_ffi_load32((iter_base) + 16)); index56 = index56 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index56 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 26 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + + for index57 = 0; index57 < (mbt_ffi_load32((iter_base) + 20)); index57 = index57 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index57 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + + for index58 = 0; index58 < (mbt_ffi_load32((iter_base) + 32)); index58 = index58 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index58 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 27 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index59 = 0; index59 < (mbt_ffi_load32((iter_base) + 16)); index59 = index59 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index59 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { + + for index60 = 0; index60 < (mbt_ffi_load32((iter_base) + 28)); index60 = index60 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index60 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index61 = 0; index61 < (mbt_ffi_load32((iter_base) + 20)); index61 = index61 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index61 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + } + _ => panic() + } + + } + 31 => { + + for index64 = 0; index64 < (mbt_ffi_load32((iter_base) + 12)); index64 = index64 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index64 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index62 = 0; index62 < (mbt_ffi_load32((iter_base) + 52)); index62 = index62 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index62 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index63 = 0; index63 < (mbt_ffi_load32((iter_base) + 60)); index63 = index63 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index63 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index65 = 0; index65 < (mbt_ffi_load32((iter_base) + 104)); index65 = index65 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index65 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index66 = 0; index66 < (mbt_ffi_load32((iter_base) + 112)); index66 = index66 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index66 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + for index68 = 0; index68 < (mbt_ffi_load32((iter_base) + 28)); index68 = index68 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index68 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 100) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 104)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - for index7 = 0 - index7 < mbt_ffi_load32(iter_base + 52) - index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index7 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - for index5 = 0 - index5 < mbt_ffi_load32(iter_base + 20) - index5 = index5 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index5 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - for index6 = 0 - index6 < mbt_ffi_load32(iter_base + 44) - index6 = index6 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index6 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () + mbt_ffi_free(mbt_ffi_load32((p0) + 4)) + + } 1 => { - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 72) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + index10 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 28) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index8 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - match mbt_ffi_load8_u(iter_base + 32) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 48) { - 0 => () - 1 => { - for index9 = 0 - index9 < mbt_ffi_load32(iter_base + 56) - index9 = index9 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 52) + - index9 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + + match (mbt_ffi_load8_u((p0) + 4)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 1 => { + + for index70 = 0; index70 < (mbt_ffi_load32((p0) + 12)); index70 = index70 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 8)) + (index70 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 5 => { + + for index91 = 0; index91 < (mbt_ffi_load32((p0) + 12)); index91 = index91 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 8)) + (index91 * 144) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 3 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 5 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 7 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 8 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 9 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 10 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 11 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 12 => () + 13 => () + 14 => { + + for index73 = 0; index73 < (mbt_ffi_load32((iter_base) + 12)); index73 = index73 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index73 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index71 = 0; index71 < (mbt_ffi_load32((iter_base) + 28)); index71 = index71 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index71 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index72 = 0; index72 < (mbt_ffi_load32((iter_base) + 36)); index72 = index72 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index72 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index76 = 0; index76 < (mbt_ffi_load32((iter_base) + 12)); index76 = index76 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index76 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index74 = 0; index74 < (mbt_ffi_load32((iter_base) + 32)); index74 = index74 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index74 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index75 = 0; index75 < (mbt_ffi_load32((iter_base) + 40)); index75 = index75 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index75 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 16 => { + + for index77 = 0; index77 < (mbt_ffi_load32((iter_base) + 12)); index77 = index77 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index77 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + + for index78 = 0; index78 < (mbt_ffi_load32((iter_base) + 12)); index78 = index78 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index78 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index79 = 0; index79 < (mbt_ffi_load32((iter_base) + 16)); index79 = index79 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index79 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + } + 25 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index80 = 0; index80 < (mbt_ffi_load32((iter_base) + 16)); index80 = index80 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index80 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 26 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + + for index81 = 0; index81 < (mbt_ffi_load32((iter_base) + 20)); index81 = index81 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index81 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + + for index82 = 0; index82 < (mbt_ffi_load32((iter_base) + 32)); index82 = index82 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index82 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 27 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index83 = 0; index83 < (mbt_ffi_load32((iter_base) + 16)); index83 = index83 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index83 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { + + for index84 = 0; index84 < (mbt_ffi_load32((iter_base) + 28)); index84 = index84 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index84 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index85 = 0; index85 < (mbt_ffi_load32((iter_base) + 20)); index85 = index85 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index85 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + } + _ => panic() + } + + } + 31 => { + + for index88 = 0; index88 < (mbt_ffi_load32((iter_base) + 12)); index88 = index88 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index88 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index86 = 0; index86 < (mbt_ffi_load32((iter_base) + 52)); index86 = index86 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index86 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index87 = 0; index87 < (mbt_ffi_load32((iter_base) + 60)); index87 = index87 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index87 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index89 = 0; index89 < (mbt_ffi_load32((iter_base) + 104)); index89 = index89 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index89 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index90 = 0; index90 < (mbt_ffi_load32((iter_base) + 112)); index90 = index90 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index90 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + for index92 = 0; index92 < (mbt_ffi_load32((p0) + 20)); index92 = index92 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 16)) + (index92 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 16)) + + for index93 = 0; index93 < (mbt_ffi_load32((p0) + 32)); index93 = index93 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 28)) + (index93 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 28)) + + } + _ => panic() + } + + } + _ => panic() + } + +} + +#doc(hidden) +pub fn wasmExportGetTool(p0 : Int, p1 : Int) -> Int { + + let result = mbt_ffi_ptr2str(p0, p1) + + let (result0) : (Result[@common.Tool, @common.ToolError]) = get_tool(result); + let return_area = mbt_ffi_malloc(40) + + match result0 { + Ok(payload) => { + mbt_ffi_store8((return_area) + 0, (0)) + __wit_bindgen_lower_t510((return_area) + 4, payload) + + () + } + Err(payload1) => { + mbt_ffi_store8((return_area) + 0, (1)) + __wit_bindgen_lower_t511((return_area) + 4, payload1) + + () + } + } + let ret = return_area + return ret + +} + +#doc(hidden) +pub fn wasmExportGetToolPostReturn(p0 : Int) -> Unit { + + match (mbt_ffi_load8_u((p0) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 4)) + + for index46 = 0; index46 < (mbt_ffi_load32((p0) + 16)); index46 = index46 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 12)) + (index46 * 324) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + for index = 0; index < (mbt_ffi_load32((iter_base) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index0 = 0; index0 < (mbt_ffi_load32((iter_base) + 36)); index0 = index0 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index0 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + for index4 = 0; index4 < (mbt_ffi_load32((iter_base) + 44)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index4 * 112) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + for index1 = 0; index1 < (mbt_ffi_load32((iter_base) + 20)); index1 = index1 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + for index2 = 0; index2 < (mbt_ffi_load32((iter_base) + 44)); index2 = index2 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index2 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => { + + for index3 = 0; index3 < (mbt_ffi_load32((iter_base) + 88)); index3 = index3 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 84)) + (index3 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 100)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 104)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + for index7 = 0; index7 < (mbt_ffi_load32((iter_base) + 52)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index7 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + for index5 = 0; index5 < (mbt_ffi_load32((iter_base) + 20)); index5 = index5 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index5 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + for index6 = 0; index6 < (mbt_ffi_load32((iter_base) + 44)); index6 = index6 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index6 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 72)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index10 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 28)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index8 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + match (mbt_ffi_load8_u((iter_base) + 32)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => () + 1 => { + + for index9 = 0; index9 < (mbt_ffi_load32((iter_base) + 56)); index9 = index9 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 52)) + (index9 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 80)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 96)) + + for index11 = 0; index11 < (mbt_ffi_load32((iter_base) + 108)); index11 = index11 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 104)) + (index11 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 104)) + + match (mbt_ffi_load8_u((iter_base) + 112)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 116)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 140)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 144)) + + } + _ => panic() + } + + } + _ => panic() + } + + for index15 = 0; index15 < (mbt_ffi_load32((iter_base) + 160)); index15 = index15 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 156)) + (index15 * 112) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + for index12 = 0; index12 < (mbt_ffi_load32((iter_base) + 20)); index12 = index12 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index12 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + for index13 = 0; index13 < (mbt_ffi_load32((iter_base) + 44)); index13 = index13 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index13 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => { + + for index14 = 0; index14 < (mbt_ffi_load32((iter_base) + 88)); index14 = index14 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 84)) + (index14 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 100)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 104)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 156)) + + for index18 = 0; index18 < (mbt_ffi_load32((iter_base) + 168)); index18 = index18 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 164)) + (index18 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + for index16 = 0; index16 < (mbt_ffi_load32((iter_base) + 20)); index16 = index16 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index16 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + for index17 = 0; index17 < (mbt_ffi_load32((iter_base) + 44)); index17 = index17 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index17 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 164)) + + for index36 = 0; index36 < (mbt_ffi_load32((iter_base) + 176)); index36 = index36 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 172)) + (index36 * 28) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + for index20 = 0; index20 < (mbt_ffi_load32((iter_base) + 8)); index20 = index20 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index20 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index19 = 0; index19 < (mbt_ffi_load32((iter_base) + 16)); index19 = index19 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index19 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + + for index22 = 0; index22 < (mbt_ffi_load32((iter_base) + 8)); index22 = index22 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index22 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index21 = 0; index21 < (mbt_ffi_load32((iter_base) + 16)); index21 = index21 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index21 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 2 => { + + for index24 = 0; index24 < (mbt_ffi_load32((iter_base) + 8)); index24 = index24 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index24 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index23 = 0; index23 < (mbt_ffi_load32((iter_base) + 16)); index23 = index23 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index23 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 3 => { + + for index27 = 0; index27 < (mbt_ffi_load32((iter_base) + 8)); index27 = index27 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index27 * 8) + + for index26 = 0; index26 < (mbt_ffi_load32((iter_base) + 4)); index26 = index26 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index26 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index25 = 0; index25 < (mbt_ffi_load32((iter_base) + 16)); index25 = index25 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index25 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 4 => { + + for index29 = 0; index29 < (mbt_ffi_load32((iter_base) + 12)); index29 = index29 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index29 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index28 = 0; index28 < (mbt_ffi_load32((iter_base) + 16)); index28 = index28 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index28 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index31 = 0; index31 < (mbt_ffi_load32((iter_base) + 24)); index31 = index31 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index31 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index30 = 0; index30 < (mbt_ffi_load32((iter_base) + 16)); index30 = index30 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index30 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 5 => { + + for index33 = 0; index33 < (mbt_ffi_load32((iter_base) + 12)); index33 = index33 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index33 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index32 = 0; index32 < (mbt_ffi_load32((iter_base) + 16)); index32 = index32 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index32 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index35 = 0; index35 < (mbt_ffi_load32((iter_base) + 20)); index35 = index35 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index35 * 24) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + for index34 = 0; index34 < (mbt_ffi_load32((iter_base) + 16)); index34 = index34 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index34 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 172)) + + match (mbt_ffi_load8_u((iter_base) + 180)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 184)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 192)) + + for index37 = 0; index37 < (mbt_ffi_load32((iter_base) + 204)); index37 = index37 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 200)) + (index37 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 200)) + + for index38 = 0; index38 < (mbt_ffi_load32((iter_base) + 212)); index38 = index38 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 208)) + (index38 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 208)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 220)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 224)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 232)) + + for index39 = 0; index39 < (mbt_ffi_load32((iter_base) + 244)); index39 = index39 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 240)) + (index39 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 240)) + + for index40 = 0; index40 < (mbt_ffi_load32((iter_base) + 252)); index40 = index40 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 248)) + (index40 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 248)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 260)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 268)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 276)) + + for index41 = 0; index41 < (mbt_ffi_load32((iter_base) + 288)); index41 = index41 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 284)) + (index41 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 284)) + + for index43 = 0; index43 < (mbt_ffi_load32((iter_base) + 296)); index43 = index43 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 292)) + (index43 * 32) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + for index42 = 0; index42 < (mbt_ffi_load32((iter_base) + 28)); index42 = index42 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index42 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 292)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 300)) + + } + _ => panic() + } + + for index45 = 0; index45 < (mbt_ffi_load32((iter_base) + 312)); index45 = index45 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 308)) + (index45 * 44) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + for index44 = 0; index44 < (mbt_ffi_load32((iter_base) + 28)); index44 = index44 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index44 * 16) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 308)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 12)) + + for index67 = 0; index67 < (mbt_ffi_load32((p0) + 24)); index67 = index67 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 20)) + (index67 * 144) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 3 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 5 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 7 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 8 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 9 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 10 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 11 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 12 => () + 13 => () + 14 => { + + for index49 = 0; index49 < (mbt_ffi_load32((iter_base) + 12)); index49 = index49 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index49 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index47 = 0; index47 < (mbt_ffi_load32((iter_base) + 28)); index47 = index47 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index47 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index48 = 0; index48 < (mbt_ffi_load32((iter_base) + 36)); index48 = index48 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index48 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index52 = 0; index52 < (mbt_ffi_load32((iter_base) + 12)); index52 = index52 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index52 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index50 = 0; index50 < (mbt_ffi_load32((iter_base) + 32)); index50 = index50 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index50 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index51 = 0; index51 < (mbt_ffi_load32((iter_base) + 40)); index51 = index51 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index51 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 16 => { + + for index53 = 0; index53 < (mbt_ffi_load32((iter_base) + 12)); index53 = index53 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index53 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + + for index54 = 0; index54 < (mbt_ffi_load32((iter_base) + 12)); index54 = index54 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index54 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index55 = 0; index55 < (mbt_ffi_load32((iter_base) + 16)); index55 = index55 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index55 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + } + 25 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index56 = 0; index56 < (mbt_ffi_load32((iter_base) + 16)); index56 = index56 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index56 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 26 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + + for index57 = 0; index57 < (mbt_ffi_load32((iter_base) + 20)); index57 = index57 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index57 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + + for index58 = 0; index58 < (mbt_ffi_load32((iter_base) + 32)); index58 = index58 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index58 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 27 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index59 = 0; index59 < (mbt_ffi_load32((iter_base) + 16)); index59 = index59 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index59 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { + + for index60 = 0; index60 < (mbt_ffi_load32((iter_base) + 28)); index60 = index60 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index60 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index61 = 0; index61 < (mbt_ffi_load32((iter_base) + 20)); index61 = index61 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index61 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + } + _ => panic() + } + + } + 31 => { + + for index64 = 0; index64 < (mbt_ffi_load32((iter_base) + 12)); index64 = index64 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index64 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index62 = 0; index62 < (mbt_ffi_load32((iter_base) + 52)); index62 = index62 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index62 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index63 = 0; index63 < (mbt_ffi_load32((iter_base) + 60)); index63 = index63 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index63 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index65 = 0; index65 < (mbt_ffi_load32((iter_base) + 104)); index65 = index65 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index65 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index66 = 0; index66 < (mbt_ffi_load32((iter_base) + 112)); index66 = index66 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index66 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 20)) + + for index68 = 0; index68 < (mbt_ffi_load32((p0) + 32)); index68 = index68 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 28)) + (index68 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 28)) + + } + 1 => { + + match (mbt_ffi_load8_u((p0) + 4)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 1 => { + + for index69 = 0; index69 < (mbt_ffi_load32((p0) + 12)); index69 = index69 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 8)) + (index69 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + } + 5 => { + + for index90 = 0; index90 < (mbt_ffi_load32((p0) + 12)); index90 = index90 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 8)) + (index90 * 144) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 3 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 5 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 7 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 8 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 9 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 10 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 11 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 12 => () + 13 => () + 14 => { + + for index72 = 0; index72 < (mbt_ffi_load32((iter_base) + 12)); index72 = index72 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index72 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index70 = 0; index70 < (mbt_ffi_load32((iter_base) + 28)); index70 = index70 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index70 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index71 = 0; index71 < (mbt_ffi_load32((iter_base) + 36)); index71 = index71 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index71 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index75 = 0; index75 < (mbt_ffi_load32((iter_base) + 12)); index75 = index75 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index75 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index73 = 0; index73 < (mbt_ffi_load32((iter_base) + 32)); index73 = index73 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index73 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index74 = 0; index74 < (mbt_ffi_load32((iter_base) + 40)); index74 = index74 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index74 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 16 => { + + for index76 = 0; index76 < (mbt_ffi_load32((iter_base) + 12)); index76 = index76 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index76 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + + for index77 = 0; index77 < (mbt_ffi_load32((iter_base) + 12)); index77 = index77 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index77 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index78 = 0; index78 < (mbt_ffi_load32((iter_base) + 16)); index78 = index78 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index78 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + } + 25 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index79 = 0; index79 < (mbt_ffi_load32((iter_base) + 16)); index79 = index79 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index79 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 26 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + + for index80 = 0; index80 < (mbt_ffi_load32((iter_base) + 20)); index80 = index80 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index80 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + + for index81 = 0; index81 < (mbt_ffi_load32((iter_base) + 32)); index81 = index81 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index81 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 27 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index82 = 0; index82 < (mbt_ffi_load32((iter_base) + 16)); index82 = index82 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index82 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { + + for index83 = 0; index83 < (mbt_ffi_load32((iter_base) + 28)); index83 = index83 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index83 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index84 = 0; index84 < (mbt_ffi_load32((iter_base) + 20)); index84 = index84 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index84 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + } + _ => panic() + } + + } + 31 => { + + for index87 = 0; index87 < (mbt_ffi_load32((iter_base) + 12)); index87 = index87 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index87 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index85 = 0; index85 < (mbt_ffi_load32((iter_base) + 52)); index85 = index85 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index85 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index86 = 0; index86 < (mbt_ffi_load32((iter_base) + 60)); index86 = index86 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index86 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index88 = 0; index88 < (mbt_ffi_load32((iter_base) + 104)); index88 = index88 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index88 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index89 = 0; index89 < (mbt_ffi_load32((iter_base) + 112)); index89 = index89 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index89 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + for index91 = 0; index91 < (mbt_ffi_load32((p0) + 20)); index91 = index91 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 16)) + (index91 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 16)) + + for index92 = 0; index92 < (mbt_ffi_load32((p0) + 32)); index92 = index92 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 28)) + (index92 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((p0) + 28)) + + } + _ => panic() + } + + } + _ => panic() + } + +} + +fn wasmImportExportGolemToolGuest010InvokeStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "[export]golem:tool/guest@0.1.0" "[async-lower][stream-read-0]invoke" +fn wasmImportExportGolemToolGuest010InvokeStream0CancelRead(handle : Int) -> Int = "[export]golem:tool/guest@0.1.0" "[stream-cancel-read-0]invoke" + +fn wasmImportExportGolemToolGuest010InvokeStream0DropReadable(handle : Int) = "[export]golem:tool/guest@0.1.0" "[stream-drop-readable-0]invoke" + +fn wasmExportGolemToolGuest010InvokeStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr +} + +fn wasmExportGolemToolGuest010InvokeStream0Reject( +ptr : Int, +start : Int, +length : Int, +) -> Unit { + ignore((ptr, start, length)) +} + +fn wasmExportGolemToolGuest010InvokeStream0ListLift( +ptr : Int, +length : Int, +) -> FixedArray[Byte] { + mbt_ffi_ptr2bytes(ptr, length) +} + +priv struct WasmExportGolemToolGuest010InvokeStream0StreamSource { + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar +} + +fn WasmExportGolemToolGuest010InvokeStream0StreamSource::finish_read( +self : WasmExportGolemToolGuest010InvokeStream0StreamSource, +) -> Unit { + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. +} + +async fn WasmExportGolemToolGuest010InvokeStream0StreamSource::wait_for_read_cleanup( +self : WasmExportGolemToolGuest010InvokeStream0StreamSource, +) -> Unit noraise { + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () + } +} + +async fn WasmExportGolemToolGuest010InvokeStream0StreamSource::cancel_active_read( +self : WasmExportGolemToolGuest010InvokeStream0StreamSource, +) -> Unit noraise { + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, + self.handle, + () => wasmImportExportGolemToolGuest010InvokeStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmExportGolemToolGuest010InvokeStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() +} + +async fn WasmExportGolemToolGuest010InvokeStream0StreamSource::close( +self : WasmExportGolemToolGuest010InvokeStream0StreamSource, +) -> Unit noraise { + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportExportGolemToolGuest010InvokeStream0DropReadable(self.handle) +} + +fn WasmExportGolemToolGuest010InvokeStream0StreamSource::close_sync( +self : WasmExportGolemToolGuest010InvokeStream0StreamSource, +) -> Unit { + if self.closed || self.reading { + return + } + + self.closed = true + wasmImportExportGolemToolGuest010InvokeStream0DropReadable(self.handle) +} + +async fn WasmExportGolemToolGuest010InvokeStream0StreamSource::read( +self : WasmExportGolemToolGuest010InvokeStream0StreamSource, +count : Int, +) -> FixedArray[Byte]? { + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmExportGolemToolGuest010InvokeStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( + self.handle, + wasmImportExportGolemToolGuest010InvokeStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportExportGolemToolGuest010InvokeStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) + } + let values = wasmExportGolemToolGuest010InvokeStream0ListLift(ptr, progress) + owns_buffer = true + self.finish_read() + if end { + self.close() + } + Some(values) +} + +fn wasmExportGolemToolGuest010InvokeStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmExportGolemToolGuest010InvokeStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) +} + +fn wasmImportExportGolemToolGuest010InvokeStream1DropReadable(handle : Int) = "[export]golem:tool/guest@0.1.0" "[stream-drop-readable-0]invoke" + +fn wasmImportExportGolemToolGuest010InvokeStream1New() -> UInt64 = "[export]golem:tool/guest@0.1.0" "[stream-new-0]invoke" +fn wasmImportExportGolemToolGuest010InvokeStream1Write(handle : Int, buffer_ptr : Int, length : Int) -> Int = "[export]golem:tool/guest@0.1.0" "[async-lower][stream-write-0]invoke" + +fn wasmImportExportGolemToolGuest010InvokeStream1CancelWrite(handle : Int) -> Int = "[export]golem:tool/guest@0.1.0" "[stream-cancel-write-0]invoke" + +fn wasmImportExportGolemToolGuest010InvokeStream1DropWritable(handle : Int) = "[export]golem:tool/guest@0.1.0" "[stream-drop-writable-0]invoke" + +fn wasmExportGolemToolGuest010InvokeStream1Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr +} + +fn wasmExportGolemToolGuest010InvokeStream1Commit( +ptr : Int, +start : Int, +length : Int, +) -> Unit { + ignore((ptr, start, length)) +} + +fn wasmExportGolemToolGuest010InvokeStream1Reject( +ptr : Int, +start : Int, +length : Int, +) -> Unit { + ignore((ptr, start, length)) +} + +fn wasmExportGolemToolGuest010InvokeStream1Lower(value : Byte, ptr : Int) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).to_int()) + +} + +priv struct WasmExportGolemToolGuest010InvokeStream1StreamProducer { + stream : @async-core.Stream[Byte] + writer : Int +} + +let wasmExportGolemToolGuest010InvokeStream1StreamProducers : Map[Int, WasmExportGolemToolGuest010InvokeStream1StreamProducer] = Map([]) + +fn wasmExportGolemToolGuest010InvokeStream1StreamCommit(handle : Int) -> Unit { + guard wasmExportGolemToolGuest010InvokeStream1StreamProducers.get(handle) is Some(prepared) else { + return + } + wasmExportGolemToolGuest010InvokeStream1StreamProducers.remove(handle) + let stream = prepared.stream + let writer = prepared.writer + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let producer = stream.take_producer() + @async-core.spawn_component_task_current(async fn() { + let writer_closed = Ref(false) + let writer_lock = @async-core.Mutex() + let close_writer = fn() -> Unit { + if !writer_closed.val { + writer_closed.val = true + wasmImportExportGolemToolGuest010InvokeStream1DropWritable(writer) + } + } + let close_writer_serialized = async fn() -> Unit { + writer_lock.acquire() + defer writer_lock.release() + close_writer() + } + let cleanup_value = fn(value : Byte) -> Unit { + let ptr = wasmExportGolemToolGuest010InvokeStream1Malloc(1) + wasmExportGolemToolGuest010InvokeStream1Lower(value, ptr) + wasmExportGolemToolGuest010InvokeStream1Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + } + let sink = @async-core.Sink::from_callbacks( + (data : ArrayView[Byte]) => { + writer_lock.acquire() + defer writer_lock.release() + if writer_closed.val || data.length() == 0 { + return 0 + } + let data_len = if data.length() < 64 { + data.length() + } else { + 64 + } + let ptr = wasmExportGolemToolGuest010InvokeStream1Malloc(data_len) + for i in 0.. Unit { + wasmExportGolemToolGuest010InvokeStream1Commit(ptr, 0, transferred) + if transferred < data_len { + wasmExportGolemToolGuest010InvokeStream1Reject( + ptr, + transferred, + data_len - transferred, + ) + } + mbt_ffi_free(ptr) + } + let mut total = 0 + let mut dropped = false + while total < data_len { + let (progress, end) = @async-core.suspend_for_stream_write( + writer, + wasmImportExportGolemToolGuest010InvokeStream1Write( + writer, + ptr + total * 1, + data_len - total, + ), + ) catch { + _ => { + total = total + @async-core.cancel_stream_write( + writer, + () => wasmImportExportGolemToolGuest010InvokeStream1CancelWrite(writer), + ) + settle_staging(total) + close_writer() + return data_len + } + } + total = total + progress + if end { + dropped = true + break + } + } + settle_staging(total) + if dropped { + close_writer() + } + // The canonical writer accepted `total`; generated cleanup + // consumed the rest of this staging window. + data_len + }, + () => close_writer_serialized(), + () => !writer_closed.val, + Some(cleanup_value), + ) + let relay_source = producer is None + let run_producer = async fn() -> Unit { + match producer { + Some(producer) => { + producer(sink) + sink.close() + } + None => + for ;; { + match stream.read(64) { + Some(data) => + if !sink.write_all(data[:]) { + stream.reject(cleanup_value) + return + } + None => { + sink.close() + return + } + } + } + } + } + run_producer() catch { + _ => + if relay_source { + @async-core.protect_from_cancel( + () => stream.reject(cleanup_value), + resume_on_cancel=true, + ) catch { + _ => () + } + } + } + // A retained Sink may still own an in-flight canonical write after its + // producer returns. Do not drop the writable endpoint until that write + // has reached a terminal event and released its staging buffer. + @async-core.protect_from_cancel( + () => close_writer_serialized(), + resume_on_cancel=true, + ) + }) +} + +fn wasmExportGolemToolGuest010InvokeStream1StreamLower(stream : @async-core.Stream[Byte]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let pair = wasmImportExportGolemToolGuest010InvokeStream1New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmExportGolemToolGuest010InvokeStream1StreamProducers.set(reader, { stream, writer }) + reader +} + +fn wasmExportGolemToolGuest010InvokeStream1StreamLowerCommitted(stream : @async-core.Stream[Byte]) -> Int { + let reader = wasmExportGolemToolGuest010InvokeStream1StreamLower(stream) + wasmExportGolemToolGuest010InvokeStream1StreamCommit(reader) + reader +} + +#doc(hidden) +pub fn wasmExportInvokeGolemToolGuest(p0 : Int) -> Int { + @async-core.with_waitableset(async fn() { + @async-core.with_task_group(async fn(background_group) { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 0), mbt_ffi_load32((p0) + 4)) + + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((p0) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((p0) + 8)) + (index * 8) + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result0) + } + mbt_ffi_free(mbt_ffi_load32((p0) + 8)) + + let array196 : Array[@types.SchemaTypeNode] = []; + for index197 = 0; index197 < (mbt_ffi_load32((p0) + 20)); index197 = index197 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 16)) + (index197 * 144) + + let lifted182 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted6 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted) + } + _ => panic() + } + + let lifted3 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2) + } + _ => panic() + } + + let lifted5 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result4) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1, max : lifted3, unit : lifted5}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted6) + } + 3 => { + + let lifted13 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted8 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted7 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted7) + } + _ => panic() + } + + let lifted10 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted9 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted9) + } + _ => panic() + } + + let lifted12 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result11 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result11) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted8, max : lifted10, unit : lifted12}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted13) + } + 4 => { + + let lifted20 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted15 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted14 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted14) + } + _ => panic() + } + + let lifted17 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted16 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted16) + } + _ => panic() + } + + let lifted19 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result18) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted15, max : lifted17, unit : lifted19}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted20) + } + 5 => { + + let lifted27 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted22 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted21 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted21) + } + _ => panic() + } + + let lifted24 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted23 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted23) + } + _ => panic() + } + + let lifted26 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result25 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result25) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted22, max : lifted24, unit : lifted26}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted27) + } + 6 => { + + let lifted34 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted29 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted28 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted28) + } + _ => panic() + } + + let lifted31 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted30 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted30) + } + _ => panic() + } + + let lifted33 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result32 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result32) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted29, max : lifted31, unit : lifted33}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted34) + } + 7 => { + + let lifted41 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted36 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted35 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted35) + } + _ => panic() + } + + let lifted38 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted37 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted37) + } + _ => panic() + } + + let lifted40 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result39 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result39) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted36, max : lifted38, unit : lifted40}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted41) + } + 8 => { + + let lifted48 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted43 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted42 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted42) + } + _ => panic() + } + + let lifted45 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted44 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted44) + } + _ => panic() + } + + let lifted47 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result46 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result46) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted43, max : lifted45, unit : lifted47}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted48) + } + 9 => { + + let lifted55 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted50 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted49 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted49) + } + _ => panic() + } + + let lifted52 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted51 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted51) + } + _ => panic() + } + + let lifted54 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result53 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result53) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted50, max : lifted52, unit : lifted54}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted55) + } + 10 => { + + let lifted62 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted57 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted56 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted56) + } + _ => panic() + } + + let lifted59 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted58 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted58) + } + _ => panic() + } + + let lifted61 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result60 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result60) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted57, max : lifted59, unit : lifted61}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted62) + } + 11 => { + + let lifted69 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted64 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted63 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted63) + } + _ => panic() + } + + let lifted66 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted65 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted65) + } + _ => panic() + } + + let lifted68 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result67 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result67) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted64, max : lifted66, unit : lifted68}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted69) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array84 : Array[@types.NamedFieldType] = []; + for index85 = 0; index85 < (mbt_ffi_load32((iter_base) + 12)); index85 = index85 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index85 * 68) + + let result70 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted72 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result71 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result71) + } + _ => panic() + } + + let array74 : Array[String] = []; + for index75 = 0; index75 < (mbt_ffi_load32((iter_base) + 28)); index75 = index75 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index75 * 8) + + let result73 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array74.push(result73) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array77 : Array[String] = []; + for index78 = 0; index78 < (mbt_ffi_load32((iter_base) + 36)); index78 = index78 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index78 * 8) + + let result76 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array77.push(result76) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted80 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result79 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result79) + } + _ => panic() + } + + let lifted83 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted82 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result81 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result81) + } + _ => panic() + } + + Option::Some(lifted82) + } + _ => panic() + } + + array84.push(@types.NamedFieldType::{name : result70, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted72, aliases : array74, examples : array77, deprecated : lifted80, role : lifted83}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array84) + } + 15 => { + + let array101 : Array[@types.VariantCaseType] = []; + for index102 = 0; index102 < (mbt_ffi_load32((iter_base) + 12)); index102 = index102 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index102 * 72) + + let result86 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted87 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted89 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result88 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result88) + } + _ => panic() + } + + let array91 : Array[String] = []; + for index92 = 0; index92 < (mbt_ffi_load32((iter_base) + 32)); index92 = index92 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index92 * 8) + + let result90 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array91.push(result90) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array94 : Array[String] = []; + for index95 = 0; index95 < (mbt_ffi_load32((iter_base) + 40)); index95 = index95 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index95 * 8) + + let result93 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array94.push(result93) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted97 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result96 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result96) + } + _ => panic() + } + + let lifted100 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted99 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result98 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result98) + } + _ => panic() + } + + Option::Some(lifted99) + } + _ => panic() + } + + array101.push(@types.VariantCaseType::{name : result86, payload : lifted87, metadata : @types.MetadataEnvelope::{doc : lifted89, aliases : array91, examples : array94, deprecated : lifted97, role : lifted100}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array101) + } + 16 => { + + let array104 : Array[String] = []; + for index105 = 0; index105 < (mbt_ffi_load32((iter_base) + 12)); index105 = index105 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index105 * 8) + + let result103 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array104.push(result103) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array104) + } + 17 => { + + let array107 : Array[String] = []; + for index108 = 0; index108 < (mbt_ffi_load32((iter_base) + 12)); index108 = index108 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index108 * 8) + + let result106 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array107.push(result106) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array107) + } + 18 => { + + let array109 : Array[Int] = []; + for index110 = 0; index110 < (mbt_ffi_load32((iter_base) + 12)); index110 = index110 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index110 * 4) + + array109.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array109) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted111 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted112 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted111, err : lifted112}) + } + 24 => { + + let lifted116 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array114 : Array[String] = []; + for index115 = 0; index115 < (mbt_ffi_load32((iter_base) + 16)); index115 = index115 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index115 * 8) + + let result113 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array114.push(result113) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array114) + } + _ => panic() + } + + let lifted117 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted118 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted120 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result119 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result119) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted116, min_length : lifted117, max_length : lifted118, regex : lifted120}) + } + 25 => { + + let lifted124 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array122 : Array[String] = []; + for index123 = 0; index123 < (mbt_ffi_load32((iter_base) + 16)); index123 = index123 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index123 * 8) + + let result121 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array122.push(result121) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array122) + } + _ => panic() + } + + let lifted125 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted126 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted124, min_bytes : lifted125, max_bytes : lifted126}) + } + 26 => { + + let lifted130 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array128 : Array[String] = []; + for index129 = 0; index129 < (mbt_ffi_load32((iter_base) + 20)); index129 = index129 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index129 * 8) + + let result127 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array128.push(result127) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array128) + } + _ => panic() + } + + let lifted134 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array132 : Array[String] = []; + for index133 = 0; index133 < (mbt_ffi_load32((iter_base) + 32)); index133 = index133 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index133 * 8) + + let result131 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array132.push(result131) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array132) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted130, allowed_extensions : lifted134}) + } + 27 => { + + let lifted138 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array136 : Array[String] = []; + for index137 = 0; index137 < (mbt_ffi_load32((iter_base) + 16)); index137 = index137 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index137 * 8) + + let result135 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array136.push(result135) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array136) + } + _ => panic() + } + + let lifted142 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array140 : Array[String] = []; + for index141 = 0; index141 < (mbt_ffi_load32((iter_base) + 28)); index141 = index141 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index141 * 8) + + let result139 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array140.push(result139) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array140) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted138, allowed_hosts : lifted142}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result143 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array145 : Array[String] = []; + for index146 = 0; index146 < (mbt_ffi_load32((iter_base) + 20)); index146 = index146 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index146 * 8) + + let result144 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array145.push(result144) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted148 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result147 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result147}) + } + _ => panic() + } + + let lifted150 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result149 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result149}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result143, allowed_suffixes : array145, min : lifted148, max : lifted150}) + } + 31 => { + + let array174 : Array[@types.UnionBranch] = []; + for index175 = 0; index175 < (mbt_ffi_load32((iter_base) + 12)); index175 = index175 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index175 * 92) + + let result151 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted160 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result152 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result152) + } + 1 => { + + let result153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result153) + } + 2 => { + + let result154 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result154) + } + 3 => { + + let result155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result155) + } + 4 => { + + let result156 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted158 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result157 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result157) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result156, literal : lifted158}) + } + 5 => { + + let result159 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result159) + } + _ => panic() + } + + let lifted162 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result161 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result161) + } + _ => panic() + } + + let array164 : Array[String] = []; + for index165 = 0; index165 < (mbt_ffi_load32((iter_base) + 52)); index165 = index165 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index165 * 8) + + let result163 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array164.push(result163) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array167 : Array[String] = []; + for index168 = 0; index168 < (mbt_ffi_load32((iter_base) + 60)); index168 = index168 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index168 * 8) + + let result166 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array167.push(result166) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted170 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result169 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result169) + } + _ => panic() + } + + let lifted173 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted172 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result171 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result171) + } + _ => panic() + } + + Option::Some(lifted172) + } + _ => panic() + } + + array174.push(@types.UnionBranch::{tag : result151, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted160, metadata : @types.MetadataEnvelope::{doc : lifted162, aliases : array164, examples : array167, deprecated : lifted170, role : lifted173}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array174}) + } + 32 => { + + let lifted177 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result176 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result176) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted177}) + } + 33 => { + + let lifted179 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result178 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result178) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted179}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted180 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted180) + } + 36 => { + + let lifted181 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted181) + } + _ => panic() + } + + let lifted184 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result183 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result183) + } + _ => panic() + } + + let array186 : Array[String] = []; + for index187 = 0; index187 < (mbt_ffi_load32((iter_base) + 104)); index187 = index187 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index187 * 8) + + let result185 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array186.push(result185) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array189 : Array[String] = []; + for index190 = 0; index190 < (mbt_ffi_load32((iter_base) + 112)); index190 = index190 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index190 * 8) + + let result188 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array189.push(result188) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted192 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result191 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result191) + } + _ => panic() + } + + let lifted195 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted194 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result193 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result193) + } + _ => panic() + } + + Option::Some(lifted194) + } + _ => panic() + } + + array196.push(@types.SchemaTypeNode::{body : lifted182, metadata : @types.MetadataEnvelope::{doc : lifted184, aliases : array186, examples : array189, deprecated : lifted192, role : lifted195}}) + } + mbt_ffi_free(mbt_ffi_load32((p0) + 16)) + + let array201 : Array[@types.SchemaTypeDef] = []; + for index202 = 0; index202 < (mbt_ffi_load32((p0) + 28)); index202 = index202 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 24)) + (index202 * 24) + + let result198 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted200 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result199 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result199) + } + _ => panic() + } + + array201.push(@types.SchemaTypeDef::{id : result198, name : lifted200, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((p0) + 24)) + + let array232 : Array[@types.SchemaValueNode] = []; + for index233 = 0; index233 < (mbt_ffi_load32((p0) + 40)); index233 = index233 + 1 { + let iter_base = (mbt_ffi_load32((p0) + 36)) + (index233 * 32) + + let lifted231 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result203 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result203) + } + 13 => { + + let array204 : Array[Int] = []; + for index205 = 0; index205 < (mbt_ffi_load32((iter_base) + 12)); index205 = index205 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index205 * 4) + + array204.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array204) + } + 14 => { + + let lifted206 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted206}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array207 : Array[Bool] = []; + for index208 = 0; index208 < (mbt_ffi_load32((iter_base) + 12)); index208 = index208 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index208 * 1) + + array207.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array207) + } + 17 => { + + let array209 : Array[Int] = []; + for index210 = 0; index210 < (mbt_ffi_load32((iter_base) + 12)); index210 = index210 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index210 * 4) + + array209.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array209) + } + 18 => { + + let array211 : Array[Int] = []; + for index212 = 0; index212 < (mbt_ffi_load32((iter_base) + 12)); index212 = index212 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index212 * 4) + + array211.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array211) + } + 19 => { + + let array213 : Array[Int] = []; + for index214 = 0; index214 < (mbt_ffi_load32((iter_base) + 12)); index214 = index214 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index214 * 4) + + array213.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array213) + } + 20 => { + + let array215 : Array[@types.MapEntry] = []; + for index216 = 0; index216 < (mbt_ffi_load32((iter_base) + 12)); index216 = index216 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index216 * 8) + + array215.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array215) + } + 21 => { + + let lifted217 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted217) + } + 22 => { + + let lifted220 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted218 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted218) + } + 1 => { + + let lifted219 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted219) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted220) + } + 23 => { + + let result221 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted223 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result222 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result222) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result221, language : lifted223}) + } + 24 => { + + let result224 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted226 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result225 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result225) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result224, mime_type : lifted226}) + } + 25 => { + + let result227 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result227) + } + 26 => { + + let result228 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result228) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result229 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result229}) + } + 30 => { + + let result230 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result230, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array232.push(lifted231) + } + mbt_ffi_free(mbt_ffi_load32((p0) + 36)) + + let lifted235 : @async-core.Stream[Byte]? = match mbt_ffi_load8_u((p0) + 48) { + 0 => Option::None + 1 => { + let result234 = wasmExportGolemToolGuest010InvokeStream0StreamLift(mbt_ffi_load32((p0) + 52)) + + Option::Some(result234) + } + _ => panic() + } + + let lifted253 = match (mbt_ffi_load8_u((p0) + 56)) { + 0 => { + + let result236 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 64), mbt_ffi_load32((p0) + 68)) + + let result237 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 72), mbt_ffi_load32((p0) + 76)) + + let lifted239 : String? = match mbt_ffi_load8_u((p0) + 80) { + 0 => Option::None + 1 => { + + let result238 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 84), mbt_ffi_load32((p0) + 88)) + + Option::Some(result238) + } + _ => panic() + } + + let lifted241 : String? = match mbt_ffi_load8_u((p0) + 92) { + 0 => Option::None + 1 => { + + let result240 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 96), mbt_ffi_load32((p0) + 100)) + + Option::Some(result240) + } + _ => panic() + } + + let lifted242 : Bool? = match mbt_ffi_load8_u((p0) + 104) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load8_u((p0) + 105) != 0)) + } + _ => panic() + } + + let lifted244 : String? = match mbt_ffi_load8_u((p0) + 108) { + 0 => Option::None + 1 => { + + let result243 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 112), mbt_ffi_load32((p0) + 116)) + + Option::Some(result243) + } + _ => panic() + } + + let lifted246 : String? = match mbt_ffi_load8_u((p0) + 120) { + 0 => Option::None + 1 => { + + let result245 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 124), mbt_ffi_load32((p0) + 128)) + + Option::Some(result245) + } + _ => panic() + } + + let lifted248 : String? = match mbt_ffi_load8_u((p0) + 132) { + 0 => Option::None + 1 => { + + let result247 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 136), mbt_ffi_load32((p0) + 140)) + + Option::Some(result247) + } + _ => panic() + } + + let lifted250 : String? = match mbt_ffi_load8_u((p0) + 144) { + 0 => Option::None + 1 => { + + let result249 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 148), mbt_ffi_load32((p0) + 152)) + + Option::Some(result249) + } + _ => panic() + } + + let result251 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 156), mbt_ffi_load32((p0) + 160)) + + @common0.Principal::Oidc(@common0.OidcPrincipal::{sub : result236, issuer : result237, email : lifted239, name : lifted241, email_verified : lifted242, given_name : lifted244, family_name : lifted246, picture : lifted248, preferred_username : lifted250, claims : result251}) + } + 1 => { + + let result252 = mbt_ffi_ptr2str(mbt_ffi_load32((p0) + 80), mbt_ffi_load32((p0) + 84)) + + @common0.Principal::Agent(@common0.AgentPrincipal::{agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((p0) + 64)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((p0) + 72)).reinterpret_as_uint64()}}, agent_id : result252}}) + } + 2 => { + + @common0.Principal::GolemUser(@common0.GolemUserPrincipal::{account_id : @types.AccountId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((p0) + 64)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((p0) + 72)).reinterpret_as_uint64()}}}) + } + 3 => { + + @common0.Principal::Anonymous + } + _ => panic() + } + + let return_result: Ref[Result[@common.InvocationResult, @common.ToolError]?] = Ref(None) + return_result.val = Some(invoke(result, array, @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array196, defs : array201, root : mbt_ffi_load32((p0) + 32)}, value : @types.SchemaValueTree::{value_nodes : array232, root : mbt_ffi_load32((p0) + 44)}}, lifted235, lifted253, background_group)) + invoke_task_return(return_result) + + }) + }) +} + +fn wasmExportAsyncInvokeGolemToolGuestTaskReturn(p0: Int, p1: Int, p2: Int, p3: Int, p4: Int, p5: Int, p6: Int, p7: Int, p8: Int, p9: Int, p10: Int, p11: Int) = "[export]golem:tool/guest@0.1.0" "[task-return]invoke" + +fn invoke_task_return(return_result: Ref[Result[@common.InvocationResult, @common.ToolError]?]) -> Unit { + + match return_result.val { + Some(return_value) => { + + let cleanup_list : Array[Int] = [] + + let (lowered301,lowered302,lowered303,lowered304,lowered305,lowered306,lowered307,lowered308,lowered309,lowered310,lowered311,lowered312) = match return_value { + Ok(payload) => { + + let (lowered, lowered261, lowered262, lowered263, lowered264, lowered265, lowered266, lowered267, lowered268) = match ((payload).result) { + None => { + + ((0), 0, 0, 0, 0, 0, 0, 0, 0) + } + Some(payload255) => { + + let address = mbt_ffi_malloc((((payload255).graph).type_nodes).length() * 144); + for index256 = 0; index256 < (((payload255).graph).type_nodes).length(); index256 = index256 + 1 { + let iter_elem : @types.SchemaTypeNode = (((payload255).graph).type_nodes)[(index256)] + let iter_base = address + (index256 * 144); + __wit_bindgen_lower_t55((iter_base) + 0, iter_elem) + + } + + let address257 = mbt_ffi_malloc((((payload255).graph).defs).length() * 24); + for index258 = 0; index258 < (((payload255).graph).defs).length(); index258 = index258 + 1 { + let iter_elem : @types.SchemaTypeDef = (((payload255).graph).defs)[(index258)] + let iter_base = address257 + (index258 * 24); + __wit_bindgen_lower_t17((iter_base) + 0, iter_elem) + + } + + let address259 = mbt_ffi_malloc((((payload255).value).value_nodes).length() * 32); + for index260 = 0; index260 < (((payload255).value).value_nodes).length(); index260 = index260 + 1 { + let iter_elem : @types.SchemaValueNode = (((payload255).value).value_nodes)[(index260)] + let iter_base = address259 + (index260 * 32); + __wit_bindgen_lower_t74((iter_base) + 0, iter_elem) + + } + cleanup_list.push(address) + cleanup_list.push(address257) + cleanup_list.push(address259) + + ((1), address, (((payload255).graph).type_nodes).length(), address257, (((payload255).graph).defs).length(), ((payload255).graph).root, address259, (((payload255).value).value_nodes).length(), ((payload255).value).root) + } + } + + let (lowered271, lowered272) = match ((payload).stdout) { + None => { + + ((0), 0) + } + Some(payload270) => { + + ((1), wasmExportGolemToolGuest010InvokeStream1StreamLowerCommitted(payload270)) + } + } + + ((0), lowered, lowered261, lowered262, lowered263, lowered264, lowered265, lowered266, lowered267, lowered268, lowered271, lowered272) + } + Err(payload273) => { + + let (lowered292,lowered293,lowered294,lowered295,lowered296,lowered297,lowered298,lowered299,lowered300) = match payload273 { + InvalidToolName(payload274) => { + + let ptr = mbt_ffi_str2ptr(payload274) + cleanup_list.push(ptr) + + ((0), ptr, payload274.length(), 0, 0, 0, 0, 0, 0) + } + InvalidCommandPath(payload275) => { + + let address277 = mbt_ffi_malloc((payload275).length() * 8); + for index278 = 0; index278 < (payload275).length(); index278 = index278 + 1 { + let iter_elem : String = (payload275)[(index278)] + let iter_base = address277 + (index278 * 8); + + let ptr276 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr276) + cleanup_list.push(ptr276) + + } + cleanup_list.push(address277) + + ((1), address277, (payload275).length(), 0, 0, 0, 0, 0, 0) + } + InvalidInput(payload279) => { + + let ptr280 = mbt_ffi_str2ptr(payload279) + cleanup_list.push(ptr280) + + ((2), ptr280, payload279.length(), 0, 0, 0, 0, 0, 0) + } + ConstraintViolation(payload281) => { + + let ptr282 = mbt_ffi_str2ptr(payload281) + cleanup_list.push(ptr282) + + ((3), ptr282, payload281.length(), 0, 0, 0, 0, 0, 0) + } + InvalidResult(payload283) => { + + let ptr284 = mbt_ffi_str2ptr(payload283) + cleanup_list.push(ptr284) + + ((4), ptr284, payload283.length(), 0, 0, 0, 0, 0, 0) + } + CustomError(payload285) => { + + let address286 = mbt_ffi_malloc((((payload285).graph).type_nodes).length() * 144); + for index287 = 0; index287 < (((payload285).graph).type_nodes).length(); index287 = index287 + 1 { + let iter_elem : @types.SchemaTypeNode = (((payload285).graph).type_nodes)[(index287)] + let iter_base = address286 + (index287 * 144); + __wit_bindgen_lower_t55((iter_base) + 0, iter_elem) + + } + + let address288 = mbt_ffi_malloc((((payload285).graph).defs).length() * 24); + for index289 = 0; index289 < (((payload285).graph).defs).length(); index289 = index289 + 1 { + let iter_elem : @types.SchemaTypeDef = (((payload285).graph).defs)[(index289)] + let iter_base = address288 + (index289 * 24); + __wit_bindgen_lower_t17((iter_base) + 0, iter_elem) + + } + + let address290 = mbt_ffi_malloc((((payload285).value).value_nodes).length() * 32); + for index291 = 0; index291 < (((payload285).value).value_nodes).length(); index291 = index291 + 1 { + let iter_elem : @types.SchemaValueNode = (((payload285).value).value_nodes)[(index291)] + let iter_base = address290 + (index291 * 32); + __wit_bindgen_lower_t74((iter_base) + 0, iter_elem) + + } + cleanup_list.push(address286) + cleanup_list.push(address288) + cleanup_list.push(address290) + + ((5), address286, (((payload285).graph).type_nodes).length(), address288, (((payload285).graph).defs).length(), ((payload285).graph).root, address290, (((payload285).value).value_nodes).length(), ((payload285).value).root) + } + } + + ((1), lowered292, lowered293, lowered294, lowered295, lowered296, lowered297, lowered298, lowered299, lowered300, 0, 0) + } + } + + wasmExportAsyncInvokeGolemToolGuestTaskReturn(lowered301, lowered302, lowered303, lowered304, lowered305, lowered306, lowered307, lowered308, lowered309, lowered310, lowered311, lowered312) + + cleanup_list.each(mbt_ffi_free) + + @async-core.task_returned() + + } + None => () + } + +} + +#doc(hidden) +pub fn wasmExportAsyncInvokeGolemToolGuest(event_raw : Int, waitable : Int, code : Int) -> Int { + @async-core.cb(event_raw, waitable, code) +} + +#doc(hidden) +fn __wit_bindgen_lower_t5(ptr : Int, value : @types.Datetime) -> Unit { + mbt_ffi_store64((ptr) + 0, (value).seconds) + mbt_ffi_store32((ptr) + 8, ((value).nanoseconds).reinterpret_as_int()) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t17(ptr : Int, value : @types.SchemaTypeDef) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).id) + mbt_ffi_store32((ptr) + 4, (value).id.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + match ((value).name) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) + + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 16, payload1.length()) + mbt_ffi_store32((ptr) + 12, ptr2) + + () + } + } + mbt_ffi_store32((ptr) + 20, (value).body) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t18(ptr : Int, value : @types.Role) -> Unit { + + match value { + Multimodal => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((ptr) + 0, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((ptr) + 0, (2)) + + () + } + Other(payload2) => { + mbt_ffi_store8((ptr) + 0, (3)) + + let ptr3 = mbt_ffi_str2ptr(payload2) + mbt_ffi_store32((ptr) + 8, payload2.length()) + mbt_ffi_store32((ptr) + 4, ptr3) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t21(ptr : Int, value : @types.MetadataEnvelope) -> Unit { + + match ((value).doc) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let ptr1 = mbt_ffi_str2ptr(payload0) + mbt_ffi_store32((ptr) + 8, payload0.length()) + mbt_ffi_store32((ptr) + 4, ptr1) + + () + } + } + + let address = mbt_ffi_malloc(((value).aliases).length() * 8); + for index = 0; index < ((value).aliases).length(); index = index + 1 { + let iter_elem : String = ((value).aliases)[(index)] + let iter_base = address + (index * 8); + + let ptr2 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr2) + + } + mbt_ffi_store32((ptr) + 16, ((value).aliases).length()) + mbt_ffi_store32((ptr) + 12, address) + + let address4 = mbt_ffi_malloc(((value).examples).length() * 8); + for index5 = 0; index5 < ((value).examples).length(); index5 = index5 + 1 { + let iter_elem : String = ((value).examples)[(index5)] + let iter_base = address4 + (index5 * 8); + + let ptr3 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr3) + + } + mbt_ffi_store32((ptr) + 24, ((value).examples).length()) + mbt_ffi_store32((ptr) + 20, address4) + + match ((value).deprecated) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload7) => { + mbt_ffi_store8((ptr) + 28, (1)) + + let ptr8 = mbt_ffi_str2ptr(payload7) + mbt_ffi_store32((ptr) + 36, payload7.length()) + mbt_ffi_store32((ptr) + 32, ptr8) + + () + } + } + + match ((value).role) { + None => { + mbt_ffi_store8((ptr) + 40, (0)) + + () + } + Some(payload10) => { + mbt_ffi_store8((ptr) + 40, (1)) + __wit_bindgen_lower_t18((ptr) + 44, payload10) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t22(ptr : Int, value : @types.NamedFieldType) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).name) + mbt_ffi_store32((ptr) + 4, (value).name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + mbt_ffi_store32((ptr) + 8, (value).body) + __wit_bindgen_lower_t21((ptr) + 12, (value).metadata) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t24(ptr : Int, value : @types.VariantCaseType) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).name) + mbt_ffi_store32((ptr) + 4, (value).name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + match ((value).payload) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) + mbt_ffi_store32((ptr) + 12, payload1) + + () + } + } + __wit_bindgen_lower_t21((ptr) + 16, (value).metadata) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t25(ptr : Int, value : @types.FixedListSpec) -> Unit { + mbt_ffi_store32((ptr) + 0, (value).element) + mbt_ffi_store32((ptr) + 4, ((value).length).reinterpret_as_int()) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t26(ptr : Int, value : @types.MapSpec) -> Unit { + mbt_ffi_store32((ptr) + 0, (value).key) + mbt_ffi_store32((ptr) + 4, (value).value) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t27(ptr : Int, value : @types.ResultSpec) -> Unit { + + match ((value).ok) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + mbt_ffi_store32((ptr) + 4, payload0) + + () + } + } + + match ((value).err) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload2) => { + mbt_ffi_store8((ptr) + 8, (1)) + mbt_ffi_store32((ptr) + 12, payload2) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t28(ptr : Int, value : @types.NumericBound) -> Unit { + + match value { + Signed(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + mbt_ffi_store64((ptr) + 8, payload) + + () + } + Unsigned(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + mbt_ffi_store64((ptr) + 8, (payload0).reinterpret_as_int64()) + + () + } + FloatBits(payload1) => { + mbt_ffi_store8((ptr) + 0, (2)) + mbt_ffi_store64((ptr) + 8, (payload1).reinterpret_as_int64()) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t30(ptr : Int, value : @types.NumericRestrictions) -> Unit { + + match ((value).min) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + __wit_bindgen_lower_t28((ptr) + 8, payload0) + + () + } + } + + match ((value).max) { + None => { + mbt_ffi_store8((ptr) + 24, (0)) + + () + } + Some(payload2) => { + mbt_ffi_store8((ptr) + 24, (1)) + __wit_bindgen_lower_t28((ptr) + 32, payload2) + + () + } + } + + match ((value).unit) { + None => { + mbt_ffi_store8((ptr) + 48, (0)) + + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 48, (1)) + + let ptr5 = mbt_ffi_str2ptr(payload4) + mbt_ffi_store32((ptr) + 56, payload4.length()) + mbt_ffi_store32((ptr) + 52, ptr5) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t33(ptr : Int, value : @types.TextRestrictions) -> Unit { + + match ((value).languages) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let address = mbt_ffi_malloc((payload0).length() * 8); + for index = 0; index < (payload0).length(); index = index + 1 { + let iter_elem : String = (payload0)[(index)] + let iter_base = address + (index * 8); + + let ptr1 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + } + mbt_ffi_store32((ptr) + 8, (payload0).length()) + mbt_ffi_store32((ptr) + 4, address) + + () + } + } + + match ((value).min_length) { + None => { + mbt_ffi_store8((ptr) + 12, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((ptr) + 12, (1)) + mbt_ffi_store32((ptr) + 16, (payload3).reinterpret_as_int()) + + () + } + } + + match ((value).max_length) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) + + () + } + Some(payload5) => { + mbt_ffi_store8((ptr) + 20, (1)) + mbt_ffi_store32((ptr) + 24, (payload5).reinterpret_as_int()) + + () + } + } + + match ((value).regex) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload7) => { + mbt_ffi_store8((ptr) + 28, (1)) + + let ptr8 = mbt_ffi_str2ptr(payload7) + mbt_ffi_store32((ptr) + 36, payload7.length()) + mbt_ffi_store32((ptr) + 32, ptr8) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t34(ptr : Int, value : @types.BinaryRestrictions) -> Unit { + + match ((value).mime_types) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let address = mbt_ffi_malloc((payload0).length() * 8); + for index = 0; index < (payload0).length(); index = index + 1 { + let iter_elem : String = (payload0)[(index)] + let iter_base = address + (index * 8); + + let ptr1 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + } + mbt_ffi_store32((ptr) + 8, (payload0).length()) + mbt_ffi_store32((ptr) + 4, address) + + () + } + } + + match ((value).min_bytes) { + None => { + mbt_ffi_store8((ptr) + 12, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((ptr) + 12, (1)) + mbt_ffi_store32((ptr) + 16, (payload3).reinterpret_as_int()) + + () + } + } + + match ((value).max_bytes) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) + + () + } + Some(payload5) => { + mbt_ffi_store8((ptr) + 20, (1)) + mbt_ffi_store32((ptr) + 24, (payload5).reinterpret_as_int()) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t37(ptr : Int, value : @types.PathSpec) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).direction.ordinal()) + mbt_ffi_store8((ptr) + 1, (value).kind.ordinal()) + + match ((value).allowed_mime_types) { + None => { + mbt_ffi_store8((ptr) + 4, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 4, (1)) + + let address = mbt_ffi_malloc((payload0).length() * 8); + for index = 0; index < (payload0).length(); index = index + 1 { + let iter_elem : String = (payload0)[(index)] + let iter_base = address + (index * 8); + + let ptr1 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + } + mbt_ffi_store32((ptr) + 12, (payload0).length()) + mbt_ffi_store32((ptr) + 8, address) + + () + } + } + + match ((value).allowed_extensions) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let address5 = mbt_ffi_malloc((payload3).length() * 8); + for index6 = 0; index6 < (payload3).length(); index6 = index6 + 1 { + let iter_elem : String = (payload3)[(index6)] + let iter_base = address5 + (index6 * 8); + + let ptr4 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr4) + + } + mbt_ffi_store32((ptr) + 24, (payload3).length()) + mbt_ffi_store32((ptr) + 20, address5) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t38(ptr : Int, value : @types.UrlRestrictions) -> Unit { + + match ((value).allowed_schemes) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let address = mbt_ffi_malloc((payload0).length() * 8); + for index = 0; index < (payload0).length(); index = index + 1 { + let iter_elem : String = (payload0)[(index)] + let iter_base = address + (index * 8); + + let ptr1 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + } + mbt_ffi_store32((ptr) + 8, (payload0).length()) + mbt_ffi_store32((ptr) + 4, address) + + () + } + } + + match ((value).allowed_hosts) { + None => { + mbt_ffi_store8((ptr) + 12, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((ptr) + 12, (1)) + + let address5 = mbt_ffi_malloc((payload3).length() * 8); + for index6 = 0; index6 < (payload3).length(); index6 = index6 + 1 { + let iter_elem : String = (payload3)[(index6)] + let iter_base = address5 + (index6 * 8); + + let ptr4 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr4) + + } + mbt_ffi_store32((ptr) + 20, (payload3).length()) + mbt_ffi_store32((ptr) + 16, address5) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t39(ptr : Int, value : @types.QuantityValue) -> Unit { + mbt_ffi_store64((ptr) + 0, (value).mantissa) + mbt_ffi_store32((ptr) + 8, (value).scale) + + let ptr0 = mbt_ffi_str2ptr((value).unit) + mbt_ffi_store32((ptr) + 16, (value).unit.length()) + mbt_ffi_store32((ptr) + 12, ptr0) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t41(ptr : Int, value : @types.QuantitySpec) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).base_unit) + mbt_ffi_store32((ptr) + 4, (value).base_unit.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + let address = mbt_ffi_malloc(((value).allowed_suffixes).length() * 8); + for index = 0; index < ((value).allowed_suffixes).length(); index = index + 1 { + let iter_elem : String = ((value).allowed_suffixes)[(index)] + let iter_base = address + (index * 8); + + let ptr1 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + } + mbt_ffi_store32((ptr) + 12, ((value).allowed_suffixes).length()) + mbt_ffi_store32((ptr) + 8, address) + + match ((value).min) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload2) => { + mbt_ffi_store8((ptr) + 16, (1)) + __wit_bindgen_lower_t39((ptr) + 24, payload2) + + () + } + } + + match ((value).max) { + None => { + mbt_ffi_store8((ptr) + 48, (0)) + + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 48, (1)) + __wit_bindgen_lower_t39((ptr) + 56, payload4) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t42(ptr : Int, value : @types.FieldDiscriminator) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).field_name) + mbt_ffi_store32((ptr) + 4, (value).field_name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + match ((value).literal) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) + + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 16, payload1.length()) + mbt_ffi_store32((ptr) + 12, ptr2) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t43(ptr : Int, value : @types.DiscriminatorRule) -> Unit { + + match value { + Prefix(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + + let ptr0 = mbt_ffi_str2ptr(payload) + mbt_ffi_store32((ptr) + 8, payload.length()) + mbt_ffi_store32((ptr) + 4, ptr0) + + () + } + Suffix(payload1) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 8, payload1.length()) + mbt_ffi_store32((ptr) + 4, ptr2) + + () + } + Contains(payload3) => { + mbt_ffi_store8((ptr) + 0, (2)) + + let ptr4 = mbt_ffi_str2ptr(payload3) + mbt_ffi_store32((ptr) + 8, payload3.length()) + mbt_ffi_store32((ptr) + 4, ptr4) + + () + } + Regex(payload5) => { + mbt_ffi_store8((ptr) + 0, (3)) + + let ptr6 = mbt_ffi_str2ptr(payload5) + mbt_ffi_store32((ptr) + 8, payload5.length()) + mbt_ffi_store32((ptr) + 4, ptr6) + + () + } + FieldEquals(payload7) => { + mbt_ffi_store8((ptr) + 0, (4)) + __wit_bindgen_lower_t42((ptr) + 4, payload7) + + () + } + FieldAbsent(payload8) => { + mbt_ffi_store8((ptr) + 0, (5)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((ptr) + 8, payload8.length()) + mbt_ffi_store32((ptr) + 4, ptr9) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t44(ptr : Int, value : @types.UnionBranch) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).tag) + mbt_ffi_store32((ptr) + 4, (value).tag.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + mbt_ffi_store32((ptr) + 8, (value).body) + __wit_bindgen_lower_t43((ptr) + 12, (value).discriminator) + __wit_bindgen_lower_t21((ptr) + 36, (value).metadata) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t46(ptr : Int, value : @types.UnionSpec) -> Unit { + + let address = mbt_ffi_malloc(((value).branches).length() * 92); + for index = 0; index < ((value).branches).length(); index = index + 1 { + let iter_elem : @types.UnionBranch = ((value).branches)[(index)] + let iter_base = address + (index * 92); + __wit_bindgen_lower_t44((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 4, ((value).branches).length()) + mbt_ffi_store32((ptr) + 0, address) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t47(ptr : Int, value : @types.SecretSpec) -> Unit { + mbt_ffi_store32((ptr) + 0, (value).inner) + + match ((value).category) { + None => { + mbt_ffi_store8((ptr) + 4, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 4, (1)) + + let ptr1 = mbt_ffi_str2ptr(payload0) + mbt_ffi_store32((ptr) + 12, payload0.length()) + mbt_ffi_store32((ptr) + 8, ptr1) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t48(ptr : Int, value : @types.QuotaTokenSpec) -> Unit { + + match ((value).resource_name) { + None => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let ptr1 = mbt_ffi_str2ptr(payload0) + mbt_ffi_store32((ptr) + 8, payload0.length()) + mbt_ffi_store32((ptr) + 4, ptr1) + + () + } + } + +} + +#doc(hidden) +fn __wit_bindgen_lower_t49(ptr : Int, value : @types.PermissionCardSpec) -> Unit { + mbt_ffi_store8((ptr) + 0, (if (value).polymorphic { 1 } else { 0 })) + +} + +#doc(hidden) +fn __wit_bindgen_lower_t54(ptr : Int, value : @types.SchemaTypeBody) -> Unit { + + match value { + RefType(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + mbt_ffi_store32((ptr) + 8, payload) + + () + } + BoolType => { + mbt_ffi_store8((ptr) + 0, (1)) + + () + } + S8Type(payload1) => { + mbt_ffi_store8((ptr) + 0, (2)) + + match (payload1) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload3) + + () + } + } + + () + } + S16Type(payload4) => { + mbt_ffi_store8((ptr) + 0, (3)) + + match (payload4) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + Some(payload6) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload6) + + () } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 80)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 96)) - - for index11 = 0 - index11 < mbt_ffi_load32(iter_base + 108) - index11 = index11 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 104) + - index11 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) } - mbt_ffi_free(mbt_ffi_load32(iter_base + 104)) - match mbt_ffi_load8_u(iter_base + 112) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 116)) - _ => panic() - } + () + } + S32Type(payload7) => { + mbt_ffi_store8((ptr) + 0, (4)) - match mbt_ffi_load8_u(iter_base + 140) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 144)) - _ => panic() - } - } - _ => panic() - } - - for index15 = 0 - index15 < mbt_ffi_load32(iter_base + 160) - index15 = index15 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 156) + index15 * 112 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - for index12 = 0 - index12 < mbt_ffi_load32(iter_base + 20) - index12 = index12 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index12 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - for index13 = 0 - index13 < mbt_ffi_load32(iter_base + 44) - index13 = index13 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index13 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - match mbt_ffi_load8_u(iter_base + 48) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => { - for index14 = 0 - index14 < mbt_ffi_load32(iter_base + 88) - index14 = index14 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 84) + - index14 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + match (payload7) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + Some(payload9) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload9) + + () } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 100) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 104)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 156)) - - for index18 = 0 - index18 < mbt_ffi_load32(iter_base + 168) - index18 = index18 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 164) + index18 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - for index16 = 0 - index16 < mbt_ffi_load32(iter_base + 20) - index16 = index16 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index16 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - for index17 = 0 - index17 < mbt_ffi_load32(iter_base + 44) - index17 = index17 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index17 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 164)) - - for index36 = 0 - index36 < mbt_ffi_load32(iter_base + 176) - index36 = index36 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 172) + index36 * 28 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - for index20 = 0 - index20 < mbt_ffi_load32(iter_base + 8) - index20 = index20 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + - index20 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - for index19 = 0 - index19 < mbt_ffi_load32(iter_base + 16) - index19 = index19 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index19 * 32 + () + } + S64Type(payload10) => { + mbt_ffi_store8((ptr) + 0, (5)) - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + match (payload10) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + () + } + Some(payload12) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload12) + + () } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) } - 1 => { - for index22 = 0 - index22 < mbt_ffi_load32(iter_base + 8) - index22 = index22 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + - index22 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - for index21 = 0 - index21 < mbt_ffi_load32(iter_base + 16) - index21 = index21 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index21 * 32 + () + } + U8Type(payload13) => { + mbt_ffi_store8((ptr) + 0, (6)) - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + match (payload13) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + () + } + Some(payload15) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload15) + + () } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) } - 2 => { - for index24 = 0 - index24 < mbt_ffi_load32(iter_base + 8) - index24 = index24 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + - index24 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - for index23 = 0 - index23 < mbt_ffi_load32(iter_base + 16) - index23 = index23 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index23 * 32 + () + } + U16Type(payload16) => { + mbt_ffi_store8((ptr) + 0, (7)) - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + match (payload16) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + () } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - } - 3 => { - for index27 = 0 - index27 < mbt_ffi_load32(iter_base + 8) - index27 = index27 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + - index27 * 8 - - for index26 = 0 - index26 < mbt_ffi_load32(iter_base + 4) - index26 = index26 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index26 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - for index25 = 0 - index25 < mbt_ffi_load32(iter_base + 16) - index25 = index25 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index25 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free( - mbt_ffi_load32(iter_base + 20), - ) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + Some(payload18) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload18) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free( - mbt_ffi_load32(iter_base + 20), - ) - _ => panic() - } - } - 25 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() + () } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) } - 4 => { - for index29 = 0 - index29 < mbt_ffi_load32(iter_base + 12) - index29 = index29 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index29 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - for index28 = 0 - index28 < mbt_ffi_load32(iter_base + 16) - index28 = index28 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index28 * 32 + () + } + U32Type(payload19) => { + mbt_ffi_store8((ptr) + 0, (8)) - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + match (payload19) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + () } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index31 = 0 - index31 < mbt_ffi_load32(iter_base + 24) - index31 = index31 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + - index31 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) + Some(payload21) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload21) - for index30 = 0 - index30 < mbt_ffi_load32(iter_base + 16) - index30 = index30 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index30 * 32 + () + } + } - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + () + } + U64Type(payload22) => { + mbt_ffi_store8((ptr) + 0, (9)) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + match (payload22) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload24) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload24) + + () } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) } - 5 => { - for index33 = 0 - index33 < mbt_ffi_load32(iter_base + 12) - index33 = index33 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index33 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - for index32 = 0 - index32 < mbt_ffi_load32(iter_base + 16) - index32 = index32 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index32 * 32 + () + } + F32Type(payload25) => { + mbt_ffi_store8((ptr) + 0, (10)) - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + match (payload25) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + () } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index35 = 0 - index35 < mbt_ffi_load32(iter_base + 20) - index35 = index35 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index35 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) + Some(payload27) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload27) - for index34 = 0 - index34 < mbt_ffi_load32(iter_base + 16) - index34 = index34 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index34 * 32 + () + } + } - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + () + } + F64Type(payload28) => { + mbt_ffi_store8((ptr) + 0, (11)) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + match (payload28) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload30) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t30((ptr) + 16, payload30) + + () } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 172)) - - match mbt_ffi_load8_u(iter_base + 180) { - 0 => () - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 184)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 192)) - - for index37 = 0 - index37 < mbt_ffi_load32(iter_base + 204) - index37 = index37 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 200) + - index37 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 200)) - - for index38 = 0 - index38 < mbt_ffi_load32(iter_base + 212) - index38 = index38 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 208) + - index38 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 208)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 220) { - 0 => () - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 224)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 232)) - - for index39 = 0 - index39 < mbt_ffi_load32(iter_base + 244) - index39 = index39 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 240) + - index39 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 240)) - - for index40 = 0 - index40 < mbt_ffi_load32(iter_base + 252) - index40 = index40 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 248) + - index40 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 248)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 260) { - 0 => () - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 268)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 276)) - - for index41 = 0 - index41 < mbt_ffi_load32(iter_base + 288) - index41 = index41 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 284) + - index41 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 284)) - - for index43 = 0 - index43 < mbt_ffi_load32(iter_base + 296) - index43 = index43 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 292) + - index43 * 32 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - for index42 = 0 - index42 < mbt_ffi_load32(iter_base + 28) - index42 = index42 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index42 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) } - mbt_ffi_free(mbt_ffi_load32(iter_base + 292)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 300)) - } - _ => panic() - } - - for index45 = 0 - index45 < mbt_ffi_load32(iter_base + 312) - index45 = index45 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 308) + index45 * 44 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - for index44 = 0 - index44 < mbt_ffi_load32(iter_base + 28) - index44 = index44 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index44 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 308)) + + () } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index67 = 0 - index67 < mbt_ffi_load32(iter_base + 20) - index67 = index67 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index67 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index49 = 0 - index49 < mbt_ffi_load32(iter_base + 12) - index49 = index49 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index49 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - for index47 = 0 - index47 < mbt_ffi_load32(iter_base + 28) - index47 = index47 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index47 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index48 = 0 - index48 < mbt_ffi_load32(iter_base + 36) - index48 = index48 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index48 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index52 = 0 - index52 < mbt_ffi_load32(iter_base + 12) - index52 = index52 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index52 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index50 = 0 - index50 < mbt_ffi_load32(iter_base + 32) - index50 = index50 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index50 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index51 = 0 - index51 < mbt_ffi_load32(iter_base + 40) - index51 = index51 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index51 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index53 = 0 - index53 < mbt_ffi_load32(iter_base + 12) - index53 = index53 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index53 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index54 = 0 - index54 < mbt_ffi_load32(iter_base + 12) - index54 = index54 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index54 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index55 = 0 - index55 < mbt_ffi_load32(iter_base + 16) - index55 = index55 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index55 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index56 = 0 - index56 < mbt_ffi_load32(iter_base + 16) - index56 = index56 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index56 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index57 = 0 - index57 < mbt_ffi_load32(iter_base + 20) - index57 = index57 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index57 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index58 = 0 - index58 < mbt_ffi_load32(iter_base + 32) - index58 = index58 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index58 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index59 = 0 - index59 < mbt_ffi_load32(iter_base + 16) - index59 = index59 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index59 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index60 = 0 - index60 < mbt_ffi_load32(iter_base + 28) - index60 = index60 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index60 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index61 = 0 - index61 < mbt_ffi_load32(iter_base + 20) - index61 = index61 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index61 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index64 = 0 - index64 < mbt_ffi_load32(iter_base + 12) - index64 = index64 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index64 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - - for index62 = 0 - index62 < mbt_ffi_load32(iter_base + 52) - index62 = index62 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index62 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - for index63 = 0 - index63 < mbt_ffi_load32(iter_base + 60) - index63 = index63 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index63 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } + CharType => { + mbt_ffi_store8((ptr) + 0, (12)) - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index65 = 0 - index65 < mbt_ffi_load32(iter_base + 104) - index65 = index65 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index65 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index66 = 0 - index66 < mbt_ffi_load32(iter_base + 112) - index66 = index66 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index66 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - for index68 = 0 - index68 < mbt_ffi_load32(iter_base + 28) - index68 = index68 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index68 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 4)) - } - 1 => - match mbt_ffi_load8_u(p0 + 4) { - 0 => mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - 1 => { - for index70 = 0 - index70 < mbt_ffi_load32(p0 + 12) - index70 = index70 + 1 { - let iter_base = mbt_ffi_load32(p0 + 8) + index70 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - } - 2 => mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - 3 => mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - 4 => mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - 5 => { - for index91 = 0 - index91 < mbt_ffi_load32(p0 + 12) - index91 = index91 + 1 { - let iter_base = mbt_ffi_load32(p0 + 8) + index91 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index73 = 0 - index73 < mbt_ffi_load32(iter_base + 12) - index73 = index73 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index73 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + () + } + StringType => { + mbt_ffi_store8((ptr) + 0, (13)) - for index71 = 0 - index71 < mbt_ffi_load32(iter_base + 28) - index71 = index71 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index71 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + () + } + RecordType(payload33) => { + mbt_ffi_store8((ptr) + 0, (14)) - for index72 = 0 - index72 < mbt_ffi_load32(iter_base + 36) - index72 = index72 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index72 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) + let address = mbt_ffi_malloc((payload33).length() * 68); + for index = 0; index < (payload33).length(); index = index + 1 { + let iter_elem : @types.NamedFieldType = (payload33)[(index)] + let iter_base = address + (index * 68); + __wit_bindgen_lower_t22((iter_base) + 0, iter_elem) - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() } + mbt_ffi_store32((ptr) + 12, (payload33).length()) + mbt_ffi_store32((ptr) + 8, address) - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index76 = 0 - index76 < mbt_ffi_load32(iter_base + 12) - index76 = index76 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index76 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + () + } + VariantType(payload34) => { + mbt_ffi_store8((ptr) + 0, (15)) - for index74 = 0 - index74 < mbt_ffi_load32(iter_base + 32) - index74 = index74 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index74 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let address35 = mbt_ffi_malloc((payload34).length() * 72); + for index36 = 0; index36 < (payload34).length(); index36 = index36 + 1 { + let iter_elem : @types.VariantCaseType = (payload34)[(index36)] + let iter_base = address35 + (index36 * 72); + __wit_bindgen_lower_t24((iter_base) + 0, iter_elem) - for index75 = 0 - index75 < mbt_ffi_load32(iter_base + 40) - index75 = index75 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index75 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) + mbt_ffi_store32((ptr) + 12, (payload34).length()) + mbt_ffi_store32((ptr) + 8, address35) - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + () + } + EnumType(payload37) => { + mbt_ffi_store8((ptr) + 0, (16)) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index77 = 0 - index77 < mbt_ffi_load32(iter_base + 12) - index77 = index77 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index77 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index78 = 0 - index78 < mbt_ffi_load32(iter_base + 12) - index78 = index78 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index78 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index79 = 0 - index79 < mbt_ffi_load32(iter_base + 16) - index79 = index79 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index79 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index80 = 0 - index80 < mbt_ffi_load32(iter_base + 16) - index80 = index80 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index80 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index81 = 0 - index81 < mbt_ffi_load32(iter_base + 20) - index81 = index81 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index81 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index82 = 0 - index82 < mbt_ffi_load32(iter_base + 32) - index82 = index82 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index82 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index83 = 0 - index83 < mbt_ffi_load32(iter_base + 16) - index83 = index83 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index83 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index84 = 0 - index84 < mbt_ffi_load32(iter_base + 28) - index84 = index84 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index84 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index85 = 0 - index85 < mbt_ffi_load32(iter_base + 20) - index85 = index85 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index85 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index88 = 0 - index88 < mbt_ffi_load32(iter_base + 12) - index88 = index88 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index88 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let address39 = mbt_ffi_malloc((payload37).length() * 8); + for index40 = 0; index40 < (payload37).length(); index40 = index40 + 1 { + let iter_elem : String = (payload37)[(index40)] + let iter_base = address39 + (index40 * 8); - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } + let ptr38 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr38) - for index86 = 0 - index86 < mbt_ffi_load32(iter_base + 52) - index86 = index86 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index86 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + mbt_ffi_store32((ptr) + 12, (payload37).length()) + mbt_ffi_store32((ptr) + 8, address39) - for index87 = 0 - index87 < mbt_ffi_load32(iter_base + 60) - index87 = index87 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index87 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) + () + } + FlagsType(payload41) => { + mbt_ffi_store8((ptr) + 0, (17)) - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } + let address43 = mbt_ffi_malloc((payload41).length() * 8); + for index44 = 0; index44 < (payload41).length(); index44 = index44 + 1 { + let iter_elem : String = (payload41)[(index44)] + let iter_base = address43 + (index44 * 8); + + let ptr42 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr42) - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index89 = 0 - index89 < mbt_ffi_load32(iter_base + 104) - index89 = index89 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index89 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index90 = 0 - index90 < mbt_ffi_load32(iter_base + 112) - index90 = index90 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index90 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - - for index92 = 0 - index92 < mbt_ffi_load32(p0 + 20) - index92 = index92 + 1 { - let iter_base = mbt_ffi_load32(p0 + 16) + index92 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 16)) - - for index93 = 0 - index93 < mbt_ffi_load32(p0 + 32) - index93 = index93 + 1 { - let iter_base = mbt_ffi_load32(p0 + 28) + index93 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 28)) - } - _ => panic() - } - _ => panic() - } -} + mbt_ffi_store32((ptr) + 12, (payload41).length()) + mbt_ffi_store32((ptr) + 8, address43) -///| -#doc(hidden) -pub fn wasmExportGetTool(p0 : Int, p1 : Int) -> Int { - let result = mbt_ffi_ptr2str(p0, p1) - - let result0 : Result[@common.Tool, @common.ToolError] = get_tool(result) - let return_area = mbt_ffi_malloc(40) - - match result0 { - Ok(payload) => { - mbt_ffi_store8(return_area + 0, 0) - __wit_bindgen_lower_t510(return_area + 4, payload) - - () - } - Err(payload1) => { - mbt_ffi_store8(return_area + 0, 1) - __wit_bindgen_lower_t511(return_area + 4, payload1) - - () - } - } - let ret = return_area - return ret -} + () + } + TupleType(payload45) => { + mbt_ffi_store8((ptr) + 0, (18)) -///| -#doc(hidden) -pub fn wasmExportGetToolPostReturn(p0 : Int) -> Unit { - match mbt_ffi_load8_u(p0 + 0) { - 0 => { - mbt_ffi_free(mbt_ffi_load32(p0 + 4)) - - for index46 = 0; index46 < mbt_ffi_load32(p0 + 16); index46 = index46 + 1 { - let iter_base = mbt_ffi_load32(p0 + 12) + index46 * 324 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - for index = 0; index < mbt_ffi_load32(iter_base + 12); index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index0 = 0 - index0 < mbt_ffi_load32(iter_base + 36) - index0 = index0 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index0 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - for index4 = 0 - index4 < mbt_ffi_load32(iter_base + 44) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index4 * 112 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - for index1 = 0 - index1 < mbt_ffi_load32(iter_base + 20) - index1 = index1 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index1 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - for index2 = 0 - index2 < mbt_ffi_load32(iter_base + 44) - index2 = index2 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index2 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - match mbt_ffi_load8_u(iter_base + 48) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - _ => panic() - } + let address46 = mbt_ffi_malloc((payload45).length() * 4); + for index47 = 0; index47 < (payload45).length(); index47 = index47 + 1 { + let iter_elem : Int = (payload45)[(index47)] + let iter_base = address46 + (index47 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => { - for index3 = 0 - index3 < mbt_ffi_load32(iter_base + 88) - index3 = index3 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 84) + index3 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) + mbt_ffi_store32((ptr) + 12, (payload45).length()) + mbt_ffi_store32((ptr) + 8, address46) + + () } - _ => panic() - } + ListType(payload48) => { + mbt_ffi_store8((ptr) + 0, (19)) + mbt_ffi_store32((ptr) + 8, payload48) - match mbt_ffi_load8_u(iter_base + 100) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 104)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - for index7 = 0 - index7 < mbt_ffi_load32(iter_base + 52) - index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index7 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - for index5 = 0 - index5 < mbt_ffi_load32(iter_base + 20) - index5 = index5 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index5 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - for index6 = 0 - index6 < mbt_ffi_load32(iter_base + 44) - index6 = index6 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index6 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => { - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 72) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + index10 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 28) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index8 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - match mbt_ffi_load8_u(iter_base + 32) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 48) { - 0 => () - 1 => { - for index9 = 0 - index9 < mbt_ffi_load32(iter_base + 56) - index9 = index9 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 52) + index9 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 80)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 96)) - - for index11 = 0 - index11 < mbt_ffi_load32(iter_base + 108) - index11 = index11 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 104) + index11 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 104)) - - match mbt_ffi_load8_u(iter_base + 112) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 116)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 140) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 144)) - _ => panic() - } - } - _ => panic() - } - - for index15 = 0 - index15 < mbt_ffi_load32(iter_base + 160) - index15 = index15 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 156) + index15 * 112 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - for index12 = 0 - index12 < mbt_ffi_load32(iter_base + 20) - index12 = index12 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index12 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - for index13 = 0 - index13 < mbt_ffi_load32(iter_base + 44) - index13 = index13 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index13 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - match mbt_ffi_load8_u(iter_base + 48) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => { - for index14 = 0 - index14 < mbt_ffi_load32(iter_base + 88) - index14 = index14 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 84) + - index14 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 100) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 104)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 156)) - - for index18 = 0 - index18 < mbt_ffi_load32(iter_base + 168) - index18 = index18 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 164) + index18 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - for index16 = 0 - index16 < mbt_ffi_load32(iter_base + 20) - index16 = index16 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index16 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - for index17 = 0 - index17 < mbt_ffi_load32(iter_base + 44) - index17 = index17 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index17 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 164)) - - for index36 = 0 - index36 < mbt_ffi_load32(iter_base + 176) - index36 = index36 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 172) + index36 * 28 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - for index20 = 0 - index20 < mbt_ffi_load32(iter_base + 8) - index20 = index20 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index20 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - for index19 = 0 - index19 < mbt_ffi_load32(iter_base + 16) - index19 = index19 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index19 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - } - 1 => { - for index22 = 0 - index22 < mbt_ffi_load32(iter_base + 8) - index22 = index22 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index22 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - for index21 = 0 - index21 < mbt_ffi_load32(iter_base + 16) - index21 = index21 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index21 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - } - 2 => { - for index24 = 0 - index24 < mbt_ffi_load32(iter_base + 8) - index24 = index24 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index24 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - for index23 = 0 - index23 < mbt_ffi_load32(iter_base + 16) - index23 = index23 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index23 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - } - 3 => { - for index27 = 0 - index27 < mbt_ffi_load32(iter_base + 8) - index27 = index27 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index27 * 8 - - for index26 = 0 - index26 < mbt_ffi_load32(iter_base + 4) - index26 = index26 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index26 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) + () + } + FixedListType(payload49) => { + mbt_ffi_store8((ptr) + 0, (20)) + __wit_bindgen_lower_t25((ptr) + 8, payload49) - for index25 = 0 - index25 < mbt_ffi_load32(iter_base + 16) - index25 = index25 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index25 * 32 + () + } + MapType(payload50) => { + mbt_ffi_store8((ptr) + 0, (21)) + __wit_bindgen_lower_t26((ptr) + 8, payload50) - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + () + } + OptionType(payload51) => { + mbt_ffi_store8((ptr) + 0, (22)) + mbt_ffi_store32((ptr) + 8, payload51) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - } - 4 => { - for index29 = 0 - index29 < mbt_ffi_load32(iter_base + 12) - index29 = index29 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index29 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - for index28 = 0 - index28 < mbt_ffi_load32(iter_base + 16) - index28 = index28 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index28 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index31 = 0 - index31 < mbt_ffi_load32(iter_base + 24) - index31 = index31 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + - index31 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - for index30 = 0 - index30 < mbt_ffi_load32(iter_base + 16) - index30 = index30 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index30 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - } - 5 => { - for index33 = 0 - index33 < mbt_ffi_load32(iter_base + 12) - index33 = index33 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index33 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - for index32 = 0 - index32 < mbt_ffi_load32(iter_base + 16) - index32 = index32 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index32 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index35 = 0 - index35 < mbt_ffi_load32(iter_base + 20) - index35 = index35 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index35 * 24 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - for index34 = 0 - index34 < mbt_ffi_load32(iter_base + 16) - index34 = index34 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index34 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 172)) - - match mbt_ffi_load8_u(iter_base + 180) { - 0 => () - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 184)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 192)) - - for index37 = 0 - index37 < mbt_ffi_load32(iter_base + 204) - index37 = index37 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 200) + index37 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 200)) - - for index38 = 0 - index38 < mbt_ffi_load32(iter_base + 212) - index38 = index38 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 208) + index38 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 208)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 220) { - 0 => () - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 224)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 232)) - - for index39 = 0 - index39 < mbt_ffi_load32(iter_base + 244) - index39 = index39 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 240) + index39 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 240)) - - for index40 = 0 - index40 < mbt_ffi_load32(iter_base + 252) - index40 = index40 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 248) + index40 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 248)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 260) { - 0 => () - 1 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 268)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 276)) - - for index41 = 0 - index41 < mbt_ffi_load32(iter_base + 288) - index41 = index41 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 284) + index41 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 284)) - - for index43 = 0 - index43 < mbt_ffi_load32(iter_base + 296) - index43 = index43 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 292) + index43 * 32 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - for index42 = 0 - index42 < mbt_ffi_load32(iter_base + 28) - index42 = index42 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index42 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 292)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 300)) - } - _ => panic() - } - - for index45 = 0 - index45 < mbt_ffi_load32(iter_base + 312) - index45 = index45 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 308) + index45 * 44 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - for index44 = 0 - index44 < mbt_ffi_load32(iter_base + 28) - index44 = index44 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index44 * 16 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 308)) - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 12)) - - for index67 = 0; index67 < mbt_ffi_load32(p0 + 24); index67 = index67 + 1 { - let iter_base = mbt_ffi_load32(p0 + 20) + index67 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index49 = 0 - index49 < mbt_ffi_load32(iter_base + 12) - index49 = index49 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index49 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - for index47 = 0 - index47 < mbt_ffi_load32(iter_base + 28) - index47 = index47 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index47 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index48 = 0 - index48 < mbt_ffi_load32(iter_base + 36) - index48 = index48 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index48 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index52 = 0 - index52 < mbt_ffi_load32(iter_base + 12) - index52 = index52 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index52 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index50 = 0 - index50 < mbt_ffi_load32(iter_base + 32) - index50 = index50 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index50 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index51 = 0 - index51 < mbt_ffi_load32(iter_base + 40) - index51 = index51 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index51 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index53 = 0 - index53 < mbt_ffi_load32(iter_base + 12) - index53 = index53 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index53 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index54 = 0 - index54 < mbt_ffi_load32(iter_base + 12) - index54 = index54 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index54 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index55 = 0 - index55 < mbt_ffi_load32(iter_base + 16) - index55 = index55 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index55 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index56 = 0 - index56 < mbt_ffi_load32(iter_base + 16) - index56 = index56 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index56 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index57 = 0 - index57 < mbt_ffi_load32(iter_base + 20) - index57 = index57 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index57 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index58 = 0 - index58 < mbt_ffi_load32(iter_base + 32) - index58 = index58 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index58 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index59 = 0 - index59 < mbt_ffi_load32(iter_base + 16) - index59 = index59 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index59 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index60 = 0 - index60 < mbt_ffi_load32(iter_base + 28) - index60 = index60 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index60 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index61 = 0 - index61 < mbt_ffi_load32(iter_base + 20) - index61 = index61 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index61 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index64 = 0 - index64 < mbt_ffi_load32(iter_base + 12) - index64 = index64 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index64 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - - for index62 = 0 - index62 < mbt_ffi_load32(iter_base + 52) - index62 = index62 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index62 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - for index63 = 0 - index63 < mbt_ffi_load32(iter_base + 60) - index63 = index63 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index63 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index65 = 0 - index65 < mbt_ffi_load32(iter_base + 104) - index65 = index65 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index65 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index66 = 0 - index66 < mbt_ffi_load32(iter_base + 112) - index66 = index66 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index66 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 20)) + () + } + ResultType(payload52) => { + mbt_ffi_store8((ptr) + 0, (23)) + __wit_bindgen_lower_t27((ptr) + 8, payload52) + + () + } + TextType(payload53) => { + mbt_ffi_store8((ptr) + 0, (24)) + __wit_bindgen_lower_t33((ptr) + 8, payload53) + + () + } + BinaryType(payload54) => { + mbt_ffi_store8((ptr) + 0, (25)) + __wit_bindgen_lower_t34((ptr) + 8, payload54) + + () + } + PathType(payload55) => { + mbt_ffi_store8((ptr) + 0, (26)) + __wit_bindgen_lower_t37((ptr) + 8, payload55) + + () + } + UrlType(payload56) => { + mbt_ffi_store8((ptr) + 0, (27)) + __wit_bindgen_lower_t38((ptr) + 8, payload56) + + () + } + DatetimeType => { + mbt_ffi_store8((ptr) + 0, (28)) + + () + } + DurationType => { + mbt_ffi_store8((ptr) + 0, (29)) + + () + } + QuantityType(payload59) => { + mbt_ffi_store8((ptr) + 0, (30)) + __wit_bindgen_lower_t41((ptr) + 8, payload59) + + () + } + UnionType(payload60) => { + mbt_ffi_store8((ptr) + 0, (31)) + __wit_bindgen_lower_t46((ptr) + 8, payload60) + + () + } + SecretType(payload61) => { + mbt_ffi_store8((ptr) + 0, (32)) + __wit_bindgen_lower_t47((ptr) + 8, payload61) + + () + } + QuotaTokenType(payload62) => { + mbt_ffi_store8((ptr) + 0, (33)) + __wit_bindgen_lower_t48((ptr) + 8, payload62) + + () + } + PermissionCardType(payload63) => { + mbt_ffi_store8((ptr) + 0, (34)) + __wit_bindgen_lower_t49((ptr) + 8, payload63) - for index68 = 0; index68 < mbt_ffi_load32(p0 + 32); index68 = index68 + 1 { - let iter_base = mbt_ffi_load32(p0 + 28) + index68 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () + } + FutureType(payload64) => { + mbt_ffi_store8((ptr) + 0, (35)) - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 28)) - } - 1 => - match mbt_ffi_load8_u(p0 + 4) { - 0 => mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - 1 => { - for index69 = 0 - index69 < mbt_ffi_load32(p0 + 12) - index69 = index69 + 1 { - let iter_base = mbt_ffi_load32(p0 + 8) + index69 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - } - 2 => mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - 3 => mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - 4 => mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - 5 => { - for index90 = 0 - index90 < mbt_ffi_load32(p0 + 12) - index90 = index90 + 1 { - let iter_base = mbt_ffi_load32(p0 + 8) + index90 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index72 = 0 - index72 < mbt_ffi_load32(iter_base + 12) - index72 = index72 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index72 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + match (payload64) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - for index70 = 0 - index70 < mbt_ffi_load32(iter_base + 28) - index70 = index70 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index70 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + () + } + Some(payload66) => { + mbt_ffi_store8((ptr) + 8, (1)) + mbt_ffi_store32((ptr) + 12, payload66) - for index71 = 0 - index71 < mbt_ffi_load32(iter_base + 36) - index71 = index71 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index71 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () + } } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } + () + } + StreamType(payload67) => { + mbt_ffi_store8((ptr) + 0, (36)) - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index75 = 0 - index75 < mbt_ffi_load32(iter_base + 12) - index75 = index75 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index75 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + match (payload67) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - for index73 = 0 - index73 < mbt_ffi_load32(iter_base + 32) - index73 = index73 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index73 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + () + } + Some(payload69) => { + mbt_ffi_store8((ptr) + 8, (1)) + mbt_ffi_store32((ptr) + 12, payload69) - for index74 = 0 - index74 < mbt_ffi_load32(iter_base + 40) - index74 = index74 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index74 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () + } } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + () + } + } - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index76 = 0 - index76 < mbt_ffi_load32(iter_base + 12) - index76 = index76 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index76 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index77 = 0 - index77 < mbt_ffi_load32(iter_base + 12) - index77 = index77 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index77 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index78 = 0 - index78 < mbt_ffi_load32(iter_base + 16) - index78 = index78 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index78 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index79 = 0 - index79 < mbt_ffi_load32(iter_base + 16) - index79 = index79 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index79 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index80 = 0 - index80 < mbt_ffi_load32(iter_base + 20) - index80 = index80 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index80 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index81 = 0 - index81 < mbt_ffi_load32(iter_base + 32) - index81 = index81 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index81 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index82 = 0 - index82 < mbt_ffi_load32(iter_base + 16) - index82 = index82 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index82 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index83 = 0 - index83 < mbt_ffi_load32(iter_base + 28) - index83 = index83 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index83 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index84 = 0 - index84 < mbt_ffi_load32(iter_base + 20) - index84 = index84 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index84 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index87 = 0 - index87 < mbt_ffi_load32(iter_base + 12) - index87 = index87 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index87 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } +} - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } +#doc(hidden) +fn __wit_bindgen_lower_t55(ptr : Int, value : @types.SchemaTypeNode) -> Unit { + __wit_bindgen_lower_t54((ptr) + 0, (value).body) + __wit_bindgen_lower_t21((ptr) + 88, (value).metadata) - for index85 = 0 - index85 < mbt_ffi_load32(iter_base + 52) - index85 = index85 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index85 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) +} - for index86 = 0 - index86 < mbt_ffi_load32(iter_base + 60) - index86 = index86 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index86 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) +#doc(hidden) +fn __wit_bindgen_lower_t58(ptr : Int, value : @types.SchemaGraph) -> Unit { - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } + let address = mbt_ffi_malloc(((value).type_nodes).length() * 144); + for index = 0; index < ((value).type_nodes).length(); index = index + 1 { + let iter_elem : @types.SchemaTypeNode = ((value).type_nodes)[(index)] + let iter_base = address + (index * 144); + __wit_bindgen_lower_t55((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 4, ((value).type_nodes).length()) + mbt_ffi_store32((ptr) + 0, address) + + let address0 = mbt_ffi_malloc(((value).defs).length() * 24); + for index1 = 0; index1 < ((value).defs).length(); index1 = index1 + 1 { + let iter_elem : @types.SchemaTypeDef = ((value).defs)[(index1)] + let iter_base = address0 + (index1 * 24); + __wit_bindgen_lower_t17((iter_base) + 0, iter_elem) - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index88 = 0 - index88 < mbt_ffi_load32(iter_base + 104) - index88 = index88 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index88 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index89 = 0 - index89 < mbt_ffi_load32(iter_base + 112) - index89 = index89 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index89 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - - for index91 = 0 - index91 < mbt_ffi_load32(p0 + 20) - index91 = index91 + 1 { - let iter_base = mbt_ffi_load32(p0 + 16) + index91 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 16)) - - for index92 = 0 - index92 < mbt_ffi_load32(p0 + 32) - index92 = index92 + 1 { - let iter_base = mbt_ffi_load32(p0 + 28) + index92 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(p0 + 28)) - } - _ => panic() } - _ => panic() - } + mbt_ffi_store32((ptr) + 12, ((value).defs).length()) + mbt_ffi_store32((ptr) + 8, address0) + mbt_ffi_store32((ptr) + 16, (value).root) + } -///| -fn wasmImportExportGolemToolGuest010InvokeStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "[export]golem:tool/guest@0.1.0" "[async-lower][stream-read-0]invoke" +#doc(hidden) +fn __wit_bindgen_lower_t60(ptr : Int, value : @types.VariantValuePayload) -> Unit { + mbt_ffi_store32((ptr) + 0, ((value).case).reinterpret_as_int()) -///| -fn wasmImportExportGolemToolGuest010InvokeStream0CancelRead( - handle : Int, -) -> Int = "[export]golem:tool/guest@0.1.0" "[stream-cancel-read-0]invoke" + match ((value).payload) { + None => { + mbt_ffi_store8((ptr) + 4, (0)) -///| -fn wasmImportExportGolemToolGuest010InvokeStream0DropReadable(handle : Int) = "[export]golem:tool/guest@0.1.0" "[stream-drop-readable-0]invoke" + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 4, (1)) + mbt_ffi_store32((ptr) + 8, payload0) -///| -fn wasmExportGolemToolGuest010InvokeStream0Malloc(length : Int) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr -} + () + } + } -///| -fn wasmExportGolemToolGuest010InvokeStream0Reject( - ptr : Int, - start : Int, - length : Int, -) -> Unit { - ignore((ptr, start, length)) } -///| -fn wasmExportGolemToolGuest010InvokeStream0ListLift( - ptr : Int, - length : Int, -) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) -} +#doc(hidden) +fn __wit_bindgen_lower_t61(ptr : Int, value : @types.MapEntry) -> Unit { + mbt_ffi_store32((ptr) + 0, (value).key) + mbt_ffi_store32((ptr) + 4, (value).value) -///| -priv struct WasmExportGolemToolGuest010InvokeStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar } -///| -fn WasmExportGolemToolGuest010InvokeStream0StreamSource::finish_read( - self : WasmExportGolemToolGuest010InvokeStream0StreamSource, -) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. -} +#doc(hidden) +fn __wit_bindgen_lower_t62(ptr : Int, value : @types.ResultValuePayload) -> Unit { -///| -async fn WasmExportGolemToolGuest010InvokeStream0StreamSource::wait_for_read_cleanup( - self : WasmExportGolemToolGuest010InvokeStream0StreamSource, -) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() - } - }, - resume_on_cancel=true, - ) catch { - _ => () - } -} + match value { + OkValue(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) -///| -async fn WasmExportGolemToolGuest010InvokeStream0StreamSource::cancel_active_read( - self : WasmExportGolemToolGuest010InvokeStream0StreamSource, -) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportExportGolemToolGuest010InvokeStream0CancelRead(self.handle) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmExportGolemToolGuest010InvokeStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() -} + match (payload) { + None => { + mbt_ffi_store8((ptr) + 4, (0)) -///| -async fn WasmExportGolemToolGuest010InvokeStream0StreamSource::close( - self : WasmExportGolemToolGuest010InvokeStream0StreamSource, -) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportExportGolemToolGuest010InvokeStream0DropReadable(self.handle) -} + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 4, (1)) + mbt_ffi_store32((ptr) + 8, payload1) -///| -fn WasmExportGolemToolGuest010InvokeStream0StreamSource::close_sync( - self : WasmExportGolemToolGuest010InvokeStream0StreamSource, -) -> Unit { - if self.closed || self.reading { - return - } + () + } + } - self.closed = true - wasmImportExportGolemToolGuest010InvokeStream0DropReadable(self.handle) -} + () + } + ErrValue(payload2) => { + mbt_ffi_store8((ptr) + 0, (1)) -///| -async fn WasmExportGolemToolGuest010InvokeStream0StreamSource::read( - self : WasmExportGolemToolGuest010InvokeStream0StreamSource, - count : Int, -) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmExportGolemToolGuest010InvokeStream0Malloc(read_count) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportExportGolemToolGuest010InvokeStream0Read( - self.handle, - ptr, - read_count, - ), - ) catch { - err => { - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportExportGolemToolGuest010InvokeStream0DropReadable( - self.handle, - ) - } + match (payload2) { + None => { + mbt_ffi_store8((ptr) + 4, (0)) + + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 4, (1)) + mbt_ffi_store32((ptr) + 8, payload4) + + () + } + } + + () + } } - self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmExportGolemToolGuest010InvokeStream0ListLift(ptr, progress) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} -///| -fn wasmExportGolemToolGuest010InvokeStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmExportGolemToolGuest010InvokeStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) } -///| -fn wasmImportExportGolemToolGuest010InvokeStream1DropReadable(handle : Int) = "[export]golem:tool/guest@0.1.0" "[stream-drop-readable-0]invoke" +#doc(hidden) +fn __wit_bindgen_lower_t63(ptr : Int, value : @types.TextValuePayload) -> Unit { -///| -fn wasmImportExportGolemToolGuest010InvokeStream1New() -> UInt64 = "[export]golem:tool/guest@0.1.0" "[stream-new-0]invoke" + let ptr0 = mbt_ffi_str2ptr((value).text) + mbt_ffi_store32((ptr) + 4, (value).text.length()) + mbt_ffi_store32((ptr) + 0, ptr0) -///| -fn wasmImportExportGolemToolGuest010InvokeStream1Write( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "[export]golem:tool/guest@0.1.0" "[async-lower][stream-write-0]invoke" + match ((value).language) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) -///| -fn wasmImportExportGolemToolGuest010InvokeStream1CancelWrite( - handle : Int, -) -> Int = "[export]golem:tool/guest@0.1.0" "[stream-cancel-write-0]invoke" + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) -///| -fn wasmImportExportGolemToolGuest010InvokeStream1DropWritable(handle : Int) = "[export]golem:tool/guest@0.1.0" "[stream-drop-writable-0]invoke" + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 16, payload1.length()) + mbt_ffi_store32((ptr) + 12, ptr2) -///| -fn wasmExportGolemToolGuest010InvokeStream1Malloc(length : Int) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr -} + () + } + } -///| -fn wasmExportGolemToolGuest010InvokeStream1Commit( - ptr : Int, - start : Int, - length : Int, -) -> Unit { - ignore((ptr, start, length)) } -///| -fn wasmExportGolemToolGuest010InvokeStream1Reject( - ptr : Int, - start : Int, - length : Int, -) -> Unit { - ignore((ptr, start, length)) -} +#doc(hidden) +fn __wit_bindgen_lower_t65(ptr : Int, value : @types.BinaryValuePayload) -> Unit { -///| -fn wasmExportGolemToolGuest010InvokeStream1Lower( - value : Byte, - ptr : Int, -) -> Unit { - mbt_ffi_store8(ptr + 0, value.to_int()) -} + let ptr0 = mbt_ffi_bytes2ptr((value).bytes) -///| -priv struct WasmExportGolemToolGuest010InvokeStream1StreamProducer { - stream : @async-core.Stream[Byte] - writer : Int -} + mbt_ffi_store32((ptr) + 4, (value).bytes.length()) + mbt_ffi_store32((ptr) + 0, ptr0) -///| -let wasmExportGolemToolGuest010InvokeStream1StreamProducers : Map[ - Int, - WasmExportGolemToolGuest010InvokeStream1StreamProducer, -] = Map([]) + match ((value).mime_type) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) -///| -fn wasmExportGolemToolGuest010InvokeStream1StreamCommit(handle : Int) -> Unit { - guard wasmExportGolemToolGuest010InvokeStream1StreamProducers.get(handle) - is Some(prepared) else { - return - } - wasmExportGolemToolGuest010InvokeStream1StreamProducers.remove(handle) - let stream = prepared.stream - let writer = prepared.writer - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let producer = stream.take_producer() - @async-core.spawn_component_task_current(async fn() { - let writer_closed = Ref(false) - let writer_lock = @async-core.Mutex() - let close_writer = fn() -> Unit { - if !writer_closed.val { - writer_closed.val = true - wasmImportExportGolemToolGuest010InvokeStream1DropWritable(writer) - } - } - let close_writer_serialized = async fn() -> Unit { - writer_lock.acquire() - defer writer_lock.release() - close_writer() - } - let cleanup_value = fn(value : Byte) -> Unit { - let ptr = wasmExportGolemToolGuest010InvokeStream1Malloc(1) - wasmExportGolemToolGuest010InvokeStream1Lower(value, ptr) - wasmExportGolemToolGuest010InvokeStream1Reject(ptr, 0, 1) - mbt_ffi_free(ptr) - } - let sink = @async-core.Sink::from_callbacks( - (data : ArrayView[Byte]) => { - writer_lock.acquire() - defer writer_lock.release() - if writer_closed.val || data.length() == 0 { - return 0 - } - let data_len = if data.length() < 64 { data.length() } else { 64 } - let ptr = wasmExportGolemToolGuest010InvokeStream1Malloc(data_len) - for i in 0.. Unit { - wasmExportGolemToolGuest010InvokeStream1Commit(ptr, 0, transferred) - if transferred < data_len { - wasmExportGolemToolGuest010InvokeStream1Reject( - ptr, - transferred, - data_len - transferred, - ) - } - mbt_ffi_free(ptr) - } - let mut total = 0 - let mut dropped = false - while total < data_len { - let (progress, end) = @async-core.suspend_for_stream_write( - writer, - wasmImportExportGolemToolGuest010InvokeStream1Write( - writer, - ptr + total * 1, - data_len - total, - ), - ) catch { - _ => { - total = total + - @async-core.cancel_stream_write(writer, () => { - wasmImportExportGolemToolGuest010InvokeStream1CancelWrite( - writer, - ) - }) - settle_staging(total) - close_writer() - return data_len - } - } - total = total + progress - if end { - dropped = true - break - } - } - settle_staging(total) - if dropped { - close_writer() - } - // The canonical writer accepted `total`; generated cleanup - // consumed the rest of this staging window. - data_len - }, - () => close_writer_serialized(), - () => !writer_closed.val, - Some(cleanup_value), - ) - let relay_source = producer is None - let run_producer = async fn() -> Unit { - match producer { - Some(producer) => { - producer(sink) - sink.close() - } - None => - for ;; { - match stream.read(64) { - Some(data) => - if !sink.write_all(data[:]) { - stream.reject(cleanup_value) - return - } - None => { - sink.close() - return - } - } - } + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) + + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 16, payload1.length()) + mbt_ffi_store32((ptr) + 12, ptr2) + + () + } } - } - run_producer() catch { - _ => - if relay_source { - @async-core.protect_from_cancel( - () => stream.reject(cleanup_value), - resume_on_cancel=true, - ) catch { - _ => () - } - } - } - // A retained Sink may still own an in-flight canonical write after its - // producer returns. Do not drop the writable endpoint until that write - // has reached a terminal event and released its staging buffer. - @async-core.protect_from_cancel( - () => close_writer_serialized(), - resume_on_cancel=true, - ) - }) + } -///| -fn wasmExportGolemToolGuest010InvokeStream1StreamLower( - stream : @async-core.Stream[Byte], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let pair = wasmImportExportGolemToolGuest010InvokeStream1New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmExportGolemToolGuest010InvokeStream1StreamProducers.set(reader, { - stream, - writer, - }) - reader +#doc(hidden) +fn __wit_bindgen_lower_t66(ptr : Int, value : @types.DurationValuePayload) -> Unit { + mbt_ffi_store64((ptr) + 0, (value).nanoseconds) + } -///| -fn wasmExportGolemToolGuest010InvokeStream1StreamLowerCommitted( - stream : @async-core.Stream[Byte], -) -> Int { - let reader = wasmExportGolemToolGuest010InvokeStream1StreamLower(stream) - wasmExportGolemToolGuest010InvokeStream1StreamCommit(reader) - reader +#doc(hidden) +fn __wit_bindgen_lower_t67(ptr : Int, value : @types.UnionValuePayload) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).tag) + mbt_ffi_store32((ptr) + 4, (value).tag.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + mbt_ffi_store32((ptr) + 8, (value).body) + } -///| #doc(hidden) -pub fn wasmExportInvokeGolemToolGuest(p0 : Int) -> Int { - @async-core.with_waitableset(async fn() { - @async-core.with_task_group(async fn(background_group) { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 0), - mbt_ffi_load32(p0 + 4), - ) +fn __wit_bindgen_lower_t74(ptr : Int, value : @types.SchemaValueNode) -> Unit { - let array : Array[String] = [] - for index = 0; index < mbt_ffi_load32(p0 + 12); index = index + 1 { - let iter_base = mbt_ffi_load32(p0 + 8) + index * 8 + match value { + BoolValue(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + mbt_ffi_store8((ptr) + 8, (if payload { 1 } else { 0 })) - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + () + } + S8Value(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + mbt_ffi_store8((ptr) + 8, mbt_ffi_extend8(payload0)) - array.push(result0) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 8)) - - let array196 : Array[@types.SchemaTypeNode] = [] - for index197 = 0 - index197 < mbt_ffi_load32(p0 + 20) - index197 = index197 + 1 { - let iter_base = mbt_ffi_load32(p0 + 16) + index197 * 144 - - let lifted182 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted6 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted) - } - _ => panic() - } - - let lifted3 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2) - } - _ => panic() - } - - let lifted5 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result4) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1, - max: lifted3, - unit: lifted5, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted6) - } - 3 => { - let lifted13 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted8 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted7 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted7) - } - _ => panic() - } - - let lifted10 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted9 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted9) - } - _ => panic() - } - - let lifted12 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result11 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result11) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted8, - max: lifted10, - unit: lifted12, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted13) - } - 4 => { - let lifted20 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted15 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted14 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted14) - } - _ => panic() - } - - let lifted17 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted16 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted16) - } - _ => panic() - } - - let lifted19 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result18) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted15, - max: lifted17, - unit: lifted19, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted20) - } - 5 => { - let lifted27 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted22 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted21 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted21) - } - _ => panic() - } - - let lifted24 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted23 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted23) - } - _ => panic() - } - - let lifted26 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result25 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result25) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted22, - max: lifted24, - unit: lifted26, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted27) - } - 6 => { - let lifted34 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted29 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted28 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted28) - } - _ => panic() - } - - let lifted31 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted30 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted30) - } - _ => panic() - } - - let lifted33 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result32 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result32) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted29, - max: lifted31, - unit: lifted33, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted34) - } - 7 => { - let lifted41 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted36 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted35 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted35) - } - _ => panic() - } - - let lifted38 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted37 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted37) - } - _ => panic() - } - - let lifted40 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result39 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result39) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted36, - max: lifted38, - unit: lifted40, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted41) - } - 8 => { - let lifted48 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted43 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted42 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted42) - } - _ => panic() - } - - let lifted45 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted44 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted44) - } - _ => panic() - } - - let lifted47 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result46 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result46) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted43, - max: lifted45, - unit: lifted47, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted48) - } - 9 => { - let lifted55 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted50 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted49 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted49) - } - _ => panic() - } - - let lifted52 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted51 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted51) - } - _ => panic() - } - - let lifted54 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result53 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result53) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted50, - max: lifted52, - unit: lifted54, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted55) - } - 10 => { - let lifted62 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted57 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted56 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted56) - } - _ => panic() - } - - let lifted59 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted58 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted58) - } - _ => panic() - } - - let lifted61 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result60 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result60) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted57, - max: lifted59, - unit: lifted61, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted62) - } - 11 => { - let lifted69 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted64 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted63 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted63) - } - _ => panic() - } - - let lifted66 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted65 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted65) - } - _ => panic() - } - - let lifted68 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result67 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result67) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted64, - max: lifted66, - unit: lifted68, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted69) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array84 : Array[@types.NamedFieldType] = [] - for index85 = 0 - index85 < mbt_ffi_load32(iter_base + 12) - index85 = index85 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index85 * 68 - - let result70 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted72 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result71 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result71) - } - _ => panic() - } - - let array74 : Array[String] = [] - for index75 = 0 - index75 < mbt_ffi_load32(iter_base + 28) - index75 = index75 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index75 * 8 - - let result73 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array74.push(result73) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array77 : Array[String] = [] - for index78 = 0 - index78 < mbt_ffi_load32(iter_base + 36) - index78 = index78 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index78 * 8 - - let result76 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array77.push(result76) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted80 : String? = match mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result79 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result79) - } - _ => panic() - } - - let lifted83 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted82 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result81 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result81) - } - _ => panic() - } + () + } + S16Value(payload1) => { + mbt_ffi_store8((ptr) + 0, (2)) + mbt_ffi_store16((ptr) + 8, mbt_ffi_extend16(payload1)) - Option::Some(lifted82) - } - _ => panic() - } - - array84.push(@types.NamedFieldType::{ - name: result70, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted72, - aliases: array74, - examples: array77, - deprecated: lifted80, - role: lifted83, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array84) - } - 15 => { - let array101 : Array[@types.VariantCaseType] = [] - for index102 = 0 - index102 < mbt_ffi_load32(iter_base + 12) - index102 = index102 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index102 * 72 - - let result86 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted87 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted89 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result88 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result88) - } - _ => panic() - } - - let array91 : Array[String] = [] - for index92 = 0 - index92 < mbt_ffi_load32(iter_base + 32) - index92 = index92 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index92 * 8 - - let result90 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array91.push(result90) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array94 : Array[String] = [] - for index95 = 0 - index95 < mbt_ffi_load32(iter_base + 40) - index95 = index95 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index95 * 8 - - let result93 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array94.push(result93) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted97 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result96 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result96) - } - _ => panic() - } - - let lifted100 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted99 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result98 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result98) - } - _ => panic() - } + () + } + S32Value(payload2) => { + mbt_ffi_store8((ptr) + 0, (3)) + mbt_ffi_store32((ptr) + 8, payload2) - Option::Some(lifted99) - } - _ => panic() - } - - array101.push(@types.VariantCaseType::{ - name: result86, - payload: lifted87, - metadata: @types.MetadataEnvelope::{ - doc: lifted89, - aliases: array91, - examples: array94, - deprecated: lifted97, - role: lifted100, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array101) - } - 16 => { - let array104 : Array[String] = [] - for index105 = 0 - index105 < mbt_ffi_load32(iter_base + 12) - index105 = index105 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index105 * 8 - - let result103 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array104.push(result103) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array104) - } - 17 => { - let array107 : Array[String] = [] - for index108 = 0 - index108 < mbt_ffi_load32(iter_base + 12) - index108 = index108 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index108 * 8 - - let result106 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array107.push(result106) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array107) - } - 18 => { - let array109 : Array[Int] = [] - for index110 = 0 - index110 < mbt_ffi_load32(iter_base + 12) - index110 = index110 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index110 * 4 - - array109.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array109) - } - 19 => @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted111 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() + () } + S64Value(payload3) => { + mbt_ffi_store8((ptr) + 0, (4)) + mbt_ffi_store64((ptr) + 8, payload3) - let lifted112 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() + () } + U8Value(payload4) => { + mbt_ffi_store8((ptr) + 0, (5)) + mbt_ffi_store8((ptr) + 8, (payload4).to_int()) - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted111, - err: lifted112, - }) - } - 24 => { - let lifted116 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array114 : Array[String] = [] - for index115 = 0 - index115 < mbt_ffi_load32(iter_base + 16) - index115 = index115 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index115 * 8 - - let result113 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array114.push(result113) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array114) - } - _ => panic() - } - - let lifted117 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted118 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted120 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result119 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result119) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted116, - min_length: lifted117, - max_length: lifted118, - regex: lifted120, - }) - } - 25 => { - let lifted124 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array122 : Array[String] = [] - for index123 = 0 - index123 < mbt_ffi_load32(iter_base + 16) - index123 = index123 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index123 * 8 - - let result121 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array122.push(result121) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array122) - } - _ => panic() - } - - let lifted125 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted126 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted124, - min_bytes: lifted125, - max_bytes: lifted126, - }) - } - 26 => { - let lifted130 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array128 : Array[String] = [] - for index129 = 0 - index129 < mbt_ffi_load32(iter_base + 20) - index129 = index129 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index129 * 8 - - let result127 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array128.push(result127) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array128) - } - _ => panic() - } - - let lifted134 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array132 : Array[String] = [] - for index133 = 0 - index133 < mbt_ffi_load32(iter_base + 32) - index133 = index133 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index133 * 8 - - let result131 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array132.push(result131) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array132) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted130, - allowed_extensions: lifted134, - }) - } - 27 => { - let lifted138 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array136 : Array[String] = [] - for index137 = 0 - index137 < mbt_ffi_load32(iter_base + 16) - index137 = index137 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index137 * 8 - - let result135 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array136.push(result135) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array136) - } - _ => panic() - } - - let lifted142 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array140 : Array[String] = [] - for index141 = 0 - index141 < mbt_ffi_load32(iter_base + 28) - index141 = index141 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index141 * 8 - - let result139 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array140.push(result139) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array140) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted138, - allowed_hosts: lifted142, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result143 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + () + } + U16Value(payload5) => { + mbt_ffi_store8((ptr) + 0, (6)) + mbt_ffi_store16((ptr) + 8, (payload5).reinterpret_as_int()) - let array145 : Array[String] = [] - for index146 = 0 - index146 < mbt_ffi_load32(iter_base + 20) - index146 = index146 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index146 * 8 - - let result144 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array145.push(result144) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted148 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result147 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result147, - }) - } - _ => panic() - } - - let lifted150 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result149 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result149, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result143, - allowed_suffixes: array145, - min: lifted148, - max: lifted150, - }) - } - 31 => { - let array174 : Array[@types.UnionBranch] = [] - for index175 = 0 - index175 < mbt_ffi_load32(iter_base + 12) - index175 = index175 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index175 * 92 - - let result151 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted160 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result152 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result152) - } - 1 => { - let result153 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result153) - } - 2 => { - let result154 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result154) - } - 3 => { - let result155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result155) - } - 4 => { - let result156 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted158 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result157 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result157) - } - _ => panic() - } + () + } + U32Value(payload6) => { + mbt_ffi_store8((ptr) + 0, (7)) + mbt_ffi_store32((ptr) + 8, (payload6).reinterpret_as_int()) - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result156, - literal: lifted158, - }) - } - 5 => { - let result159 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result159) - } - _ => panic() - } - - let lifted162 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result161 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result161) - } - _ => panic() - } - - let array164 : Array[String] = [] - for index165 = 0 - index165 < mbt_ffi_load32(iter_base + 52) - index165 = index165 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index165 * 8 - - let result163 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array164.push(result163) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array167 : Array[String] = [] - for index168 = 0 - index168 < mbt_ffi_load32(iter_base + 60) - index168 = index168 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index168 * 8 - - let result166 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array167.push(result166) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted170 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result169 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result169) - } - _ => panic() - } - - let lifted173 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted172 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result171 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result171) - } - _ => panic() - } + () + } + U64Value(payload7) => { + mbt_ffi_store8((ptr) + 0, (8)) + mbt_ffi_store64((ptr) + 8, (payload7).reinterpret_as_int64()) - Option::Some(lifted172) - } - _ => panic() - } - - array174.push(@types.UnionBranch::{ - tag: result151, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted160, - metadata: @types.MetadataEnvelope::{ - doc: lifted162, - aliases: array164, - examples: array167, - deprecated: lifted170, - role: lifted173, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array174, - }) - } - 32 => { - let lifted177 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result176 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result176) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted177, - }) - } - 33 => { - let lifted179 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result178 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result178) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted179, - }) - } - 34 => { - let lifted180 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted180) - } - 35 => { - let lifted181 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted181) - } - _ => panic() - } - - let lifted184 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result183 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) + () + } + F32Value(payload8) => { + mbt_ffi_store8((ptr) + 0, (9)) + mbt_ffi_storef32((ptr) + 8, payload8) - Option::Some(result183) - } - _ => panic() - } - - let array186 : Array[String] = [] - for index187 = 0 - index187 < mbt_ffi_load32(iter_base + 104) - index187 = index187 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index187 * 8 - - let result185 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array186.push(result185) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array189 : Array[String] = [] - for index190 = 0 - index190 < mbt_ffi_load32(iter_base + 112) - index190 = index190 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index190 * 8 - - let result188 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array189.push(result188) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted192 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result191 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) + () + } + F64Value(payload9) => { + mbt_ffi_store8((ptr) + 0, (10)) + mbt_ffi_storef64((ptr) + 8, payload9) - Option::Some(result191) - } - _ => panic() - } - - let lifted195 : @types.Role? = match mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted194 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result193 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result193) - } - _ => panic() - } - - Option::Some(lifted194) - } - _ => panic() - } - - array196.push(@types.SchemaTypeNode::{ - body: lifted182, - metadata: @types.MetadataEnvelope::{ - doc: lifted184, - aliases: array186, - examples: array189, - deprecated: lifted192, - role: lifted195, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 16)) - - let array201 : Array[@types.SchemaTypeDef] = [] - for index202 = 0 - index202 < mbt_ffi_load32(p0 + 28) - index202 = index202 + 1 { - let iter_base = mbt_ffi_load32(p0 + 24) + index202 * 24 - - let result198 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted200 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result199 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + () + } + CharValue(payload10) => { + mbt_ffi_store8((ptr) + 0, (11)) + mbt_ffi_store32((ptr) + 8, (payload10).to_int()) - Option::Some(result199) - } - _ => panic() - } + () + } + StringValue(payload11) => { + mbt_ffi_store8((ptr) + 0, (12)) - array201.push(@types.SchemaTypeDef::{ - id: result198, - name: lifted200, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 24)) - - let array232 : Array[@types.SchemaValueNode] = [] - for index233 = 0 - index233 < mbt_ffi_load32(p0 + 40) - index233 = index233 + 1 { - let iter_base = mbt_ffi_load32(p0 + 36) + index233 * 32 - - let lifted231 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8).land(0xFFFF).reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result203 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let ptr12 = mbt_ffi_str2ptr(payload11) + mbt_ffi_store32((ptr) + 12, payload11.length()) + mbt_ffi_store32((ptr) + 8, ptr12) + + () + } + RecordValue(payload13) => { + mbt_ffi_store8((ptr) + 0, (13)) + + let address = mbt_ffi_malloc((payload13).length() * 4); + for index = 0; index < (payload13).length(); index = index + 1 { + let iter_elem : Int = (payload13)[(index)] + let iter_base = address + (index * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - @types.SchemaValueNode::StringValue(result203) - } - 13 => { - let array204 : Array[Int] = [] - for index205 = 0 - index205 < mbt_ffi_load32(iter_base + 12) - index205 = index205 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index205 * 4 + } + mbt_ffi_store32((ptr) + 12, (payload13).length()) + mbt_ffi_store32((ptr) + 8, address) - array204.push(mbt_ffi_load32(iter_base + 0)) + () } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + VariantValue(payload14) => { + mbt_ffi_store8((ptr) + 0, (14)) + __wit_bindgen_lower_t60((ptr) + 8, payload14) - @types.SchemaValueNode::RecordValue(array204) - } - 14 => { - let lifted206 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() + () } + EnumValue(payload15) => { + mbt_ffi_store8((ptr) + 0, (15)) + mbt_ffi_store32((ptr) + 8, (payload15).reinterpret_as_int()) - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted206, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array207 : Array[Bool] = [] - for index208 = 0 - index208 < mbt_ffi_load32(iter_base + 12) - index208 = index208 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index208 * 1 - - array207.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array207) - } - 17 => { - let array209 : Array[Int] = [] - for index210 = 0 - index210 < mbt_ffi_load32(iter_base + 12) - index210 = index210 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index210 * 4 - - array209.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array209) - } - 18 => { - let array211 : Array[Int] = [] - for index212 = 0 - index212 < mbt_ffi_load32(iter_base + 12) - index212 = index212 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index212 * 4 - - array211.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array211) - } - 19 => { - let array213 : Array[Int] = [] - for index214 = 0 - index214 < mbt_ffi_load32(iter_base + 12) - index214 = index214 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index214 * 4 - - array213.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array213) - } - 20 => { - let array215 : Array[@types.MapEntry] = [] - for index216 = 0 - index216 < mbt_ffi_load32(iter_base + 12) - index216 = index216 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index216 * 8 - - array215.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array215) - } - 21 => { - let lifted217 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted217) - } - 22 => { - let lifted220 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted218 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted218) - } - 1 => { - let lifted219 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted219) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted220) - } - 23 => { - let result221 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + () + } + FlagsValue(payload16) => { + mbt_ffi_store8((ptr) + 0, (16)) + + let address17 = mbt_ffi_malloc((payload16).length() * 1); + for index18 = 0; index18 < (payload16).length(); index18 = index18 + 1 { + let iter_elem : Bool = (payload16)[(index18)] + let iter_base = address17 + (index18 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) - let lifted223 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result222 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + } + mbt_ffi_store32((ptr) + 12, (payload16).length()) + mbt_ffi_store32((ptr) + 8, address17) - Option::Some(result222) - } - _ => panic() + () } + TupleValue(payload19) => { + mbt_ffi_store8((ptr) + 0, (17)) - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result221, - language: lifted223, - }) - } - 24 => { - let result224 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let address20 = mbt_ffi_malloc((payload19).length() * 4); + for index21 = 0; index21 < (payload19).length(); index21 = index21 + 1 { + let iter_elem : Int = (payload19)[(index21)] + let iter_base = address20 + (index21 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - let lifted226 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result225 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + } + mbt_ffi_store32((ptr) + 12, (payload19).length()) + mbt_ffi_store32((ptr) + 8, address20) - Option::Some(result225) - } - _ => panic() + () } + ListValue(payload22) => { + mbt_ffi_store8((ptr) + 0, (18)) - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result224, - mime_type: lifted226, - }) - } - 25 => { - let result227 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let address23 = mbt_ffi_malloc((payload22).length() * 4); + for index24 = 0; index24 < (payload22).length(); index24 = index24 + 1 { + let iter_elem : Int = (payload22)[(index24)] + let iter_base = address23 + (index24 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 12, (payload22).length()) + mbt_ffi_store32((ptr) + 8, address23) + + () + } + FixedListValue(payload25) => { + mbt_ffi_store8((ptr) + 0, (19)) + + let address26 = mbt_ffi_malloc((payload25).length() * 4); + for index27 = 0; index27 < (payload25).length(); index27 = index27 + 1 { + let iter_elem : Int = (payload25)[(index27)] + let iter_base = address26 + (index27 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 12, (payload25).length()) + mbt_ffi_store32((ptr) + 8, address26) + + () + } + MapValue(payload28) => { + mbt_ffi_store8((ptr) + 0, (20)) + + let address29 = mbt_ffi_malloc((payload28).length() * 8); + for index30 = 0; index30 < (payload28).length(); index30 = index30 + 1 { + let iter_elem : @types.MapEntry = (payload28)[(index30)] + let iter_base = address29 + (index30 * 8); + __wit_bindgen_lower_t61((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 12, (payload28).length()) + mbt_ffi_store32((ptr) + 8, address29) - @types.SchemaValueNode::PathValue(result227) - } - 26 => { - let result228 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + () + } + OptionValue(payload31) => { + mbt_ffi_store8((ptr) + 0, (21)) - @types.SchemaValueNode::UrlValue(result228) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result229 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + match (payload31) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result229, - }) - } - 30 => { - let result230 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + () + } + Some(payload33) => { + mbt_ffi_store8((ptr) + 8, (1)) + mbt_ffi_store32((ptr) + 12, payload33) - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result230, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } + () + } + } - array232.push(lifted231) - } - mbt_ffi_free(mbt_ffi_load32(p0 + 36)) - - let lifted235 : @async-core.Stream[Byte]? = match - mbt_ffi_load8_u(p0 + 48) { - 0 => Option::None - 1 => { - let result234 = wasmExportGolemToolGuest010InvokeStream0StreamLift( - mbt_ffi_load32(p0 + 52), - ) - - Option::Some(result234) - } - _ => panic() - } + () + } + ResultValue(payload34) => { + mbt_ffi_store8((ptr) + 0, (22)) + __wit_bindgen_lower_t62((ptr) + 8, payload34) - let lifted253 = match mbt_ffi_load8_u(p0 + 56) { - 0 => { - let result236 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 64), - mbt_ffi_load32(p0 + 68), - ) + () + } + TextValue(payload35) => { + mbt_ffi_store8((ptr) + 0, (23)) + __wit_bindgen_lower_t63((ptr) + 8, payload35) - let result237 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 72), - mbt_ffi_load32(p0 + 76), - ) + () + } + BinaryValue(payload36) => { + mbt_ffi_store8((ptr) + 0, (24)) + __wit_bindgen_lower_t65((ptr) + 8, payload36) - let lifted239 : String? = match mbt_ffi_load8_u(p0 + 80) { - 0 => Option::None - 1 => { - let result238 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 84), - mbt_ffi_load32(p0 + 88), - ) + () + } + PathValue(payload37) => { + mbt_ffi_store8((ptr) + 0, (25)) - Option::Some(result238) + let ptr38 = mbt_ffi_str2ptr(payload37) + mbt_ffi_store32((ptr) + 12, payload37.length()) + mbt_ffi_store32((ptr) + 8, ptr38) + + () } - _ => panic() - } + UrlValue(payload39) => { + mbt_ffi_store8((ptr) + 0, (26)) - let lifted241 : String? = match mbt_ffi_load8_u(p0 + 92) { - 0 => Option::None - 1 => { - let result240 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 96), - mbt_ffi_load32(p0 + 100), - ) + let ptr40 = mbt_ffi_str2ptr(payload39) + mbt_ffi_store32((ptr) + 12, payload39.length()) + mbt_ffi_store32((ptr) + 8, ptr40) - Option::Some(result240) + () } - _ => panic() - } + DatetimeValue(payload41) => { + mbt_ffi_store8((ptr) + 0, (27)) + __wit_bindgen_lower_t5((ptr) + 8, payload41) - let lifted242 : Bool? = match mbt_ffi_load8_u(p0 + 104) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load8_u(p0 + 105) != 0) - _ => panic() - } + () + } + DurationValue(payload42) => { + mbt_ffi_store8((ptr) + 0, (28)) + __wit_bindgen_lower_t66((ptr) + 8, payload42) - let lifted244 : String? = match mbt_ffi_load8_u(p0 + 108) { - 0 => Option::None - 1 => { - let result243 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 112), - mbt_ffi_load32(p0 + 116), - ) + () + } + QuantityValueNode(payload43) => { + mbt_ffi_store8((ptr) + 0, (29)) + __wit_bindgen_lower_t39((ptr) + 8, payload43) - Option::Some(result243) + () } - _ => panic() - } + UnionValue(payload44) => { + mbt_ffi_store8((ptr) + 0, (30)) + __wit_bindgen_lower_t67((ptr) + 8, payload44) - let lifted246 : String? = match mbt_ffi_load8_u(p0 + 120) { - 0 => Option::None - 1 => { - let result245 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 124), - mbt_ffi_load32(p0 + 128), - ) + () + } + SecretValue(payload45) => { + mbt_ffi_store8((ptr) + 0, (31)) + + let @types.Secret(handle) = payload45 + mbt_ffi_store32((ptr) + 8, handle) - Option::Some(result245) + () } - _ => panic() - } + QuotaTokenHandle(payload46) => { + mbt_ffi_store8((ptr) + 0, (32)) - let lifted248 : String? = match mbt_ffi_load8_u(p0 + 132) { - 0 => Option::None - 1 => { - let result247 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 136), - mbt_ffi_load32(p0 + 140), - ) + let @types.QuotaToken(handle47) = payload46 + mbt_ffi_store32((ptr) + 8, handle47) - Option::Some(result247) + () } - _ => panic() - } + PermissionCardHandle(payload48) => { + mbt_ffi_store8((ptr) + 0, (33)) - let lifted250 : String? = match mbt_ffi_load8_u(p0 + 144) { - 0 => Option::None - 1 => { - let result249 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 148), - mbt_ffi_load32(p0 + 152), - ) + let @types.PermissionCard(handle49) = payload48 + mbt_ffi_store32((ptr) + 8, handle49) - Option::Some(result249) + () } - _ => panic() - } - - let result251 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 156), - mbt_ffi_load32(p0 + 160), - ) - - @common0.Principal::Oidc(@common0.OidcPrincipal::{ - sub: result236, - issuer: result237, - email: lifted239, - name: lifted241, - email_verified: lifted242, - given_name: lifted244, - family_name: lifted246, - picture: lifted248, - preferred_username: lifted250, - claims: result251, - }) - } - 1 => { - let result252 = mbt_ffi_ptr2str( - mbt_ffi_load32(p0 + 80), - mbt_ffi_load32(p0 + 84), - ) - - @common0.Principal::Agent(@common0.AgentPrincipal::{ - agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(p0 + 64).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(p0 + 72).reinterpret_as_uint64(), - }, - }, - agent_id: result252, - }, - }) - } - 2 => - @common0.Principal::GolemUser(@common0.GolemUserPrincipal::{ - account_id: @types.AccountId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(p0 + 64).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(p0 + 72).reinterpret_as_uint64(), - }, - }, - }) - 3 => @common0.Principal::Anonymous - _ => panic() } - let return_result : Ref[ - Result[@common.InvocationResult, @common.ToolError]?, - ] = Ref(None) - return_result.val = Some( - invoke( - result, - array, - @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array196, - defs: array201, - root: mbt_ffi_load32(p0 + 32), - }, - value: @types.SchemaValueTree::{ - value_nodes: array232, - root: mbt_ffi_load32(p0 + 44), - }, - }, - lifted235, - lifted253, - background_group, - ), - ) - invoke_task_return(return_result) - }) - }) } -///| -fn wasmExportAsyncInvokeGolemToolGuestTaskReturn( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, - p7 : Int, - p8 : Int, - p9 : Int, - p10 : Int, - p11 : Int, -) = "[export]golem:tool/guest@0.1.0" "[task-return]invoke" - -///| -fn invoke_task_return( - return_result : Ref[Result[@common.InvocationResult, @common.ToolError]?], -) -> Unit { - match return_result.val { - Some(return_value) => { - let cleanup_list : Array[Int] = [] - - let ( - lowered301, - lowered302, - lowered303, - lowered304, - lowered305, - lowered306, - lowered307, - lowered308, - lowered309, - lowered310, - lowered311, - lowered312, - ) = match return_value { - Ok(payload) => { - let ( - lowered, - lowered261, - lowered262, - lowered263, - lowered264, - lowered265, - lowered266, - lowered267, - lowered268, - ) = match payload.result { - None => (0, 0, 0, 0, 0, 0, 0, 0, 0) - Some(payload255) => { - let address = mbt_ffi_malloc( - payload255.graph.type_nodes.length() * 144, - ) - for index256 = 0 - index256 < payload255.graph.type_nodes.length() - index256 = index256 + 1 { - let iter_elem : @types.SchemaTypeNode = payload255.graph.type_nodes[index256] - let iter_base = address + index256 * 144 - __wit_bindgen_lower_t53(iter_base + 0, iter_elem) - } - - let address257 = mbt_ffi_malloc( - payload255.graph.defs.length() * 24, - ) - for index258 = 0 - index258 < payload255.graph.defs.length() - index258 = index258 + 1 { - let iter_elem : @types.SchemaTypeDef = payload255.graph.defs[index258] - let iter_base = address257 + index258 * 24 - __wit_bindgen_lower_t16(iter_base + 0, iter_elem) - } - - let address259 = mbt_ffi_malloc( - payload255.value.value_nodes.length() * 32, - ) - for index260 = 0 - index260 < payload255.value.value_nodes.length() - index260 = index260 + 1 { - let iter_elem : @types.SchemaValueNode = payload255.value.value_nodes[index260] - let iter_base = address259 + index260 * 32 - __wit_bindgen_lower_t71(iter_base + 0, iter_elem) - } - cleanup_list.push(address) - cleanup_list.push(address257) - cleanup_list.push(address259) - - ( - 1, - address, - payload255.graph.type_nodes.length(), - address257, - payload255.graph.defs.length(), - payload255.graph.root, - address259, - payload255.value.value_nodes.length(), - payload255.value.root, - ) - } - } - - let (lowered271, lowered272) = match payload.stdout { - None => (0, 0) - Some(payload270) => - ( - 1, - wasmExportGolemToolGuest010InvokeStream1StreamLowerCommitted( - payload270, - ), - ) - } - - ( - 0, lowered, lowered261, lowered262, lowered263, lowered264, lowered265, - lowered266, lowered267, lowered268, lowered271, lowered272, - ) - } - Err(payload273) => { - let ( - lowered292, - lowered293, - lowered294, - lowered295, - lowered296, - lowered297, - lowered298, - lowered299, - lowered300, - ) = match payload273 { - InvalidToolName(payload274) => { - let ptr = mbt_ffi_str2ptr(payload274) - cleanup_list.push(ptr) - - (0, ptr, payload274.length(), 0, 0, 0, 0, 0, 0) - } - InvalidCommandPath(payload275) => { - let address277 = mbt_ffi_malloc(payload275.length() * 8) - for index278 = 0 - index278 < payload275.length() - index278 = index278 + 1 { - let iter_elem : String = payload275[index278] - let iter_base = address277 + index278 * 8 - - let ptr276 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr276) - cleanup_list.push(ptr276) - } - cleanup_list.push(address277) - - (1, address277, payload275.length(), 0, 0, 0, 0, 0, 0) - } - InvalidInput(payload279) => { - let ptr280 = mbt_ffi_str2ptr(payload279) - cleanup_list.push(ptr280) - - (2, ptr280, payload279.length(), 0, 0, 0, 0, 0, 0) - } - ConstraintViolation(payload281) => { - let ptr282 = mbt_ffi_str2ptr(payload281) - cleanup_list.push(ptr282) - - (3, ptr282, payload281.length(), 0, 0, 0, 0, 0, 0) - } - InvalidResult(payload283) => { - let ptr284 = mbt_ffi_str2ptr(payload283) - cleanup_list.push(ptr284) - - (4, ptr284, payload283.length(), 0, 0, 0, 0, 0, 0) - } - CustomError(payload285) => { - let address286 = mbt_ffi_malloc( - payload285.graph.type_nodes.length() * 144, - ) - for index287 = 0 - index287 < payload285.graph.type_nodes.length() - index287 = index287 + 1 { - let iter_elem : @types.SchemaTypeNode = payload285.graph.type_nodes[index287] - let iter_base = address286 + index287 * 144 - __wit_bindgen_lower_t53(iter_base + 0, iter_elem) - } - - let address288 = mbt_ffi_malloc( - payload285.graph.defs.length() * 24, - ) - for index289 = 0 - index289 < payload285.graph.defs.length() - index289 = index289 + 1 { - let iter_elem : @types.SchemaTypeDef = payload285.graph.defs[index289] - let iter_base = address288 + index289 * 24 - __wit_bindgen_lower_t16(iter_base + 0, iter_elem) - } - - let address290 = mbt_ffi_malloc( - payload285.value.value_nodes.length() * 32, - ) - for index291 = 0 - index291 < payload285.value.value_nodes.length() - index291 = index291 + 1 { - let iter_elem : @types.SchemaValueNode = payload285.value.value_nodes[index291] - let iter_base = address290 + index291 * 32 - __wit_bindgen_lower_t71(iter_base + 0, iter_elem) - } - cleanup_list.push(address286) - cleanup_list.push(address288) - cleanup_list.push(address290) - - ( - 5, - address286, - payload285.graph.type_nodes.length(), - address288, - payload285.graph.defs.length(), - payload285.graph.root, - address290, - payload285.value.value_nodes.length(), - payload285.value.root, - ) - } - } - - ( - 1, lowered292, lowered293, lowered294, lowered295, lowered296, lowered297, - lowered298, lowered299, lowered300, 0, 0, - ) - } - } +#doc(hidden) +fn __wit_bindgen_lower_t76(ptr : Int, value : @types.SchemaValueTree) -> Unit { - wasmExportAsyncInvokeGolemToolGuestTaskReturn( - lowered301, lowered302, lowered303, lowered304, lowered305, lowered306, lowered307, - lowered308, lowered309, lowered310, lowered311, lowered312, - ) + let address = mbt_ffi_malloc(((value).value_nodes).length() * 32); + for index = 0; index < ((value).value_nodes).length(); index = index + 1 { + let iter_elem : @types.SchemaValueNode = ((value).value_nodes)[(index)] + let iter_base = address + (index * 32); + __wit_bindgen_lower_t74((iter_base) + 0, iter_elem) - cleanup_list.each(mbt_ffi_free) + } + mbt_ffi_store32((ptr) + 4, ((value).value_nodes).length()) + mbt_ffi_store32((ptr) + 0, address) + mbt_ffi_store32((ptr) + 8, (value).root) - @async-core.task_returned() - } - None => () - } } -///| #doc(hidden) -pub fn wasmExportAsyncInvokeGolemToolGuest( - event_raw : Int, - waitable : Int, - code : Int, -) -> Int { - @async-core.cb(event_raw, waitable, code) -} +fn __wit_bindgen_lower_t77(ptr : Int, value : @types.TypedSchemaValue) -> Unit { + __wit_bindgen_lower_t58((ptr) + 0, (value).graph) + __wit_bindgen_lower_t76((ptr) + 20, (value).value) -///| -#doc(hidden) -fn __wit_bindgen_lower_t5(ptr : Int, value : @types.Datetime) -> Unit { - mbt_ffi_store64(ptr + 0, value.seconds) - mbt_ffi_store32(ptr + 8, value.nanoseconds.reinterpret_as_int()) } -///| #doc(hidden) -fn __wit_bindgen_lower_t16(ptr : Int, value : @types.SchemaTypeDef) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.id) - mbt_ffi_store32(ptr + 4, value.id.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - match value.name { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 16, payload1.length()) - mbt_ffi_store32(ptr + 12, ptr2) - - () - } - } - mbt_ffi_store32(ptr + 20, value.body) -} +fn __wit_bindgen_lower_t457(ptr : Int, value : @common.CommandAnnotations) -> Unit { + mbt_ffi_store8((ptr) + 0, (if (value).read_only { 1 } else { 0 })) + mbt_ffi_store8((ptr) + 1, (if (value).destructive { 1 } else { 0 })) + mbt_ffi_store8((ptr) + 2, (if (value).idempotent { 1 } else { 0 })) + mbt_ffi_store8((ptr) + 3, (if (value).open_world { 1 } else { 0 })) -///| -#doc(hidden) -fn __wit_bindgen_lower_t17(ptr : Int, value : @types.Role) -> Unit { - match value { - Multimodal => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(ptr + 0, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(ptr + 0, 2) - - () - } - Other(payload2) => { - mbt_ffi_store8(ptr + 0, 3) - - let ptr3 = mbt_ffi_str2ptr(payload2) - mbt_ffi_store32(ptr + 8, payload2.length()) - mbt_ffi_store32(ptr + 4, ptr3) - - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t20(ptr : Int, value : @types.MetadataEnvelope) -> Unit { - match value.doc { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - let ptr1 = mbt_ffi_str2ptr(payload0) - mbt_ffi_store32(ptr + 8, payload0.length()) - mbt_ffi_store32(ptr + 4, ptr1) - - () - } - } - - let address = mbt_ffi_malloc(value.aliases.length() * 8) - for index = 0; index < value.aliases.length(); index = index + 1 { - let iter_elem : String = value.aliases[index] - let iter_base = address + index * 8 - - let ptr2 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr2) - } - mbt_ffi_store32(ptr + 16, value.aliases.length()) - mbt_ffi_store32(ptr + 12, address) - - let address4 = mbt_ffi_malloc(value.examples.length() * 8) - for index5 = 0; index5 < value.examples.length(); index5 = index5 + 1 { - let iter_elem : String = value.examples[index5] - let iter_base = address4 + index5 * 8 - - let ptr3 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr3) - } - mbt_ffi_store32(ptr + 24, value.examples.length()) - mbt_ffi_store32(ptr + 20, address4) - - match value.deprecated { - None => { - mbt_ffi_store8(ptr + 28, 0) - - () - } - Some(payload7) => { - mbt_ffi_store8(ptr + 28, 1) - - let ptr8 = mbt_ffi_str2ptr(payload7) - mbt_ffi_store32(ptr + 36, payload7.length()) - mbt_ffi_store32(ptr + 32, ptr8) - - () - } - } - - match value.role { - None => { - mbt_ffi_store8(ptr + 40, 0) - - () - } - Some(payload10) => { - mbt_ffi_store8(ptr + 40, 1) - __wit_bindgen_lower_t17(ptr + 44, payload10) - - () - } - } -} +fn __wit_bindgen_lower_t459(ptr : Int, value : @common.Repetition) -> Unit { + + match value { + Repeated => { + mbt_ffi_store8((ptr) + 0, (0)) + + () + } + Delimited(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + mbt_ffi_store32((ptr) + 4, (payload0).to_int()) + + () + } + Either(payload1) => { + mbt_ffi_store8((ptr) + 0, (2)) + mbt_ffi_store32((ptr) + 4, (payload1).to_int()) + + () + } + } -///| -#doc(hidden) -fn __wit_bindgen_lower_t21(ptr : Int, value : @types.NamedFieldType) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.name) - mbt_ffi_store32(ptr + 4, value.name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - mbt_ffi_store32(ptr + 8, value.body) - __wit_bindgen_lower_t20(ptr + 12, value.metadata) } -///| #doc(hidden) -fn __wit_bindgen_lower_t23(ptr : Int, value : @types.VariantCaseType) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.name) - mbt_ffi_store32(ptr + 4, value.name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - match value.payload { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) - mbt_ffi_store32(ptr + 12, payload1) - - () - } - } - __wit_bindgen_lower_t20(ptr + 16, value.metadata) +fn __wit_bindgen_lower_t460(ptr : Int, value : @common.RepeatableListShape) -> Unit { + __wit_bindgen_lower_t459((ptr) + 0, (value).repetition) + mbt_ffi_store32((ptr) + 8, (value).item_type) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t24(ptr : Int, value : @types.FixedListSpec) -> Unit { - mbt_ffi_store32(ptr + 0, value.element) - mbt_ffi_store32(ptr + 4, value.length.reinterpret_as_int()) +fn __wit_bindgen_lower_t461(ptr : Int, value : @common.RepeatableMapShape) -> Unit { + __wit_bindgen_lower_t459((ptr) + 0, (value).repetition) + mbt_ffi_store32((ptr) + 8, (value).map_type) + mbt_ffi_store8((ptr) + 12, (value).duplicate_key_policy.ordinal()) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t25(ptr : Int, value : @types.MapSpec) -> Unit { - mbt_ffi_store32(ptr + 0, value.key) - mbt_ffi_store32(ptr + 4, value.value) +fn __wit_bindgen_lower_t462(ptr : Int, value : @common.OptionShape) -> Unit { + + match value { + Scalar(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + mbt_ffi_store32((ptr) + 4, payload) + + () + } + OptionalScalar(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + mbt_ffi_store32((ptr) + 4, payload0) + + () + } + RepeatableList(payload1) => { + mbt_ffi_store8((ptr) + 0, (2)) + __wit_bindgen_lower_t460((ptr) + 4, payload1) + + () + } + RepeatableMap(payload2) => { + mbt_ffi_store8((ptr) + 0, (3)) + __wit_bindgen_lower_t461((ptr) + 4, payload2) + + () + } + } + } -///| #doc(hidden) -fn __wit_bindgen_lower_t26(ptr : Int, value : @types.ResultSpec) -> Unit { - match value.ok { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - mbt_ffi_store32(ptr + 4, payload0) - - () - } - } - - match value.err { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload2) => { - mbt_ffi_store8(ptr + 8, 1) - mbt_ffi_store32(ptr + 12, payload2) - - () - } - } +fn __wit_bindgen_lower_t463(ptr : Int, value : @common.BoolFlagShape) -> Unit { + mbt_ffi_store8((ptr) + 0, (if (value).default { 1 } else { 0 })) + mbt_ffi_store8((ptr) + 1, (if (value).negatable { 1 } else { 0 })) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t27(ptr : Int, value : @types.NumericBound) -> Unit { - match value { - Signed(payload) => { - mbt_ffi_store8(ptr + 0, 0) - mbt_ffi_store64(ptr + 8, payload) - - () - } - Unsigned(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - mbt_ffi_store64(ptr + 8, payload0.reinterpret_as_int64()) - - () - } - FloatBits(payload1) => { - mbt_ffi_store8(ptr + 0, 2) - mbt_ffi_store64(ptr + 8, payload1.reinterpret_as_int64()) - - () - } - } +fn __wit_bindgen_lower_t465(ptr : Int, value : @common.FlagShape) -> Unit { + + match value { + BoolFlag(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + __wit_bindgen_lower_t463((ptr) + 4, payload) + + () + } + CountFlag(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + match (payload0) { + None => { + mbt_ffi_store8((ptr) + 4, (0)) + + () + } + Some(payload2) => { + mbt_ffi_store8((ptr) + 4, (1)) + mbt_ffi_store32((ptr) + 8, (payload2).reinterpret_as_int()) + + () + } + } + + () + } + } + } -///| #doc(hidden) -fn __wit_bindgen_lower_t29( - ptr : Int, - value : @types.NumericRestrictions, -) -> Unit { - match value.min { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - __wit_bindgen_lower_t27(ptr + 8, payload0) - - () - } - } - - match value.max { - None => { - mbt_ffi_store8(ptr + 24, 0) - - () - } - Some(payload2) => { - mbt_ffi_store8(ptr + 24, 1) - __wit_bindgen_lower_t27(ptr + 32, payload2) - - () - } - } - - match value.unit { - None => { - mbt_ffi_store8(ptr + 48, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 48, 1) - - let ptr5 = mbt_ffi_str2ptr(payload4) - mbt_ffi_store32(ptr + 56, payload4.length()) - mbt_ffi_store32(ptr + 52, ptr5) - - () - } - } +fn __wit_bindgen_lower_t466(ptr : Int, value : @common.ValueIsRef) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).name) + mbt_ffi_store32((ptr) + 4, (value).name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + __wit_bindgen_lower_t76((ptr) + 8, (value).value) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t32(ptr : Int, value : @types.TextRestrictions) -> Unit { - match value.languages { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - let address = mbt_ffi_malloc(payload0.length() * 8) - for index = 0; index < payload0.length(); index = index + 1 { - let iter_elem : String = payload0[index] - let iter_base = address + index * 8 - - let ptr1 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr1) +fn __wit_bindgen_lower_t467(ptr : Int, value : @common.Ref) -> Unit { + + match value { + Present(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) + + let ptr0 = mbt_ffi_str2ptr(payload) + mbt_ffi_store32((ptr) + 8, payload.length()) + mbt_ffi_store32((ptr) + 4, ptr0) + + () + } + ValueIs(payload1) => { + mbt_ffi_store8((ptr) + 0, (1)) + __wit_bindgen_lower_t466((ptr) + 4, payload1) + + () + } } - mbt_ffi_store32(ptr + 8, payload0.length()) - mbt_ffi_store32(ptr + 4, address) - - () - } - } - - match value.min_length { - None => { - mbt_ffi_store8(ptr + 12, 0) - - () - } - Some(payload3) => { - mbt_ffi_store8(ptr + 12, 1) - mbt_ffi_store32(ptr + 16, payload3.reinterpret_as_int()) - - () - } - } - - match value.max_length { - None => { - mbt_ffi_store8(ptr + 20, 0) - - () - } - Some(payload5) => { - mbt_ffi_store8(ptr + 20, 1) - mbt_ffi_store32(ptr + 24, payload5.reinterpret_as_int()) - - () - } - } - - match value.regex { - None => { - mbt_ffi_store8(ptr + 28, 0) - - () - } - Some(payload7) => { - mbt_ffi_store8(ptr + 28, 1) - - let ptr8 = mbt_ffi_str2ptr(payload7) - mbt_ffi_store32(ptr + 36, payload7.length()) - mbt_ffi_store32(ptr + 32, ptr8) - - () - } - } + } -///| #doc(hidden) -fn __wit_bindgen_lower_t33( - ptr : Int, - value : @types.BinaryRestrictions, -) -> Unit { - match value.mime_types { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - let address = mbt_ffi_malloc(payload0.length() * 8) - for index = 0; index < payload0.length(); index = index + 1 { - let iter_elem : String = payload0[index] - let iter_base = address + index * 8 - - let ptr1 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr1) +fn __wit_bindgen_lower_t469(ptr : Int, value : @common.RefGroup) -> Unit { + + let address = mbt_ffi_malloc(((value).refs).length() * 24); + for index = 0; index < ((value).refs).length(); index = index + 1 { + let iter_elem : @common.Ref = ((value).refs)[(index)] + let iter_base = address + (index * 24); + __wit_bindgen_lower_t467((iter_base) + 0, iter_elem) + } - mbt_ffi_store32(ptr + 8, payload0.length()) - mbt_ffi_store32(ptr + 4, address) - - () - } - } - - match value.min_bytes { - None => { - mbt_ffi_store8(ptr + 12, 0) - - () - } - Some(payload3) => { - mbt_ffi_store8(ptr + 12, 1) - mbt_ffi_store32(ptr + 16, payload3.reinterpret_as_int()) - - () - } - } - - match value.max_bytes { - None => { - mbt_ffi_store8(ptr + 20, 0) - - () - } - Some(payload5) => { - mbt_ffi_store8(ptr + 20, 1) - mbt_ffi_store32(ptr + 24, payload5.reinterpret_as_int()) - - () - } - } + mbt_ffi_store32((ptr) + 4, ((value).refs).length()) + mbt_ffi_store32((ptr) + 0, address) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t36(ptr : Int, value : @types.PathSpec) -> Unit { - mbt_ffi_store8(ptr + 0, value.direction.ordinal()) - mbt_ffi_store8(ptr + 1, value.kind.ordinal()) - - match value.allowed_mime_types { - None => { - mbt_ffi_store8(ptr + 4, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 4, 1) - - let address = mbt_ffi_malloc(payload0.length() * 8) - for index = 0; index < payload0.length(); index = index + 1 { - let iter_elem : String = payload0[index] - let iter_base = address + index * 8 - - let ptr1 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr1) +fn __wit_bindgen_lower_t471(ptr : Int, value : @common.ImpliesC) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).lhs_quant.ordinal()) + + let address = mbt_ffi_malloc(((value).lhs).length() * 24); + for index = 0; index < ((value).lhs).length(); index = index + 1 { + let iter_elem : @common.Ref = ((value).lhs)[(index)] + let iter_base = address + (index * 24); + __wit_bindgen_lower_t467((iter_base) + 0, iter_elem) + } - mbt_ffi_store32(ptr + 12, payload0.length()) - mbt_ffi_store32(ptr + 8, address) - - () - } - } - - match value.allowed_extensions { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload3) => { - mbt_ffi_store8(ptr + 16, 1) - - let address5 = mbt_ffi_malloc(payload3.length() * 8) - for index6 = 0; index6 < payload3.length(); index6 = index6 + 1 { - let iter_elem : String = payload3[index6] - let iter_base = address5 + index6 * 8 - - let ptr4 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr4) + mbt_ffi_store32((ptr) + 8, ((value).lhs).length()) + mbt_ffi_store32((ptr) + 4, address) + mbt_ffi_store8((ptr) + 12, (value).rhs_quant.ordinal()) + + let address0 = mbt_ffi_malloc(((value).rhs).length() * 24); + for index1 = 0; index1 < ((value).rhs).length(); index1 = index1 + 1 { + let iter_elem : @common.Ref = ((value).rhs)[(index1)] + let iter_base = address0 + (index1 * 24); + __wit_bindgen_lower_t467((iter_base) + 0, iter_elem) + } - mbt_ffi_store32(ptr + 24, payload3.length()) - mbt_ffi_store32(ptr + 20, address5) + mbt_ffi_store32((ptr) + 20, ((value).rhs).length()) + mbt_ffi_store32((ptr) + 16, address0) - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t37(ptr : Int, value : @types.UrlRestrictions) -> Unit { - match value.allowed_schemes { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - let address = mbt_ffi_malloc(payload0.length() * 8) - for index = 0; index < payload0.length(); index = index + 1 { - let iter_elem : String = payload0[index] - let iter_base = address + index * 8 - - let ptr1 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr1) +fn __wit_bindgen_lower_t472(ptr : Int, value : @common.ForbidsC) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).lhs_quant.ordinal()) + + let address = mbt_ffi_malloc(((value).lhs).length() * 24); + for index = 0; index < ((value).lhs).length(); index = index + 1 { + let iter_elem : @common.Ref = ((value).lhs)[(index)] + let iter_base = address + (index * 24); + __wit_bindgen_lower_t467((iter_base) + 0, iter_elem) + } - mbt_ffi_store32(ptr + 8, payload0.length()) - mbt_ffi_store32(ptr + 4, address) - - () - } - } - - match value.allowed_hosts { - None => { - mbt_ffi_store8(ptr + 12, 0) - - () - } - Some(payload3) => { - mbt_ffi_store8(ptr + 12, 1) - - let address5 = mbt_ffi_malloc(payload3.length() * 8) - for index6 = 0; index6 < payload3.length(); index6 = index6 + 1 { - let iter_elem : String = payload3[index6] - let iter_base = address5 + index6 * 8 - - let ptr4 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr4) + mbt_ffi_store32((ptr) + 8, ((value).lhs).length()) + mbt_ffi_store32((ptr) + 4, address) + + let address0 = mbt_ffi_malloc(((value).rhs).length() * 24); + for index1 = 0; index1 < ((value).rhs).length(); index1 = index1 + 1 { + let iter_elem : @common.Ref = ((value).rhs)[(index1)] + let iter_base = address0 + (index1 * 24); + __wit_bindgen_lower_t467((iter_base) + 0, iter_elem) + } - mbt_ffi_store32(ptr + 20, payload3.length()) - mbt_ffi_store32(ptr + 16, address5) + mbt_ffi_store32((ptr) + 16, ((value).rhs).length()) + mbt_ffi_store32((ptr) + 12, address0) - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t38(ptr : Int, value : @types.QuantityValue) -> Unit { - mbt_ffi_store64(ptr + 0, value.mantissa) - mbt_ffi_store32(ptr + 8, value.scale) +fn __wit_bindgen_lower_t474(ptr : Int, value : @common.Constraint) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.unit) - mbt_ffi_store32(ptr + 16, value.unit.length()) - mbt_ffi_store32(ptr + 12, ptr0) -} + match value { + RequiresAll(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t40(ptr : Int, value : @types.QuantitySpec) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.base_unit) - mbt_ffi_store32(ptr + 4, value.base_unit.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - let address = mbt_ffi_malloc(value.allowed_suffixes.length() * 8) - for index = 0; index < value.allowed_suffixes.length(); index = index + 1 { - let iter_elem : String = value.allowed_suffixes[index] - let iter_base = address + index * 8 - - let ptr1 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr1) - } - mbt_ffi_store32(ptr + 12, value.allowed_suffixes.length()) - mbt_ffi_store32(ptr + 8, address) - - match value.min { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload2) => { - mbt_ffi_store8(ptr + 16, 1) - __wit_bindgen_lower_t38(ptr + 24, payload2) - - () - } - } - - match value.max { - None => { - mbt_ffi_store8(ptr + 48, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 48, 1) - __wit_bindgen_lower_t38(ptr + 56, payload4) - - () - } - } -} + let address = mbt_ffi_malloc((payload).length() * 24); + for index = 0; index < (payload).length(); index = index + 1 { + let iter_elem : @common.Ref = (payload)[(index)] + let iter_base = address + (index * 24); + __wit_bindgen_lower_t467((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 8, (payload).length()) + mbt_ffi_store32((ptr) + 4, address) + + () + } + AllOrNone(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + let address1 = mbt_ffi_malloc((payload0).length() * 24); + for index2 = 0; index2 < (payload0).length(); index2 = index2 + 1 { + let iter_elem : @common.Ref = (payload0)[(index2)] + let iter_base = address1 + (index2 * 24); + __wit_bindgen_lower_t467((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 8, (payload0).length()) + mbt_ffi_store32((ptr) + 4, address1) + + () + } + RequiresAny(payload3) => { + mbt_ffi_store8((ptr) + 0, (2)) + + let address4 = mbt_ffi_malloc((payload3).length() * 24); + for index5 = 0; index5 < (payload3).length(); index5 = index5 + 1 { + let iter_elem : @common.Ref = (payload3)[(index5)] + let iter_base = address4 + (index5 * 24); + __wit_bindgen_lower_t467((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 8, (payload3).length()) + mbt_ffi_store32((ptr) + 4, address4) + + () + } + MutexGroups(payload6) => { + mbt_ffi_store8((ptr) + 0, (3)) + + let address7 = mbt_ffi_malloc((payload6).length() * 8); + for index8 = 0; index8 < (payload6).length(); index8 = index8 + 1 { + let iter_elem : @common.RefGroup = (payload6)[(index8)] + let iter_base = address7 + (index8 * 8); + __wit_bindgen_lower_t469((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 8, (payload6).length()) + mbt_ffi_store32((ptr) + 4, address7) + + () + } + Implies(payload9) => { + mbt_ffi_store8((ptr) + 0, (4)) + __wit_bindgen_lower_t471((ptr) + 4, payload9) + + () + } + Forbids(payload10) => { + mbt_ffi_store8((ptr) + 0, (5)) + __wit_bindgen_lower_t472((ptr) + 4, payload10) + + () + } + } -///| -#doc(hidden) -fn __wit_bindgen_lower_t41( - ptr : Int, - value : @types.FieldDiscriminator, -) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.field_name) - mbt_ffi_store32(ptr + 4, value.field_name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - match value.literal { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 16, payload1.length()) - mbt_ffi_store32(ptr + 12, ptr2) - - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t42(ptr : Int, value : @types.DiscriminatorRule) -> Unit { - match value { - Prefix(payload) => { - mbt_ffi_store8(ptr + 0, 0) - - let ptr0 = mbt_ffi_str2ptr(payload) - mbt_ffi_store32(ptr + 8, payload.length()) - mbt_ffi_store32(ptr + 4, ptr0) - - () - } - Suffix(payload1) => { - mbt_ffi_store8(ptr + 0, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 8, payload1.length()) - mbt_ffi_store32(ptr + 4, ptr2) - - () - } - Contains(payload3) => { - mbt_ffi_store8(ptr + 0, 2) - - let ptr4 = mbt_ffi_str2ptr(payload3) - mbt_ffi_store32(ptr + 8, payload3.length()) - mbt_ffi_store32(ptr + 4, ptr4) - - () - } - Regex(payload5) => { - mbt_ffi_store8(ptr + 0, 3) - - let ptr6 = mbt_ffi_str2ptr(payload5) - mbt_ffi_store32(ptr + 8, payload5.length()) - mbt_ffi_store32(ptr + 4, ptr6) - - () - } - FieldEquals(payload7) => { - mbt_ffi_store8(ptr + 0, 4) - __wit_bindgen_lower_t41(ptr + 4, payload7) - - () - } - FieldAbsent(payload8) => { - mbt_ffi_store8(ptr + 0, 5) - - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(ptr + 8, payload8.length()) - mbt_ffi_store32(ptr + 4, ptr9) - - () - } - } +fn __wit_bindgen_lower_t476(ptr : Int, value : @common.Example) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).title) + mbt_ffi_store32((ptr) + 4, (value).title.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + let ptr1 = mbt_ffi_str2ptr((value).body) + mbt_ffi_store32((ptr) + 12, (value).body.length()) + mbt_ffi_store32((ptr) + 8, ptr1) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t43(ptr : Int, value : @types.UnionBranch) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.tag) - mbt_ffi_store32(ptr + 4, value.tag.length()) - mbt_ffi_store32(ptr + 0, ptr0) - mbt_ffi_store32(ptr + 8, value.body) - __wit_bindgen_lower_t42(ptr + 12, value.discriminator) - __wit_bindgen_lower_t20(ptr + 36, value.metadata) +fn __wit_bindgen_lower_t478(ptr : Int, value : @common.Doc) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).summary) + mbt_ffi_store32((ptr) + 4, (value).summary.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + + let ptr1 = mbt_ffi_str2ptr((value).description) + mbt_ffi_store32((ptr) + 12, (value).description.length()) + mbt_ffi_store32((ptr) + 8, ptr1) + + let address = mbt_ffi_malloc(((value).examples).length() * 16); + for index = 0; index < ((value).examples).length(); index = index + 1 { + let iter_elem : @common.Example = ((value).examples)[(index)] + let iter_base = address + (index * 16); + __wit_bindgen_lower_t476((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 20, ((value).examples).length()) + mbt_ffi_store32((ptr) + 16, address) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t45(ptr : Int, value : @types.UnionSpec) -> Unit { - let address = mbt_ffi_malloc(value.branches.length() * 92) - for index = 0; index < value.branches.length(); index = index + 1 { - let iter_elem : @types.UnionBranch = value.branches[index] - let iter_base = address + index * 92 - __wit_bindgen_lower_t43(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 4, value.branches.length()) - mbt_ffi_store32(ptr + 0, address) +fn __wit_bindgen_lower_t481(ptr : Int, value : @common.Positional) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).name) + mbt_ffi_store32((ptr) + 4, (value).name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + __wit_bindgen_lower_t478((ptr) + 8, (value).doc) + + match ((value).value_name) { + None => { + mbt_ffi_store8((ptr) + 32, (0)) + + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 32, (1)) + + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 40, payload1.length()) + mbt_ffi_store32((ptr) + 36, ptr2) + + () + } + } + mbt_ffi_store32((ptr) + 44, (value).type_) + + match ((value).default) { + None => { + mbt_ffi_store8((ptr) + 48, (0)) + + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 48, (1)) + __wit_bindgen_lower_t76((ptr) + 52, payload4) + + () + } + } + mbt_ffi_store8((ptr) + 64, (if (value).required { 1 } else { 0 })) + mbt_ffi_store8((ptr) + 65, (if (value).accepts_stdio { 1 } else { 0 })) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t46(ptr : Int, value : @types.SecretSpec) -> Unit { - mbt_ffi_store32(ptr + 0, value.inner) +fn __wit_bindgen_lower_t482(ptr : Int, value : @common.TailPositional) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).name) + mbt_ffi_store32((ptr) + 4, (value).name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + __wit_bindgen_lower_t478((ptr) + 8, (value).doc) + + match ((value).value_name) { + None => { + mbt_ffi_store8((ptr) + 32, (0)) + + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 32, (1)) - match value.category { - None => { - mbt_ffi_store8(ptr + 4, 0) + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((ptr) + 40, payload1.length()) + mbt_ffi_store32((ptr) + 36, ptr2) - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 4, 1) + () + } + } + mbt_ffi_store32((ptr) + 44, (value).item_type) + mbt_ffi_store32((ptr) + 48, ((value).min).reinterpret_as_int()) + + match ((value).max) { + None => { + mbt_ffi_store8((ptr) + 52, (0)) + + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 52, (1)) + mbt_ffi_store32((ptr) + 56, (payload4).reinterpret_as_int()) + + () + } + } - let ptr1 = mbt_ffi_str2ptr(payload0) - mbt_ffi_store32(ptr + 12, payload0.length()) - mbt_ffi_store32(ptr + 8, ptr1) + match ((value).separator) { + None => { + mbt_ffi_store8((ptr) + 60, (0)) + + () + } + Some(payload6) => { + mbt_ffi_store8((ptr) + 60, (1)) + + let ptr7 = mbt_ffi_str2ptr(payload6) + mbt_ffi_store32((ptr) + 68, payload6.length()) + mbt_ffi_store32((ptr) + 64, ptr7) + + () + } + } + mbt_ffi_store8((ptr) + 72, (if (value).verbatim { 1 } else { 0 })) + mbt_ffi_store8((ptr) + 73, (if (value).accepts_stdio { 1 } else { 0 })) - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t47(ptr : Int, value : @types.QuotaTokenSpec) -> Unit { - match value.resource_name { - None => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - let ptr1 = mbt_ffi_str2ptr(payload0) - mbt_ffi_store32(ptr + 8, payload0.length()) - mbt_ffi_store32(ptr + 4, ptr1) - - () - } - } +fn __wit_bindgen_lower_t485(ptr : Int, value : @common.Positionals) -> Unit { + + let address = mbt_ffi_malloc(((value).fixed).length() * 68); + for index = 0; index < ((value).fixed).length(); index = index + 1 { + let iter_elem : @common.Positional = ((value).fixed)[(index)] + let iter_base = address + (index * 68); + __wit_bindgen_lower_t481((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((ptr) + 4, ((value).fixed).length()) + mbt_ffi_store32((ptr) + 0, address) + + match ((value).tail) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((ptr) + 8, (1)) + __wit_bindgen_lower_t482((ptr) + 12, payload0) + + () + } + } + } -///| #doc(hidden) -fn __wit_bindgen_lower_t52(ptr : Int, value : @types.SchemaTypeBody) -> Unit { - match value { - RefType(payload) => { - mbt_ffi_store8(ptr + 0, 0) - mbt_ffi_store32(ptr + 8, payload) - - () - } - BoolType => { - mbt_ffi_store8(ptr + 0, 1) - - () - } - S8Type(payload1) => { - mbt_ffi_store8(ptr + 0, 2) - - match payload1 { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload3) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload3) - - () - } - } +fn __wit_bindgen_lower_t488(ptr : Int, value : @common.OptionSpec) -> Unit { - () - } - S16Type(payload4) => { - mbt_ffi_store8(ptr + 0, 3) + let ptr0 = mbt_ffi_str2ptr((value).long) + mbt_ffi_store32((ptr) + 4, (value).long.length()) + mbt_ffi_store32((ptr) + 0, ptr0) - match payload4 { - None => { - mbt_ffi_store8(ptr + 8, 0) + match ((value).short) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - () - } - Some(payload6) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload6) + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) + mbt_ffi_store32((ptr) + 12, (payload1).to_int()) - () - } + () + } } - () - } - S32Type(payload7) => { - mbt_ffi_store8(ptr + 0, 4) - - match payload7 { - None => { - mbt_ffi_store8(ptr + 8, 0) + let address = mbt_ffi_malloc(((value).aliases).length() * 8); + for index = 0; index < ((value).aliases).length(); index = index + 1 { + let iter_elem : String = ((value).aliases)[(index)] + let iter_base = address + (index * 8); - () - } - Some(payload9) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload9) + let ptr2 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr2) - () - } } + mbt_ffi_store32((ptr) + 20, ((value).aliases).length()) + mbt_ffi_store32((ptr) + 16, address) + __wit_bindgen_lower_t478((ptr) + 24, (value).doc) - () - } - S64Type(payload10) => { - mbt_ffi_store8(ptr + 0, 5) + match ((value).value_name) { + None => { + mbt_ffi_store8((ptr) + 48, (0)) - match payload10 { - None => { - mbt_ffi_store8(ptr + 8, 0) + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 48, (1)) - () - } - Some(payload12) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload12) + let ptr5 = mbt_ffi_str2ptr(payload4) + mbt_ffi_store32((ptr) + 56, payload4.length()) + mbt_ffi_store32((ptr) + 52, ptr5) - () - } + () + } } + __wit_bindgen_lower_t462((ptr) + 60, (value).shape) - () - } - U8Type(payload13) => { - mbt_ffi_store8(ptr + 0, 6) + match ((value).default) { + None => { + mbt_ffi_store8((ptr) + 80, (0)) - match payload13 { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload15) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload15) + () + } + Some(payload7) => { + mbt_ffi_store8((ptr) + 80, (1)) + __wit_bindgen_lower_t76((ptr) + 84, payload7) - () - } + () + } } + mbt_ffi_store8((ptr) + 96, (if (value).required { 1 } else { 0 })) - () - } - U16Type(payload16) => { - mbt_ffi_store8(ptr + 0, 7) + match ((value).env_var) { + None => { + mbt_ffi_store8((ptr) + 100, (0)) - match payload16 { - None => { - mbt_ffi_store8(ptr + 8, 0) + () + } + Some(payload9) => { + mbt_ffi_store8((ptr) + 100, (1)) - () - } - Some(payload18) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload18) + let ptr10 = mbt_ffi_str2ptr(payload9) + mbt_ffi_store32((ptr) + 108, payload9.length()) + mbt_ffi_store32((ptr) + 104, ptr10) - () - } + () + } } - () - } - U32Type(payload19) => { - mbt_ffi_store8(ptr + 0, 8) +} + +#doc(hidden) +fn __wit_bindgen_lower_t489(ptr : Int, value : @common.FlagSpec) -> Unit { - match payload19 { - None => { - mbt_ffi_store8(ptr + 8, 0) + let ptr0 = mbt_ffi_str2ptr((value).long) + mbt_ffi_store32((ptr) + 4, (value).long.length()) + mbt_ffi_store32((ptr) + 0, ptr0) - () - } - Some(payload21) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload21) + match ((value).short) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - () - } - } + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) + mbt_ffi_store32((ptr) + 12, (payload1).to_int()) - () - } - U64Type(payload22) => { - mbt_ffi_store8(ptr + 0, 9) + () + } + } - match payload22 { - None => { - mbt_ffi_store8(ptr + 8, 0) + let address = mbt_ffi_malloc(((value).aliases).length() * 8); + for index = 0; index < ((value).aliases).length(); index = index + 1 { + let iter_elem : String = ((value).aliases)[(index)] + let iter_base = address + (index * 8); - () - } - Some(payload24) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload24) + let ptr2 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr2) - () - } } + mbt_ffi_store32((ptr) + 20, ((value).aliases).length()) + mbt_ffi_store32((ptr) + 16, address) + __wit_bindgen_lower_t478((ptr) + 24, (value).doc) + __wit_bindgen_lower_t465((ptr) + 48, (value).shape) - () - } - F32Type(payload25) => { - mbt_ffi_store8(ptr + 0, 10) + match ((value).env_var) { + None => { + mbt_ffi_store8((ptr) + 60, (0)) - match payload25 { - None => { - mbt_ffi_store8(ptr + 8, 0) + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 60, (1)) - () - } - Some(payload27) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload27) + let ptr5 = mbt_ffi_str2ptr(payload4) + mbt_ffi_store32((ptr) + 68, payload4.length()) + mbt_ffi_store32((ptr) + 64, ptr5) - () - } + () + } } - () - } - F64Type(payload28) => { - mbt_ffi_store8(ptr + 0, 11) +} - match payload28 { - None => { - mbt_ffi_store8(ptr + 8, 0) +#doc(hidden) +fn __wit_bindgen_lower_t492(ptr : Int, value : @common.Globals) -> Unit { - () - } - Some(payload30) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t29(ptr + 16, payload30) + let address = mbt_ffi_malloc(((value).options).length() * 112); + for index = 0; index < ((value).options).length(); index = index + 1 { + let iter_elem : @common.OptionSpec = ((value).options)[(index)] + let iter_base = address + (index * 112); + __wit_bindgen_lower_t488((iter_base) + 0, iter_elem) - () - } } + mbt_ffi_store32((ptr) + 4, ((value).options).length()) + mbt_ffi_store32((ptr) + 0, address) + + let address0 = mbt_ffi_malloc(((value).flags).length() * 72); + for index1 = 0; index1 < ((value).flags).length(); index1 = index1 + 1 { + let iter_elem : @common.FlagSpec = ((value).flags)[(index1)] + let iter_base = address0 + (index1 * 72); + __wit_bindgen_lower_t489((iter_base) + 0, iter_elem) - () - } - CharType => { - mbt_ffi_store8(ptr + 0, 12) - - () - } - StringType => { - mbt_ffi_store8(ptr + 0, 13) - - () - } - RecordType(payload33) => { - mbt_ffi_store8(ptr + 0, 14) - - let address = mbt_ffi_malloc(payload33.length() * 68) - for index = 0; index < payload33.length(); index = index + 1 { - let iter_elem : @types.NamedFieldType = payload33[index] - let iter_base = address + index * 68 - __wit_bindgen_lower_t21(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload33.length()) - mbt_ffi_store32(ptr + 8, address) - - () - } - VariantType(payload34) => { - mbt_ffi_store8(ptr + 0, 15) - - let address35 = mbt_ffi_malloc(payload34.length() * 72) - for index36 = 0; index36 < payload34.length(); index36 = index36 + 1 { - let iter_elem : @types.VariantCaseType = payload34[index36] - let iter_base = address35 + index36 * 72 - __wit_bindgen_lower_t23(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload34.length()) - mbt_ffi_store32(ptr + 8, address35) - - () - } - EnumType(payload37) => { - mbt_ffi_store8(ptr + 0, 16) - - let address39 = mbt_ffi_malloc(payload37.length() * 8) - for index40 = 0; index40 < payload37.length(); index40 = index40 + 1 { - let iter_elem : String = payload37[index40] - let iter_base = address39 + index40 * 8 - - let ptr38 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr38) - } - mbt_ffi_store32(ptr + 12, payload37.length()) - mbt_ffi_store32(ptr + 8, address39) - - () - } - FlagsType(payload41) => { - mbt_ffi_store8(ptr + 0, 17) - - let address43 = mbt_ffi_malloc(payload41.length() * 8) - for index44 = 0; index44 < payload41.length(); index44 = index44 + 1 { - let iter_elem : String = payload41[index44] - let iter_base = address43 + index44 * 8 - - let ptr42 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr42) - } - mbt_ffi_store32(ptr + 12, payload41.length()) - mbt_ffi_store32(ptr + 8, address43) - - () - } - TupleType(payload45) => { - mbt_ffi_store8(ptr + 0, 18) - - let address46 = mbt_ffi_malloc(payload45.length() * 4) - for index47 = 0; index47 < payload45.length(); index47 = index47 + 1 { - let iter_elem : Int = payload45[index47] - let iter_base = address46 + index47 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload45.length()) - mbt_ffi_store32(ptr + 8, address46) - - () - } - ListType(payload48) => { - mbt_ffi_store8(ptr + 0, 19) - mbt_ffi_store32(ptr + 8, payload48) - - () - } - FixedListType(payload49) => { - mbt_ffi_store8(ptr + 0, 20) - __wit_bindgen_lower_t24(ptr + 8, payload49) - - () - } - MapType(payload50) => { - mbt_ffi_store8(ptr + 0, 21) - __wit_bindgen_lower_t25(ptr + 8, payload50) - - () - } - OptionType(payload51) => { - mbt_ffi_store8(ptr + 0, 22) - mbt_ffi_store32(ptr + 8, payload51) - - () - } - ResultType(payload52) => { - mbt_ffi_store8(ptr + 0, 23) - __wit_bindgen_lower_t26(ptr + 8, payload52) - - () - } - TextType(payload53) => { - mbt_ffi_store8(ptr + 0, 24) - __wit_bindgen_lower_t32(ptr + 8, payload53) - - () - } - BinaryType(payload54) => { - mbt_ffi_store8(ptr + 0, 25) - __wit_bindgen_lower_t33(ptr + 8, payload54) - - () - } - PathType(payload55) => { - mbt_ffi_store8(ptr + 0, 26) - __wit_bindgen_lower_t36(ptr + 8, payload55) - - () - } - UrlType(payload56) => { - mbt_ffi_store8(ptr + 0, 27) - __wit_bindgen_lower_t37(ptr + 8, payload56) - - () - } - DatetimeType => { - mbt_ffi_store8(ptr + 0, 28) - - () - } - DurationType => { - mbt_ffi_store8(ptr + 0, 29) - - () - } - QuantityType(payload59) => { - mbt_ffi_store8(ptr + 0, 30) - __wit_bindgen_lower_t40(ptr + 8, payload59) - - () - } - UnionType(payload60) => { - mbt_ffi_store8(ptr + 0, 31) - __wit_bindgen_lower_t45(ptr + 8, payload60) - - () - } - SecretType(payload61) => { - mbt_ffi_store8(ptr + 0, 32) - __wit_bindgen_lower_t46(ptr + 8, payload61) - - () - } - QuotaTokenType(payload62) => { - mbt_ffi_store8(ptr + 0, 33) - __wit_bindgen_lower_t47(ptr + 8, payload62) - - () - } - FutureType(payload63) => { - mbt_ffi_store8(ptr + 0, 34) - - match payload63 { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload65) => { - mbt_ffi_store8(ptr + 8, 1) - mbt_ffi_store32(ptr + 12, payload65) - - () - } } + mbt_ffi_store32((ptr) + 12, ((value).flags).length()) + mbt_ffi_store32((ptr) + 8, address0) + +} - () - } - StreamType(payload66) => { - mbt_ffi_store8(ptr + 0, 35) +#doc(hidden) +fn __wit_bindgen_lower_t493(ptr : Int, value : @common.StreamSpec) -> Unit { + __wit_bindgen_lower_t478((ptr) + 0, (value).doc) - match payload66 { - None => { - mbt_ffi_store8(ptr + 8, 0) + let address = mbt_ffi_malloc(((value).mime).length() * 8); + for index = 0; index < ((value).mime).length(); index = index + 1 { + let iter_elem : String = ((value).mime)[(index)] + let iter_base = address + (index * 8); - () - } - Some(payload68) => { - mbt_ffi_store8(ptr + 8, 1) - mbt_ffi_store32(ptr + 12, payload68) + let ptr0 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr0) - () - } } + mbt_ffi_store32((ptr) + 28, ((value).mime).length()) + mbt_ffi_store32((ptr) + 24, address) + mbt_ffi_store8((ptr) + 32, (if (value).required { 1 } else { 0 })) - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t53(ptr : Int, value : @types.SchemaTypeNode) -> Unit { - __wit_bindgen_lower_t52(ptr + 0, value.body) - __wit_bindgen_lower_t20(ptr + 88, value.metadata) -} +fn __wit_bindgen_lower_t494(ptr : Int, value : @common.Formatter) -> Unit { + + let ptr0 = mbt_ffi_str2ptr((value).name) + mbt_ffi_store32((ptr) + 4, (value).name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + __wit_bindgen_lower_t478((ptr) + 8, (value).doc) -///| -#doc(hidden) -fn __wit_bindgen_lower_t56(ptr : Int, value : @types.SchemaGraph) -> Unit { - let address = mbt_ffi_malloc(value.type_nodes.length() * 144) - for index = 0; index < value.type_nodes.length(); index = index + 1 { - let iter_elem : @types.SchemaTypeNode = value.type_nodes[index] - let iter_base = address + index * 144 - __wit_bindgen_lower_t53(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 4, value.type_nodes.length()) - mbt_ffi_store32(ptr + 0, address) - - let address0 = mbt_ffi_malloc(value.defs.length() * 24) - for index1 = 0; index1 < value.defs.length(); index1 = index1 + 1 { - let iter_elem : @types.SchemaTypeDef = value.defs[index1] - let iter_base = address0 + index1 * 24 - __wit_bindgen_lower_t16(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, value.defs.length()) - mbt_ffi_store32(ptr + 8, address0) - mbt_ffi_store32(ptr + 16, value.root) } -///| #doc(hidden) -fn __wit_bindgen_lower_t58( - ptr : Int, - value : @types.VariantValuePayload, -) -> Unit { - mbt_ffi_store32(ptr + 0, value.case.reinterpret_as_int()) +fn __wit_bindgen_lower_t496(ptr : Int, value : @common.ResultSpec) -> Unit { + mbt_ffi_store32((ptr) + 0, (value).type_) + __wit_bindgen_lower_t478((ptr) + 4, (value).doc) - match value.payload { - None => { - mbt_ffi_store8(ptr + 4, 0) + let address = mbt_ffi_malloc(((value).formatters).length() * 32); + for index = 0; index < ((value).formatters).length(); index = index + 1 { + let iter_elem : @common.Formatter = ((value).formatters)[(index)] + let iter_base = address + (index * 32); + __wit_bindgen_lower_t494((iter_base) + 0, iter_elem) - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 4, 1) - mbt_ffi_store32(ptr + 8, payload0) + } + mbt_ffi_store32((ptr) + 32, ((value).formatters).length()) + mbt_ffi_store32((ptr) + 28, address) - () - } - } -} + let ptr0 = mbt_ffi_str2ptr((value).default_formatter) + mbt_ffi_store32((ptr) + 40, (value).default_formatter.length()) + mbt_ffi_store32((ptr) + 36, ptr0) -///| -#doc(hidden) -fn __wit_bindgen_lower_t59(ptr : Int, value : @types.MapEntry) -> Unit { - mbt_ffi_store32(ptr + 0, value.key) - mbt_ffi_store32(ptr + 4, value.value) } -///| #doc(hidden) -fn __wit_bindgen_lower_t60( - ptr : Int, - value : @types.ResultValuePayload, -) -> Unit { - match value { - OkValue(payload) => { - mbt_ffi_store8(ptr + 0, 0) - - match payload { - None => { - mbt_ffi_store8(ptr + 4, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 4, 1) - mbt_ffi_store32(ptr + 8, payload1) - - () - } - } +fn __wit_bindgen_lower_t498(ptr : Int, value : @common.ErrorCase) -> Unit { - () - } - ErrValue(payload2) => { - mbt_ffi_store8(ptr + 0, 1) + let ptr0 = mbt_ffi_str2ptr((value).name) + mbt_ffi_store32((ptr) + 4, (value).name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + __wit_bindgen_lower_t478((ptr) + 8, (value).doc) + mbt_ffi_store8((ptr) + 32, (value).kind.ordinal()) + mbt_ffi_store8((ptr) + 33, ((value).exit_code).to_int()) - match payload2 { - None => { - mbt_ffi_store8(ptr + 4, 0) + match ((value).payload) { + None => { + mbt_ffi_store8((ptr) + 36, (0)) - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 4, 1) - mbt_ffi_store32(ptr + 8, payload4) + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 36, (1)) + mbt_ffi_store32((ptr) + 40, payload1) - () - } + () + } } - () - } - } } -///| #doc(hidden) -fn __wit_bindgen_lower_t61(ptr : Int, value : @types.TextValuePayload) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.text) - mbt_ffi_store32(ptr + 4, value.text.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - match value.language { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 16, payload1.length()) - mbt_ffi_store32(ptr + 12, ptr2) - - () - } - } -} +fn __wit_bindgen_lower_t504(ptr : Int, value : @common.CommandBody) -> Unit { + __wit_bindgen_lower_t485((ptr) + 0, (value).positionals) -///| -#doc(hidden) -fn __wit_bindgen_lower_t63( - ptr : Int, - value : @types.BinaryValuePayload, -) -> Unit { - let ptr0 = mbt_ffi_bytes2ptr(value.bytes) + let address = mbt_ffi_malloc(((value).options).length() * 112); + for index = 0; index < ((value).options).length(); index = index + 1 { + let iter_elem : @common.OptionSpec = ((value).options)[(index)] + let iter_base = address + (index * 112); + __wit_bindgen_lower_t488((iter_base) + 0, iter_elem) - mbt_ffi_store32(ptr + 4, value.bytes.length()) - mbt_ffi_store32(ptr + 0, ptr0) + } + mbt_ffi_store32((ptr) + 92, ((value).options).length()) + mbt_ffi_store32((ptr) + 88, address) - match value.mime_type { - None => { - mbt_ffi_store8(ptr + 8, 0) + let address0 = mbt_ffi_malloc(((value).flags).length() * 72); + for index1 = 0; index1 < ((value).flags).length(); index1 = index1 + 1 { + let iter_elem : @common.FlagSpec = ((value).flags)[(index1)] + let iter_base = address0 + (index1 * 72); + __wit_bindgen_lower_t489((iter_base) + 0, iter_elem) - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) + } + mbt_ffi_store32((ptr) + 100, ((value).flags).length()) + mbt_ffi_store32((ptr) + 96, address0) - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 16, payload1.length()) - mbt_ffi_store32(ptr + 12, ptr2) + let address2 = mbt_ffi_malloc(((value).constraints).length() * 28); + for index3 = 0; index3 < ((value).constraints).length(); index3 = index3 + 1 { + let iter_elem : @common.Constraint = ((value).constraints)[(index3)] + let iter_base = address2 + (index3 * 28); + __wit_bindgen_lower_t474((iter_base) + 0, iter_elem) - () - } - } -} + } + mbt_ffi_store32((ptr) + 108, ((value).constraints).length()) + mbt_ffi_store32((ptr) + 104, address2) -///| -#doc(hidden) -fn __wit_bindgen_lower_t64( - ptr : Int, - value : @types.DurationValuePayload, -) -> Unit { - mbt_ffi_store64(ptr + 0, value.nanoseconds) -} + match ((value).stdin) { + None => { + mbt_ffi_store8((ptr) + 112, (0)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t65(ptr : Int, value : @types.UnionValuePayload) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.tag) - mbt_ffi_store32(ptr + 4, value.tag.length()) - mbt_ffi_store32(ptr + 0, ptr0) - mbt_ffi_store32(ptr + 8, value.body) -} + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 112, (1)) + __wit_bindgen_lower_t493((ptr) + 116, payload4) -///| -#doc(hidden) -fn __wit_bindgen_lower_t71(ptr : Int, value : @types.SchemaValueNode) -> Unit { - match value { - BoolValue(payload) => { - mbt_ffi_store8(ptr + 0, 0) - mbt_ffi_store8(ptr + 8, if payload { 1 } else { 0 }) - - () - } - S8Value(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - mbt_ffi_store8(ptr + 8, mbt_ffi_extend8(payload0)) - - () - } - S16Value(payload1) => { - mbt_ffi_store8(ptr + 0, 2) - mbt_ffi_store16(ptr + 8, mbt_ffi_extend16(payload1)) - - () - } - S32Value(payload2) => { - mbt_ffi_store8(ptr + 0, 3) - mbt_ffi_store32(ptr + 8, payload2) - - () - } - S64Value(payload3) => { - mbt_ffi_store8(ptr + 0, 4) - mbt_ffi_store64(ptr + 8, payload3) - - () - } - U8Value(payload4) => { - mbt_ffi_store8(ptr + 0, 5) - mbt_ffi_store8(ptr + 8, payload4.to_int()) - - () - } - U16Value(payload5) => { - mbt_ffi_store8(ptr + 0, 6) - mbt_ffi_store16(ptr + 8, payload5.reinterpret_as_int()) - - () - } - U32Value(payload6) => { - mbt_ffi_store8(ptr + 0, 7) - mbt_ffi_store32(ptr + 8, payload6.reinterpret_as_int()) - - () - } - U64Value(payload7) => { - mbt_ffi_store8(ptr + 0, 8) - mbt_ffi_store64(ptr + 8, payload7.reinterpret_as_int64()) - - () - } - F32Value(payload8) => { - mbt_ffi_store8(ptr + 0, 9) - mbt_ffi_storef32(ptr + 8, payload8) - - () - } - F64Value(payload9) => { - mbt_ffi_store8(ptr + 0, 10) - mbt_ffi_storef64(ptr + 8, payload9) - - () - } - CharValue(payload10) => { - mbt_ffi_store8(ptr + 0, 11) - mbt_ffi_store32(ptr + 8, payload10.to_int()) - - () - } - StringValue(payload11) => { - mbt_ffi_store8(ptr + 0, 12) - - let ptr12 = mbt_ffi_str2ptr(payload11) - mbt_ffi_store32(ptr + 12, payload11.length()) - mbt_ffi_store32(ptr + 8, ptr12) - - () - } - RecordValue(payload13) => { - mbt_ffi_store8(ptr + 0, 13) - - let address = mbt_ffi_malloc(payload13.length() * 4) - for index = 0; index < payload13.length(); index = index + 1 { - let iter_elem : Int = payload13[index] - let iter_base = address + index * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload13.length()) - mbt_ffi_store32(ptr + 8, address) - - () - } - VariantValue(payload14) => { - mbt_ffi_store8(ptr + 0, 14) - __wit_bindgen_lower_t58(ptr + 8, payload14) - - () - } - EnumValue(payload15) => { - mbt_ffi_store8(ptr + 0, 15) - mbt_ffi_store32(ptr + 8, payload15.reinterpret_as_int()) - - () - } - FlagsValue(payload16) => { - mbt_ffi_store8(ptr + 0, 16) - - let address17 = mbt_ffi_malloc(payload16.length() * 1) - for index18 = 0; index18 < payload16.length(); index18 = index18 + 1 { - let iter_elem : Bool = payload16[index18] - let iter_base = address17 + index18 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(ptr + 12, payload16.length()) - mbt_ffi_store32(ptr + 8, address17) - - () - } - TupleValue(payload19) => { - mbt_ffi_store8(ptr + 0, 17) - - let address20 = mbt_ffi_malloc(payload19.length() * 4) - for index21 = 0; index21 < payload19.length(); index21 = index21 + 1 { - let iter_elem : Int = payload19[index21] - let iter_base = address20 + index21 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, payload19.length()) - mbt_ffi_store32(ptr + 8, address20) - - () - } - ListValue(payload22) => { - mbt_ffi_store8(ptr + 0, 18) - - let address23 = mbt_ffi_malloc(payload22.length() * 4) - for index24 = 0; index24 < payload22.length(); index24 = index24 + 1 { - let iter_elem : Int = payload22[index24] - let iter_base = address23 + index24 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) + () + } } - mbt_ffi_store32(ptr + 12, payload22.length()) - mbt_ffi_store32(ptr + 8, address23) - - () - } - FixedListValue(payload25) => { - mbt_ffi_store8(ptr + 0, 19) - - let address26 = mbt_ffi_malloc(payload25.length() * 4) - for index27 = 0; index27 < payload25.length(); index27 = index27 + 1 { - let iter_elem : Int = payload25[index27] - let iter_base = address26 + index27 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) + + match ((value).stdout) { + None => { + mbt_ffi_store8((ptr) + 152, (0)) + + () + } + Some(payload6) => { + mbt_ffi_store8((ptr) + 152, (1)) + __wit_bindgen_lower_t493((ptr) + 156, payload6) + + () + } } - mbt_ffi_store32(ptr + 12, payload25.length()) - mbt_ffi_store32(ptr + 8, address26) - - () - } - MapValue(payload28) => { - mbt_ffi_store8(ptr + 0, 20) - - let address29 = mbt_ffi_malloc(payload28.length() * 8) - for index30 = 0; index30 < payload28.length(); index30 = index30 + 1 { - let iter_elem : @types.MapEntry = payload28[index30] - let iter_base = address29 + index30 * 8 - __wit_bindgen_lower_t59(iter_base + 0, iter_elem) + + match ((value).result) { + None => { + mbt_ffi_store8((ptr) + 192, (0)) + + () + } + Some(payload8) => { + mbt_ffi_store8((ptr) + 192, (1)) + __wit_bindgen_lower_t496((ptr) + 196, payload8) + + () + } } - mbt_ffi_store32(ptr + 12, payload28.length()) - mbt_ffi_store32(ptr + 8, address29) - - () - } - OptionValue(payload31) => { - mbt_ffi_store8(ptr + 0, 21) - - match payload31 { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload33) => { - mbt_ffi_store8(ptr + 8, 1) - mbt_ffi_store32(ptr + 12, payload33) - - () - } + + let address9 = mbt_ffi_malloc(((value).errors).length() * 44); + for index10 = 0; index10 < ((value).errors).length(); index10 = index10 + 1 { + let iter_elem : @common.ErrorCase = ((value).errors)[(index10)] + let iter_base = address9 + (index10 * 44); + __wit_bindgen_lower_t498((iter_base) + 0, iter_elem) + } + mbt_ffi_store32((ptr) + 244, ((value).errors).length()) + mbt_ffi_store32((ptr) + 240, address9) - () - } - ResultValue(payload34) => { - mbt_ffi_store8(ptr + 0, 22) - __wit_bindgen_lower_t60(ptr + 8, payload34) - - () - } - TextValue(payload35) => { - mbt_ffi_store8(ptr + 0, 23) - __wit_bindgen_lower_t61(ptr + 8, payload35) - - () - } - BinaryValue(payload36) => { - mbt_ffi_store8(ptr + 0, 24) - __wit_bindgen_lower_t63(ptr + 8, payload36) - - () - } - PathValue(payload37) => { - mbt_ffi_store8(ptr + 0, 25) - - let ptr38 = mbt_ffi_str2ptr(payload37) - mbt_ffi_store32(ptr + 12, payload37.length()) - mbt_ffi_store32(ptr + 8, ptr38) - - () - } - UrlValue(payload39) => { - mbt_ffi_store8(ptr + 0, 26) - - let ptr40 = mbt_ffi_str2ptr(payload39) - mbt_ffi_store32(ptr + 12, payload39.length()) - mbt_ffi_store32(ptr + 8, ptr40) - - () - } - DatetimeValue(payload41) => { - mbt_ffi_store8(ptr + 0, 27) - __wit_bindgen_lower_t5(ptr + 8, payload41) - - () - } - DurationValue(payload42) => { - mbt_ffi_store8(ptr + 0, 28) - __wit_bindgen_lower_t64(ptr + 8, payload42) - - () - } - QuantityValueNode(payload43) => { - mbt_ffi_store8(ptr + 0, 29) - __wit_bindgen_lower_t38(ptr + 8, payload43) - - () - } - UnionValue(payload44) => { - mbt_ffi_store8(ptr + 0, 30) - __wit_bindgen_lower_t65(ptr + 8, payload44) - - () - } - SecretValue(payload45) => { - mbt_ffi_store8(ptr + 0, 31) - - let @types.Secret(handle) = payload45 - mbt_ffi_store32(ptr + 8, handle) - - () - } - QuotaTokenHandle(payload46) => { - mbt_ffi_store8(ptr + 0, 32) - - let @types.QuotaToken(handle47) = payload46 - mbt_ffi_store32(ptr + 8, handle47) - - () - } - } -} + match ((value).annotations) { + None => { + mbt_ffi_store8((ptr) + 248, (0)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t73(ptr : Int, value : @types.SchemaValueTree) -> Unit { - let address = mbt_ffi_malloc(value.value_nodes.length() * 32) - for index = 0; index < value.value_nodes.length(); index = index + 1 { - let iter_elem : @types.SchemaValueNode = value.value_nodes[index] - let iter_base = address + index * 32 - __wit_bindgen_lower_t71(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 4, value.value_nodes.length()) - mbt_ffi_store32(ptr + 0, address) - mbt_ffi_store32(ptr + 8, value.root) -} + () + } + Some(payload12) => { + mbt_ffi_store8((ptr) + 248, (1)) + __wit_bindgen_lower_t457((ptr) + 249, payload12) -///| -#doc(hidden) -fn __wit_bindgen_lower_t74(ptr : Int, value : @types.TypedSchemaValue) -> Unit { - __wit_bindgen_lower_t56(ptr + 0, value.graph) - __wit_bindgen_lower_t73(ptr + 20, value.value) -} + () + } + } -///| -#doc(hidden) -fn __wit_bindgen_lower_t457( - ptr : Int, - value : @common.CommandAnnotations, -) -> Unit { - mbt_ffi_store8(ptr + 0, if value.read_only { 1 } else { 0 }) - mbt_ffi_store8(ptr + 1, if value.destructive { 1 } else { 0 }) - mbt_ffi_store8(ptr + 2, if value.idempotent { 1 } else { 0 }) - mbt_ffi_store8(ptr + 3, if value.open_world { 1 } else { 0 }) } -///| #doc(hidden) -fn __wit_bindgen_lower_t459(ptr : Int, value : @common.Repetition) -> Unit { - match value { - Repeated => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Delimited(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - mbt_ffi_store32(ptr + 4, payload0.to_int()) - - () - } - Either(payload1) => { - mbt_ffi_store8(ptr + 0, 2) - mbt_ffi_store32(ptr + 4, payload1.to_int()) - - () - } - } -} +fn __wit_bindgen_lower_t507(ptr : Int, value : @common.CommandNode) -> Unit { -///| -#doc(hidden) -fn __wit_bindgen_lower_t460( - ptr : Int, - value : @common.RepeatableListShape, -) -> Unit { - __wit_bindgen_lower_t459(ptr + 0, value.repetition) - mbt_ffi_store32(ptr + 8, value.item_type) -} + let ptr0 = mbt_ffi_str2ptr((value).name) + mbt_ffi_store32((ptr) + 4, (value).name.length()) + mbt_ffi_store32((ptr) + 0, ptr0) -///| -#doc(hidden) -fn __wit_bindgen_lower_t461( - ptr : Int, - value : @common.RepeatableMapShape, -) -> Unit { - __wit_bindgen_lower_t459(ptr + 0, value.repetition) - mbt_ffi_store32(ptr + 8, value.map_type) - mbt_ffi_store8(ptr + 12, value.duplicate_key_policy.ordinal()) -} + let address = mbt_ffi_malloc(((value).aliases).length() * 8); + for index = 0; index < ((value).aliases).length(); index = index + 1 { + let iter_elem : String = ((value).aliases)[(index)] + let iter_base = address + (index * 8); -///| -#doc(hidden) -fn __wit_bindgen_lower_t462(ptr : Int, value : @common.OptionShape) -> Unit { - match value { - Scalar(payload) => { - mbt_ffi_store8(ptr + 0, 0) - mbt_ffi_store32(ptr + 4, payload) - - () - } - OptionalScalar(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - mbt_ffi_store32(ptr + 4, payload0) - - () - } - RepeatableList(payload1) => { - mbt_ffi_store8(ptr + 0, 2) - __wit_bindgen_lower_t460(ptr + 4, payload1) - - () - } - RepeatableMap(payload2) => { - mbt_ffi_store8(ptr + 0, 3) - __wit_bindgen_lower_t461(ptr + 4, payload2) - - () - } - } -} + let ptr1 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) -///| -#doc(hidden) -fn __wit_bindgen_lower_t463(ptr : Int, value : @common.BoolFlagShape) -> Unit { - mbt_ffi_store8(ptr + 0, if value.default { 1 } else { 0 }) - mbt_ffi_store8(ptr + 1, if value.negatable { 1 } else { 0 }) -} + } + mbt_ffi_store32((ptr) + 12, ((value).aliases).length()) + mbt_ffi_store32((ptr) + 8, address) + __wit_bindgen_lower_t478((ptr) + 16, (value).doc) + __wit_bindgen_lower_t492((ptr) + 40, (value).globals) + + let address2 = mbt_ffi_malloc(((value).subcommands).length() * 4); + for index3 = 0; index3 < ((value).subcommands).length(); index3 = index3 + 1 { + let iter_elem : Int = ((value).subcommands)[(index3)] + let iter_base = address2 + (index3 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) -///| -#doc(hidden) -fn __wit_bindgen_lower_t465(ptr : Int, value : @common.FlagShape) -> Unit { - match value { - BoolFlag(payload) => { - mbt_ffi_store8(ptr + 0, 0) - __wit_bindgen_lower_t463(ptr + 4, payload) - - () - } - CountFlag(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - match payload0 { - None => { - mbt_ffi_store8(ptr + 4, 0) - - () - } - Some(payload2) => { - mbt_ffi_store8(ptr + 4, 1) - mbt_ffi_store32(ptr + 8, payload2.reinterpret_as_int()) - - () - } } + mbt_ffi_store32((ptr) + 60, ((value).subcommands).length()) + mbt_ffi_store32((ptr) + 56, address2) - () - } - } -} + match ((value).body) { + None => { + mbt_ffi_store8((ptr) + 64, (0)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t466(ptr : Int, value : @common.ValueIsRef) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.name) - mbt_ffi_store32(ptr + 4, value.name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - __wit_bindgen_lower_t73(ptr + 8, value.value) -} + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 64, (1)) + __wit_bindgen_lower_t504((ptr) + 68, payload4) -///| -#doc(hidden) -fn __wit_bindgen_lower_t467(ptr : Int, value : @common.Ref) -> Unit { - match value { - Present(payload) => { - mbt_ffi_store8(ptr + 0, 0) - - let ptr0 = mbt_ffi_str2ptr(payload) - mbt_ffi_store32(ptr + 8, payload.length()) - mbt_ffi_store32(ptr + 4, ptr0) - - () - } - ValueIs(payload1) => { - mbt_ffi_store8(ptr + 0, 1) - __wit_bindgen_lower_t466(ptr + 4, payload1) - - () - } - } -} + () + } + } -///| -#doc(hidden) -fn __wit_bindgen_lower_t469(ptr : Int, value : @common.RefGroup) -> Unit { - let address = mbt_ffi_malloc(value.refs.length() * 24) - for index = 0; index < value.refs.length(); index = index + 1 { - let iter_elem : @common.Ref = value.refs[index] - let iter_base = address + index * 24 - __wit_bindgen_lower_t467(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 4, value.refs.length()) - mbt_ffi_store32(ptr + 0, address) } -///| #doc(hidden) -fn __wit_bindgen_lower_t471(ptr : Int, value : @common.ImpliesC) -> Unit { - mbt_ffi_store8(ptr + 0, value.lhs_quant.ordinal()) - - let address = mbt_ffi_malloc(value.lhs.length() * 24) - for index = 0; index < value.lhs.length(); index = index + 1 { - let iter_elem : @common.Ref = value.lhs[index] - let iter_base = address + index * 24 - __wit_bindgen_lower_t467(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 8, value.lhs.length()) - mbt_ffi_store32(ptr + 4, address) - mbt_ffi_store8(ptr + 12, value.rhs_quant.ordinal()) - - let address0 = mbt_ffi_malloc(value.rhs.length() * 24) - for index1 = 0; index1 < value.rhs.length(); index1 = index1 + 1 { - let iter_elem : @common.Ref = value.rhs[index1] - let iter_base = address0 + index1 * 24 - __wit_bindgen_lower_t467(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 20, value.rhs.length()) - mbt_ffi_store32(ptr + 16, address0) -} +fn __wit_bindgen_lower_t509(ptr : Int, value : @common.CommandTree) -> Unit { -///| -#doc(hidden) -fn __wit_bindgen_lower_t472(ptr : Int, value : @common.ForbidsC) -> Unit { - mbt_ffi_store8(ptr + 0, value.lhs_quant.ordinal()) - - let address = mbt_ffi_malloc(value.lhs.length() * 24) - for index = 0; index < value.lhs.length(); index = index + 1 { - let iter_elem : @common.Ref = value.lhs[index] - let iter_base = address + index * 24 - __wit_bindgen_lower_t467(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 8, value.lhs.length()) - mbt_ffi_store32(ptr + 4, address) - - let address0 = mbt_ffi_malloc(value.rhs.length() * 24) - for index1 = 0; index1 < value.rhs.length(); index1 = index1 + 1 { - let iter_elem : @common.Ref = value.rhs[index1] - let iter_base = address0 + index1 * 24 - __wit_bindgen_lower_t467(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 16, value.rhs.length()) - mbt_ffi_store32(ptr + 12, address0) -} + let address = mbt_ffi_malloc(((value).nodes).length() * 324); + for index = 0; index < ((value).nodes).length(); index = index + 1 { + let iter_elem : @common.CommandNode = ((value).nodes)[(index)] + let iter_base = address + (index * 324); + __wit_bindgen_lower_t507((iter_base) + 0, iter_elem) -///| -#doc(hidden) -fn __wit_bindgen_lower_t474(ptr : Int, value : @common.Constraint) -> Unit { - match value { - RequiresAll(payload) => { - mbt_ffi_store8(ptr + 0, 0) - - let address = mbt_ffi_malloc(payload.length() * 24) - for index = 0; index < payload.length(); index = index + 1 { - let iter_elem : @common.Ref = payload[index] - let iter_base = address + index * 24 - __wit_bindgen_lower_t467(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 8, payload.length()) - mbt_ffi_store32(ptr + 4, address) - - () - } - AllOrNone(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - let address1 = mbt_ffi_malloc(payload0.length() * 24) - for index2 = 0; index2 < payload0.length(); index2 = index2 + 1 { - let iter_elem : @common.Ref = payload0[index2] - let iter_base = address1 + index2 * 24 - __wit_bindgen_lower_t467(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 8, payload0.length()) - mbt_ffi_store32(ptr + 4, address1) - - () - } - RequiresAny(payload3) => { - mbt_ffi_store8(ptr + 0, 2) - - let address4 = mbt_ffi_malloc(payload3.length() * 24) - for index5 = 0; index5 < payload3.length(); index5 = index5 + 1 { - let iter_elem : @common.Ref = payload3[index5] - let iter_base = address4 + index5 * 24 - __wit_bindgen_lower_t467(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 8, payload3.length()) - mbt_ffi_store32(ptr + 4, address4) - - () - } - MutexGroups(payload6) => { - mbt_ffi_store8(ptr + 0, 3) - - let address7 = mbt_ffi_malloc(payload6.length() * 8) - for index8 = 0; index8 < payload6.length(); index8 = index8 + 1 { - let iter_elem : @common.RefGroup = payload6[index8] - let iter_base = address7 + index8 * 8 - __wit_bindgen_lower_t469(iter_base + 0, iter_elem) } - mbt_ffi_store32(ptr + 8, payload6.length()) - mbt_ffi_store32(ptr + 4, address7) - - () - } - Implies(payload9) => { - mbt_ffi_store8(ptr + 0, 4) - __wit_bindgen_lower_t471(ptr + 4, payload9) - - () - } - Forbids(payload10) => { - mbt_ffi_store8(ptr + 0, 5) - __wit_bindgen_lower_t472(ptr + 4, payload10) - - () - } - } + mbt_ffi_store32((ptr) + 4, ((value).nodes).length()) + mbt_ffi_store32((ptr) + 0, address) + } -///| #doc(hidden) -fn __wit_bindgen_lower_t476(ptr : Int, value : @common.Example) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.title) - mbt_ffi_store32(ptr + 4, value.title.length()) - mbt_ffi_store32(ptr + 0, ptr0) +fn __wit_bindgen_lower_t510(ptr : Int, value : @common.Tool) -> Unit { - let ptr1 = mbt_ffi_str2ptr(value.body) - mbt_ffi_store32(ptr + 12, value.body.length()) - mbt_ffi_store32(ptr + 8, ptr1) -} + let ptr0 = mbt_ffi_str2ptr((value).version) + mbt_ffi_store32((ptr) + 4, (value).version.length()) + mbt_ffi_store32((ptr) + 0, ptr0) + __wit_bindgen_lower_t509((ptr) + 8, (value).commands) + __wit_bindgen_lower_t58((ptr) + 16, (value).schema) -///| -#doc(hidden) -fn __wit_bindgen_lower_t478(ptr : Int, value : @common.Doc) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.summary) - mbt_ffi_store32(ptr + 4, value.summary.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - let ptr1 = mbt_ffi_str2ptr(value.description) - mbt_ffi_store32(ptr + 12, value.description.length()) - mbt_ffi_store32(ptr + 8, ptr1) - - let address = mbt_ffi_malloc(value.examples.length() * 16) - for index = 0; index < value.examples.length(); index = index + 1 { - let iter_elem : @common.Example = value.examples[index] - let iter_base = address + index * 16 - __wit_bindgen_lower_t476(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 20, value.examples.length()) - mbt_ffi_store32(ptr + 16, address) } -///| #doc(hidden) -fn __wit_bindgen_lower_t481(ptr : Int, value : @common.Positional) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.name) - mbt_ffi_store32(ptr + 4, value.name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - __wit_bindgen_lower_t478(ptr + 8, value.doc) - - match value.value_name { - None => { - mbt_ffi_store8(ptr + 32, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 32, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 40, payload1.length()) - mbt_ffi_store32(ptr + 36, ptr2) - - () - } - } - mbt_ffi_store32(ptr + 44, value.type_) - - match value.default { - None => { - mbt_ffi_store8(ptr + 48, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 48, 1) - __wit_bindgen_lower_t73(ptr + 52, payload4) - - () - } - } - mbt_ffi_store8(ptr + 64, if value.required { 1 } else { 0 }) - mbt_ffi_store8(ptr + 65, if value.accepts_stdio { 1 } else { 0 }) -} +fn __wit_bindgen_lower_t511(ptr : Int, value : @common.ToolError) -> Unit { -///| -#doc(hidden) -fn __wit_bindgen_lower_t482(ptr : Int, value : @common.TailPositional) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.name) - mbt_ffi_store32(ptr + 4, value.name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - __wit_bindgen_lower_t478(ptr + 8, value.doc) - - match value.value_name { - None => { - mbt_ffi_store8(ptr + 32, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 32, 1) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(ptr + 40, payload1.length()) - mbt_ffi_store32(ptr + 36, ptr2) - - () - } - } - mbt_ffi_store32(ptr + 44, value.item_type) - mbt_ffi_store32(ptr + 48, value.min.reinterpret_as_int()) - - match value.max { - None => { - mbt_ffi_store8(ptr + 52, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 52, 1) - mbt_ffi_store32(ptr + 56, payload4.reinterpret_as_int()) - - () - } - } - - match value.separator { - None => { - mbt_ffi_store8(ptr + 60, 0) - - () - } - Some(payload6) => { - mbt_ffi_store8(ptr + 60, 1) - - let ptr7 = mbt_ffi_str2ptr(payload6) - mbt_ffi_store32(ptr + 68, payload6.length()) - mbt_ffi_store32(ptr + 64, ptr7) - - () - } - } - mbt_ffi_store8(ptr + 72, if value.verbatim { 1 } else { 0 }) - mbt_ffi_store8(ptr + 73, if value.accepts_stdio { 1 } else { 0 }) -} + match value { + InvalidToolName(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t485(ptr : Int, value : @common.Positionals) -> Unit { - let address = mbt_ffi_malloc(value.fixed.length() * 68) - for index = 0; index < value.fixed.length(); index = index + 1 { - let iter_elem : @common.Positional = value.fixed[index] - let iter_base = address + index * 68 - __wit_bindgen_lower_t481(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 4, value.fixed.length()) - mbt_ffi_store32(ptr + 0, address) - - match value.tail { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(ptr + 8, 1) - __wit_bindgen_lower_t482(ptr + 12, payload0) - - () - } - } -} + let ptr0 = mbt_ffi_str2ptr(payload) + mbt_ffi_store32((ptr) + 8, payload.length()) + mbt_ffi_store32((ptr) + 4, ptr0) -///| -#doc(hidden) -fn __wit_bindgen_lower_t488(ptr : Int, value : @common.OptionSpec) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.long) - mbt_ffi_store32(ptr + 4, value.long.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - match value.short { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) - mbt_ffi_store32(ptr + 12, payload1.to_int()) - - () - } - } - - let address = mbt_ffi_malloc(value.aliases.length() * 8) - for index = 0; index < value.aliases.length(); index = index + 1 { - let iter_elem : String = value.aliases[index] - let iter_base = address + index * 8 - - let ptr2 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr2) - } - mbt_ffi_store32(ptr + 20, value.aliases.length()) - mbt_ffi_store32(ptr + 16, address) - __wit_bindgen_lower_t478(ptr + 24, value.doc) - - match value.value_name { - None => { - mbt_ffi_store8(ptr + 48, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 48, 1) - - let ptr5 = mbt_ffi_str2ptr(payload4) - mbt_ffi_store32(ptr + 56, payload4.length()) - mbt_ffi_store32(ptr + 52, ptr5) - - () - } - } - __wit_bindgen_lower_t462(ptr + 60, value.shape) - - match value.default { - None => { - mbt_ffi_store8(ptr + 80, 0) - - () - } - Some(payload7) => { - mbt_ffi_store8(ptr + 80, 1) - __wit_bindgen_lower_t73(ptr + 84, payload7) - - () - } - } - mbt_ffi_store8(ptr + 96, if value.required { 1 } else { 0 }) - - match value.env_var { - None => { - mbt_ffi_store8(ptr + 100, 0) - - () - } - Some(payload9) => { - mbt_ffi_store8(ptr + 100, 1) - - let ptr10 = mbt_ffi_str2ptr(payload9) - mbt_ffi_store32(ptr + 108, payload9.length()) - mbt_ffi_store32(ptr + 104, ptr10) - - () - } - } -} + () + } + InvalidCommandPath(payload1) => { + mbt_ffi_store8((ptr) + 0, (1)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t489(ptr : Int, value : @common.FlagSpec) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.long) - mbt_ffi_store32(ptr + 4, value.long.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - match value.short { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) - mbt_ffi_store32(ptr + 12, payload1.to_int()) - - () - } - } - - let address = mbt_ffi_malloc(value.aliases.length() * 8) - for index = 0; index < value.aliases.length(); index = index + 1 { - let iter_elem : String = value.aliases[index] - let iter_base = address + index * 8 - - let ptr2 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr2) - } - mbt_ffi_store32(ptr + 20, value.aliases.length()) - mbt_ffi_store32(ptr + 16, address) - __wit_bindgen_lower_t478(ptr + 24, value.doc) - __wit_bindgen_lower_t465(ptr + 48, value.shape) - - match value.env_var { - None => { - mbt_ffi_store8(ptr + 60, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 60, 1) - - let ptr5 = mbt_ffi_str2ptr(payload4) - mbt_ffi_store32(ptr + 68, payload4.length()) - mbt_ffi_store32(ptr + 64, ptr5) - - () - } - } -} + let address = mbt_ffi_malloc((payload1).length() * 8); + for index = 0; index < (payload1).length(); index = index + 1 { + let iter_elem : String = (payload1)[(index)] + let iter_base = address + (index * 8); -///| -#doc(hidden) -fn __wit_bindgen_lower_t492(ptr : Int, value : @common.Globals) -> Unit { - let address = mbt_ffi_malloc(value.options.length() * 112) - for index = 0; index < value.options.length(); index = index + 1 { - let iter_elem : @common.OptionSpec = value.options[index] - let iter_base = address + index * 112 - __wit_bindgen_lower_t488(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 4, value.options.length()) - mbt_ffi_store32(ptr + 0, address) - - let address0 = mbt_ffi_malloc(value.flags.length() * 72) - for index1 = 0; index1 < value.flags.length(); index1 = index1 + 1 { - let iter_elem : @common.FlagSpec = value.flags[index1] - let iter_base = address0 + index1 * 72 - __wit_bindgen_lower_t489(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 12, value.flags.length()) - mbt_ffi_store32(ptr + 8, address0) -} + let ptr2 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr2) -///| -#doc(hidden) -fn __wit_bindgen_lower_t493(ptr : Int, value : @common.StreamSpec) -> Unit { - __wit_bindgen_lower_t478(ptr + 0, value.doc) - - let address = mbt_ffi_malloc(value.mime.length() * 8) - for index = 0; index < value.mime.length(); index = index + 1 { - let iter_elem : String = value.mime[index] - let iter_base = address + index * 8 - - let ptr0 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr0) - } - mbt_ffi_store32(ptr + 28, value.mime.length()) - mbt_ffi_store32(ptr + 24, address) - mbt_ffi_store8(ptr + 32, if value.required { 1 } else { 0 }) -} + } + mbt_ffi_store32((ptr) + 8, (payload1).length()) + mbt_ffi_store32((ptr) + 4, address) -///| -#doc(hidden) -fn __wit_bindgen_lower_t494(ptr : Int, value : @common.Formatter) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.name) - mbt_ffi_store32(ptr + 4, value.name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - __wit_bindgen_lower_t478(ptr + 8, value.doc) -} + () + } + InvalidInput(payload3) => { + mbt_ffi_store8((ptr) + 0, (2)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t496(ptr : Int, value : @common.ResultSpec) -> Unit { - mbt_ffi_store32(ptr + 0, value.type_) - __wit_bindgen_lower_t478(ptr + 4, value.doc) - - let address = mbt_ffi_malloc(value.formatters.length() * 32) - for index = 0; index < value.formatters.length(); index = index + 1 { - let iter_elem : @common.Formatter = value.formatters[index] - let iter_base = address + index * 32 - __wit_bindgen_lower_t494(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 32, value.formatters.length()) - mbt_ffi_store32(ptr + 28, address) - - let ptr0 = mbt_ffi_str2ptr(value.default_formatter) - mbt_ffi_store32(ptr + 40, value.default_formatter.length()) - mbt_ffi_store32(ptr + 36, ptr0) -} + let ptr4 = mbt_ffi_str2ptr(payload3) + mbt_ffi_store32((ptr) + 8, payload3.length()) + mbt_ffi_store32((ptr) + 4, ptr4) -///| -#doc(hidden) -fn __wit_bindgen_lower_t498(ptr : Int, value : @common.ErrorCase) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.name) - mbt_ffi_store32(ptr + 4, value.name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - __wit_bindgen_lower_t478(ptr + 8, value.doc) - mbt_ffi_store8(ptr + 32, value.kind.ordinal()) - mbt_ffi_store8(ptr + 33, value.exit_code.to_int()) - - match value.payload { - None => { - mbt_ffi_store8(ptr + 36, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 36, 1) - mbt_ffi_store32(ptr + 40, payload1) - - () - } - } -} + () + } + ConstraintViolation(payload5) => { + mbt_ffi_store8((ptr) + 0, (3)) -///| -#doc(hidden) -fn __wit_bindgen_lower_t504(ptr : Int, value : @common.CommandBody) -> Unit { - __wit_bindgen_lower_t485(ptr + 0, value.positionals) - - let address = mbt_ffi_malloc(value.options.length() * 112) - for index = 0; index < value.options.length(); index = index + 1 { - let iter_elem : @common.OptionSpec = value.options[index] - let iter_base = address + index * 112 - __wit_bindgen_lower_t488(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 92, value.options.length()) - mbt_ffi_store32(ptr + 88, address) - - let address0 = mbt_ffi_malloc(value.flags.length() * 72) - for index1 = 0; index1 < value.flags.length(); index1 = index1 + 1 { - let iter_elem : @common.FlagSpec = value.flags[index1] - let iter_base = address0 + index1 * 72 - __wit_bindgen_lower_t489(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 100, value.flags.length()) - mbt_ffi_store32(ptr + 96, address0) - - let address2 = mbt_ffi_malloc(value.constraints.length() * 28) - for index3 = 0; index3 < value.constraints.length(); index3 = index3 + 1 { - let iter_elem : @common.Constraint = value.constraints[index3] - let iter_base = address2 + index3 * 28 - __wit_bindgen_lower_t474(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 108, value.constraints.length()) - mbt_ffi_store32(ptr + 104, address2) - - match value.stdin { - None => { - mbt_ffi_store8(ptr + 112, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 112, 1) - __wit_bindgen_lower_t493(ptr + 116, payload4) - - () - } - } - - match value.stdout { - None => { - mbt_ffi_store8(ptr + 152, 0) - - () - } - Some(payload6) => { - mbt_ffi_store8(ptr + 152, 1) - __wit_bindgen_lower_t493(ptr + 156, payload6) - - () - } - } - - match value.result { - None => { - mbt_ffi_store8(ptr + 192, 0) - - () - } - Some(payload8) => { - mbt_ffi_store8(ptr + 192, 1) - __wit_bindgen_lower_t496(ptr + 196, payload8) - - () - } - } - - let address9 = mbt_ffi_malloc(value.errors.length() * 44) - for index10 = 0; index10 < value.errors.length(); index10 = index10 + 1 { - let iter_elem : @common.ErrorCase = value.errors[index10] - let iter_base = address9 + index10 * 44 - __wit_bindgen_lower_t498(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 244, value.errors.length()) - mbt_ffi_store32(ptr + 240, address9) - - match value.annotations { - None => { - mbt_ffi_store8(ptr + 248, 0) - - () - } - Some(payload12) => { - mbt_ffi_store8(ptr + 248, 1) - __wit_bindgen_lower_t457(ptr + 249, payload12) - - () - } - } -} + let ptr6 = mbt_ffi_str2ptr(payload5) + mbt_ffi_store32((ptr) + 8, payload5.length()) + mbt_ffi_store32((ptr) + 4, ptr6) -///| -#doc(hidden) -fn __wit_bindgen_lower_t507(ptr : Int, value : @common.CommandNode) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.name) - mbt_ffi_store32(ptr + 4, value.name.length()) - mbt_ffi_store32(ptr + 0, ptr0) - - let address = mbt_ffi_malloc(value.aliases.length() * 8) - for index = 0; index < value.aliases.length(); index = index + 1 { - let iter_elem : String = value.aliases[index] - let iter_base = address + index * 8 - - let ptr1 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr1) - } - mbt_ffi_store32(ptr + 12, value.aliases.length()) - mbt_ffi_store32(ptr + 8, address) - __wit_bindgen_lower_t478(ptr + 16, value.doc) - __wit_bindgen_lower_t492(ptr + 40, value.globals) - - let address2 = mbt_ffi_malloc(value.subcommands.length() * 4) - for index3 = 0; index3 < value.subcommands.length(); index3 = index3 + 1 { - let iter_elem : Int = value.subcommands[index3] - let iter_base = address2 + index3 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 60, value.subcommands.length()) - mbt_ffi_store32(ptr + 56, address2) - - match value.body { - None => { - mbt_ffi_store8(ptr + 64, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 64, 1) - __wit_bindgen_lower_t504(ptr + 68, payload4) - - () - } - } -} + () + } + InvalidResult(payload7) => { + mbt_ffi_store8((ptr) + 0, (4)) + + let ptr8 = mbt_ffi_str2ptr(payload7) + mbt_ffi_store32((ptr) + 8, payload7.length()) + mbt_ffi_store32((ptr) + 4, ptr8) + + () + } + CustomError(payload9) => { + mbt_ffi_store8((ptr) + 0, (5)) + __wit_bindgen_lower_t77((ptr) + 4, payload9) + + () + } + } -///| -#doc(hidden) -fn __wit_bindgen_lower_t509(ptr : Int, value : @common.CommandTree) -> Unit { - let address = mbt_ffi_malloc(value.nodes.length() * 324) - for index = 0; index < value.nodes.length(); index = index + 1 { - let iter_elem : @common.CommandNode = value.nodes[index] - let iter_base = address + index * 324 - __wit_bindgen_lower_t507(iter_base + 0, iter_elem) - } - mbt_ffi_store32(ptr + 4, value.nodes.length()) - mbt_ffi_store32(ptr + 0, address) } ///| -#doc(hidden) -fn __wit_bindgen_lower_t510(ptr : Int, value : @common.Tool) -> Unit { - let ptr0 = mbt_ffi_str2ptr(value.version) - mbt_ffi_store32(ptr + 4, value.version.length()) - mbt_ffi_store32(ptr + 0, ptr0) - __wit_bindgen_lower_t509(ptr + 8, value.commands) - __wit_bindgen_lower_t56(ptr + 16, value.schema) -} +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -#doc(hidden) -fn __wit_bindgen_lower_t511(ptr : Int, value : @common.ToolError) -> Unit { - match value { - InvalidToolName(payload) => { - mbt_ffi_store8(ptr + 0, 0) - - let ptr0 = mbt_ffi_str2ptr(payload) - mbt_ffi_store32(ptr + 8, payload.length()) - mbt_ffi_store32(ptr + 4, ptr0) - - () - } - InvalidCommandPath(payload1) => { - mbt_ffi_store8(ptr + 0, 1) - - let address = mbt_ffi_malloc(payload1.length() * 8) - for index = 0; index < payload1.length(); index = index + 1 { - let iter_elem : String = payload1[index] - let iter_base = address + index * 8 - - let ptr2 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr2) - } - mbt_ffi_store32(ptr + 8, payload1.length()) - mbt_ffi_store32(ptr + 4, address) - - () - } - InvalidInput(payload3) => { - mbt_ffi_store8(ptr + 0, 2) - - let ptr4 = mbt_ffi_str2ptr(payload3) - mbt_ffi_store32(ptr + 8, payload3.length()) - mbt_ffi_store32(ptr + 4, ptr4) - - () - } - ConstraintViolation(payload5) => { - mbt_ffi_store8(ptr + 0, 3) - - let ptr6 = mbt_ffi_str2ptr(payload5) - mbt_ffi_store32(ptr + 8, payload5.length()) - mbt_ffi_store32(ptr + 4, ptr6) - - () - } - InvalidResult(payload7) => { - mbt_ffi_store8(ptr + 0, 4) - - let ptr8 = mbt_ffi_str2ptr(payload7) - mbt_ffi_store32(ptr + 8, payload7.length()) - mbt_ffi_store32(ptr + 4, ptr8) - - () - } - CustomError(payload9) => { - mbt_ffi_store8(ptr + 0, 5) - __wit_bindgen_lower_t74(ptr + 4, payload9) - - () - } - } -} +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -#owned(bytes) -extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_s) ///| extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend8_s) +#|(func (param i32) (result i32) local.get 0 i32.extend8_s) ///| -extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_s) +extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| -extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = - #|(func (param i32) (result f64) local.get 0 f64.load) +extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = +#|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = +#|(func (param i32) (result f64) local.get 0 f64.load) ///| extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = - #|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) +#|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = - #|(func (param i32) (result f32) local.get 0 f32.load) +extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_u) ///| -extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend16_s) +extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = +#|(func (param i32) (result f32) local.get 0 f32.load) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = - #|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) +#owned(bytes) +extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend16_s) ///| extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_s) +#|(func (param i32) (result i32) local.get 0 i32.load16_s) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) - -///| -extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) -///| -extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) diff --git a/sdks/moonbit/golem_sdk/gen/interface/golem/tool/guest/top.mbt b/sdks/moonbit/golem_sdk/gen/interface/golem/tool/guest/top.mbt index 89c8eee98e..e25324af8a 100644 --- a/sdks/moonbit/golem_sdk/gen/interface/golem/tool/guest/top.mbt +++ b/sdks/moonbit/golem_sdk/gen/interface/golem/tool/guest/top.mbt @@ -1,19 +1,11 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Enumerate the tools this component exposes. The returned metadata /// is complete (full command tree and schema graph). -declare pub fn discover_tools() -> Result[ - Array[@common.Tool], - @common.ToolError, -] - +declare pub fn discover_tools() -> Result[Array[@common.Tool], @common.ToolError] ///| /// Look up a single tool by name. -declare pub fn get_tool( - name : String, -) -> Result[@common.Tool, @common.ToolError] - +declare pub fn get_tool(name : String) -> Result[@common.Tool, @common.ToolError] ///| /// Invoke a command of a tool. /// @@ -35,11 +27,5 @@ declare pub fn get_tool( /// `principal` carries the caller's authenticated identity for /// authorization and audit, identical in semantics to the parameter /// of the same name in `golem:agent/guest.invoke`. -declare pub async fn invoke( - tool_name : String, - command_path : Array[String], - input : @types.TypedSchemaValue, - stdin : @async-core.Stream[Byte]?, - principal : @common0.Principal, - background_group : @async-core.TaskGroup[Unit], -) -> Result[@common.InvocationResult, @common.ToolError] +declare pub async fn invoke(tool_name : String, command_path : Array[String], input : @types.TypedSchemaValue, stdin : @async-core.Stream[Byte]?, principal : @common0.Principal, background_group : @async-core.TaskGroup[Unit]) -> Result[@common.InvocationResult, @common.ToolError] + diff --git a/sdks/moonbit/golem_sdk/interface/golem/agent/common/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/agent/common/ffi.mbt index 01e5518ad5..821232033b 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/agent/common/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/agent/common/ffi.mbt @@ -1 +1,2 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! + diff --git a/sdks/moonbit/golem_sdk/interface/golem/agent/common/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/agent/common/top.mbt index a892c0c2e7..1d48e9edbc 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/agent/common/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/agent/common/top.mbt @@ -1,284 +1,204 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| pub(all) enum AgentMode { - DURABLE - EPHEMERAL + DURABLE; EPHEMERAL } derive(Show, Eq) -///| pub fn AgentMode::ordinal(self : AgentMode) -> Int { - match self { - DURABLE => 0 - EPHEMERAL => 1 - } + match self { + DURABLE => 0 + EPHEMERAL => 1 + } } -///| pub fn AgentMode::from(self : Int) -> AgentMode { - match self { - 0 => DURABLE - 1 => EPHEMERAL - _ => panic() - } + match self { + 0 => DURABLE + 1 => EPHEMERAL + _ => panic() + } } - ///| pub(all) enum AutoInjectedKind { - PRINCIPAL + PRINCIPAL } derive(Show, Eq) -///| pub fn AutoInjectedKind::ordinal(self : AutoInjectedKind) -> Int { - match self { - PRINCIPAL => 0 - } + match self { + PRINCIPAL => 0 + } } -///| pub fn AutoInjectedKind::from(self : Int) -> AutoInjectedKind { - match self { - 0 => PRINCIPAL - _ => panic() - } + match self { + 0 => PRINCIPAL + _ => panic() + } } - ///| pub(all) enum FieldSource { - UserSupplied - AutoInjected(AutoInjectedKind) + UserSupplied + AutoInjected(AutoInjectedKind) } derive(Show, Eq) - ///| pub(all) struct NamedField { - name : String - source : FieldSource - schema : Int - metadata : @types.MetadataEnvelope + name : String; source : FieldSource; schema : Int; metadata : @types.MetadataEnvelope } derive(Show, Eq) - ///| /// Ordered, named input parameters with per-field source annotation. pub(all) enum InputSchema { - Parameters(Array[NamedField]) + Parameters(Array[NamedField]) } derive(Show, Eq) - ///| /// Output is either unit (no value) or a single value of the given type. pub(all) enum OutputSchema { - Unit - Single(Int) + Unit + Single(Int) } derive(Show, Eq) - ///| pub(all) enum CachePolicy { - NoCache - UntilWrite - Ttl(UInt64) + NoCache + UntilWrite + Ttl(UInt64) } derive(Show, Eq) - ///| pub(all) struct ReadOnlyConfig { - cache_policy : CachePolicy - uses_principal : Bool + cache_policy : CachePolicy; uses_principal : Bool } derive(Show, Eq) - ///| pub(all) struct CorsOptions { - allowed_patterns : Array[String] + allowed_patterns : Array[String] } derive(Show, Eq) - ///| pub(all) enum HttpMethod { - Get - Head - Post - Put - Delete - Connect - Options - Trace - Patch - Custom(String) + Get + Head + Post + Put + Delete + Connect + Options + Trace + Patch + Custom(String) } derive(Show, Eq) - ///| pub(all) enum SystemVariable { - AGENT_TYPE - AGENT_VERSION + AGENT_TYPE; AGENT_VERSION } derive(Show, Eq) -///| pub fn SystemVariable::ordinal(self : SystemVariable) -> Int { - match self { - AGENT_TYPE => 0 - AGENT_VERSION => 1 - } + match self { + AGENT_TYPE => 0 + AGENT_VERSION => 1 + } } -///| pub fn SystemVariable::from(self : Int) -> SystemVariable { - match self { - 0 => AGENT_TYPE - 1 => AGENT_VERSION - _ => panic() - } + match self { + 0 => AGENT_TYPE + 1 => AGENT_VERSION + _ => panic() + } } - ///| pub(all) struct PathVariable { - variable_name : String + variable_name : String } derive(Show, Eq) - ///| pub(all) enum PathSegment { - Literal(String) - SystemVariable(SystemVariable) - PathVariable(PathVariable) - RemainingPathVariable(PathVariable) + Literal(String) + SystemVariable(SystemVariable) + PathVariable(PathVariable) + RemainingPathVariable(PathVariable) } derive(Show, Eq) - ///| pub(all) struct HeaderVariable { - header_name : String - variable_name : String + header_name : String; variable_name : String } derive(Show, Eq) - ///| pub(all) struct QueryVariable { - query_param_name : String - variable_name : String + query_param_name : String; variable_name : String } derive(Show, Eq) - ///| pub(all) struct AuthDetails { - required : Bool + required : Bool } derive(Show, Eq) - ///| pub(all) struct HttpMountDetails { - path_prefix : Array[PathSegment] - auth_details : AuthDetails? - phantom_agent : Bool - cors_options : CorsOptions - webhook_suffix : Array[PathSegment] + path_prefix : Array[PathSegment]; auth_details : AuthDetails?; phantom_agent : Bool; cors_options : CorsOptions; webhook_suffix : Array[PathSegment] } derive(Show, Eq) - ///| pub(all) struct HttpEndpointDetails { - http_method : HttpMethod - path_suffix : Array[PathSegment] - header_vars : Array[HeaderVariable] - query_vars : Array[QueryVariable] - auth_details : AuthDetails? - cors_options : CorsOptions + http_method : HttpMethod; path_suffix : Array[PathSegment]; header_vars : Array[HeaderVariable]; query_vars : Array[QueryVariable]; auth_details : AuthDetails?; cors_options : CorsOptions } derive(Show, Eq) - ///| pub(all) struct AgentMethod { - name : String - description : String - http_endpoint : Array[HttpEndpointDetails] - prompt_hint : String? - input_schema : InputSchema - output_schema : OutputSchema - read_only : ReadOnlyConfig? + name : String; description : String; http_endpoint : Array[HttpEndpointDetails]; prompt_hint : String?; input_schema : InputSchema; output_schema : OutputSchema; read_only : ReadOnlyConfig? } derive(Show, Eq) - ///| pub(all) struct OidcPrincipal { - sub : String - issuer : String - email : String? - name : String? - email_verified : Bool? - given_name : String? - family_name : String? - picture : String? - preferred_username : String? - claims : String + sub : String; issuer : String; email : String?; name : String?; email_verified : Bool?; given_name : String?; family_name : String?; picture : String?; preferred_username : String?; claims : String } derive(Show, Eq) - ///| pub(all) struct AgentPrincipal { - agent_id : @types.AgentId + agent_id : @types.AgentId } derive(Show, Eq) - ///| pub(all) struct GolemUserPrincipal { - account_id : @types.AccountId + account_id : @types.AccountId } derive(Show, Eq) - ///| pub(all) enum Principal { - Oidc(OidcPrincipal) - Agent(AgentPrincipal) - GolemUser(GolemUserPrincipal) - Anonymous + Oidc(OidcPrincipal) + Agent(AgentPrincipal) + GolemUser(GolemUserPrincipal) + Anonymous } derive(Show, Eq) - ///| pub(all) struct AgentConstructor { - name : String? - description : String - prompt_hint : String? - input_schema : InputSchema + name : String?; description : String; prompt_hint : String?; input_schema : InputSchema } derive(Show, Eq) - ///| /// Dependent agent type. All schema roots inside it resolve against its own /// `schema`, not against the parent agent-type's graph. pub(all) struct AgentDependency { - type_name : String - description : String? - schema : @types.SchemaGraph - constructor_ : AgentConstructor - methods : Array[AgentMethod] + type_name : String; description : String?; schema : @types.SchemaGraph; constructor_ : AgentConstructor; methods : Array[AgentMethod] } derive(Show, Eq) - ///| pub(all) enum SnapshottingConfig { - Default - Periodic(UInt64) - EveryNInvocation(UInt) + Default + Periodic(UInt64) + EveryNInvocation(UInt) } derive(Show, Eq) - ///| pub(all) enum Snapshotting { - Disabled - Enabled(SnapshottingConfig) + Disabled + Enabled(SnapshottingConfig) } derive(Show, Eq) - ///| pub(all) enum AgentConfigSource { - LOCAL - SECRET + LOCAL; SECRET } derive(Show, Eq) -///| pub fn AgentConfigSource::ordinal(self : AgentConfigSource) -> Int { - match self { - LOCAL => 0 - SECRET => 1 - } + match self { + LOCAL => 0 + SECRET => 1 + } } -///| pub fn AgentConfigSource::from(self : Int) -> AgentConfigSource { - match self { - 0 => LOCAL - 1 => SECRET - _ => panic() - } + match self { + 0 => LOCAL + 1 => SECRET + _ => panic() + } } - ///| pub(all) struct AgentConfigDeclaration { - source : AgentConfigSource - path : Array[String] - value_type : Int + source : AgentConfigSource; path : Array[String]; value_type : Int } derive(Show, Eq) - ///| /// Full agent type declaration. /// @@ -287,38 +207,24 @@ pub(all) struct AgentConfigDeclaration { /// `schema.root` field is a structurally-required placeholder and is not the /// semantic root of the agent type. pub(all) struct AgentType { - type_name : String - description : String - source_language : String - schema : @types.SchemaGraph - constructor_ : AgentConstructor - methods : Array[AgentMethod] - dependencies : Array[AgentDependency] - mode : AgentMode - http_mount : HttpMountDetails? - snapshotting : Snapshotting - config : Array[AgentConfigDeclaration] + type_name : String; description : String; source_language : String; schema : @types.SchemaGraph; constructor_ : AgentConstructor; methods : Array[AgentMethod]; dependencies : Array[AgentDependency]; mode : AgentMode; http_mount : HttpMountDetails?; snapshotting : Snapshotting; config : Array[AgentConfigDeclaration] } derive(Show, Eq) - ///| /// Associates an agent type with a component that implements it pub(all) struct RegisteredAgentType { - agent_type : AgentType - implemented_by : @types.ComponentId + agent_type : AgentType; implemented_by : @types.ComponentId } derive(Show, Eq) - ///| pub(all) struct TypedAgentConfigValue { - path : Array[String] - value : @types.TypedSchemaValue + path : Array[String]; value : @types.TypedSchemaValue } derive(Show, Eq) - ///| /// Agent-level failures pub(all) suberror AgentError { - InvalidInput(String) - InvalidMethod(String) - InvalidType(String) - InvalidAgentId(String) - CustomError(@types.TypedSchemaValue) + InvalidInput(String) + InvalidMethod(String) + InvalidType(String) + InvalidAgentId(String) + CustomError(@types.TypedSchemaValue) } derive(Show, Eq) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/agent/host/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/agent/host/ffi.mbt index 50b2bf7600..9b050e1303 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/agent/host/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/agent/host/ffi.mbt @@ -1,235 +1,137 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropWasmRpc(resource : Int) = "golem:agent/host@2.0.0" "[resource-drop]wasm-rpc" -///| fn wasmImportResourceDropFutureInvokeResult(resource : Int) = "golem:agent/host@2.0.0" "[resource-drop]future-invoke-result" -///| fn wasmImportResourceDropCancellationToken(resource : Int) = "golem:agent/host@2.0.0" "[resource-drop]cancellation-token" -///| -fn wasmImportGetAllAgentTypes(p0 : Int) = "golem:agent/host@2.0.0" "get-all-agent-types" - -///| -fn wasmImportGetAgentType(p0 : Int, p1 : Int, p2 : Int) = "golem:agent/host@2.0.0" "get-agent-type" - -///| -fn wasmImportMakeAgentId( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int64, - p7 : Int64, - p8 : Int, -) = "golem:agent/host@2.0.0" "make-agent-id" - -///| -fn wasmImportParseAgentId(p0 : Int, p1 : Int, p2 : Int) = "golem:agent/host@2.0.0" "parse-agent-id" - -///| -fn wasmImportCreateWebhook( - p0 : Int64, - p1 : Int64, - p2 : Int, - p3 : Int, - p4 : Int64, - p5 : Int, -) = "golem:agent/host@2.0.0" "create-webhook" - -///| -fn wasmImportConstructorWasmRpc( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int64, - p7 : Int64, - p8 : Int, - p9 : Int, -) -> Int = "golem:agent/host@2.0.0" "[constructor]wasm-rpc" - -///| -fn wasmImportMethodWasmRpcInvokeAndAwait( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, -) = "golem:agent/host@2.0.0" "[method]wasm-rpc.invoke-and-await" - -///| -fn wasmImportMethodWasmRpcInvoke( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, -) = "golem:agent/host@2.0.0" "[method]wasm-rpc.invoke" - -///| -fn wasmImportMethodWasmRpcAsyncInvokeAndAwait( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, -) = "golem:agent/host@2.0.0" "[method]wasm-rpc.async-invoke-and-await" - -///| -fn wasmImportMethodWasmRpcScheduleInvocation( - p0 : Int, - p1 : Int64, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, - p7 : Int, - p8 : Int, -) = "golem:agent/host@2.0.0" "[method]wasm-rpc.schedule-invocation" - -///| -fn wasmImportMethodWasmRpcScheduleCancelableInvocation( - p0 : Int, - p1 : Int64, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, - p7 : Int, - p8 : Int, -) = "golem:agent/host@2.0.0" "[method]wasm-rpc.schedule-cancelable-invocation" +fn wasmImportGetAllAgentTypes(p0 : Int) = "golem:agent/host@2.0.0" "get-all-agent-types" + +fn wasmImportGetAgentType(p0 : Int, p1 : Int, p2 : Int) = "golem:agent/host@2.0.0" "get-agent-type" + +fn wasmImportMakeAgentId(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int64, p7 : Int64, p8 : Int) = "golem:agent/host@2.0.0" "make-agent-id" + +fn wasmImportParseAgentId(p0 : Int, p1 : Int, p2 : Int) = "golem:agent/host@2.0.0" "parse-agent-id" + +fn wasmImportCreateWebhook(p0 : Int64, p1 : Int64, p2 : Int, p3 : Int, p4 : Int64, p5 : Int) = "golem:agent/host@2.0.0" "create-webhook" + +fn wasmImportConstructorWasmRpc(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int64, p7 : Int64, p8 : Int, p9 : Int) -> Int = "golem:agent/host@2.0.0" "[constructor]wasm-rpc" + +fn wasmImportMethodWasmRpcInvokeAndAwait(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int, p7 : Int, p8 : Int) = "golem:agent/host@2.0.0" "[method]wasm-rpc.invoke-and-await" + +fn wasmImportMethodWasmRpcInvoke(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int, p7 : Int, p8 : Int) = "golem:agent/host@2.0.0" "[method]wasm-rpc.invoke" + +fn wasmImportMethodWasmRpcAsyncInvokeAndAwait(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int, p7 : Int, p8 : Int) = "golem:agent/host@2.0.0" "[method]wasm-rpc.async-invoke-and-await" + +fn wasmImportMethodWasmRpcScheduleInvocation(p0 : Int, p1 : Int64, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int, p7 : Int, p8 : Int, p9 : Int, p10 : Int) = "golem:agent/host@2.0.0" "[method]wasm-rpc.schedule-invocation" + +fn wasmImportMethodWasmRpcScheduleCancelableInvocation(p0 : Int, p1 : Int64, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int, p7 : Int, p8 : Int, p9 : Int, p10 : Int) = "golem:agent/host@2.0.0" "[method]wasm-rpc.schedule-cancelable-invocation" -///| fn wasmImportMethodFutureInvokeResultGet(p0 : Int, p1 : Int) -> Int = "golem:agent/host@2.0.0" "[async-lower][method]future-invoke-result.get" -///| -fn wasmImportMethodFutureInvokeResultCancel(p0 : Int) = "golem:agent/host@2.0.0" "[method]future-invoke-result.cancel" +fn wasmImportMethodFutureInvokeResultCancel(p0 : Int) = "golem:agent/host@2.0.0" "[method]future-invoke-result.cancel" -///| -fn wasmImportMethodCancellationTokenCancel(p0 : Int) = "golem:agent/host@2.0.0" "[method]cancellation-token.cancel" +fn wasmImportMethodCancellationTokenCancel(p0 : Int) = "golem:agent/host@2.0.0" "[method]cancellation-token.cancel" -///| -fn wasmImportGetConfigValue( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, - p7 : Int, -) = "golem:agent/host@2.0.0" "get-config-value" +fn wasmImportGetConfigValue(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int, p7 : Int) = "golem:agent/host@2.0.0" "get-config-value" ///| -extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend16_s) +extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_s) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = +#|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) ///| extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_s) +#|(func (param i32) (result i32) local.get 0 i32.load16_s) ///| -extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_s) +extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend8_s) ///| -extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = - #|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) +extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = +#|(func (param i32) (result f64) local.get 0 f64.load) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_u) ///| -extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = - #|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend16_s) ///| -#owned(bytes) -extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = +#|(func (param i32) (result f32) local.get 0 f32.load) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = - #|(func (param i32) (result f32) local.get 0 f32.load) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = - #|(func (param i32) (result f64) local.get 0 f64.load) +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) +extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend8_s) +extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = +#|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) +#owned(bytes) +extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/agent/host/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/agent/host/top.mbt index 778b628d44..30a4195254 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/agent/host/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/agent/host/top.mbt @@ -1,30264 +1,27076 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Possible failures of an RPC call pub(all) suberror RpcError { - ProtocolError(String) - Denied(String) - NotFound(String) - RemoteInternalError(String) - RemoteAgentError(@common.AgentError) + ProtocolError(String) + Denied(String) + NotFound(String) + RemoteInternalError(String) + RemoteAgentError(@common.AgentError) } derive(Show, Eq) - ///| /// Final identity allocated for one remote invocation. For an ephemeral /// target, `agent-id` contains the generated one-shot phantom ID. pub(all) struct InvocationMetadata { - agent_id : String - idempotency_key : String + agent_id : String; idempotency_key : String } derive(Show, Eq) - ///| /// Result of an awaited invocation together with its final identity. pub(all) struct InvocationResultWithMetadata { - metadata : InvocationMetadata - result : @types.SchemaValueTree? + metadata : InvocationMetadata; result : @types.SchemaValueTree? } derive(Show, Eq) - ///| /// Receipt returned when an invocation has been scheduled. pub(all) struct ScheduledInvocationReceipt { - metadata : InvocationMetadata + metadata : InvocationMetadata } derive(Show, Eq) - ///| /// An RPC client for invoking remote agents pub(all) struct WasmRpc(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn WasmRpc::drop(self : WasmRpc) -> Unit { - let WasmRpc(resource) = self - wasmImportResourceDropWasmRpc(resource) + let WasmRpc(resource) = self + wasmImportResourceDropWasmRpc(resource) } - ///| /// Represents an asynchronous invocation result pub(all) struct FutureInvokeResult(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn FutureInvokeResult::drop(self : FutureInvokeResult) -> Unit { - let FutureInvokeResult(resource) = self - wasmImportResourceDropFutureInvokeResult(resource) + let FutureInvokeResult(resource) = self + wasmImportResourceDropFutureInvokeResult(resource) } - ///| /// Asynchronous invocation handle together with its final identity. pub(all) struct AsyncInvocationWithMetadata { - metadata : InvocationMetadata - future : FutureInvokeResult + metadata : InvocationMetadata; future : FutureInvokeResult } derive(Show, Eq) - ///| /// Cancellation token for scheduled invocations pub(all) struct CancellationToken(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn CancellationToken::drop(self : CancellationToken) -> Unit { - let CancellationToken(resource) = self - wasmImportResourceDropCancellationToken(resource) + let CancellationToken(resource) = self + wasmImportResourceDropCancellationToken(resource) } - ///| /// Receipt for a scheduled invocation that can still be cancelled. pub(all) struct CancelableScheduledInvocationReceipt { - metadata : InvocationMetadata - cancellation_token : CancellationToken + metadata : InvocationMetadata; cancellation_token : CancellationToken } derive(Show, Eq) - ///| /// Gets all the registered agent types pub fn get_all_agent_types() -> Array[@common.RegisteredAgentType] { - let return_area = mbt_ffi_malloc(8) - wasmImportGetAllAgentTypes(return_area) - - let array578 : Array[@common.RegisteredAgentType] = [] - for index579 = 0 - index579 < mbt_ffi_load32(return_area + 4) - index579 = index579 + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index579 * 192 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let array195 : Array[@types.SchemaTypeNode] = [] - for index196 = 0 - index196 < mbt_ffi_load32(iter_base + 28) - index196 = index196 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index196 * 144 - - let lifted181 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted7 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted) - } - _ => panic() - } - - let lifted4 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted3 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3) - } - _ => panic() - } - - let lifted6 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result5) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2, - max: lifted4, - unit: lifted6, - }) - } - _ => panic() - } - @types.SchemaTypeBody::S8Type(lifted7) - } - 3 => { - let lifted14 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted9 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted8 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted8) - } - _ => panic() - } - - let lifted11 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted10 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted10) - } - _ => panic() - } - - let lifted13 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result12 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result12) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted9, - max: lifted11, - unit: lifted13, - }) - } - _ => panic() - } + let return_area = mbt_ffi_malloc(8) + wasmImportGetAllAgentTypes(return_area); - @types.SchemaTypeBody::S16Type(lifted14) - } - 4 => { - let lifted21 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted16 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted15 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted15) - } - _ => panic() - } - - let lifted18 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted17 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted17) - } - _ => panic() - } - - let lifted20 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result19) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted16, - max: lifted18, - unit: lifted20, - }) - } - _ => panic() - } + let array578 : Array[@common.RegisteredAgentType] = []; + for index579 = 0; index579 < (mbt_ffi_load32((return_area) + 4)); index579 = index579 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index579 * 192) - @types.SchemaTypeBody::S32Type(lifted21) - } - 5 => { - let lifted28 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted23 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted22 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted22) - } - _ => panic() - } - - let lifted25 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted24 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted24) - } - _ => panic() - } - - let lifted27 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result26 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result26) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted23, - max: lifted25, - unit: lifted27, - }) - } - _ => panic() - } + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::S64Type(lifted28) - } - 6 => { - let lifted35 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted30 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted29 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted29) - } - _ => panic() - } - - let lifted32 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted31 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted31) - } - _ => panic() - } - - let lifted34 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result33 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result33) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted30, - max: lifted32, - unit: lifted34, - }) - } - _ => panic() - } + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::U8Type(lifted35) - } - 7 => { - let lifted42 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted37 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted36 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted36) - } - _ => panic() - } - - let lifted39 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted38 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted38) - } - _ => panic() - } - - let lifted41 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result40 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result40) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted37, - max: lifted39, - unit: lifted41, - }) - } - _ => panic() - } + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaTypeBody::U16Type(lifted42) - } - 8 => { - let lifted49 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted44 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted43 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted43) - } - _ => panic() - } - - let lifted46 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted45 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted45) - } - _ => panic() - } - - let lifted48 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result47 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result47) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted44, - max: lifted46, - unit: lifted48, - }) - } - _ => panic() - } + let array195 : Array[@types.SchemaTypeNode] = []; + for index196 = 0; index196 < (mbt_ffi_load32((iter_base) + 28)); index196 = index196 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index196 * 144) - @types.SchemaTypeBody::U32Type(lifted49) - } - 9 => { - let lifted56 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted51 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted50 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted50) - } - _ => panic() - } - - let lifted53 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted52 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted52) - } - _ => panic() - } - - let lifted55 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result54 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result54) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted51, - max: lifted53, - unit: lifted55, - }) - } - _ => panic() - } + let lifted181 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - @types.SchemaTypeBody::U64Type(lifted56) - } - 10 => { - let lifted63 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted58 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted57 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted57) - } - _ => panic() - } - - let lifted60 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted59 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted59) - } - _ => panic() - } - - let lifted62 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result61 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result61) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted58, - max: lifted60, - unit: lifted62, - }) - } - _ => panic() - } + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { - @types.SchemaTypeBody::F32Type(lifted63) - } - 11 => { - let lifted70 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted65 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted64 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted64) - } - _ => panic() - } - - let lifted67 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted66 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted66) - } - _ => panic() - } - - let lifted69 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result68 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result68) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted65, - max: lifted67, - unit: lifted69, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted70) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array83 : Array[@types.NamedFieldType] = [] - for index84 = 0 - index84 < mbt_ffi_load32(iter_base + 12) - index84 = index84 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index84 * 68 - - let result71 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted73 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result72 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result72) - } - _ => panic() - } + @types.SchemaTypeBody::BoolType + } + 2 => { - let array : Array[String] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 28) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index * 8 + let lifted7 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let result74 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - array.push(result74) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let lifted = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let array76 : Array[String] = [] - for index77 = 0 - index77 < mbt_ffi_load32(iter_base + 36) - index77 = index77 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index77 * 8 + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let result75 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - array76.push(result75) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted79 : String? = match mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result78 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result78) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted82 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted81 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result80 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + Option::Some(lifted) + } + _ => panic() + } - @types.Role::Other(result80) - } - _ => panic() - } + let lifted4 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - Option::Some(lifted81) - } - _ => panic() - } + let lifted3 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - array83.push(@types.NamedFieldType::{ - name: result71, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted73, - aliases: array, - examples: array76, - deprecated: lifted79, - role: lifted82, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array83) - } - 15 => { - let array100 : Array[@types.VariantCaseType] = [] - for index101 = 0 - index101 < mbt_ffi_load32(iter_base + 12) - index101 = index101 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index101 * 72 - - let result85 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted86 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - let lifted88 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result87 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result87) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - let array90 : Array[String] = [] - for index91 = 0 - index91 < mbt_ffi_load32(iter_base + 32) - index91 = index91 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index91 * 8 + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let result89 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(lifted3) + } + _ => panic() + } - array90.push(result89) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let lifted6 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let array93 : Array[String] = [] - for index94 = 0 - index94 < mbt_ffi_load32(iter_base + 40) - index94 = index94 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index94 * 8 + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let result92 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(result5) + } + _ => panic() + } - array93.push(result92) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted96 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result95 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result95) - } - _ => panic() - } + Option::Some(@types.NumericRestrictions::{min : lifted2, max : lifted4, unit : lifted6}) + } + _ => panic() + } - let lifted99 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted98 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result97 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + @types.SchemaTypeBody::S8Type(lifted7) + } + 3 => { - @types.Role::Other(result97) - } - _ => panic() - } + let lifted14 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted98) - } - _ => panic() - } + let lifted9 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - array100.push(@types.VariantCaseType::{ - name: result85, - payload: lifted86, - metadata: @types.MetadataEnvelope::{ - doc: lifted88, - aliases: array90, - examples: array93, - deprecated: lifted96, - role: lifted99, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array100) - } - 16 => { - let array103 : Array[String] = [] - for index104 = 0 - index104 < mbt_ffi_load32(iter_base + 12) - index104 = index104 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index104 * 8 - - let result102 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array103.push(result102) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array103) - } - 17 => { - let array106 : Array[String] = [] - for index107 = 0 - index107 < mbt_ffi_load32(iter_base + 12) - index107 = index107 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index107 * 8 - - let result105 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array106.push(result105) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array106) - } - 18 => { - let array108 : Array[Int] = [] - for index109 = 0 - index109 < mbt_ffi_load32(iter_base + 12) - index109 = index109 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index109 * 4 - - array108.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array108) - } - 19 => @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted110 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted8 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let lifted111 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted110, - err: lifted111, - }) - } - 24 => { - let lifted115 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array113 : Array[String] = [] - for index114 = 0 - index114 < mbt_ffi_load32(iter_base + 16) - index114 = index114 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index114 * 8 - - let result112 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array113.push(result112) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array113) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let lifted116 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 24).reinterpret_as_uint()) - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - let lifted117 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 32).reinterpret_as_uint()) - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted119 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result118 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + Option::Some(lifted8) + } + _ => panic() + } - Option::Some(result118) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted115, - min_length: lifted116, - max_length: lifted117, - regex: lifted119, - }) - } - 25 => { - let lifted123 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array121 : Array[String] = [] - for index122 = 0 - index122 < mbt_ffi_load32(iter_base + 16) - index122 = index122 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index122 * 8 - - let result120 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array121.push(result120) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array121) - } - _ => panic() - } + let lifted11 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - let lifted124 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 24).reinterpret_as_uint()) - _ => panic() - } + let lifted10 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let lifted125 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 32).reinterpret_as_uint()) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted123, - min_bytes: lifted124, - max_bytes: lifted125, - }) - } - 26 => { - let lifted129 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array127 : Array[String] = [] - for index128 = 0 - index128 < mbt_ffi_load32(iter_base + 20) - index128 = index128 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index128 * 8 - - let result126 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array127.push(result126) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array127) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - let lifted133 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array131 : Array[String] = [] - for index132 = 0 - index132 < mbt_ffi_load32(iter_base + 32) - index132 = index132 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index132 * 8 - - let result130 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array131.push(result130) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array131) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted129, - allowed_extensions: lifted133, - }) - } - 27 => { - let lifted137 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array135 : Array[String] = [] - for index136 = 0 - index136 < mbt_ffi_load32(iter_base + 16) - index136 = index136 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index136 * 8 - - let result134 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array135.push(result134) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array135) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - let lifted141 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array139 : Array[String] = [] - for index140 = 0 - index140 < mbt_ffi_load32(iter_base + 28) - index140 = index140 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index140 * 8 - - let result138 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array139.push(result138) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array139) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted137, - allowed_hosts: lifted141, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result142 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array144 : Array[String] = [] - for index145 = 0 - index145 < mbt_ffi_load32(iter_base + 20) - index145 = index145 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index145 * 8 - - let result143 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array144.push(result143) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted147 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result146 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result146, - }) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted149 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result148 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result148, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result142, - allowed_suffixes: array144, - min: lifted147, - max: lifted149, - }) - } - 31 => { - let array173 : Array[@types.UnionBranch] = [] - for index174 = 0 - index174 < mbt_ffi_load32(iter_base + 12) - index174 = index174 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index174 * 92 - - let result150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted159 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result151 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result151) - } - 1 => { - let result152 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result152) - } - 2 => { - let result153 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result153) - } - 3 => { - let result154 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result154) - } - 4 => { - let result155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted157 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result156 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + Option::Some(lifted10) + } + _ => panic() + } - Option::Some(result156) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result155, - literal: lifted157, - }) - } - 5 => { - let result158 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result158) - } - _ => panic() - } + let lifted13 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let lifted161 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result160 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result160) - } - _ => panic() - } + let result12 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let array163 : Array[String] = [] - for index164 = 0 - index164 < mbt_ffi_load32(iter_base + 52) - index164 = index164 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index164 * 8 + Option::Some(result12) + } + _ => panic() + } - let result162 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(@types.NumericRestrictions::{min : lifted9, max : lifted11, unit : lifted13}) + } + _ => panic() + } - array163.push(result162) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + @types.SchemaTypeBody::S16Type(lifted14) + } + 4 => { - let array166 : Array[String] = [] - for index167 = 0 - index167 < mbt_ffi_load32(iter_base + 60) - index167 = index167 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index167 * 8 + let lifted21 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let result165 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted16 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - array166.push(result165) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted169 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result168 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result168) - } - _ => panic() - } + let lifted15 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let lifted172 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted171 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result170 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - @types.Role::Other(result170) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(lifted171) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - array173.push(@types.UnionBranch::{ - tag: result150, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted159, - metadata: @types.MetadataEnvelope::{ - doc: lifted161, - aliases: array163, - examples: array166, - deprecated: lifted169, - role: lifted172, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array173, - }) - } - 32 => { - let lifted176 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + Option::Some(lifted15) + } + _ => panic() + } - Option::Some(result175) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted176, - }) - } - 33 => { - let lifted178 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result177 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + let lifted18 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - Option::Some(result177) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted178, - }) - } - 34 => { - let lifted179 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted17 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - @types.SchemaTypeBody::FutureType(lifted179) - } - 35 => { - let lifted180 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - @types.SchemaTypeBody::StreamType(lifted180) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - let lifted183 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result182 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result182) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let array185 : Array[String] = [] - for index186 = 0 - index186 < mbt_ffi_load32(iter_base + 104) - index186 = index186 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index186 * 8 + Option::Some(lifted17) + } + _ => panic() + } - let result184 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted20 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - array185.push(result184) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let array188 : Array[String] = [] - for index189 = 0 - index189 < mbt_ffi_load32(iter_base + 112) - index189 = index189 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index189 * 8 + Option::Some(result19) + } + _ => panic() + } - let result187 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(@types.NumericRestrictions::{min : lifted16, max : lifted18, unit : lifted20}) + } + _ => panic() + } - array188.push(result187) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted191 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result190 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result190) - } - _ => panic() - } + @types.SchemaTypeBody::S32Type(lifted21) + } + 5 => { - let lifted194 : @types.Role? = match mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted193 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result192 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result192) - } - _ => panic() - } + let lifted28 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted193) - } - _ => panic() - } + let lifted23 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - array195.push(@types.SchemaTypeNode::{ - body: lifted181, - metadata: @types.MetadataEnvelope::{ - doc: lifted183, - aliases: array185, - examples: array188, - deprecated: lifted191, - role: lifted194, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array200 : Array[@types.SchemaTypeDef] = [] - for index201 = 0 - index201 < mbt_ffi_load32(iter_base + 36) - index201 = index201 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index201 * 24 - - let result197 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted22 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let lifted199 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result198 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result198) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - array200.push(@types.SchemaTypeDef::{ - id: result197, - name: lifted199, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted203 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result202 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result202) - } - _ => panic() - } - - let result204 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 56), - mbt_ffi_load32(iter_base + 60), - ) - - let lifted206 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result205 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result205) - } - _ => panic() - } - - let lifted224 = match mbt_ffi_load8_u(iter_base + 76) { - 0 => { - let array222 : Array[@common.NamedField] = [] - for index223 = 0 - index223 < mbt_ffi_load32(iter_base + 84) - index223 = index223 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 80) + index223 * 72 - - let result207 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted208 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => @common.FieldSource::UserSupplied - 1 => - @common.FieldSource::AutoInjected( - @common.AutoInjectedKind::from(mbt_ffi_load8_u(iter_base + 9)), - ) - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - let lifted210 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result209 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - Option::Some(result209) - } - _ => panic() - } - - let array212 : Array[String] = [] - for index213 = 0 - index213 < mbt_ffi_load32(iter_base + 32) - index213 = index213 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index213 * 8 - - let result211 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array212.push(result211) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array215 : Array[String] = [] - for index216 = 0 - index216 < mbt_ffi_load32(iter_base + 40) - index216 = index216 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index216 * 8 - - let result214 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array215.push(result214) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted218 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result217 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) + Option::Some(lifted22) + } + _ => panic() + } - Option::Some(result217) - } - _ => panic() - } + let lifted25 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - let lifted221 : @types.Role? = match mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted220 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result219 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result219) - } - _ => panic() - } - - Option::Some(lifted220) - } - _ => panic() - } - - array222.push(@common.NamedField::{ - name: result207, - source: lifted208, - schema: mbt_ffi_load32(iter_base + 12), - metadata: @types.MetadataEnvelope::{ - doc: lifted210, - aliases: array212, - examples: array215, - deprecated: lifted218, - role: lifted221, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 80)) - - @common.InputSchema::Parameters(array222) - } - _ => panic() - } - - let array272 : Array[@common.AgentMethod] = [] - for index273 = 0 - index273 < mbt_ffi_load32(iter_base + 92) - index273 = index273 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 88) + index273 * 88 - - let result225 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted24 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let result226 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - let array247 : Array[@common.HttpEndpointDetails] = [] - for index248 = 0 - index248 < mbt_ffi_load32(iter_base + 20) - index248 = index248 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index248 * 48 - - let lifted228 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @common.HttpMethod::Get - 1 => @common.HttpMethod::Head - 2 => @common.HttpMethod::Post - 3 => @common.HttpMethod::Put - 4 => @common.HttpMethod::Delete - 5 => @common.HttpMethod::Connect - 6 => @common.HttpMethod::Options - 7 => @common.HttpMethod::Trace - 8 => @common.HttpMethod::Patch - 9 => { - let result227 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.HttpMethod::Custom(result227) - } - _ => panic() - } - - let array233 : Array[@common.PathSegment] = [] - for index234 = 0 - index234 < mbt_ffi_load32(iter_base + 16) - index234 = index234 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index234 * 12 - - let lifted232 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result229 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - @common.PathSegment::Literal(result229) - } - 1 => - @common.PathSegment::SystemVariable( - @common.SystemVariable::from(mbt_ffi_load8_u(iter_base + 4)), - ) - 2 => { - let result230 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::PathVariable(@common.PathVariable::{ - variable_name: result230, - }) - } - 3 => { - let result231 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::RemainingPathVariable(@common.PathVariable::{ - variable_name: result231, - }) - } - _ => panic() - } - - array233.push(lifted232) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - let array237 : Array[@common.HeaderVariable] = [] - for index238 = 0 - index238 < mbt_ffi_load32(iter_base + 24) - index238 = index238 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index238 * 16 - - let result235 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result236 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array237.push(@common.HeaderVariable::{ - header_name: result235, - variable_name: result236, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - let array241 : Array[@common.QueryVariable] = [] - for index242 = 0 - index242 < mbt_ffi_load32(iter_base + 32) - index242 = index242 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index242 * 16 - - let result239 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result240 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array241.push(@common.QueryVariable::{ - query_param_name: result239, - variable_name: result240, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let lifted243 : @common.AuthDetails? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => - Option::Some(@common.AuthDetails::{ - required: mbt_ffi_load8_u(iter_base + 37) != 0, - }) - _ => panic() - } - - let array245 : Array[String] = [] - for index246 = 0 - index246 < mbt_ffi_load32(iter_base + 44) - index246 = index246 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index246 * 8 - - let result244 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array245.push(result244) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - array247.push(@common.HttpEndpointDetails::{ - http_method: lifted228, - path_suffix: array233, - header_vars: array237, - query_vars: array241, - auth_details: lifted243, - cors_options: @common.CorsOptions::{ allowed_patterns: array245 }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted250 : String? = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result249 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result249) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted268 = match mbt_ffi_load8_u(iter_base + 36) { - 0 => { - let array266 : Array[@common.NamedField] = [] - for index267 = 0 - index267 < mbt_ffi_load32(iter_base + 44) - index267 = index267 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index267 * 72 - - let result251 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted252 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => @common.FieldSource::UserSupplied - 1 => - @common.FieldSource::AutoInjected( - @common.AutoInjectedKind::from(mbt_ffi_load8_u(iter_base + 9)), - ) - _ => panic() - } + Option::Some(lifted24) + } + _ => panic() + } - let lifted254 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result253 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result253) - } - _ => panic() - } + let lifted27 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let array256 : Array[String] = [] - for index257 = 0 - index257 < mbt_ffi_load32(iter_base + 32) - index257 = index257 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index257 * 8 + let result26 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let result255 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(result26) + } + _ => panic() + } - array256.push(result255) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + Option::Some(@types.NumericRestrictions::{min : lifted23, max : lifted25, unit : lifted27}) + } + _ => panic() + } - let array259 : Array[String] = [] - for index260 = 0 - index260 < mbt_ffi_load32(iter_base + 40) - index260 = index260 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index260 * 8 + @types.SchemaTypeBody::S64Type(lifted28) + } + 6 => { - let result258 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted35 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array259.push(result258) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted262 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result261 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result261) - } - _ => panic() - } + let lifted30 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted265 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted264 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result263 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let lifted29 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - @types.Role::Other(result263) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - Option::Some(lifted264) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - array266.push(@common.NamedField::{ - name: result251, - source: lifted252, - schema: mbt_ffi_load32(iter_base + 12), - metadata: @types.MetadataEnvelope::{ - doc: lifted254, - aliases: array256, - examples: array259, - deprecated: lifted262, - role: lifted265, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - @common.InputSchema::Parameters(array266) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted269 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => @common.OutputSchema::Unit - 1 => @common.OutputSchema::Single(mbt_ffi_load32(iter_base + 52)) - _ => panic() - } + Option::Some(lifted29) + } + _ => panic() + } - let lifted271 : @common.ReadOnlyConfig? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted270 = match mbt_ffi_load8_u(iter_base + 64) { - 0 => @common.CachePolicy::NoCache - 1 => @common.CachePolicy::UntilWrite - 2 => - @common.CachePolicy::Ttl( - mbt_ffi_load64(iter_base + 72).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(@common.ReadOnlyConfig::{ - cache_policy: lifted270, - uses_principal: mbt_ffi_load8_u(iter_base + 80) != 0, - }) - } - _ => panic() - } + let lifted32 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - array272.push(@common.AgentMethod::{ - name: result225, - description: result226, - http_endpoint: array247, - prompt_hint: lifted250, - input_schema: lifted268, - output_schema: lifted269, - read_only: lifted271, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - - let array552 : Array[@common.AgentDependency] = [] - for index553 = 0 - index553 < mbt_ffi_load32(iter_base + 100) - index553 = index553 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 96) + index553 * 92 - - let result274 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted31 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let lifted276 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result275 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result275) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - let array473 : Array[@types.SchemaTypeNode] = [] - for index474 = 0 - index474 < mbt_ffi_load32(iter_base + 24) - index474 = index474 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index474 * 144 - - let lifted459 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted283 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted278 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted277 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted277) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - let lifted280 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted279 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted279) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted282 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result281 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(lifted31) + } + _ => panic() + } - Option::Some(result281) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted278, - max: lifted280, - unit: lifted282, - }) - } - _ => panic() - } + let lifted34 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::S8Type(lifted283) - } - 3 => { - let lifted290 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted285 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted284 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted284) - } - _ => panic() - } + let result33 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let lifted287 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted286 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted286) - } - _ => panic() - } + Option::Some(result33) + } + _ => panic() + } - let lifted289 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result288 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(@types.NumericRestrictions::{min : lifted30, max : lifted32, unit : lifted34}) + } + _ => panic() + } - Option::Some(result288) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted285, - max: lifted287, - unit: lifted289, - }) - } - _ => panic() - } + @types.SchemaTypeBody::U8Type(lifted35) + } + 7 => { - @types.SchemaTypeBody::S16Type(lifted290) - } - 4 => { - let lifted297 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted292 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted291 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted291) - } - _ => panic() - } + let lifted42 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted294 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted293 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted293) - } - _ => panic() - } + let lifted37 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted296 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result295 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted36 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - Option::Some(result295) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted292, - max: lifted294, - unit: lifted296, - }) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - @types.SchemaTypeBody::S32Type(lifted297) - } - 5 => { - let lifted304 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted299 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted298 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted298) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - let lifted301 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted300 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted300) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted36) + } + _ => panic() + } + + let lifted39 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted38 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted38) + } + _ => panic() + } + + let lifted41 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result40 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result40) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted37, max : lifted39, unit : lifted41}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted42) + } + 8 => { + + let lifted49 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted44 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted43 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted43) + } + _ => panic() + } + + let lifted46 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted45 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted45) + } + _ => panic() + } + + let lifted48 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result47 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result47) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted44, max : lifted46, unit : lifted48}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted49) + } + 9 => { + + let lifted56 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted51 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted50 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted50) + } + _ => panic() + } + + let lifted53 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted52 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted52) + } + _ => panic() + } + + let lifted55 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result54 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result54) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted51, max : lifted53, unit : lifted55}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted56) + } + 10 => { + + let lifted63 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted58 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted57 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted57) + } + _ => panic() + } + + let lifted60 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted59 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted59) + } + _ => panic() + } + + let lifted62 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result61 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result61) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted58, max : lifted60, unit : lifted62}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted63) + } + 11 => { + + let lifted70 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted65 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted64 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted64) + } + _ => panic() + } + + let lifted67 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted66 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted66) + } + _ => panic() + } + + let lifted69 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result68 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result68) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted65, max : lifted67, unit : lifted69}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted70) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array83 : Array[@types.NamedFieldType] = []; + for index84 = 0; index84 < (mbt_ffi_load32((iter_base) + 12)); index84 = index84 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index84 * 68) + + let result71 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted73 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result72 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result72) + } + _ => panic() + } + + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 28)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index * 8) + + let result74 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result74) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array76 : Array[String] = []; + for index77 = 0; index77 < (mbt_ffi_load32((iter_base) + 36)); index77 = index77 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index77 * 8) + + let result75 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array76.push(result75) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted79 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result78 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result78) + } + _ => panic() + } + + let lifted82 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted81 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result80 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result80) + } + _ => panic() + } + + Option::Some(lifted81) + } + _ => panic() + } + + array83.push(@types.NamedFieldType::{name : result71, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted73, aliases : array, examples : array76, deprecated : lifted79, role : lifted82}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array83) + } + 15 => { + + let array100 : Array[@types.VariantCaseType] = []; + for index101 = 0; index101 < (mbt_ffi_load32((iter_base) + 12)); index101 = index101 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index101 * 72) + + let result85 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted86 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted88 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result87 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result87) + } + _ => panic() + } + + let array90 : Array[String] = []; + for index91 = 0; index91 < (mbt_ffi_load32((iter_base) + 32)); index91 = index91 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index91 * 8) + + let result89 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array90.push(result89) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array93 : Array[String] = []; + for index94 = 0; index94 < (mbt_ffi_load32((iter_base) + 40)); index94 = index94 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index94 * 8) + + let result92 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array93.push(result92) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted96 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result95 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result95) + } + _ => panic() + } + + let lifted99 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted98 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result97 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result97) + } + _ => panic() + } + + Option::Some(lifted98) + } + _ => panic() + } + + array100.push(@types.VariantCaseType::{name : result85, payload : lifted86, metadata : @types.MetadataEnvelope::{doc : lifted88, aliases : array90, examples : array93, deprecated : lifted96, role : lifted99}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array100) + } + 16 => { + + let array103 : Array[String] = []; + for index104 = 0; index104 < (mbt_ffi_load32((iter_base) + 12)); index104 = index104 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index104 * 8) + + let result102 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array103.push(result102) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array103) + } + 17 => { + + let array106 : Array[String] = []; + for index107 = 0; index107 < (mbt_ffi_load32((iter_base) + 12)); index107 = index107 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index107 * 8) + + let result105 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array106.push(result105) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array106) + } + 18 => { + + let array108 : Array[Int] = []; + for index109 = 0; index109 < (mbt_ffi_load32((iter_base) + 12)); index109 = index109 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index109 * 4) + + array108.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array108) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted110 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted111 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted110, err : lifted111}) + } + 24 => { + + let lifted115 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array113 : Array[String] = []; + for index114 = 0; index114 < (mbt_ffi_load32((iter_base) + 16)); index114 = index114 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index114 * 8) + + let result112 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array113.push(result112) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array113) + } + _ => panic() + } + + let lifted116 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted117 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted119 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result118 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result118) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted115, min_length : lifted116, max_length : lifted117, regex : lifted119}) + } + 25 => { + + let lifted123 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array121 : Array[String] = []; + for index122 = 0; index122 < (mbt_ffi_load32((iter_base) + 16)); index122 = index122 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index122 * 8) + + let result120 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array121.push(result120) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array121) + } + _ => panic() + } + + let lifted124 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted125 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted123, min_bytes : lifted124, max_bytes : lifted125}) + } + 26 => { + + let lifted129 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array127 : Array[String] = []; + for index128 = 0; index128 < (mbt_ffi_load32((iter_base) + 20)); index128 = index128 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index128 * 8) + + let result126 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array127.push(result126) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array127) + } + _ => panic() + } + + let lifted133 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array131 : Array[String] = []; + for index132 = 0; index132 < (mbt_ffi_load32((iter_base) + 32)); index132 = index132 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index132 * 8) + + let result130 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array131.push(result130) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array131) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted129, allowed_extensions : lifted133}) + } + 27 => { + + let lifted137 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array135 : Array[String] = []; + for index136 = 0; index136 < (mbt_ffi_load32((iter_base) + 16)); index136 = index136 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index136 * 8) + + let result134 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array135.push(result134) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array135) + } + _ => panic() + } + + let lifted141 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array139 : Array[String] = []; + for index140 = 0; index140 < (mbt_ffi_load32((iter_base) + 28)); index140 = index140 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index140 * 8) + + let result138 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array139.push(result138) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array139) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted137, allowed_hosts : lifted141}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result142 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array144 : Array[String] = []; + for index145 = 0; index145 < (mbt_ffi_load32((iter_base) + 20)); index145 = index145 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index145 * 8) + + let result143 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array144.push(result143) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted147 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result146 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result146}) + } + _ => panic() + } + + let lifted149 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result148 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result148}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result142, allowed_suffixes : array144, min : lifted147, max : lifted149}) + } + 31 => { + + let array173 : Array[@types.UnionBranch] = []; + for index174 = 0; index174 < (mbt_ffi_load32((iter_base) + 12)); index174 = index174 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index174 * 92) + + let result150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted159 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result151 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result151) + } + 1 => { + + let result152 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result152) + } + 2 => { + + let result153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result153) + } + 3 => { + + let result154 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result154) + } + 4 => { + + let result155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted157 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result156 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result156) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result155, literal : lifted157}) + } + 5 => { + + let result158 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result158) + } + _ => panic() + } + + let lifted161 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result160 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result160) + } + _ => panic() + } + + let array163 : Array[String] = []; + for index164 = 0; index164 < (mbt_ffi_load32((iter_base) + 52)); index164 = index164 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index164 * 8) + + let result162 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array163.push(result162) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array166 : Array[String] = []; + for index167 = 0; index167 < (mbt_ffi_load32((iter_base) + 60)); index167 = index167 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index167 * 8) + + let result165 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array166.push(result165) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted169 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result168 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result168) + } + _ => panic() + } + + let lifted172 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted171 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result170 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result170) + } + _ => panic() + } + + Option::Some(lifted171) + } + _ => panic() + } + + array173.push(@types.UnionBranch::{tag : result150, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted159, metadata : @types.MetadataEnvelope::{doc : lifted161, aliases : array163, examples : array166, deprecated : lifted169, role : lifted172}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array173}) + } + 32 => { + + let lifted176 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result175 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result175) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted176}) + } + 33 => { + + let lifted178 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result177 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result177) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted178}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted179 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted179) + } + 36 => { + + let lifted180 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted180) + } + _ => panic() + } + + let lifted183 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result182 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result182) + } + _ => panic() + } + + let array185 : Array[String] = []; + for index186 = 0; index186 < (mbt_ffi_load32((iter_base) + 104)); index186 = index186 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index186 * 8) + + let result184 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array185.push(result184) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array188 : Array[String] = []; + for index189 = 0; index189 < (mbt_ffi_load32((iter_base) + 112)); index189 = index189 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index189 * 8) + + let result187 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array188.push(result187) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted191 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result190 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result190) + } + _ => panic() + } + + let lifted194 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted193 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result192 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result192) + } + _ => panic() + } + + Option::Some(lifted193) + } + _ => panic() + } + + array195.push(@types.SchemaTypeNode::{body : lifted181, metadata : @types.MetadataEnvelope::{doc : lifted183, aliases : array185, examples : array188, deprecated : lifted191, role : lifted194}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array200 : Array[@types.SchemaTypeDef] = []; + for index201 = 0; index201 < (mbt_ffi_load32((iter_base) + 36)); index201 = index201 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index201 * 24) + + let result197 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted199 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result198 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result198) + } + _ => panic() + } + + array200.push(@types.SchemaTypeDef::{id : result197, name : lifted199, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted203 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result202 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result202) + } + _ => panic() + } + + let result204 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 56), mbt_ffi_load32((iter_base) + 60)) + + let lifted206 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result205 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result205) + } + _ => panic() + } + + let lifted224 = match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => { + + let array222 : Array[@common.NamedField] = []; + for index223 = 0; index223 < (mbt_ffi_load32((iter_base) + 84)); index223 = index223 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 80)) + (index223 * 72) + + let result207 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted208 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + @common.FieldSource::UserSupplied + } + 1 => { + + @common.FieldSource::AutoInjected(@common.AutoInjectedKind::from(mbt_ffi_load8_u((iter_base) + 9))) + } + _ => panic() + } + + let lifted210 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result209 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result209) + } + _ => panic() + } + + let array212 : Array[String] = []; + for index213 = 0; index213 < (mbt_ffi_load32((iter_base) + 32)); index213 = index213 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index213 * 8) + + let result211 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array212.push(result211) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array215 : Array[String] = []; + for index216 = 0; index216 < (mbt_ffi_load32((iter_base) + 40)); index216 = index216 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index216 * 8) + + let result214 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array215.push(result214) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted218 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result217 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result217) + } + _ => panic() + } + + let lifted221 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted220 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result219 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result219) + } + _ => panic() + } + + Option::Some(lifted220) + } + _ => panic() + } + + array222.push(@common.NamedField::{name : result207, source : lifted208, schema : mbt_ffi_load32((iter_base) + 12), metadata : @types.MetadataEnvelope::{doc : lifted210, aliases : array212, examples : array215, deprecated : lifted218, role : lifted221}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 80)) + + @common.InputSchema::Parameters(array222) + } + _ => panic() + } + + let array272 : Array[@common.AgentMethod] = []; + for index273 = 0; index273 < (mbt_ffi_load32((iter_base) + 92)); index273 = index273 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 88)) + (index273 * 88) + + let result225 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result226 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array247 : Array[@common.HttpEndpointDetails] = []; + for index248 = 0; index248 < (mbt_ffi_load32((iter_base) + 20)); index248 = index248 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index248 * 48) + + let lifted228 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @common.HttpMethod::Get + } + 1 => { + + @common.HttpMethod::Head + } + 2 => { + + @common.HttpMethod::Post + } + 3 => { + + @common.HttpMethod::Put + } + 4 => { + + @common.HttpMethod::Delete + } + 5 => { + + @common.HttpMethod::Connect + } + 6 => { + + @common.HttpMethod::Options + } + 7 => { + + @common.HttpMethod::Trace + } + 8 => { + + @common.HttpMethod::Patch + } + 9 => { + + let result227 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.HttpMethod::Custom(result227) + } + _ => panic() + } + + let array233 : Array[@common.PathSegment] = []; + for index234 = 0; index234 < (mbt_ffi_load32((iter_base) + 16)); index234 = index234 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index234 * 12) + + let lifted232 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result229 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::Literal(result229) + } + 1 => { + + @common.PathSegment::SystemVariable(@common.SystemVariable::from(mbt_ffi_load8_u((iter_base) + 4))) + } + 2 => { + + let result230 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::PathVariable(@common.PathVariable::{variable_name : result230}) + } + 3 => { + + let result231 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::RemainingPathVariable(@common.PathVariable::{variable_name : result231}) + } + _ => panic() + } + + array233.push(lifted232) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + let array237 : Array[@common.HeaderVariable] = []; + for index238 = 0; index238 < (mbt_ffi_load32((iter_base) + 24)); index238 = index238 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index238 * 16) + + let result235 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result236 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array237.push(@common.HeaderVariable::{header_name : result235, variable_name : result236}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + let array241 : Array[@common.QueryVariable] = []; + for index242 = 0; index242 < (mbt_ffi_load32((iter_base) + 32)); index242 = index242 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index242 * 16) + + let result239 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result240 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array241.push(@common.QueryVariable::{query_param_name : result239, variable_name : result240}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let lifted243 : @common.AuthDetails? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + Option::Some(@common.AuthDetails::{required : (mbt_ffi_load8_u((iter_base) + 37) != 0)}) + } + _ => panic() + } + + let array245 : Array[String] = []; + for index246 = 0; index246 < (mbt_ffi_load32((iter_base) + 44)); index246 = index246 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index246 * 8) + + let result244 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array245.push(result244) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + array247.push(@common.HttpEndpointDetails::{http_method : lifted228, path_suffix : array233, header_vars : array237, query_vars : array241, auth_details : lifted243, cors_options : @common.CorsOptions::{allowed_patterns : array245}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted250 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result249 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result249) + } + _ => panic() + } + + let lifted268 = match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => { + + let array266 : Array[@common.NamedField] = []; + for index267 = 0; index267 < (mbt_ffi_load32((iter_base) + 44)); index267 = index267 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index267 * 72) + + let result251 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted252 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + @common.FieldSource::UserSupplied + } + 1 => { + + @common.FieldSource::AutoInjected(@common.AutoInjectedKind::from(mbt_ffi_load8_u((iter_base) + 9))) + } + _ => panic() + } + + let lifted254 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result253 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result253) + } + _ => panic() + } + + let array256 : Array[String] = []; + for index257 = 0; index257 < (mbt_ffi_load32((iter_base) + 32)); index257 = index257 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index257 * 8) + + let result255 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array256.push(result255) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array259 : Array[String] = []; + for index260 = 0; index260 < (mbt_ffi_load32((iter_base) + 40)); index260 = index260 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index260 * 8) + + let result258 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array259.push(result258) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted262 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result261 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result261) + } + _ => panic() + } + + let lifted265 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted264 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result263 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result263) + } + _ => panic() + } + + Option::Some(lifted264) + } + _ => panic() + } + + array266.push(@common.NamedField::{name : result251, source : lifted252, schema : mbt_ffi_load32((iter_base) + 12), metadata : @types.MetadataEnvelope::{doc : lifted254, aliases : array256, examples : array259, deprecated : lifted262, role : lifted265}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + @common.InputSchema::Parameters(array266) + } + _ => panic() + } + + let lifted269 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @common.OutputSchema::Unit + } + 1 => { + + @common.OutputSchema::Single(mbt_ffi_load32((iter_base) + 52)) + } + _ => panic() + } + + let lifted271 : @common.ReadOnlyConfig? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted270 = match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => { + + @common.CachePolicy::NoCache + } + 1 => { + + @common.CachePolicy::UntilWrite + } + 2 => { + + @common.CachePolicy::Ttl((mbt_ffi_load64((iter_base) + 72)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(@common.ReadOnlyConfig::{cache_policy : lifted270, uses_principal : (mbt_ffi_load8_u((iter_base) + 80) != 0)}) + } + _ => panic() + } + + array272.push(@common.AgentMethod::{name : result225, description : result226, http_endpoint : array247, prompt_hint : lifted250, input_schema : lifted268, output_schema : lifted269, read_only : lifted271}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + + let array552 : Array[@common.AgentDependency] = []; + for index553 = 0; index553 < (mbt_ffi_load32((iter_base) + 100)); index553 = index553 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 96)) + (index553 * 92) + + let result274 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted276 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result275 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result275) + } + _ => panic() + } + + let array473 : Array[@types.SchemaTypeNode] = []; + for index474 = 0; index474 < (mbt_ffi_load32((iter_base) + 24)); index474 = index474 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index474 * 144) + + let lifted459 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted283 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted278 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted277 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted277) + } + _ => panic() + } + + let lifted280 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted279 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted279) + } + _ => panic() + } + + let lifted282 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result281 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result281) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted278, max : lifted280, unit : lifted282}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted283) + } + 3 => { + + let lifted290 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted285 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted284 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted284) + } + _ => panic() + } + + let lifted287 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted286 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted286) + } + _ => panic() + } + + let lifted289 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result288 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result288) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted285, max : lifted287, unit : lifted289}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted290) + } + 4 => { + + let lifted297 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted292 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted291 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted291) + } + _ => panic() + } + + let lifted294 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted293 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted293) + } + _ => panic() + } + + let lifted296 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result295 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result295) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted292, max : lifted294, unit : lifted296}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted297) + } + 5 => { + + let lifted304 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted299 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted298 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted298) + } + _ => panic() + } + + let lifted301 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted300 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted300) + } + _ => panic() + } + + let lifted303 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result302 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result302) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted299, max : lifted301, unit : lifted303}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted304) + } + 6 => { + + let lifted311 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted306 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted305 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted305) + } + _ => panic() + } + + let lifted308 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted307 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted307) + } + _ => panic() + } + + let lifted310 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result309 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result309) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted306, max : lifted308, unit : lifted310}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted311) + } + 7 => { + + let lifted318 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted313 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted312 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted312) + } + _ => panic() + } + + let lifted315 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted314 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted314) + } + _ => panic() + } + + let lifted317 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result316 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result316) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted313, max : lifted315, unit : lifted317}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted318) + } + 8 => { + + let lifted325 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted320 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted319 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted319) + } + _ => panic() + } + + let lifted322 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted321 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted321) + } + _ => panic() + } + + let lifted324 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result323 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result323) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted320, max : lifted322, unit : lifted324}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted325) + } + 9 => { + + let lifted332 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted327 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted326 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted326) + } + _ => panic() + } + + let lifted329 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted328 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted328) + } + _ => panic() + } + + let lifted331 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result330 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result330) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted327, max : lifted329, unit : lifted331}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted332) + } + 10 => { + + let lifted339 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted334 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted333 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted333) + } + _ => panic() + } + + let lifted336 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted335 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted335) + } + _ => panic() + } + + let lifted338 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result337 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result337) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted334, max : lifted336, unit : lifted338}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted339) + } + 11 => { + + let lifted346 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted341 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted340 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted340) + } + _ => panic() + } + + let lifted343 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted342 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted342) + } + _ => panic() + } + + let lifted345 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result344 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result344) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted341, max : lifted343, unit : lifted345}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted346) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array361 : Array[@types.NamedFieldType] = []; + for index362 = 0; index362 < (mbt_ffi_load32((iter_base) + 12)); index362 = index362 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index362 * 68) + + let result347 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted349 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result348 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result348) + } + _ => panic() + } + + let array351 : Array[String] = []; + for index352 = 0; index352 < (mbt_ffi_load32((iter_base) + 28)); index352 = index352 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index352 * 8) + + let result350 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array351.push(result350) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array354 : Array[String] = []; + for index355 = 0; index355 < (mbt_ffi_load32((iter_base) + 36)); index355 = index355 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index355 * 8) + + let result353 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array354.push(result353) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted357 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result356 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result356) + } + _ => panic() + } + + let lifted360 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted359 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result358 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result358) + } + _ => panic() + } + + Option::Some(lifted359) + } + _ => panic() + } + + array361.push(@types.NamedFieldType::{name : result347, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted349, aliases : array351, examples : array354, deprecated : lifted357, role : lifted360}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array361) + } + 15 => { + + let array378 : Array[@types.VariantCaseType] = []; + for index379 = 0; index379 < (mbt_ffi_load32((iter_base) + 12)); index379 = index379 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index379 * 72) + + let result363 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted364 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted366 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result365 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result365) + } + _ => panic() + } + + let array368 : Array[String] = []; + for index369 = 0; index369 < (mbt_ffi_load32((iter_base) + 32)); index369 = index369 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index369 * 8) + + let result367 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array368.push(result367) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array371 : Array[String] = []; + for index372 = 0; index372 < (mbt_ffi_load32((iter_base) + 40)); index372 = index372 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index372 * 8) + + let result370 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array371.push(result370) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted374 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result373 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result373) + } + _ => panic() + } + + let lifted377 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted376 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result375 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result375) + } + _ => panic() + } + + Option::Some(lifted376) + } + _ => panic() + } + + array378.push(@types.VariantCaseType::{name : result363, payload : lifted364, metadata : @types.MetadataEnvelope::{doc : lifted366, aliases : array368, examples : array371, deprecated : lifted374, role : lifted377}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array378) + } + 16 => { + + let array381 : Array[String] = []; + for index382 = 0; index382 < (mbt_ffi_load32((iter_base) + 12)); index382 = index382 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index382 * 8) + + let result380 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array381.push(result380) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array381) + } + 17 => { + + let array384 : Array[String] = []; + for index385 = 0; index385 < (mbt_ffi_load32((iter_base) + 12)); index385 = index385 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index385 * 8) + + let result383 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array384.push(result383) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array384) + } + 18 => { + + let array386 : Array[Int] = []; + for index387 = 0; index387 < (mbt_ffi_load32((iter_base) + 12)); index387 = index387 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index387 * 4) + + array386.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array386) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted388 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted389 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted388, err : lifted389}) + } + 24 => { + + let lifted393 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array391 : Array[String] = []; + for index392 = 0; index392 < (mbt_ffi_load32((iter_base) + 16)); index392 = index392 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index392 * 8) + + let result390 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array391.push(result390) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array391) + } + _ => panic() + } + + let lifted394 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted395 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted397 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result396 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result396) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted393, min_length : lifted394, max_length : lifted395, regex : lifted397}) + } + 25 => { + + let lifted401 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array399 : Array[String] = []; + for index400 = 0; index400 < (mbt_ffi_load32((iter_base) + 16)); index400 = index400 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index400 * 8) + + let result398 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array399.push(result398) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array399) + } + _ => panic() + } + + let lifted402 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted403 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted401, min_bytes : lifted402, max_bytes : lifted403}) + } + 26 => { + + let lifted407 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array405 : Array[String] = []; + for index406 = 0; index406 < (mbt_ffi_load32((iter_base) + 20)); index406 = index406 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index406 * 8) + + let result404 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array405.push(result404) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array405) + } + _ => panic() + } + + let lifted411 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array409 : Array[String] = []; + for index410 = 0; index410 < (mbt_ffi_load32((iter_base) + 32)); index410 = index410 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index410 * 8) + + let result408 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array409.push(result408) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array409) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted407, allowed_extensions : lifted411}) + } + 27 => { + + let lifted415 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array413 : Array[String] = []; + for index414 = 0; index414 < (mbt_ffi_load32((iter_base) + 16)); index414 = index414 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index414 * 8) + + let result412 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array413.push(result412) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array413) + } + _ => panic() + } + + let lifted419 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array417 : Array[String] = []; + for index418 = 0; index418 < (mbt_ffi_load32((iter_base) + 28)); index418 = index418 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index418 * 8) + + let result416 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array417.push(result416) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array417) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted415, allowed_hosts : lifted419}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result420 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array422 : Array[String] = []; + for index423 = 0; index423 < (mbt_ffi_load32((iter_base) + 20)); index423 = index423 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index423 * 8) + + let result421 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array422.push(result421) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted425 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result424 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result424}) + } + _ => panic() + } + + let lifted427 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result426 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result426}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result420, allowed_suffixes : array422, min : lifted425, max : lifted427}) + } + 31 => { + + let array451 : Array[@types.UnionBranch] = []; + for index452 = 0; index452 < (mbt_ffi_load32((iter_base) + 12)); index452 = index452 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index452 * 92) + + let result428 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted437 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result429 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result429) + } + 1 => { + + let result430 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result430) + } + 2 => { + + let result431 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result431) + } + 3 => { + + let result432 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result432) + } + 4 => { + + let result433 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted435 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result434 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result434) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result433, literal : lifted435}) + } + 5 => { + + let result436 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result436) + } + _ => panic() + } + + let lifted439 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result438 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result438) + } + _ => panic() + } + + let array441 : Array[String] = []; + for index442 = 0; index442 < (mbt_ffi_load32((iter_base) + 52)); index442 = index442 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index442 * 8) + + let result440 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array441.push(result440) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array444 : Array[String] = []; + for index445 = 0; index445 < (mbt_ffi_load32((iter_base) + 60)); index445 = index445 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index445 * 8) + + let result443 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array444.push(result443) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted447 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result446 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result446) + } + _ => panic() + } + + let lifted450 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted449 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result448 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result448) + } + _ => panic() + } + + Option::Some(lifted449) + } + _ => panic() + } + + array451.push(@types.UnionBranch::{tag : result428, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted437, metadata : @types.MetadataEnvelope::{doc : lifted439, aliases : array441, examples : array444, deprecated : lifted447, role : lifted450}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array451}) + } + 32 => { + + let lifted454 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result453 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result453) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted454}) + } + 33 => { + + let lifted456 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result455 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result455) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted456}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted457 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted457) + } + 36 => { + + let lifted458 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted458) + } + _ => panic() + } + + let lifted461 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result460 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result460) + } + _ => panic() + } + + let array463 : Array[String] = []; + for index464 = 0; index464 < (mbt_ffi_load32((iter_base) + 104)); index464 = index464 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index464 * 8) + + let result462 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array463.push(result462) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array466 : Array[String] = []; + for index467 = 0; index467 < (mbt_ffi_load32((iter_base) + 112)); index467 = index467 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index467 * 8) + + let result465 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array466.push(result465) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted469 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result468 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result468) + } + _ => panic() + } + + let lifted472 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted471 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result470 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result470) + } + _ => panic() + } + + Option::Some(lifted471) + } + _ => panic() + } + + array473.push(@types.SchemaTypeNode::{body : lifted459, metadata : @types.MetadataEnvelope::{doc : lifted461, aliases : array463, examples : array466, deprecated : lifted469, role : lifted472}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + let array478 : Array[@types.SchemaTypeDef] = []; + for index479 = 0; index479 < (mbt_ffi_load32((iter_base) + 32)); index479 = index479 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index479 * 24) + + let result475 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted477 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result476 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result476) + } + _ => panic() + } + + array478.push(@types.SchemaTypeDef::{id : result475, name : lifted477, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let lifted481 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result480 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result480) + } + _ => panic() + } + + let result482 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) + + let lifted484 : String? = match mbt_ffi_load8_u((iter_base) + 60) { + 0 => Option::None + 1 => { + + let result483 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + Option::Some(result483) + } + _ => panic() + } + + let lifted502 = match (mbt_ffi_load8_u((iter_base) + 72)) { + 0 => { + + let array500 : Array[@common.NamedField] = []; + for index501 = 0; index501 < (mbt_ffi_load32((iter_base) + 80)); index501 = index501 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 76)) + (index501 * 72) + + let result485 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted486 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + @common.FieldSource::UserSupplied + } + 1 => { + + @common.FieldSource::AutoInjected(@common.AutoInjectedKind::from(mbt_ffi_load8_u((iter_base) + 9))) + } + _ => panic() + } + + let lifted488 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result487 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result487) + } + _ => panic() + } + + let array490 : Array[String] = []; + for index491 = 0; index491 < (mbt_ffi_load32((iter_base) + 32)); index491 = index491 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index491 * 8) + + let result489 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array490.push(result489) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array493 : Array[String] = []; + for index494 = 0; index494 < (mbt_ffi_load32((iter_base) + 40)); index494 = index494 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index494 * 8) + + let result492 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array493.push(result492) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted496 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result495 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result495) + } + _ => panic() + } + + let lifted499 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted498 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result497 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result497) + } + _ => panic() + } + + Option::Some(lifted498) + } + _ => panic() + } + + array500.push(@common.NamedField::{name : result485, source : lifted486, schema : mbt_ffi_load32((iter_base) + 12), metadata : @types.MetadataEnvelope::{doc : lifted488, aliases : array490, examples : array493, deprecated : lifted496, role : lifted499}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + @common.InputSchema::Parameters(array500) + } + _ => panic() + } + + let array550 : Array[@common.AgentMethod] = []; + for index551 = 0; index551 < (mbt_ffi_load32((iter_base) + 88)); index551 = index551 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 84)) + (index551 * 88) + + let result503 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result504 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array525 : Array[@common.HttpEndpointDetails] = []; + for index526 = 0; index526 < (mbt_ffi_load32((iter_base) + 20)); index526 = index526 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index526 * 48) + + let lifted506 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @common.HttpMethod::Get + } + 1 => { + + @common.HttpMethod::Head + } + 2 => { + + @common.HttpMethod::Post + } + 3 => { + + @common.HttpMethod::Put + } + 4 => { + + @common.HttpMethod::Delete + } + 5 => { + + @common.HttpMethod::Connect + } + 6 => { + + @common.HttpMethod::Options + } + 7 => { + + @common.HttpMethod::Trace + } + 8 => { + + @common.HttpMethod::Patch + } + 9 => { + + let result505 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.HttpMethod::Custom(result505) + } + _ => panic() + } + + let array511 : Array[@common.PathSegment] = []; + for index512 = 0; index512 < (mbt_ffi_load32((iter_base) + 16)); index512 = index512 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index512 * 12) + + let lifted510 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result507 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::Literal(result507) + } + 1 => { + + @common.PathSegment::SystemVariable(@common.SystemVariable::from(mbt_ffi_load8_u((iter_base) + 4))) + } + 2 => { + + let result508 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::PathVariable(@common.PathVariable::{variable_name : result508}) + } + 3 => { + + let result509 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::RemainingPathVariable(@common.PathVariable::{variable_name : result509}) + } + _ => panic() + } + + array511.push(lifted510) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + let array515 : Array[@common.HeaderVariable] = []; + for index516 = 0; index516 < (mbt_ffi_load32((iter_base) + 24)); index516 = index516 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index516 * 16) + + let result513 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result514 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array515.push(@common.HeaderVariable::{header_name : result513, variable_name : result514}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + let array519 : Array[@common.QueryVariable] = []; + for index520 = 0; index520 < (mbt_ffi_load32((iter_base) + 32)); index520 = index520 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index520 * 16) + + let result517 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result518 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array519.push(@common.QueryVariable::{query_param_name : result517, variable_name : result518}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let lifted521 : @common.AuthDetails? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + Option::Some(@common.AuthDetails::{required : (mbt_ffi_load8_u((iter_base) + 37) != 0)}) + } + _ => panic() + } + + let array523 : Array[String] = []; + for index524 = 0; index524 < (mbt_ffi_load32((iter_base) + 44)); index524 = index524 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index524 * 8) + + let result522 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array523.push(result522) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + array525.push(@common.HttpEndpointDetails::{http_method : lifted506, path_suffix : array511, header_vars : array515, query_vars : array519, auth_details : lifted521, cors_options : @common.CorsOptions::{allowed_patterns : array523}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted528 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result527 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result527) + } + _ => panic() + } + + let lifted546 = match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => { + + let array544 : Array[@common.NamedField] = []; + for index545 = 0; index545 < (mbt_ffi_load32((iter_base) + 44)); index545 = index545 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index545 * 72) + + let result529 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted530 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + @common.FieldSource::UserSupplied + } + 1 => { + + @common.FieldSource::AutoInjected(@common.AutoInjectedKind::from(mbt_ffi_load8_u((iter_base) + 9))) + } + _ => panic() + } + + let lifted532 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result531 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result531) + } + _ => panic() + } + + let array534 : Array[String] = []; + for index535 = 0; index535 < (mbt_ffi_load32((iter_base) + 32)); index535 = index535 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index535 * 8) + + let result533 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array534.push(result533) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array537 : Array[String] = []; + for index538 = 0; index538 < (mbt_ffi_load32((iter_base) + 40)); index538 = index538 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index538 * 8) + + let result536 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array537.push(result536) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted540 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result539 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result539) + } + _ => panic() + } + + let lifted543 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted542 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result541 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result541) + } + _ => panic() + } + + Option::Some(lifted542) + } + _ => panic() + } + + array544.push(@common.NamedField::{name : result529, source : lifted530, schema : mbt_ffi_load32((iter_base) + 12), metadata : @types.MetadataEnvelope::{doc : lifted532, aliases : array534, examples : array537, deprecated : lifted540, role : lifted543}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + @common.InputSchema::Parameters(array544) + } + _ => panic() + } + + let lifted547 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @common.OutputSchema::Unit + } + 1 => { + + @common.OutputSchema::Single(mbt_ffi_load32((iter_base) + 52)) + } + _ => panic() + } + + let lifted549 : @common.ReadOnlyConfig? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted548 = match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => { + + @common.CachePolicy::NoCache + } + 1 => { + + @common.CachePolicy::UntilWrite + } + 2 => { + + @common.CachePolicy::Ttl((mbt_ffi_load64((iter_base) + 72)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(@common.ReadOnlyConfig::{cache_policy : lifted548, uses_principal : (mbt_ffi_load8_u((iter_base) + 80) != 0)}) + } + _ => panic() + } + + array550.push(@common.AgentMethod::{name : result503, description : result504, http_endpoint : array525, prompt_hint : lifted528, input_schema : lifted546, output_schema : lifted547, read_only : lifted549}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + array552.push(@common.AgentDependency::{type_name : result274, description : lifted276, schema : @types.SchemaGraph::{type_nodes : array473, defs : array478, root : mbt_ffi_load32((iter_base) + 36)}, constructor_ : @common.AgentConstructor::{name : lifted481, description : result482, prompt_hint : lifted484, input_schema : lifted502}, methods : array550}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 96)) + + let lifted570 : @common.HttpMountDetails? = match mbt_ffi_load8_u((iter_base) + 108) { + 0 => Option::None + 1 => { + + let array558 : Array[@common.PathSegment] = []; + for index559 = 0; index559 < (mbt_ffi_load32((iter_base) + 116)); index559 = index559 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 112)) + (index559 * 12) + + let lifted557 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result554 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::Literal(result554) + } + 1 => { + + @common.PathSegment::SystemVariable(@common.SystemVariable::from(mbt_ffi_load8_u((iter_base) + 4))) + } + 2 => { + + let result555 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::PathVariable(@common.PathVariable::{variable_name : result555}) + } + 3 => { + + let result556 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::RemainingPathVariable(@common.PathVariable::{variable_name : result556}) + } + _ => panic() + } + + array558.push(lifted557) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 112)) + + let lifted560 : @common.AuthDetails? = match mbt_ffi_load8_u((iter_base) + 120) { + 0 => Option::None + 1 => { + + Option::Some(@common.AuthDetails::{required : (mbt_ffi_load8_u((iter_base) + 121) != 0)}) + } + _ => panic() + } + + let array562 : Array[String] = []; + for index563 = 0; index563 < (mbt_ffi_load32((iter_base) + 128)); index563 = index563 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 124)) + (index563 * 8) + + let result561 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array562.push(result561) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 124)) + + let array568 : Array[@common.PathSegment] = []; + for index569 = 0; index569 < (mbt_ffi_load32((iter_base) + 136)); index569 = index569 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 132)) + (index569 * 12) + + let lifted567 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result564 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::Literal(result564) + } + 1 => { + + @common.PathSegment::SystemVariable(@common.SystemVariable::from(mbt_ffi_load8_u((iter_base) + 4))) + } + 2 => { + + let result565 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::PathVariable(@common.PathVariable::{variable_name : result565}) + } + 3 => { + + let result566 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::RemainingPathVariable(@common.PathVariable::{variable_name : result566}) + } + _ => panic() + } + + array568.push(lifted567) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 132)) + + Option::Some(@common.HttpMountDetails::{path_prefix : array558, auth_details : lifted560, phantom_agent : (mbt_ffi_load8_u((iter_base) + 122) != 0), cors_options : @common.CorsOptions::{allowed_patterns : array562}, webhook_suffix : array568}) + } + _ => panic() + } + + let lifted572 = match (mbt_ffi_load8_u((iter_base) + 144)) { + 0 => { + + @common.Snapshotting::Disabled + } + 1 => { + + let lifted571 = match (mbt_ffi_load8_u((iter_base) + 152)) { + 0 => { + + @common.SnapshottingConfig::Default + } + 1 => { + + @common.SnapshottingConfig::Periodic((mbt_ffi_load64((iter_base) + 160)).reinterpret_as_uint64()) + } + 2 => { + + @common.SnapshottingConfig::EveryNInvocation((mbt_ffi_load16_u((iter_base) + 160).land(0xFFFF).reinterpret_as_uint())) + } + _ => panic() + } + + @common.Snapshotting::Enabled(lifted571) + } + _ => panic() + } + + let array576 : Array[@common.AgentConfigDeclaration] = []; + for index577 = 0; index577 < (mbt_ffi_load32((iter_base) + 172)); index577 = index577 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 168)) + (index577 * 16) + + let array574 : Array[String] = []; + for index575 = 0; index575 < (mbt_ffi_load32((iter_base) + 8)); index575 = index575 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index575 * 8) + + let result573 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array574.push(result573) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + array576.push(@common.AgentConfigDeclaration::{source : @common.AgentConfigSource::from(mbt_ffi_load8_u((iter_base) + 0)), path : array574, value_type : mbt_ffi_load32((iter_base) + 12)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 168)) + + array578.push(@common.RegisteredAgentType::{agent_type : @common.AgentType::{type_name : result, description : result0, source_language : result1, schema : @types.SchemaGraph::{type_nodes : array195, defs : array200, root : mbt_ffi_load32((iter_base) + 40)}, constructor_ : @common.AgentConstructor::{name : lifted203, description : result204, prompt_hint : lifted206, input_schema : lifted224}, methods : array272, dependencies : array552, mode : @common.AgentMode::from(mbt_ffi_load8_u((iter_base) + 104)), http_mount : lifted570, snapshotting : lifted572, config : array576}, implemented_by : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 176)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 184)).reinterpret_as_uint64()}}}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array578 + mbt_ffi_free(return_area) + return ret + +} +///| +/// Get a specific registered agent type by name +pub fn get_agent_type(agent_type_name : String) -> @common.RegisteredAgentType? { + + let ptr = mbt_ffi_str2ptr(agent_type_name) + let return_area = mbt_ffi_malloc(200) + wasmImportGetAgentType(ptr, agent_type_name.length(), return_area); + + let lifted578 : @common.RegisteredAgentType? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 16), mbt_ffi_load32((return_area) + 20)) + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 24), mbt_ffi_load32((return_area) + 28)) + + let array195 : Array[@types.SchemaTypeNode] = []; + for index196 = 0; index196 < (mbt_ffi_load32((return_area) + 36)); index196 = index196 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 32)) + (index196 * 144) + + let lifted181 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted7 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted) + } + _ => panic() + } + + let lifted4 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted3 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3) + } + _ => panic() + } + + let lifted6 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result5) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2, max : lifted4, unit : lifted6}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted7) + } + 3 => { + + let lifted14 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted9 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted8 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted8) + } + _ => panic() + } + + let lifted11 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted10 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted10) + } + _ => panic() + } + + let lifted13 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result12 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result12) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted9, max : lifted11, unit : lifted13}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted14) + } + 4 => { + + let lifted21 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted16 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted15 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted15) + } + _ => panic() + } + + let lifted18 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted17 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted17) + } + _ => panic() + } + + let lifted20 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result19) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted16, max : lifted18, unit : lifted20}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted21) + } + 5 => { + + let lifted28 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted23 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted22 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted22) + } + _ => panic() + } + + let lifted25 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted24 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted24) + } + _ => panic() + } + + let lifted27 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result26 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result26) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted23, max : lifted25, unit : lifted27}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted28) + } + 6 => { + + let lifted35 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted30 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted29 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted29) + } + _ => panic() + } + + let lifted32 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted31 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted31) + } + _ => panic() + } + + let lifted34 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result33 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result33) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted30, max : lifted32, unit : lifted34}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted35) + } + 7 => { + + let lifted42 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted37 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted36 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted36) + } + _ => panic() + } + + let lifted39 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted38 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted38) + } + _ => panic() + } + + let lifted41 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result40 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result40) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted37, max : lifted39, unit : lifted41}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted42) + } + 8 => { + + let lifted49 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted44 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted43 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted43) + } + _ => panic() + } + + let lifted46 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted45 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted45) + } + _ => panic() + } + + let lifted48 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result47 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result47) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted44, max : lifted46, unit : lifted48}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted49) + } + 9 => { + + let lifted56 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted51 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted50 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted50) + } + _ => panic() + } + + let lifted53 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted52 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted52) + } + _ => panic() + } + + let lifted55 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result54 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result54) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted51, max : lifted53, unit : lifted55}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted56) + } + 10 => { + + let lifted63 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted58 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted57 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted57) + } + _ => panic() + } + + let lifted60 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted59 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted59) + } + _ => panic() + } + + let lifted62 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result61 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result61) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted58, max : lifted60, unit : lifted62}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted63) + } + 11 => { + + let lifted70 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted65 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted64 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted64) + } + _ => panic() + } + + let lifted67 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted66 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted66) + } + _ => panic() + } + + let lifted69 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result68 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result68) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted65, max : lifted67, unit : lifted69}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted70) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array83 : Array[@types.NamedFieldType] = []; + for index84 = 0; index84 < (mbt_ffi_load32((iter_base) + 12)); index84 = index84 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index84 * 68) + + let result71 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted73 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result72 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result72) + } + _ => panic() + } + + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 28)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index * 8) + + let result74 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result74) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array76 : Array[String] = []; + for index77 = 0; index77 < (mbt_ffi_load32((iter_base) + 36)); index77 = index77 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index77 * 8) + + let result75 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array76.push(result75) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted79 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result78 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result78) + } + _ => panic() + } + + let lifted82 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted81 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result80 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result80) + } + _ => panic() + } + + Option::Some(lifted81) + } + _ => panic() + } + + array83.push(@types.NamedFieldType::{name : result71, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted73, aliases : array, examples : array76, deprecated : lifted79, role : lifted82}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array83) + } + 15 => { + + let array100 : Array[@types.VariantCaseType] = []; + for index101 = 0; index101 < (mbt_ffi_load32((iter_base) + 12)); index101 = index101 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index101 * 72) + + let result85 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted86 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted88 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result87 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result87) + } + _ => panic() + } + + let array90 : Array[String] = []; + for index91 = 0; index91 < (mbt_ffi_load32((iter_base) + 32)); index91 = index91 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index91 * 8) + + let result89 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array90.push(result89) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array93 : Array[String] = []; + for index94 = 0; index94 < (mbt_ffi_load32((iter_base) + 40)); index94 = index94 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index94 * 8) + + let result92 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array93.push(result92) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted96 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result95 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result95) + } + _ => panic() + } + + let lifted99 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted98 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result97 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result97) + } + _ => panic() + } + + Option::Some(lifted98) + } + _ => panic() + } + + array100.push(@types.VariantCaseType::{name : result85, payload : lifted86, metadata : @types.MetadataEnvelope::{doc : lifted88, aliases : array90, examples : array93, deprecated : lifted96, role : lifted99}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array100) + } + 16 => { + + let array103 : Array[String] = []; + for index104 = 0; index104 < (mbt_ffi_load32((iter_base) + 12)); index104 = index104 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index104 * 8) + + let result102 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array103.push(result102) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array103) + } + 17 => { + + let array106 : Array[String] = []; + for index107 = 0; index107 < (mbt_ffi_load32((iter_base) + 12)); index107 = index107 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index107 * 8) + + let result105 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array106.push(result105) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array106) + } + 18 => { + + let array108 : Array[Int] = []; + for index109 = 0; index109 < (mbt_ffi_load32((iter_base) + 12)); index109 = index109 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index109 * 4) + + array108.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array108) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted110 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted111 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted110, err : lifted111}) + } + 24 => { + + let lifted115 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array113 : Array[String] = []; + for index114 = 0; index114 < (mbt_ffi_load32((iter_base) + 16)); index114 = index114 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index114 * 8) + + let result112 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array113.push(result112) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array113) + } + _ => panic() + } + + let lifted116 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted117 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted119 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result118 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result118) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted115, min_length : lifted116, max_length : lifted117, regex : lifted119}) + } + 25 => { + + let lifted123 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array121 : Array[String] = []; + for index122 = 0; index122 < (mbt_ffi_load32((iter_base) + 16)); index122 = index122 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index122 * 8) + + let result120 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array121.push(result120) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array121) + } + _ => panic() + } + + let lifted124 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted125 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted123, min_bytes : lifted124, max_bytes : lifted125}) + } + 26 => { + + let lifted129 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array127 : Array[String] = []; + for index128 = 0; index128 < (mbt_ffi_load32((iter_base) + 20)); index128 = index128 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index128 * 8) + + let result126 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array127.push(result126) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array127) + } + _ => panic() + } + + let lifted133 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array131 : Array[String] = []; + for index132 = 0; index132 < (mbt_ffi_load32((iter_base) + 32)); index132 = index132 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index132 * 8) + + let result130 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array131.push(result130) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array131) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted129, allowed_extensions : lifted133}) + } + 27 => { + + let lifted137 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array135 : Array[String] = []; + for index136 = 0; index136 < (mbt_ffi_load32((iter_base) + 16)); index136 = index136 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index136 * 8) + + let result134 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array135.push(result134) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array135) + } + _ => panic() + } + + let lifted141 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array139 : Array[String] = []; + for index140 = 0; index140 < (mbt_ffi_load32((iter_base) + 28)); index140 = index140 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index140 * 8) + + let result138 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array139.push(result138) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array139) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted137, allowed_hosts : lifted141}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result142 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array144 : Array[String] = []; + for index145 = 0; index145 < (mbt_ffi_load32((iter_base) + 20)); index145 = index145 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index145 * 8) + + let result143 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array144.push(result143) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted147 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result146 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result146}) + } + _ => panic() + } + + let lifted149 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result148 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result148}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result142, allowed_suffixes : array144, min : lifted147, max : lifted149}) + } + 31 => { + + let array173 : Array[@types.UnionBranch] = []; + for index174 = 0; index174 < (mbt_ffi_load32((iter_base) + 12)); index174 = index174 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index174 * 92) + + let result150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted159 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result151 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result151) + } + 1 => { + + let result152 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result152) + } + 2 => { + + let result153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result153) + } + 3 => { + + let result154 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result154) + } + 4 => { + + let result155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted157 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result156 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result156) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result155, literal : lifted157}) + } + 5 => { + + let result158 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result158) + } + _ => panic() + } + + let lifted161 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result160 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result160) + } + _ => panic() + } + + let array163 : Array[String] = []; + for index164 = 0; index164 < (mbt_ffi_load32((iter_base) + 52)); index164 = index164 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index164 * 8) + + let result162 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array163.push(result162) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array166 : Array[String] = []; + for index167 = 0; index167 < (mbt_ffi_load32((iter_base) + 60)); index167 = index167 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index167 * 8) + + let result165 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array166.push(result165) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted169 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result168 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result168) + } + _ => panic() + } + + let lifted172 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted171 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result170 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result170) + } + _ => panic() + } + + Option::Some(lifted171) + } + _ => panic() + } + + array173.push(@types.UnionBranch::{tag : result150, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted159, metadata : @types.MetadataEnvelope::{doc : lifted161, aliases : array163, examples : array166, deprecated : lifted169, role : lifted172}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array173}) + } + 32 => { + + let lifted176 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result175 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result175) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted176}) + } + 33 => { + + let lifted178 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result177 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result177) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted178}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted179 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted179) + } + 36 => { + + let lifted180 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted180) + } + _ => panic() + } + + let lifted183 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result182 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result182) + } + _ => panic() + } + + let array185 : Array[String] = []; + for index186 = 0; index186 < (mbt_ffi_load32((iter_base) + 104)); index186 = index186 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index186 * 8) + + let result184 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array185.push(result184) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array188 : Array[String] = []; + for index189 = 0; index189 < (mbt_ffi_load32((iter_base) + 112)); index189 = index189 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index189 * 8) + + let result187 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array188.push(result187) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted191 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result190 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result190) + } + _ => panic() + } + + let lifted194 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted193 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result192 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result192) + } + _ => panic() + } + + Option::Some(lifted193) + } + _ => panic() + } + + array195.push(@types.SchemaTypeNode::{body : lifted181, metadata : @types.MetadataEnvelope::{doc : lifted183, aliases : array185, examples : array188, deprecated : lifted191, role : lifted194}}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 32)) + + let array200 : Array[@types.SchemaTypeDef] = []; + for index201 = 0; index201 < (mbt_ffi_load32((return_area) + 44)); index201 = index201 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 40)) + (index201 * 24) + + let result197 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted199 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result198 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result198) + } + _ => panic() + } + + array200.push(@types.SchemaTypeDef::{id : result197, name : lifted199, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 40)) + + let lifted203 : String? = match mbt_ffi_load8_u((return_area) + 52) { + 0 => Option::None + 1 => { + + let result202 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 56), mbt_ffi_load32((return_area) + 60)) + + Option::Some(result202) + } + _ => panic() + } + + let result204 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 64), mbt_ffi_load32((return_area) + 68)) + + let lifted206 : String? = match mbt_ffi_load8_u((return_area) + 72) { + 0 => Option::None + 1 => { + + let result205 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 76), mbt_ffi_load32((return_area) + 80)) + + Option::Some(result205) + } + _ => panic() + } + + let lifted224 = match (mbt_ffi_load8_u((return_area) + 84)) { + 0 => { + + let array222 : Array[@common.NamedField] = []; + for index223 = 0; index223 < (mbt_ffi_load32((return_area) + 92)); index223 = index223 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 88)) + (index223 * 72) + + let result207 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted208 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + @common.FieldSource::UserSupplied + } + 1 => { + + @common.FieldSource::AutoInjected(@common.AutoInjectedKind::from(mbt_ffi_load8_u((iter_base) + 9))) + } + _ => panic() + } + + let lifted210 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result209 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result209) + } + _ => panic() + } + + let array212 : Array[String] = []; + for index213 = 0; index213 < (mbt_ffi_load32((iter_base) + 32)); index213 = index213 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index213 * 8) + + let result211 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array212.push(result211) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array215 : Array[String] = []; + for index216 = 0; index216 < (mbt_ffi_load32((iter_base) + 40)); index216 = index216 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index216 * 8) + + let result214 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array215.push(result214) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted218 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result217 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result217) + } + _ => panic() + } + + let lifted221 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted220 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result219 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result219) + } + _ => panic() + } + + Option::Some(lifted220) + } + _ => panic() + } + + array222.push(@common.NamedField::{name : result207, source : lifted208, schema : mbt_ffi_load32((iter_base) + 12), metadata : @types.MetadataEnvelope::{doc : lifted210, aliases : array212, examples : array215, deprecated : lifted218, role : lifted221}}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 88)) + + @common.InputSchema::Parameters(array222) + } + _ => panic() + } + + let array272 : Array[@common.AgentMethod] = []; + for index273 = 0; index273 < (mbt_ffi_load32((return_area) + 100)); index273 = index273 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 96)) + (index273 * 88) + + let result225 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result226 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array247 : Array[@common.HttpEndpointDetails] = []; + for index248 = 0; index248 < (mbt_ffi_load32((iter_base) + 20)); index248 = index248 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index248 * 48) + + let lifted228 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @common.HttpMethod::Get + } + 1 => { + + @common.HttpMethod::Head + } + 2 => { + + @common.HttpMethod::Post + } + 3 => { + + @common.HttpMethod::Put + } + 4 => { + + @common.HttpMethod::Delete + } + 5 => { + + @common.HttpMethod::Connect + } + 6 => { + + @common.HttpMethod::Options + } + 7 => { + + @common.HttpMethod::Trace + } + 8 => { + + @common.HttpMethod::Patch + } + 9 => { + + let result227 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.HttpMethod::Custom(result227) + } + _ => panic() + } + + let array233 : Array[@common.PathSegment] = []; + for index234 = 0; index234 < (mbt_ffi_load32((iter_base) + 16)); index234 = index234 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index234 * 12) + + let lifted232 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result229 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::Literal(result229) + } + 1 => { + + @common.PathSegment::SystemVariable(@common.SystemVariable::from(mbt_ffi_load8_u((iter_base) + 4))) + } + 2 => { + + let result230 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::PathVariable(@common.PathVariable::{variable_name : result230}) + } + 3 => { + + let result231 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::RemainingPathVariable(@common.PathVariable::{variable_name : result231}) + } + _ => panic() + } + + array233.push(lifted232) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + let array237 : Array[@common.HeaderVariable] = []; + for index238 = 0; index238 < (mbt_ffi_load32((iter_base) + 24)); index238 = index238 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index238 * 16) + + let result235 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result236 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array237.push(@common.HeaderVariable::{header_name : result235, variable_name : result236}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + let array241 : Array[@common.QueryVariable] = []; + for index242 = 0; index242 < (mbt_ffi_load32((iter_base) + 32)); index242 = index242 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index242 * 16) + + let result239 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result240 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array241.push(@common.QueryVariable::{query_param_name : result239, variable_name : result240}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let lifted243 : @common.AuthDetails? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + Option::Some(@common.AuthDetails::{required : (mbt_ffi_load8_u((iter_base) + 37) != 0)}) + } + _ => panic() + } + + let array245 : Array[String] = []; + for index246 = 0; index246 < (mbt_ffi_load32((iter_base) + 44)); index246 = index246 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index246 * 8) + + let result244 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array245.push(result244) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + array247.push(@common.HttpEndpointDetails::{http_method : lifted228, path_suffix : array233, header_vars : array237, query_vars : array241, auth_details : lifted243, cors_options : @common.CorsOptions::{allowed_patterns : array245}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted250 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result249 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result249) + } + _ => panic() + } + + let lifted268 = match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => { + + let array266 : Array[@common.NamedField] = []; + for index267 = 0; index267 < (mbt_ffi_load32((iter_base) + 44)); index267 = index267 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index267 * 72) + + let result251 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted252 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + @common.FieldSource::UserSupplied + } + 1 => { + + @common.FieldSource::AutoInjected(@common.AutoInjectedKind::from(mbt_ffi_load8_u((iter_base) + 9))) + } + _ => panic() + } + + let lifted254 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result253 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result253) + } + _ => panic() + } + + let array256 : Array[String] = []; + for index257 = 0; index257 < (mbt_ffi_load32((iter_base) + 32)); index257 = index257 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index257 * 8) + + let result255 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array256.push(result255) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array259 : Array[String] = []; + for index260 = 0; index260 < (mbt_ffi_load32((iter_base) + 40)); index260 = index260 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index260 * 8) + + let result258 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array259.push(result258) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted262 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result261 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result261) + } + _ => panic() + } + + let lifted265 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted264 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result263 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result263) + } + _ => panic() + } + + Option::Some(lifted264) + } + _ => panic() + } + + array266.push(@common.NamedField::{name : result251, source : lifted252, schema : mbt_ffi_load32((iter_base) + 12), metadata : @types.MetadataEnvelope::{doc : lifted254, aliases : array256, examples : array259, deprecated : lifted262, role : lifted265}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + @common.InputSchema::Parameters(array266) + } + _ => panic() + } + + let lifted269 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @common.OutputSchema::Unit + } + 1 => { + + @common.OutputSchema::Single(mbt_ffi_load32((iter_base) + 52)) + } + _ => panic() + } + + let lifted271 : @common.ReadOnlyConfig? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted270 = match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => { + + @common.CachePolicy::NoCache + } + 1 => { + + @common.CachePolicy::UntilWrite + } + 2 => { + + @common.CachePolicy::Ttl((mbt_ffi_load64((iter_base) + 72)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(@common.ReadOnlyConfig::{cache_policy : lifted270, uses_principal : (mbt_ffi_load8_u((iter_base) + 80) != 0)}) + } + _ => panic() + } + + array272.push(@common.AgentMethod::{name : result225, description : result226, http_endpoint : array247, prompt_hint : lifted250, input_schema : lifted268, output_schema : lifted269, read_only : lifted271}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 96)) + + let array552 : Array[@common.AgentDependency] = []; + for index553 = 0; index553 < (mbt_ffi_load32((return_area) + 108)); index553 = index553 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 104)) + (index553 * 92) + + let result274 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted276 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result275 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result275) + } + _ => panic() + } + + let array473 : Array[@types.SchemaTypeNode] = []; + for index474 = 0; index474 < (mbt_ffi_load32((iter_base) + 24)); index474 = index474 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index474 * 144) + + let lifted459 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted283 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted278 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted277 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted277) + } + _ => panic() + } + + let lifted280 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted279 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted279) + } + _ => panic() + } + + let lifted282 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result281 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result281) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted278, max : lifted280, unit : lifted282}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted283) + } + 3 => { + + let lifted290 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted285 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted284 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted284) + } + _ => panic() + } + + let lifted287 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted286 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted286) + } + _ => panic() + } + + let lifted289 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result288 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result288) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted285, max : lifted287, unit : lifted289}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted290) + } + 4 => { + + let lifted297 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted292 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted291 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted291) + } + _ => panic() + } + + let lifted294 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted293 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted293) + } + _ => panic() + } + + let lifted296 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result295 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result295) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted292, max : lifted294, unit : lifted296}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted297) + } + 5 => { + + let lifted304 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted299 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted298 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted298) + } + _ => panic() + } + + let lifted301 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted300 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted300) + } + _ => panic() + } + + let lifted303 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result302 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result302) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted299, max : lifted301, unit : lifted303}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted304) + } + 6 => { + + let lifted311 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted306 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted305 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted305) + } + _ => panic() + } + + let lifted308 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted307 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted307) + } + _ => panic() + } + + let lifted310 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result309 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result309) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted306, max : lifted308, unit : lifted310}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted311) + } + 7 => { + + let lifted318 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted313 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted312 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted312) + } + _ => panic() + } + + let lifted315 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted314 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted314) + } + _ => panic() + } + + let lifted317 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result316 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result316) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted313, max : lifted315, unit : lifted317}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted318) + } + 8 => { + + let lifted325 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted320 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted319 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted319) + } + _ => panic() + } + + let lifted322 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted321 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted321) + } + _ => panic() + } + + let lifted324 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result323 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result323) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted320, max : lifted322, unit : lifted324}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted325) + } + 9 => { + + let lifted332 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted327 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted326 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted326) + } + _ => panic() + } + + let lifted329 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted328 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted328) + } + _ => panic() + } + + let lifted331 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result330 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result330) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted327, max : lifted329, unit : lifted331}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted332) + } + 10 => { + + let lifted339 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted334 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted333 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted333) + } + _ => panic() + } + + let lifted336 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted335 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted335) + } + _ => panic() + } + + let lifted338 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result337 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result337) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted334, max : lifted336, unit : lifted338}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted339) + } + 11 => { + + let lifted346 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted341 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted340 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted340) + } + _ => panic() + } + + let lifted343 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted342 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted342) + } + _ => panic() + } + + let lifted345 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result344 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result344) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted341, max : lifted343, unit : lifted345}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted346) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array361 : Array[@types.NamedFieldType] = []; + for index362 = 0; index362 < (mbt_ffi_load32((iter_base) + 12)); index362 = index362 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index362 * 68) + + let result347 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted349 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result348 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result348) + } + _ => panic() + } + + let array351 : Array[String] = []; + for index352 = 0; index352 < (mbt_ffi_load32((iter_base) + 28)); index352 = index352 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index352 * 8) + + let result350 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array351.push(result350) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array354 : Array[String] = []; + for index355 = 0; index355 < (mbt_ffi_load32((iter_base) + 36)); index355 = index355 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index355 * 8) + + let result353 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array354.push(result353) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted357 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result356 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result356) + } + _ => panic() + } + + let lifted360 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted359 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result358 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result358) + } + _ => panic() + } + + Option::Some(lifted359) + } + _ => panic() + } + + array361.push(@types.NamedFieldType::{name : result347, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted349, aliases : array351, examples : array354, deprecated : lifted357, role : lifted360}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array361) + } + 15 => { + + let array378 : Array[@types.VariantCaseType] = []; + for index379 = 0; index379 < (mbt_ffi_load32((iter_base) + 12)); index379 = index379 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index379 * 72) + + let result363 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted364 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted366 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result365 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result365) + } + _ => panic() + } + + let array368 : Array[String] = []; + for index369 = 0; index369 < (mbt_ffi_load32((iter_base) + 32)); index369 = index369 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index369 * 8) + + let result367 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array368.push(result367) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array371 : Array[String] = []; + for index372 = 0; index372 < (mbt_ffi_load32((iter_base) + 40)); index372 = index372 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index372 * 8) + + let result370 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array371.push(result370) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted374 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result373 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result373) + } + _ => panic() + } + + let lifted377 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted376 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result375 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result375) + } + _ => panic() + } + + Option::Some(lifted376) + } + _ => panic() + } + + array378.push(@types.VariantCaseType::{name : result363, payload : lifted364, metadata : @types.MetadataEnvelope::{doc : lifted366, aliases : array368, examples : array371, deprecated : lifted374, role : lifted377}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array378) + } + 16 => { + + let array381 : Array[String] = []; + for index382 = 0; index382 < (mbt_ffi_load32((iter_base) + 12)); index382 = index382 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index382 * 8) + + let result380 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array381.push(result380) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array381) + } + 17 => { + + let array384 : Array[String] = []; + for index385 = 0; index385 < (mbt_ffi_load32((iter_base) + 12)); index385 = index385 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index385 * 8) + + let result383 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array384.push(result383) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array384) + } + 18 => { + + let array386 : Array[Int] = []; + for index387 = 0; index387 < (mbt_ffi_load32((iter_base) + 12)); index387 = index387 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index387 * 4) + + array386.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array386) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted388 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted389 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted388, err : lifted389}) + } + 24 => { + + let lifted393 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array391 : Array[String] = []; + for index392 = 0; index392 < (mbt_ffi_load32((iter_base) + 16)); index392 = index392 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index392 * 8) + + let result390 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array391.push(result390) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array391) + } + _ => panic() + } + + let lifted394 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted395 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted397 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result396 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result396) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted393, min_length : lifted394, max_length : lifted395, regex : lifted397}) + } + 25 => { + + let lifted401 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array399 : Array[String] = []; + for index400 = 0; index400 < (mbt_ffi_load32((iter_base) + 16)); index400 = index400 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index400 * 8) + + let result398 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array399.push(result398) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array399) + } + _ => panic() + } + + let lifted402 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted403 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted401, min_bytes : lifted402, max_bytes : lifted403}) + } + 26 => { + + let lifted407 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array405 : Array[String] = []; + for index406 = 0; index406 < (mbt_ffi_load32((iter_base) + 20)); index406 = index406 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index406 * 8) + + let result404 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array405.push(result404) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array405) + } + _ => panic() + } + + let lifted411 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array409 : Array[String] = []; + for index410 = 0; index410 < (mbt_ffi_load32((iter_base) + 32)); index410 = index410 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index410 * 8) + + let result408 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array409.push(result408) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array409) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted407, allowed_extensions : lifted411}) + } + 27 => { + + let lifted415 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array413 : Array[String] = []; + for index414 = 0; index414 < (mbt_ffi_load32((iter_base) + 16)); index414 = index414 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index414 * 8) + + let result412 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array413.push(result412) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array413) + } + _ => panic() + } + + let lifted419 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array417 : Array[String] = []; + for index418 = 0; index418 < (mbt_ffi_load32((iter_base) + 28)); index418 = index418 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index418 * 8) + + let result416 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array417.push(result416) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array417) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted415, allowed_hosts : lifted419}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result420 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array422 : Array[String] = []; + for index423 = 0; index423 < (mbt_ffi_load32((iter_base) + 20)); index423 = index423 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index423 * 8) + + let result421 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array422.push(result421) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted425 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result424 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result424}) + } + _ => panic() + } + + let lifted427 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result426 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result426}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result420, allowed_suffixes : array422, min : lifted425, max : lifted427}) + } + 31 => { + + let array451 : Array[@types.UnionBranch] = []; + for index452 = 0; index452 < (mbt_ffi_load32((iter_base) + 12)); index452 = index452 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index452 * 92) + + let result428 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted437 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result429 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result429) + } + 1 => { + + let result430 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result430) + } + 2 => { + + let result431 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result431) + } + 3 => { + + let result432 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result432) + } + 4 => { + + let result433 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted435 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result434 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result434) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result433, literal : lifted435}) + } + 5 => { + + let result436 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result436) + } + _ => panic() + } + + let lifted439 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result438 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result438) + } + _ => panic() + } + + let array441 : Array[String] = []; + for index442 = 0; index442 < (mbt_ffi_load32((iter_base) + 52)); index442 = index442 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index442 * 8) + + let result440 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array441.push(result440) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array444 : Array[String] = []; + for index445 = 0; index445 < (mbt_ffi_load32((iter_base) + 60)); index445 = index445 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index445 * 8) + + let result443 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array444.push(result443) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted447 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result446 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result446) + } + _ => panic() + } + + let lifted450 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted449 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result448 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result448) + } + _ => panic() + } + + Option::Some(lifted449) + } + _ => panic() + } + + array451.push(@types.UnionBranch::{tag : result428, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted437, metadata : @types.MetadataEnvelope::{doc : lifted439, aliases : array441, examples : array444, deprecated : lifted447, role : lifted450}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array451}) + } + 32 => { + + let lifted454 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result453 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result453) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted454}) + } + 33 => { + + let lifted456 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result455 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result455) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted456}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted457 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted457) + } + 36 => { + + let lifted458 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted458) + } + _ => panic() + } + + let lifted461 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result460 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result460) + } + _ => panic() + } + + let array463 : Array[String] = []; + for index464 = 0; index464 < (mbt_ffi_load32((iter_base) + 104)); index464 = index464 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index464 * 8) + + let result462 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array463.push(result462) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array466 : Array[String] = []; + for index467 = 0; index467 < (mbt_ffi_load32((iter_base) + 112)); index467 = index467 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index467 * 8) + + let result465 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array466.push(result465) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted469 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result468 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result468) + } + _ => panic() + } + + let lifted472 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted471 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result470 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result470) + } + _ => panic() + } + + Option::Some(lifted471) + } + _ => panic() + } + + array473.push(@types.SchemaTypeNode::{body : lifted459, metadata : @types.MetadataEnvelope::{doc : lifted461, aliases : array463, examples : array466, deprecated : lifted469, role : lifted472}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + let array478 : Array[@types.SchemaTypeDef] = []; + for index479 = 0; index479 < (mbt_ffi_load32((iter_base) + 32)); index479 = index479 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index479 * 24) + + let result475 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted477 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result476 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result476) + } + _ => panic() + } + + array478.push(@types.SchemaTypeDef::{id : result475, name : lifted477, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let lifted481 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result480 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result480) + } + _ => panic() + } + + let result482 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) + + let lifted484 : String? = match mbt_ffi_load8_u((iter_base) + 60) { + 0 => Option::None + 1 => { + + let result483 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + Option::Some(result483) + } + _ => panic() + } + + let lifted502 = match (mbt_ffi_load8_u((iter_base) + 72)) { + 0 => { + + let array500 : Array[@common.NamedField] = []; + for index501 = 0; index501 < (mbt_ffi_load32((iter_base) + 80)); index501 = index501 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 76)) + (index501 * 72) + + let result485 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted486 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + @common.FieldSource::UserSupplied + } + 1 => { + + @common.FieldSource::AutoInjected(@common.AutoInjectedKind::from(mbt_ffi_load8_u((iter_base) + 9))) + } + _ => panic() + } + + let lifted488 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result487 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result487) + } + _ => panic() + } + + let array490 : Array[String] = []; + for index491 = 0; index491 < (mbt_ffi_load32((iter_base) + 32)); index491 = index491 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index491 * 8) + + let result489 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array490.push(result489) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array493 : Array[String] = []; + for index494 = 0; index494 < (mbt_ffi_load32((iter_base) + 40)); index494 = index494 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index494 * 8) + + let result492 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array493.push(result492) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted496 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result495 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result495) + } + _ => panic() + } + + let lifted499 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted498 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result497 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result497) + } + _ => panic() + } + + Option::Some(lifted498) + } + _ => panic() + } + + array500.push(@common.NamedField::{name : result485, source : lifted486, schema : mbt_ffi_load32((iter_base) + 12), metadata : @types.MetadataEnvelope::{doc : lifted488, aliases : array490, examples : array493, deprecated : lifted496, role : lifted499}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + @common.InputSchema::Parameters(array500) + } + _ => panic() + } + + let array550 : Array[@common.AgentMethod] = []; + for index551 = 0; index551 < (mbt_ffi_load32((iter_base) + 88)); index551 = index551 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 84)) + (index551 * 88) + + let result503 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result504 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array525 : Array[@common.HttpEndpointDetails] = []; + for index526 = 0; index526 < (mbt_ffi_load32((iter_base) + 20)); index526 = index526 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index526 * 48) + + let lifted506 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @common.HttpMethod::Get + } + 1 => { + + @common.HttpMethod::Head + } + 2 => { + + @common.HttpMethod::Post + } + 3 => { + + @common.HttpMethod::Put + } + 4 => { + + @common.HttpMethod::Delete + } + 5 => { + + @common.HttpMethod::Connect + } + 6 => { + + @common.HttpMethod::Options + } + 7 => { + + @common.HttpMethod::Trace + } + 8 => { + + @common.HttpMethod::Patch + } + 9 => { + + let result505 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.HttpMethod::Custom(result505) + } + _ => panic() + } + + let array511 : Array[@common.PathSegment] = []; + for index512 = 0; index512 < (mbt_ffi_load32((iter_base) + 16)); index512 = index512 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index512 * 12) + + let lifted510 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result507 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::Literal(result507) + } + 1 => { + + @common.PathSegment::SystemVariable(@common.SystemVariable::from(mbt_ffi_load8_u((iter_base) + 4))) + } + 2 => { + + let result508 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::PathVariable(@common.PathVariable::{variable_name : result508}) + } + 3 => { + + let result509 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::RemainingPathVariable(@common.PathVariable::{variable_name : result509}) + } + _ => panic() + } + + array511.push(lifted510) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + let array515 : Array[@common.HeaderVariable] = []; + for index516 = 0; index516 < (mbt_ffi_load32((iter_base) + 24)); index516 = index516 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index516 * 16) + + let result513 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result514 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array515.push(@common.HeaderVariable::{header_name : result513, variable_name : result514}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + let array519 : Array[@common.QueryVariable] = []; + for index520 = 0; index520 < (mbt_ffi_load32((iter_base) + 32)); index520 = index520 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index520 * 16) + + let result517 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result518 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array519.push(@common.QueryVariable::{query_param_name : result517, variable_name : result518}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let lifted521 : @common.AuthDetails? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + Option::Some(@common.AuthDetails::{required : (mbt_ffi_load8_u((iter_base) + 37) != 0)}) + } + _ => panic() + } + + let array523 : Array[String] = []; + for index524 = 0; index524 < (mbt_ffi_load32((iter_base) + 44)); index524 = index524 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index524 * 8) + + let result522 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array523.push(result522) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + array525.push(@common.HttpEndpointDetails::{http_method : lifted506, path_suffix : array511, header_vars : array515, query_vars : array519, auth_details : lifted521, cors_options : @common.CorsOptions::{allowed_patterns : array523}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted528 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result527 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result527) + } + _ => panic() + } + + let lifted546 = match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => { + + let array544 : Array[@common.NamedField] = []; + for index545 = 0; index545 < (mbt_ffi_load32((iter_base) + 44)); index545 = index545 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index545 * 72) + + let result529 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted530 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + @common.FieldSource::UserSupplied + } + 1 => { + + @common.FieldSource::AutoInjected(@common.AutoInjectedKind::from(mbt_ffi_load8_u((iter_base) + 9))) + } + _ => panic() + } + + let lifted532 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result531 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result531) + } + _ => panic() + } + + let array534 : Array[String] = []; + for index535 = 0; index535 < (mbt_ffi_load32((iter_base) + 32)); index535 = index535 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index535 * 8) + + let result533 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array534.push(result533) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array537 : Array[String] = []; + for index538 = 0; index538 < (mbt_ffi_load32((iter_base) + 40)); index538 = index538 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index538 * 8) + + let result536 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array537.push(result536) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted540 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result539 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result539) + } + _ => panic() + } + + let lifted543 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted542 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result541 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result541) + } + _ => panic() + } + + Option::Some(lifted542) + } + _ => panic() + } + + array544.push(@common.NamedField::{name : result529, source : lifted530, schema : mbt_ffi_load32((iter_base) + 12), metadata : @types.MetadataEnvelope::{doc : lifted532, aliases : array534, examples : array537, deprecated : lifted540, role : lifted543}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + @common.InputSchema::Parameters(array544) + } + _ => panic() + } + + let lifted547 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @common.OutputSchema::Unit + } + 1 => { + + @common.OutputSchema::Single(mbt_ffi_load32((iter_base) + 52)) + } + _ => panic() + } + + let lifted549 : @common.ReadOnlyConfig? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted548 = match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => { + + @common.CachePolicy::NoCache + } + 1 => { + + @common.CachePolicy::UntilWrite + } + 2 => { + + @common.CachePolicy::Ttl((mbt_ffi_load64((iter_base) + 72)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(@common.ReadOnlyConfig::{cache_policy : lifted548, uses_principal : (mbt_ffi_load8_u((iter_base) + 80) != 0)}) + } + _ => panic() + } + + array550.push(@common.AgentMethod::{name : result503, description : result504, http_endpoint : array525, prompt_hint : lifted528, input_schema : lifted546, output_schema : lifted547, read_only : lifted549}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + array552.push(@common.AgentDependency::{type_name : result274, description : lifted276, schema : @types.SchemaGraph::{type_nodes : array473, defs : array478, root : mbt_ffi_load32((iter_base) + 36)}, constructor_ : @common.AgentConstructor::{name : lifted481, description : result482, prompt_hint : lifted484, input_schema : lifted502}, methods : array550}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 104)) + + let lifted570 : @common.HttpMountDetails? = match mbt_ffi_load8_u((return_area) + 116) { + 0 => Option::None + 1 => { + + let array558 : Array[@common.PathSegment] = []; + for index559 = 0; index559 < (mbt_ffi_load32((return_area) + 124)); index559 = index559 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 120)) + (index559 * 12) + + let lifted557 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result554 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::Literal(result554) + } + 1 => { + + @common.PathSegment::SystemVariable(@common.SystemVariable::from(mbt_ffi_load8_u((iter_base) + 4))) + } + 2 => { + + let result555 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::PathVariable(@common.PathVariable::{variable_name : result555}) + } + 3 => { + + let result556 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::RemainingPathVariable(@common.PathVariable::{variable_name : result556}) + } + _ => panic() + } + + array558.push(lifted557) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 120)) + + let lifted560 : @common.AuthDetails? = match mbt_ffi_load8_u((return_area) + 128) { + 0 => Option::None + 1 => { + + Option::Some(@common.AuthDetails::{required : (mbt_ffi_load8_u((return_area) + 129) != 0)}) + } + _ => panic() + } + + let array562 : Array[String] = []; + for index563 = 0; index563 < (mbt_ffi_load32((return_area) + 136)); index563 = index563 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 132)) + (index563 * 8) + + let result561 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array562.push(result561) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 132)) + + let array568 : Array[@common.PathSegment] = []; + for index569 = 0; index569 < (mbt_ffi_load32((return_area) + 144)); index569 = index569 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 140)) + (index569 * 12) + + let lifted567 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result564 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::Literal(result564) + } + 1 => { + + @common.PathSegment::SystemVariable(@common.SystemVariable::from(mbt_ffi_load8_u((iter_base) + 4))) + } + 2 => { + + let result565 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::PathVariable(@common.PathVariable::{variable_name : result565}) + } + 3 => { + + let result566 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.PathSegment::RemainingPathVariable(@common.PathVariable::{variable_name : result566}) + } + _ => panic() + } + + array568.push(lifted567) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 140)) + + Option::Some(@common.HttpMountDetails::{path_prefix : array558, auth_details : lifted560, phantom_agent : (mbt_ffi_load8_u((return_area) + 130) != 0), cors_options : @common.CorsOptions::{allowed_patterns : array562}, webhook_suffix : array568}) + } + _ => panic() + } + + let lifted572 = match (mbt_ffi_load8_u((return_area) + 152)) { + 0 => { + + @common.Snapshotting::Disabled + } + 1 => { + + let lifted571 = match (mbt_ffi_load8_u((return_area) + 160)) { + 0 => { + + @common.SnapshottingConfig::Default + } + 1 => { + + @common.SnapshottingConfig::Periodic((mbt_ffi_load64((return_area) + 168)).reinterpret_as_uint64()) + } + 2 => { + + @common.SnapshottingConfig::EveryNInvocation((mbt_ffi_load16_u((return_area) + 168).land(0xFFFF).reinterpret_as_uint())) + } + _ => panic() + } + + @common.Snapshotting::Enabled(lifted571) + } + _ => panic() + } + + let array576 : Array[@common.AgentConfigDeclaration] = []; + for index577 = 0; index577 < (mbt_ffi_load32((return_area) + 180)); index577 = index577 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 176)) + (index577 * 16) + + let array574 : Array[String] = []; + for index575 = 0; index575 < (mbt_ffi_load32((iter_base) + 8)); index575 = index575 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index575 * 8) + + let result573 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array574.push(result573) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + array576.push(@common.AgentConfigDeclaration::{source : @common.AgentConfigSource::from(mbt_ffi_load8_u((iter_base) + 0)), path : array574, value_type : mbt_ffi_load32((iter_base) + 12)}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 176)) + + Option::Some(@common.RegisteredAgentType::{agent_type : @common.AgentType::{type_name : result, description : result0, source_language : result1, schema : @types.SchemaGraph::{type_nodes : array195, defs : array200, root : mbt_ffi_load32((return_area) + 48)}, constructor_ : @common.AgentConstructor::{name : lifted203, description : result204, prompt_hint : lifted206, input_schema : lifted224}, methods : array272, dependencies : array552, mode : @common.AgentMode::from(mbt_ffi_load8_u((return_area) + 112)), http_mount : lifted570, snapshotting : lifted572, config : array576}, implemented_by : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 184)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 192)).reinterpret_as_uint64()}}}) + } + _ => panic() + } + let ret = lifted578 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} +///| +/// Constructs a string agent-id from the agent type and its constructor parameters +/// and an optional phantom ID. +/// +/// `input` is a value tree whose root encodes the constructor's parameter list. +pub fn make_agent_id(agent_type_name : String, input : @types.SchemaValueTree, phantom_id : @types.Uuid?) -> Result[String, @common.AgentError] { + let cleanup_list : Array[Int] = [] + + let ptr = mbt_ffi_str2ptr(agent_type_name) + + let address68 = mbt_ffi_malloc(((input).value_nodes).length() * 32); + for index69 = 0; index69 < ((input).value_nodes).length(); index69 = index69 + 1 { + let iter_elem : @types.SchemaValueNode = ((input).value_nodes)[(index69)] + let iter_base = address68 + (index69 * 32); + + match iter_elem { + BoolValue(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) + + () + } + S8Value(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) + + () + } + S16Value(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) + + () + } + S32Value(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) + + () + } + S64Value(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload3) + + () + } + U8Value(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload4).to_int()) + + () + } + U16Value(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload5).reinterpret_as_int()) + + () + } + U32Value(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload6).reinterpret_as_int()) + + () + } + U64Value(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload7).reinterpret_as_int64()) + + () + } + F32Value(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload8) + + () + } + F64Value(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload9) + + () + } + CharValue(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload10).to_int()) + + () + } + StringValue(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) + + let ptr12 = mbt_ffi_str2ptr(payload11) + mbt_ffi_store32((iter_base) + 12, payload11.length()) + mbt_ffi_store32((iter_base) + 8, ptr12) + cleanup_list.push(ptr12) + + () + } + RecordValue(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let address = mbt_ffi_malloc((payload13).length() * 4); + for index = 0; index < (payload13).length(); index = index + 1 { + let iter_elem : Int = (payload13)[(index)] + let iter_base = address + (index * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload13).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + VariantValue(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload14).case).reinterpret_as_int()) + + match ((payload14).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload16) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload16) + + () + } + } + + () + } + EnumValue(payload17) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload17).reinterpret_as_int()) + + () + } + FlagsValue(payload18) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address19 = mbt_ffi_malloc((payload18).length() * 1); + for index20 = 0; index20 < (payload18).length(); index20 = index20 + 1 { + let iter_elem : Bool = (payload18)[(index20)] + let iter_base = address19 + (index20 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload18).length()) + mbt_ffi_store32((iter_base) + 8, address19) + cleanup_list.push(address19) + + () + } + TupleValue(payload21) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address22 = mbt_ffi_malloc((payload21).length() * 4); + for index23 = 0; index23 < (payload21).length(); index23 = index23 + 1 { + let iter_elem : Int = (payload21)[(index23)] + let iter_base = address22 + (index23 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload21).length()) + mbt_ffi_store32((iter_base) + 8, address22) + cleanup_list.push(address22) + + () + } + ListValue(payload24) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address25 = mbt_ffi_malloc((payload24).length() * 4); + for index26 = 0; index26 < (payload24).length(); index26 = index26 + 1 { + let iter_elem : Int = (payload24)[(index26)] + let iter_base = address25 + (index26 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload24).length()) + mbt_ffi_store32((iter_base) + 8, address25) + cleanup_list.push(address25) + + () + } + FixedListValue(payload27) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address28 = mbt_ffi_malloc((payload27).length() * 4); + for index29 = 0; index29 < (payload27).length(); index29 = index29 + 1 { + let iter_elem : Int = (payload27)[(index29)] + let iter_base = address28 + (index29 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload27).length()) + mbt_ffi_store32((iter_base) + 8, address28) + cleanup_list.push(address28) + + () + } + MapValue(payload30) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let address31 = mbt_ffi_malloc((payload30).length() * 8); + for index32 = 0; index32 < (payload30).length(); index32 = index32 + 1 { + let iter_elem : @types.MapEntry = (payload30)[(index32)] + let iter_base = address31 + (index32 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload30).length()) + mbt_ffi_store32((iter_base) + 8, address31) + cleanup_list.push(address31) + + () + } + OptionValue(payload33) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + match (payload33) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload35) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload35) + + () + } + } + + () + } + ResultValue(payload36) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload36 { + OkValue(payload37) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload37) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload39) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload39) + + () + } + } + + () + } + ErrValue(payload40) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload40) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload42) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload42) + + () + } + } + + () + } + } + + () + } + TextValue(payload43) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr44 = mbt_ffi_str2ptr((payload43).text) + mbt_ffi_store32((iter_base) + 12, (payload43).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) + + match ((payload43).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload46) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr47 = mbt_ffi_str2ptr(payload46) + mbt_ffi_store32((iter_base) + 24, payload46.length()) + mbt_ffi_store32((iter_base) + 20, ptr47) + cleanup_list.push(ptr47) + + () + } + } + cleanup_list.push(ptr44) + + () + } + BinaryValue(payload48) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr49 = mbt_ffi_bytes2ptr((payload48).bytes) + + mbt_ffi_store32((iter_base) + 12, (payload48).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) + + match ((payload48).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload51) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr52 = mbt_ffi_str2ptr(payload51) + mbt_ffi_store32((iter_base) + 24, payload51.length()) + mbt_ffi_store32((iter_base) + 20, ptr52) + cleanup_list.push(ptr52) + + () + } + } + cleanup_list.push(ptr49) + + () + } + PathValue(payload53) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr54 = mbt_ffi_str2ptr(payload53) + mbt_ffi_store32((iter_base) + 12, payload53.length()) + mbt_ffi_store32((iter_base) + 8, ptr54) + cleanup_list.push(ptr54) + + () + } + UrlValue(payload55) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr56 = mbt_ffi_str2ptr(payload55) + mbt_ffi_store32((iter_base) + 12, payload55.length()) + mbt_ffi_store32((iter_base) + 8, ptr56) + cleanup_list.push(ptr56) + + () + } + DatetimeValue(payload57) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload57).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload57).nanoseconds).reinterpret_as_int()) + + () + } + DurationValue(payload58) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload58).nanoseconds) + + () + } + QuantityValueNode(payload59) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload59).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload59).scale) + + let ptr60 = mbt_ffi_str2ptr((payload59).unit) + mbt_ffi_store32((iter_base) + 24, (payload59).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr60) + cleanup_list.push(ptr60) + + () + } + UnionValue(payload61) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr62 = mbt_ffi_str2ptr((payload61).tag) + mbt_ffi_store32((iter_base) + 12, (payload61).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr62) + mbt_ffi_store32((iter_base) + 16, (payload61).body) + cleanup_list.push(ptr62) + + () + } + SecretValue(payload63) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let @types.Secret(handle) = payload63 + mbt_ffi_store32((iter_base) + 8, handle) + + () + } + QuotaTokenHandle(payload64) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let @types.QuotaToken(handle65) = payload64 + mbt_ffi_store32((iter_base) + 8, handle65) + + () + } + PermissionCardHandle(payload66) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let @types.PermissionCard(handle67) = payload66 + mbt_ffi_store32((iter_base) + 8, handle67) + + () + } + } + + } + + let (lowered, lowered72, lowered73) = match (phantom_id) { + None => { + + ((0), 0L, 0L) + } + Some(payload71) => { + + ((1), ((payload71).high_bits).reinterpret_as_int64(), ((payload71).low_bits).reinterpret_as_int64()) + } + } + let return_area = mbt_ffi_malloc(40) + wasmImportMakeAgentId(ptr, agent_type_name.length(), address68, ((input).value_nodes).length(), (input).root, lowered, lowered72, lowered73, return_area); + + let lifted311 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Ok(result) + } + 1 => { + + let lifted310 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result74 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + @common.AgentError::InvalidInput(result74) + } + 1 => { + + let result75 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + @common.AgentError::InvalidMethod(result75) + } + 2 => { + + let result76 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + @common.AgentError::InvalidType(result76) + } + 3 => { + + let result77 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + @common.AgentError::InvalidAgentId(result77) + } + 4 => { + + let array272 : Array[@types.SchemaTypeNode] = []; + for index273 = 0; index273 < (mbt_ffi_load32((return_area) + 12)); index273 = index273 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 8)) + (index273 * 144) + + let lifted258 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted83 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted78 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted) + } + _ => panic() + } + + let lifted80 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted79 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted79) + } + _ => panic() + } + + let lifted82 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result81 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result81) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted78, max : lifted80, unit : lifted82}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted83) + } + 3 => { + + let lifted90 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted85 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted84 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted84) + } + _ => panic() + } + + let lifted87 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted86 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted86) + } + _ => panic() + } + + let lifted89 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result88 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result88) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted85, max : lifted87, unit : lifted89}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted90) + } + 4 => { + + let lifted97 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted92 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted91 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted91) + } + _ => panic() + } + + let lifted94 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted93 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted93) + } + _ => panic() + } + + let lifted96 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result95 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result95) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted92, max : lifted94, unit : lifted96}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted97) + } + 5 => { + + let lifted104 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted99 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted98 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted98) + } + _ => panic() + } + + let lifted101 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted100 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted100) + } + _ => panic() + } + + let lifted103 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result102 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result102) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted99, max : lifted101, unit : lifted103}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted104) + } + 6 => { + + let lifted111 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted106 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted105 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted105) + } + _ => panic() + } + + let lifted108 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted107 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted107) + } + _ => panic() + } + + let lifted110 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result109 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result109) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted106, max : lifted108, unit : lifted110}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted111) + } + 7 => { + + let lifted118 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted113 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted112 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted112) + } + _ => panic() + } + + let lifted115 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted114 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted114) + } + _ => panic() + } + + let lifted117 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result116 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result116) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted113, max : lifted115, unit : lifted117}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted118) + } + 8 => { + + let lifted125 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted120 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted119 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted119) + } + _ => panic() + } + + let lifted122 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted121 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted121) + } + _ => panic() + } + + let lifted124 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result123 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result123) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted120, max : lifted122, unit : lifted124}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted125) + } + 9 => { + + let lifted132 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted127 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted126 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted126) + } + _ => panic() + } + + let lifted129 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted128 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted128) + } + _ => panic() + } + + let lifted131 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result130 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result130) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted127, max : lifted129, unit : lifted131}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted132) + } + 10 => { + + let lifted139 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted134 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted133 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted133) + } + _ => panic() + } + + let lifted136 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted135 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted135) + } + _ => panic() + } + + let lifted138 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result137 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result137) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted134, max : lifted136, unit : lifted138}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted139) + } + 11 => { + + let lifted146 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted141 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted140 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted140) + } + _ => panic() + } + + let lifted143 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted142 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted142) + } + _ => panic() + } + + let lifted145 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result144 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result144) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted141, max : lifted143, unit : lifted145}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted146) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array160 : Array[@types.NamedFieldType] = []; + for index161 = 0; index161 < (mbt_ffi_load32((iter_base) + 12)); index161 = index161 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index161 * 68) + + let result147 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted149 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result148 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result148) + } + _ => panic() + } + + let array : Array[String] = []; + for index151 = 0; index151 < (mbt_ffi_load32((iter_base) + 28)); index151 = index151 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index151 * 8) + + let result150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result150) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array153 : Array[String] = []; + for index154 = 0; index154 < (mbt_ffi_load32((iter_base) + 36)); index154 = index154 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index154 * 8) + + let result152 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array153.push(result152) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted156 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result155) + } + _ => panic() + } + + let lifted159 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted158 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result157 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result157) + } + _ => panic() + } + + Option::Some(lifted158) + } + _ => panic() + } + + array160.push(@types.NamedFieldType::{name : result147, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted149, aliases : array, examples : array153, deprecated : lifted156, role : lifted159}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array160) + } + 15 => { + + let array177 : Array[@types.VariantCaseType] = []; + for index178 = 0; index178 < (mbt_ffi_load32((iter_base) + 12)); index178 = index178 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index178 * 72) + + let result162 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted163 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted165 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result164 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result164) + } + _ => panic() + } + + let array167 : Array[String] = []; + for index168 = 0; index168 < (mbt_ffi_load32((iter_base) + 32)); index168 = index168 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index168 * 8) + + let result166 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array167.push(result166) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array170 : Array[String] = []; + for index171 = 0; index171 < (mbt_ffi_load32((iter_base) + 40)); index171 = index171 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index171 * 8) + + let result169 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array170.push(result169) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted173 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result172 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result172) + } + _ => panic() + } + + let lifted176 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted175 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result174 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result174) + } + _ => panic() + } + + Option::Some(lifted175) + } + _ => panic() + } + + array177.push(@types.VariantCaseType::{name : result162, payload : lifted163, metadata : @types.MetadataEnvelope::{doc : lifted165, aliases : array167, examples : array170, deprecated : lifted173, role : lifted176}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array177) + } + 16 => { + + let array180 : Array[String] = []; + for index181 = 0; index181 < (mbt_ffi_load32((iter_base) + 12)); index181 = index181 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index181 * 8) + + let result179 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array180.push(result179) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array180) + } + 17 => { + + let array183 : Array[String] = []; + for index184 = 0; index184 < (mbt_ffi_load32((iter_base) + 12)); index184 = index184 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index184 * 8) + + let result182 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array183.push(result182) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array183) + } + 18 => { + + let array185 : Array[Int] = []; + for index186 = 0; index186 < (mbt_ffi_load32((iter_base) + 12)); index186 = index186 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index186 * 4) + + array185.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array185) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted187 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted188 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted187, err : lifted188}) + } + 24 => { + + let lifted192 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array190 : Array[String] = []; + for index191 = 0; index191 < (mbt_ffi_load32((iter_base) + 16)); index191 = index191 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index191 * 8) + + let result189 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array190.push(result189) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array190) + } + _ => panic() + } + + let lifted193 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted194 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted196 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result195 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result195) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted192, min_length : lifted193, max_length : lifted194, regex : lifted196}) + } + 25 => { + + let lifted200 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array198 : Array[String] = []; + for index199 = 0; index199 < (mbt_ffi_load32((iter_base) + 16)); index199 = index199 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index199 * 8) + + let result197 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array198.push(result197) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array198) + } + _ => panic() + } + + let lifted201 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted202 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted200, min_bytes : lifted201, max_bytes : lifted202}) + } + 26 => { + + let lifted206 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array204 : Array[String] = []; + for index205 = 0; index205 < (mbt_ffi_load32((iter_base) + 20)); index205 = index205 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index205 * 8) + + let result203 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array204.push(result203) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array204) + } + _ => panic() + } + + let lifted210 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array208 : Array[String] = []; + for index209 = 0; index209 < (mbt_ffi_load32((iter_base) + 32)); index209 = index209 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index209 * 8) + + let result207 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array208.push(result207) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array208) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted206, allowed_extensions : lifted210}) + } + 27 => { + + let lifted214 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array212 : Array[String] = []; + for index213 = 0; index213 < (mbt_ffi_load32((iter_base) + 16)); index213 = index213 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index213 * 8) + + let result211 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array212.push(result211) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array212) + } + _ => panic() + } + + let lifted218 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array216 : Array[String] = []; + for index217 = 0; index217 < (mbt_ffi_load32((iter_base) + 28)); index217 = index217 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index217 * 8) + + let result215 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array216.push(result215) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array216) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted214, allowed_hosts : lifted218}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result219 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array221 : Array[String] = []; + for index222 = 0; index222 < (mbt_ffi_load32((iter_base) + 20)); index222 = index222 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index222 * 8) + + let result220 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array221.push(result220) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted224 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result223 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result223}) + } + _ => panic() + } + + let lifted226 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result225 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result225}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result219, allowed_suffixes : array221, min : lifted224, max : lifted226}) + } + 31 => { + + let array250 : Array[@types.UnionBranch] = []; + for index251 = 0; index251 < (mbt_ffi_load32((iter_base) + 12)); index251 = index251 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index251 * 92) + + let result227 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted236 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result228 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result228) + } + 1 => { + + let result229 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result229) + } + 2 => { + + let result230 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result230) + } + 3 => { + + let result231 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result231) + } + 4 => { + + let result232 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted234 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result233 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result233) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result232, literal : lifted234}) + } + 5 => { + + let result235 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result235) + } + _ => panic() + } + + let lifted238 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result237 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result237) + } + _ => panic() + } + + let array240 : Array[String] = []; + for index241 = 0; index241 < (mbt_ffi_load32((iter_base) + 52)); index241 = index241 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index241 * 8) + + let result239 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array240.push(result239) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array243 : Array[String] = []; + for index244 = 0; index244 < (mbt_ffi_load32((iter_base) + 60)); index244 = index244 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index244 * 8) + + let result242 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array243.push(result242) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted246 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result245 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result245) + } + _ => panic() + } + + let lifted249 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted248 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result247 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result247) + } + _ => panic() + } + + Option::Some(lifted248) + } + _ => panic() + } + + array250.push(@types.UnionBranch::{tag : result227, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted236, metadata : @types.MetadataEnvelope::{doc : lifted238, aliases : array240, examples : array243, deprecated : lifted246, role : lifted249}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array250}) + } + 32 => { + + let lifted253 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result252 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result252) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted253}) + } + 33 => { + + let lifted255 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result254 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result254) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted255}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted256 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted256) + } + 36 => { + + let lifted257 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted257) + } + _ => panic() + } + + let lifted260 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result259 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result259) + } + _ => panic() + } + + let array262 : Array[String] = []; + for index263 = 0; index263 < (mbt_ffi_load32((iter_base) + 104)); index263 = index263 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index263 * 8) + + let result261 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array262.push(result261) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array265 : Array[String] = []; + for index266 = 0; index266 < (mbt_ffi_load32((iter_base) + 112)); index266 = index266 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index266 * 8) + + let result264 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array265.push(result264) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted268 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result267 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result267) + } + _ => panic() + } + + let lifted271 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted270 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result269 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result269) + } + _ => panic() + } + + Option::Some(lifted270) + } + _ => panic() + } + + array272.push(@types.SchemaTypeNode::{body : lifted258, metadata : @types.MetadataEnvelope::{doc : lifted260, aliases : array262, examples : array265, deprecated : lifted268, role : lifted271}}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 8)) + + let array277 : Array[@types.SchemaTypeDef] = []; + for index278 = 0; index278 < (mbt_ffi_load32((return_area) + 20)); index278 = index278 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 16)) + (index278 * 24) + + let result274 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted276 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result275 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result275) + } + _ => panic() + } + + array277.push(@types.SchemaTypeDef::{id : result274, name : lifted276, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 16)) + + let array308 : Array[@types.SchemaValueNode] = []; + for index309 = 0; index309 < (mbt_ffi_load32((return_area) + 32)); index309 = index309 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 28)) + (index309 * 32) + + let lifted307 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result279 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result279) + } + 13 => { + + let array280 : Array[Int] = []; + for index281 = 0; index281 < (mbt_ffi_load32((iter_base) + 12)); index281 = index281 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index281 * 4) + + array280.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array280) + } + 14 => { + + let lifted282 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted282}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array283 : Array[Bool] = []; + for index284 = 0; index284 < (mbt_ffi_load32((iter_base) + 12)); index284 = index284 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index284 * 1) + + array283.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array283) + } + 17 => { + + let array285 : Array[Int] = []; + for index286 = 0; index286 < (mbt_ffi_load32((iter_base) + 12)); index286 = index286 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index286 * 4) + + array285.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array285) + } + 18 => { + + let array287 : Array[Int] = []; + for index288 = 0; index288 < (mbt_ffi_load32((iter_base) + 12)); index288 = index288 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index288 * 4) + + array287.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array287) + } + 19 => { + + let array289 : Array[Int] = []; + for index290 = 0; index290 < (mbt_ffi_load32((iter_base) + 12)); index290 = index290 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index290 * 4) + + array289.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array289) + } + 20 => { + + let array291 : Array[@types.MapEntry] = []; + for index292 = 0; index292 < (mbt_ffi_load32((iter_base) + 12)); index292 = index292 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index292 * 8) + + array291.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array291) + } + 21 => { + + let lifted293 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted293) + } + 22 => { + + let lifted296 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted294 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted294) + } + 1 => { + + let lifted295 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted295) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted296) + } + 23 => { + + let result297 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted299 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result298 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result298) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result297, language : lifted299}) + } + 24 => { + + let result300 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted302 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result301 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result301) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result300, mime_type : lifted302}) + } + 25 => { + + let result303 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result303) + } + 26 => { + + let result304 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result304) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result305 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result305}) + } + 30 => { + + let result306 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result306, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array308.push(lifted307) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 28)) + + @common.AgentError::CustomError(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array272, defs : array277, root : mbt_ffi_load32((return_area) + 24)}, value : @types.SchemaValueTree::{value_nodes : array308, root : mbt_ffi_load32((return_area) + 36)}}) + } + _ => panic() + } + + Result::Err(lifted310) + } + _ => panic() + } + let ret = lifted311 + mbt_ffi_free(ptr) + mbt_ffi_free(address68) + mbt_ffi_free(return_area) + + cleanup_list.each(mbt_ffi_free) + return ret + +} +///| +/// Parses an agent-id (created by `make-agent-id`) into an agent type name and its constructor parameters +/// and an optional phantom ID. +/// +/// The constructor parameters are returned as a self-contained typed value +/// (graph + value tree) so the receiver can interpret them without an +/// external schema registry. +pub fn parse_agent_id(agent_id : String) -> Result[(String, @types.TypedSchemaValue, @types.Uuid?), @common.AgentError] { + + let ptr = mbt_ffi_str2ptr(agent_id) + let return_area = mbt_ffi_malloc(72) + wasmImportParseAgentId(ptr, agent_id.length(), return_area); + + let lifted471 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + let array193 : Array[@types.SchemaTypeNode] = []; + for index194 = 0; index194 < (mbt_ffi_load32((return_area) + 20)); index194 = index194 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 16)) + (index194 * 144) + + let lifted179 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted5 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted0 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted) + } + _ => panic() + } + + let lifted2 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1) + } + _ => panic() + } + + let lifted4 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result3) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted0, max : lifted2, unit : lifted4}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted5) + } + 3 => { + + let lifted12 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted7 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted6 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted6) + } + _ => panic() + } + + let lifted9 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted8 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted8) + } + _ => panic() + } + + let lifted11 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result10 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result10) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted7, max : lifted9, unit : lifted11}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted12) + } + 4 => { + + let lifted19 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted14 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted13 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted13) + } + _ => panic() + } + + let lifted16 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted15 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted15) + } + _ => panic() + } + + let lifted18 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result17 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result17) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted14, max : lifted16, unit : lifted18}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted19) + } + 5 => { + + let lifted26 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted21 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted20 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted20) + } + _ => panic() + } + + let lifted23 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted22 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted22) + } + _ => panic() + } + + let lifted25 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result24 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result24) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted21, max : lifted23, unit : lifted25}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted26) + } + 6 => { + + let lifted33 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted28 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted27 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted27) + } + _ => panic() + } + + let lifted30 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted29 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted29) + } + _ => panic() + } + + let lifted32 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result31 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result31) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted28, max : lifted30, unit : lifted32}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted33) + } + 7 => { + + let lifted40 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted35 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted34 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted34) + } + _ => panic() + } + + let lifted37 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted36 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted36) + } + _ => panic() + } + + let lifted39 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result38 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result38) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted35, max : lifted37, unit : lifted39}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted40) + } + 8 => { + + let lifted47 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted42 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted41 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted41) + } + _ => panic() + } + + let lifted44 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted43 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted43) + } + _ => panic() + } + + let lifted46 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result45 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result45) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted42, max : lifted44, unit : lifted46}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted47) + } + 9 => { + + let lifted54 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted49 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted48 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted48) + } + _ => panic() + } + + let lifted51 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted50 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted50) + } + _ => panic() + } + + let lifted53 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result52 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result52) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted49, max : lifted51, unit : lifted53}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted54) + } + 10 => { + + let lifted61 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted56 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted55 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted55) + } + _ => panic() + } + + let lifted58 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted57 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted57) + } + _ => panic() + } + + let lifted60 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result59 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result59) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted56, max : lifted58, unit : lifted60}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted61) + } + 11 => { + + let lifted68 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted63 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted62 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted62) + } + _ => panic() + } + + let lifted65 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted64 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted64) + } + _ => panic() + } + + let lifted67 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result66 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result66) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted63, max : lifted65, unit : lifted67}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted68) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array81 : Array[@types.NamedFieldType] = []; + for index82 = 0; index82 < (mbt_ffi_load32((iter_base) + 12)); index82 = index82 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index82 * 68) + + let result69 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted71 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result70 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result70) + } + _ => panic() + } + + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 28)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index * 8) + + let result72 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result72) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array74 : Array[String] = []; + for index75 = 0; index75 < (mbt_ffi_load32((iter_base) + 36)); index75 = index75 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index75 * 8) + + let result73 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array74.push(result73) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted77 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result76 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result76) + } + _ => panic() + } + + let lifted80 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted79 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result78 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result78) + } + _ => panic() + } + + Option::Some(lifted79) + } + _ => panic() + } + + array81.push(@types.NamedFieldType::{name : result69, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted71, aliases : array, examples : array74, deprecated : lifted77, role : lifted80}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array81) + } + 15 => { + + let array98 : Array[@types.VariantCaseType] = []; + for index99 = 0; index99 < (mbt_ffi_load32((iter_base) + 12)); index99 = index99 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index99 * 72) + + let result83 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted84 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted86 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result85 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result85) + } + _ => panic() + } + + let array88 : Array[String] = []; + for index89 = 0; index89 < (mbt_ffi_load32((iter_base) + 32)); index89 = index89 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index89 * 8) + + let result87 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array88.push(result87) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array91 : Array[String] = []; + for index92 = 0; index92 < (mbt_ffi_load32((iter_base) + 40)); index92 = index92 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index92 * 8) + + let result90 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array91.push(result90) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted94 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result93 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result93) + } + _ => panic() + } + + let lifted97 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted96 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result95 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result95) + } + _ => panic() + } + + Option::Some(lifted96) + } + _ => panic() + } + + array98.push(@types.VariantCaseType::{name : result83, payload : lifted84, metadata : @types.MetadataEnvelope::{doc : lifted86, aliases : array88, examples : array91, deprecated : lifted94, role : lifted97}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array98) + } + 16 => { + + let array101 : Array[String] = []; + for index102 = 0; index102 < (mbt_ffi_load32((iter_base) + 12)); index102 = index102 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index102 * 8) + + let result100 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array101.push(result100) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array101) + } + 17 => { + + let array104 : Array[String] = []; + for index105 = 0; index105 < (mbt_ffi_load32((iter_base) + 12)); index105 = index105 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index105 * 8) + + let result103 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array104.push(result103) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array104) + } + 18 => { + + let array106 : Array[Int] = []; + for index107 = 0; index107 < (mbt_ffi_load32((iter_base) + 12)); index107 = index107 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index107 * 4) + + array106.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array106) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted108 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted109 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted108, err : lifted109}) + } + 24 => { + + let lifted113 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array111 : Array[String] = []; + for index112 = 0; index112 < (mbt_ffi_load32((iter_base) + 16)); index112 = index112 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index112 * 8) + + let result110 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array111.push(result110) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array111) + } + _ => panic() + } + + let lifted114 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted115 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted117 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result116 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result116) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted113, min_length : lifted114, max_length : lifted115, regex : lifted117}) + } + 25 => { + + let lifted121 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array119 : Array[String] = []; + for index120 = 0; index120 < (mbt_ffi_load32((iter_base) + 16)); index120 = index120 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index120 * 8) + + let result118 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array119.push(result118) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array119) + } + _ => panic() + } + + let lifted122 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted123 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted121, min_bytes : lifted122, max_bytes : lifted123}) + } + 26 => { + + let lifted127 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array125 : Array[String] = []; + for index126 = 0; index126 < (mbt_ffi_load32((iter_base) + 20)); index126 = index126 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index126 * 8) + + let result124 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array125.push(result124) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array125) + } + _ => panic() + } + + let lifted131 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array129 : Array[String] = []; + for index130 = 0; index130 < (mbt_ffi_load32((iter_base) + 32)); index130 = index130 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index130 * 8) + + let result128 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array129.push(result128) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array129) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted127, allowed_extensions : lifted131}) + } + 27 => { + + let lifted135 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array133 : Array[String] = []; + for index134 = 0; index134 < (mbt_ffi_load32((iter_base) + 16)); index134 = index134 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index134 * 8) + + let result132 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array133.push(result132) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array133) + } + _ => panic() + } + + let lifted139 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array137 : Array[String] = []; + for index138 = 0; index138 < (mbt_ffi_load32((iter_base) + 28)); index138 = index138 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index138 * 8) + + let result136 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array137.push(result136) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array137) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted135, allowed_hosts : lifted139}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result140 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array142 : Array[String] = []; + for index143 = 0; index143 < (mbt_ffi_load32((iter_base) + 20)); index143 = index143 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index143 * 8) + + let result141 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array142.push(result141) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted145 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result144 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result144}) + } + _ => panic() + } + + let lifted147 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result146 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result146}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result140, allowed_suffixes : array142, min : lifted145, max : lifted147}) + } + 31 => { + + let array171 : Array[@types.UnionBranch] = []; + for index172 = 0; index172 < (mbt_ffi_load32((iter_base) + 12)); index172 = index172 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index172 * 92) + + let result148 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted157 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result149 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result149) + } + 1 => { + + let result150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result150) + } + 2 => { + + let result151 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result151) + } + 3 => { + + let result152 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result152) + } + 4 => { + + let result153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted155 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result154 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result154) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result153, literal : lifted155}) + } + 5 => { + + let result156 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result156) + } + _ => panic() + } + + let lifted159 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result158 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result158) + } + _ => panic() + } + + let array161 : Array[String] = []; + for index162 = 0; index162 < (mbt_ffi_load32((iter_base) + 52)); index162 = index162 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index162 * 8) + + let result160 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array161.push(result160) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array164 : Array[String] = []; + for index165 = 0; index165 < (mbt_ffi_load32((iter_base) + 60)); index165 = index165 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index165 * 8) + + let result163 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array164.push(result163) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted167 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result166 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result166) + } + _ => panic() + } + + let lifted170 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted169 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result168 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result168) + } + _ => panic() + } + + Option::Some(lifted169) + } + _ => panic() + } + + array171.push(@types.UnionBranch::{tag : result148, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted157, metadata : @types.MetadataEnvelope::{doc : lifted159, aliases : array161, examples : array164, deprecated : lifted167, role : lifted170}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array171}) + } + 32 => { + + let lifted174 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result173 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result173) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted174}) + } + 33 => { + + let lifted176 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result175 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result175) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted176}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted177 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted177) + } + 36 => { + + let lifted178 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted178) + } + _ => panic() + } + + let lifted181 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result180 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result180) + } + _ => panic() + } + + let array183 : Array[String] = []; + for index184 = 0; index184 < (mbt_ffi_load32((iter_base) + 104)); index184 = index184 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index184 * 8) + + let result182 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array183.push(result182) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array186 : Array[String] = []; + for index187 = 0; index187 < (mbt_ffi_load32((iter_base) + 112)); index187 = index187 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index187 * 8) + + let result185 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array186.push(result185) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted189 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result188 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result188) + } + _ => panic() + } + + let lifted192 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted191 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result190 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result190) + } + _ => panic() + } + + Option::Some(lifted191) + } + _ => panic() + } + + array193.push(@types.SchemaTypeNode::{body : lifted179, metadata : @types.MetadataEnvelope::{doc : lifted181, aliases : array183, examples : array186, deprecated : lifted189, role : lifted192}}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 16)) + + let array198 : Array[@types.SchemaTypeDef] = []; + for index199 = 0; index199 < (mbt_ffi_load32((return_area) + 28)); index199 = index199 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 24)) + (index199 * 24) + + let result195 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted197 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result196 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result196) + } + _ => panic() + } + + array198.push(@types.SchemaTypeDef::{id : result195, name : lifted197, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 24)) + + let array229 : Array[@types.SchemaValueNode] = []; + for index230 = 0; index230 < (mbt_ffi_load32((return_area) + 40)); index230 = index230 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 36)) + (index230 * 32) + + let lifted228 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result200 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result200) + } + 13 => { + + let array201 : Array[Int] = []; + for index202 = 0; index202 < (mbt_ffi_load32((iter_base) + 12)); index202 = index202 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index202 * 4) + + array201.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array201) + } + 14 => { + + let lifted203 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted203}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array204 : Array[Bool] = []; + for index205 = 0; index205 < (mbt_ffi_load32((iter_base) + 12)); index205 = index205 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index205 * 1) + + array204.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array204) + } + 17 => { + + let array206 : Array[Int] = []; + for index207 = 0; index207 < (mbt_ffi_load32((iter_base) + 12)); index207 = index207 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index207 * 4) + + array206.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array206) + } + 18 => { + + let array208 : Array[Int] = []; + for index209 = 0; index209 < (mbt_ffi_load32((iter_base) + 12)); index209 = index209 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index209 * 4) + + array208.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array208) + } + 19 => { + + let array210 : Array[Int] = []; + for index211 = 0; index211 < (mbt_ffi_load32((iter_base) + 12)); index211 = index211 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index211 * 4) + + array210.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array210) + } + 20 => { + + let array212 : Array[@types.MapEntry] = []; + for index213 = 0; index213 < (mbt_ffi_load32((iter_base) + 12)); index213 = index213 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index213 * 8) + + array212.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array212) + } + 21 => { + + let lifted214 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted214) + } + 22 => { + + let lifted217 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted215 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted215) + } + 1 => { + + let lifted216 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted216) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted217) + } + 23 => { + + let result218 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted220 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result219 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result219) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result218, language : lifted220}) + } + 24 => { + + let result221 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted223 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result222 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result222) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result221, mime_type : lifted223}) + } + 25 => { + + let result224 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result224) + } + 26 => { + + let result225 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result225) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result226 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result226}) + } + 30 => { + + let result227 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result227, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array229.push(lifted228) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 36)) + + let lifted231 : @types.Uuid? = match mbt_ffi_load8_u((return_area) + 48) { + 0 => Option::None + 1 => { + + Option::Some(@types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 56)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 64)).reinterpret_as_uint64()}) + } + _ => panic() + } + + Result::Ok((result, @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array193, defs : array198, root : mbt_ffi_load32((return_area) + 32)}, value : @types.SchemaValueTree::{value_nodes : array229, root : mbt_ffi_load32((return_area) + 44)}}, lifted231)) + } + 1 => { + + let lifted470 = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { + + let result232 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + @common.AgentError::InvalidInput(result232) + } + 1 => { + + let result233 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + @common.AgentError::InvalidMethod(result233) + } + 2 => { + + let result234 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + @common.AgentError::InvalidType(result234) + } + 3 => { + + let result235 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + @common.AgentError::InvalidAgentId(result235) + } + 4 => { + + let array432 : Array[@types.SchemaTypeNode] = []; + for index433 = 0; index433 < (mbt_ffi_load32((return_area) + 16)); index433 = index433 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 12)) + (index433 * 144) + + let lifted418 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted242 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted237 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted236 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted236) + } + _ => panic() + } + + let lifted239 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted238 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted238) + } + _ => panic() + } + + let lifted241 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result240 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result240) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted237, max : lifted239, unit : lifted241}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted242) + } + 3 => { + + let lifted249 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted244 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted243 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted243) + } + _ => panic() + } + + let lifted246 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted245 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted245) + } + _ => panic() + } + + let lifted248 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result247 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result247) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted244, max : lifted246, unit : lifted248}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted249) + } + 4 => { + + let lifted256 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted251 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted250 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted250) + } + _ => panic() + } + + let lifted253 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted252 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted252) + } + _ => panic() + } + + let lifted255 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result254 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result254) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted251, max : lifted253, unit : lifted255}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted256) + } + 5 => { + + let lifted263 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted258 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted257 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted257) + } + _ => panic() + } + + let lifted260 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted259 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted259) + } + _ => panic() + } + + let lifted262 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result261 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result261) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted258, max : lifted260, unit : lifted262}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted263) + } + 6 => { + + let lifted270 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted265 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted264 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted264) + } + _ => panic() + } + + let lifted267 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted266 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted266) + } + _ => panic() + } + + let lifted269 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result268 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result268) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted265, max : lifted267, unit : lifted269}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted270) + } + 7 => { + + let lifted277 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted272 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted271 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted271) + } + _ => panic() + } + + let lifted274 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted273 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted273) + } + _ => panic() + } + + let lifted276 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result275 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result275) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted272, max : lifted274, unit : lifted276}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted277) + } + 8 => { + + let lifted284 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted279 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted278 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted278) + } + _ => panic() + } + + let lifted281 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted280 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted280) + } + _ => panic() + } + + let lifted283 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result282 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result282) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted279, max : lifted281, unit : lifted283}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted284) + } + 9 => { + + let lifted291 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted286 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted285 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted285) + } + _ => panic() + } + + let lifted288 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted287 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted287) + } + _ => panic() + } + + let lifted290 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result289 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result289) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted286, max : lifted288, unit : lifted290}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted291) + } + 10 => { + + let lifted298 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted293 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted292 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted292) + } + _ => panic() + } + + let lifted295 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted294 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted294) + } + _ => panic() + } + + let lifted297 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result296 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result296) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted293, max : lifted295, unit : lifted297}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted298) + } + 11 => { + + let lifted305 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted300 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted299 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted299) + } + _ => panic() + } + + let lifted302 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted301 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted301) + } + _ => panic() + } + + let lifted304 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result303 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result303) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted300, max : lifted302, unit : lifted304}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted305) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array320 : Array[@types.NamedFieldType] = []; + for index321 = 0; index321 < (mbt_ffi_load32((iter_base) + 12)); index321 = index321 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index321 * 68) + + let result306 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted308 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result307 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result307) + } + _ => panic() + } + + let array310 : Array[String] = []; + for index311 = 0; index311 < (mbt_ffi_load32((iter_base) + 28)); index311 = index311 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index311 * 8) + + let result309 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array310.push(result309) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array313 : Array[String] = []; + for index314 = 0; index314 < (mbt_ffi_load32((iter_base) + 36)); index314 = index314 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index314 * 8) + + let result312 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array313.push(result312) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted316 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result315 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result315) + } + _ => panic() + } + + let lifted319 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted318 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result317 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result317) + } + _ => panic() + } + + Option::Some(lifted318) + } + _ => panic() + } + + array320.push(@types.NamedFieldType::{name : result306, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted308, aliases : array310, examples : array313, deprecated : lifted316, role : lifted319}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array320) + } + 15 => { + + let array337 : Array[@types.VariantCaseType] = []; + for index338 = 0; index338 < (mbt_ffi_load32((iter_base) + 12)); index338 = index338 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index338 * 72) + + let result322 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted323 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted325 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result324 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result324) + } + _ => panic() + } + + let array327 : Array[String] = []; + for index328 = 0; index328 < (mbt_ffi_load32((iter_base) + 32)); index328 = index328 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index328 * 8) + + let result326 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array327.push(result326) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array330 : Array[String] = []; + for index331 = 0; index331 < (mbt_ffi_load32((iter_base) + 40)); index331 = index331 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index331 * 8) + + let result329 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array330.push(result329) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted333 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result332 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result332) + } + _ => panic() + } + + let lifted336 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted335 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result334 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result334) + } + _ => panic() + } + + Option::Some(lifted335) + } + _ => panic() + } + + array337.push(@types.VariantCaseType::{name : result322, payload : lifted323, metadata : @types.MetadataEnvelope::{doc : lifted325, aliases : array327, examples : array330, deprecated : lifted333, role : lifted336}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array337) + } + 16 => { + + let array340 : Array[String] = []; + for index341 = 0; index341 < (mbt_ffi_load32((iter_base) + 12)); index341 = index341 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index341 * 8) + + let result339 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array340.push(result339) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array340) + } + 17 => { + + let array343 : Array[String] = []; + for index344 = 0; index344 < (mbt_ffi_load32((iter_base) + 12)); index344 = index344 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index344 * 8) + + let result342 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array343.push(result342) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array343) + } + 18 => { + + let array345 : Array[Int] = []; + for index346 = 0; index346 < (mbt_ffi_load32((iter_base) + 12)); index346 = index346 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index346 * 4) + + array345.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array345) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted347 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted348 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted347, err : lifted348}) + } + 24 => { + + let lifted352 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array350 : Array[String] = []; + for index351 = 0; index351 < (mbt_ffi_load32((iter_base) + 16)); index351 = index351 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index351 * 8) + + let result349 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array350.push(result349) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array350) + } + _ => panic() + } + + let lifted353 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted354 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted356 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result355 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result355) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted352, min_length : lifted353, max_length : lifted354, regex : lifted356}) + } + 25 => { + + let lifted360 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array358 : Array[String] = []; + for index359 = 0; index359 < (mbt_ffi_load32((iter_base) + 16)); index359 = index359 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index359 * 8) + + let result357 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array358.push(result357) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array358) + } + _ => panic() + } + + let lifted361 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted362 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted360, min_bytes : lifted361, max_bytes : lifted362}) + } + 26 => { + + let lifted366 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array364 : Array[String] = []; + for index365 = 0; index365 < (mbt_ffi_load32((iter_base) + 20)); index365 = index365 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index365 * 8) + + let result363 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array364.push(result363) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array364) + } + _ => panic() + } + + let lifted370 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array368 : Array[String] = []; + for index369 = 0; index369 < (mbt_ffi_load32((iter_base) + 32)); index369 = index369 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index369 * 8) + + let result367 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array368.push(result367) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array368) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted366, allowed_extensions : lifted370}) + } + 27 => { + + let lifted374 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array372 : Array[String] = []; + for index373 = 0; index373 < (mbt_ffi_load32((iter_base) + 16)); index373 = index373 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index373 * 8) + + let result371 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array372.push(result371) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array372) + } + _ => panic() + } + + let lifted378 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array376 : Array[String] = []; + for index377 = 0; index377 < (mbt_ffi_load32((iter_base) + 28)); index377 = index377 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index377 * 8) + + let result375 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array376.push(result375) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array376) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted374, allowed_hosts : lifted378}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result379 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array381 : Array[String] = []; + for index382 = 0; index382 < (mbt_ffi_load32((iter_base) + 20)); index382 = index382 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index382 * 8) + + let result380 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array381.push(result380) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted384 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result383 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result383}) + } + _ => panic() + } + + let lifted386 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result385 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result385}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result379, allowed_suffixes : array381, min : lifted384, max : lifted386}) + } + 31 => { + + let array410 : Array[@types.UnionBranch] = []; + for index411 = 0; index411 < (mbt_ffi_load32((iter_base) + 12)); index411 = index411 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index411 * 92) + + let result387 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted396 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result388 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result388) + } + 1 => { + + let result389 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result389) + } + 2 => { + + let result390 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result390) + } + 3 => { + + let result391 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result391) + } + 4 => { + + let result392 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted394 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result393 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result393) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result392, literal : lifted394}) + } + 5 => { + + let result395 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result395) + } + _ => panic() + } + + let lifted398 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result397 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result397) + } + _ => panic() + } + + let array400 : Array[String] = []; + for index401 = 0; index401 < (mbt_ffi_load32((iter_base) + 52)); index401 = index401 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index401 * 8) + + let result399 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array400.push(result399) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array403 : Array[String] = []; + for index404 = 0; index404 < (mbt_ffi_load32((iter_base) + 60)); index404 = index404 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index404 * 8) + + let result402 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array403.push(result402) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted406 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result405 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result405) + } + _ => panic() + } + + let lifted409 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted408 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result407 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result407) + } + _ => panic() + } + + Option::Some(lifted408) + } + _ => panic() + } + + array410.push(@types.UnionBranch::{tag : result387, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted396, metadata : @types.MetadataEnvelope::{doc : lifted398, aliases : array400, examples : array403, deprecated : lifted406, role : lifted409}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array410}) + } + 32 => { + + let lifted413 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result412 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result412) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted413}) + } + 33 => { + + let lifted415 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result414 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result414) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted415}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted416 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted416) + } + 36 => { + + let lifted417 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted417) + } + _ => panic() + } + + let lifted420 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result419 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result419) + } + _ => panic() + } + + let array422 : Array[String] = []; + for index423 = 0; index423 < (mbt_ffi_load32((iter_base) + 104)); index423 = index423 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index423 * 8) + + let result421 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array422.push(result421) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array425 : Array[String] = []; + for index426 = 0; index426 < (mbt_ffi_load32((iter_base) + 112)); index426 = index426 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index426 * 8) + + let result424 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array425.push(result424) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted428 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result427 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result427) + } + _ => panic() + } + + let lifted431 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted430 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result429 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result429) + } + _ => panic() + } + + Option::Some(lifted430) + } + _ => panic() + } + + array432.push(@types.SchemaTypeNode::{body : lifted418, metadata : @types.MetadataEnvelope::{doc : lifted420, aliases : array422, examples : array425, deprecated : lifted428, role : lifted431}}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 12)) + + let array437 : Array[@types.SchemaTypeDef] = []; + for index438 = 0; index438 < (mbt_ffi_load32((return_area) + 24)); index438 = index438 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 20)) + (index438 * 24) + + let result434 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted436 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result435 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result435) + } + _ => panic() + } + + array437.push(@types.SchemaTypeDef::{id : result434, name : lifted436, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 20)) + + let array468 : Array[@types.SchemaValueNode] = []; + for index469 = 0; index469 < (mbt_ffi_load32((return_area) + 36)); index469 = index469 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 32)) + (index469 * 32) + + let lifted467 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result439 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result439) + } + 13 => { + + let array440 : Array[Int] = []; + for index441 = 0; index441 < (mbt_ffi_load32((iter_base) + 12)); index441 = index441 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index441 * 4) + + array440.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array440) + } + 14 => { + + let lifted442 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted442}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array443 : Array[Bool] = []; + for index444 = 0; index444 < (mbt_ffi_load32((iter_base) + 12)); index444 = index444 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index444 * 1) + + array443.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array443) + } + 17 => { + + let array445 : Array[Int] = []; + for index446 = 0; index446 < (mbt_ffi_load32((iter_base) + 12)); index446 = index446 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index446 * 4) + + array445.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array445) + } + 18 => { + + let array447 : Array[Int] = []; + for index448 = 0; index448 < (mbt_ffi_load32((iter_base) + 12)); index448 = index448 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index448 * 4) + + array447.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array447) + } + 19 => { + + let array449 : Array[Int] = []; + for index450 = 0; index450 < (mbt_ffi_load32((iter_base) + 12)); index450 = index450 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index450 * 4) + + array449.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array449) + } + 20 => { + + let array451 : Array[@types.MapEntry] = []; + for index452 = 0; index452 < (mbt_ffi_load32((iter_base) + 12)); index452 = index452 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index452 * 8) + + array451.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array451) + } + 21 => { + + let lifted453 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted453) + } + 22 => { + + let lifted456 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted454 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted454) + } + 1 => { + + let lifted455 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted455) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted456) + } + 23 => { + + let result457 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted459 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result458 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result458) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result457, language : lifted459}) + } + 24 => { + + let result460 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted462 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result461 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result461) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result460, mime_type : lifted462}) + } + 25 => { + + let result463 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result463) + } + 26 => { + + let result464 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result464) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result465 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result465}) + } + 30 => { + + let result466 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result466, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array468.push(lifted467) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 32)) + + @common.AgentError::CustomError(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array432, defs : array437, root : mbt_ffi_load32((return_area) + 28)}, value : @types.SchemaValueTree::{value_nodes : array468, root : mbt_ffi_load32((return_area) + 40)}}) + } + _ => panic() + } + + Result::Err(lifted470) + } + _ => panic() + } + let ret = lifted471 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} +///| +/// Creates a webhook that can be used to integrate with webhook driven apis. +/// When the created url is called with a post request, the provided promise-id is completed with the body of the post request. +/// Note the following behaviours: +/// * Only agents whoose agent types are _currently_ deployed via an http api are allowed to create a webhook. Calling this function while the agent +/// is not deployed via an http api will trap. +/// * Only the agent type that created the promise is allowed to create a webhook for it. Using this host function +/// from a different agent type will trap. +pub fn create_webhook(promise_id : @types.PromiseId) -> String { + + let ptr = mbt_ffi_str2ptr(((promise_id).agent_id).agent_id) + let return_area = mbt_ffi_malloc(8) + wasmImportCreateWebhook((((((promise_id).agent_id).component_id).uuid).high_bits).reinterpret_as_int64(), (((((promise_id).agent_id).component_id).uuid).low_bits).reinterpret_as_int64(), ptr, ((promise_id).agent_id).agent_id.length(), ((promise_id).oplog_idx).reinterpret_as_int64(), return_area); + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 0), mbt_ffi_load32((return_area) + 4)) + let ret = result + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} +///| +/// Constructs the RPC client connecting to the given target agent. +/// +/// `constructor` is a value tree whose root encodes the target agent +/// constructor's parameter list. +pub fn WasmRpc::wasm_rpc(agent_type_name : String, constructor_ : @types.SchemaValueTree, phantom_id : @types.Uuid?, agent_config : Array[@common.TypedAgentConfigValue]) -> WasmRpc { + let cleanup_list : Array[Int] = [] + + let ptr = mbt_ffi_str2ptr(agent_type_name) + + let address68 = mbt_ffi_malloc(((constructor_).value_nodes).length() * 32); + for index69 = 0; index69 < ((constructor_).value_nodes).length(); index69 = index69 + 1 { + let iter_elem : @types.SchemaValueNode = ((constructor_).value_nodes)[(index69)] + let iter_base = address68 + (index69 * 32); + + match iter_elem { + BoolValue(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) + + () + } + S8Value(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) + + () + } + S16Value(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) + + () + } + S32Value(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) + + () + } + S64Value(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload3) + + () + } + U8Value(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload4).to_int()) + + () + } + U16Value(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload5).reinterpret_as_int()) + + () + } + U32Value(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload6).reinterpret_as_int()) + + () + } + U64Value(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload7).reinterpret_as_int64()) + + () + } + F32Value(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload8) + + () + } + F64Value(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload9) + + () + } + CharValue(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload10).to_int()) + + () + } + StringValue(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) + + let ptr12 = mbt_ffi_str2ptr(payload11) + mbt_ffi_store32((iter_base) + 12, payload11.length()) + mbt_ffi_store32((iter_base) + 8, ptr12) + cleanup_list.push(ptr12) + + () + } + RecordValue(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let address = mbt_ffi_malloc((payload13).length() * 4); + for index = 0; index < (payload13).length(); index = index + 1 { + let iter_elem : Int = (payload13)[(index)] + let iter_base = address + (index * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload13).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + VariantValue(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload14).case).reinterpret_as_int()) + + match ((payload14).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload16) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload16) + + () + } + } + + () + } + EnumValue(payload17) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload17).reinterpret_as_int()) + + () + } + FlagsValue(payload18) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address19 = mbt_ffi_malloc((payload18).length() * 1); + for index20 = 0; index20 < (payload18).length(); index20 = index20 + 1 { + let iter_elem : Bool = (payload18)[(index20)] + let iter_base = address19 + (index20 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload18).length()) + mbt_ffi_store32((iter_base) + 8, address19) + cleanup_list.push(address19) + + () + } + TupleValue(payload21) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address22 = mbt_ffi_malloc((payload21).length() * 4); + for index23 = 0; index23 < (payload21).length(); index23 = index23 + 1 { + let iter_elem : Int = (payload21)[(index23)] + let iter_base = address22 + (index23 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload21).length()) + mbt_ffi_store32((iter_base) + 8, address22) + cleanup_list.push(address22) + + () + } + ListValue(payload24) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address25 = mbt_ffi_malloc((payload24).length() * 4); + for index26 = 0; index26 < (payload24).length(); index26 = index26 + 1 { + let iter_elem : Int = (payload24)[(index26)] + let iter_base = address25 + (index26 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload24).length()) + mbt_ffi_store32((iter_base) + 8, address25) + cleanup_list.push(address25) + + () + } + FixedListValue(payload27) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address28 = mbt_ffi_malloc((payload27).length() * 4); + for index29 = 0; index29 < (payload27).length(); index29 = index29 + 1 { + let iter_elem : Int = (payload27)[(index29)] + let iter_base = address28 + (index29 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload27).length()) + mbt_ffi_store32((iter_base) + 8, address28) + cleanup_list.push(address28) + + () + } + MapValue(payload30) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let address31 = mbt_ffi_malloc((payload30).length() * 8); + for index32 = 0; index32 < (payload30).length(); index32 = index32 + 1 { + let iter_elem : @types.MapEntry = (payload30)[(index32)] + let iter_base = address31 + (index32 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload30).length()) + mbt_ffi_store32((iter_base) + 8, address31) + cleanup_list.push(address31) + + () + } + OptionValue(payload33) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + match (payload33) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload35) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload35) + + () + } + } + + () + } + ResultValue(payload36) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload36 { + OkValue(payload37) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload37) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload39) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload39) + + () + } + } + + () + } + ErrValue(payload40) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload40) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload42) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload42) + + () + } + } + + () + } + } + + () + } + TextValue(payload43) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr44 = mbt_ffi_str2ptr((payload43).text) + mbt_ffi_store32((iter_base) + 12, (payload43).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) + + match ((payload43).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload46) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr47 = mbt_ffi_str2ptr(payload46) + mbt_ffi_store32((iter_base) + 24, payload46.length()) + mbt_ffi_store32((iter_base) + 20, ptr47) + cleanup_list.push(ptr47) + + () + } + } + cleanup_list.push(ptr44) + + () + } + BinaryValue(payload48) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr49 = mbt_ffi_bytes2ptr((payload48).bytes) + + mbt_ffi_store32((iter_base) + 12, (payload48).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) + + match ((payload48).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload51) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr52 = mbt_ffi_str2ptr(payload51) + mbt_ffi_store32((iter_base) + 24, payload51.length()) + mbt_ffi_store32((iter_base) + 20, ptr52) + cleanup_list.push(ptr52) + + () + } + } + cleanup_list.push(ptr49) + + () + } + PathValue(payload53) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr54 = mbt_ffi_str2ptr(payload53) + mbt_ffi_store32((iter_base) + 12, payload53.length()) + mbt_ffi_store32((iter_base) + 8, ptr54) + cleanup_list.push(ptr54) + + () + } + UrlValue(payload55) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr56 = mbt_ffi_str2ptr(payload55) + mbt_ffi_store32((iter_base) + 12, payload55.length()) + mbt_ffi_store32((iter_base) + 8, ptr56) + cleanup_list.push(ptr56) + + () + } + DatetimeValue(payload57) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload57).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload57).nanoseconds).reinterpret_as_int()) + + () + } + DurationValue(payload58) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload58).nanoseconds) + + () + } + QuantityValueNode(payload59) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload59).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload59).scale) + + let ptr60 = mbt_ffi_str2ptr((payload59).unit) + mbt_ffi_store32((iter_base) + 24, (payload59).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr60) + cleanup_list.push(ptr60) + + () + } + UnionValue(payload61) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr62 = mbt_ffi_str2ptr((payload61).tag) + mbt_ffi_store32((iter_base) + 12, (payload61).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr62) + mbt_ffi_store32((iter_base) + 16, (payload61).body) + cleanup_list.push(ptr62) + + () + } + SecretValue(payload63) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let @types.Secret(handle) = payload63 + mbt_ffi_store32((iter_base) + 8, handle) + + () + } + QuotaTokenHandle(payload64) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let @types.QuotaToken(handle65) = payload64 + mbt_ffi_store32((iter_base) + 8, handle65) + + () + } + PermissionCardHandle(payload66) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let @types.PermissionCard(handle67) = payload66 + mbt_ffi_store32((iter_base) + 8, handle67) + + () + } + } + + } + + let (lowered, lowered72, lowered73) = match (phantom_id) { + None => { + + ((0), 0L, 0L) + } + Some(payload71) => { + + ((1), ((payload71).high_bits).reinterpret_as_int64(), ((payload71).low_bits).reinterpret_as_int64()) + } + } + + let address521 = mbt_ffi_malloc((agent_config).length() * 40); + for index522 = 0; index522 < (agent_config).length(); index522 = index522 + 1 { + let iter_elem : @common.TypedAgentConfigValue = (agent_config)[(index522)] + let iter_base = address521 + (index522 * 40); + + let address75 = mbt_ffi_malloc(((iter_elem).path).length() * 8); + for index76 = 0; index76 < ((iter_elem).path).length(); index76 = index76 + 1 { + let iter_elem : String = ((iter_elem).path)[(index76)] + let iter_base = address75 + (index76 * 8); + + let ptr74 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr74) + cleanup_list.push(ptr74) + + } + mbt_ffi_store32((iter_base) + 4, ((iter_elem).path).length()) + mbt_ffi_store32((iter_base) + 0, address75) + + let address439 = mbt_ffi_malloc(((((iter_elem).value).graph).type_nodes).length() * 144); + for index440 = 0; index440 < ((((iter_elem).value).graph).type_nodes).length(); index440 = index440 + 1 { + let iter_elem : @types.SchemaTypeNode = ((((iter_elem).value).graph).type_nodes)[(index440)] + let iter_base = address439 + (index440 * 144); + + match (iter_elem).body { + RefType(payload77) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store32((iter_base) + 8, payload77) + + () + } + BoolType => { + mbt_ffi_store8((iter_base) + 0, (1)) + + () + } + S8Type(payload79) => { + mbt_ffi_store8((iter_base) + 0, (2)) + + match (payload79) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload81) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload81).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload83) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload83 { + Signed(payload84) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload84) + + () + } + Unsigned(payload85) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload85).reinterpret_as_int64()) + + () + } + FloatBits(payload86) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload86).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload81).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload88) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload88 { + Signed(payload89) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload89) + + () + } + Unsigned(payload90) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload90).reinterpret_as_int64()) + + () + } + FloatBits(payload91) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload91).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload81).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload93) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr94 = mbt_ffi_str2ptr(payload93) + mbt_ffi_store32((iter_base) + 72, payload93.length()) + mbt_ffi_store32((iter_base) + 68, ptr94) + cleanup_list.push(ptr94) + + () + } + } + + () + } + } + + () + } + S16Type(payload95) => { + mbt_ffi_store8((iter_base) + 0, (3)) + + match (payload95) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload97) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload97).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload99) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload99 { + Signed(payload100) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload100) + + () + } + Unsigned(payload101) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload101).reinterpret_as_int64()) + + () + } + FloatBits(payload102) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload102).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload97).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload104) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload104 { + Signed(payload105) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload105) + + () + } + Unsigned(payload106) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload106).reinterpret_as_int64()) + + () + } + FloatBits(payload107) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload107).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload97).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload109) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr110 = mbt_ffi_str2ptr(payload109) + mbt_ffi_store32((iter_base) + 72, payload109.length()) + mbt_ffi_store32((iter_base) + 68, ptr110) + cleanup_list.push(ptr110) + + () + } + } + + () + } + } + + () + } + S32Type(payload111) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + match (payload111) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload113) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload113).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload115) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload115 { + Signed(payload116) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload116) + + () + } + Unsigned(payload117) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload117).reinterpret_as_int64()) + + () + } + FloatBits(payload118) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload118).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload113).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload120) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload120 { + Signed(payload121) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload121) + + () + } + Unsigned(payload122) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload122).reinterpret_as_int64()) + + () + } + FloatBits(payload123) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload123).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload113).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload125) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr126 = mbt_ffi_str2ptr(payload125) + mbt_ffi_store32((iter_base) + 72, payload125.length()) + mbt_ffi_store32((iter_base) + 68, ptr126) + cleanup_list.push(ptr126) + + () + } + } + + () + } + } + + () + } + S64Type(payload127) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + match (payload127) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload129) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload129).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload131) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload131 { + Signed(payload132) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload132) + + () + } + Unsigned(payload133) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload133).reinterpret_as_int64()) + + () + } + FloatBits(payload134) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload134).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload129).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload136) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload136 { + Signed(payload137) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload137) + + () + } + Unsigned(payload138) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload138).reinterpret_as_int64()) + + () + } + FloatBits(payload139) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload139).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload129).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload141) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr142 = mbt_ffi_str2ptr(payload141) + mbt_ffi_store32((iter_base) + 72, payload141.length()) + mbt_ffi_store32((iter_base) + 68, ptr142) + cleanup_list.push(ptr142) + + () + } + } + + () + } + } + + () + } + U8Type(payload143) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + match (payload143) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload145) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload145).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload147) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload147 { + Signed(payload148) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload148) + + () + } + Unsigned(payload149) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload149).reinterpret_as_int64()) + + () + } + FloatBits(payload150) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload150).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload145).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload152) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload152 { + Signed(payload153) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload153) + + () + } + Unsigned(payload154) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload154).reinterpret_as_int64()) + + () + } + FloatBits(payload155) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload155).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload145).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload157) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr158 = mbt_ffi_str2ptr(payload157) + mbt_ffi_store32((iter_base) + 72, payload157.length()) + mbt_ffi_store32((iter_base) + 68, ptr158) + cleanup_list.push(ptr158) + + () + } + } + + () + } + } + + () + } + U16Type(payload159) => { + mbt_ffi_store8((iter_base) + 0, (7)) + + match (payload159) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload161) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload161).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload163) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload163 { + Signed(payload164) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload164) + + () + } + Unsigned(payload165) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload165).reinterpret_as_int64()) + + () + } + FloatBits(payload166) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload166).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload161).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload168) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload168 { + Signed(payload169) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload169) + + () + } + Unsigned(payload170) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload170).reinterpret_as_int64()) + + () + } + FloatBits(payload171) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload171).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload161).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload173) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr174 = mbt_ffi_str2ptr(payload173) + mbt_ffi_store32((iter_base) + 72, payload173.length()) + mbt_ffi_store32((iter_base) + 68, ptr174) + cleanup_list.push(ptr174) + + () + } + } + + () + } + } + + () + } + U32Type(payload175) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + match (payload175) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload177) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload177).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload179) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload179 { + Signed(payload180) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload180) + + () + } + Unsigned(payload181) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload181).reinterpret_as_int64()) + + () + } + FloatBits(payload182) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload182).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload177).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload184) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload184 { + Signed(payload185) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload185) + + () + } + Unsigned(payload186) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload186).reinterpret_as_int64()) + + () + } + FloatBits(payload187) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload187).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload177).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload189) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr190 = mbt_ffi_str2ptr(payload189) + mbt_ffi_store32((iter_base) + 72, payload189.length()) + mbt_ffi_store32((iter_base) + 68, ptr190) + cleanup_list.push(ptr190) + + () + } + } + + () + } + } + + () + } + U64Type(payload191) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + match (payload191) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload193) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload193).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload195) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload195 { + Signed(payload196) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload196) + + () + } + Unsigned(payload197) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload197).reinterpret_as_int64()) + + () + } + FloatBits(payload198) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload198).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload193).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload200) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload200 { + Signed(payload201) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload201) + + () + } + Unsigned(payload202) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload202).reinterpret_as_int64()) + + () + } + FloatBits(payload203) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload203).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload193).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload205) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr206 = mbt_ffi_str2ptr(payload205) + mbt_ffi_store32((iter_base) + 72, payload205.length()) + mbt_ffi_store32((iter_base) + 68, ptr206) + cleanup_list.push(ptr206) + + () + } + } + + () + } + } + + () + } + F32Type(payload207) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + match (payload207) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload209) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload209).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload211) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload211 { + Signed(payload212) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload212) + + () + } + Unsigned(payload213) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload213).reinterpret_as_int64()) + + () + } + FloatBits(payload214) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload214).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload209).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload216) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload216 { + Signed(payload217) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload217) + + () + } + Unsigned(payload218) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload218).reinterpret_as_int64()) + + () + } + FloatBits(payload219) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload219).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload209).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload221) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr222 = mbt_ffi_str2ptr(payload221) + mbt_ffi_store32((iter_base) + 72, payload221.length()) + mbt_ffi_store32((iter_base) + 68, ptr222) + cleanup_list.push(ptr222) + + () + } + } + + () + } + } + + () + } + F64Type(payload223) => { + mbt_ffi_store8((iter_base) + 0, (11)) + + match (payload223) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload225) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload225).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload227) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload227 { + Signed(payload228) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload228) + + () + } + Unsigned(payload229) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload229).reinterpret_as_int64()) + + () + } + FloatBits(payload230) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload230).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload225).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload232) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload232 { + Signed(payload233) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload233) + + () + } + Unsigned(payload234) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload234).reinterpret_as_int64()) + + () + } + FloatBits(payload235) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload235).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload225).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload237) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr238 = mbt_ffi_str2ptr(payload237) + mbt_ffi_store32((iter_base) + 72, payload237.length()) + mbt_ffi_store32((iter_base) + 68, ptr238) + cleanup_list.push(ptr238) + + () + } + } + + () + } + } + + () + } + CharType => { + mbt_ffi_store8((iter_base) + 0, (12)) + + () + } + StringType => { + mbt_ffi_store8((iter_base) + 0, (13)) + + () + } + RecordType(payload241) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let address262 = mbt_ffi_malloc((payload241).length() * 68); + for index263 = 0; index263 < (payload241).length(); index263 = index263 + 1 { + let iter_elem : @types.NamedFieldType = (payload241)[(index263)] + let iter_base = address262 + (index263 * 68); + + let ptr242 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr242) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload244) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr245 = mbt_ffi_str2ptr(payload244) + mbt_ffi_store32((iter_base) + 20, payload244.length()) + mbt_ffi_store32((iter_base) + 16, ptr245) + cleanup_list.push(ptr245) + + () + } + } + + let address247 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index248 = 0; index248 < (((iter_elem).metadata).aliases).length(); index248 = index248 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index248)] + let iter_base = address247 + (index248 * 8); + + let ptr246 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr246) + cleanup_list.push(ptr246) + + } + mbt_ffi_store32((iter_base) + 28, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 24, address247) + + let address250 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index251 = 0; index251 < (((iter_elem).metadata).examples).length(); index251 = index251 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index251)] + let iter_base = address250 + (index251 * 8); + + let ptr249 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr249) + cleanup_list.push(ptr249) + + } + mbt_ffi_store32((iter_base) + 36, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 32, address250) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload253) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + let ptr254 = mbt_ffi_str2ptr(payload253) + mbt_ffi_store32((iter_base) + 48, payload253.length()) + mbt_ffi_store32((iter_base) + 44, ptr254) + cleanup_list.push(ptr254) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 52, (0)) + + () + } + Some(payload256) => { + mbt_ffi_store8((iter_base) + 52, (1)) + + match payload256 { + Multimodal => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 56, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 56, (2)) + + () + } + Other(payload260) => { + mbt_ffi_store8((iter_base) + 56, (3)) + + let ptr261 = mbt_ffi_str2ptr(payload260) + mbt_ffi_store32((iter_base) + 64, payload260.length()) + mbt_ffi_store32((iter_base) + 60, ptr261) + cleanup_list.push(ptr261) + + () + } + } + + () + } + } + cleanup_list.push(ptr242) + cleanup_list.push(address247) + cleanup_list.push(address250) + + } + mbt_ffi_store32((iter_base) + 12, (payload241).length()) + mbt_ffi_store32((iter_base) + 8, address262) + cleanup_list.push(address262) + + () + } + VariantType(payload264) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let address287 = mbt_ffi_malloc((payload264).length() * 72); + for index288 = 0; index288 < (payload264).length(); index288 = index288 + 1 { + let iter_elem : @types.VariantCaseType = (payload264)[(index288)] + let iter_base = address287 + (index288 * 72); + + let ptr265 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr265) + + match ((iter_elem).payload) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload267) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload267) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload269) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr270 = mbt_ffi_str2ptr(payload269) + mbt_ffi_store32((iter_base) + 24, payload269.length()) + mbt_ffi_store32((iter_base) + 20, ptr270) + cleanup_list.push(ptr270) + + () + } + } + + let address272 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index273 = 0; index273 < (((iter_elem).metadata).aliases).length(); index273 = index273 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index273)] + let iter_base = address272 + (index273 * 8); + + let ptr271 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr271) + cleanup_list.push(ptr271) + + } + mbt_ffi_store32((iter_base) + 32, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 28, address272) + + let address275 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index276 = 0; index276 < (((iter_elem).metadata).examples).length(); index276 = index276 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index276)] + let iter_base = address275 + (index276 * 8); + + let ptr274 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr274) + cleanup_list.push(ptr274) + + } + mbt_ffi_store32((iter_base) + 40, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 36, address275) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 44, (0)) + + () + } + Some(payload278) => { + mbt_ffi_store8((iter_base) + 44, (1)) + + let ptr279 = mbt_ffi_str2ptr(payload278) + mbt_ffi_store32((iter_base) + 52, payload278.length()) + mbt_ffi_store32((iter_base) + 48, ptr279) + cleanup_list.push(ptr279) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload281) => { + mbt_ffi_store8((iter_base) + 56, (1)) + + match payload281 { + Multimodal => { + mbt_ffi_store8((iter_base) + 60, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 60, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 60, (2)) + + () + } + Other(payload285) => { + mbt_ffi_store8((iter_base) + 60, (3)) + + let ptr286 = mbt_ffi_str2ptr(payload285) + mbt_ffi_store32((iter_base) + 68, payload285.length()) + mbt_ffi_store32((iter_base) + 64, ptr286) + cleanup_list.push(ptr286) + + () + } + } + + () + } + } + cleanup_list.push(ptr265) + cleanup_list.push(address272) + cleanup_list.push(address275) + + } + mbt_ffi_store32((iter_base) + 12, (payload264).length()) + mbt_ffi_store32((iter_base) + 8, address287) + cleanup_list.push(address287) + + () + } + EnumType(payload289) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address291 = mbt_ffi_malloc((payload289).length() * 8); + for index292 = 0; index292 < (payload289).length(); index292 = index292 + 1 { + let iter_elem : String = (payload289)[(index292)] + let iter_base = address291 + (index292 * 8); + + let ptr290 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr290) + cleanup_list.push(ptr290) + + } + mbt_ffi_store32((iter_base) + 12, (payload289).length()) + mbt_ffi_store32((iter_base) + 8, address291) + cleanup_list.push(address291) + + () + } + FlagsType(payload293) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address295 = mbt_ffi_malloc((payload293).length() * 8); + for index296 = 0; index296 < (payload293).length(); index296 = index296 + 1 { + let iter_elem : String = (payload293)[(index296)] + let iter_base = address295 + (index296 * 8); + + let ptr294 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr294) + cleanup_list.push(ptr294) + + } + mbt_ffi_store32((iter_base) + 12, (payload293).length()) + mbt_ffi_store32((iter_base) + 8, address295) + cleanup_list.push(address295) + + () + } + TupleType(payload297) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address298 = mbt_ffi_malloc((payload297).length() * 4); + for index299 = 0; index299 < (payload297).length(); index299 = index299 + 1 { + let iter_elem : Int = (payload297)[(index299)] + let iter_base = address298 + (index299 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload297).length()) + mbt_ffi_store32((iter_base) + 8, address298) + cleanup_list.push(address298) + + () + } + ListType(payload300) => { + mbt_ffi_store8((iter_base) + 0, (19)) + mbt_ffi_store32((iter_base) + 8, payload300) + + () + } + FixedListType(payload301) => { + mbt_ffi_store8((iter_base) + 0, (20)) + mbt_ffi_store32((iter_base) + 8, (payload301).element) + mbt_ffi_store32((iter_base) + 12, ((payload301).length).reinterpret_as_int()) + + () + } + MapType(payload302) => { + mbt_ffi_store8((iter_base) + 0, (21)) + mbt_ffi_store32((iter_base) + 8, (payload302).key) + mbt_ffi_store32((iter_base) + 12, (payload302).value) + + () + } + OptionType(payload303) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store32((iter_base) + 8, payload303) + + () + } + ResultType(payload304) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match ((payload304).ok) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload306) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload306) + + () + } + } + + match ((payload304).err) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload308) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload308) + + () + } + } + + () + } + TextType(payload309) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match ((payload309).languages) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload311) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address313 = mbt_ffi_malloc((payload311).length() * 8); + for index314 = 0; index314 < (payload311).length(); index314 = index314 + 1 { + let iter_elem : String = (payload311)[(index314)] + let iter_base = address313 + (index314 * 8); + + let ptr312 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr312) + cleanup_list.push(ptr312) + + } + mbt_ffi_store32((iter_base) + 16, (payload311).length()) + mbt_ffi_store32((iter_base) + 12, address313) + cleanup_list.push(address313) + + () + } + } + + match ((payload309).min_length) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload316) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload316).reinterpret_as_int()) + + () + } + } + + match ((payload309).max_length) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload318) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload318).reinterpret_as_int()) + + () + } + } + + match ((payload309).regex) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload320) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr321 = mbt_ffi_str2ptr(payload320) + mbt_ffi_store32((iter_base) + 44, payload320.length()) + mbt_ffi_store32((iter_base) + 40, ptr321) + cleanup_list.push(ptr321) + + () + } + } + + () + } + BinaryType(payload322) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + match ((payload322).mime_types) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload324) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address326 = mbt_ffi_malloc((payload324).length() * 8); + for index327 = 0; index327 < (payload324).length(); index327 = index327 + 1 { + let iter_elem : String = (payload324)[(index327)] + let iter_base = address326 + (index327 * 8); + + let ptr325 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr325) + cleanup_list.push(ptr325) + + } + mbt_ffi_store32((iter_base) + 16, (payload324).length()) + mbt_ffi_store32((iter_base) + 12, address326) + cleanup_list.push(address326) + + () + } + } + + match ((payload322).min_bytes) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload329) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload329).reinterpret_as_int()) + + () + } + } + + match ((payload322).max_bytes) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload331) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload331).reinterpret_as_int()) + + () + } + } + + () + } + PathType(payload332) => { + mbt_ffi_store8((iter_base) + 0, (26)) + mbt_ffi_store8((iter_base) + 8, (payload332).direction.ordinal()) + mbt_ffi_store8((iter_base) + 9, (payload332).kind.ordinal()) + + match ((payload332).allowed_mime_types) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload334) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let address336 = mbt_ffi_malloc((payload334).length() * 8); + for index337 = 0; index337 < (payload334).length(); index337 = index337 + 1 { + let iter_elem : String = (payload334)[(index337)] + let iter_base = address336 + (index337 * 8); + + let ptr335 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr335) + cleanup_list.push(ptr335) + + } + mbt_ffi_store32((iter_base) + 20, (payload334).length()) + mbt_ffi_store32((iter_base) + 16, address336) + cleanup_list.push(address336) + + () + } + } + + match ((payload332).allowed_extensions) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload339) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let address341 = mbt_ffi_malloc((payload339).length() * 8); + for index342 = 0; index342 < (payload339).length(); index342 = index342 + 1 { + let iter_elem : String = (payload339)[(index342)] + let iter_base = address341 + (index342 * 8); + + let ptr340 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr340) + cleanup_list.push(ptr340) + + } + mbt_ffi_store32((iter_base) + 32, (payload339).length()) + mbt_ffi_store32((iter_base) + 28, address341) + cleanup_list.push(address341) + + () + } + } + + () + } + UrlType(payload343) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + match ((payload343).allowed_schemes) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload345) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address347 = mbt_ffi_malloc((payload345).length() * 8); + for index348 = 0; index348 < (payload345).length(); index348 = index348 + 1 { + let iter_elem : String = (payload345)[(index348)] + let iter_base = address347 + (index348 * 8); + + let ptr346 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr346) + cleanup_list.push(ptr346) + + } + mbt_ffi_store32((iter_base) + 16, (payload345).length()) + mbt_ffi_store32((iter_base) + 12, address347) + cleanup_list.push(address347) + + () + } + } + + match ((payload343).allowed_hosts) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload350) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let address352 = mbt_ffi_malloc((payload350).length() * 8); + for index353 = 0; index353 < (payload350).length(); index353 = index353 + 1 { + let iter_elem : String = (payload350)[(index353)] + let iter_base = address352 + (index353 * 8); + + let ptr351 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr351) + cleanup_list.push(ptr351) + + } + mbt_ffi_store32((iter_base) + 28, (payload350).length()) + mbt_ffi_store32((iter_base) + 24, address352) + cleanup_list.push(address352) + + () + } + } + + () + } + DatetimeType => { + mbt_ffi_store8((iter_base) + 0, (28)) + + () + } + DurationType => { + mbt_ffi_store8((iter_base) + 0, (29)) + + () + } + QuantityType(payload356) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr357 = mbt_ffi_str2ptr((payload356).base_unit) + mbt_ffi_store32((iter_base) + 12, (payload356).base_unit.length()) + mbt_ffi_store32((iter_base) + 8, ptr357) + + let address359 = mbt_ffi_malloc(((payload356).allowed_suffixes).length() * 8); + for index360 = 0; index360 < ((payload356).allowed_suffixes).length(); index360 = index360 + 1 { + let iter_elem : String = ((payload356).allowed_suffixes)[(index360)] + let iter_base = address359 + (index360 * 8); + + let ptr358 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr358) + cleanup_list.push(ptr358) + + } + mbt_ffi_store32((iter_base) + 20, ((payload356).allowed_suffixes).length()) + mbt_ffi_store32((iter_base) + 16, address359) + + match ((payload356).min) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload362) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload362).mantissa) + mbt_ffi_store32((iter_base) + 40, (payload362).scale) + + let ptr363 = mbt_ffi_str2ptr((payload362).unit) + mbt_ffi_store32((iter_base) + 48, (payload362).unit.length()) + mbt_ffi_store32((iter_base) + 44, ptr363) + cleanup_list.push(ptr363) + + () + } + } + + match ((payload356).max) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload365) => { + mbt_ffi_store8((iter_base) + 56, (1)) + mbt_ffi_store64((iter_base) + 64, (payload365).mantissa) + mbt_ffi_store32((iter_base) + 72, (payload365).scale) + + let ptr366 = mbt_ffi_str2ptr((payload365).unit) + mbt_ffi_store32((iter_base) + 80, (payload365).unit.length()) + mbt_ffi_store32((iter_base) + 76, ptr366) + cleanup_list.push(ptr366) + + () + } + } + cleanup_list.push(ptr357) + cleanup_list.push(address359) + + () + } + UnionType(payload367) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let address403 = mbt_ffi_malloc(((payload367).branches).length() * 92); + for index404 = 0; index404 < ((payload367).branches).length(); index404 = index404 + 1 { + let iter_elem : @types.UnionBranch = ((payload367).branches)[(index404)] + let iter_base = address403 + (index404 * 92); + + let ptr368 = mbt_ffi_str2ptr((iter_elem).tag) + mbt_ffi_store32((iter_base) + 4, (iter_elem).tag.length()) + mbt_ffi_store32((iter_base) + 0, ptr368) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (iter_elem).discriminator { + Prefix(payload369) => { + mbt_ffi_store8((iter_base) + 12, (0)) + + let ptr370 = mbt_ffi_str2ptr(payload369) + mbt_ffi_store32((iter_base) + 20, payload369.length()) + mbt_ffi_store32((iter_base) + 16, ptr370) + cleanup_list.push(ptr370) + + () + } + Suffix(payload371) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr372 = mbt_ffi_str2ptr(payload371) + mbt_ffi_store32((iter_base) + 20, payload371.length()) + mbt_ffi_store32((iter_base) + 16, ptr372) + cleanup_list.push(ptr372) + + () + } + Contains(payload373) => { + mbt_ffi_store8((iter_base) + 12, (2)) + + let ptr374 = mbt_ffi_str2ptr(payload373) + mbt_ffi_store32((iter_base) + 20, payload373.length()) + mbt_ffi_store32((iter_base) + 16, ptr374) + cleanup_list.push(ptr374) + + () + } + Regex(payload375) => { + mbt_ffi_store8((iter_base) + 12, (3)) + + let ptr376 = mbt_ffi_str2ptr(payload375) + mbt_ffi_store32((iter_base) + 20, payload375.length()) + mbt_ffi_store32((iter_base) + 16, ptr376) + cleanup_list.push(ptr376) + + () + } + FieldEquals(payload377) => { + mbt_ffi_store8((iter_base) + 12, (4)) + + let ptr378 = mbt_ffi_str2ptr((payload377).field_name) + mbt_ffi_store32((iter_base) + 20, (payload377).field_name.length()) + mbt_ffi_store32((iter_base) + 16, ptr378) + + match ((payload377).literal) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload380) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let ptr381 = mbt_ffi_str2ptr(payload380) + mbt_ffi_store32((iter_base) + 32, payload380.length()) + mbt_ffi_store32((iter_base) + 28, ptr381) + cleanup_list.push(ptr381) + + () + } + } + cleanup_list.push(ptr378) + + () + } + FieldAbsent(payload382) => { + mbt_ffi_store8((iter_base) + 12, (5)) + + let ptr383 = mbt_ffi_str2ptr(payload382) + mbt_ffi_store32((iter_base) + 20, payload382.length()) + mbt_ffi_store32((iter_base) + 16, ptr383) + cleanup_list.push(ptr383) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload385) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr386 = mbt_ffi_str2ptr(payload385) + mbt_ffi_store32((iter_base) + 44, payload385.length()) + mbt_ffi_store32((iter_base) + 40, ptr386) + cleanup_list.push(ptr386) + + () + } + } + + let address388 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index389 = 0; index389 < (((iter_elem).metadata).aliases).length(); index389 = index389 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index389)] + let iter_base = address388 + (index389 * 8); + + let ptr387 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr387) + cleanup_list.push(ptr387) + + } + mbt_ffi_store32((iter_base) + 52, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 48, address388) + + let address391 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index392 = 0; index392 < (((iter_elem).metadata).examples).length(); index392 = index392 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index392)] + let iter_base = address391 + (index392 * 8); + + let ptr390 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr390) + cleanup_list.push(ptr390) + + } + mbt_ffi_store32((iter_base) + 60, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 56, address391) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload394) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr395 = mbt_ffi_str2ptr(payload394) + mbt_ffi_store32((iter_base) + 72, payload394.length()) + mbt_ffi_store32((iter_base) + 68, ptr395) + cleanup_list.push(ptr395) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 76, (0)) + + () + } + Some(payload397) => { + mbt_ffi_store8((iter_base) + 76, (1)) + + match payload397 { + Multimodal => { + mbt_ffi_store8((iter_base) + 80, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 80, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 80, (2)) + + () + } + Other(payload401) => { + mbt_ffi_store8((iter_base) + 80, (3)) + + let ptr402 = mbt_ffi_str2ptr(payload401) + mbt_ffi_store32((iter_base) + 88, payload401.length()) + mbt_ffi_store32((iter_base) + 84, ptr402) + cleanup_list.push(ptr402) + + () + } + } + + () + } + } + cleanup_list.push(ptr368) + cleanup_list.push(address388) + cleanup_list.push(address391) + + } + mbt_ffi_store32((iter_base) + 12, ((payload367).branches).length()) + mbt_ffi_store32((iter_base) + 8, address403) + cleanup_list.push(address403) + + () + } + SecretType(payload405) => { + mbt_ffi_store8((iter_base) + 0, (32)) + mbt_ffi_store32((iter_base) + 8, (payload405).inner) + + match ((payload405).category) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload407) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr408 = mbt_ffi_str2ptr(payload407) + mbt_ffi_store32((iter_base) + 20, payload407.length()) + mbt_ffi_store32((iter_base) + 16, ptr408) + cleanup_list.push(ptr408) + + () + } + } + + () + } + QuotaTokenType(payload409) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + match ((payload409).resource_name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload411) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr412 = mbt_ffi_str2ptr(payload411) + mbt_ffi_store32((iter_base) + 16, payload411.length()) + mbt_ffi_store32((iter_base) + 12, ptr412) + cleanup_list.push(ptr412) + + () + } + } + + () + } + PermissionCardType(payload413) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store8((iter_base) + 8, (if (payload413).polymorphic { 1 } else { 0 })) + + () + } + FutureType(payload414) => { + mbt_ffi_store8((iter_base) + 0, (35)) + + match (payload414) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload416) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload416) + + () + } + } + + () + } + StreamType(payload417) => { + mbt_ffi_store8((iter_base) + 0, (36)) + + match (payload417) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload419) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload419) + + () + } + } + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 88, (0)) + + () + } + Some(payload421) => { + mbt_ffi_store8((iter_base) + 88, (1)) + + let ptr422 = mbt_ffi_str2ptr(payload421) + mbt_ffi_store32((iter_base) + 96, payload421.length()) + mbt_ffi_store32((iter_base) + 92, ptr422) + cleanup_list.push(ptr422) + + () + } + } + + let address424 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index425 = 0; index425 < (((iter_elem).metadata).aliases).length(); index425 = index425 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index425)] + let iter_base = address424 + (index425 * 8); + + let ptr423 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr423) + cleanup_list.push(ptr423) + + } + mbt_ffi_store32((iter_base) + 104, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 100, address424) + + let address427 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index428 = 0; index428 < (((iter_elem).metadata).examples).length(); index428 = index428 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index428)] + let iter_base = address427 + (index428 * 8); + + let ptr426 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr426) + cleanup_list.push(ptr426) + + } + mbt_ffi_store32((iter_base) + 112, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 108, address427) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 116, (0)) + + () + } + Some(payload430) => { + mbt_ffi_store8((iter_base) + 116, (1)) + + let ptr431 = mbt_ffi_str2ptr(payload430) + mbt_ffi_store32((iter_base) + 124, payload430.length()) + mbt_ffi_store32((iter_base) + 120, ptr431) + cleanup_list.push(ptr431) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 128, (0)) + + () + } + Some(payload433) => { + mbt_ffi_store8((iter_base) + 128, (1)) + + match payload433 { + Multimodal => { + mbt_ffi_store8((iter_base) + 132, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 132, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 132, (2)) + + () + } + Other(payload437) => { + mbt_ffi_store8((iter_base) + 132, (3)) + + let ptr438 = mbt_ffi_str2ptr(payload437) + mbt_ffi_store32((iter_base) + 140, payload437.length()) + mbt_ffi_store32((iter_base) + 136, ptr438) + cleanup_list.push(ptr438) + + () + } + } + + () + } + } + cleanup_list.push(address424) + cleanup_list.push(address427) + + } + mbt_ffi_store32((iter_base) + 12, ((((iter_elem).value).graph).type_nodes).length()) + mbt_ffi_store32((iter_base) + 8, address439) + + let address445 = mbt_ffi_malloc(((((iter_elem).value).graph).defs).length() * 24); + for index446 = 0; index446 < ((((iter_elem).value).graph).defs).length(); index446 = index446 + 1 { + let iter_elem : @types.SchemaTypeDef = ((((iter_elem).value).graph).defs)[(index446)] + let iter_base = address445 + (index446 * 24); + + let ptr441 = mbt_ffi_str2ptr((iter_elem).id) + mbt_ffi_store32((iter_base) + 4, (iter_elem).id.length()) + mbt_ffi_store32((iter_base) + 0, ptr441) + + match ((iter_elem).name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload443) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr444 = mbt_ffi_str2ptr(payload443) + mbt_ffi_store32((iter_base) + 16, payload443.length()) + mbt_ffi_store32((iter_base) + 12, ptr444) + cleanup_list.push(ptr444) + + () + } + } + mbt_ffi_store32((iter_base) + 20, (iter_elem).body) + cleanup_list.push(ptr441) + + } + mbt_ffi_store32((iter_base) + 20, ((((iter_elem).value).graph).defs).length()) + mbt_ffi_store32((iter_base) + 16, address445) + mbt_ffi_store32((iter_base) + 24, (((iter_elem).value).graph).root) + + let address519 = mbt_ffi_malloc(((((iter_elem).value).value).value_nodes).length() * 32); + for index520 = 0; index520 < ((((iter_elem).value).value).value_nodes).length(); index520 = index520 + 1 { + let iter_elem : @types.SchemaValueNode = ((((iter_elem).value).value).value_nodes)[(index520)] + let iter_base = address519 + (index520 * 32); + + match iter_elem { + BoolValue(payload447) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload447 { 1 } else { 0 })) + + () + } + S8Value(payload448) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload448)) + + () + } + S16Value(payload449) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload449)) + + () + } + S32Value(payload450) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload450) + + () + } + S64Value(payload451) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload451) + + () + } + U8Value(payload452) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload452).to_int()) + + () + } + U16Value(payload453) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload453).reinterpret_as_int()) + + () + } + U32Value(payload454) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload454).reinterpret_as_int()) + + () + } + U64Value(payload455) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload455).reinterpret_as_int64()) + + () + } + F32Value(payload456) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload456) + + () + } + F64Value(payload457) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload457) + + () + } + CharValue(payload458) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload458).to_int()) + + () + } + StringValue(payload459) => { + mbt_ffi_store8((iter_base) + 0, (12)) + + let ptr460 = mbt_ffi_str2ptr(payload459) + mbt_ffi_store32((iter_base) + 12, payload459.length()) + mbt_ffi_store32((iter_base) + 8, ptr460) + cleanup_list.push(ptr460) + + () + } + RecordValue(payload461) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let address462 = mbt_ffi_malloc((payload461).length() * 4); + for index463 = 0; index463 < (payload461).length(); index463 = index463 + 1 { + let iter_elem : Int = (payload461)[(index463)] + let iter_base = address462 + (index463 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload461).length()) + mbt_ffi_store32((iter_base) + 8, address462) + cleanup_list.push(address462) + + () + } + VariantValue(payload464) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload464).case).reinterpret_as_int()) + + match ((payload464).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload466) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload466) + + () + } + } + + () + } + EnumValue(payload467) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload467).reinterpret_as_int()) + + () + } + FlagsValue(payload468) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address469 = mbt_ffi_malloc((payload468).length() * 1); + for index470 = 0; index470 < (payload468).length(); index470 = index470 + 1 { + let iter_elem : Bool = (payload468)[(index470)] + let iter_base = address469 + (index470 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload468).length()) + mbt_ffi_store32((iter_base) + 8, address469) + cleanup_list.push(address469) + + () + } + TupleValue(payload471) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address472 = mbt_ffi_malloc((payload471).length() * 4); + for index473 = 0; index473 < (payload471).length(); index473 = index473 + 1 { + let iter_elem : Int = (payload471)[(index473)] + let iter_base = address472 + (index473 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload471).length()) + mbt_ffi_store32((iter_base) + 8, address472) + cleanup_list.push(address472) + + () + } + ListValue(payload474) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address475 = mbt_ffi_malloc((payload474).length() * 4); + for index476 = 0; index476 < (payload474).length(); index476 = index476 + 1 { + let iter_elem : Int = (payload474)[(index476)] + let iter_base = address475 + (index476 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload474).length()) + mbt_ffi_store32((iter_base) + 8, address475) + cleanup_list.push(address475) + + () + } + FixedListValue(payload477) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address478 = mbt_ffi_malloc((payload477).length() * 4); + for index479 = 0; index479 < (payload477).length(); index479 = index479 + 1 { + let iter_elem : Int = (payload477)[(index479)] + let iter_base = address478 + (index479 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload477).length()) + mbt_ffi_store32((iter_base) + 8, address478) + cleanup_list.push(address478) + + () + } + MapValue(payload480) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let address481 = mbt_ffi_malloc((payload480).length() * 8); + for index482 = 0; index482 < (payload480).length(); index482 = index482 + 1 { + let iter_elem : @types.MapEntry = (payload480)[(index482)] + let iter_base = address481 + (index482 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload480).length()) + mbt_ffi_store32((iter_base) + 8, address481) + cleanup_list.push(address481) + + () + } + OptionValue(payload483) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + match (payload483) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload485) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload485) + + () + } + } + + () + } + ResultValue(payload486) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload486 { + OkValue(payload487) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload487) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload489) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload489) + + () + } + } + + () + } + ErrValue(payload490) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload490) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload492) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload492) + + () + } + } + + () + } + } + + () + } + TextValue(payload493) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr494 = mbt_ffi_str2ptr((payload493).text) + mbt_ffi_store32((iter_base) + 12, (payload493).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr494) + + match ((payload493).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload496) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr497 = mbt_ffi_str2ptr(payload496) + mbt_ffi_store32((iter_base) + 24, payload496.length()) + mbt_ffi_store32((iter_base) + 20, ptr497) + cleanup_list.push(ptr497) + + () + } + } + cleanup_list.push(ptr494) + + () + } + BinaryValue(payload498) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr499 = mbt_ffi_bytes2ptr((payload498).bytes) + + mbt_ffi_store32((iter_base) + 12, (payload498).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr499) + + match ((payload498).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload501) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr502 = mbt_ffi_str2ptr(payload501) + mbt_ffi_store32((iter_base) + 24, payload501.length()) + mbt_ffi_store32((iter_base) + 20, ptr502) + cleanup_list.push(ptr502) + + () + } + } + cleanup_list.push(ptr499) + + () + } + PathValue(payload503) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr504 = mbt_ffi_str2ptr(payload503) + mbt_ffi_store32((iter_base) + 12, payload503.length()) + mbt_ffi_store32((iter_base) + 8, ptr504) + cleanup_list.push(ptr504) + + () + } + UrlValue(payload505) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr506 = mbt_ffi_str2ptr(payload505) + mbt_ffi_store32((iter_base) + 12, payload505.length()) + mbt_ffi_store32((iter_base) + 8, ptr506) + cleanup_list.push(ptr506) + + () + } + DatetimeValue(payload507) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload507).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload507).nanoseconds).reinterpret_as_int()) + + () + } + DurationValue(payload508) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload508).nanoseconds) + + () + } + QuantityValueNode(payload509) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload509).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload509).scale) + + let ptr510 = mbt_ffi_str2ptr((payload509).unit) + mbt_ffi_store32((iter_base) + 24, (payload509).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr510) + cleanup_list.push(ptr510) + + () + } + UnionValue(payload511) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr512 = mbt_ffi_str2ptr((payload511).tag) + mbt_ffi_store32((iter_base) + 12, (payload511).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr512) + mbt_ffi_store32((iter_base) + 16, (payload511).body) + cleanup_list.push(ptr512) + + () + } + SecretValue(payload513) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let @types.Secret(handle514) = payload513 + mbt_ffi_store32((iter_base) + 8, handle514) + + () + } + QuotaTokenHandle(payload515) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let @types.QuotaToken(handle516) = payload515 + mbt_ffi_store32((iter_base) + 8, handle516) + + () + } + PermissionCardHandle(payload517) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let @types.PermissionCard(handle518) = payload517 + mbt_ffi_store32((iter_base) + 8, handle518) + + () + } } - _ => panic() - } - let lifted303 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result302 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + } + mbt_ffi_store32((iter_base) + 32, ((((iter_elem).value).value).value_nodes).length()) + mbt_ffi_store32((iter_base) + 28, address519) + mbt_ffi_store32((iter_base) + 36, (((iter_elem).value).value).root) + cleanup_list.push(address75) + cleanup_list.push(address439) + cleanup_list.push(address445) + cleanup_list.push(address519) + + } + let result : Int = wasmImportConstructorWasmRpc(ptr, agent_type_name.length(), address68, ((constructor_).value_nodes).length(), (constructor_).root, lowered, lowered72, lowered73, address521, (agent_config).length()); + let ret = WasmRpc::WasmRpc(result) + mbt_ffi_free(ptr) + mbt_ffi_free(address68) + mbt_ffi_free(address521) + + cleanup_list.each(mbt_ffi_free) + return ret + +} +///| +/// Invokes a remote method with the given parameters, and awaits the result. +/// +/// `input` encodes the method's parameter list. The returned result is +/// `none` for a `unit` output and `some(value)` for a `single` output. +pub fn WasmRpc::invoke_and_await(self : WasmRpc, method_name : String, input : @types.SchemaValueTree, scope_card : @types.PermissionCard?) -> Result[InvocationResultWithMetadata, RpcError] { + let cleanup_list : Array[Int] = [] + + let WasmRpc(handle) = self + + let ptr = mbt_ffi_str2ptr(method_name) + + let address69 = mbt_ffi_malloc(((input).value_nodes).length() * 32); + for index70 = 0; index70 < ((input).value_nodes).length(); index70 = index70 + 1 { + let iter_elem : @types.SchemaValueNode = ((input).value_nodes)[(index70)] + let iter_base = address69 + (index70 * 32); + + match iter_elem { + BoolValue(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) + + () + } + S8Value(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) + + () + } + S16Value(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) + + () + } + S32Value(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) + + () + } + S64Value(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload3) + + () + } + U8Value(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload4).to_int()) + + () + } + U16Value(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload5).reinterpret_as_int()) + + () + } + U32Value(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload6).reinterpret_as_int()) + + () + } + U64Value(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload7).reinterpret_as_int64()) + + () + } + F32Value(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload8) + + () + } + F64Value(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload9) + + () + } + CharValue(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload10).to_int()) + + () + } + StringValue(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) + + let ptr12 = mbt_ffi_str2ptr(payload11) + mbt_ffi_store32((iter_base) + 12, payload11.length()) + mbt_ffi_store32((iter_base) + 8, ptr12) + cleanup_list.push(ptr12) + + () + } + RecordValue(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let address = mbt_ffi_malloc((payload13).length() * 4); + for index = 0; index < (payload13).length(); index = index + 1 { + let iter_elem : Int = (payload13)[(index)] + let iter_base = address + (index * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload13).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + VariantValue(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload14).case).reinterpret_as_int()) + + match ((payload14).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload16) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload16) + + () + } + } + + () + } + EnumValue(payload17) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload17).reinterpret_as_int()) + + () + } + FlagsValue(payload18) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address19 = mbt_ffi_malloc((payload18).length() * 1); + for index20 = 0; index20 < (payload18).length(); index20 = index20 + 1 { + let iter_elem : Bool = (payload18)[(index20)] + let iter_base = address19 + (index20 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload18).length()) + mbt_ffi_store32((iter_base) + 8, address19) + cleanup_list.push(address19) + + () + } + TupleValue(payload21) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address22 = mbt_ffi_malloc((payload21).length() * 4); + for index23 = 0; index23 < (payload21).length(); index23 = index23 + 1 { + let iter_elem : Int = (payload21)[(index23)] + let iter_base = address22 + (index23 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload21).length()) + mbt_ffi_store32((iter_base) + 8, address22) + cleanup_list.push(address22) + + () + } + ListValue(payload24) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address25 = mbt_ffi_malloc((payload24).length() * 4); + for index26 = 0; index26 < (payload24).length(); index26 = index26 + 1 { + let iter_elem : Int = (payload24)[(index26)] + let iter_base = address25 + (index26 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload24).length()) + mbt_ffi_store32((iter_base) + 8, address25) + cleanup_list.push(address25) + + () + } + FixedListValue(payload27) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address28 = mbt_ffi_malloc((payload27).length() * 4); + for index29 = 0; index29 < (payload27).length(); index29 = index29 + 1 { + let iter_elem : Int = (payload27)[(index29)] + let iter_base = address28 + (index29 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload27).length()) + mbt_ffi_store32((iter_base) + 8, address28) + cleanup_list.push(address28) + + () + } + MapValue(payload30) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let address31 = mbt_ffi_malloc((payload30).length() * 8); + for index32 = 0; index32 < (payload30).length(); index32 = index32 + 1 { + let iter_elem : @types.MapEntry = (payload30)[(index32)] + let iter_base = address31 + (index32 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload30).length()) + mbt_ffi_store32((iter_base) + 8, address31) + cleanup_list.push(address31) + + () + } + OptionValue(payload33) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + match (payload33) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload35) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload35) + + () + } + } + + () + } + ResultValue(payload36) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload36 { + OkValue(payload37) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload37) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload39) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload39) + + () + } + } + + () + } + ErrValue(payload40) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload40) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload42) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload42) + + () + } + } + + () + } + } + + () + } + TextValue(payload43) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr44 = mbt_ffi_str2ptr((payload43).text) + mbt_ffi_store32((iter_base) + 12, (payload43).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) + + match ((payload43).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload46) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr47 = mbt_ffi_str2ptr(payload46) + mbt_ffi_store32((iter_base) + 24, payload46.length()) + mbt_ffi_store32((iter_base) + 20, ptr47) + cleanup_list.push(ptr47) + + () + } + } + cleanup_list.push(ptr44) + + () + } + BinaryValue(payload48) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr49 = mbt_ffi_bytes2ptr((payload48).bytes) + + mbt_ffi_store32((iter_base) + 12, (payload48).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) + + match ((payload48).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload51) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr52 = mbt_ffi_str2ptr(payload51) + mbt_ffi_store32((iter_base) + 24, payload51.length()) + mbt_ffi_store32((iter_base) + 20, ptr52) + cleanup_list.push(ptr52) + + () + } + } + cleanup_list.push(ptr49) + + () + } + PathValue(payload53) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr54 = mbt_ffi_str2ptr(payload53) + mbt_ffi_store32((iter_base) + 12, payload53.length()) + mbt_ffi_store32((iter_base) + 8, ptr54) + cleanup_list.push(ptr54) + + () + } + UrlValue(payload55) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr56 = mbt_ffi_str2ptr(payload55) + mbt_ffi_store32((iter_base) + 12, payload55.length()) + mbt_ffi_store32((iter_base) + 8, ptr56) + cleanup_list.push(ptr56) + + () + } + DatetimeValue(payload57) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload57).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload57).nanoseconds).reinterpret_as_int()) + + () + } + DurationValue(payload58) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload58).nanoseconds) + + () + } + QuantityValueNode(payload59) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload59).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload59).scale) + + let ptr60 = mbt_ffi_str2ptr((payload59).unit) + mbt_ffi_store32((iter_base) + 24, (payload59).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr60) + cleanup_list.push(ptr60) + + () + } + UnionValue(payload61) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr62 = mbt_ffi_str2ptr((payload61).tag) + mbt_ffi_store32((iter_base) + 12, (payload61).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr62) + mbt_ffi_store32((iter_base) + 16, (payload61).body) + cleanup_list.push(ptr62) + + () + } + SecretValue(payload63) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let @types.Secret(handle64) = payload63 + mbt_ffi_store32((iter_base) + 8, handle64) + + () + } + QuotaTokenHandle(payload65) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let @types.QuotaToken(handle66) = payload65 + mbt_ffi_store32((iter_base) + 8, handle66) + + () + } + PermissionCardHandle(payload67) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let @types.PermissionCard(handle68) = payload67 + mbt_ffi_store32((iter_base) + 8, handle68) + + () + } + } + + } + + let (lowered, lowered74) = match (scope_card) { + None => { + + ((0), 0) + } + Some(payload72) => { + + let @types.PermissionCard(handle73) = payload72 + + ((1), handle73) + } + } + let return_area = mbt_ffi_malloc(44) + wasmImportMethodWasmRpcInvokeAndAwait(handle, ptr, method_name.length(), address69, ((input).value_nodes).length(), (input).root, lowered, lowered74, return_area); + + let lifted350 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + let result75 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + let lifted105 : @types.SchemaValueTree? = match mbt_ffi_load8_u((return_area) + 20) { + 0 => Option::None + 1 => { + + let array103 : Array[@types.SchemaValueNode] = []; + for index104 = 0; index104 < (mbt_ffi_load32((return_area) + 28)); index104 = index104 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 24)) + (index104 * 32) + + let lifted102 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result76 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result76) + } + 13 => { - Option::Some(result302) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted299, - max: lifted301, - unit: lifted303, - }) - } - _ => panic() - } + let array : Array[Int] = []; + for index77 = 0; index77 < (mbt_ffi_load32((iter_base) + 12)); index77 = index77 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index77 * 4) - @types.SchemaTypeBody::S64Type(lifted304) - } - 6 => { - let lifted311 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted306 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted305 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted305) - } - _ => panic() - } + array.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted308 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted307 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted307) - } - _ => panic() - } + @types.SchemaValueNode::RecordValue(array) + } + 14 => { - let lifted310 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result309 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(result309) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted306, - max: lifted308, - unit: lifted310, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - @types.SchemaTypeBody::U8Type(lifted311) - } - 7 => { - let lifted318 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted313 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted312 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted312) - } - _ => panic() - } + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted}) + } + 15 => { - let lifted315 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted314 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted314) - } - _ => panic() - } + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - let lifted317 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result316 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let array78 : Array[Bool] = []; + for index79 = 0; index79 < (mbt_ffi_load32((iter_base) + 12)); index79 = index79 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index79 * 1) - Option::Some(result316) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted313, - max: lifted315, - unit: lifted317, - }) - } - _ => panic() - } + array78.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.SchemaTypeBody::U16Type(lifted318) - } - 8 => { - let lifted325 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted320 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted319 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted319) - } - _ => panic() - } + @types.SchemaValueNode::FlagsValue(array78) + } + 17 => { - let lifted322 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted321 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted321) - } - _ => panic() - } + let array80 : Array[Int] = []; + for index81 = 0; index81 < (mbt_ffi_load32((iter_base) + 12)); index81 = index81 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index81 * 4) - let lifted324 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result323 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + array80.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(result323) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted320, - max: lifted322, - unit: lifted324, - }) - } - _ => panic() - } + @types.SchemaValueNode::TupleValue(array80) + } + 18 => { - @types.SchemaTypeBody::U32Type(lifted325) - } - 9 => { - let lifted332 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted327 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted326 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted326) - } - _ => panic() - } + let array82 : Array[Int] = []; + for index83 = 0; index83 < (mbt_ffi_load32((iter_base) + 12)); index83 = index83 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index83 * 4) - let lifted329 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted328 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted328) - } - _ => panic() - } + array82.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted331 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result330 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::ListValue(array82) + } + 19 => { + + let array84 : Array[Int] = []; + for index85 = 0; index85 < (mbt_ffi_load32((iter_base) + 12)); index85 = index85 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index85 * 4) + + array84.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array84) + } + 20 => { + + let array86 : Array[@types.MapEntry] = []; + for index87 = 0; index87 < (mbt_ffi_load32((iter_base) + 12)); index87 = index87 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index87 * 8) + + array86.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array86) + } + 21 => { + + let lifted88 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted88) + } + 22 => { + + let lifted91 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - Option::Some(result330) + let lifted89 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted89) + } + 1 => { + + let lifted90 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted90) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted91) + } + 23 => { + + let result92 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted94 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result93 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result93) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result92, language : lifted94}) + } + 24 => { + + let result95 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted97 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result96 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result96) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result95, mime_type : lifted97}) + } + 25 => { + + let result98 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result98) + } + 26 => { + + let result99 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result99) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result100 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result100}) + } + 30 => { + + let result101 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result101, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array103.push(lifted102) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 24)) + + Option::Some(@types.SchemaValueTree::{value_nodes : array103, root : mbt_ffi_load32((return_area) + 32)}) + } + _ => panic() } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted327, - max: lifted329, - unit: lifted331, - }) - } - _ => panic() + + Result::Ok(InvocationResultWithMetadata::{metadata : InvocationMetadata::{agent_id : result, idempotency_key : result75}, result : lifted105}) } + 1 => { - @types.SchemaTypeBody::U64Type(lifted332) - } - 10 => { - let lifted339 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted334 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted333 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted333) - } - _ => panic() - } + let lifted349 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - let lifted336 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted335 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted335) - } - _ => panic() - } + let result106 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + RpcError::ProtocolError(result106) + } + 1 => { + + let result107 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + RpcError::Denied(result107) + } + 2 => { + + let result108 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + RpcError::NotFound(result108) + } + 3 => { + + let result109 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + RpcError::RemoteInternalError(result109) + } + 4 => { + + let lifted348 = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { + + let result110 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + @common.AgentError::InvalidInput(result110) + } + 1 => { + + let result111 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + @common.AgentError::InvalidMethod(result111) + } + 2 => { + + let result112 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + @common.AgentError::InvalidType(result112) + } + 3 => { + + let result113 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + @common.AgentError::InvalidAgentId(result113) + } + 4 => { + + let array310 : Array[@types.SchemaTypeNode] = []; + for index311 = 0; index311 < (mbt_ffi_load32((return_area) + 16)); index311 = index311 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 12)) + (index311 * 144) + + let lifted296 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted120 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted115 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted114 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted114) + } + _ => panic() + } + + let lifted117 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted116 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted116) + } + _ => panic() + } + + let lifted119 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result118 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result118) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted115, max : lifted117, unit : lifted119}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted120) + } + 3 => { + + let lifted127 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted122 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted121 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted121) + } + _ => panic() + } + + let lifted124 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted123 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted123) + } + _ => panic() + } + + let lifted126 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result125 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result125) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted122, max : lifted124, unit : lifted126}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted127) + } + 4 => { + + let lifted134 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted129 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted128 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted128) + } + _ => panic() + } + + let lifted131 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted130 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted130) + } + _ => panic() + } + + let lifted133 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result132 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result132) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted129, max : lifted131, unit : lifted133}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted134) + } + 5 => { + + let lifted141 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted136 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted135 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted135) + } + _ => panic() + } + + let lifted138 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted137 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted137) + } + _ => panic() + } + + let lifted140 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result139 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result139) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted136, max : lifted138, unit : lifted140}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted141) + } + 6 => { + + let lifted148 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted143 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted142 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted142) + } + _ => panic() + } + + let lifted145 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted144 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted144) + } + _ => panic() + } + + let lifted147 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result146 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result146) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted143, max : lifted145, unit : lifted147}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted148) + } + 7 => { + + let lifted155 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted150 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted149 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted149) + } + _ => panic() + } + + let lifted152 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted151 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted151) + } + _ => panic() + } + + let lifted154 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result153) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted150, max : lifted152, unit : lifted154}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted155) + } + 8 => { + + let lifted162 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted157 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted156 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted156) + } + _ => panic() + } + + let lifted159 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted158 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted158) + } + _ => panic() + } + + let lifted161 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result160 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result160) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted157, max : lifted159, unit : lifted161}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted162) + } + 9 => { + + let lifted169 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted164 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted163 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted163) + } + _ => panic() + } + + let lifted166 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted165 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted165) + } + _ => panic() + } + + let lifted168 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result167 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result167) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted164, max : lifted166, unit : lifted168}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted169) + } + 10 => { + + let lifted176 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted171 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted170 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted170) + } + _ => panic() + } + + let lifted173 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted172 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted172) + } + _ => panic() + } + + let lifted175 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result174 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result174) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted171, max : lifted173, unit : lifted175}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted176) + } + 11 => { + + let lifted183 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted178 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted177 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted177) + } + _ => panic() + } + + let lifted180 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted179 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted179) + } + _ => panic() + } + + let lifted182 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result181 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result181) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted178, max : lifted180, unit : lifted182}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted183) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array198 : Array[@types.NamedFieldType] = []; + for index199 = 0; index199 < (mbt_ffi_load32((iter_base) + 12)); index199 = index199 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index199 * 68) + + let result184 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted186 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result185 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result185) + } + _ => panic() + } + + let array188 : Array[String] = []; + for index189 = 0; index189 < (mbt_ffi_load32((iter_base) + 28)); index189 = index189 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index189 * 8) + + let result187 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array188.push(result187) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array191 : Array[String] = []; + for index192 = 0; index192 < (mbt_ffi_load32((iter_base) + 36)); index192 = index192 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index192 * 8) + + let result190 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array191.push(result190) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted194 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result193 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result193) + } + _ => panic() + } + + let lifted197 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted196 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result195 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result195) + } + _ => panic() + } + + Option::Some(lifted196) + } + _ => panic() + } + + array198.push(@types.NamedFieldType::{name : result184, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted186, aliases : array188, examples : array191, deprecated : lifted194, role : lifted197}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array198) + } + 15 => { + + let array215 : Array[@types.VariantCaseType] = []; + for index216 = 0; index216 < (mbt_ffi_load32((iter_base) + 12)); index216 = index216 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index216 * 72) + + let result200 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted201 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted203 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result202 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result202) + } + _ => panic() + } + + let array205 : Array[String] = []; + for index206 = 0; index206 < (mbt_ffi_load32((iter_base) + 32)); index206 = index206 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index206 * 8) + + let result204 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array205.push(result204) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array208 : Array[String] = []; + for index209 = 0; index209 < (mbt_ffi_load32((iter_base) + 40)); index209 = index209 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index209 * 8) + + let result207 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array208.push(result207) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted211 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result210 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result210) + } + _ => panic() + } + + let lifted214 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted213 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result212 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result212) + } + _ => panic() + } + + Option::Some(lifted213) + } + _ => panic() + } + + array215.push(@types.VariantCaseType::{name : result200, payload : lifted201, metadata : @types.MetadataEnvelope::{doc : lifted203, aliases : array205, examples : array208, deprecated : lifted211, role : lifted214}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array215) + } + 16 => { + + let array218 : Array[String] = []; + for index219 = 0; index219 < (mbt_ffi_load32((iter_base) + 12)); index219 = index219 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index219 * 8) + + let result217 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array218.push(result217) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array218) + } + 17 => { + + let array221 : Array[String] = []; + for index222 = 0; index222 < (mbt_ffi_load32((iter_base) + 12)); index222 = index222 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index222 * 8) + + let result220 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array221.push(result220) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array221) + } + 18 => { + + let array223 : Array[Int] = []; + for index224 = 0; index224 < (mbt_ffi_load32((iter_base) + 12)); index224 = index224 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index224 * 4) + + array223.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array223) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted225 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted226 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted225, err : lifted226}) + } + 24 => { + + let lifted230 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array228 : Array[String] = []; + for index229 = 0; index229 < (mbt_ffi_load32((iter_base) + 16)); index229 = index229 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index229 * 8) + + let result227 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array228.push(result227) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array228) + } + _ => panic() + } - let lifted338 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result337 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted231 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - Option::Some(result337) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted334, - max: lifted336, - unit: lifted338, - }) - } - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - @types.SchemaTypeBody::F32Type(lifted339) - } - 11 => { - let lifted346 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted341 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted340 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted340) - } - _ => panic() - } + let lifted232 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - let lifted343 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted342 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted342) - } - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - let lifted345 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result344 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted234 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - Option::Some(result344) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted341, - max: lifted343, - unit: lifted345, - }) - } - _ => panic() - } + let result233 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - @types.SchemaTypeBody::F64Type(lifted346) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array361 : Array[@types.NamedFieldType] = [] - for index362 = 0 - index362 < mbt_ffi_load32(iter_base + 12) - index362 = index362 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index362 * 68 - - let result347 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted349 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result348 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result348) - } - _ => panic() - } - - let array351 : Array[String] = [] - for index352 = 0 - index352 < mbt_ffi_load32(iter_base + 28) - index352 = index352 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index352 * 8 - - let result350 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array351.push(result350) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array354 : Array[String] = [] - for index355 = 0 - index355 < mbt_ffi_load32(iter_base + 36) - index355 = index355 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index355 * 8 - - let result353 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array354.push(result353) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted357 : String? = match mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result356 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result356) - } - _ => panic() - } - - let lifted360 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted359 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result358 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result358) - } - _ => panic() - } - - Option::Some(lifted359) - } - _ => panic() - } - - array361.push(@types.NamedFieldType::{ - name: result347, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted349, - aliases: array351, - examples: array354, - deprecated: lifted357, - role: lifted360, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array361) - } - 15 => { - let array378 : Array[@types.VariantCaseType] = [] - for index379 = 0 - index379 < mbt_ffi_load32(iter_base + 12) - index379 = index379 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index379 * 72 - - let result363 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted364 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted366 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result365 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result365) - } - _ => panic() - } - - let array368 : Array[String] = [] - for index369 = 0 - index369 < mbt_ffi_load32(iter_base + 32) - index369 = index369 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index369 * 8 - - let result367 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array368.push(result367) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array371 : Array[String] = [] - for index372 = 0 - index372 < mbt_ffi_load32(iter_base + 40) - index372 = index372 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index372 * 8 - - let result370 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array371.push(result370) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted374 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result373 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result373) - } - _ => panic() - } - - let lifted377 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted376 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result375 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result375) - } - _ => panic() - } - - Option::Some(lifted376) - } - _ => panic() - } - - array378.push(@types.VariantCaseType::{ - name: result363, - payload: lifted364, - metadata: @types.MetadataEnvelope::{ - doc: lifted366, - aliases: array368, - examples: array371, - deprecated: lifted374, - role: lifted377, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array378) - } - 16 => { - let array381 : Array[String] = [] - for index382 = 0 - index382 < mbt_ffi_load32(iter_base + 12) - index382 = index382 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index382 * 8 - - let result380 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array381.push(result380) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array381) - } - 17 => { - let array384 : Array[String] = [] - for index385 = 0 - index385 < mbt_ffi_load32(iter_base + 12) - index385 = index385 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index385 * 8 - - let result383 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array384.push(result383) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array384) - } - 18 => { - let array386 : Array[Int] = [] - for index387 = 0 - index387 < mbt_ffi_load32(iter_base + 12) - index387 = index387 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index387 * 4 - - array386.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array386) - } - 19 => @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted388 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + Option::Some(result233) + } + _ => panic() + } - let lifted389 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted230, min_length : lifted231, max_length : lifted232, regex : lifted234}) + } + 25 => { - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted388, - err: lifted389, - }) - } - 24 => { - let lifted393 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array391 : Array[String] = [] - for index392 = 0 - index392 < mbt_ffi_load32(iter_base + 16) - index392 = index392 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index392 * 8 - - let result390 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array391.push(result390) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array391) - } - _ => panic() - } + let lifted238 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted394 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + let array236 : Array[String] = []; + for index237 = 0; index237 < (mbt_ffi_load32((iter_base) + 16)); index237 = index237 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index237 * 8) - let lifted395 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + let result235 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted397 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result396 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result396) - } - _ => panic() - } + array236.push(result235) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted393, - min_length: lifted394, - max_length: lifted395, - regex: lifted397, - }) - } - 25 => { - let lifted401 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array399 : Array[String] = [] - for index400 = 0 - index400 < mbt_ffi_load32(iter_base + 16) - index400 = index400 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index400 * 8 - - let result398 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array399.push(result398) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array399) - } - _ => panic() - } + Option::Some(array236) + } + _ => panic() + } - let lifted402 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + let lifted239 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - let lifted403 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted401, - min_bytes: lifted402, - max_bytes: lifted403, - }) - } - 26 => { - let lifted407 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array405 : Array[String] = [] - for index406 = 0 - index406 < mbt_ffi_load32(iter_base + 20) - index406 = index406 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index406 * 8 - - let result404 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array405.push(result404) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array405) - } - _ => panic() - } + let lifted240 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - let lifted411 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array409 : Array[String] = [] - for index410 = 0 - index410 < mbt_ffi_load32(iter_base + 32) - index410 = index410 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index410 * 8 - - let result408 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array409.push(result408) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array409) - } - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted407, - allowed_extensions: lifted411, - }) - } - 27 => { - let lifted415 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array413 : Array[String] = [] - for index414 = 0 - index414 < mbt_ffi_load32(iter_base + 16) - index414 = index414 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index414 * 8 - - let result412 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array413.push(result412) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array413) - } - _ => panic() - } + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted238, min_bytes : lifted239, max_bytes : lifted240}) + } + 26 => { - let lifted419 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array417 : Array[String] = [] - for index418 = 0 - index418 < mbt_ffi_load32(iter_base + 28) - index418 = index418 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index418 * 8 - - let result416 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array417.push(result416) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array417) - } - _ => panic() - } + let lifted244 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted415, - allowed_hosts: lifted419, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result420 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array422 : Array[String] = [] - for index423 = 0 - index423 < mbt_ffi_load32(iter_base + 20) - index423 = index423 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index423 * 8 - - let result421 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array422.push(result421) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted425 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result424 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result424, - }) - } - _ => panic() - } + let array242 : Array[String] = []; + for index243 = 0; index243 < (mbt_ffi_load32((iter_base) + 20)); index243 = index243 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index243 * 8) - let lifted427 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result426 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result426, - }) - } - _ => panic() - } + let result241 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result420, - allowed_suffixes: array422, - min: lifted425, - max: lifted427, - }) - } - 31 => { - let array451 : Array[@types.UnionBranch] = [] - for index452 = 0 - index452 < mbt_ffi_load32(iter_base + 12) - index452 = index452 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index452 * 92 - - let result428 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted437 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result429 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result429) - } - 1 => { - let result430 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result430) - } - 2 => { - let result431 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result431) - } - 3 => { - let result432 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result432) - } - 4 => { - let result433 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted435 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result434 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result434) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result433, - literal: lifted435, - }) - } - 5 => { - let result436 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result436) - } - _ => panic() - } - - let lifted439 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result438 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result438) - } - _ => panic() - } - - let array441 : Array[String] = [] - for index442 = 0 - index442 < mbt_ffi_load32(iter_base + 52) - index442 = index442 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index442 * 8 - - let result440 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array441.push(result440) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array444 : Array[String] = [] - for index445 = 0 - index445 < mbt_ffi_load32(iter_base + 60) - index445 = index445 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index445 * 8 - - let result443 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array444.push(result443) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted447 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result446 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result446) - } - _ => panic() - } - - let lifted450 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted449 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result448 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result448) - } - _ => panic() - } - - Option::Some(lifted449) - } - _ => panic() - } - - array451.push(@types.UnionBranch::{ - tag: result428, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted437, - metadata: @types.MetadataEnvelope::{ - doc: lifted439, - aliases: array441, - examples: array444, - deprecated: lifted447, - role: lifted450, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array451, - }) - } - 32 => { - let lifted454 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result453 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result453) - } - _ => panic() - } + array242.push(result241) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted454, - }) - } - 33 => { - let lifted456 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result455 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result455) - } - _ => panic() - } + Option::Some(array242) + } + _ => panic() + } - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted456, - }) - } - 34 => { - let lifted457 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted248 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::FutureType(lifted457) - } - 35 => { - let lifted458 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let array246 : Array[String] = []; + for index247 = 0; index247 < (mbt_ffi_load32((iter_base) + 32)); index247 = index247 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index247 * 8) - @types.SchemaTypeBody::StreamType(lifted458) - } - _ => panic() - } - - let lifted461 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result460 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result460) - } - _ => panic() - } - - let array463 : Array[String] = [] - for index464 = 0 - index464 < mbt_ffi_load32(iter_base + 104) - index464 = index464 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index464 * 8 - - let result462 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array463.push(result462) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array466 : Array[String] = [] - for index467 = 0 - index467 < mbt_ffi_load32(iter_base + 112) - index467 = index467 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index467 * 8 - - let result465 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array466.push(result465) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted469 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result468 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result468) - } - _ => panic() - } - - let lifted472 : @types.Role? = match mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted471 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result470 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result470) - } - _ => panic() - } + let result245 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted471) - } - _ => panic() - } - - array473.push(@types.SchemaTypeNode::{ - body: lifted459, - metadata: @types.MetadataEnvelope::{ - doc: lifted461, - aliases: array463, - examples: array466, - deprecated: lifted469, - role: lifted472, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - let array478 : Array[@types.SchemaTypeDef] = [] - for index479 = 0 - index479 < mbt_ffi_load32(iter_base + 32) - index479 = index479 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index479 * 24 - - let result475 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted477 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result476 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result476) - } - _ => panic() - } - - array478.push(@types.SchemaTypeDef::{ - id: result475, - name: lifted477, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let lifted481 : String? = match mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result480 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result480) - } - _ => panic() - } + array246.push(result245) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let result482 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) + Option::Some(array246) + } + _ => panic() + } - let lifted484 : String? = match mbt_ffi_load8_u(iter_base + 60) { - 0 => Option::None - 1 => { - let result483 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - Option::Some(result483) - } - _ => panic() - } + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted244, allowed_extensions : lifted248}) + } + 27 => { - let lifted502 = match mbt_ffi_load8_u(iter_base + 72) { - 0 => { - let array500 : Array[@common.NamedField] = [] - for index501 = 0 - index501 < mbt_ffi_load32(iter_base + 80) - index501 = index501 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 76) + index501 * 72 - - let result485 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted486 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => @common.FieldSource::UserSupplied - 1 => - @common.FieldSource::AutoInjected( - @common.AutoInjectedKind::from(mbt_ffi_load8_u(iter_base + 9)), - ) - _ => panic() - } + let lifted252 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted488 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result487 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result487) - } - _ => panic() - } + let array250 : Array[String] = []; + for index251 = 0; index251 < (mbt_ffi_load32((iter_base) + 16)); index251 = index251 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index251 * 8) - let array490 : Array[String] = [] - for index491 = 0 - index491 < mbt_ffi_load32(iter_base + 32) - index491 = index491 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index491 * 8 + let result249 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result489 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array250.push(result249) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - array490.push(result489) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + Option::Some(array250) + } + _ => panic() + } - let array493 : Array[String] = [] - for index494 = 0 - index494 < mbt_ffi_load32(iter_base + 40) - index494 = index494 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index494 * 8 + let lifted256 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - let result492 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array254 : Array[String] = []; + for index255 = 0; index255 < (mbt_ffi_load32((iter_base) + 28)); index255 = index255 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index255 * 8) - array493.push(result492) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted496 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result495 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result495) - } - _ => panic() - } + let result253 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted499 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted498 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result497 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + array254.push(result253) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - @types.Role::Other(result497) - } - _ => panic() - } + Option::Some(array254) + } + _ => panic() + } - Option::Some(lifted498) - } - _ => panic() - } + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted252, allowed_hosts : lifted256}) + } + 28 => { - array500.push(@common.NamedField::{ - name: result485, - source: lifted486, - schema: mbt_ffi_load32(iter_base + 12), - metadata: @types.MetadataEnvelope::{ - doc: lifted488, - aliases: array490, - examples: array493, - deprecated: lifted496, - role: lifted499, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - - @common.InputSchema::Parameters(array500) - } - _ => panic() - } + @types.SchemaTypeBody::DatetimeType + } + 29 => { - let array550 : Array[@common.AgentMethod] = [] - for index551 = 0 - index551 < mbt_ffi_load32(iter_base + 88) - index551 = index551 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 84) + index551 * 88 - - let result503 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result504 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array525 : Array[@common.HttpEndpointDetails] = [] - for index526 = 0 - index526 < mbt_ffi_load32(iter_base + 20) - index526 = index526 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index526 * 48 - - let lifted506 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @common.HttpMethod::Get - 1 => @common.HttpMethod::Head - 2 => @common.HttpMethod::Post - 3 => @common.HttpMethod::Put - 4 => @common.HttpMethod::Delete - 5 => @common.HttpMethod::Connect - 6 => @common.HttpMethod::Options - 7 => @common.HttpMethod::Trace - 8 => @common.HttpMethod::Patch - 9 => { - let result505 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.HttpMethod::Custom(result505) - } - _ => panic() - } - - let array511 : Array[@common.PathSegment] = [] - for index512 = 0 - index512 < mbt_ffi_load32(iter_base + 16) - index512 = index512 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index512 * 12 - - let lifted510 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result507 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::Literal(result507) - } - 1 => - @common.PathSegment::SystemVariable( - @common.SystemVariable::from(mbt_ffi_load8_u(iter_base + 4)), - ) - 2 => { - let result508 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::PathVariable(@common.PathVariable::{ - variable_name: result508, - }) - } - 3 => { - let result509 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::RemainingPathVariable(@common.PathVariable::{ - variable_name: result509, - }) - } - _ => panic() - } + @types.SchemaTypeBody::DurationType + } + 30 => { - array511.push(lifted510) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - let array515 : Array[@common.HeaderVariable] = [] - for index516 = 0 - index516 < mbt_ffi_load32(iter_base + 24) - index516 = index516 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index516 * 16 - - let result513 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result514 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array515.push(@common.HeaderVariable::{ - header_name: result513, - variable_name: result514, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - let array519 : Array[@common.QueryVariable] = [] - for index520 = 0 - index520 < mbt_ffi_load32(iter_base + 32) - index520 = index520 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index520 * 16 - - let result517 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result518 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array519.push(@common.QueryVariable::{ - query_param_name: result517, - variable_name: result518, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let lifted521 : @common.AuthDetails? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => - Option::Some(@common.AuthDetails::{ - required: mbt_ffi_load8_u(iter_base + 37) != 0, - }) - _ => panic() - } - - let array523 : Array[String] = [] - for index524 = 0 - index524 < mbt_ffi_load32(iter_base + 44) - index524 = index524 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index524 * 8 - - let result522 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array523.push(result522) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - array525.push(@common.HttpEndpointDetails::{ - http_method: lifted506, - path_suffix: array511, - header_vars: array515, - query_vars: array519, - auth_details: lifted521, - cors_options: @common.CorsOptions::{ allowed_patterns: array523 }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted528 : String? = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result527 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result527) - } - _ => panic() - } - - let lifted546 = match mbt_ffi_load8_u(iter_base + 36) { - 0 => { - let array544 : Array[@common.NamedField] = [] - for index545 = 0 - index545 < mbt_ffi_load32(iter_base + 44) - index545 = index545 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index545 * 72 - - let result529 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted530 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => @common.FieldSource::UserSupplied - 1 => - @common.FieldSource::AutoInjected( - @common.AutoInjectedKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - ) - _ => panic() - } - - let lifted532 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result531 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result531) - } - _ => panic() - } - - let array534 : Array[String] = [] - for index535 = 0 - index535 < mbt_ffi_load32(iter_base + 32) - index535 = index535 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index535 * 8 - - let result533 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array534.push(result533) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array537 : Array[String] = [] - for index538 = 0 - index538 < mbt_ffi_load32(iter_base + 40) - index538 = index538 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index538 * 8 - - let result536 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array537.push(result536) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted540 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result539 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result539) - } - _ => panic() - } - - let lifted543 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted542 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result541 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result541) - } - _ => panic() - } - - Option::Some(lifted542) - } - _ => panic() - } - - array544.push(@common.NamedField::{ - name: result529, - source: lifted530, - schema: mbt_ffi_load32(iter_base + 12), - metadata: @types.MetadataEnvelope::{ - doc: lifted532, - aliases: array534, - examples: array537, - deprecated: lifted540, - role: lifted543, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - @common.InputSchema::Parameters(array544) - } - _ => panic() - } - - let lifted547 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => @common.OutputSchema::Unit - 1 => @common.OutputSchema::Single(mbt_ffi_load32(iter_base + 52)) - _ => panic() - } - - let lifted549 : @common.ReadOnlyConfig? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted548 = match mbt_ffi_load8_u(iter_base + 64) { - 0 => @common.CachePolicy::NoCache - 1 => @common.CachePolicy::UntilWrite - 2 => - @common.CachePolicy::Ttl( - mbt_ffi_load64(iter_base + 72).reinterpret_as_uint64(), - ) - _ => panic() - } + let result257 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(@common.ReadOnlyConfig::{ - cache_policy: lifted548, - uses_principal: mbt_ffi_load8_u(iter_base + 80) != 0, - }) - } - _ => panic() - } - - array550.push(@common.AgentMethod::{ - name: result503, - description: result504, - http_endpoint: array525, - prompt_hint: lifted528, - input_schema: lifted546, - output_schema: lifted547, - read_only: lifted549, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - - array552.push(@common.AgentDependency::{ - type_name: result274, - description: lifted276, - schema: @types.SchemaGraph::{ - type_nodes: array473, - defs: array478, - root: mbt_ffi_load32(iter_base + 36), - }, - constructor_: @common.AgentConstructor::{ - name: lifted481, - description: result482, - prompt_hint: lifted484, - input_schema: lifted502, - }, - methods: array550, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 96)) - - let lifted570 : @common.HttpMountDetails? = match - mbt_ffi_load8_u(iter_base + 108) { - 0 => Option::None - 1 => { - let array558 : Array[@common.PathSegment] = [] - for index559 = 0 - index559 < mbt_ffi_load32(iter_base + 116) - index559 = index559 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 112) + index559 * 12 - - let lifted557 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result554 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) + let array259 : Array[String] = []; + for index260 = 0; index260 < (mbt_ffi_load32((iter_base) + 20)); index260 = index260 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index260 * 8) - @common.PathSegment::Literal(result554) - } - 1 => - @common.PathSegment::SystemVariable( - @common.SystemVariable::from(mbt_ffi_load8_u(iter_base + 4)), - ) - 2 => { - let result555 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::PathVariable(@common.PathVariable::{ - variable_name: result555, - }) - } - 3 => { - let result556 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::RemainingPathVariable(@common.PathVariable::{ - variable_name: result556, - }) - } - _ => panic() - } - - array558.push(lifted557) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 112)) - - let lifted560 : @common.AuthDetails? = match - mbt_ffi_load8_u(iter_base + 120) { - 0 => Option::None - 1 => - Option::Some(@common.AuthDetails::{ - required: mbt_ffi_load8_u(iter_base + 121) != 0, - }) - _ => panic() - } - - let array562 : Array[String] = [] - for index563 = 0 - index563 < mbt_ffi_load32(iter_base + 128) - index563 = index563 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 124) + index563 * 8 - - let result561 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array562.push(result561) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 124)) - - let array568 : Array[@common.PathSegment] = [] - for index569 = 0 - index569 < mbt_ffi_load32(iter_base + 136) - index569 = index569 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 132) + index569 * 12 - - let lifted567 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result564 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) + let result258 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @common.PathSegment::Literal(result564) - } - 1 => - @common.PathSegment::SystemVariable( - @common.SystemVariable::from(mbt_ffi_load8_u(iter_base + 4)), - ) - 2 => { - let result565 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::PathVariable(@common.PathVariable::{ - variable_name: result565, - }) - } - 3 => { - let result566 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::RemainingPathVariable(@common.PathVariable::{ - variable_name: result566, - }) - } - _ => panic() - } - - array568.push(lifted567) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 132)) - - Option::Some(@common.HttpMountDetails::{ - path_prefix: array558, - auth_details: lifted560, - phantom_agent: mbt_ffi_load8_u(iter_base + 122) != 0, - cors_options: @common.CorsOptions::{ allowed_patterns: array562 }, - webhook_suffix: array568, - }) - } - _ => panic() - } - - let lifted572 = match mbt_ffi_load8_u(iter_base + 144) { - 0 => @common.Snapshotting::Disabled - 1 => { - let lifted571 = match mbt_ffi_load8_u(iter_base + 152) { - 0 => @common.SnapshottingConfig::Default - 1 => - @common.SnapshottingConfig::Periodic( - mbt_ffi_load64(iter_base + 160).reinterpret_as_uint64(), - ) - 2 => - @common.SnapshottingConfig::EveryNInvocation( - mbt_ffi_load16_u(iter_base + 160) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - _ => panic() - } - - @common.Snapshotting::Enabled(lifted571) - } - _ => panic() - } - - let array576 : Array[@common.AgentConfigDeclaration] = [] - for index577 = 0 - index577 < mbt_ffi_load32(iter_base + 172) - index577 = index577 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 168) + index577 * 16 - - let array574 : Array[String] = [] - for index575 = 0 - index575 < mbt_ffi_load32(iter_base + 8) - index575 = index575 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index575 * 8 - - let result573 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array574.push(result573) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - array576.push(@common.AgentConfigDeclaration::{ - source: @common.AgentConfigSource::from(mbt_ffi_load8_u(iter_base + 0)), - path: array574, - value_type: mbt_ffi_load32(iter_base + 12), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 168)) - - array578.push(@common.RegisteredAgentType::{ - agent_type: @common.AgentType::{ - type_name: result, - description: result0, - source_language: result1, - schema: @types.SchemaGraph::{ - type_nodes: array195, - defs: array200, - root: mbt_ffi_load32(iter_base + 40), - }, - constructor_: @common.AgentConstructor::{ - name: lifted203, - description: result204, - prompt_hint: lifted206, - input_schema: lifted224, - }, - methods: array272, - dependencies: array552, - mode: @common.AgentMode::from(mbt_ffi_load8_u(iter_base + 104)), - http_mount: lifted570, - snapshotting: lifted572, - config: array576, - }, - implemented_by: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 176).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 184).reinterpret_as_uint64(), - }, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array578 - mbt_ffi_free(return_area) - return ret -} + array259.push(result258) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) -///| -/// Get a specific registered agent type by name -pub fn get_agent_type(agent_type_name : String) -> @common.RegisteredAgentType? { - let ptr = mbt_ffi_str2ptr(agent_type_name) - let return_area = mbt_ffi_malloc(200) - wasmImportGetAgentType(ptr, agent_type_name.length(), return_area) - - let lifted578 : @common.RegisteredAgentType? = match - mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) + let lifted262 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 16), - mbt_ffi_load32(return_area + 20), - ) + let result261 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 24), - mbt_ffi_load32(return_area + 28), - ) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result261}) + } + _ => panic() + } - let array195 : Array[@types.SchemaTypeNode] = [] - for index196 = 0 - index196 < mbt_ffi_load32(return_area + 36) - index196 = index196 + 1 { - let iter_base = mbt_ffi_load32(return_area + 32) + index196 * 144 - - let lifted181 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted7 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted) - } - _ => panic() - } + let lifted264 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - let lifted4 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted3 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3) - } - _ => panic() - } + let result263 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - let lifted6 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result263}) + } + _ => panic() + } - Option::Some(result5) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2, - max: lifted4, - unit: lifted6, - }) - } - _ => panic() - } + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result257, allowed_suffixes : array259, min : lifted262, max : lifted264}) + } + 31 => { - @types.SchemaTypeBody::S8Type(lifted7) - } - 3 => { - let lifted14 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted9 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted8 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted8) - } - _ => panic() - } + let array288 : Array[@types.UnionBranch] = []; + for index289 = 0; index289 < (mbt_ffi_load32((iter_base) + 12)); index289 = index289 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index289 * 92) - let lifted11 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted10 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted10) - } - _ => panic() - } + let result265 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted13 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result12 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted274 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { - Option::Some(result12) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted9, - max: lifted11, - unit: lifted13, - }) - } - _ => panic() - } + let result266 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaTypeBody::S16Type(lifted14) - } - 4 => { - let lifted21 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted16 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted15 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted15) - } - _ => panic() - } + @types.DiscriminatorRule::Prefix(result266) + } + 1 => { - let lifted18 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted17 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted17) - } - _ => panic() - } + let result267 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let lifted20 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.DiscriminatorRule::Suffix(result267) + } + 2 => { - Option::Some(result19) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted16, - max: lifted18, - unit: lifted20, - }) - } - _ => panic() - } + let result268 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaTypeBody::S32Type(lifted21) - } - 5 => { - let lifted28 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted23 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted22 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted22) - } - _ => panic() - } + @types.DiscriminatorRule::Contains(result268) + } + 3 => { - let lifted25 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted24 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted24) - } - _ => panic() - } + let result269 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let lifted27 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result26 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.DiscriminatorRule::Regex(result269) + } + 4 => { - Option::Some(result26) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted23, - max: lifted25, - unit: lifted27, - }) - } - _ => panic() - } + let result270 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaTypeBody::S64Type(lifted28) - } - 6 => { - let lifted35 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted30 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted29 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted29) - } - _ => panic() - } + let lifted272 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let lifted32 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted31 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted31) - } - _ => panic() - } + let result271 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - let lifted34 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result33 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(result271) + } + _ => panic() + } - Option::Some(result33) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted30, - max: lifted32, - unit: lifted34, - }) - } - _ => panic() - } + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result270, literal : lifted272}) + } + 5 => { - @types.SchemaTypeBody::U8Type(lifted35) - } - 7 => { - let lifted42 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted37 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted36 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted36) - } - _ => panic() - } + let result273 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let lifted39 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted38 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted38) - } - _ => panic() - } + @types.DiscriminatorRule::FieldAbsent(result273) + } + _ => panic() + } - let lifted41 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result40 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted276 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - Option::Some(result40) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted37, - max: lifted39, - unit: lifted41, - }) - } - _ => panic() - } + let result275 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - @types.SchemaTypeBody::U16Type(lifted42) - } - 8 => { - let lifted49 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted44 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted43 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted43) - } - _ => panic() - } + Option::Some(result275) + } + _ => panic() + } - let lifted46 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted45 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted45) - } - _ => panic() - } + let array278 : Array[String] = []; + for index279 = 0; index279 < (mbt_ffi_load32((iter_base) + 52)); index279 = index279 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index279 * 8) - let lifted48 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result47 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let result277 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(result47) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted44, - max: lifted46, - unit: lifted48, - }) - } - _ => panic() - } + array278.push(result277) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - @types.SchemaTypeBody::U32Type(lifted49) - } - 9 => { - let lifted56 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted51 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted50 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted50) - } - _ => panic() - } + let array281 : Array[String] = []; + for index282 = 0; index282 < (mbt_ffi_load32((iter_base) + 60)); index282 = index282 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index282 * 8) - let lifted53 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted52 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted52) - } - _ => panic() - } + let result280 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted55 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result54 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + array281.push(result280) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - Option::Some(result54) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted51, - max: lifted53, - unit: lifted55, - }) - } - _ => panic() - } + let lifted284 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::U64Type(lifted56) - } - 10 => { - let lifted63 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted58 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted57 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted57) - } - _ => panic() - } + let result283 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let lifted60 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted59 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted59) - } - _ => panic() - } + Option::Some(result283) + } + _ => panic() + } - let lifted62 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result61 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted287 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - Option::Some(result61) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted58, - max: lifted60, - unit: lifted62, - }) - } - _ => panic() - } + let lifted286 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { - @types.SchemaTypeBody::F32Type(lifted63) - } - 11 => { - let lifted70 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted65 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted64 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted64) - } - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - let lifted67 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted66 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted66) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - let lifted69 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result68 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.Role::UnstructuredBinary + } + 3 => { - Option::Some(result68) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted65, - max: lifted67, - unit: lifted69, - }) - } - _ => panic() - } + let result285 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - @types.SchemaTypeBody::F64Type(lifted70) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array83 : Array[@types.NamedFieldType] = [] - for index84 = 0 - index84 < mbt_ffi_load32(iter_base + 12) - index84 = index84 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index84 * 68 - - let result71 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted73 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result72 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result72) - } - _ => panic() - } - - let array : Array[String] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 28) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index * 8 - - let result74 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result74) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array76 : Array[String] = [] - for index77 = 0 - index77 < mbt_ffi_load32(iter_base + 36) - index77 = index77 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index77 * 8 - - let result75 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array76.push(result75) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted79 : String? = match mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result78 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result78) - } - _ => panic() - } - - let lifted82 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted81 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result80 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result80) - } - _ => panic() - } - - Option::Some(lifted81) - } - _ => panic() - } - - array83.push(@types.NamedFieldType::{ - name: result71, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted73, - aliases: array, - examples: array76, - deprecated: lifted79, - role: lifted82, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array83) - } - 15 => { - let array100 : Array[@types.VariantCaseType] = [] - for index101 = 0 - index101 < mbt_ffi_load32(iter_base + 12) - index101 = index101 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index101 * 72 - - let result85 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted86 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted88 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result87 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result87) - } - _ => panic() - } - - let array90 : Array[String] = [] - for index91 = 0 - index91 < mbt_ffi_load32(iter_base + 32) - index91 = index91 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index91 * 8 - - let result89 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array90.push(result89) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array93 : Array[String] = [] - for index94 = 0 - index94 < mbt_ffi_load32(iter_base + 40) - index94 = index94 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index94 * 8 - - let result92 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array93.push(result92) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted96 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result95 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result95) - } - _ => panic() - } - - let lifted99 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted98 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result97 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result97) - } - _ => panic() - } - - Option::Some(lifted98) - } - _ => panic() - } - - array100.push(@types.VariantCaseType::{ - name: result85, - payload: lifted86, - metadata: @types.MetadataEnvelope::{ - doc: lifted88, - aliases: array90, - examples: array93, - deprecated: lifted96, - role: lifted99, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array100) - } - 16 => { - let array103 : Array[String] = [] - for index104 = 0 - index104 < mbt_ffi_load32(iter_base + 12) - index104 = index104 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index104 * 8 - - let result102 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array103.push(result102) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array103) - } - 17 => { - let array106 : Array[String] = [] - for index107 = 0 - index107 < mbt_ffi_load32(iter_base + 12) - index107 = index107 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index107 * 8 - - let result105 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array106.push(result105) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array106) - } - 18 => { - let array108 : Array[Int] = [] - for index109 = 0 - index109 < mbt_ffi_load32(iter_base + 12) - index109 = index109 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index109 * 4 - - array108.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array108) - } - 19 => @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted110 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.Role::Other(result285) + } + _ => panic() + } - let lifted111 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + Option::Some(lifted286) + } + _ => panic() + } - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted110, - err: lifted111, - }) - } - 24 => { - let lifted115 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array113 : Array[String] = [] - for index114 = 0 - index114 < mbt_ffi_load32(iter_base + 16) - index114 = index114 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index114 * 8 - - let result112 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array113.push(result112) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array113) - } - _ => panic() - } + array288.push(@types.UnionBranch::{tag : result265, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted274, metadata : @types.MetadataEnvelope::{doc : lifted276, aliases : array278, examples : array281, deprecated : lifted284, role : lifted287}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted116 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array288}) + } + 32 => { - let lifted117 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + let lifted291 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let lifted119 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result118 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result118) - } - _ => panic() - } + let result290 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted115, - min_length: lifted116, - max_length: lifted117, - regex: lifted119, - }) - } - 25 => { - let lifted123 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array121 : Array[String] = [] - for index122 = 0 - index122 < mbt_ffi_load32(iter_base + 16) - index122 = index122 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index122 * 8 - - let result120 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array121.push(result120) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array121) - } - _ => panic() - } + Option::Some(result290) + } + _ => panic() + } - let lifted124 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted291}) + } + 33 => { - let lifted125 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + let lifted293 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted123, - min_bytes: lifted124, - max_bytes: lifted125, - }) - } - 26 => { - let lifted129 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array127 : Array[String] = [] - for index128 = 0 - index128 < mbt_ffi_load32(iter_base + 20) - index128 = index128 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index128 * 8 - - let result126 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array127.push(result126) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array127) - } - _ => panic() - } + let result292 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - let lifted133 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array131 : Array[String] = [] - for index132 = 0 - index132 < mbt_ffi_load32(iter_base + 32) - index132 = index132 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index132 * 8 - - let result130 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array131.push(result130) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array131) - } - _ => panic() - } + Option::Some(result292) + } + _ => panic() + } - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted129, - allowed_extensions: lifted133, - }) - } - 27 => { - let lifted137 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array135 : Array[String] = [] - for index136 = 0 - index136 < mbt_ffi_load32(iter_base + 16) - index136 = index136 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index136 * 8 - - let result134 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array135.push(result134) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array135) - } - _ => panic() - } + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted293}) + } + 34 => { - let lifted141 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array139 : Array[String] = [] - for index140 = 0 - index140 < mbt_ffi_load32(iter_base + 28) - index140 = index140 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index140 * 8 - - let result138 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array139.push(result138) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array139) - } - _ => panic() - } + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted137, - allowed_hosts: lifted141, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result142 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array144 : Array[String] = [] - for index145 = 0 - index145 < mbt_ffi_load32(iter_base + 20) - index145 = index145 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index145 * 8 - - let result143 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array144.push(result143) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted147 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result146 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result146, - }) - } - _ => panic() - } + let lifted294 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted149 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result148 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result148, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result142, - allowed_suffixes: array144, - min: lifted147, - max: lifted149, - }) - } - 31 => { - let array173 : Array[@types.UnionBranch] = [] - for index174 = 0 - index174 < mbt_ffi_load32(iter_base + 12) - index174 = index174 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index174 * 92 - - let result150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted159 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result151 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result151) - } - 1 => { - let result152 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result152) - } - 2 => { - let result153 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result153) - } - 3 => { - let result154 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result154) - } - 4 => { - let result155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted157 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result156 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result156) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result155, - literal: lifted157, - }) - } - 5 => { - let result158 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result158) - } - _ => panic() - } - - let lifted161 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result160 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result160) - } - _ => panic() - } - - let array163 : Array[String] = [] - for index164 = 0 - index164 < mbt_ffi_load32(iter_base + 52) - index164 = index164 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index164 * 8 - - let result162 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array163.push(result162) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array166 : Array[String] = [] - for index167 = 0 - index167 < mbt_ffi_load32(iter_base + 60) - index167 = index167 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index167 * 8 - - let result165 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array166.push(result165) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted169 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result168 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result168) - } - _ => panic() - } - - let lifted172 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted171 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result170 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result170) - } - _ => panic() - } - - Option::Some(lifted171) - } - _ => panic() - } - - array173.push(@types.UnionBranch::{ - tag: result150, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted159, - metadata: @types.MetadataEnvelope::{ - doc: lifted161, - aliases: array163, - examples: array166, - deprecated: lifted169, - role: lifted172, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array173, - }) - } - 32 => { - let lifted176 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result175) - } - _ => panic() - } + @types.SchemaTypeBody::FutureType(lifted294) + } + 36 => { - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted176, - }) - } - 33 => { - let lifted178 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result177 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result177) - } - _ => panic() - } + let lifted295 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted178, - }) - } - 34 => { - let lifted179 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - @types.SchemaTypeBody::FutureType(lifted179) - } - 35 => { - let lifted180 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaTypeBody::StreamType(lifted295) + } + _ => panic() + } - @types.SchemaTypeBody::StreamType(lifted180) - } - _ => panic() - } - - let lifted183 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result182 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result182) - } - _ => panic() - } - - let array185 : Array[String] = [] - for index186 = 0 - index186 < mbt_ffi_load32(iter_base + 104) - index186 = index186 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index186 * 8 - - let result184 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array185.push(result184) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array188 : Array[String] = [] - for index189 = 0 - index189 < mbt_ffi_load32(iter_base + 112) - index189 = index189 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index189 * 8 - - let result187 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array188.push(result187) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted191 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result190 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result190) - } - _ => panic() - } - - let lifted194 : @types.Role? = match mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted193 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result192 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result192) - } - _ => panic() - } + let lifted298 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { - Option::Some(lifted193) - } - _ => panic() - } - - array195.push(@types.SchemaTypeNode::{ - body: lifted181, - metadata: @types.MetadataEnvelope::{ - doc: lifted183, - aliases: array185, - examples: array188, - deprecated: lifted191, - role: lifted194, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 32)) - - let array200 : Array[@types.SchemaTypeDef] = [] - for index201 = 0 - index201 < mbt_ffi_load32(return_area + 44) - index201 = index201 + 1 { - let iter_base = mbt_ffi_load32(return_area + 40) + index201 * 24 - - let result197 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted199 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result198 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result198) - } - _ => panic() - } - - array200.push(@types.SchemaTypeDef::{ - id: result197, - name: lifted199, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 40)) - - let lifted203 : String? = match mbt_ffi_load8_u(return_area + 52) { - 0 => Option::None - 1 => { - let result202 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 56), - mbt_ffi_load32(return_area + 60), - ) - - Option::Some(result202) - } - _ => panic() - } + let result297 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - let result204 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 64), - mbt_ffi_load32(return_area + 68), - ) + Option::Some(result297) + } + _ => panic() + } - let lifted206 : String? = match mbt_ffi_load8_u(return_area + 72) { - 0 => Option::None - 1 => { - let result205 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 76), - mbt_ffi_load32(return_area + 80), - ) - - Option::Some(result205) - } - _ => panic() - } + let array300 : Array[String] = []; + for index301 = 0; index301 < (mbt_ffi_load32((iter_base) + 104)); index301 = index301 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index301 * 8) - let lifted224 = match mbt_ffi_load8_u(return_area + 84) { - 0 => { - let array222 : Array[@common.NamedField] = [] - for index223 = 0 - index223 < mbt_ffi_load32(return_area + 92) - index223 = index223 + 1 { - let iter_base = mbt_ffi_load32(return_area + 88) + index223 * 72 - - let result207 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted208 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => @common.FieldSource::UserSupplied - 1 => - @common.FieldSource::AutoInjected( - @common.AutoInjectedKind::from(mbt_ffi_load8_u(iter_base + 9)), - ) - _ => panic() - } + let result299 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array300.push(result299) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array303 : Array[String] = []; + for index304 = 0; index304 < (mbt_ffi_load32((iter_base) + 112)); index304 = index304 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index304 * 8) + + let result302 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted210 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result209 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result209) - } - _ => panic() - } + array303.push(result302) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - let array212 : Array[String] = [] - for index213 = 0 - index213 < mbt_ffi_load32(iter_base + 32) - index213 = index213 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index213 * 8 + let lifted306 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - let result211 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result305 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - array212.push(result211) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + Option::Some(result305) + } + _ => panic() + } - let array215 : Array[String] = [] - for index216 = 0 - index216 < mbt_ffi_load32(iter_base + 40) - index216 = index216 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index216 * 8 + let lifted309 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - let result214 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted308 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - array215.push(result214) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted218 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result217 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result217) - } - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - let lifted221 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted220 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result219 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + @types.Role::UnstructuredText + } + 2 => { - @types.Role::Other(result219) - } - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - Option::Some(lifted220) - } - _ => panic() - } + let result307 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - array222.push(@common.NamedField::{ - name: result207, - source: lifted208, - schema: mbt_ffi_load32(iter_base + 12), - metadata: @types.MetadataEnvelope::{ - doc: lifted210, - aliases: array212, - examples: array215, - deprecated: lifted218, - role: lifted221, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 88)) - - @common.InputSchema::Parameters(array222) - } - _ => panic() - } + @types.Role::Other(result307) + } + _ => panic() + } - let array272 : Array[@common.AgentMethod] = [] - for index273 = 0 - index273 < mbt_ffi_load32(return_area + 100) - index273 = index273 + 1 { - let iter_base = mbt_ffi_load32(return_area + 96) + index273 * 88 - - let result225 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result226 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array247 : Array[@common.HttpEndpointDetails] = [] - for index248 = 0 - index248 < mbt_ffi_load32(iter_base + 20) - index248 = index248 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index248 * 48 - - let lifted228 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @common.HttpMethod::Get - 1 => @common.HttpMethod::Head - 2 => @common.HttpMethod::Post - 3 => @common.HttpMethod::Put - 4 => @common.HttpMethod::Delete - 5 => @common.HttpMethod::Connect - 6 => @common.HttpMethod::Options - 7 => @common.HttpMethod::Trace - 8 => @common.HttpMethod::Patch - 9 => { - let result227 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.HttpMethod::Custom(result227) - } - _ => panic() - } - - let array233 : Array[@common.PathSegment] = [] - for index234 = 0 - index234 < mbt_ffi_load32(iter_base + 16) - index234 = index234 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index234 * 12 - - let lifted232 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result229 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::Literal(result229) - } - 1 => - @common.PathSegment::SystemVariable( - @common.SystemVariable::from(mbt_ffi_load8_u(iter_base + 4)), - ) - 2 => { - let result230 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::PathVariable(@common.PathVariable::{ - variable_name: result230, - }) - } - 3 => { - let result231 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::RemainingPathVariable(@common.PathVariable::{ - variable_name: result231, - }) - } - _ => panic() - } + Option::Some(lifted308) + } + _ => panic() + } - array233.push(lifted232) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - let array237 : Array[@common.HeaderVariable] = [] - for index238 = 0 - index238 < mbt_ffi_load32(iter_base + 24) - index238 = index238 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index238 * 16 - - let result235 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result236 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array237.push(@common.HeaderVariable::{ - header_name: result235, - variable_name: result236, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - let array241 : Array[@common.QueryVariable] = [] - for index242 = 0 - index242 < mbt_ffi_load32(iter_base + 32) - index242 = index242 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index242 * 16 - - let result239 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result240 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array241.push(@common.QueryVariable::{ - query_param_name: result239, - variable_name: result240, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let lifted243 : @common.AuthDetails? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => - Option::Some(@common.AuthDetails::{ - required: mbt_ffi_load8_u(iter_base + 37) != 0, - }) - _ => panic() - } - - let array245 : Array[String] = [] - for index246 = 0 - index246 < mbt_ffi_load32(iter_base + 44) - index246 = index246 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index246 * 8 - - let result244 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array245.push(result244) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - array247.push(@common.HttpEndpointDetails::{ - http_method: lifted228, - path_suffix: array233, - header_vars: array237, - query_vars: array241, - auth_details: lifted243, - cors_options: @common.CorsOptions::{ allowed_patterns: array245 }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted250 : String? = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result249 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result249) - } - _ => panic() - } - - let lifted268 = match mbt_ffi_load8_u(iter_base + 36) { - 0 => { - let array266 : Array[@common.NamedField] = [] - for index267 = 0 - index267 < mbt_ffi_load32(iter_base + 44) - index267 = index267 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index267 * 72 - - let result251 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted252 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => @common.FieldSource::UserSupplied - 1 => - @common.FieldSource::AutoInjected( - @common.AutoInjectedKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - ) - _ => panic() - } - - let lifted254 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result253 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result253) - } - _ => panic() - } - - let array256 : Array[String] = [] - for index257 = 0 - index257 < mbt_ffi_load32(iter_base + 32) - index257 = index257 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index257 * 8 - - let result255 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array256.push(result255) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array259 : Array[String] = [] - for index260 = 0 - index260 < mbt_ffi_load32(iter_base + 40) - index260 = index260 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index260 * 8 - - let result258 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array259.push(result258) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted262 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result261 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result261) - } - _ => panic() - } - - let lifted265 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted264 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result263 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result263) - } - _ => panic() - } - - Option::Some(lifted264) - } - _ => panic() - } - - array266.push(@common.NamedField::{ - name: result251, - source: lifted252, - schema: mbt_ffi_load32(iter_base + 12), - metadata: @types.MetadataEnvelope::{ - doc: lifted254, - aliases: array256, - examples: array259, - deprecated: lifted262, - role: lifted265, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - @common.InputSchema::Parameters(array266) - } - _ => panic() - } - - let lifted269 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => @common.OutputSchema::Unit - 1 => @common.OutputSchema::Single(mbt_ffi_load32(iter_base + 52)) - _ => panic() - } - - let lifted271 : @common.ReadOnlyConfig? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted270 = match mbt_ffi_load8_u(iter_base + 64) { - 0 => @common.CachePolicy::NoCache - 1 => @common.CachePolicy::UntilWrite - 2 => - @common.CachePolicy::Ttl( - mbt_ffi_load64(iter_base + 72).reinterpret_as_uint64(), - ) - _ => panic() - } + array310.push(@types.SchemaTypeNode::{body : lifted296, metadata : @types.MetadataEnvelope::{doc : lifted298, aliases : array300, examples : array303, deprecated : lifted306, role : lifted309}}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 12)) - Option::Some(@common.ReadOnlyConfig::{ - cache_policy: lifted270, - uses_principal: mbt_ffi_load8_u(iter_base + 80) != 0, - }) - } - _ => panic() - } - - array272.push(@common.AgentMethod::{ - name: result225, - description: result226, - http_endpoint: array247, - prompt_hint: lifted250, - input_schema: lifted268, - output_schema: lifted269, - read_only: lifted271, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 96)) - - let array552 : Array[@common.AgentDependency] = [] - for index553 = 0 - index553 < mbt_ffi_load32(return_area + 108) - index553 = index553 + 1 { - let iter_base = mbt_ffi_load32(return_area + 104) + index553 * 92 - - let result274 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted276 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result275 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result275) - } - _ => panic() - } - - let array473 : Array[@types.SchemaTypeNode] = [] - for index474 = 0 - index474 < mbt_ffi_load32(iter_base + 24) - index474 = index474 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index474 * 144 - - let lifted459 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted283 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted278 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted277 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted277) - } - _ => panic() - } - - let lifted280 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted279 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array315 : Array[@types.SchemaTypeDef] = []; + for index316 = 0; index316 < (mbt_ffi_load32((return_area) + 24)); index316 = index316 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 20)) + (index316 * 24) - Option::Some(lifted279) - } - _ => panic() - } + let result312 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted282 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result281 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted314 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(result281) - } - _ => panic() - } + let result313 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - Option::Some(@types.NumericRestrictions::{ - min: lifted278, - max: lifted280, - unit: lifted282, - }) - } - _ => panic() - } + Option::Some(result313) + } + _ => panic() + } - @types.SchemaTypeBody::S8Type(lifted283) - } - 3 => { - let lifted290 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted285 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted284 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted284) - } - _ => panic() - } - - let lifted287 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted286 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array315.push(@types.SchemaTypeDef::{id : result312, name : lifted314, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 20)) - Option::Some(lifted286) - } - _ => panic() - } + let array346 : Array[@types.SchemaValueNode] = []; + for index347 = 0; index347 < (mbt_ffi_load32((return_area) + 36)); index347 = index347 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 32)) + (index347 * 32) - let lifted289 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result288 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted345 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - Option::Some(result288) - } - _ => panic() - } + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted285, - max: lifted287, - unit: lifted289, - }) - } - _ => panic() - } + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - @types.SchemaTypeBody::S16Type(lifted290) - } - 4 => { - let lifted297 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted292 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted291 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted291) - } - _ => panic() - } - - let lifted294 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted293 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - Option::Some(lifted293) - } - _ => panic() - } + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - let lifted296 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result295 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - Option::Some(result295) - } - _ => panic() - } + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted292, - max: lifted294, - unit: lifted296, - }) - } - _ => panic() - } + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - @types.SchemaTypeBody::S32Type(lifted297) - } - 5 => { - let lifted304 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted299 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted298 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted298) - } - _ => panic() - } - - let lifted301 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted300 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - Option::Some(lifted300) - } - _ => panic() - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - let lifted303 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result302 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - Option::Some(result302) - } - _ => panic() - } + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted299, - max: lifted301, - unit: lifted303, - }) - } - _ => panic() - } + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - @types.SchemaTypeBody::S64Type(lifted304) - } - 6 => { - let lifted311 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted306 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted305 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted305) - } - _ => panic() - } - - let lifted308 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted307 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result317 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted307) - } - _ => panic() - } + @types.SchemaValueNode::StringValue(result317) + } + 13 => { - let lifted310 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result309 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let array318 : Array[Int] = []; + for index319 = 0; index319 < (mbt_ffi_load32((iter_base) + 12)); index319 = index319 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index319 * 4) - Option::Some(result309) - } - _ => panic() - } + array318.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(@types.NumericRestrictions::{ - min: lifted306, - max: lifted308, - unit: lifted310, - }) - } - _ => panic() - } + @types.SchemaValueNode::RecordValue(array318) + } + 14 => { - @types.SchemaTypeBody::U8Type(lifted311) - } - 7 => { - let lifted318 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted313 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted312 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted312) - } - _ => panic() - } - - let lifted315 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted314 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted320 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted314) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let lifted317 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result316 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted320}) + } + 15 => { - Option::Some(result316) - } - _ => panic() - } + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted313, - max: lifted315, - unit: lifted317, - }) - } - _ => panic() - } + let array321 : Array[Bool] = []; + for index322 = 0; index322 < (mbt_ffi_load32((iter_base) + 12)); index322 = index322 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index322 * 1) - @types.SchemaTypeBody::U16Type(lifted318) - } - 8 => { - let lifted325 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted320 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted319 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted319) - } - _ => panic() - } - - let lifted322 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted321 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array321.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted321) - } - _ => panic() - } + @types.SchemaValueNode::FlagsValue(array321) + } + 17 => { - let lifted324 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result323 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let array323 : Array[Int] = []; + for index324 = 0; index324 < (mbt_ffi_load32((iter_base) + 12)); index324 = index324 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index324 * 4) - Option::Some(result323) - } - _ => panic() - } + array323.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(@types.NumericRestrictions::{ - min: lifted320, - max: lifted322, - unit: lifted324, - }) - } - _ => panic() - } + @types.SchemaValueNode::TupleValue(array323) + } + 18 => { - @types.SchemaTypeBody::U32Type(lifted325) - } - 9 => { - let lifted332 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted327 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted326 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted326) - } - _ => panic() - } - - let lifted329 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted328 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array325 : Array[Int] = []; + for index326 = 0; index326 < (mbt_ffi_load32((iter_base) + 12)); index326 = index326 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index326 * 4) - Option::Some(lifted328) - } - _ => panic() - } + array325.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted331 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result330 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::ListValue(array325) + } + 19 => { - Option::Some(result330) - } - _ => panic() - } + let array327 : Array[Int] = []; + for index328 = 0; index328 < (mbt_ffi_load32((iter_base) + 12)); index328 = index328 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index328 * 4) - Option::Some(@types.NumericRestrictions::{ - min: lifted327, - max: lifted329, - unit: lifted331, - }) - } - _ => panic() - } + array327.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.SchemaTypeBody::U64Type(lifted332) - } - 10 => { - let lifted339 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted334 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted333 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted333) - } - _ => panic() - } - - let lifted336 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted335 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::FixedListValue(array327) + } + 20 => { - Option::Some(lifted335) - } - _ => panic() - } + let array329 : Array[@types.MapEntry] = []; + for index330 = 0; index330 < (mbt_ffi_load32((iter_base) + 12)); index330 = index330 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index330 * 8) - let lifted338 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result337 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + array329.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(result337) - } - _ => panic() - } + @types.SchemaValueNode::MapValue(array329) + } + 21 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted334, - max: lifted336, - unit: lifted338, - }) - } - _ => panic() - } + let lifted331 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::F32Type(lifted339) - } - 11 => { - let lifted346 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted341 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted340 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted340) - } - _ => panic() - } - - let lifted343 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted342 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted342) - } - _ => panic() - } + @types.SchemaValueNode::OptionValue(lifted331) + } + 22 => { - let lifted345 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result344 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted334 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - Option::Some(result344) - } - _ => panic() - } + let lifted332 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted341, - max: lifted343, - unit: lifted345, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - @types.SchemaTypeBody::F64Type(lifted346) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array361 : Array[@types.NamedFieldType] = [] - for index362 = 0 - index362 < mbt_ffi_load32(iter_base + 12) - index362 = index362 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index362 * 68 - - let result347 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted349 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result348 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.ResultValuePayload::OkValue(lifted332) + } + 1 => { - Option::Some(result348) - } - _ => panic() - } - - let array351 : Array[String] = [] - for index352 = 0 - index352 < mbt_ffi_load32(iter_base + 28) - index352 = index352 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index352 * 8 - - let result350 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array351.push(result350) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array354 : Array[String] = [] - for index355 = 0 - index355 < mbt_ffi_load32(iter_base + 36) - index355 = index355 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index355 * 8 - - let result353 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array354.push(result353) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted357 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result356 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) + let lifted333 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(result356) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let lifted360 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted359 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result358 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result358) - } - _ => panic() - } - - Option::Some(lifted359) - } - _ => panic() - } - - array361.push(@types.NamedFieldType::{ - name: result347, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted349, - aliases: array351, - examples: array354, - deprecated: lifted357, - role: lifted360, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array361) - } - 15 => { - let array378 : Array[@types.VariantCaseType] = [] - for index379 = 0 - index379 < mbt_ffi_load32(iter_base + 12) - index379 = index379 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index379 * 72 - - let result363 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted364 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.ResultValuePayload::ErrValue(lifted333) + } + _ => panic() + } - let lifted366 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result365 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.SchemaValueNode::ResultValue(lifted334) + } + 23 => { - Option::Some(result365) - } - _ => panic() - } - - let array368 : Array[String] = [] - for index369 = 0 - index369 < mbt_ffi_load32(iter_base + 32) - index369 = index369 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index369 * 8 - - let result367 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array368.push(result367) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array371 : Array[String] = [] - for index372 = 0 - index372 < mbt_ffi_load32(iter_base + 40) - index372 = index372 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index372 * 8 - - let result370 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array371.push(result370) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted374 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result373 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) + let result335 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(result373) - } - _ => panic() - } + let lifted337 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted377 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted376 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result375 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result375) - } - _ => panic() - } - - Option::Some(lifted376) - } - _ => panic() - } - - array378.push(@types.VariantCaseType::{ - name: result363, - payload: lifted364, - metadata: @types.MetadataEnvelope::{ - doc: lifted366, - aliases: array368, - examples: array371, - deprecated: lifted374, - role: lifted377, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array378) - } - 16 => { - let array381 : Array[String] = [] - for index382 = 0 - index382 < mbt_ffi_load32(iter_base + 12) - index382 = index382 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index382 * 8 - - let result380 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array381.push(result380) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array381) - } - 17 => { - let array384 : Array[String] = [] - for index385 = 0 - index385 < mbt_ffi_load32(iter_base + 12) - index385 = index385 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index385 * 8 - - let result383 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array384.push(result383) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array384) - } - 18 => { - let array386 : Array[Int] = [] - for index387 = 0 - index387 < mbt_ffi_load32(iter_base + 12) - index387 = index387 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index387 * 4 - - array386.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array386) - } - 19 => @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted388 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted389 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted388, - err: lifted389, - }) - } - 24 => { - let lifted393 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array391 : Array[String] = [] - for index392 = 0 - index392 < mbt_ffi_load32(iter_base + 16) - index392 = index392 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index392 * 8 - - let result390 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array391.push(result390) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array391) - } - _ => panic() - } - - let lifted394 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted395 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted397 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result396 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result396) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted393, - min_length: lifted394, - max_length: lifted395, - regex: lifted397, - }) - } - 25 => { - let lifted401 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array399 : Array[String] = [] - for index400 = 0 - index400 < mbt_ffi_load32(iter_base + 16) - index400 = index400 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index400 * 8 - - let result398 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array399.push(result398) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array399) - } - _ => panic() - } - - let lifted402 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted403 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted401, - min_bytes: lifted402, - max_bytes: lifted403, - }) - } - 26 => { - let lifted407 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array405 : Array[String] = [] - for index406 = 0 - index406 < mbt_ffi_load32(iter_base + 20) - index406 = index406 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index406 * 8 - - let result404 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array405.push(result404) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array405) - } - _ => panic() - } - - let lifted411 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array409 : Array[String] = [] - for index410 = 0 - index410 < mbt_ffi_load32(iter_base + 32) - index410 = index410 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index410 * 8 - - let result408 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array409.push(result408) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array409) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted407, - allowed_extensions: lifted411, - }) - } - 27 => { - let lifted415 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array413 : Array[String] = [] - for index414 = 0 - index414 < mbt_ffi_load32(iter_base + 16) - index414 = index414 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index414 * 8 - - let result412 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array413.push(result412) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array413) - } - _ => panic() - } - - let lifted419 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array417 : Array[String] = [] - for index418 = 0 - index418 < mbt_ffi_load32(iter_base + 28) - index418 = index418 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index418 * 8 - - let result416 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array417.push(result416) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array417) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted415, - allowed_hosts: lifted419, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result420 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array422 : Array[String] = [] - for index423 = 0 - index423 < mbt_ffi_load32(iter_base + 20) - index423 = index423 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index423 * 8 - - let result421 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array422.push(result421) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted425 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result424 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result424, - }) - } - _ => panic() - } - - let lifted427 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result426 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result426, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result420, - allowed_suffixes: array422, - min: lifted425, - max: lifted427, - }) - } - 31 => { - let array451 : Array[@types.UnionBranch] = [] - for index452 = 0 - index452 < mbt_ffi_load32(iter_base + 12) - index452 = index452 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index452 * 92 - - let result428 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted437 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result429 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let result336 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - @types.DiscriminatorRule::Prefix(result429) - } - 1 => { - let result430 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + Option::Some(result336) + } + _ => panic() + } - @types.DiscriminatorRule::Suffix(result430) - } - 2 => { - let result431 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result335, language : lifted337}) + } + 24 => { - @types.DiscriminatorRule::Contains(result431) - } - 3 => { - let result432 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let result338 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.DiscriminatorRule::Regex(result432) - } - 4 => { - let result433 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted435 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result434 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result434) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result433, - literal: lifted435, - }) - } - 5 => { - let result436 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let lifted340 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - @types.DiscriminatorRule::FieldAbsent(result436) - } - _ => panic() - } + let result339 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted439 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result438 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + Option::Some(result339) + } + _ => panic() + } - Option::Some(result438) - } - _ => panic() - } - - let array441 : Array[String] = [] - for index442 = 0 - index442 < mbt_ffi_load32(iter_base + 52) - index442 = index442 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index442 * 8 - - let result440 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array441.push(result440) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array444 : Array[String] = [] - for index445 = 0 - index445 < mbt_ffi_load32(iter_base + 60) - index445 = index445 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index445 * 8 - - let result443 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array444.push(result443) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted447 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result446 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result338, mime_type : lifted340}) + } + 25 => { - Option::Some(result446) - } - _ => panic() - } + let result341 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let lifted450 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted449 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result448 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result448) - } - _ => panic() - } - - Option::Some(lifted449) - } - _ => panic() - } - - array451.push(@types.UnionBranch::{ - tag: result428, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted437, - metadata: @types.MetadataEnvelope::{ - doc: lifted439, - aliases: array441, - examples: array444, - deprecated: lifted447, - role: lifted450, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array451, - }) - } - 32 => { - let lifted454 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result453 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result453) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted454, - }) - } - 33 => { - let lifted456 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result455 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result455) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted456, - }) - } - 34 => { - let lifted457 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted457) - } - 35 => { - let lifted458 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted458) - } - _ => panic() - } + @types.SchemaValueNode::PathValue(result341) + } + 26 => { - let lifted461 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result460 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) + let result342 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(result460) - } - _ => panic() - } - - let array463 : Array[String] = [] - for index464 = 0 - index464 < mbt_ffi_load32(iter_base + 104) - index464 = index464 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index464 * 8 - - let result462 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array463.push(result462) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array466 : Array[String] = [] - for index467 = 0 - index467 < mbt_ffi_load32(iter_base + 112) - index467 = index467 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index467 * 8 - - let result465 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array466.push(result465) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted469 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result468 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) + @types.SchemaValueNode::UrlValue(result342) + } + 27 => { - Option::Some(result468) - } - _ => panic() - } + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - let lifted472 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted471 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result470 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result470) - } - _ => panic() - } - - Option::Some(lifted471) - } - _ => panic() - } - - array473.push(@types.SchemaTypeNode::{ - body: lifted459, - metadata: @types.MetadataEnvelope::{ - doc: lifted461, - aliases: array463, - examples: array466, - deprecated: lifted469, - role: lifted472, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - let array478 : Array[@types.SchemaTypeDef] = [] - for index479 = 0 - index479 < mbt_ffi_load32(iter_base + 32) - index479 = index479 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index479 * 24 - - let result475 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted477 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result476 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - Option::Some(result476) - } - _ => panic() - } - - array478.push(@types.SchemaTypeDef::{ - id: result475, - name: lifted477, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let lifted481 : String? = match mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result480 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result480) - } - _ => panic() - } - - let result482 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - let lifted484 : String? = match mbt_ffi_load8_u(iter_base + 60) { - 0 => Option::None - 1 => { - let result483 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - Option::Some(result483) - } - _ => panic() - } - - let lifted502 = match mbt_ffi_load8_u(iter_base + 72) { - 0 => { - let array500 : Array[@common.NamedField] = [] - for index501 = 0 - index501 < mbt_ffi_load32(iter_base + 80) - index501 = index501 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 76) + index501 * 72 - - let result485 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted486 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => @common.FieldSource::UserSupplied - 1 => - @common.FieldSource::AutoInjected( - @common.AutoInjectedKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - ) - _ => panic() - } - - let lifted488 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result487 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result487) - } - _ => panic() - } - - let array490 : Array[String] = [] - for index491 = 0 - index491 < mbt_ffi_load32(iter_base + 32) - index491 = index491 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index491 * 8 - - let result489 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array490.push(result489) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array493 : Array[String] = [] - for index494 = 0 - index494 < mbt_ffi_load32(iter_base + 40) - index494 = index494 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index494 * 8 - - let result492 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array493.push(result492) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted496 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result495 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result495) - } - _ => panic() - } - - let lifted499 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted498 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result497 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result497) - } - _ => panic() - } - - Option::Some(lifted498) - } - _ => panic() - } - - array500.push(@common.NamedField::{ - name: result485, - source: lifted486, - schema: mbt_ffi_load32(iter_base + 12), - metadata: @types.MetadataEnvelope::{ - doc: lifted488, - aliases: array490, - examples: array493, - deprecated: lifted496, - role: lifted499, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - - @common.InputSchema::Parameters(array500) - } - _ => panic() - } - - let array550 : Array[@common.AgentMethod] = [] - for index551 = 0 - index551 < mbt_ffi_load32(iter_base + 88) - index551 = index551 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 84) + index551 * 88 - - let result503 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result504 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array525 : Array[@common.HttpEndpointDetails] = [] - for index526 = 0 - index526 < mbt_ffi_load32(iter_base + 20) - index526 = index526 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index526 * 48 - - let lifted506 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @common.HttpMethod::Get - 1 => @common.HttpMethod::Head - 2 => @common.HttpMethod::Post - 3 => @common.HttpMethod::Put - 4 => @common.HttpMethod::Delete - 5 => @common.HttpMethod::Connect - 6 => @common.HttpMethod::Options - 7 => @common.HttpMethod::Trace - 8 => @common.HttpMethod::Patch - 9 => { - let result505 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.HttpMethod::Custom(result505) - } - _ => panic() - } + let result343 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let array511 : Array[@common.PathSegment] = [] - for index512 = 0 - index512 < mbt_ffi_load32(iter_base + 16) - index512 = index512 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index512 * 12 - - let lifted510 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result507 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::Literal(result507) - } - 1 => - @common.PathSegment::SystemVariable( - @common.SystemVariable::from(mbt_ffi_load8_u(iter_base + 4)), - ) - 2 => { - let result508 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::PathVariable(@common.PathVariable::{ - variable_name: result508, - }) - } - 3 => { - let result509 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::RemainingPathVariable(@common.PathVariable::{ - variable_name: result509, - }) - } - _ => panic() - } - - array511.push(lifted510) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - let array515 : Array[@common.HeaderVariable] = [] - for index516 = 0 - index516 < mbt_ffi_load32(iter_base + 24) - index516 = index516 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index516 * 16 - - let result513 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result514 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array515.push(@common.HeaderVariable::{ - header_name: result513, - variable_name: result514, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - let array519 : Array[@common.QueryVariable] = [] - for index520 = 0 - index520 < mbt_ffi_load32(iter_base + 32) - index520 = index520 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index520 * 16 - - let result517 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result518 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array519.push(@common.QueryVariable::{ - query_param_name: result517, - variable_name: result518, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let lifted521 : @common.AuthDetails? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => - Option::Some(@common.AuthDetails::{ - required: mbt_ffi_load8_u(iter_base + 37) != 0, - }) - _ => panic() - } + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result343}) + } + 30 => { - let array523 : Array[String] = [] - for index524 = 0 - index524 < mbt_ffi_load32(iter_base + 44) - index524 = index524 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index524 * 8 + let result344 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result522 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result344, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - array523.push(result522) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - array525.push(@common.HttpEndpointDetails::{ - http_method: lifted506, - path_suffix: array511, - header_vars: array515, - query_vars: array519, - auth_details: lifted521, - cors_options: @common.CorsOptions::{ allowed_patterns: array523 }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted528 : String? = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result527 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - Option::Some(result527) - } - _ => panic() - } + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - let lifted546 = match mbt_ffi_load8_u(iter_base + 36) { - 0 => { - let array544 : Array[@common.NamedField] = [] - for index545 = 0 - index545 < mbt_ffi_load32(iter_base + 44) - index545 = index545 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index545 * 72 - - let result529 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted530 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => @common.FieldSource::UserSupplied - 1 => - @common.FieldSource::AutoInjected( - @common.AutoInjectedKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - ) - _ => panic() - } + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } - let lifted532 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result531 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + array346.push(lifted345) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 32)) - Option::Some(result531) - } - _ => panic() - } - - let array534 : Array[String] = [] - for index535 = 0 - index535 < mbt_ffi_load32(iter_base + 32) - index535 = index535 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index535 * 8 - - let result533 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array534.push(result533) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array537 : Array[String] = [] - for index538 = 0 - index538 < mbt_ffi_load32(iter_base + 40) - index538 = index538 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index538 * 8 - - let result536 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array537.push(result536) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted540 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result539 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) + @common.AgentError::CustomError(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array310, defs : array315, root : mbt_ffi_load32((return_area) + 28)}, value : @types.SchemaValueTree::{value_nodes : array346, root : mbt_ffi_load32((return_area) + 40)}}) + } + _ => panic() + } - Option::Some(result539) + RpcError::RemoteAgentError(lifted348) + } + _ => panic() } - _ => panic() - } - let lifted543 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted542 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result541 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result541) - } - _ => panic() - } - - Option::Some(lifted542) - } - _ => panic() - } - - array544.push(@common.NamedField::{ - name: result529, - source: lifted530, - schema: mbt_ffi_load32(iter_base + 12), - metadata: @types.MetadataEnvelope::{ - doc: lifted532, - aliases: array534, - examples: array537, - deprecated: lifted540, - role: lifted543, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - @common.InputSchema::Parameters(array544) + Result::Err(lifted349) } _ => panic() - } + } + let ret = lifted350 + mbt_ffi_free(ptr) + mbt_ffi_free(address69) + mbt_ffi_free(return_area) - let lifted547 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => @common.OutputSchema::Unit - 1 => @common.OutputSchema::Single(mbt_ffi_load32(iter_base + 52)) - _ => panic() - } + cleanup_list.each(mbt_ffi_free) + return ret - let lifted549 : @common.ReadOnlyConfig? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted548 = match mbt_ffi_load8_u(iter_base + 64) { - 0 => @common.CachePolicy::NoCache - 1 => @common.CachePolicy::UntilWrite - 2 => - @common.CachePolicy::Ttl( - mbt_ffi_load64(iter_base + 72).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(@common.ReadOnlyConfig::{ - cache_policy: lifted548, - uses_principal: mbt_ffi_load8_u(iter_base + 80) != 0, - }) - } - _ => panic() - } - - array550.push(@common.AgentMethod::{ - name: result503, - description: result504, - http_endpoint: array525, - prompt_hint: lifted528, - input_schema: lifted546, - output_schema: lifted547, - read_only: lifted549, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - - array552.push(@common.AgentDependency::{ - type_name: result274, - description: lifted276, - schema: @types.SchemaGraph::{ - type_nodes: array473, - defs: array478, - root: mbt_ffi_load32(iter_base + 36), - }, - constructor_: @common.AgentConstructor::{ - name: lifted481, - description: result482, - prompt_hint: lifted484, - input_schema: lifted502, - }, - methods: array550, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 104)) - - let lifted570 : @common.HttpMountDetails? = match - mbt_ffi_load8_u(return_area + 116) { - 0 => Option::None - 1 => { - let array558 : Array[@common.PathSegment] = [] - for index559 = 0 - index559 < mbt_ffi_load32(return_area + 124) - index559 = index559 + 1 { - let iter_base = mbt_ffi_load32(return_area + 120) + index559 * 12 - - let lifted557 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result554 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::Literal(result554) - } - 1 => - @common.PathSegment::SystemVariable( - @common.SystemVariable::from(mbt_ffi_load8_u(iter_base + 4)), - ) - 2 => { - let result555 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::PathVariable(@common.PathVariable::{ - variable_name: result555, - }) - } - 3 => { - let result556 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::RemainingPathVariable(@common.PathVariable::{ - variable_name: result556, - }) - } - _ => panic() - } +} +///| +/// Triggers the invocation of a remote method with the given parameters, +/// and returns its final identity immediately. +pub fn WasmRpc::invoke(self : WasmRpc, method_name : String, input : @types.SchemaValueTree, scope_card : @types.PermissionCard?) -> Result[InvocationMetadata, RpcError] { + let cleanup_list : Array[Int] = [] - array558.push(lifted557) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 120)) + let WasmRpc(handle) = self - let lifted560 : @common.AuthDetails? = match - mbt_ffi_load8_u(return_area + 128) { - 0 => Option::None - 1 => - Option::Some(@common.AuthDetails::{ - required: mbt_ffi_load8_u(return_area + 129) != 0, - }) - _ => panic() - } - - let array562 : Array[String] = [] - for index563 = 0 - index563 < mbt_ffi_load32(return_area + 136) - index563 = index563 + 1 { - let iter_base = mbt_ffi_load32(return_area + 132) + index563 * 8 - - let result561 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array562.push(result561) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 132)) - - let array568 : Array[@common.PathSegment] = [] - for index569 = 0 - index569 < mbt_ffi_load32(return_area + 144) - index569 = index569 + 1 { - let iter_base = mbt_ffi_load32(return_area + 140) + index569 * 12 - - let lifted567 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result564 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::Literal(result564) - } - 1 => - @common.PathSegment::SystemVariable( - @common.SystemVariable::from(mbt_ffi_load8_u(iter_base + 4)), - ) - 2 => { - let result565 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::PathVariable(@common.PathVariable::{ - variable_name: result565, - }) - } - 3 => { - let result566 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.PathSegment::RemainingPathVariable(@common.PathVariable::{ - variable_name: result566, - }) - } - _ => panic() - } + let ptr = mbt_ffi_str2ptr(method_name) - array568.push(lifted567) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 140)) - - Option::Some(@common.HttpMountDetails::{ - path_prefix: array558, - auth_details: lifted560, - phantom_agent: mbt_ffi_load8_u(return_area + 130) != 0, - cors_options: @common.CorsOptions::{ allowed_patterns: array562 }, - webhook_suffix: array568, - }) - } - _ => panic() - } + let address69 = mbt_ffi_malloc(((input).value_nodes).length() * 32); + for index70 = 0; index70 < ((input).value_nodes).length(); index70 = index70 + 1 { + let iter_elem : @types.SchemaValueNode = ((input).value_nodes)[(index70)] + let iter_base = address69 + (index70 * 32); - let lifted572 = match mbt_ffi_load8_u(return_area + 152) { - 0 => @common.Snapshotting::Disabled - 1 => { - let lifted571 = match mbt_ffi_load8_u(return_area + 160) { - 0 => @common.SnapshottingConfig::Default - 1 => - @common.SnapshottingConfig::Periodic( - mbt_ffi_load64(return_area + 168).reinterpret_as_uint64(), - ) - 2 => - @common.SnapshottingConfig::EveryNInvocation( - mbt_ffi_load16_u(return_area + 168) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - _ => panic() - } + match iter_elem { + BoolValue(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) - @common.Snapshotting::Enabled(lifted571) - } - _ => panic() - } + () + } + S8Value(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) - let array576 : Array[@common.AgentConfigDeclaration] = [] - for index577 = 0 - index577 < mbt_ffi_load32(return_area + 180) - index577 = index577 + 1 { - let iter_base = mbt_ffi_load32(return_area + 176) + index577 * 16 - - let array574 : Array[String] = [] - for index575 = 0 - index575 < mbt_ffi_load32(iter_base + 8) - index575 = index575 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index575 * 8 - - let result573 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array574.push(result573) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - array576.push(@common.AgentConfigDeclaration::{ - source: @common.AgentConfigSource::from( - mbt_ffi_load8_u(iter_base + 0), - ), - path: array574, - value_type: mbt_ffi_load32(iter_base + 12), - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 176)) - - Option::Some(@common.RegisteredAgentType::{ - agent_type: @common.AgentType::{ - type_name: result, - description: result0, - source_language: result1, - schema: @types.SchemaGraph::{ - type_nodes: array195, - defs: array200, - root: mbt_ffi_load32(return_area + 48), - }, - constructor_: @common.AgentConstructor::{ - name: lifted203, - description: result204, - prompt_hint: lifted206, - input_schema: lifted224, - }, - methods: array272, - dependencies: array552, - mode: @common.AgentMode::from(mbt_ffi_load8_u(return_area + 112)), - http_mount: lifted570, - snapshotting: lifted572, - config: array576, - }, - implemented_by: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 184).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 192).reinterpret_as_uint64(), - }, - }, - }) - } - _ => panic() - } - let ret = lifted578 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + () + } + S16Value(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) -///| -/// Constructs a string agent-id from the agent type and its constructor parameters -/// and an optional phantom ID. -/// -/// `input` is a value tree whose root encodes the constructor's parameter list. -pub fn make_agent_id( - agent_type_name : String, - input : @types.SchemaValueTree, - phantom_id : @types.Uuid?, -) -> Result[String, @common.AgentError] { - let cleanup_list : Array[Int] = [] - - let ptr = mbt_ffi_str2ptr(agent_type_name) - - let address66 = mbt_ffi_malloc(input.value_nodes.length() * 32) - for index67 = 0; index67 < input.value_nodes.length(); index67 = index67 + 1 { - let iter_elem : @types.SchemaValueNode = input.value_nodes[index67] - let iter_base = address66 + index67 * 32 - - match iter_elem { - BoolValue(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) - - () - } - S8Value(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + () + } + S32Value(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) - () - } - S16Value(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + () + } + S64Value(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload3) - () - } - S32Value(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + () + } + U8Value(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload4).to_int()) - () - } - S64Value(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload3) + () + } + U16Value(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload5).reinterpret_as_int()) - () - } - U8Value(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload4.to_int()) + () + } + U32Value(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload6).reinterpret_as_int()) - () - } - U16Value(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload5.reinterpret_as_int()) + () + } + U64Value(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload7).reinterpret_as_int64()) - () - } - U32Value(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload6.reinterpret_as_int()) + () + } + F32Value(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload8) - () - } - U64Value(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload7.reinterpret_as_int64()) + () + } + F64Value(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload9) - () - } - F32Value(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload8) + () + } + CharValue(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload10).to_int()) - () - } - F64Value(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload9) + () + } + StringValue(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) - () - } - CharValue(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload10.to_int()) + let ptr12 = mbt_ffi_str2ptr(payload11) + mbt_ffi_store32((iter_base) + 12, payload11.length()) + mbt_ffi_store32((iter_base) + 8, ptr12) + cleanup_list.push(ptr12) - () - } - StringValue(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) + () + } + RecordValue(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) - let ptr12 = mbt_ffi_str2ptr(payload11) - mbt_ffi_store32(iter_base + 12, payload11.length()) - mbt_ffi_store32(iter_base + 8, ptr12) - cleanup_list.push(ptr12) + let address = mbt_ffi_malloc((payload13).length() * 4); + for index = 0; index < (payload13).length(); index = index + 1 { + let iter_elem : Int = (payload13)[(index)] + let iter_base = address + (index * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () - } - RecordValue(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address = mbt_ffi_malloc(payload13.length() * 4) - for index = 0; index < payload13.length(); index = index + 1 { - let iter_elem : Int = payload13[index] - let iter_base = address + index * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload13.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - VariantValue(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.case.reinterpret_as_int()) + } + mbt_ffi_store32((iter_base) + 12, (payload13).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) - match payload14.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + () + } + VariantValue(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload14).case).reinterpret_as_int()) - () - } - Some(payload16) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload16) + match ((payload14).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - } + () + } + Some(payload16) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload16) - () - } - EnumValue(payload17) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload17.reinterpret_as_int()) + () + } + } - () - } - FlagsValue(payload18) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address19 = mbt_ffi_malloc(payload18.length() * 1) - for index20 = 0; index20 < payload18.length(); index20 = index20 + 1 { - let iter_elem : Bool = payload18[index20] - let iter_base = address19 + index20 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload18.length()) - mbt_ffi_store32(iter_base + 8, address19) - cleanup_list.push(address19) - - () - } - TupleValue(payload21) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address22 = mbt_ffi_malloc(payload21.length() * 4) - for index23 = 0; index23 < payload21.length(); index23 = index23 + 1 { - let iter_elem : Int = payload21[index23] - let iter_base = address22 + index23 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, address22) - cleanup_list.push(address22) - - () - } - ListValue(payload24) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address25 = mbt_ffi_malloc(payload24.length() * 4) - for index26 = 0; index26 < payload24.length(); index26 = index26 + 1 { - let iter_elem : Int = payload24[index26] - let iter_base = address25 + index26 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, address25) - cleanup_list.push(address25) - - () - } - FixedListValue(payload27) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address28 = mbt_ffi_malloc(payload27.length() * 4) - for index29 = 0; index29 < payload27.length(); index29 = index29 + 1 { - let iter_elem : Int = payload27[index29] - let iter_base = address28 + index29 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, address28) - cleanup_list.push(address28) - - () - } - MapValue(payload30) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address31 = mbt_ffi_malloc(payload30.length() * 8) - for index32 = 0; index32 < payload30.length(); index32 = index32 + 1 { - let iter_elem : @types.MapEntry = payload30[index32] - let iter_base = address31 + index32 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload30.length()) - mbt_ffi_store32(iter_base + 8, address31) - cleanup_list.push(address31) - - () - } - OptionValue(payload33) => { - mbt_ffi_store8(iter_base + 0, 21) + () + } + EnumValue(payload17) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload17).reinterpret_as_int()) + + () + } + FlagsValue(payload18) => { + mbt_ffi_store8((iter_base) + 0, (16)) - match payload33 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let address19 = mbt_ffi_malloc((payload18).length() * 1); + for index20 = 0; index20 < (payload18).length(); index20 = index20 + 1 { + let iter_elem : Bool = (payload18)[(index20)] + let iter_base = address19 + (index20 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) - () - } - Some(payload35) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload35) + } + mbt_ffi_store32((iter_base) + 12, (payload18).length()) + mbt_ffi_store32((iter_base) + 8, address19) + cleanup_list.push(address19) - () - } - } + () + } + TupleValue(payload21) => { + mbt_ffi_store8((iter_base) + 0, (17)) - () - } - ResultValue(payload36) => { - mbt_ffi_store8(iter_base + 0, 22) + let address22 = mbt_ffi_malloc((payload21).length() * 4); + for index23 = 0; index23 < (payload21).length(); index23 = index23 + 1 { + let iter_elem : Int = (payload21)[(index23)] + let iter_base = address22 + (index23 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match payload36 { - OkValue(payload37) => { - mbt_ffi_store8(iter_base + 8, 0) + } + mbt_ffi_store32((iter_base) + 12, (payload21).length()) + mbt_ffi_store32((iter_base) + 8, address22) + cleanup_list.push(address22) - match payload37 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + () + } + ListValue(payload24) => { + mbt_ffi_store8((iter_base) + 0, (18)) - () - } - Some(payload39) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload39) + let address25 = mbt_ffi_malloc((payload24).length() * 4); + for index26 = 0; index26 < (payload24).length(); index26 = index26 + 1 { + let iter_elem : Int = (payload24)[(index26)] + let iter_base = address25 + (index26 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () - } - } + } + mbt_ffi_store32((iter_base) + 12, (payload24).length()) + mbt_ffi_store32((iter_base) + 8, address25) + cleanup_list.push(address25) - () - } - ErrValue(payload40) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + FixedListValue(payload27) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address28 = mbt_ffi_malloc((payload27).length() * 4); + for index29 = 0; index29 < (payload27).length(); index29 = index29 + 1 { + let iter_elem : Int = (payload27)[(index29)] + let iter_base = address28 + (index29 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match payload40 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + } + mbt_ffi_store32((iter_base) + 12, (payload27).length()) + mbt_ffi_store32((iter_base) + 8, address28) + cleanup_list.push(address28) - () - } - Some(payload42) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload42) + () + } + MapValue(payload30) => { + mbt_ffi_store8((iter_base) + 0, (20)) - () - } - } + let address31 = mbt_ffi_malloc((payload30).length() * 8); + for index32 = 0; index32 < (payload30).length(); index32 = index32 + 1 { + let iter_elem : @types.MapEntry = (payload30)[(index32)] + let iter_base = address31 + (index32 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) - () - } - } + } + mbt_ffi_store32((iter_base) + 12, (payload30).length()) + mbt_ffi_store32((iter_base) + 8, address31) + cleanup_list.push(address31) - () - } - TextValue(payload43) => { - mbt_ffi_store8(iter_base + 0, 23) + () + } + OptionValue(payload33) => { + mbt_ffi_store8((iter_base) + 0, (21)) - let ptr44 = mbt_ffi_str2ptr(payload43.text) - mbt_ffi_store32(iter_base + 12, payload43.text.length()) - mbt_ffi_store32(iter_base + 8, ptr44) + match (payload33) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload43.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + Some(payload35) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload35) - () - } - Some(payload46) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + } - let ptr47 = mbt_ffi_str2ptr(payload46) - mbt_ffi_store32(iter_base + 24, payload46.length()) - mbt_ffi_store32(iter_base + 20, ptr47) - cleanup_list.push(ptr47) + () + } + ResultValue(payload36) => { + mbt_ffi_store8((iter_base) + 0, (22)) - () - } - } - cleanup_list.push(ptr44) + match payload36 { + OkValue(payload37) => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - BinaryValue(payload48) => { - mbt_ffi_store8(iter_base + 0, 24) + match (payload37) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - let ptr49 = mbt_ffi_bytes2ptr(payload48.bytes) + () + } + Some(payload39) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload39) - mbt_ffi_store32(iter_base + 12, payload48.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr49) + () + } + } - match payload48.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + ErrValue(payload40) => { + mbt_ffi_store8((iter_base) + 8, (1)) - () - } - Some(payload51) => { - mbt_ffi_store8(iter_base + 16, 1) + match (payload40) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - let ptr52 = mbt_ffi_str2ptr(payload51) - mbt_ffi_store32(iter_base + 24, payload51.length()) - mbt_ffi_store32(iter_base + 20, ptr52) - cleanup_list.push(ptr52) + () + } + Some(payload42) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload42) - () - } - } - cleanup_list.push(ptr49) + () + } + } - () - } - PathValue(payload53) => { - mbt_ffi_store8(iter_base + 0, 25) + () + } + } - let ptr54 = mbt_ffi_str2ptr(payload53) - mbt_ffi_store32(iter_base + 12, payload53.length()) - mbt_ffi_store32(iter_base + 8, ptr54) - cleanup_list.push(ptr54) + () + } + TextValue(payload43) => { + mbt_ffi_store8((iter_base) + 0, (23)) - () - } - UrlValue(payload55) => { - mbt_ffi_store8(iter_base + 0, 26) + let ptr44 = mbt_ffi_str2ptr((payload43).text) + mbt_ffi_store32((iter_base) + 12, (payload43).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) - let ptr56 = mbt_ffi_str2ptr(payload55) - mbt_ffi_store32(iter_base + 12, payload55.length()) - mbt_ffi_store32(iter_base + 8, ptr56) - cleanup_list.push(ptr56) + match ((payload43).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - () - } - DatetimeValue(payload57) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload57.seconds) - mbt_ffi_store32( - iter_base + 16, - payload57.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload58) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload58.nanoseconds) + () + } + Some(payload46) => { + mbt_ffi_store8((iter_base) + 16, (1)) - () - } - QuantityValueNode(payload59) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload59.mantissa) - mbt_ffi_store32(iter_base + 16, payload59.scale) + let ptr47 = mbt_ffi_str2ptr(payload46) + mbt_ffi_store32((iter_base) + 24, payload46.length()) + mbt_ffi_store32((iter_base) + 20, ptr47) + cleanup_list.push(ptr47) - let ptr60 = mbt_ffi_str2ptr(payload59.unit) - mbt_ffi_store32(iter_base + 24, payload59.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr60) - cleanup_list.push(ptr60) + () + } + } + cleanup_list.push(ptr44) - () - } - UnionValue(payload61) => { - mbt_ffi_store8(iter_base + 0, 30) + () + } + BinaryValue(payload48) => { + mbt_ffi_store8((iter_base) + 0, (24)) - let ptr62 = mbt_ffi_str2ptr(payload61.tag) - mbt_ffi_store32(iter_base + 12, payload61.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr62) - mbt_ffi_store32(iter_base + 16, payload61.body) - cleanup_list.push(ptr62) + let ptr49 = mbt_ffi_bytes2ptr((payload48).bytes) - () - } - SecretValue(payload63) => { - mbt_ffi_store8(iter_base + 0, 31) + mbt_ffi_store32((iter_base) + 12, (payload48).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) - let @types.Secret(handle) = payload63 - mbt_ffi_store32(iter_base + 8, handle) + match ((payload48).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - () - } - QuotaTokenHandle(payload64) => { - mbt_ffi_store8(iter_base + 0, 32) + () + } + Some(payload51) => { + mbt_ffi_store8((iter_base) + 16, (1)) - let @types.QuotaToken(handle65) = payload64 - mbt_ffi_store32(iter_base + 8, handle65) + let ptr52 = mbt_ffi_str2ptr(payload51) + mbt_ffi_store32((iter_base) + 24, payload51.length()) + mbt_ffi_store32((iter_base) + 20, ptr52) + cleanup_list.push(ptr52) - () - } - } - } - - let (lowered, lowered70, lowered71) = match phantom_id { - None => (0, 0L, 0L) - Some(payload69) => - ( - 1, - payload69.high_bits.reinterpret_as_int64(), - payload69.low_bits.reinterpret_as_int64(), - ) - } - let return_area = mbt_ffi_malloc(40) - wasmImportMakeAgentId( - ptr, - agent_type_name.length(), - address66, - input.value_nodes.length(), - input.root, - lowered, - lowered70, - lowered71, - return_area, - ) - - let lifted309 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) + () + } + } + cleanup_list.push(ptr49) - Result::Ok(result) - } - 1 => { - let lifted308 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result72 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - @common.AgentError::InvalidInput(result72) - } - 1 => { - let result73 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - @common.AgentError::InvalidMethod(result73) - } - 2 => { - let result74 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - @common.AgentError::InvalidType(result74) - } - 3 => { - let result75 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - @common.AgentError::InvalidAgentId(result75) - } - 4 => { - let array270 : Array[@types.SchemaTypeNode] = [] - for index271 = 0 - index271 < mbt_ffi_load32(return_area + 12) - index271 = index271 + 1 { - let iter_base = mbt_ffi_load32(return_area + 8) + index271 * 144 - - let lifted256 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted81 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted76 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted) - } - _ => panic() - } - - let lifted78 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted77 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted77) - } - _ => panic() - } - - let lifted80 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result79 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result79) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted76, - max: lifted78, - unit: lifted80, - }) + () } - _ => panic() - } + PathValue(payload53) => { + mbt_ffi_store8((iter_base) + 0, (25)) - @types.SchemaTypeBody::S8Type(lifted81) - } - 3 => { - let lifted88 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted83 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted82 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted82) - } - _ => panic() - } - - let lifted85 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted84 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted84) - } - _ => panic() - } - - let lifted87 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result86 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result86) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted83, - max: lifted85, - unit: lifted87, - }) - } - _ => panic() - } + let ptr54 = mbt_ffi_str2ptr(payload53) + mbt_ffi_store32((iter_base) + 12, payload53.length()) + mbt_ffi_store32((iter_base) + 8, ptr54) + cleanup_list.push(ptr54) - @types.SchemaTypeBody::S16Type(lifted88) - } - 4 => { - let lifted95 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted90 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted89 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted89) - } - _ => panic() - } - - let lifted92 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted91 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted91) - } - _ => panic() - } - - let lifted94 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result93 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result93) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted90, - max: lifted92, - unit: lifted94, - }) + () } - _ => panic() - } + UrlValue(payload55) => { + mbt_ffi_store8((iter_base) + 0, (26)) - @types.SchemaTypeBody::S32Type(lifted95) - } - 5 => { - let lifted102 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted97 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted96 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted96) - } - _ => panic() - } - - let lifted99 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted98 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted98) - } - _ => panic() - } - - let lifted101 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result100 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result100) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted97, - max: lifted99, - unit: lifted101, - }) - } - _ => panic() - } + let ptr56 = mbt_ffi_str2ptr(payload55) + mbt_ffi_store32((iter_base) + 12, payload55.length()) + mbt_ffi_store32((iter_base) + 8, ptr56) + cleanup_list.push(ptr56) - @types.SchemaTypeBody::S64Type(lifted102) - } - 6 => { - let lifted109 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted104 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted103 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted103) - } - _ => panic() - } - - let lifted106 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted105 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted105) - } - _ => panic() - } - - let lifted108 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result107 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result107) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted104, - max: lifted106, - unit: lifted108, - }) + () } - _ => panic() - } + DatetimeValue(payload57) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload57).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload57).nanoseconds).reinterpret_as_int()) - @types.SchemaTypeBody::U8Type(lifted109) - } - 7 => { - let lifted116 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted111 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted110 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted110) - } - _ => panic() - } - - let lifted113 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted112 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted112) - } - _ => panic() - } - - let lifted115 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result114 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result114) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted111, - max: lifted113, - unit: lifted115, - }) + () } - _ => panic() - } + DurationValue(payload58) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload58).nanoseconds) - @types.SchemaTypeBody::U16Type(lifted116) - } - 8 => { - let lifted123 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted118 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted117 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted117) - } - _ => panic() - } - - let lifted120 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted119 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted119) - } - _ => panic() - } - - let lifted122 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result121 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result121) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted118, - max: lifted120, - unit: lifted122, - }) + () } - _ => panic() - } + QuantityValueNode(payload59) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload59).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload59).scale) - @types.SchemaTypeBody::U32Type(lifted123) - } - 9 => { - let lifted130 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted125 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted124 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted124) - } - _ => panic() - } - - let lifted127 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted126 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted126) - } - _ => panic() - } - - let lifted129 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result128 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result128) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted125, - max: lifted127, - unit: lifted129, - }) - } - _ => panic() - } + let ptr60 = mbt_ffi_str2ptr((payload59).unit) + mbt_ffi_store32((iter_base) + 24, (payload59).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr60) + cleanup_list.push(ptr60) - @types.SchemaTypeBody::U64Type(lifted130) - } - 10 => { - let lifted137 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted132 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted131 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted131) - } - _ => panic() - } - - let lifted134 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted133 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted133) - } - _ => panic() - } - - let lifted136 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result135 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result135) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted132, - max: lifted134, - unit: lifted136, - }) + () } - _ => panic() - } + UnionValue(payload61) => { + mbt_ffi_store8((iter_base) + 0, (30)) - @types.SchemaTypeBody::F32Type(lifted137) - } - 11 => { - let lifted144 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted139 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted138 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted138) - } - _ => panic() - } - - let lifted141 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted140 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted140) - } - _ => panic() - } - - let lifted143 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result142 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result142) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted139, - max: lifted141, - unit: lifted143, - }) + let ptr62 = mbt_ffi_str2ptr((payload61).tag) + mbt_ffi_store32((iter_base) + 12, (payload61).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr62) + mbt_ffi_store32((iter_base) + 16, (payload61).body) + cleanup_list.push(ptr62) + + () } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted144) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array158 : Array[@types.NamedFieldType] = [] - for index159 = 0 - index159 < mbt_ffi_load32(iter_base + 12) - index159 = index159 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index159 * 68 - - let result145 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted147 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result146 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result146) - } - _ => panic() - } - - let array : Array[String] = [] - for index149 = 0 - index149 < mbt_ffi_load32(iter_base + 28) - index149 = index149 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index149 * 8 - - let result148 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result148) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array151 : Array[String] = [] - for index152 = 0 - index152 < mbt_ffi_load32(iter_base + 36) - index152 = index152 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index152 * 8 - - let result150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array151.push(result150) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted154 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result153 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result153) - } - _ => panic() - } - - let lifted157 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted156 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + SecretValue(payload63) => { + mbt_ffi_store8((iter_base) + 0, (31)) - @types.Role::Other(result155) - } - _ => panic() - } - - Option::Some(lifted156) - } - _ => panic() - } - - array158.push(@types.NamedFieldType::{ - name: result145, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted147, - aliases: array, - examples: array151, - deprecated: lifted154, - role: lifted157, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array158) - } - 15 => { - let array175 : Array[@types.VariantCaseType] = [] - for index176 = 0 - index176 < mbt_ffi_load32(iter_base + 12) - index176 = index176 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index176 * 72 - - let result160 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted161 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted163 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result162 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result162) - } - _ => panic() - } - - let array165 : Array[String] = [] - for index166 = 0 - index166 < mbt_ffi_load32(iter_base + 32) - index166 = index166 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index166 * 8 - - let result164 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array165.push(result164) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array168 : Array[String] = [] - for index169 = 0 - index169 < mbt_ffi_load32(iter_base + 40) - index169 = index169 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index169 * 8 - - let result167 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array168.push(result167) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted171 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result170 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result170) - } - _ => panic() - } - - let lifted174 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted173 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result172 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let @types.Secret(handle64) = payload63 + mbt_ffi_store32((iter_base) + 8, handle64) - @types.Role::Other(result172) - } - _ => panic() - } - - Option::Some(lifted173) - } - _ => panic() - } - - array175.push(@types.VariantCaseType::{ - name: result160, - payload: lifted161, - metadata: @types.MetadataEnvelope::{ - doc: lifted163, - aliases: array165, - examples: array168, - deprecated: lifted171, - role: lifted174, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array175) - } - 16 => { - let array178 : Array[String] = [] - for index179 = 0 - index179 < mbt_ffi_load32(iter_base + 12) - index179 = index179 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index179 * 8 - - let result177 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array178.push(result177) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array178) - } - 17 => { - let array181 : Array[String] = [] - for index182 = 0 - index182 < mbt_ffi_load32(iter_base + 12) - index182 = index182 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index182 * 8 - - let result180 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array181.push(result180) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array181) - } - 18 => { - let array183 : Array[Int] = [] - for index184 = 0 - index184 < mbt_ffi_load32(iter_base + 12) - index184 = index184 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index184 * 4 - - array183.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array183) - } - 19 => - @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted185 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + () + } + QuotaTokenHandle(payload65) => { + mbt_ffi_store8((iter_base) + 0, (32)) - let lifted186 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted185, - err: lifted186, - }) - } - 24 => { - let lifted190 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array188 : Array[String] = [] - for index189 = 0 - index189 < mbt_ffi_load32(iter_base + 16) - index189 = index189 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index189 * 8 + let @types.QuotaToken(handle66) = payload65 + mbt_ffi_store32((iter_base) + 8, handle66) - let result187 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + () + } + PermissionCardHandle(payload67) => { + mbt_ffi_store8((iter_base) + 0, (33)) - array188.push(result187) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + let @types.PermissionCard(handle68) = payload67 + mbt_ffi_store32((iter_base) + 8, handle68) - Option::Some(array188) + () } - _ => panic() - } + } - let lifted191 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + } - let lifted192 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + let (lowered, lowered74) = match (scope_card) { + None => { - let lifted194 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result193 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + ((0), 0) + } + Some(payload72) => { - Option::Some(result193) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted190, - min_length: lifted191, - max_length: lifted192, - regex: lifted194, - }) - } - 25 => { - let lifted198 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array196 : Array[String] = [] - for index197 = 0 - index197 < mbt_ffi_load32(iter_base + 16) - index197 = index197 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index197 * 8 + let @types.PermissionCard(handle73) = payload72 - let result195 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + ((1), handle73) + } + } + let return_area = mbt_ffi_malloc(44) + wasmImportMethodWasmRpcInvoke(handle, ptr, method_name.length(), address69, ((input).value_nodes).length(), (input).root, lowered, lowered74, return_area); - array196.push(result195) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + let lifted318 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - Option::Some(array196) - } - _ => panic() - } + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) - let lifted199 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + let result75 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let lifted200 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted198, - min_bytes: lifted199, - max_bytes: lifted200, - }) - } - 26 => { - let lifted204 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array202 : Array[String] = [] - for index203 = 0 - index203 < mbt_ffi_load32(iter_base + 20) - index203 = index203 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index203 * 8 + Result::Ok(InvocationMetadata::{agent_id : result, idempotency_key : result75}) + } + 1 => { - let result201 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted317 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - array202.push(result201) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) + let result76 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - Option::Some(array202) - } - _ => panic() - } + RpcError::ProtocolError(result76) + } + 1 => { - let lifted208 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array206 : Array[String] = [] - for index207 = 0 - index207 < mbt_ffi_load32(iter_base + 32) - index207 = index207 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index207 * 8 + let result77 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let result205 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + RpcError::Denied(result77) + } + 2 => { - array206.push(result205) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let result78 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - Option::Some(array206) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted204, - allowed_extensions: lifted208, - }) - } - 27 => { - let lifted212 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array210 : Array[String] = [] - for index211 = 0 - index211 < mbt_ffi_load32(iter_base + 16) - index211 = index211 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index211 * 8 + RpcError::NotFound(result78) + } + 3 => { - let result209 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result79 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - array210.push(result209) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + RpcError::RemoteInternalError(result79) + } + 4 => { - Option::Some(array210) - } - _ => panic() - } + let lifted316 = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - let lifted216 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array214 : Array[String] = [] - for index215 = 0 - index215 < mbt_ffi_load32(iter_base + 28) - index215 = index215 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index215 * 8 + let result80 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let result213 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @common.AgentError::InvalidInput(result80) + } + 1 => { - array214.push(result213) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let result81 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - Option::Some(array214) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted212, - allowed_hosts: lifted216, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result217 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array219 : Array[String] = [] - for index220 = 0 - index220 < mbt_ffi_load32(iter_base + 20) - index220 = index220 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index220 * 8 - - let result218 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array219.push(result218) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted222 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result221 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) + @common.AgentError::InvalidMethod(result81) + } + 2 => { - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result221, - }) - } - _ => panic() - } + let result82 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let lifted224 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result223 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) + @common.AgentError::InvalidType(result82) + } + 3 => { - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result223, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result217, - allowed_suffixes: array219, - min: lifted222, - max: lifted224, - }) - } - 31 => { - let array248 : Array[@types.UnionBranch] = [] - for index249 = 0 - index249 < mbt_ffi_load32(iter_base + 12) - index249 = index249 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index249 * 92 - - let result225 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted234 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result226 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result226) - } - 1 => { - let result227 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result227) - } - 2 => { - let result228 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result228) - } - 3 => { - let result229 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result229) - } - 4 => { - let result230 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted232 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result231 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let result83 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - Option::Some(result231) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result230, - literal: lifted232, - }) - } - 5 => { - let result233 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result233) - } - _ => panic() - } - - let lifted236 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result235 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result235) - } - _ => panic() - } - - let array238 : Array[String] = [] - for index239 = 0 - index239 < mbt_ffi_load32(iter_base + 52) - index239 = index239 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index239 * 8 - - let result237 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array238.push(result237) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array241 : Array[String] = [] - for index242 = 0 - index242 < mbt_ffi_load32(iter_base + 60) - index242 = index242 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index242 * 8 - - let result240 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array241.push(result240) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted244 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result243 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result243) - } - _ => panic() - } - - let lifted247 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted246 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result245 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @common.AgentError::InvalidAgentId(result83) + } + 4 => { - @types.Role::Other(result245) - } - _ => panic() - } - - Option::Some(lifted246) - } - _ => panic() - } - - array248.push(@types.UnionBranch::{ - tag: result225, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted234, - metadata: @types.MetadataEnvelope::{ - doc: lifted236, - aliases: array238, - examples: array241, - deprecated: lifted244, - role: lifted247, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array248, - }) - } - 32 => { - let lifted251 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result250 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let array278 : Array[@types.SchemaTypeNode] = []; + for index279 = 0; index279 < (mbt_ffi_load32((return_area) + 16)); index279 = index279 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 12)) + (index279 * 144) - Option::Some(result250) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted251, - }) - } - 33 => { - let lifted253 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result252 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + let lifted264 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - Option::Some(result252) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted253, - }) - } - 34 => { - let lifted254 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { - @types.SchemaTypeBody::FutureType(lifted254) - } - 35 => { - let lifted255 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaTypeBody::BoolType + } + 2 => { - @types.SchemaTypeBody::StreamType(lifted255) - } - _ => panic() - } + let lifted89 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted258 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result257 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result257) - } - _ => panic() - } + let lifted84 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let array260 : Array[String] = [] - for index261 = 0 - index261 < mbt_ffi_load32(iter_base + 104) - index261 = index261 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index261 * 8 + let lifted = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let result259 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - array260.push(result259) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - let array263 : Array[String] = [] - for index264 = 0 - index264 < mbt_ffi_load32(iter_base + 112) - index264 = index264 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index264 * 8 + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - let result262 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(lifted) + } + _ => panic() + } - array263.push(result262) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted266 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result265 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result265) - } - _ => panic() - } + let lifted86 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - let lifted269 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted268 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result267 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) + let lifted85 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - @types.Role::Other(result267) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - Option::Some(lifted268) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - array270.push(@types.SchemaTypeNode::{ - body: lifted256, - metadata: @types.MetadataEnvelope::{ - doc: lifted258, - aliases: array260, - examples: array263, - deprecated: lifted266, - role: lifted269, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 8)) - - let array275 : Array[@types.SchemaTypeDef] = [] - for index276 = 0 - index276 < mbt_ffi_load32(return_area + 20) - index276 = index276 + 1 { - let iter_base = mbt_ffi_load32(return_area + 16) + index276 * 24 - - let result272 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted274 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result273 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result273) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - array275.push(@types.SchemaTypeDef::{ - id: result272, - name: lifted274, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 16)) - - let array306 : Array[@types.SchemaValueNode] = [] - for index307 = 0 - index307 < mbt_ffi_load32(return_area + 32) - index307 = index307 + 1 { - let iter_base = mbt_ffi_load32(return_area + 28) + index307 * 32 - - let lifted305 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => - @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => - @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => - @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => - @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result277 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result277) - } - 13 => { - let array278 : Array[Int] = [] - for index279 = 0 - index279 < mbt_ffi_load32(iter_base + 12) - index279 = index279 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index279 * 4 - - array278.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array278) - } - 14 => { - let lifted280 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted280, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array281 : Array[Bool] = [] - for index282 = 0 - index282 < mbt_ffi_load32(iter_base + 12) - index282 = index282 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index282 * 1 - - array281.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array281) - } - 17 => { - let array283 : Array[Int] = [] - for index284 = 0 - index284 < mbt_ffi_load32(iter_base + 12) - index284 = index284 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index284 * 4 - - array283.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array283) - } - 18 => { - let array285 : Array[Int] = [] - for index286 = 0 - index286 < mbt_ffi_load32(iter_base + 12) - index286 = index286 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index286 * 4 - - array285.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array285) - } - 19 => { - let array287 : Array[Int] = [] - for index288 = 0 - index288 < mbt_ffi_load32(iter_base + 12) - index288 = index288 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index288 * 4 - - array287.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array287) - } - 20 => { - let array289 : Array[@types.MapEntry] = [] - for index290 = 0 - index290 < mbt_ffi_load32(iter_base + 12) - index290 = index290 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index290 * 8 - - array289.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array289) - } - 21 => { - let lifted291 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + Option::Some(lifted85) + } + _ => panic() + } - @types.SchemaValueNode::OptionValue(lifted291) - } - 22 => { - let lifted294 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted292 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let lifted88 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - @types.ResultValuePayload::OkValue(lifted292) - } - 1 => { - let lifted293 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let result87 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - @types.ResultValuePayload::ErrValue(lifted293) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted294) - } - 23 => { - let result295 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted297 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result296 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + Option::Some(result87) + } + _ => panic() + } - Option::Some(result296) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result295, - language: lifted297, - }) - } - 24 => { - let result298 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted300 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result299 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + Option::Some(@types.NumericRestrictions::{min : lifted84, max : lifted86, unit : lifted88}) + } + _ => panic() + } - Option::Some(result299) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result298, - mime_type: lifted300, - }) - } - 25 => { - let result301 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result301) - } - 26 => { - let result302 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result302) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result303 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result303, - }) - } - 30 => { - let result304 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result304, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } + @types.SchemaTypeBody::S8Type(lifted89) + } + 3 => { - array306.push(lifted305) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 28)) - - @common.AgentError::CustomError(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array270, - defs: array275, - root: mbt_ffi_load32(return_area + 24), - }, - value: @types.SchemaValueTree::{ - value_nodes: array306, - root: mbt_ffi_load32(return_area + 36), - }, - }) - } - _ => panic() - } + let lifted96 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Result::Err(lifted308) - } - _ => panic() - } - let ret = lifted309 - mbt_ffi_free(ptr) - mbt_ffi_free(address66) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let lifted91 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted90 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { -///| -/// Parses an agent-id (created by `make-agent-id`) into an agent type name and its constructor parameters -/// and an optional phantom ID. -/// -/// The constructor parameters are returned as a self-contained typed value -/// (graph + value tree) so the receiver can interpret them without an -/// external schema registry. -pub fn parse_agent_id( - agent_id : String, -) -> Result[(String, @types.TypedSchemaValue, @types.Uuid?), @common.AgentError] { - let ptr = mbt_ffi_str2ptr(agent_id) - let return_area = mbt_ffi_malloc(72) - wasmImportParseAgentId(ptr, agent_id.length(), return_area) - - let lifted471 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let array193 : Array[@types.SchemaTypeNode] = [] - for index194 = 0 - index194 < mbt_ffi_load32(return_area + 20) - index194 = index194 + 1 { - let iter_base = mbt_ffi_load32(return_area + 16) + index194 * 144 - - let lifted179 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted5 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted0 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted90) + } + _ => panic() + } + + let lifted93 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted92 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted92) + } + _ => panic() + } + + let lifted95 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result94 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result94) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted91, max : lifted93, unit : lifted95}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted96) + } + 4 => { + + let lifted103 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted98 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted97 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted97) + } + _ => panic() + } + + let lifted100 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted99 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted99) + } + _ => panic() + } + + let lifted102 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result101 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result101) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted98, max : lifted100, unit : lifted102}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted103) + } + 5 => { + + let lifted110 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted105 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted104 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted104) + } + _ => panic() + } + + let lifted107 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted106 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted106) + } + _ => panic() + } + + let lifted109 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result108 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result108) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted105, max : lifted107, unit : lifted109}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted110) + } + 6 => { + + let lifted117 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted112 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted111 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted111) + } + _ => panic() + } + + let lifted114 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted113 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted113) + } + _ => panic() + } + + let lifted116 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result115 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result115) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted112, max : lifted114, unit : lifted116}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted117) + } + 7 => { + + let lifted124 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted119 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted118 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted118) + } + _ => panic() + } + + let lifted121 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted120 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted120) + } + _ => panic() + } + + let lifted123 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result122 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result122) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted119, max : lifted121, unit : lifted123}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted124) + } + 8 => { + + let lifted131 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted126 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted125 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted125) + } + _ => panic() + } + + let lifted128 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted127 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted127) + } + _ => panic() + } + + let lifted130 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result129 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result129) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted126, max : lifted128, unit : lifted130}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted131) + } + 9 => { + + let lifted138 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted133 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted132 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted132) + } + _ => panic() + } + + let lifted135 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted134 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted134) + } + _ => panic() + } + + let lifted137 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result136 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result136) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted133, max : lifted135, unit : lifted137}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted138) + } + 10 => { + + let lifted145 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted140 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted139 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted139) + } + _ => panic() + } + + let lifted142 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted141 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted141) + } + _ => panic() + } + + let lifted144 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result143 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result143) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted140, max : lifted142, unit : lifted144}) + } + _ => panic() + } - let lifted2 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted1) - } - _ => panic() - } + @types.SchemaTypeBody::F32Type(lifted145) + } + 11 => { - let lifted4 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted152 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(result3) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted0, - max: lifted2, - unit: lifted4, - }) - } - _ => panic() - } + let lifted147 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::S8Type(lifted5) - } - 3 => { - let lifted12 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted7 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted6 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted6) - } - _ => panic() - } + let lifted146 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let lifted9 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted8 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted8) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let lifted11 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result10 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(result10) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted7, - max: lifted9, - unit: lifted11, - }) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - @types.SchemaTypeBody::S16Type(lifted12) - } - 4 => { - let lifted19 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted14 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted13 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted13) - } - _ => panic() - } + Option::Some(lifted146) + } + _ => panic() + } - let lifted16 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted15 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted15) - } - _ => panic() - } + let lifted149 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - let lifted18 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result17 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted148 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - Option::Some(result17) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted14, - max: lifted16, - unit: lifted18, - }) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - @types.SchemaTypeBody::S32Type(lifted19) - } - 5 => { - let lifted26 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted21 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted20 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted20) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - let lifted23 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted22 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted22) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted25 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result24 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(lifted148) + } + _ => panic() + } - Option::Some(result24) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted21, - max: lifted23, - unit: lifted25, - }) - } - _ => panic() - } + let lifted151 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::S64Type(lifted26) - } - 6 => { - let lifted33 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted28 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted27 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted27) - } - _ => panic() - } + let result150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let lifted30 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted29 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted29) - } - _ => panic() - } + Option::Some(result150) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted147, max : lifted149, unit : lifted151}) + } + _ => panic() + } - let lifted32 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result31 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaTypeBody::F64Type(lifted152) + } + 12 => { - Option::Some(result31) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted28, - max: lifted30, - unit: lifted32, - }) - } - _ => panic() - } + @types.SchemaTypeBody::CharType + } + 13 => { - @types.SchemaTypeBody::U8Type(lifted33) - } - 7 => { - let lifted40 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted35 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted34 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted34) - } - _ => panic() - } + @types.SchemaTypeBody::StringType + } + 14 => { - let lifted37 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted36 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted36) - } - _ => panic() - } + let array166 : Array[@types.NamedFieldType] = []; + for index167 = 0; index167 < (mbt_ffi_load32((iter_base) + 12)); index167 = index167 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index167 * 68) - let lifted39 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result38 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let result153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(result38) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted35, - max: lifted37, - unit: lifted39, - }) - } - _ => panic() - } + let lifted155 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::U16Type(lifted40) - } - 8 => { - let lifted47 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted42 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted41 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted41) - } - _ => panic() - } + let result154 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let lifted44 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted43 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted43) - } - _ => panic() - } + Option::Some(result154) + } + _ => panic() + } - let lifted46 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result45 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let array : Array[String] = []; + for index157 = 0; index157 < (mbt_ffi_load32((iter_base) + 28)); index157 = index157 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index157 * 8) - Option::Some(result45) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted42, - max: lifted44, - unit: lifted46, - }) - } - _ => panic() - } + let result156 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::U32Type(lifted47) - } - 9 => { - let lifted54 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted49 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted48 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted48) - } - _ => panic() - } + array.push(result156) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - let lifted51 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted50 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted50) - } - _ => panic() - } + let array159 : Array[String] = []; + for index160 = 0; index160 < (mbt_ffi_load32((iter_base) + 36)); index160 = index160 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index160 * 8) - let lifted53 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result52 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let result158 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(result52) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted49, - max: lifted51, - unit: lifted53, - }) - } - _ => panic() - } + array159.push(result158) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - @types.SchemaTypeBody::U64Type(lifted54) - } - 10 => { - let lifted61 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted56 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted55 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted55) - } - _ => panic() - } + let lifted162 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - let lifted58 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted57 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted57) - } - _ => panic() - } + let result161 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - let lifted60 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result59 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(result161) + } + _ => panic() + } - Option::Some(result59) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted56, - max: lifted58, - unit: lifted60, - }) - } - _ => panic() - } + let lifted165 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::F32Type(lifted61) - } - 11 => { - let lifted68 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted63 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted62 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted62) - } - _ => panic() - } + let lifted164 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { - let lifted65 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted64 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted64) - } - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - let lifted67 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result66 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.Role::UnstructuredText + } + 2 => { - Option::Some(result66) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted63, - max: lifted65, - unit: lifted67, - }) - } - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - @types.SchemaTypeBody::F64Type(lifted68) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array81 : Array[@types.NamedFieldType] = [] - for index82 = 0 - index82 < mbt_ffi_load32(iter_base + 12) - index82 = index82 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index82 * 68 - - let result69 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted71 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result70 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result70) - } - _ => panic() - } - - let array : Array[String] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 28) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index * 8 - - let result72 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result72) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array74 : Array[String] = [] - for index75 = 0 - index75 < mbt_ffi_load32(iter_base + 36) - index75 = index75 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index75 * 8 - - let result73 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array74.push(result73) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted77 : String? = match mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result76 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result76) - } - _ => panic() - } - - let lifted80 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted79 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result78 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result78) - } - _ => panic() - } - - Option::Some(lifted79) - } - _ => panic() - } - - array81.push(@types.NamedFieldType::{ - name: result69, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted71, - aliases: array, - examples: array74, - deprecated: lifted77, - role: lifted80, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array81) - } - 15 => { - let array98 : Array[@types.VariantCaseType] = [] - for index99 = 0 - index99 < mbt_ffi_load32(iter_base + 12) - index99 = index99 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index99 * 72 - - let result83 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted84 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted86 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result85 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result85) - } - _ => panic() - } - - let array88 : Array[String] = [] - for index89 = 0 - index89 < mbt_ffi_load32(iter_base + 32) - index89 = index89 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index89 * 8 - - let result87 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array88.push(result87) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array91 : Array[String] = [] - for index92 = 0 - index92 < mbt_ffi_load32(iter_base + 40) - index92 = index92 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index92 * 8 - - let result90 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array91.push(result90) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted94 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result93 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result93) - } - _ => panic() - } - - let lifted97 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted96 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result95 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result95) - } - _ => panic() - } - - Option::Some(lifted96) - } - _ => panic() - } - - array98.push(@types.VariantCaseType::{ - name: result83, - payload: lifted84, - metadata: @types.MetadataEnvelope::{ - doc: lifted86, - aliases: array88, - examples: array91, - deprecated: lifted94, - role: lifted97, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array98) - } - 16 => { - let array101 : Array[String] = [] - for index102 = 0 - index102 < mbt_ffi_load32(iter_base + 12) - index102 = index102 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index102 * 8 - - let result100 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array101.push(result100) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array101) - } - 17 => { - let array104 : Array[String] = [] - for index105 = 0 - index105 < mbt_ffi_load32(iter_base + 12) - index105 = index105 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index105 * 8 - - let result103 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array104.push(result103) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array104) - } - 18 => { - let array106 : Array[Int] = [] - for index107 = 0 - index107 < mbt_ffi_load32(iter_base + 12) - index107 = index107 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index107 * 4 - - array106.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array106) - } - 19 => @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted108 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result163 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - let lifted109 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + @types.Role::Other(result163) + } + _ => panic() + } - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted108, - err: lifted109, - }) - } - 24 => { - let lifted113 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array111 : Array[String] = [] - for index112 = 0 - index112 < mbt_ffi_load32(iter_base + 16) - index112 = index112 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index112 * 8 - - let result110 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array111.push(result110) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array111) - } - _ => panic() - } + Option::Some(lifted164) + } + _ => panic() + } - let lifted114 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + array166.push(@types.NamedFieldType::{name : result153, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted155, aliases : array, examples : array159, deprecated : lifted162, role : lifted165}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted115 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + @types.SchemaTypeBody::RecordType(array166) + } + 15 => { - let lifted117 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result116 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result116) - } - _ => panic() - } + let array183 : Array[@types.VariantCaseType] = []; + for index184 = 0; index184 < (mbt_ffi_load32((iter_base) + 12)); index184 = index184 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index184 * 72) - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted113, - min_length: lifted114, - max_length: lifted115, - regex: lifted117, - }) - } - 25 => { - let lifted121 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array119 : Array[String] = [] - for index120 = 0 - index120 < mbt_ffi_load32(iter_base + 16) - index120 = index120 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index120 * 8 - - let result118 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array119.push(result118) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array119) - } - _ => panic() - } + let result168 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted122 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + let lifted169 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted123 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted121, - min_bytes: lifted122, - max_bytes: lifted123, - }) - } - 26 => { - let lifted127 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array125 : Array[String] = [] - for index126 = 0 - index126 < mbt_ffi_load32(iter_base + 20) - index126 = index126 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index126 * 8 - - let result124 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array125.push(result124) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array125) - } - _ => panic() - } + let lifted171 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted131 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array129 : Array[String] = [] - for index130 = 0 - index130 < mbt_ffi_load32(iter_base + 32) - index130 = index130 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index130 * 8 - - let result128 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array129.push(result128) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array129) - } - _ => panic() - } + let result170 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted127, - allowed_extensions: lifted131, - }) - } - 27 => { - let lifted135 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array133 : Array[String] = [] - for index134 = 0 - index134 < mbt_ffi_load32(iter_base + 16) - index134 = index134 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index134 * 8 - - let result132 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array133.push(result132) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array133) - } - _ => panic() - } + Option::Some(result170) + } + _ => panic() + } - let lifted139 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array137 : Array[String] = [] - for index138 = 0 - index138 < mbt_ffi_load32(iter_base + 28) - index138 = index138 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index138 * 8 - - let result136 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array137.push(result136) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array137) - } - _ => panic() - } + let array173 : Array[String] = []; + for index174 = 0; index174 < (mbt_ffi_load32((iter_base) + 32)); index174 = index174 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index174 * 8) - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted135, - allowed_hosts: lifted139, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result140 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array142 : Array[String] = [] - for index143 = 0 - index143 < mbt_ffi_load32(iter_base + 20) - index143 = index143 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index143 * 8 - - let result141 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array142.push(result141) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted145 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result144 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result144, - }) - } - _ => panic() - } + let result172 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted147 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result146 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result146, - }) - } - _ => panic() - } + array173.push(result172) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result140, - allowed_suffixes: array142, - min: lifted145, - max: lifted147, - }) - } - 31 => { - let array171 : Array[@types.UnionBranch] = [] - for index172 = 0 - index172 < mbt_ffi_load32(iter_base + 12) - index172 = index172 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index172 * 92 - - let result148 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted157 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result149 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result149) - } - 1 => { - let result150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result150) - } - 2 => { - let result151 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result151) - } - 3 => { - let result152 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result152) - } - 4 => { - let result153 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted155 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result154 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result154) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result153, - literal: lifted155, - }) - } - 5 => { - let result156 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result156) - } - _ => panic() - } - - let lifted159 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result158 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result158) - } - _ => panic() - } - - let array161 : Array[String] = [] - for index162 = 0 - index162 < mbt_ffi_load32(iter_base + 52) - index162 = index162 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index162 * 8 - - let result160 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array161.push(result160) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array164 : Array[String] = [] - for index165 = 0 - index165 < mbt_ffi_load32(iter_base + 60) - index165 = index165 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index165 * 8 - - let result163 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array164.push(result163) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted167 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result166 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result166) - } - _ => panic() - } - - let lifted170 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted169 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result168 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result168) - } - _ => panic() - } - - Option::Some(lifted169) - } - _ => panic() - } - - array171.push(@types.UnionBranch::{ - tag: result148, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted157, - metadata: @types.MetadataEnvelope::{ - doc: lifted159, - aliases: array161, - examples: array164, - deprecated: lifted167, - role: lifted170, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array171, - }) - } - 32 => { - let lifted174 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result173 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result173) - } - _ => panic() - } + let array176 : Array[String] = []; + for index177 = 0; index177 < (mbt_ffi_load32((iter_base) + 40)); index177 = index177 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index177 * 8) - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted174, - }) - } - 33 => { - let lifted176 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result175) - } - _ => panic() - } + let result175 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted176, - }) - } - 34 => { - let lifted177 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + array176.push(result175) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - @types.SchemaTypeBody::FutureType(lifted177) - } - 35 => { - let lifted178 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted179 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::StreamType(lifted178) - } - _ => panic() - } - - let lifted181 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result180 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result180) - } - _ => panic() - } - - let array183 : Array[String] = [] - for index184 = 0 - index184 < mbt_ffi_load32(iter_base + 104) - index184 = index184 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index184 * 8 - - let result182 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array183.push(result182) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array186 : Array[String] = [] - for index187 = 0 - index187 < mbt_ffi_load32(iter_base + 112) - index187 = index187 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index187 * 8 - - let result185 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array186.push(result185) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted189 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result188 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result188) - } - _ => panic() - } - - let lifted192 : @types.Role? = match mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted191 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result190 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result190) - } - _ => panic() - } + let result178 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - Option::Some(lifted191) - } - _ => panic() - } - - array193.push(@types.SchemaTypeNode::{ - body: lifted179, - metadata: @types.MetadataEnvelope::{ - doc: lifted181, - aliases: array183, - examples: array186, - deprecated: lifted189, - role: lifted192, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 16)) - - let array198 : Array[@types.SchemaTypeDef] = [] - for index199 = 0 - index199 < mbt_ffi_load32(return_area + 28) - index199 = index199 + 1 { - let iter_base = mbt_ffi_load32(return_area + 24) + index199 * 24 - - let result195 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted197 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result196 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result196) - } - _ => panic() - } - - array198.push(@types.SchemaTypeDef::{ - id: result195, - name: lifted197, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 24)) - - let array229 : Array[@types.SchemaValueNode] = [] - for index230 = 0 - index230 < mbt_ffi_load32(return_area + 40) - index230 = index230 + 1 { - let iter_base = mbt_ffi_load32(return_area + 36) + index230 * 32 - - let lifted228 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8).land(0xFFFF).reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result200 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result200) - } - 13 => { - let array201 : Array[Int] = [] - for index202 = 0 - index202 < mbt_ffi_load32(iter_base + 12) - index202 = index202 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index202 * 4 - - array201.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array201) - } - 14 => { - let lifted203 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + Option::Some(result178) + } + _ => panic() + } - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted203, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array204 : Array[Bool] = [] - for index205 = 0 - index205 < mbt_ffi_load32(iter_base + 12) - index205 = index205 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index205 * 1 - - array204.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array204) - } - 17 => { - let array206 : Array[Int] = [] - for index207 = 0 - index207 < mbt_ffi_load32(iter_base + 12) - index207 = index207 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index207 * 4 - - array206.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array206) - } - 18 => { - let array208 : Array[Int] = [] - for index209 = 0 - index209 < mbt_ffi_load32(iter_base + 12) - index209 = index209 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index209 * 4 - - array208.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array208) - } - 19 => { - let array210 : Array[Int] = [] - for index211 = 0 - index211 < mbt_ffi_load32(iter_base + 12) - index211 = index211 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index211 * 4 - - array210.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array210) - } - 20 => { - let array212 : Array[@types.MapEntry] = [] - for index213 = 0 - index213 < mbt_ffi_load32(iter_base + 12) - index213 = index213 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index213 * 8 - - array212.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array212) - } - 21 => { - let lifted214 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted182 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - @types.SchemaValueNode::OptionValue(lifted214) - } - 22 => { - let lifted217 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted215 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let lifted181 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { - @types.ResultValuePayload::OkValue(lifted215) - } - 1 => { - let lifted216 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - @types.ResultValuePayload::ErrValue(lifted216) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - @types.SchemaValueNode::ResultValue(lifted217) - } - 23 => { - let result218 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted220 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result219 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result219) - } - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result218, - language: lifted220, - }) - } - 24 => { - let result221 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted223 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result222 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result222) - } - _ => panic() - } + let result180 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result221, - mime_type: lifted223, - }) - } - 25 => { - let result224 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result224) - } - 26 => { - let result225 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result225) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result226 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result226, - }) - } - 30 => { - let result227 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result227, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } - - array229.push(lifted228) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 36)) - - let lifted231 : @types.Uuid? = match mbt_ffi_load8_u(return_area + 48) { - 0 => Option::None - 1 => - Option::Some(@types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 56).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 64).reinterpret_as_uint64(), - }) - _ => panic() - } + @types.Role::Other(result180) + } + _ => panic() + } - Result::Ok( - ( - result, - @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array193, - defs: array198, - root: mbt_ffi_load32(return_area + 32), - }, - value: @types.SchemaValueTree::{ - value_nodes: array229, - root: mbt_ffi_load32(return_area + 44), - }, - }, - lifted231, - ), - ) - } - 1 => { - let lifted470 = match mbt_ffi_load8_u(return_area + 8) { - 0 => { - let result232 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - @common.AgentError::InvalidInput(result232) - } - 1 => { - let result233 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - @common.AgentError::InvalidMethod(result233) - } - 2 => { - let result234 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - @common.AgentError::InvalidType(result234) - } - 3 => { - let result235 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - @common.AgentError::InvalidAgentId(result235) - } - 4 => { - let array432 : Array[@types.SchemaTypeNode] = [] - for index433 = 0 - index433 < mbt_ffi_load32(return_area + 16) - index433 = index433 + 1 { - let iter_base = mbt_ffi_load32(return_area + 12) + index433 * 144 - - let lifted418 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted242 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted237 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted236 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted236) - } - _ => panic() - } - - let lifted239 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted238 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted238) - } - _ => panic() - } - - let lifted241 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result240 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result240) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted237, - max: lifted239, - unit: lifted241, - }) - } - _ => panic() - } + Option::Some(lifted181) + } + _ => panic() + } - @types.SchemaTypeBody::S8Type(lifted242) - } - 3 => { - let lifted249 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted244 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted243 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted243) - } - _ => panic() - } - - let lifted246 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted245 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted245) - } - _ => panic() - } - - let lifted248 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result247 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result247) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted244, - max: lifted246, - unit: lifted248, - }) - } - _ => panic() - } + array183.push(@types.VariantCaseType::{name : result168, payload : lifted169, metadata : @types.MetadataEnvelope::{doc : lifted171, aliases : array173, examples : array176, deprecated : lifted179, role : lifted182}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.SchemaTypeBody::S16Type(lifted249) - } - 4 => { - let lifted256 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted251 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted250 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted250) - } - _ => panic() - } - - let lifted253 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted252 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted252) - } - _ => panic() - } - - let lifted255 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result254 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result254) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted251, - max: lifted253, - unit: lifted255, - }) - } - _ => panic() - } + @types.SchemaTypeBody::VariantType(array183) + } + 16 => { - @types.SchemaTypeBody::S32Type(lifted256) - } - 5 => { - let lifted263 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted258 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted257 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted257) - } - _ => panic() - } - - let lifted260 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted259 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted259) - } - _ => panic() - } - - let lifted262 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result261 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result261) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted258, - max: lifted260, - unit: lifted262, - }) - } - _ => panic() - } + let array186 : Array[String] = []; + for index187 = 0; index187 < (mbt_ffi_load32((iter_base) + 12)); index187 = index187 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index187 * 8) - @types.SchemaTypeBody::S64Type(lifted263) - } - 6 => { - let lifted270 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted265 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted264 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted264) - } - _ => panic() - } - - let lifted267 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted266 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted266) - } - _ => panic() - } - - let lifted269 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result268 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result268) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted265, - max: lifted267, - unit: lifted269, - }) - } - _ => panic() - } + let result185 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::U8Type(lifted270) - } - 7 => { - let lifted277 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted272 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted271 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted271) - } - _ => panic() - } - - let lifted274 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted273 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted273) - } - _ => panic() - } - - let lifted276 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result275 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result275) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted272, - max: lifted274, - unit: lifted276, - }) - } - _ => panic() - } + array186.push(result185) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.SchemaTypeBody::U16Type(lifted277) - } - 8 => { - let lifted284 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted279 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted278 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted278) - } - _ => panic() - } - - let lifted281 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted280 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted280) - } - _ => panic() - } - - let lifted283 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result282 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result282) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted279, - max: lifted281, - unit: lifted283, - }) - } - _ => panic() - } + @types.SchemaTypeBody::EnumType(array186) + } + 17 => { - @types.SchemaTypeBody::U32Type(lifted284) - } - 9 => { - let lifted291 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted286 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted285 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted285) - } - _ => panic() - } - - let lifted288 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted287 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted287) - } - _ => panic() - } - - let lifted290 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result289 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result289) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted286, - max: lifted288, - unit: lifted290, - }) - } - _ => panic() - } + let array189 : Array[String] = []; + for index190 = 0; index190 < (mbt_ffi_load32((iter_base) + 12)); index190 = index190 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index190 * 8) - @types.SchemaTypeBody::U64Type(lifted291) - } - 10 => { - let lifted298 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted293 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted292 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted292) - } - _ => panic() - } - - let lifted295 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted294 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted294) - } - _ => panic() - } - - let lifted297 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result296 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result296) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted293, - max: lifted295, - unit: lifted297, - }) - } - _ => panic() - } + let result188 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::F32Type(lifted298) - } - 11 => { - let lifted305 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted300 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted299 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted299) - } - _ => panic() - } - - let lifted302 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted301 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted301) - } - _ => panic() - } - - let lifted304 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result303 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result303) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted300, - max: lifted302, - unit: lifted304, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted305) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array320 : Array[@types.NamedFieldType] = [] - for index321 = 0 - index321 < mbt_ffi_load32(iter_base + 12) - index321 = index321 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index321 * 68 - - let result306 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted308 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result307 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result307) - } - _ => panic() - } - - let array310 : Array[String] = [] - for index311 = 0 - index311 < mbt_ffi_load32(iter_base + 28) - index311 = index311 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index311 * 8 - - let result309 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array310.push(result309) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array313 : Array[String] = [] - for index314 = 0 - index314 < mbt_ffi_load32(iter_base + 36) - index314 = index314 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index314 * 8 - - let result312 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array313.push(result312) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted316 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result315 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result315) - } - _ => panic() - } - - let lifted319 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted318 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result317 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + array189.push(result188) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.Role::Other(result317) - } - _ => panic() - } - - Option::Some(lifted318) - } - _ => panic() - } - - array320.push(@types.NamedFieldType::{ - name: result306, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted308, - aliases: array310, - examples: array313, - deprecated: lifted316, - role: lifted319, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array320) - } - 15 => { - let array337 : Array[@types.VariantCaseType] = [] - for index338 = 0 - index338 < mbt_ffi_load32(iter_base + 12) - index338 = index338 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index338 * 72 - - let result322 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted323 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted325 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result324 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result324) - } - _ => panic() - } - - let array327 : Array[String] = [] - for index328 = 0 - index328 < mbt_ffi_load32(iter_base + 32) - index328 = index328 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index328 * 8 - - let result326 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array327.push(result326) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array330 : Array[String] = [] - for index331 = 0 - index331 < mbt_ffi_load32(iter_base + 40) - index331 = index331 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index331 * 8 - - let result329 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array330.push(result329) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted333 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result332 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result332) - } - _ => panic() - } - - let lifted336 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted335 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result334 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + @types.SchemaTypeBody::FlagsType(array189) + } + 18 => { - @types.Role::Other(result334) - } - _ => panic() - } - - Option::Some(lifted335) - } - _ => panic() - } - - array337.push(@types.VariantCaseType::{ - name: result322, - payload: lifted323, - metadata: @types.MetadataEnvelope::{ - doc: lifted325, - aliases: array327, - examples: array330, - deprecated: lifted333, - role: lifted336, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array337) - } - 16 => { - let array340 : Array[String] = [] - for index341 = 0 - index341 < mbt_ffi_load32(iter_base + 12) - index341 = index341 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index341 * 8 - - let result339 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array340.push(result339) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array340) - } - 17 => { - let array343 : Array[String] = [] - for index344 = 0 - index344 < mbt_ffi_load32(iter_base + 12) - index344 = index344 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index344 * 8 - - let result342 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array343.push(result342) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array343) - } - 18 => { - let array345 : Array[Int] = [] - for index346 = 0 - index346 < mbt_ffi_load32(iter_base + 12) - index346 = index346 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index346 * 4 - - array345.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array345) - } - 19 => - @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted347 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let array191 : Array[Int] = []; + for index192 = 0; index192 < (mbt_ffi_load32((iter_base) + 12)); index192 = index192 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index192 * 4) - let lifted348 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted347, - err: lifted348, - }) - } - 24 => { - let lifted352 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array350 : Array[String] = [] - for index351 = 0 - index351 < mbt_ffi_load32(iter_base + 16) - index351 = index351 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index351 * 8 + array191.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let result349 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::TupleType(array191) + } + 19 => { - array350.push(result349) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { - Option::Some(array350) - } - _ => panic() - } + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { - let lifted353 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { - let lifted354 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { - let lifted356 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result355 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + let lifted193 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(result355) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted352, - min_length: lifted353, - max_length: lifted354, - regex: lifted356, - }) - } - 25 => { - let lifted360 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array358 : Array[String] = [] - for index359 = 0 - index359 < mbt_ffi_load32(iter_base + 16) - index359 = index359 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index359 * 8 + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - let result357 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted194 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - array358.push(result357) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } - Option::Some(array358) - } - _ => panic() - } + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted193, err : lifted194}) + } + 24 => { - let lifted361 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + let lifted198 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted362 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted360, - min_bytes: lifted361, - max_bytes: lifted362, - }) - } - 26 => { - let lifted366 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array364 : Array[String] = [] - for index365 = 0 - index365 < mbt_ffi_load32(iter_base + 20) - index365 = index365 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index365 * 8 + let array196 : Array[String] = []; + for index197 = 0; index197 < (mbt_ffi_load32((iter_base) + 16)); index197 = index197 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index197 * 8) - let result363 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result195 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array364.push(result363) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) + array196.push(result195) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - Option::Some(array364) - } - _ => panic() - } + Option::Some(array196) + } + _ => panic() + } - let lifted370 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array368 : Array[String] = [] - for index369 = 0 - index369 < mbt_ffi_load32(iter_base + 32) - index369 = index369 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index369 * 8 + let lifted199 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - let result367 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - array368.push(result367) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let lifted200 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - Option::Some(array368) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted366, - allowed_extensions: lifted370, - }) - } - 27 => { - let lifted374 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array372 : Array[String] = [] - for index373 = 0 - index373 < mbt_ffi_load32(iter_base + 16) - index373 = index373 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index373 * 8 + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - let result371 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted202 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - array372.push(result371) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + let result201 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(array372) - } - _ => panic() - } + Option::Some(result201) + } + _ => panic() + } - let lifted378 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array376 : Array[String] = [] - for index377 = 0 - index377 < mbt_ffi_load32(iter_base + 28) - index377 = index377 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index377 * 8 + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted198, min_length : lifted199, max_length : lifted200, regex : lifted202}) + } + 25 => { - let result375 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted206 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array376.push(result375) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let array204 : Array[String] = []; + for index205 = 0; index205 < (mbt_ffi_load32((iter_base) + 16)); index205 = index205 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index205 * 8) - Option::Some(array376) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted374, - allowed_hosts: lifted378, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result379 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array381 : Array[String] = [] - for index382 = 0 - index382 < mbt_ffi_load32(iter_base + 20) - index382 = index382 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index382 * 8 - - let result380 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array381.push(result380) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted384 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result383 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) + let result203 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result383, - }) - } - _ => panic() - } + array204.push(result203) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let lifted386 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result385 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) + Option::Some(array204) + } + _ => panic() + } - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result385, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result379, - allowed_suffixes: array381, - min: lifted384, - max: lifted386, - }) - } - 31 => { - let array410 : Array[@types.UnionBranch] = [] - for index411 = 0 - index411 < mbt_ffi_load32(iter_base + 12) - index411 = index411 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index411 * 92 - - let result387 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted396 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result388 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result388) - } - 1 => { - let result389 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result389) - } - 2 => { - let result390 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result390) - } - 3 => { - let result391 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result391) - } - 4 => { - let result392 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted394 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result393 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let lifted207 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - Option::Some(result393) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result392, - literal: lifted394, - }) - } - 5 => { - let result395 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result395) - } - _ => panic() - } - - let lifted398 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result397 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result397) - } - _ => panic() - } - - let array400 : Array[String] = [] - for index401 = 0 - index401 < mbt_ffi_load32(iter_base + 52) - index401 = index401 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index401 * 8 - - let result399 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array400.push(result399) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array403 : Array[String] = [] - for index404 = 0 - index404 < mbt_ffi_load32(iter_base + 60) - index404 = index404 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index404 * 8 - - let result402 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array403.push(result402) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted406 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result405 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result405) - } - _ => panic() - } - - let lifted409 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted408 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result407 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - @types.Role::Other(result407) - } - _ => panic() - } - - Option::Some(lifted408) - } - _ => panic() - } - - array410.push(@types.UnionBranch::{ - tag: result387, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted396, - metadata: @types.MetadataEnvelope::{ - doc: lifted398, - aliases: array400, - examples: array403, - deprecated: lifted406, - role: lifted409, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array410, - }) - } - 32 => { - let lifted413 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result412 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let lifted208 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - Option::Some(result412) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted413, - }) - } - 33 => { - let lifted415 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result414 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - Option::Some(result414) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted415, - }) - } - 34 => { - let lifted416 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted206, min_bytes : lifted207, max_bytes : lifted208}) + } + 26 => { - @types.SchemaTypeBody::FutureType(lifted416) - } - 35 => { - let lifted417 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted212 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::StreamType(lifted417) - } - _ => panic() - } + let array210 : Array[String] = []; + for index211 = 0; index211 < (mbt_ffi_load32((iter_base) + 20)); index211 = index211 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index211 * 8) - let lifted420 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result419 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result419) - } - _ => panic() - } + let result209 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array422 : Array[String] = [] - for index423 = 0 - index423 < mbt_ffi_load32(iter_base + 104) - index423 = index423 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index423 * 8 + array210.push(result209) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let result421 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(array210) + } + _ => panic() + } - array422.push(result421) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let lifted216 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let array425 : Array[String] = [] - for index426 = 0 - index426 < mbt_ffi_load32(iter_base + 112) - index426 = index426 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index426 * 8 + let array214 : Array[String] = []; + for index215 = 0; index215 < (mbt_ffi_load32((iter_base) + 32)); index215 = index215 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index215 * 8) - let result424 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result213 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array425.push(result424) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted428 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result427 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result427) - } - _ => panic() - } + array214.push(result213) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let lifted431 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted430 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result429 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) + Option::Some(array214) + } + _ => panic() + } - @types.Role::Other(result429) - } - _ => panic() - } + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted212, allowed_extensions : lifted216}) + } + 27 => { - Option::Some(lifted430) - } - _ => panic() - } + let lifted220 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array432.push(@types.SchemaTypeNode::{ - body: lifted418, - metadata: @types.MetadataEnvelope::{ - doc: lifted420, - aliases: array422, - examples: array425, - deprecated: lifted428, - role: lifted431, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 12)) - - let array437 : Array[@types.SchemaTypeDef] = [] - for index438 = 0 - index438 < mbt_ffi_load32(return_area + 24) - index438 = index438 + 1 { - let iter_base = mbt_ffi_load32(return_area + 20) + index438 * 24 - - let result434 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted436 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result435 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result435) - } - _ => panic() - } + let array218 : Array[String] = []; + for index219 = 0; index219 < (mbt_ffi_load32((iter_base) + 16)); index219 = index219 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index219 * 8) - array437.push(@types.SchemaTypeDef::{ - id: result434, - name: lifted436, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 20)) - - let array468 : Array[@types.SchemaValueNode] = [] - for index469 = 0 - index469 < mbt_ffi_load32(return_area + 36) - index469 = index469 + 1 { - let iter_base = mbt_ffi_load32(return_area + 32) + index469 * 32 - - let lifted467 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => - @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => - @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => - @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => - @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result439 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result439) - } - 13 => { - let array440 : Array[Int] = [] - for index441 = 0 - index441 < mbt_ffi_load32(iter_base + 12) - index441 = index441 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index441 * 4 - - array440.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array440) - } - 14 => { - let lifted442 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted442, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array443 : Array[Bool] = [] - for index444 = 0 - index444 < mbt_ffi_load32(iter_base + 12) - index444 = index444 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index444 * 1 - - array443.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array443) - } - 17 => { - let array445 : Array[Int] = [] - for index446 = 0 - index446 < mbt_ffi_load32(iter_base + 12) - index446 = index446 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index446 * 4 - - array445.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array445) - } - 18 => { - let array447 : Array[Int] = [] - for index448 = 0 - index448 < mbt_ffi_load32(iter_base + 12) - index448 = index448 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index448 * 4 - - array447.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array447) - } - 19 => { - let array449 : Array[Int] = [] - for index450 = 0 - index450 < mbt_ffi_load32(iter_base + 12) - index450 = index450 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index450 * 4 - - array449.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array449) - } - 20 => { - let array451 : Array[@types.MapEntry] = [] - for index452 = 0 - index452 < mbt_ffi_load32(iter_base + 12) - index452 = index452 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index452 * 8 - - array451.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array451) - } - 21 => { - let lifted453 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result217 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaValueNode::OptionValue(lifted453) - } - 22 => { - let lifted456 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted454 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + array218.push(result217) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - @types.ResultValuePayload::OkValue(lifted454) - } - 1 => { - let lifted455 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + Option::Some(array218) + } + _ => panic() + } - @types.ResultValuePayload::ErrValue(lifted455) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted456) - } - 23 => { - let result457 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted459 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result458 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + let lifted224 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - Option::Some(result458) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result457, - language: lifted459, - }) - } - 24 => { - let result460 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted462 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result461 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + let array222 : Array[String] = []; + for index223 = 0; index223 < (mbt_ffi_load32((iter_base) + 28)); index223 = index223 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index223 * 8) + + let result221 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(result461) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result460, - mime_type: lifted462, - }) - } - 25 => { - let result463 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result463) - } - 26 => { - let result464 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result464) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result465 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result465, - }) - } - 30 => { - let result466 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result466, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } + array222.push(result221) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - array468.push(lifted467) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 32)) - - @common.AgentError::CustomError(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array432, - defs: array437, - root: mbt_ffi_load32(return_area + 28), - }, - value: @types.SchemaValueTree::{ - value_nodes: array468, - root: mbt_ffi_load32(return_area + 40), - }, - }) - } - _ => panic() - } + Option::Some(array222) + } + _ => panic() + } - Result::Err(lifted470) - } - _ => panic() - } - let ret = lifted471 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted220, allowed_hosts : lifted224}) + } + 28 => { -///| -/// Creates a webhook that can be used to integrate with webhook driven apis. -/// When the created url is called with a post request, the provided promise-id is completed with the body of the post request. -/// Note the following behaviours: -/// * Only agents whoose agent types are _currently_ deployed via an http api are allowed to create a webhook. Calling this function while the agent -/// is not deployed via an http api will trap. -/// * Only the agent type that created the promise is allowed to create a webhook for it. Using this host function -/// from a different agent type will trap. -pub fn create_webhook(promise_id : @types.PromiseId) -> String { - let ptr = mbt_ffi_str2ptr(promise_id.agent_id.agent_id) - let return_area = mbt_ffi_malloc(8) - wasmImportCreateWebhook( - promise_id.agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - promise_id.agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ptr, - promise_id.agent_id.agent_id.length(), - promise_id.oplog_idx.reinterpret_as_int64(), - return_area, - ) - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 0), - mbt_ffi_load32(return_area + 4), - ) - let ret = result - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + @types.SchemaTypeBody::DatetimeType + } + 29 => { -///| -/// Constructs the RPC client connecting to the given target agent. -/// -/// `constructor` is a value tree whose root encodes the target agent -/// constructor's parameter list. -pub fn WasmRpc::wasm_rpc( - agent_type_name : String, - constructor_ : @types.SchemaValueTree, - phantom_id : @types.Uuid?, - agent_config : Array[@common.TypedAgentConfigValue], -) -> WasmRpc { - let cleanup_list : Array[Int] = [] - - let ptr = mbt_ffi_str2ptr(agent_type_name) - - let address66 = mbt_ffi_malloc(constructor_.value_nodes.length() * 32) - for index67 = 0 - index67 < constructor_.value_nodes.length() - index67 = index67 + 1 { - let iter_elem : @types.SchemaValueNode = constructor_.value_nodes[index67] - let iter_base = address66 + index67 * 32 - - match iter_elem { - BoolValue(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) - - () - } - S8Value(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + @types.SchemaTypeBody::DurationType + } + 30 => { - () - } - S16Value(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + let result225 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - S32Value(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + let array227 : Array[String] = []; + for index228 = 0; index228 < (mbt_ffi_load32((iter_base) + 20)); index228 = index228 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index228 * 8) - () - } - S64Value(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload3) + let result226 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - U8Value(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload4.to_int()) + array227.push(result226) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - U16Value(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload5.reinterpret_as_int()) + let lifted230 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - () - } - U32Value(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload6.reinterpret_as_int()) + let result229 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - () - } - U64Value(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload7.reinterpret_as_int64()) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result229}) + } + _ => panic() + } - () - } - F32Value(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload8) + let lifted232 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - () - } - F64Value(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload9) + let result231 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - () - } - CharValue(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload10.to_int()) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result231}) + } + _ => panic() + } - () - } - StringValue(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result225, allowed_suffixes : array227, min : lifted230, max : lifted232}) + } + 31 => { - let ptr12 = mbt_ffi_str2ptr(payload11) - mbt_ffi_store32(iter_base + 12, payload11.length()) - mbt_ffi_store32(iter_base + 8, ptr12) - cleanup_list.push(ptr12) + let array256 : Array[@types.UnionBranch] = []; + for index257 = 0; index257 < (mbt_ffi_load32((iter_base) + 12)); index257 = index257 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index257 * 92) - () - } - RecordValue(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address = mbt_ffi_malloc(payload13.length() * 4) - for index = 0; index < payload13.length(); index = index + 1 { - let iter_elem : Int = payload13[index] - let iter_base = address + index * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload13.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - VariantValue(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.case.reinterpret_as_int()) + let result233 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload14.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let lifted242 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { - () - } - Some(payload16) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload16) + let result234 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - } + @types.DiscriminatorRule::Prefix(result234) + } + 1 => { - () - } - EnumValue(payload17) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload17.reinterpret_as_int()) + let result235 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - FlagsValue(payload18) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address19 = mbt_ffi_malloc(payload18.length() * 1) - for index20 = 0; index20 < payload18.length(); index20 = index20 + 1 { - let iter_elem : Bool = payload18[index20] - let iter_base = address19 + index20 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload18.length()) - mbt_ffi_store32(iter_base + 8, address19) - cleanup_list.push(address19) - - () - } - TupleValue(payload21) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address22 = mbt_ffi_malloc(payload21.length() * 4) - for index23 = 0; index23 < payload21.length(); index23 = index23 + 1 { - let iter_elem : Int = payload21[index23] - let iter_base = address22 + index23 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, address22) - cleanup_list.push(address22) - - () - } - ListValue(payload24) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address25 = mbt_ffi_malloc(payload24.length() * 4) - for index26 = 0; index26 < payload24.length(); index26 = index26 + 1 { - let iter_elem : Int = payload24[index26] - let iter_base = address25 + index26 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, address25) - cleanup_list.push(address25) - - () - } - FixedListValue(payload27) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address28 = mbt_ffi_malloc(payload27.length() * 4) - for index29 = 0; index29 < payload27.length(); index29 = index29 + 1 { - let iter_elem : Int = payload27[index29] - let iter_base = address28 + index29 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, address28) - cleanup_list.push(address28) - - () - } - MapValue(payload30) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address31 = mbt_ffi_malloc(payload30.length() * 8) - for index32 = 0; index32 < payload30.length(); index32 = index32 + 1 { - let iter_elem : @types.MapEntry = payload30[index32] - let iter_base = address31 + index32 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload30.length()) - mbt_ffi_store32(iter_base + 8, address31) - cleanup_list.push(address31) - - () - } - OptionValue(payload33) => { - mbt_ffi_store8(iter_base + 0, 21) + @types.DiscriminatorRule::Suffix(result235) + } + 2 => { - match payload33 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let result236 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - Some(payload35) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload35) + @types.DiscriminatorRule::Contains(result236) + } + 3 => { - () - } - } + let result237 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - ResultValue(payload36) => { - mbt_ffi_store8(iter_base + 0, 22) + @types.DiscriminatorRule::Regex(result237) + } + 4 => { - match payload36 { - OkValue(payload37) => { - mbt_ffi_store8(iter_base + 8, 0) + let result238 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match payload37 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let lifted240 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - () - } - Some(payload39) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload39) + let result239 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - () - } - } + Option::Some(result239) + } + _ => panic() + } - () - } - ErrValue(payload40) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result238, literal : lifted240}) + } + 5 => { - match payload40 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let result241 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - Some(payload42) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload42) + @types.DiscriminatorRule::FieldAbsent(result241) + } + _ => panic() + } - () - } - } + let lifted244 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - () - } - } + let result243 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - () - } - TextValue(payload43) => { - mbt_ffi_store8(iter_base + 0, 23) + Option::Some(result243) + } + _ => panic() + } - let ptr44 = mbt_ffi_str2ptr(payload43.text) - mbt_ffi_store32(iter_base + 12, payload43.text.length()) - mbt_ffi_store32(iter_base + 8, ptr44) + let array246 : Array[String] = []; + for index247 = 0; index247 < (mbt_ffi_load32((iter_base) + 52)); index247 = index247 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index247 * 8) - match payload43.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let result245 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload46) => { - mbt_ffi_store8(iter_base + 16, 1) + array246.push(result245) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - let ptr47 = mbt_ffi_str2ptr(payload46) - mbt_ffi_store32(iter_base + 24, payload46.length()) - mbt_ffi_store32(iter_base + 20, ptr47) - cleanup_list.push(ptr47) + let array249 : Array[String] = []; + for index250 = 0; index250 < (mbt_ffi_load32((iter_base) + 60)); index250 = index250 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index250 * 8) - () - } - } - cleanup_list.push(ptr44) + let result248 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - BinaryValue(payload48) => { - mbt_ffi_store8(iter_base + 0, 24) + array249.push(result248) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - let ptr49 = mbt_ffi_bytes2ptr(payload48.bytes) + let lifted252 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - mbt_ffi_store32(iter_base + 12, payload48.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr49) + let result251 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - match payload48.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + Option::Some(result251) + } + _ => panic() + } - () - } - Some(payload51) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted255 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - let ptr52 = mbt_ffi_str2ptr(payload51) - mbt_ffi_store32(iter_base + 24, payload51.length()) - mbt_ffi_store32(iter_base + 20, ptr52) - cleanup_list.push(ptr52) + let lifted254 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { - () - } - } - cleanup_list.push(ptr49) + @types.Role::Multimodal + } + 1 => { - () - } - PathValue(payload53) => { - mbt_ffi_store8(iter_base + 0, 25) + @types.Role::UnstructuredText + } + 2 => { - let ptr54 = mbt_ffi_str2ptr(payload53) - mbt_ffi_store32(iter_base + 12, payload53.length()) - mbt_ffi_store32(iter_base + 8, ptr54) - cleanup_list.push(ptr54) + @types.Role::UnstructuredBinary + } + 3 => { - () - } - UrlValue(payload55) => { - mbt_ffi_store8(iter_base + 0, 26) + let result253 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - let ptr56 = mbt_ffi_str2ptr(payload55) - mbt_ffi_store32(iter_base + 12, payload55.length()) - mbt_ffi_store32(iter_base + 8, ptr56) - cleanup_list.push(ptr56) + @types.Role::Other(result253) + } + _ => panic() + } - () - } - DatetimeValue(payload57) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload57.seconds) - mbt_ffi_store32( - iter_base + 16, - payload57.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload58) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload58.nanoseconds) + Option::Some(lifted254) + } + _ => panic() + } - () - } - QuantityValueNode(payload59) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload59.mantissa) - mbt_ffi_store32(iter_base + 16, payload59.scale) + array256.push(@types.UnionBranch::{tag : result233, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted242, metadata : @types.MetadataEnvelope::{doc : lifted244, aliases : array246, examples : array249, deprecated : lifted252, role : lifted255}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let ptr60 = mbt_ffi_str2ptr(payload59.unit) - mbt_ffi_store32(iter_base + 24, payload59.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr60) - cleanup_list.push(ptr60) + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array256}) + } + 32 => { - () - } - UnionValue(payload61) => { - mbt_ffi_store8(iter_base + 0, 30) + let lifted259 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let ptr62 = mbt_ffi_str2ptr(payload61.tag) - mbt_ffi_store32(iter_base + 12, payload61.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr62) - mbt_ffi_store32(iter_base + 16, payload61.body) - cleanup_list.push(ptr62) + let result258 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - SecretValue(payload63) => { - mbt_ffi_store8(iter_base + 0, 31) + Option::Some(result258) + } + _ => panic() + } - let @types.Secret(handle) = payload63 - mbt_ffi_store32(iter_base + 8, handle) + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted259}) + } + 33 => { - () - } - QuotaTokenHandle(payload64) => { - mbt_ffi_store8(iter_base + 0, 32) + let lifted261 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let @types.QuotaToken(handle65) = payload64 - mbt_ffi_store32(iter_base + 8, handle65) + let result260 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - () - } - } - } - - let (lowered, lowered70, lowered71) = match phantom_id { - None => (0, 0L, 0L) - Some(payload69) => - ( - 1, - payload69.high_bits.reinterpret_as_int64(), - payload69.low_bits.reinterpret_as_int64(), - ) - } - - let address516 = mbt_ffi_malloc(agent_config.length() * 40) - for index517 = 0; index517 < agent_config.length(); index517 = index517 + 1 { - let iter_elem : @common.TypedAgentConfigValue = agent_config[index517] - let iter_base = address516 + index517 * 40 - - let address73 = mbt_ffi_malloc(iter_elem.path.length() * 8) - for index74 = 0; index74 < iter_elem.path.length(); index74 = index74 + 1 { - let iter_elem : String = iter_elem.path[index74] - let iter_base = address73 + index74 * 8 - - let ptr72 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr72) - cleanup_list.push(ptr72) - } - mbt_ffi_store32(iter_base + 4, iter_elem.path.length()) - mbt_ffi_store32(iter_base + 0, address73) - - let address436 = mbt_ffi_malloc( - iter_elem.value.graph.type_nodes.length() * 144, - ) - for index437 = 0 - index437 < iter_elem.value.graph.type_nodes.length() - index437 = index437 + 1 { - let iter_elem : @types.SchemaTypeNode = iter_elem.value.graph.type_nodes[index437] - let iter_base = address436 + index437 * 144 - - match iter_elem.body { - RefType(payload75) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store32(iter_base + 8, payload75) - - () - } - BoolType => { - mbt_ffi_store8(iter_base + 0, 1) - - () - } - S8Type(payload77) => { - mbt_ffi_store8(iter_base + 0, 2) - - match payload77 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + Option::Some(result260) + } + _ => panic() + } - () - } - Some(payload79) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted261}) + } + 34 => { - match payload79.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - () - } - Some(payload81) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload81 { - Signed(payload82) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload82) - - () - } - Unsigned(payload83) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload83.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload84) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload84.reinterpret_as_int64(), - ) - - () - } - } + let lifted262 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - match payload79.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaTypeBody::FutureType(lifted262) + } + 36 => { - () - } - Some(payload86) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload86 { - Signed(payload87) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload87) - - () - } - Unsigned(payload88) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload88.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload89) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload89.reinterpret_as_int64(), - ) - - () - } - } + let lifted263 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - match payload79.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + @types.SchemaTypeBody::StreamType(lifted263) + } + _ => panic() + } - () - } - Some(payload91) => { - mbt_ffi_store8(iter_base + 64, 1) + let lifted266 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { - let ptr92 = mbt_ffi_str2ptr(payload91) - mbt_ffi_store32(iter_base + 72, payload91.length()) - mbt_ffi_store32(iter_base + 68, ptr92) - cleanup_list.push(ptr92) + let result265 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - () - } - } + Option::Some(result265) + } + _ => panic() + } - () - } - } + let array268 : Array[String] = []; + for index269 = 0; index269 < (mbt_ffi_load32((iter_base) + 104)); index269 = index269 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index269 * 8) - () - } - S16Type(payload93) => { - mbt_ffi_store8(iter_base + 0, 3) + let result267 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload93 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + array268.push(result267) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - () - } - Some(payload95) => { - mbt_ffi_store8(iter_base + 8, 1) + let array271 : Array[String] = []; + for index272 = 0; index272 < (mbt_ffi_load32((iter_base) + 112)); index272 = index272 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index272 * 8) - match payload95.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let result270 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload97) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload97 { - Signed(payload98) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload98) - - () - } - Unsigned(payload99) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload99.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload100) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload100.reinterpret_as_int64(), - ) - - () - } - } + array271.push(result270) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - () - } - } + let lifted274 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - match payload95.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let result273 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - () - } - Some(payload102) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload102 { - Signed(payload103) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload103) - - () - } - Unsigned(payload104) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload104.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload105) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload105.reinterpret_as_int64(), - ) - - () - } - } + Option::Some(result273) + } + _ => panic() + } - () - } - } + let lifted277 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - match payload95.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted276 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - () - } - Some(payload107) => { - mbt_ffi_store8(iter_base + 64, 1) + @types.Role::Multimodal + } + 1 => { - let ptr108 = mbt_ffi_str2ptr(payload107) - mbt_ffi_store32(iter_base + 72, payload107.length()) - mbt_ffi_store32(iter_base + 68, ptr108) - cleanup_list.push(ptr108) + @types.Role::UnstructuredText + } + 2 => { - () - } - } + @types.Role::UnstructuredBinary + } + 3 => { - () - } - } + let result275 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - () - } - S32Type(payload109) => { - mbt_ffi_store8(iter_base + 0, 4) + @types.Role::Other(result275) + } + _ => panic() + } - match payload109 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + Option::Some(lifted276) + } + _ => panic() + } - () - } - Some(payload111) => { - mbt_ffi_store8(iter_base + 8, 1) + array278.push(@types.SchemaTypeNode::{body : lifted264, metadata : @types.MetadataEnvelope::{doc : lifted266, aliases : array268, examples : array271, deprecated : lifted274, role : lifted277}}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 12)) - match payload111.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let array283 : Array[@types.SchemaTypeDef] = []; + for index284 = 0; index284 < (mbt_ffi_load32((return_area) + 24)); index284 = index284 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 20)) + (index284 * 24) - () - } - Some(payload113) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload113 { - Signed(payload114) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload114) - - () - } - Unsigned(payload115) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload115.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload116) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload116.reinterpret_as_int64(), - ) - - () - } - } + let result280 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - } + let lifted282 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload111.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let result281 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - () - } - Some(payload118) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload118 { - Signed(payload119) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload119) - - () - } - Unsigned(payload120) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload120.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload121) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload121.reinterpret_as_int64(), - ) - - () - } - } + Option::Some(result281) + } + _ => panic() + } - () - } - } + array283.push(@types.SchemaTypeDef::{id : result280, name : lifted282, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 20)) - match payload111.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let array314 : Array[@types.SchemaValueNode] = []; + for index315 = 0; index315 < (mbt_ffi_load32((return_area) + 36)); index315 = index315 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 32)) + (index315 * 32) - () - } - Some(payload123) => { - mbt_ffi_store8(iter_base + 64, 1) + let lifted313 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let ptr124 = mbt_ffi_str2ptr(payload123) - mbt_ffi_store32(iter_base + 72, payload123.length()) - mbt_ffi_store32(iter_base + 68, ptr124) - cleanup_list.push(ptr124) + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - () - } - } + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - () - } - } + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - () - } - S64Type(payload125) => { - mbt_ffi_store8(iter_base + 0, 5) + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - match payload125 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - () - } - Some(payload127) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - match payload127.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - () - } - Some(payload129) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload129 { - Signed(payload130) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload130) - - () - } - Unsigned(payload131) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload131.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload132) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload132.reinterpret_as_int64(), - ) - - () - } - } + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - () - } - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - match payload127.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - () - } - Some(payload134) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload134 { - Signed(payload135) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload135) - - () - } - Unsigned(payload136) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload136.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload137) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload137.reinterpret_as_int64(), - ) - - () - } - } + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - () - } - } + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - match payload127.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let result285 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Some(payload139) => { - mbt_ffi_store8(iter_base + 64, 1) + @types.SchemaValueNode::StringValue(result285) + } + 13 => { - let ptr140 = mbt_ffi_str2ptr(payload139) - mbt_ffi_store32(iter_base + 72, payload139.length()) - mbt_ffi_store32(iter_base + 68, ptr140) - cleanup_list.push(ptr140) + let array286 : Array[Int] = []; + for index287 = 0; index287 < (mbt_ffi_load32((iter_base) + 12)); index287 = index287 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index287 * 4) - () - } - } + array286.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } + @types.SchemaValueNode::RecordValue(array286) + } + 14 => { - () - } - U8Type(payload141) => { - mbt_ffi_store8(iter_base + 0, 6) + let lifted288 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - match payload141 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - () - } - Some(payload143) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted288}) + } + 15 => { - match payload143.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - () - } - Some(payload145) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload145 { - Signed(payload146) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload146) - - () - } - Unsigned(payload147) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload147.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload148) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload148.reinterpret_as_int64(), - ) - - () - } - } + let array289 : Array[Bool] = []; + for index290 = 0; index290 < (mbt_ffi_load32((iter_base) + 12)); index290 = index290 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index290 * 1) - () - } - } + array289.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload143.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaValueNode::FlagsValue(array289) + } + 17 => { - () - } - Some(payload150) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload150 { - Signed(payload151) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload151) - - () - } - Unsigned(payload152) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload152.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload153) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload153.reinterpret_as_int64(), - ) - - () - } - } + let array291 : Array[Int] = []; + for index292 = 0; index292 < (mbt_ffi_load32((iter_base) + 12)); index292 = index292 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index292 * 4) - () - } - } + array291.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload143.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + @types.SchemaValueNode::TupleValue(array291) + } + 18 => { - () - } - Some(payload155) => { - mbt_ffi_store8(iter_base + 64, 1) + let array293 : Array[Int] = []; + for index294 = 0; index294 < (mbt_ffi_load32((iter_base) + 12)); index294 = index294 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index294 * 4) - let ptr156 = mbt_ffi_str2ptr(payload155) - mbt_ffi_store32(iter_base + 72, payload155.length()) - mbt_ffi_store32(iter_base + 68, ptr156) - cleanup_list.push(ptr156) + array293.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } + @types.SchemaValueNode::ListValue(array293) + } + 19 => { - () - } - } + let array295 : Array[Int] = []; + for index296 = 0; index296 < (mbt_ffi_load32((iter_base) + 12)); index296 = index296 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index296 * 4) - () - } - U16Type(payload157) => { - mbt_ffi_store8(iter_base + 0, 7) + array295.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload157 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::FixedListValue(array295) + } + 20 => { - () - } - Some(payload159) => { - mbt_ffi_store8(iter_base + 8, 1) + let array297 : Array[@types.MapEntry] = []; + for index298 = 0; index298 < (mbt_ffi_load32((iter_base) + 12)); index298 = index298 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index298 * 8) - match payload159.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + array297.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Some(payload161) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload161 { - Signed(payload162) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload162) - - () - } - Unsigned(payload163) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload163.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload164) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload164.reinterpret_as_int64(), - ) - - () - } - } + @types.SchemaValueNode::MapValue(array297) + } + 21 => { - () - } - } + let lifted299 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload159.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - () - } - Some(payload166) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload166 { - Signed(payload167) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload167) - - () - } - Unsigned(payload168) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload168.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload169) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload169.reinterpret_as_int64(), - ) - - () - } - } + @types.SchemaValueNode::OptionValue(lifted299) + } + 22 => { - () - } - } + let lifted302 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - match payload159.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted300 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - Some(payload171) => { - mbt_ffi_store8(iter_base + 64, 1) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let ptr172 = mbt_ffi_str2ptr(payload171) - mbt_ffi_store32(iter_base + 72, payload171.length()) - mbt_ffi_store32(iter_base + 68, ptr172) - cleanup_list.push(ptr172) + @types.ResultValuePayload::OkValue(lifted300) + } + 1 => { - () - } - } + let lifted301 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - () - } - U32Type(payload173) => { - mbt_ffi_store8(iter_base + 0, 8) + @types.ResultValuePayload::ErrValue(lifted301) + } + _ => panic() + } - match payload173 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::ResultValue(lifted302) + } + 23 => { - () - } - Some(payload175) => { - mbt_ffi_store8(iter_base + 8, 1) + let result303 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload175.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted305 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload177) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload177 { - Signed(payload178) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload178) - - () - } - Unsigned(payload179) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload179.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload180) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload180.reinterpret_as_int64(), - ) - - () - } - } + let result304 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - } + Option::Some(result304) + } + _ => panic() + } - match payload175.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result303, language : lifted305}) + } + 24 => { - () - } - Some(payload182) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload182 { - Signed(payload183) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload183) - - () - } - Unsigned(payload184) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload184.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload185) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload185.reinterpret_as_int64(), - ) - - () - } - } + let result306 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } + let lifted308 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - match payload175.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let result307 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - Some(payload187) => { - mbt_ffi_store8(iter_base + 64, 1) + Option::Some(result307) + } + _ => panic() + } - let ptr188 = mbt_ffi_str2ptr(payload187) - mbt_ffi_store32(iter_base + 72, payload187.length()) - mbt_ffi_store32(iter_base + 68, ptr188) - cleanup_list.push(ptr188) + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result306, mime_type : lifted308}) + } + 25 => { - () - } - } + let result309 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } + @types.SchemaValueNode::PathValue(result309) + } + 26 => { - () - } - U64Type(payload189) => { - mbt_ffi_store8(iter_base + 0, 9) + let result310 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload189 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::UrlValue(result310) + } + 27 => { - () - } - Some(payload191) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - match payload191.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - () - } - Some(payload193) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload193 { - Signed(payload194) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload194) - - () - } - Unsigned(payload195) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload195.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload196) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload196.reinterpret_as_int64(), - ) - - () - } - } + let result311 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - } + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result311}) + } + 30 => { - match payload191.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let result312 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Some(payload198) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload198 { - Signed(payload199) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload199) - - () - } - Unsigned(payload200) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload200.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload201) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload201.reinterpret_as_int64(), - ) - - () - } - } + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result312, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - () - } - } + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - match payload191.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - () - } - Some(payload203) => { - mbt_ffi_store8(iter_base + 64, 1) + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } - let ptr204 = mbt_ffi_str2ptr(payload203) - mbt_ffi_store32(iter_base + 72, payload203.length()) - mbt_ffi_store32(iter_base + 68, ptr204) - cleanup_list.push(ptr204) + array314.push(lifted313) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 32)) - () - } - } + @common.AgentError::CustomError(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array278, defs : array283, root : mbt_ffi_load32((return_area) + 28)}, value : @types.SchemaValueTree::{value_nodes : array314, root : mbt_ffi_load32((return_area) + 40)}}) + } + _ => panic() + } - () + RpcError::RemoteAgentError(lifted316) + } + _ => panic() + } + + Result::Err(lifted317) } - } + _ => panic() + } + let ret = lifted318 + mbt_ffi_free(ptr) + mbt_ffi_free(address69) + mbt_ffi_free(return_area) - () - } - F32Type(payload205) => { - mbt_ffi_store8(iter_base + 0, 10) + cleanup_list.each(mbt_ffi_free) + return ret - match payload205 { - None => { - mbt_ffi_store8(iter_base + 8, 0) +} +///| +/// Invokes a remote method with the given parameters, and returns a `future-invoke-result` value which can +/// be polled for the result together with the final invocation identity. +/// +/// With this function it is possible to call multiple (different) agents simultaneously. +pub fn WasmRpc::async_invoke_and_await(self : WasmRpc, method_name : String, input : @types.SchemaValueTree, scope_card : @types.PermissionCard?) -> AsyncInvocationWithMetadata { + let cleanup_list : Array[Int] = [] - () - } - Some(payload207) => { - mbt_ffi_store8(iter_base + 8, 1) + let WasmRpc(handle) = self - match payload207.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let ptr = mbt_ffi_str2ptr(method_name) - () - } - Some(payload209) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload209 { - Signed(payload210) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload210) - - () - } - Unsigned(payload211) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload211.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload212) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload212.reinterpret_as_int64(), - ) - - () - } - } + let address69 = mbt_ffi_malloc(((input).value_nodes).length() * 32); + for index70 = 0; index70 < ((input).value_nodes).length(); index70 = index70 + 1 { + let iter_elem : @types.SchemaValueNode = ((input).value_nodes)[(index70)] + let iter_base = address69 + (index70 * 32); - () - } - } + match iter_elem { + BoolValue(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) - match payload207.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + S8Value(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) - () - } - Some(payload214) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload214 { - Signed(payload215) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload215) - - () - } - Unsigned(payload216) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload216.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload217) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload217.reinterpret_as_int64(), - ) - - () - } + () } + S16Value(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) - () - } - } + () + } + S32Value(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) - match payload207.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + () + } + S64Value(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload3) - () - } - Some(payload219) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + U8Value(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload4).to_int()) - let ptr220 = mbt_ffi_str2ptr(payload219) - mbt_ffi_store32(iter_base + 72, payload219.length()) - mbt_ffi_store32(iter_base + 68, ptr220) - cleanup_list.push(ptr220) + () + } + U16Value(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload5).reinterpret_as_int()) - () - } - } + () + } + U32Value(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload6).reinterpret_as_int()) - () - } - } + () + } + U64Value(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload7).reinterpret_as_int64()) - () - } - F64Type(payload221) => { - mbt_ffi_store8(iter_base + 0, 11) + () + } + F32Value(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload8) - match payload221 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + F64Value(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload9) - () - } - Some(payload223) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + CharValue(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload10).to_int()) - match payload223.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + StringValue(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) - () - } - Some(payload225) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload225 { - Signed(payload226) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload226) - - () - } - Unsigned(payload227) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload227.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload228) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload228.reinterpret_as_int64(), - ) - - () - } + let ptr12 = mbt_ffi_str2ptr(payload11) + mbt_ffi_store32((iter_base) + 12, payload11.length()) + mbt_ffi_store32((iter_base) + 8, ptr12) + cleanup_list.push(ptr12) + + () } + RecordValue(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) - () - } - } + let address = mbt_ffi_malloc((payload13).length() * 4); + for index = 0; index < (payload13).length(); index = index + 1 { + let iter_elem : Int = (payload13)[(index)] + let iter_base = address + (index * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match payload223.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + } + mbt_ffi_store32((iter_base) + 12, (payload13).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) - () - } - Some(payload230) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload230 { - Signed(payload231) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload231) - - () - } - Unsigned(payload232) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload232.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload233) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload233.reinterpret_as_int64(), - ) - - () - } + () } + VariantValue(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload14).case).reinterpret_as_int()) - () - } - } + match ((payload14).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - match payload223.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + () + } + Some(payload16) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload16) - () - } - Some(payload235) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + } - let ptr236 = mbt_ffi_str2ptr(payload235) - mbt_ffi_store32(iter_base + 72, payload235.length()) - mbt_ffi_store32(iter_base + 68, ptr236) - cleanup_list.push(ptr236) + () + } + EnumValue(payload17) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload17).reinterpret_as_int()) - () - } - } + () + } + FlagsValue(payload18) => { + mbt_ffi_store8((iter_base) + 0, (16)) - () - } - } - - () - } - CharType => { - mbt_ffi_store8(iter_base + 0, 12) - - () - } - StringType => { - mbt_ffi_store8(iter_base + 0, 13) - - () - } - RecordType(payload239) => { - mbt_ffi_store8(iter_base + 0, 14) - - let address260 = mbt_ffi_malloc(payload239.length() * 68) - for index261 = 0 - index261 < payload239.length() - index261 = index261 + 1 { - let iter_elem : @types.NamedFieldType = payload239[index261] - let iter_base = address260 + index261 * 68 - - let ptr240 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr240) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload242) => { - mbt_ffi_store8(iter_base + 12, 1) - - let ptr243 = mbt_ffi_str2ptr(payload242) - mbt_ffi_store32(iter_base + 20, payload242.length()) - mbt_ffi_store32(iter_base + 16, ptr243) - cleanup_list.push(ptr243) - - () - } - } + let address19 = mbt_ffi_malloc((payload18).length() * 1); + for index20 = 0; index20 < (payload18).length(); index20 = index20 + 1 { + let iter_elem : Bool = (payload18)[(index20)] + let iter_base = address19 + (index20 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) - let address245 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index246 = 0 - index246 < iter_elem.metadata.aliases.length() - index246 = index246 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index246] - let iter_base = address245 + index246 * 8 - - let ptr244 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr244) - cleanup_list.push(ptr244) - } - mbt_ffi_store32(iter_base + 28, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 24, address245) - - let address248 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index249 = 0 - index249 < iter_elem.metadata.examples.length() - index249 = index249 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index249] - let iter_base = address248 + index249 * 8 - - let ptr247 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr247) - cleanup_list.push(ptr247) - } - mbt_ffi_store32( - iter_base + 36, - iter_elem.metadata.examples.length(), - ) - mbt_ffi_store32(iter_base + 32, address248) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload251) => { - mbt_ffi_store8(iter_base + 40, 1) - - let ptr252 = mbt_ffi_str2ptr(payload251) - mbt_ffi_store32(iter_base + 48, payload251.length()) - mbt_ffi_store32(iter_base + 44, ptr252) - cleanup_list.push(ptr252) - - () - } - } + } + mbt_ffi_store32((iter_base) + 12, (payload18).length()) + mbt_ffi_store32((iter_base) + 8, address19) + cleanup_list.push(address19) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 52, 0) + () + } + TupleValue(payload21) => { + mbt_ffi_store8((iter_base) + 0, (17)) - () - } - Some(payload254) => { - mbt_ffi_store8(iter_base + 52, 1) + let address22 = mbt_ffi_malloc((payload21).length() * 4); + for index23 = 0; index23 < (payload21).length(); index23 = index23 + 1 { + let iter_elem : Int = (payload21)[(index23)] + let iter_base = address22 + (index23 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match payload254 { - Multimodal => { - mbt_ffi_store8(iter_base + 56, 0) + } + mbt_ffi_store32((iter_base) + 12, (payload21).length()) + mbt_ffi_store32((iter_base) + 8, address22) + cleanup_list.push(address22) - () + () } - UnstructuredText => { - mbt_ffi_store8(iter_base + 56, 1) + ListValue(payload24) => { + mbt_ffi_store8((iter_base) + 0, (18)) - () + let address25 = mbt_ffi_malloc((payload24).length() * 4); + for index26 = 0; index26 < (payload24).length(); index26 = index26 + 1 { + let iter_elem : Int = (payload24)[(index26)] + let iter_base = address25 + (index26 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload24).length()) + mbt_ffi_store32((iter_base) + 8, address25) + cleanup_list.push(address25) + + () } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 56, 2) + FixedListValue(payload27) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address28 = mbt_ffi_malloc((payload27).length() * 4); + for index29 = 0; index29 < (payload27).length(); index29 = index29 + 1 { + let iter_elem : Int = (payload27)[(index29)] + let iter_base = address28 + (index29 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () + } + mbt_ffi_store32((iter_base) + 12, (payload27).length()) + mbt_ffi_store32((iter_base) + 8, address28) + cleanup_list.push(address28) + + () } - Other(payload258) => { - mbt_ffi_store8(iter_base + 56, 3) + MapValue(payload30) => { + mbt_ffi_store8((iter_base) + 0, (20)) - let ptr259 = mbt_ffi_str2ptr(payload258) - mbt_ffi_store32(iter_base + 64, payload258.length()) - mbt_ffi_store32(iter_base + 60, ptr259) - cleanup_list.push(ptr259) + let address31 = mbt_ffi_malloc((payload30).length() * 8); + for index32 = 0; index32 < (payload30).length(); index32 = index32 + 1 { + let iter_elem : @types.MapEntry = (payload30)[(index32)] + let iter_base = address31 + (index32 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload30).length()) + mbt_ffi_store32((iter_base) + 8, address31) + cleanup_list.push(address31) - () + () } - } + OptionValue(payload33) => { + mbt_ffi_store8((iter_base) + 0, (21)) - () - } - } - cleanup_list.push(ptr240) - cleanup_list.push(address245) - cleanup_list.push(address248) - } - mbt_ffi_store32(iter_base + 12, payload239.length()) - mbt_ffi_store32(iter_base + 8, address260) - cleanup_list.push(address260) - - () - } - VariantType(payload262) => { - mbt_ffi_store8(iter_base + 0, 15) - - let address285 = mbt_ffi_malloc(payload262.length() * 72) - for index286 = 0 - index286 < payload262.length() - index286 = index286 + 1 { - let iter_elem : @types.VariantCaseType = payload262[index286] - let iter_base = address285 + index286 * 72 - - let ptr263 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr263) - - match iter_elem.payload { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload265) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload265) - - () - } - } + match (payload33) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + Some(payload35) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload35) - () - } - Some(payload267) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + } - let ptr268 = mbt_ffi_str2ptr(payload267) - mbt_ffi_store32(iter_base + 24, payload267.length()) - mbt_ffi_store32(iter_base + 20, ptr268) - cleanup_list.push(ptr268) + () + } + ResultValue(payload36) => { + mbt_ffi_store8((iter_base) + 0, (22)) - () - } - } + match payload36 { + OkValue(payload37) => { + mbt_ffi_store8((iter_base) + 8, (0)) - let address270 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index271 = 0 - index271 < iter_elem.metadata.aliases.length() - index271 = index271 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index271] - let iter_base = address270 + index271 * 8 - - let ptr269 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr269) - cleanup_list.push(ptr269) - } - mbt_ffi_store32(iter_base + 32, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 28, address270) - - let address273 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index274 = 0 - index274 < iter_elem.metadata.examples.length() - index274 = index274 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index274] - let iter_base = address273 + index274 * 8 - - let ptr272 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr272) - cleanup_list.push(ptr272) - } - mbt_ffi_store32( - iter_base + 40, - iter_elem.metadata.examples.length(), - ) - mbt_ffi_store32(iter_base + 36, address273) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 44, 0) - - () - } - Some(payload276) => { - mbt_ffi_store8(iter_base + 44, 1) - - let ptr277 = mbt_ffi_str2ptr(payload276) - mbt_ffi_store32(iter_base + 52, payload276.length()) - mbt_ffi_store32(iter_base + 48, ptr277) - cleanup_list.push(ptr277) - - () - } - } + match (payload37) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 56, 0) + () + } + Some(payload39) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload39) - () - } - Some(payload279) => { - mbt_ffi_store8(iter_base + 56, 1) + () + } + } - match payload279 { - Multimodal => { - mbt_ffi_store8(iter_base + 60, 0) + () + } + ErrValue(payload40) => { + mbt_ffi_store8((iter_base) + 8, (1)) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 60, 1) + match (payload40) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 60, 2) + () + } + Some(payload42) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload42) - () - } - Other(payload283) => { - mbt_ffi_store8(iter_base + 60, 3) + () + } + } - let ptr284 = mbt_ffi_str2ptr(payload283) - mbt_ffi_store32(iter_base + 68, payload283.length()) - mbt_ffi_store32(iter_base + 64, ptr284) - cleanup_list.push(ptr284) + () + } + } - () + () } - } + TextValue(payload43) => { + mbt_ffi_store8((iter_base) + 0, (23)) - () - } - } - cleanup_list.push(ptr263) - cleanup_list.push(address270) - cleanup_list.push(address273) - } - mbt_ffi_store32(iter_base + 12, payload262.length()) - mbt_ffi_store32(iter_base + 8, address285) - cleanup_list.push(address285) - - () - } - EnumType(payload287) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address289 = mbt_ffi_malloc(payload287.length() * 8) - for index290 = 0 - index290 < payload287.length() - index290 = index290 + 1 { - let iter_elem : String = payload287[index290] - let iter_base = address289 + index290 * 8 - - let ptr288 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr288) - cleanup_list.push(ptr288) - } - mbt_ffi_store32(iter_base + 12, payload287.length()) - mbt_ffi_store32(iter_base + 8, address289) - cleanup_list.push(address289) - - () - } - FlagsType(payload291) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address293 = mbt_ffi_malloc(payload291.length() * 8) - for index294 = 0 - index294 < payload291.length() - index294 = index294 + 1 { - let iter_elem : String = payload291[index294] - let iter_base = address293 + index294 * 8 - - let ptr292 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr292) - cleanup_list.push(ptr292) - } - mbt_ffi_store32(iter_base + 12, payload291.length()) - mbt_ffi_store32(iter_base + 8, address293) - cleanup_list.push(address293) - - () - } - TupleType(payload295) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address296 = mbt_ffi_malloc(payload295.length() * 4) - for index297 = 0 - index297 < payload295.length() - index297 = index297 + 1 { - let iter_elem : Int = payload295[index297] - let iter_base = address296 + index297 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload295.length()) - mbt_ffi_store32(iter_base + 8, address296) - cleanup_list.push(address296) - - () - } - ListType(payload298) => { - mbt_ffi_store8(iter_base + 0, 19) - mbt_ffi_store32(iter_base + 8, payload298) - - () - } - FixedListType(payload299) => { - mbt_ffi_store8(iter_base + 0, 20) - mbt_ffi_store32(iter_base + 8, payload299.element) - mbt_ffi_store32( - iter_base + 12, - payload299.length.reinterpret_as_int(), - ) - - () - } - MapType(payload300) => { - mbt_ffi_store8(iter_base + 0, 21) - mbt_ffi_store32(iter_base + 8, payload300.key) - mbt_ffi_store32(iter_base + 12, payload300.value) - - () - } - OptionType(payload301) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store32(iter_base + 8, payload301) - - () - } - ResultType(payload302) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload302.ok { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr44 = mbt_ffi_str2ptr((payload43).text) + mbt_ffi_store32((iter_base) + 12, (payload43).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) - () - } - Some(payload304) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload304) + match ((payload43).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - () - } - } + () + } + Some(payload46) => { + mbt_ffi_store8((iter_base) + 16, (1)) - match payload302.err { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let ptr47 = mbt_ffi_str2ptr(payload46) + mbt_ffi_store32((iter_base) + 24, payload46.length()) + mbt_ffi_store32((iter_base) + 20, ptr47) + cleanup_list.push(ptr47) - () - } - Some(payload306) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload306) + () + } + } + cleanup_list.push(ptr44) - () - } - } + () + } + BinaryValue(payload48) => { + mbt_ffi_store8((iter_base) + 0, (24)) - () - } - TextType(payload307) => { - mbt_ffi_store8(iter_base + 0, 24) + let ptr49 = mbt_ffi_bytes2ptr((payload48).bytes) - match payload307.languages { - None => { - mbt_ffi_store8(iter_base + 8, 0) + mbt_ffi_store32((iter_base) + 12, (payload48).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) - () - } - Some(payload309) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address311 = mbt_ffi_malloc(payload309.length() * 8) - for index312 = 0 - index312 < payload309.length() - index312 = index312 + 1 { - let iter_elem : String = payload309[index312] - let iter_base = address311 + index312 * 8 - - let ptr310 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr310) - cleanup_list.push(ptr310) - } - mbt_ffi_store32(iter_base + 16, payload309.length()) - mbt_ffi_store32(iter_base + 12, address311) - cleanup_list.push(address311) - - () - } - } + match ((payload48).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - match payload307.min_length { - None => { - mbt_ffi_store8(iter_base + 20, 0) + () + } + Some(payload51) => { + mbt_ffi_store8((iter_base) + 16, (1)) - () - } - Some(payload314) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload314.reinterpret_as_int()) + let ptr52 = mbt_ffi_str2ptr(payload51) + mbt_ffi_store32((iter_base) + 24, payload51.length()) + mbt_ffi_store32((iter_base) + 20, ptr52) + cleanup_list.push(ptr52) - () - } - } + () + } + } + cleanup_list.push(ptr49) - match payload307.max_length { - None => { - mbt_ffi_store8(iter_base + 28, 0) + () + } + PathValue(payload53) => { + mbt_ffi_store8((iter_base) + 0, (25)) - () - } - Some(payload316) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload316.reinterpret_as_int()) + let ptr54 = mbt_ffi_str2ptr(payload53) + mbt_ffi_store32((iter_base) + 12, payload53.length()) + mbt_ffi_store32((iter_base) + 8, ptr54) + cleanup_list.push(ptr54) - () - } - } + () + } + UrlValue(payload55) => { + mbt_ffi_store8((iter_base) + 0, (26)) - match payload307.regex { - None => { - mbt_ffi_store8(iter_base + 36, 0) + let ptr56 = mbt_ffi_str2ptr(payload55) + mbt_ffi_store32((iter_base) + 12, payload55.length()) + mbt_ffi_store32((iter_base) + 8, ptr56) + cleanup_list.push(ptr56) - () - } - Some(payload318) => { - mbt_ffi_store8(iter_base + 36, 1) + () + } + DatetimeValue(payload57) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload57).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload57).nanoseconds).reinterpret_as_int()) - let ptr319 = mbt_ffi_str2ptr(payload318) - mbt_ffi_store32(iter_base + 44, payload318.length()) - mbt_ffi_store32(iter_base + 40, ptr319) - cleanup_list.push(ptr319) + () + } + DurationValue(payload58) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload58).nanoseconds) - () - } - } + () + } + QuantityValueNode(payload59) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload59).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload59).scale) + + let ptr60 = mbt_ffi_str2ptr((payload59).unit) + mbt_ffi_store32((iter_base) + 24, (payload59).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr60) + cleanup_list.push(ptr60) - () - } - BinaryType(payload320) => { - mbt_ffi_store8(iter_base + 0, 25) + () + } + UnionValue(payload61) => { + mbt_ffi_store8((iter_base) + 0, (30)) - match payload320.mime_types { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr62 = mbt_ffi_str2ptr((payload61).tag) + mbt_ffi_store32((iter_base) + 12, (payload61).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr62) + mbt_ffi_store32((iter_base) + 16, (payload61).body) + cleanup_list.push(ptr62) - () - } - Some(payload322) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address324 = mbt_ffi_malloc(payload322.length() * 8) - for index325 = 0 - index325 < payload322.length() - index325 = index325 + 1 { - let iter_elem : String = payload322[index325] - let iter_base = address324 + index325 * 8 - - let ptr323 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr323) - cleanup_list.push(ptr323) - } - mbt_ffi_store32(iter_base + 16, payload322.length()) - mbt_ffi_store32(iter_base + 12, address324) - cleanup_list.push(address324) - - () - } - } + () + } + SecretValue(payload63) => { + mbt_ffi_store8((iter_base) + 0, (31)) - match payload320.min_bytes { - None => { - mbt_ffi_store8(iter_base + 20, 0) + let @types.Secret(handle64) = payload63 + mbt_ffi_store32((iter_base) + 8, handle64) - () - } - Some(payload327) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload327.reinterpret_as_int()) + () + } + QuotaTokenHandle(payload65) => { + mbt_ffi_store8((iter_base) + 0, (32)) - () - } - } + let @types.QuotaToken(handle66) = payload65 + mbt_ffi_store32((iter_base) + 8, handle66) - match payload320.max_bytes { - None => { - mbt_ffi_store8(iter_base + 28, 0) + () + } + PermissionCardHandle(payload67) => { + mbt_ffi_store8((iter_base) + 0, (33)) - () - } - Some(payload329) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload329.reinterpret_as_int()) + let @types.PermissionCard(handle68) = payload67 + mbt_ffi_store32((iter_base) + 8, handle68) - () + () + } } - } - () - } - PathType(payload330) => { - mbt_ffi_store8(iter_base + 0, 26) - mbt_ffi_store8(iter_base + 8, payload330.direction.ordinal()) - mbt_ffi_store8(iter_base + 9, payload330.kind.ordinal()) + } - match payload330.allowed_mime_types { + let (lowered, lowered74) = match (scope_card) { None => { - mbt_ffi_store8(iter_base + 12, 0) - () + ((0), 0) } - Some(payload332) => { - mbt_ffi_store8(iter_base + 12, 1) - - let address334 = mbt_ffi_malloc(payload332.length() * 8) - for index335 = 0 - index335 < payload332.length() - index335 = index335 + 1 { - let iter_elem : String = payload332[index335] - let iter_base = address334 + index335 * 8 - - let ptr333 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr333) - cleanup_list.push(ptr333) - } - mbt_ffi_store32(iter_base + 20, payload332.length()) - mbt_ffi_store32(iter_base + 16, address334) - cleanup_list.push(address334) - - () - } - } + Some(payload72) => { - match payload330.allowed_extensions { - None => { - mbt_ffi_store8(iter_base + 24, 0) + let @types.PermissionCard(handle73) = payload72 - () + ((1), handle73) } - Some(payload337) => { - mbt_ffi_store8(iter_base + 24, 1) - - let address339 = mbt_ffi_malloc(payload337.length() * 8) - for index340 = 0 - index340 < payload337.length() - index340 = index340 + 1 { - let iter_elem : String = payload337[index340] - let iter_base = address339 + index340 * 8 - - let ptr338 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr338) - cleanup_list.push(ptr338) - } - mbt_ffi_store32(iter_base + 32, payload337.length()) - mbt_ffi_store32(iter_base + 28, address339) - cleanup_list.push(address339) - - () - } - } + } + let return_area = mbt_ffi_malloc(20) + wasmImportMethodWasmRpcAsyncInvokeAndAwait(handle, ptr, method_name.length(), address69, ((input).value_nodes).length(), (input).root, lowered, lowered74, return_area); - () - } - UrlType(payload341) => { - mbt_ffi_store8(iter_base + 0, 27) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 0), mbt_ffi_load32((return_area) + 4)) - match payload341.allowed_schemes { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let result75 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + let ret = AsyncInvocationWithMetadata::{metadata : InvocationMetadata::{agent_id : result, idempotency_key : result75}, future : FutureInvokeResult::FutureInvokeResult(mbt_ffi_load32((return_area) + 16))} + mbt_ffi_free(ptr) + mbt_ffi_free(address69) + mbt_ffi_free(return_area) - () - } - Some(payload343) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address345 = mbt_ffi_malloc(payload343.length() * 8) - for index346 = 0 - index346 < payload343.length() - index346 = index346 + 1 { - let iter_elem : String = payload343[index346] - let iter_base = address345 + index346 * 8 - - let ptr344 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr344) - cleanup_list.push(ptr344) - } - mbt_ffi_store32(iter_base + 16, payload343.length()) - mbt_ffi_store32(iter_base + 12, address345) - cleanup_list.push(address345) - - () - } - } + cleanup_list.each(mbt_ffi_free) + return ret - match payload341.allowed_hosts { - None => { - mbt_ffi_store8(iter_base + 20, 0) +} +///| +/// Schedules an invocation for later and returns its final identity. +pub fn WasmRpc::schedule_invocation(self : WasmRpc, scheduled_time : @system-clock.Instant, method_name : String, input : @types.SchemaValueTree, scope_card : @types.PermissionCard?) -> ScheduledInvocationReceipt { + let cleanup_list : Array[Int] = [] - () - } - Some(payload348) => { - mbt_ffi_store8(iter_base + 20, 1) - - let address350 = mbt_ffi_malloc(payload348.length() * 8) - for index351 = 0 - index351 < payload348.length() - index351 = index351 + 1 { - let iter_elem : String = payload348[index351] - let iter_base = address350 + index351 * 8 - - let ptr349 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr349) - cleanup_list.push(ptr349) - } - mbt_ffi_store32(iter_base + 28, payload348.length()) - mbt_ffi_store32(iter_base + 24, address350) - cleanup_list.push(address350) - - () - } - } - - () - } - DatetimeType => { - mbt_ffi_store8(iter_base + 0, 28) - - () - } - DurationType => { - mbt_ffi_store8(iter_base + 0, 29) - - () - } - QuantityType(payload354) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr355 = mbt_ffi_str2ptr(payload354.base_unit) - mbt_ffi_store32(iter_base + 12, payload354.base_unit.length()) - mbt_ffi_store32(iter_base + 8, ptr355) - - let address357 = mbt_ffi_malloc( - payload354.allowed_suffixes.length() * 8, - ) - for index358 = 0 - index358 < payload354.allowed_suffixes.length() - index358 = index358 + 1 { - let iter_elem : String = payload354.allowed_suffixes[index358] - let iter_base = address357 + index358 * 8 - - let ptr356 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr356) - cleanup_list.push(ptr356) - } - mbt_ffi_store32(iter_base + 20, payload354.allowed_suffixes.length()) - mbt_ffi_store32(iter_base + 16, address357) - - match payload354.min { - None => { - mbt_ffi_store8(iter_base + 24, 0) + let WasmRpc(handle) = self - () - } - Some(payload360) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload360.mantissa) - mbt_ffi_store32(iter_base + 40, payload360.scale) + let ptr = mbt_ffi_str2ptr(method_name) - let ptr361 = mbt_ffi_str2ptr(payload360.unit) - mbt_ffi_store32(iter_base + 48, payload360.unit.length()) - mbt_ffi_store32(iter_base + 44, ptr361) - cleanup_list.push(ptr361) + let address69 = mbt_ffi_malloc(((input).value_nodes).length() * 32); + for index70 = 0; index70 < ((input).value_nodes).length(); index70 = index70 + 1 { + let iter_elem : @types.SchemaValueNode = ((input).value_nodes)[(index70)] + let iter_base = address69 + (index70 * 32); - () - } - } + match iter_elem { + BoolValue(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) - match payload354.max { - None => { - mbt_ffi_store8(iter_base + 56, 0) + () + } + S8Value(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) - () - } - Some(payload363) => { - mbt_ffi_store8(iter_base + 56, 1) - mbt_ffi_store64(iter_base + 64, payload363.mantissa) - mbt_ffi_store32(iter_base + 72, payload363.scale) + () + } + S16Value(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) - let ptr364 = mbt_ffi_str2ptr(payload363.unit) - mbt_ffi_store32(iter_base + 80, payload363.unit.length()) - mbt_ffi_store32(iter_base + 76, ptr364) - cleanup_list.push(ptr364) + () + } + S32Value(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) - () - } - } - cleanup_list.push(ptr355) - cleanup_list.push(address357) - - () - } - UnionType(payload365) => { - mbt_ffi_store8(iter_base + 0, 31) - - let address401 = mbt_ffi_malloc(payload365.branches.length() * 92) - for index402 = 0 - index402 < payload365.branches.length() - index402 = index402 + 1 { - let iter_elem : @types.UnionBranch = payload365.branches[index402] - let iter_base = address401 + index402 * 92 - - let ptr366 = mbt_ffi_str2ptr(iter_elem.tag) - mbt_ffi_store32(iter_base + 4, iter_elem.tag.length()) - mbt_ffi_store32(iter_base + 0, ptr366) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.discriminator { - Prefix(payload367) => { - mbt_ffi_store8(iter_base + 12, 0) - - let ptr368 = mbt_ffi_str2ptr(payload367) - mbt_ffi_store32(iter_base + 20, payload367.length()) - mbt_ffi_store32(iter_base + 16, ptr368) - cleanup_list.push(ptr368) - - () - } - Suffix(payload369) => { - mbt_ffi_store8(iter_base + 12, 1) - - let ptr370 = mbt_ffi_str2ptr(payload369) - mbt_ffi_store32(iter_base + 20, payload369.length()) - mbt_ffi_store32(iter_base + 16, ptr370) - cleanup_list.push(ptr370) - - () - } - Contains(payload371) => { - mbt_ffi_store8(iter_base + 12, 2) - - let ptr372 = mbt_ffi_str2ptr(payload371) - mbt_ffi_store32(iter_base + 20, payload371.length()) - mbt_ffi_store32(iter_base + 16, ptr372) - cleanup_list.push(ptr372) - - () - } - Regex(payload373) => { - mbt_ffi_store8(iter_base + 12, 3) - - let ptr374 = mbt_ffi_str2ptr(payload373) - mbt_ffi_store32(iter_base + 20, payload373.length()) - mbt_ffi_store32(iter_base + 16, ptr374) - cleanup_list.push(ptr374) - - () - } - FieldEquals(payload375) => { - mbt_ffi_store8(iter_base + 12, 4) - - let ptr376 = mbt_ffi_str2ptr(payload375.field_name) - mbt_ffi_store32(iter_base + 20, payload375.field_name.length()) - mbt_ffi_store32(iter_base + 16, ptr376) - - match payload375.literal { - None => { - mbt_ffi_store8(iter_base + 24, 0) + () + } + S64Value(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload3) - () + () } - Some(payload378) => { - mbt_ffi_store8(iter_base + 24, 1) + U8Value(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload4).to_int()) - let ptr379 = mbt_ffi_str2ptr(payload378) - mbt_ffi_store32(iter_base + 32, payload378.length()) - mbt_ffi_store32(iter_base + 28, ptr379) - cleanup_list.push(ptr379) + () + } + U16Value(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload5).reinterpret_as_int()) - () + () } - } - cleanup_list.push(ptr376) + U32Value(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload6).reinterpret_as_int()) - () - } - FieldAbsent(payload380) => { - mbt_ffi_store8(iter_base + 12, 5) + () + } + U64Value(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload7).reinterpret_as_int64()) - let ptr381 = mbt_ffi_str2ptr(payload380) - mbt_ffi_store32(iter_base + 20, payload380.length()) - mbt_ffi_store32(iter_base + 16, ptr381) - cleanup_list.push(ptr381) + () + } + F32Value(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload8) - () - } - } + () + } + F64Value(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload9) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 36, 0) + () + } + CharValue(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload10).to_int()) - () - } - Some(payload383) => { - mbt_ffi_store8(iter_base + 36, 1) + () + } + StringValue(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) - let ptr384 = mbt_ffi_str2ptr(payload383) - mbt_ffi_store32(iter_base + 44, payload383.length()) - mbt_ffi_store32(iter_base + 40, ptr384) - cleanup_list.push(ptr384) + let ptr12 = mbt_ffi_str2ptr(payload11) + mbt_ffi_store32((iter_base) + 12, payload11.length()) + mbt_ffi_store32((iter_base) + 8, ptr12) + cleanup_list.push(ptr12) - () - } - } + () + } + RecordValue(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) - let address386 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index387 = 0 - index387 < iter_elem.metadata.aliases.length() - index387 = index387 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index387] - let iter_base = address386 + index387 * 8 - - let ptr385 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr385) - cleanup_list.push(ptr385) - } - mbt_ffi_store32(iter_base + 52, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 48, address386) - - let address389 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index390 = 0 - index390 < iter_elem.metadata.examples.length() - index390 = index390 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index390] - let iter_base = address389 + index390 * 8 - - let ptr388 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr388) - cleanup_list.push(ptr388) - } - mbt_ffi_store32( - iter_base + 60, - iter_elem.metadata.examples.length(), - ) - mbt_ffi_store32(iter_base + 56, address389) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload392) => { - mbt_ffi_store8(iter_base + 64, 1) - - let ptr393 = mbt_ffi_str2ptr(payload392) - mbt_ffi_store32(iter_base + 72, payload392.length()) - mbt_ffi_store32(iter_base + 68, ptr393) - cleanup_list.push(ptr393) - - () - } - } + let address = mbt_ffi_malloc((payload13).length() * 4); + for index = 0; index < (payload13).length(); index = index + 1 { + let iter_elem : Int = (payload13)[(index)] + let iter_base = address + (index * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload13).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 76, 0) + () + } + VariantValue(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload14).case).reinterpret_as_int()) + + match ((payload14).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - Some(payload395) => { - mbt_ffi_store8(iter_base + 76, 1) + () + } + Some(payload16) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload16) - match payload395 { - Multimodal => { - mbt_ffi_store8(iter_base + 80, 0) + () + } + } - () + () } - UnstructuredText => { - mbt_ffi_store8(iter_base + 80, 1) + EnumValue(payload17) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload17).reinterpret_as_int()) - () + () } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 80, 2) + FlagsValue(payload18) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address19 = mbt_ffi_malloc((payload18).length() * 1); + for index20 = 0; index20 < (payload18).length(); index20 = index20 + 1 { + let iter_elem : Bool = (payload18)[(index20)] + let iter_base = address19 + (index20 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload18).length()) + mbt_ffi_store32((iter_base) + 8, address19) + cleanup_list.push(address19) - () + () } - Other(payload399) => { - mbt_ffi_store8(iter_base + 80, 3) + TupleValue(payload21) => { + mbt_ffi_store8((iter_base) + 0, (17)) - let ptr400 = mbt_ffi_str2ptr(payload399) - mbt_ffi_store32(iter_base + 88, payload399.length()) - mbt_ffi_store32(iter_base + 84, ptr400) - cleanup_list.push(ptr400) + let address22 = mbt_ffi_malloc((payload21).length() * 4); + for index23 = 0; index23 < (payload21).length(); index23 = index23 + 1 { + let iter_elem : Int = (payload21)[(index23)] + let iter_base = address22 + (index23 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () + } + mbt_ffi_store32((iter_base) + 12, (payload21).length()) + mbt_ffi_store32((iter_base) + 8, address22) + cleanup_list.push(address22) + + () } - } + ListValue(payload24) => { + mbt_ffi_store8((iter_base) + 0, (18)) - () - } - } - cleanup_list.push(ptr366) - cleanup_list.push(address386) - cleanup_list.push(address389) - } - mbt_ffi_store32(iter_base + 12, payload365.branches.length()) - mbt_ffi_store32(iter_base + 8, address401) - cleanup_list.push(address401) - - () - } - SecretType(payload403) => { - mbt_ffi_store8(iter_base + 0, 32) - mbt_ffi_store32(iter_base + 8, payload403.inner) - - match payload403.category { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let address25 = mbt_ffi_malloc((payload24).length() * 4); + for index26 = 0; index26 < (payload24).length(); index26 = index26 + 1 { + let iter_elem : Int = (payload24)[(index26)] + let iter_base = address25 + (index26 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () - } - Some(payload405) => { - mbt_ffi_store8(iter_base + 12, 1) + } + mbt_ffi_store32((iter_base) + 12, (payload24).length()) + mbt_ffi_store32((iter_base) + 8, address25) + cleanup_list.push(address25) - let ptr406 = mbt_ffi_str2ptr(payload405) - mbt_ffi_store32(iter_base + 20, payload405.length()) - mbt_ffi_store32(iter_base + 16, ptr406) - cleanup_list.push(ptr406) + () + } + FixedListValue(payload27) => { + mbt_ffi_store8((iter_base) + 0, (19)) - () - } - } + let address28 = mbt_ffi_malloc((payload27).length() * 4); + for index29 = 0; index29 < (payload27).length(); index29 = index29 + 1 { + let iter_elem : Int = (payload27)[(index29)] + let iter_base = address28 + (index29 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () - } - QuotaTokenType(payload407) => { - mbt_ffi_store8(iter_base + 0, 33) + } + mbt_ffi_store32((iter_base) + 12, (payload27).length()) + mbt_ffi_store32((iter_base) + 8, address28) + cleanup_list.push(address28) - match payload407.resource_name { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + MapValue(payload30) => { + mbt_ffi_store8((iter_base) + 0, (20)) - () - } - Some(payload409) => { - mbt_ffi_store8(iter_base + 8, 1) + let address31 = mbt_ffi_malloc((payload30).length() * 8); + for index32 = 0; index32 < (payload30).length(); index32 = index32 + 1 { + let iter_elem : @types.MapEntry = (payload30)[(index32)] + let iter_base = address31 + (index32 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) - let ptr410 = mbt_ffi_str2ptr(payload409) - mbt_ffi_store32(iter_base + 16, payload409.length()) - mbt_ffi_store32(iter_base + 12, ptr410) - cleanup_list.push(ptr410) + } + mbt_ffi_store32((iter_base) + 12, (payload30).length()) + mbt_ffi_store32((iter_base) + 8, address31) + cleanup_list.push(address31) - () - } - } + () + } + OptionValue(payload33) => { + mbt_ffi_store8((iter_base) + 0, (21)) - () - } - FutureType(payload411) => { - mbt_ffi_store8(iter_base + 0, 34) + match (payload33) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload411 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + Some(payload35) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload35) - () - } - Some(payload413) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload413) + () + } + } - () - } - } + () + } + ResultValue(payload36) => { + mbt_ffi_store8((iter_base) + 0, (22)) - () - } - StreamType(payload414) => { - mbt_ffi_store8(iter_base + 0, 35) + match payload36 { + OkValue(payload37) => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload414 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match (payload37) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - Some(payload416) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload416) + () + } + Some(payload39) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload39) - () - } - } + () + } + } - () - } - } + () + } + ErrValue(payload40) => { + mbt_ffi_store8((iter_base) + 8, (1)) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 88, 0) + match (payload40) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - Some(payload418) => { - mbt_ffi_store8(iter_base + 88, 1) + () + } + Some(payload42) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload42) - let ptr419 = mbt_ffi_str2ptr(payload418) - mbt_ffi_store32(iter_base + 96, payload418.length()) - mbt_ffi_store32(iter_base + 92, ptr419) - cleanup_list.push(ptr419) + () + } + } - () - } - } + () + } + } - let address421 = mbt_ffi_malloc(iter_elem.metadata.aliases.length() * 8) - for index422 = 0 - index422 < iter_elem.metadata.aliases.length() - index422 = index422 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index422] - let iter_base = address421 + index422 * 8 - - let ptr420 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr420) - cleanup_list.push(ptr420) - } - mbt_ffi_store32(iter_base + 104, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 100, address421) - - let address424 = mbt_ffi_malloc(iter_elem.metadata.examples.length() * 8) - for index425 = 0 - index425 < iter_elem.metadata.examples.length() - index425 = index425 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index425] - let iter_base = address424 + index425 * 8 - - let ptr423 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr423) - cleanup_list.push(ptr423) - } - mbt_ffi_store32(iter_base + 112, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 108, address424) + () + } + TextValue(payload43) => { + mbt_ffi_store8((iter_base) + 0, (23)) - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 116, 0) + let ptr44 = mbt_ffi_str2ptr((payload43).text) + mbt_ffi_store32((iter_base) + 12, (payload43).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) - () - } - Some(payload427) => { - mbt_ffi_store8(iter_base + 116, 1) + match ((payload43).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - let ptr428 = mbt_ffi_str2ptr(payload427) - mbt_ffi_store32(iter_base + 124, payload427.length()) - mbt_ffi_store32(iter_base + 120, ptr428) - cleanup_list.push(ptr428) + () + } + Some(payload46) => { + mbt_ffi_store8((iter_base) + 16, (1)) - () - } - } + let ptr47 = mbt_ffi_str2ptr(payload46) + mbt_ffi_store32((iter_base) + 24, payload46.length()) + mbt_ffi_store32((iter_base) + 20, ptr47) + cleanup_list.push(ptr47) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 128, 0) + () + } + } + cleanup_list.push(ptr44) - () - } - Some(payload430) => { - mbt_ffi_store8(iter_base + 128, 1) + () + } + BinaryValue(payload48) => { + mbt_ffi_store8((iter_base) + 0, (24)) - match payload430 { - Multimodal => { - mbt_ffi_store8(iter_base + 132, 0) + let ptr49 = mbt_ffi_bytes2ptr((payload48).bytes) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 132, 1) + mbt_ffi_store32((iter_base) + 12, (payload48).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 132, 2) + match ((payload48).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - () - } - Other(payload434) => { - mbt_ffi_store8(iter_base + 132, 3) + () + } + Some(payload51) => { + mbt_ffi_store8((iter_base) + 16, (1)) - let ptr435 = mbt_ffi_str2ptr(payload434) - mbt_ffi_store32(iter_base + 140, payload434.length()) - mbt_ffi_store32(iter_base + 136, ptr435) - cleanup_list.push(ptr435) + let ptr52 = mbt_ffi_str2ptr(payload51) + mbt_ffi_store32((iter_base) + 24, payload51.length()) + mbt_ffi_store32((iter_base) + 20, ptr52) + cleanup_list.push(ptr52) - () - } - } + () + } + } + cleanup_list.push(ptr49) - () - } - } - cleanup_list.push(address421) - cleanup_list.push(address424) - } - mbt_ffi_store32(iter_base + 12, iter_elem.value.graph.type_nodes.length()) - mbt_ffi_store32(iter_base + 8, address436) - - let address442 = mbt_ffi_malloc(iter_elem.value.graph.defs.length() * 24) - for index443 = 0 - index443 < iter_elem.value.graph.defs.length() - index443 = index443 + 1 { - let iter_elem : @types.SchemaTypeDef = iter_elem.value.graph.defs[index443] - let iter_base = address442 + index443 * 24 - - let ptr438 = mbt_ffi_str2ptr(iter_elem.id) - mbt_ffi_store32(iter_base + 4, iter_elem.id.length()) - mbt_ffi_store32(iter_base + 0, ptr438) - - match iter_elem.name { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload440) => { - mbt_ffi_store8(iter_base + 8, 1) - - let ptr441 = mbt_ffi_str2ptr(payload440) - mbt_ffi_store32(iter_base + 16, payload440.length()) - mbt_ffi_store32(iter_base + 12, ptr441) - cleanup_list.push(ptr441) - - () - } - } - mbt_ffi_store32(iter_base + 20, iter_elem.body) - cleanup_list.push(ptr438) - } - mbt_ffi_store32(iter_base + 20, iter_elem.value.graph.defs.length()) - mbt_ffi_store32(iter_base + 16, address442) - mbt_ffi_store32(iter_base + 24, iter_elem.value.graph.root) - - let address514 = mbt_ffi_malloc( - iter_elem.value.value.value_nodes.length() * 32, - ) - for index515 = 0 - index515 < iter_elem.value.value.value_nodes.length() - index515 = index515 + 1 { - let iter_elem : @types.SchemaValueNode = iter_elem.value.value.value_nodes[index515] - let iter_base = address514 + index515 * 32 - - match iter_elem { - BoolValue(payload444) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload444 { 1 } else { 0 }) - - () - } - S8Value(payload445) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload445)) - - () - } - S16Value(payload446) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload446)) - - () - } - S32Value(payload447) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload447) - - () - } - S64Value(payload448) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload448) - - () - } - U8Value(payload449) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload449.to_int()) - - () - } - U16Value(payload450) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload450.reinterpret_as_int()) - - () - } - U32Value(payload451) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload451.reinterpret_as_int()) - - () - } - U64Value(payload452) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload452.reinterpret_as_int64()) - - () - } - F32Value(payload453) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload453) - - () - } - F64Value(payload454) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload454) - - () - } - CharValue(payload455) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload455.to_int()) - - () - } - StringValue(payload456) => { - mbt_ffi_store8(iter_base + 0, 12) - - let ptr457 = mbt_ffi_str2ptr(payload456) - mbt_ffi_store32(iter_base + 12, payload456.length()) - mbt_ffi_store32(iter_base + 8, ptr457) - cleanup_list.push(ptr457) - - () - } - RecordValue(payload458) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address459 = mbt_ffi_malloc(payload458.length() * 4) - for index460 = 0 - index460 < payload458.length() - index460 = index460 + 1 { - let iter_elem : Int = payload458[index460] - let iter_base = address459 + index460 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload458.length()) - mbt_ffi_store32(iter_base + 8, address459) - cleanup_list.push(address459) - - () - } - VariantValue(payload461) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload461.case.reinterpret_as_int()) - - match payload461.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + () + } + PathValue(payload53) => { + mbt_ffi_store8((iter_base) + 0, (25)) - () - } - Some(payload463) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload463) + let ptr54 = mbt_ffi_str2ptr(payload53) + mbt_ffi_store32((iter_base) + 12, payload53.length()) + mbt_ffi_store32((iter_base) + 8, ptr54) + cleanup_list.push(ptr54) - () - } - } - - () - } - EnumValue(payload464) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload464.reinterpret_as_int()) - - () - } - FlagsValue(payload465) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address466 = mbt_ffi_malloc(payload465.length() * 1) - for index467 = 0 - index467 < payload465.length() - index467 = index467 + 1 { - let iter_elem : Bool = payload465[index467] - let iter_base = address466 + index467 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload465.length()) - mbt_ffi_store32(iter_base + 8, address466) - cleanup_list.push(address466) - - () - } - TupleValue(payload468) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address469 = mbt_ffi_malloc(payload468.length() * 4) - for index470 = 0 - index470 < payload468.length() - index470 = index470 + 1 { - let iter_elem : Int = payload468[index470] - let iter_base = address469 + index470 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload468.length()) - mbt_ffi_store32(iter_base + 8, address469) - cleanup_list.push(address469) - - () - } - ListValue(payload471) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address472 = mbt_ffi_malloc(payload471.length() * 4) - for index473 = 0 - index473 < payload471.length() - index473 = index473 + 1 { - let iter_elem : Int = payload471[index473] - let iter_base = address472 + index473 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload471.length()) - mbt_ffi_store32(iter_base + 8, address472) - cleanup_list.push(address472) - - () - } - FixedListValue(payload474) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address475 = mbt_ffi_malloc(payload474.length() * 4) - for index476 = 0 - index476 < payload474.length() - index476 = index476 + 1 { - let iter_elem : Int = payload474[index476] - let iter_base = address475 + index476 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload474.length()) - mbt_ffi_store32(iter_base + 8, address475) - cleanup_list.push(address475) - - () - } - MapValue(payload477) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address478 = mbt_ffi_malloc(payload477.length() * 8) - for index479 = 0 - index479 < payload477.length() - index479 = index479 + 1 { - let iter_elem : @types.MapEntry = payload477[index479] - let iter_base = address478 + index479 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload477.length()) - mbt_ffi_store32(iter_base + 8, address478) - cleanup_list.push(address478) - - () - } - OptionValue(payload480) => { - mbt_ffi_store8(iter_base + 0, 21) - - match payload480 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + UrlValue(payload55) => { + mbt_ffi_store8((iter_base) + 0, (26)) - () - } - Some(payload482) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload482) + let ptr56 = mbt_ffi_str2ptr(payload55) + mbt_ffi_store32((iter_base) + 12, payload55.length()) + mbt_ffi_store32((iter_base) + 8, ptr56) + cleanup_list.push(ptr56) - () - } - } + () + } + DatetimeValue(payload57) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload57).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload57).nanoseconds).reinterpret_as_int()) - () - } - ResultValue(payload483) => { - mbt_ffi_store8(iter_base + 0, 22) + () + } + DurationValue(payload58) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload58).nanoseconds) - match payload483 { - OkValue(payload484) => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + QuantityValueNode(payload59) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload59).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload59).scale) - match payload484 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let ptr60 = mbt_ffi_str2ptr((payload59).unit) + mbt_ffi_store32((iter_base) + 24, (payload59).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr60) + cleanup_list.push(ptr60) - () - } - Some(payload486) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload486) + () + } + UnionValue(payload61) => { + mbt_ffi_store8((iter_base) + 0, (30)) - () - } - } + let ptr62 = mbt_ffi_str2ptr((payload61).tag) + mbt_ffi_store32((iter_base) + 12, (payload61).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr62) + mbt_ffi_store32((iter_base) + 16, (payload61).body) + cleanup_list.push(ptr62) - () - } - ErrValue(payload487) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + SecretValue(payload63) => { + mbt_ffi_store8((iter_base) + 0, (31)) - match payload487 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let @types.Secret(handle64) = payload63 + mbt_ffi_store32((iter_base) + 8, handle64) - () - } - Some(payload489) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload489) + () + } + QuotaTokenHandle(payload65) => { + mbt_ffi_store8((iter_base) + 0, (32)) - () - } - } + let @types.QuotaToken(handle66) = payload65 + mbt_ffi_store32((iter_base) + 8, handle66) - () - } - } + () + } + PermissionCardHandle(payload67) => { + mbt_ffi_store8((iter_base) + 0, (33)) - () - } - TextValue(payload490) => { - mbt_ffi_store8(iter_base + 0, 23) + let @types.PermissionCard(handle68) = payload67 + mbt_ffi_store32((iter_base) + 8, handle68) - let ptr491 = mbt_ffi_str2ptr(payload490.text) - mbt_ffi_store32(iter_base + 12, payload490.text.length()) - mbt_ffi_store32(iter_base + 8, ptr491) + () + } + } + + } - match payload490.language { + let (lowered, lowered74) = match (scope_card) { None => { - mbt_ffi_store8(iter_base + 16, 0) - () + ((0), 0) } - Some(payload493) => { - mbt_ffi_store8(iter_base + 16, 1) + Some(payload72) => { - let ptr494 = mbt_ffi_str2ptr(payload493) - mbt_ffi_store32(iter_base + 24, payload493.length()) - mbt_ffi_store32(iter_base + 20, ptr494) - cleanup_list.push(ptr494) + let @types.PermissionCard(handle73) = payload72 - () + ((1), handle73) } - } - cleanup_list.push(ptr491) + } + let return_area = mbt_ffi_malloc(16) + wasmImportMethodWasmRpcScheduleInvocation(handle, (scheduled_time).seconds, ((scheduled_time).nanoseconds).reinterpret_as_int(), ptr, method_name.length(), address69, ((input).value_nodes).length(), (input).root, lowered, lowered74, return_area); - () - } - BinaryValue(payload495) => { - mbt_ffi_store8(iter_base + 0, 24) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 0), mbt_ffi_load32((return_area) + 4)) - let ptr496 = mbt_ffi_bytes2ptr(payload495.bytes) + let result75 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + let ret = ScheduledInvocationReceipt::{metadata : InvocationMetadata::{agent_id : result, idempotency_key : result75}} + mbt_ffi_free(ptr) + mbt_ffi_free(address69) + mbt_ffi_free(return_area) - mbt_ffi_store32(iter_base + 12, payload495.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr496) + cleanup_list.each(mbt_ffi_free) + return ret - match payload495.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) +} +///| +/// Schedules an invocation for later and returns its final identity and +/// cancellation capability. Call cancel on the returned resource to +/// cancel the invocation before the scheduled time. +pub fn WasmRpc::schedule_cancelable_invocation(self : WasmRpc, scheduled_time : @system-clock.Instant, method_name : String, input : @types.SchemaValueTree, scope_card : @types.PermissionCard?) -> CancelableScheduledInvocationReceipt { + let cleanup_list : Array[Int] = [] - () - } - Some(payload498) => { - mbt_ffi_store8(iter_base + 16, 1) + let WasmRpc(handle) = self - let ptr499 = mbt_ffi_str2ptr(payload498) - mbt_ffi_store32(iter_base + 24, payload498.length()) - mbt_ffi_store32(iter_base + 20, ptr499) - cleanup_list.push(ptr499) + let ptr = mbt_ffi_str2ptr(method_name) - () - } - } - cleanup_list.push(ptr496) - - () - } - PathValue(payload500) => { - mbt_ffi_store8(iter_base + 0, 25) - - let ptr501 = mbt_ffi_str2ptr(payload500) - mbt_ffi_store32(iter_base + 12, payload500.length()) - mbt_ffi_store32(iter_base + 8, ptr501) - cleanup_list.push(ptr501) - - () - } - UrlValue(payload502) => { - mbt_ffi_store8(iter_base + 0, 26) - - let ptr503 = mbt_ffi_str2ptr(payload502) - mbt_ffi_store32(iter_base + 12, payload502.length()) - mbt_ffi_store32(iter_base + 8, ptr503) - cleanup_list.push(ptr503) - - () - } - DatetimeValue(payload504) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload504.seconds) - mbt_ffi_store32( - iter_base + 16, - payload504.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload505) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload505.nanoseconds) - - () - } - QuantityValueNode(payload506) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload506.mantissa) - mbt_ffi_store32(iter_base + 16, payload506.scale) - - let ptr507 = mbt_ffi_str2ptr(payload506.unit) - mbt_ffi_store32(iter_base + 24, payload506.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr507) - cleanup_list.push(ptr507) - - () - } - UnionValue(payload508) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr509 = mbt_ffi_str2ptr(payload508.tag) - mbt_ffi_store32(iter_base + 12, payload508.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr509) - mbt_ffi_store32(iter_base + 16, payload508.body) - cleanup_list.push(ptr509) - - () - } - SecretValue(payload510) => { - mbt_ffi_store8(iter_base + 0, 31) - - let @types.Secret(handle511) = payload510 - mbt_ffi_store32(iter_base + 8, handle511) - - () - } - QuotaTokenHandle(payload512) => { - mbt_ffi_store8(iter_base + 0, 32) - - let @types.QuotaToken(handle513) = payload512 - mbt_ffi_store32(iter_base + 8, handle513) - - () - } - } - } - mbt_ffi_store32(iter_base + 32, iter_elem.value.value.value_nodes.length()) - mbt_ffi_store32(iter_base + 28, address514) - mbt_ffi_store32(iter_base + 36, iter_elem.value.value.root) - cleanup_list.push(address73) - cleanup_list.push(address436) - cleanup_list.push(address442) - cleanup_list.push(address514) - } - let result : Int = wasmImportConstructorWasmRpc( - ptr, - agent_type_name.length(), - address66, - constructor_.value_nodes.length(), - constructor_.root, - lowered, - lowered70, - lowered71, - address516, - agent_config.length(), - ) - let ret = WasmRpc::WasmRpc(result) - mbt_ffi_free(ptr) - mbt_ffi_free(address66) - mbt_ffi_free(address516) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let address69 = mbt_ffi_malloc(((input).value_nodes).length() * 32); + for index70 = 0; index70 < ((input).value_nodes).length(); index70 = index70 + 1 { + let iter_elem : @types.SchemaValueNode = ((input).value_nodes)[(index70)] + let iter_base = address69 + (index70 * 32); -///| -/// Invokes a remote method with the given parameters, and awaits the result. -/// -/// `input` encodes the method's parameter list. The returned result is -/// `none` for a `unit` output and `some(value)` for a `single` output. -pub fn WasmRpc::invoke_and_await( - self : WasmRpc, - method_name : String, - input : @types.SchemaValueTree, -) -> Result[InvocationResultWithMetadata, RpcError] { - let cleanup_list : Array[Int] = [] + match iter_elem { + BoolValue(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) - let WasmRpc(handle) = self + () + } + S8Value(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) - let ptr = mbt_ffi_str2ptr(method_name) + () + } + S16Value(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) - let address67 = mbt_ffi_malloc(input.value_nodes.length() * 32) - for index68 = 0; index68 < input.value_nodes.length(); index68 = index68 + 1 { - let iter_elem : @types.SchemaValueNode = input.value_nodes[index68] - let iter_base = address67 + index68 * 32 + () + } + S32Value(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) - match iter_elem { - BoolValue(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) + () + } + S64Value(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload3) - () - } - S8Value(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + () + } + U8Value(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload4).to_int()) - () - } - S16Value(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + () + } + U16Value(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload5).reinterpret_as_int()) - () - } - S32Value(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + () + } + U32Value(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload6).reinterpret_as_int()) - () - } - S64Value(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload3) + () + } + U64Value(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload7).reinterpret_as_int64()) - () - } - U8Value(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload4.to_int()) + () + } + F32Value(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload8) - () - } - U16Value(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload5.reinterpret_as_int()) + () + } + F64Value(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload9) - () - } - U32Value(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload6.reinterpret_as_int()) + () + } + CharValue(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload10).to_int()) - () - } - U64Value(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload7.reinterpret_as_int64()) + () + } + StringValue(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) - () - } - F32Value(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload8) + let ptr12 = mbt_ffi_str2ptr(payload11) + mbt_ffi_store32((iter_base) + 12, payload11.length()) + mbt_ffi_store32((iter_base) + 8, ptr12) + cleanup_list.push(ptr12) - () - } - F64Value(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload9) + () + } + RecordValue(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) - () - } - CharValue(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload10.to_int()) + let address = mbt_ffi_malloc((payload13).length() * 4); + for index = 0; index < (payload13).length(); index = index + 1 { + let iter_elem : Int = (payload13)[(index)] + let iter_base = address + (index * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () - } - StringValue(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) + } + mbt_ffi_store32((iter_base) + 12, (payload13).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) - let ptr12 = mbt_ffi_str2ptr(payload11) - mbt_ffi_store32(iter_base + 12, payload11.length()) - mbt_ffi_store32(iter_base + 8, ptr12) - cleanup_list.push(ptr12) + () + } + VariantValue(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload14).case).reinterpret_as_int()) - () - } - RecordValue(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address = mbt_ffi_malloc(payload13.length() * 4) - for index = 0; index < payload13.length(); index = index + 1 { - let iter_elem : Int = payload13[index] - let iter_base = address + index * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload13.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - VariantValue(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.case.reinterpret_as_int()) + match ((payload14).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - match payload14.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + () + } + Some(payload16) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload16) - () - } - Some(payload16) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload16) + () + } + } - () - } - } + () + } + EnumValue(payload17) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload17).reinterpret_as_int()) - () - } - EnumValue(payload17) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload17.reinterpret_as_int()) + () + } + FlagsValue(payload18) => { + mbt_ffi_store8((iter_base) + 0, (16)) - () - } - FlagsValue(payload18) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address19 = mbt_ffi_malloc(payload18.length() * 1) - for index20 = 0; index20 < payload18.length(); index20 = index20 + 1 { - let iter_elem : Bool = payload18[index20] - let iter_base = address19 + index20 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload18.length()) - mbt_ffi_store32(iter_base + 8, address19) - cleanup_list.push(address19) - - () - } - TupleValue(payload21) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address22 = mbt_ffi_malloc(payload21.length() * 4) - for index23 = 0; index23 < payload21.length(); index23 = index23 + 1 { - let iter_elem : Int = payload21[index23] - let iter_base = address22 + index23 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, address22) - cleanup_list.push(address22) - - () - } - ListValue(payload24) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address25 = mbt_ffi_malloc(payload24.length() * 4) - for index26 = 0; index26 < payload24.length(); index26 = index26 + 1 { - let iter_elem : Int = payload24[index26] - let iter_base = address25 + index26 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, address25) - cleanup_list.push(address25) - - () - } - FixedListValue(payload27) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address28 = mbt_ffi_malloc(payload27.length() * 4) - for index29 = 0; index29 < payload27.length(); index29 = index29 + 1 { - let iter_elem : Int = payload27[index29] - let iter_base = address28 + index29 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, address28) - cleanup_list.push(address28) - - () - } - MapValue(payload30) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address31 = mbt_ffi_malloc(payload30.length() * 8) - for index32 = 0; index32 < payload30.length(); index32 = index32 + 1 { - let iter_elem : @types.MapEntry = payload30[index32] - let iter_base = address31 + index32 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload30.length()) - mbt_ffi_store32(iter_base + 8, address31) - cleanup_list.push(address31) - - () - } - OptionValue(payload33) => { - mbt_ffi_store8(iter_base + 0, 21) + let address19 = mbt_ffi_malloc((payload18).length() * 1); + for index20 = 0; index20 < (payload18).length(); index20 = index20 + 1 { + let iter_elem : Bool = (payload18)[(index20)] + let iter_base = address19 + (index20 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) - match payload33 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + mbt_ffi_store32((iter_base) + 12, (payload18).length()) + mbt_ffi_store32((iter_base) + 8, address19) + cleanup_list.push(address19) - () - } - Some(payload35) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload35) + () + } + TupleValue(payload21) => { + mbt_ffi_store8((iter_base) + 0, (17)) - () - } - } + let address22 = mbt_ffi_malloc((payload21).length() * 4); + for index23 = 0; index23 < (payload21).length(); index23 = index23 + 1 { + let iter_elem : Int = (payload21)[(index23)] + let iter_base = address22 + (index23 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () - } - ResultValue(payload36) => { - mbt_ffi_store8(iter_base + 0, 22) + } + mbt_ffi_store32((iter_base) + 12, (payload21).length()) + mbt_ffi_store32((iter_base) + 8, address22) + cleanup_list.push(address22) - match payload36 { - OkValue(payload37) => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + ListValue(payload24) => { + mbt_ffi_store8((iter_base) + 0, (18)) - match payload37 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let address25 = mbt_ffi_malloc((payload24).length() * 4); + for index26 = 0; index26 < (payload24).length(); index26 = index26 + 1 { + let iter_elem : Int = (payload24)[(index26)] + let iter_base = address25 + (index26 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () - } - Some(payload39) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload39) + } + mbt_ffi_store32((iter_base) + 12, (payload24).length()) + mbt_ffi_store32((iter_base) + 8, address25) + cleanup_list.push(address25) - () - } - } + () + } + FixedListValue(payload27) => { + mbt_ffi_store8((iter_base) + 0, (19)) - () - } - ErrValue(payload40) => { - mbt_ffi_store8(iter_base + 8, 1) + let address28 = mbt_ffi_malloc((payload27).length() * 4); + for index29 = 0; index29 < (payload27).length(); index29 = index29 + 1 { + let iter_elem : Int = (payload27)[(index29)] + let iter_base = address28 + (index29 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match payload40 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + } + mbt_ffi_store32((iter_base) + 12, (payload27).length()) + mbt_ffi_store32((iter_base) + 8, address28) + cleanup_list.push(address28) - () - } - Some(payload42) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload42) + () + } + MapValue(payload30) => { + mbt_ffi_store8((iter_base) + 0, (20)) - () - } - } + let address31 = mbt_ffi_malloc((payload30).length() * 8); + for index32 = 0; index32 < (payload30).length(); index32 = index32 + 1 { + let iter_elem : @types.MapEntry = (payload30)[(index32)] + let iter_base = address31 + (index32 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) - () - } - } + } + mbt_ffi_store32((iter_base) + 12, (payload30).length()) + mbt_ffi_store32((iter_base) + 8, address31) + cleanup_list.push(address31) - () - } - TextValue(payload43) => { - mbt_ffi_store8(iter_base + 0, 23) + () + } + OptionValue(payload33) => { + mbt_ffi_store8((iter_base) + 0, (21)) - let ptr44 = mbt_ffi_str2ptr(payload43.text) - mbt_ffi_store32(iter_base + 12, payload43.text.length()) - mbt_ffi_store32(iter_base + 8, ptr44) + match (payload33) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload43.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + Some(payload35) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload35) - () - } - Some(payload46) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + } - let ptr47 = mbt_ffi_str2ptr(payload46) - mbt_ffi_store32(iter_base + 24, payload46.length()) - mbt_ffi_store32(iter_base + 20, ptr47) - cleanup_list.push(ptr47) + () + } + ResultValue(payload36) => { + mbt_ffi_store8((iter_base) + 0, (22)) - () - } - } - cleanup_list.push(ptr44) + match payload36 { + OkValue(payload37) => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - BinaryValue(payload48) => { - mbt_ffi_store8(iter_base + 0, 24) + match (payload37) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - let ptr49 = mbt_ffi_bytes2ptr(payload48.bytes) + () + } + Some(payload39) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload39) - mbt_ffi_store32(iter_base + 12, payload48.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr49) + () + } + } - match payload48.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + ErrValue(payload40) => { + mbt_ffi_store8((iter_base) + 8, (1)) - () - } - Some(payload51) => { - mbt_ffi_store8(iter_base + 16, 1) + match (payload40) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - let ptr52 = mbt_ffi_str2ptr(payload51) - mbt_ffi_store32(iter_base + 24, payload51.length()) - mbt_ffi_store32(iter_base + 20, ptr52) - cleanup_list.push(ptr52) + () + } + Some(payload42) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload42) - () - } - } - cleanup_list.push(ptr49) + () + } + } - () - } - PathValue(payload53) => { - mbt_ffi_store8(iter_base + 0, 25) + () + } + } - let ptr54 = mbt_ffi_str2ptr(payload53) - mbt_ffi_store32(iter_base + 12, payload53.length()) - mbt_ffi_store32(iter_base + 8, ptr54) - cleanup_list.push(ptr54) + () + } + TextValue(payload43) => { + mbt_ffi_store8((iter_base) + 0, (23)) - () - } - UrlValue(payload55) => { - mbt_ffi_store8(iter_base + 0, 26) + let ptr44 = mbt_ffi_str2ptr((payload43).text) + mbt_ffi_store32((iter_base) + 12, (payload43).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) - let ptr56 = mbt_ffi_str2ptr(payload55) - mbt_ffi_store32(iter_base + 12, payload55.length()) - mbt_ffi_store32(iter_base + 8, ptr56) - cleanup_list.push(ptr56) + match ((payload43).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - () - } - DatetimeValue(payload57) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload57.seconds) - mbt_ffi_store32( - iter_base + 16, - payload57.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload58) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload58.nanoseconds) + () + } + Some(payload46) => { + mbt_ffi_store8((iter_base) + 16, (1)) - () - } - QuantityValueNode(payload59) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload59.mantissa) - mbt_ffi_store32(iter_base + 16, payload59.scale) + let ptr47 = mbt_ffi_str2ptr(payload46) + mbt_ffi_store32((iter_base) + 24, payload46.length()) + mbt_ffi_store32((iter_base) + 20, ptr47) + cleanup_list.push(ptr47) - let ptr60 = mbt_ffi_str2ptr(payload59.unit) - mbt_ffi_store32(iter_base + 24, payload59.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr60) - cleanup_list.push(ptr60) + () + } + } + cleanup_list.push(ptr44) - () - } - UnionValue(payload61) => { - mbt_ffi_store8(iter_base + 0, 30) + () + } + BinaryValue(payload48) => { + mbt_ffi_store8((iter_base) + 0, (24)) - let ptr62 = mbt_ffi_str2ptr(payload61.tag) - mbt_ffi_store32(iter_base + 12, payload61.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr62) - mbt_ffi_store32(iter_base + 16, payload61.body) - cleanup_list.push(ptr62) + let ptr49 = mbt_ffi_bytes2ptr((payload48).bytes) - () - } - SecretValue(payload63) => { - mbt_ffi_store8(iter_base + 0, 31) + mbt_ffi_store32((iter_base) + 12, (payload48).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) - let @types.Secret(handle64) = payload63 - mbt_ffi_store32(iter_base + 8, handle64) + match ((payload48).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - () - } - QuotaTokenHandle(payload65) => { - mbt_ffi_store8(iter_base + 0, 32) + () + } + Some(payload51) => { + mbt_ffi_store8((iter_base) + 16, (1)) - let @types.QuotaToken(handle66) = payload65 - mbt_ffi_store32(iter_base + 8, handle66) + let ptr52 = mbt_ffi_str2ptr(payload51) + mbt_ffi_store32((iter_base) + 24, payload51.length()) + mbt_ffi_store32((iter_base) + 20, ptr52) + cleanup_list.push(ptr52) - () - } - } - } - let return_area = mbt_ffi_malloc(44) - wasmImportMethodWasmRpcInvokeAndAwait( - handle, - ptr, - method_name.length(), - address67, - input.value_nodes.length(), - input.root, - return_area, - ) - - let lifted344 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) + () + } + } + cleanup_list.push(ptr49) - let result69 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + () + } + PathValue(payload53) => { + mbt_ffi_store8((iter_base) + 0, (25)) - let lifted99 : @types.SchemaValueTree? = match - mbt_ffi_load8_u(return_area + 20) { - 0 => Option::None - 1 => { - let array97 : Array[@types.SchemaValueNode] = [] - for index98 = 0 - index98 < mbt_ffi_load32(return_area + 28) - index98 = index98 + 1 { - let iter_base = mbt_ffi_load32(return_area + 24) + index98 * 32 - - let lifted96 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => - @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => - @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => - @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => - @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result70 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result70) - } - 13 => { - let array : Array[Int] = [] - for index71 = 0 - index71 < mbt_ffi_load32(iter_base + 12) - index71 = index71 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index71 * 4 - - array.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array) - } - 14 => { - let lifted : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array72 : Array[Bool] = [] - for index73 = 0 - index73 < mbt_ffi_load32(iter_base + 12) - index73 = index73 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index73 * 1 - - array72.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array72) - } - 17 => { - let array74 : Array[Int] = [] - for index75 = 0 - index75 < mbt_ffi_load32(iter_base + 12) - index75 = index75 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index75 * 4 - - array74.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array74) - } - 18 => { - let array76 : Array[Int] = [] - for index77 = 0 - index77 < mbt_ffi_load32(iter_base + 12) - index77 = index77 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index77 * 4 - - array76.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array76) - } - 19 => { - let array78 : Array[Int] = [] - for index79 = 0 - index79 < mbt_ffi_load32(iter_base + 12) - index79 = index79 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index79 * 4 - - array78.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array78) - } - 20 => { - let array80 : Array[@types.MapEntry] = [] - for index81 = 0 - index81 < mbt_ffi_load32(iter_base + 12) - index81 = index81 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index81 * 8 - - array80.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array80) - } - 21 => { - let lifted82 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let ptr54 = mbt_ffi_str2ptr(payload53) + mbt_ffi_store32((iter_base) + 12, payload53.length()) + mbt_ffi_store32((iter_base) + 8, ptr54) + cleanup_list.push(ptr54) - @types.SchemaValueNode::OptionValue(lifted82) - } - 22 => { - let lifted85 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted83 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + () + } + UrlValue(payload55) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr56 = mbt_ffi_str2ptr(payload55) + mbt_ffi_store32((iter_base) + 12, payload55.length()) + mbt_ffi_store32((iter_base) + 8, ptr56) + cleanup_list.push(ptr56) - @types.ResultValuePayload::OkValue(lifted83) + () } - 1 => { - let lifted84 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + DatetimeValue(payload57) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload57).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload57).nanoseconds).reinterpret_as_int()) - @types.ResultValuePayload::ErrValue(lifted84) + () } - _ => panic() - } + DurationValue(payload58) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload58).nanoseconds) - @types.SchemaValueNode::ResultValue(lifted85) - } - 23 => { - let result86 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + () + } + QuantityValueNode(payload59) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload59).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload59).scale) - let lifted88 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result87 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + let ptr60 = mbt_ffi_str2ptr((payload59).unit) + mbt_ffi_store32((iter_base) + 24, (payload59).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr60) + cleanup_list.push(ptr60) - Option::Some(result87) + () } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result86, - language: lifted88, - }) - } - 24 => { - let result89 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted91 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result90 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + UnionValue(payload61) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr62 = mbt_ffi_str2ptr((payload61).tag) + mbt_ffi_store32((iter_base) + 12, (payload61).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr62) + mbt_ffi_store32((iter_base) + 16, (payload61).body) + cleanup_list.push(ptr62) + + () + } + SecretValue(payload63) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let @types.Secret(handle64) = payload63 + mbt_ffi_store32((iter_base) + 8, handle64) + + () + } + QuotaTokenHandle(payload65) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let @types.QuotaToken(handle66) = payload65 + mbt_ffi_store32((iter_base) + 8, handle66) + + () + } + PermissionCardHandle(payload67) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let @types.PermissionCard(handle68) = payload67 + mbt_ffi_store32((iter_base) + 8, handle68) - Option::Some(result90) + () } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result89, - mime_type: lifted91, - }) - } - 25 => { - let result92 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result92) - } - 26 => { - let result93 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result93) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result94 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result94, - }) - } - 30 => { - let result95 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result95, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() } - array97.push(lifted96) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 24)) - - Option::Some(@types.SchemaValueTree::{ - value_nodes: array97, - root: mbt_ffi_load32(return_area + 32), - }) - } - _ => panic() } - Result::Ok(InvocationResultWithMetadata::{ - metadata: InvocationMetadata::{ - agent_id: result, - idempotency_key: result69, - }, - result: lifted99, - }) - } - 1 => { - let lifted343 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result100 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - RpcError::ProtocolError(result100) - } - 1 => { - let result101 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - RpcError::Denied(result101) - } - 2 => { - let result102 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - RpcError::NotFound(result102) - } - 3 => { - let result103 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - RpcError::RemoteInternalError(result103) - } - 4 => { - let lifted342 = match mbt_ffi_load8_u(return_area + 8) { - 0 => { - let result104 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + let (lowered, lowered74) = match (scope_card) { + None => { - @common.AgentError::InvalidInput(result104) + ((0), 0) } - 1 => { - let result105 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + Some(payload72) => { - @common.AgentError::InvalidMethod(result105) - } - 2 => { - let result106 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + let @types.PermissionCard(handle73) = payload72 - @common.AgentError::InvalidType(result106) + ((1), handle73) } - 3 => { - let result107 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + } + let return_area = mbt_ffi_malloc(20) + wasmImportMethodWasmRpcScheduleCancelableInvocation(handle, (scheduled_time).seconds, ((scheduled_time).nanoseconds).reinterpret_as_int(), ptr, method_name.length(), address69, ((input).value_nodes).length(), (input).root, lowered, lowered74, return_area); - @common.AgentError::InvalidAgentId(result107) - } - 4 => { - let array304 : Array[@types.SchemaTypeNode] = [] - for index305 = 0 - index305 < mbt_ffi_load32(return_area + 16) - index305 = index305 + 1 { - let iter_base = mbt_ffi_load32(return_area + 12) + - index305 * 144 - - let lifted290 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted114 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted109 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted108 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted108) - } - _ => panic() - } - - let lifted111 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted110 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 0), mbt_ffi_load32((return_area) + 4)) - Option::Some(lifted110) - } - _ => panic() - } + let result75 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + let ret = CancelableScheduledInvocationReceipt::{metadata : InvocationMetadata::{agent_id : result, idempotency_key : result75}, cancellation_token : CancellationToken::CancellationToken(mbt_ffi_load32((return_area) + 16))} + mbt_ffi_free(ptr) + mbt_ffi_free(address69) + mbt_ffi_free(return_area) - let lifted113 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result112 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + cleanup_list.each(mbt_ffi_free) + return ret - Option::Some(result112) - } - _ => panic() - } +} +///| +/// Awaits the result of the invocation. +pub async fn FutureInvokeResult::get(self : FutureInvokeResult) -> Result[@types.SchemaValueTree?, RpcError] { - Option::Some(@types.NumericRestrictions::{ - min: lifted109, - max: lifted111, - unit: lifted113, - }) - } - _ => panic() - } + let FutureInvokeResult(handle) = self - @types.SchemaTypeBody::S8Type(lifted114) - } - 3 => { - let lifted121 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted116 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted115 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted115) - } - _ => panic() - } - - let lifted118 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted117 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(44 * 1) + defer mbt_ffi_free(result_ptr) - Option::Some(lifted117) - } - _ => panic() - } + let subtask_code = wasmImportMethodFutureInvokeResultGet(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, - let lifted120 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result119 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + fn(before_started) { + if before_started { + () + } else { + () + } + } + , + fn() { - Option::Some(result119) - } - _ => panic() - } + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted116, - max: lifted118, - unit: lifted120, - }) - } - _ => panic() - } + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => { + + for index = 0; index < (mbt_ffi_load32((result_ptr) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 8)) + (index * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => { + @types.Secret::Secret(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 32 => { + @types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 33 => { + @types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8)).drop() + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) - @types.SchemaTypeBody::S16Type(lifted121) - } - 4 => { - let lifted128 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted123 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted122 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted122) - } - _ => panic() - } - - let lifted125 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted124 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) + } _ => panic() - } - - Option::Some(lifted124) - } - _ => panic() } - let lifted127 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result126 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + } + 1 => { - Option::Some(result126) - } - _ => panic() - } + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) - Option::Some(@types.NumericRestrictions::{ - min: lifted123, - max: lifted125, - unit: lifted127, - }) - } - _ => panic() - } + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) - @types.SchemaTypeBody::S32Type(lifted128) - } - 5 => { - let lifted135 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted130 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted129 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted129) - } - _ => panic() - } - - let lifted132 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted131 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) - Option::Some(lifted131) - } - _ => panic() - } + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) - let lifted134 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result133 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + } + 4 => { - Option::Some(result133) - } - _ => panic() - } + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) - Option::Some(@types.NumericRestrictions::{ - min: lifted130, - max: lifted132, - unit: lifted134, - }) - } - _ => panic() - } + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) - @types.SchemaTypeBody::S64Type(lifted135) - } - 6 => { - let lifted142 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted137 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted136 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted136) - } - _ => panic() - } - - let lifted139 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted138 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) - Option::Some(lifted138) - } - _ => panic() - } + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) - let lifted141 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result140 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + } + 4 => { - Option::Some(result140) - } - _ => panic() - } + for index20 = 0; index20 < (mbt_ffi_load32((result_ptr) + 16)); index20 = index20 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 12)) + (index20 * 144) - Option::Some(@types.NumericRestrictions::{ - min: lifted137, - max: lifted139, - unit: lifted141, - }) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { - @types.SchemaTypeBody::U8Type(lifted142) - } - 7 => { - let lifted149 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted144 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted143 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted143) - } - _ => panic() - } - - let lifted146 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted145 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Option::Some(lifted145) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let lifted148 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result147 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + } + _ => panic() + } - Option::Some(result147) - } - _ => panic() - } + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted144, - max: lifted146, - unit: lifted148, - }) - } - _ => panic() - } + } + 3 => { - @types.SchemaTypeBody::U16Type(lifted149) - } - 8 => { - let lifted156 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted151 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted150 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted150) - } - _ => panic() - } - - let lifted153 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted152 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Option::Some(lifted152) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let lifted155 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result154 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + } + _ => panic() + } - Option::Some(result154) - } - _ => panic() - } + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted151, - max: lifted153, - unit: lifted155, - }) - } - _ => panic() - } + } + 4 => { - @types.SchemaTypeBody::U32Type(lifted156) - } - 9 => { - let lifted163 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted158 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted157 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted157) - } - _ => panic() - } - - let lifted160 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted159 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Option::Some(lifted159) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let lifted162 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result161 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + } + _ => panic() + } - Option::Some(result161) - } - _ => panic() - } + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted158, - max: lifted160, - unit: lifted162, - }) - } - _ => panic() - } + } + 5 => { - @types.SchemaTypeBody::U64Type(lifted163) - } - 10 => { - let lifted170 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted165 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted164 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted164) - } - _ => panic() - } - - let lifted167 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted166 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Option::Some(lifted166) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let lifted169 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result168 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + } + _ => panic() + } - Option::Some(result168) - } - _ => panic() - } + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted165, - max: lifted167, - unit: lifted169, - }) - } - _ => panic() - } + } + 6 => { - @types.SchemaTypeBody::F32Type(lifted170) - } - 11 => { - let lifted177 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted172 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted171 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted171) - } - _ => panic() - } - - let lifted174 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted173 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Option::Some(lifted173) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let lifted176 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + } + _ => panic() + } - Option::Some(result175) - } - _ => panic() - } + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted172, - max: lifted174, - unit: lifted176, - }) - } - _ => panic() - } + } + 7 => { - @types.SchemaTypeBody::F64Type(lifted177) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array192 : Array[@types.NamedFieldType] = [] - for index193 = 0 - index193 < mbt_ffi_load32(iter_base + 12) - index193 = index193 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index193 * 68 - - let result178 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted180 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result179 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Option::Some(result179) - } - _ => panic() - } - - let array182 : Array[String] = [] - for index183 = 0 - index183 < mbt_ffi_load32(iter_base + 28) - index183 = index183 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index183 * 8 - - let result181 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array182.push(result181) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array185 : Array[String] = [] - for index186 = 0 - index186 < mbt_ffi_load32(iter_base + 36) - index186 = index186 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index186 * 8 - - let result184 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - array185.push(result184) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) + } + _ => panic() + } - let lifted188 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result187 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) + } + _ => panic() + } - Option::Some(result187) - } - _ => panic() - } + } + 8 => { - let lifted191 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted190 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result189 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result189) - } - _ => panic() - } - - Option::Some(lifted190) - } - _ => panic() - } - - array192.push(@types.NamedFieldType::{ - name: result178, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted180, - aliases: array182, - examples: array185, - deprecated: lifted188, - role: lifted191, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array192) - } - 15 => { - let array209 : Array[@types.VariantCaseType] = [] - for index210 = 0 - index210 < mbt_ffi_load32(iter_base + 12) - index210 = index210 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index210 * 72 - - let result194 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted195 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - let lifted197 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result196 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - Option::Some(result196) - } - _ => panic() - } - - let array199 : Array[String] = [] - for index200 = 0 - index200 < mbt_ffi_load32(iter_base + 32) - index200 = index200 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index200 * 8 - - let result198 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array199.push(result198) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array202 : Array[String] = [] - for index203 = 0 - index203 < mbt_ffi_load32(iter_base + 40) - index203 = index203 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index203 * 8 - - let result201 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array202.push(result201) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted205 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result204 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) + } + _ => panic() + } - Option::Some(result204) - } - _ => panic() - } + } + _ => panic() + } - let lifted208 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted207 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result206 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result206) - } - _ => panic() - } - - Option::Some(lifted207) - } - _ => panic() - } - - array209.push(@types.VariantCaseType::{ - name: result194, - payload: lifted195, - metadata: @types.MetadataEnvelope::{ - doc: lifted197, - aliases: array199, - examples: array202, - deprecated: lifted205, - role: lifted208, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array209) - } - 16 => { - let array212 : Array[String] = [] - for index213 = 0 - index213 < mbt_ffi_load32(iter_base + 12) - index213 = index213 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index213 * 8 + } + 9 => { - let result211 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - array212.push(result211) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - @types.SchemaTypeBody::EnumType(array212) - } - 17 => { - let array215 : Array[String] = [] - for index216 = 0 - index216 < mbt_ffi_load32(iter_base + 12) - index216 = index216 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index216 * 8 + } + _ => panic() + } - let result214 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + } + _ => panic() + } - array215.push(result214) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + } + 10 => { - @types.SchemaTypeBody::FlagsType(array215) - } - 18 => { - let array217 : Array[Int] = [] - for index218 = 0 - index218 < mbt_ffi_load32(iter_base + 12) - index218 = index218 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index218 * 4 - - array217.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array217) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted219 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted220 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted219, - err: lifted220, - }) - } - 24 => { - let lifted224 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array222 : Array[String] = [] - for index223 = 0 - index223 < mbt_ffi_load32(iter_base + 16) - index223 = index223 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index223 * 8 - - let result221 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array222.push(result221) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array222) - } - _ => panic() - } - - let lifted225 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted226 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted228 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result227 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result227) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted224, - min_length: lifted225, - max_length: lifted226, - regex: lifted228, - }) - } - 25 => { - let lifted232 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array230 : Array[String] = [] - for index231 = 0 - index231 < mbt_ffi_load32(iter_base + 16) - index231 = index231 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index231 * 8 - - let result229 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array230.push(result229) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array230) - } - _ => panic() - } - - let lifted233 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted234 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted232, - min_bytes: lifted233, - max_bytes: lifted234, - }) - } - 26 => { - let lifted238 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array236 : Array[String] = [] - for index237 = 0 - index237 < mbt_ffi_load32(iter_base + 20) - index237 = index237 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index237 * 8 - - let result235 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array236.push(result235) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array236) - } - _ => panic() - } - - let lifted242 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array240 : Array[String] = [] - for index241 = 0 - index241 < mbt_ffi_load32(iter_base + 32) - index241 = index241 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index241 * 8 - - let result239 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array240.push(result239) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array240) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted238, - allowed_extensions: lifted242, - }) - } - 27 => { - let lifted246 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array244 : Array[String] = [] - for index245 = 0 - index245 < mbt_ffi_load32(iter_base + 16) - index245 = index245 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index245 * 8 - - let result243 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array244.push(result243) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array244) - } - _ => panic() - } - - let lifted250 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array248 : Array[String] = [] - for index249 = 0 - index249 < mbt_ffi_load32(iter_base + 28) - index249 = index249 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index249 * 8 - - let result247 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array248.push(result247) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array248) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted246, - allowed_hosts: lifted250, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result251 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array253 : Array[String] = [] - for index254 = 0 - index254 < mbt_ffi_load32(iter_base + 20) - index254 = index254 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index254 * 8 - - let result252 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array253.push(result252) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted256 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result255 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result255, - }) - } - _ => panic() - } - - let lifted258 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result257 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result257, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result251, - allowed_suffixes: array253, - min: lifted256, - max: lifted258, - }) - } - 31 => { - let array282 : Array[@types.UnionBranch] = [] - for index283 = 0 - index283 < mbt_ffi_load32(iter_base + 12) - index283 = index283 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index283 * 92 - - let result259 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted268 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result260 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - @types.DiscriminatorRule::Prefix(result260) - } - 1 => { - let result261 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - @types.DiscriminatorRule::Suffix(result261) - } - 2 => { - let result262 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + } + _ => panic() + } - @types.DiscriminatorRule::Contains(result262) - } - 3 => { - let result263 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + } + _ => panic() + } - @types.DiscriminatorRule::Regex(result263) - } - 4 => { - let result264 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted266 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result265 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result265) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result264, - literal: lifted266, - }) - } - 5 => { - let result267 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + } + 11 => { - @types.DiscriminatorRule::FieldAbsent(result267) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - let lifted270 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result269 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - Option::Some(result269) - } - _ => panic() - } - - let array272 : Array[String] = [] - for index273 = 0 - index273 < mbt_ffi_load32(iter_base + 52) - index273 = index273 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index273 * 8 - - let result271 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array272.push(result271) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array275 : Array[String] = [] - for index276 = 0 - index276 < mbt_ffi_load32(iter_base + 60) - index276 = index276 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index276 * 8 - - let result274 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array275.push(result274) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted278 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result277 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + } + _ => panic() + } - Option::Some(result277) - } - _ => panic() - } + } + _ => panic() + } - let lifted281 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted280 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result279 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result279) - } - _ => panic() - } - - Option::Some(lifted280) - } - _ => panic() - } - - array282.push(@types.UnionBranch::{ - tag: result259, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted268, - metadata: @types.MetadataEnvelope::{ - doc: lifted270, - aliases: array272, - examples: array275, - deprecated: lifted278, - role: lifted281, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array282, - }) - } - 32 => { - let lifted285 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result284 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result284) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted285, - }) - } - 33 => { - let lifted287 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result286 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result286) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted287, - }) - } - 34 => { - let lifted288 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted288) - } - 35 => { - let lifted289 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted289) - } - _ => panic() - } + } + 12 => () + 13 => () + 14 => { + + for index2 = 0; index2 < (mbt_ffi_load32((iter_base) + 12)); index2 = index2 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index0 = 0; index0 < (mbt_ffi_load32((iter_base) + 28)); index0 = index0 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index0 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index1 = 0; index1 < (mbt_ffi_load32((iter_base) + 36)); index1 = index1 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - let lifted292 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result291 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - Option::Some(result291) - } - _ => panic() - } - - let array294 : Array[String] = [] - for index295 = 0 - index295 < mbt_ffi_load32(iter_base + 104) - index295 = index295 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index295 * 8 - - let result293 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array294.push(result293) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array297 : Array[String] = [] - for index298 = 0 - index298 < mbt_ffi_load32(iter_base + 112) - index298 = index298 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index298 * 8 - - let result296 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array297.push(result296) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted300 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result299 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) + } + _ => panic() + } - Option::Some(result299) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { - let lifted303 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted302 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result301 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result301) - } - _ => panic() - } - - Option::Some(lifted302) - } - _ => panic() - } - - array304.push(@types.SchemaTypeNode::{ - body: lifted290, - metadata: @types.MetadataEnvelope::{ - doc: lifted292, - aliases: array294, - examples: array297, - deprecated: lifted300, - role: lifted303, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 12)) - - let array309 : Array[@types.SchemaTypeDef] = [] - for index310 = 0 - index310 < mbt_ffi_load32(return_area + 24) - index310 = index310 + 1 { - let iter_base = mbt_ffi_load32(return_area + 20) + index310 * 24 - - let result306 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted308 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result307 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) - Option::Some(result307) - } - _ => panic() - } - - array309.push(@types.SchemaTypeDef::{ - id: result306, - name: lifted308, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 20)) - - let array340 : Array[@types.SchemaValueNode] = [] - for index341 = 0 - index341 < mbt_ffi_load32(return_area + 36) - index341 = index341 + 1 { - let iter_base = mbt_ffi_load32(return_area + 32) + index341 * 32 - - let lifted339 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result311 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + } + _ => panic() + } - @types.SchemaValueNode::StringValue(result311) - } - 13 => { - let array312 : Array[Int] = [] - for index313 = 0 - index313 < mbt_ffi_load32(iter_base + 12) - index313 = index313 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index313 * 4 + } + _ => panic() + } - array312.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index5 = 0; index5 < (mbt_ffi_load32((iter_base) + 12)); index5 = index5 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index5 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index3 = 0; index3 < (mbt_ffi_load32((iter_base) + 32)); index3 = index3 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index3 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - @types.SchemaValueNode::RecordValue(array312) - } - 14 => { - let lifted314 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted314, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array315 : Array[Bool] = [] - for index316 = 0 - index316 < mbt_ffi_load32(iter_base + 12) - index316 = index316 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index316 * 1 + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index4 = 0; index4 < (mbt_ffi_load32((iter_base) + 40)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index4 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - array315.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + } + _ => panic() + } - @types.SchemaValueNode::FlagsValue(array315) - } - 17 => { - let array317 : Array[Int] = [] - for index318 = 0 - index318 < mbt_ffi_load32(iter_base + 12) - index318 = index318 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index318 * 4 + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { - array317.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - @types.SchemaValueNode::TupleValue(array317) - } - 18 => { - let array319 : Array[Int] = [] - for index320 = 0 - index320 < mbt_ffi_load32(iter_base + 12) - index320 = index320 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index320 * 4 + } + _ => panic() + } - array319.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + } + _ => panic() + } - @types.SchemaValueNode::ListValue(array319) - } - 19 => { - let array321 : Array[Int] = [] - for index322 = 0 - index322 < mbt_ffi_load32(iter_base + 12) - index322 = index322 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index322 * 4 + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - array321.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + } + 16 => { - @types.SchemaValueNode::FixedListValue(array321) - } - 20 => { - let array323 : Array[@types.MapEntry] = [] - for index324 = 0 - index324 < mbt_ffi_load32(iter_base + 12) - index324 = index324 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index324 * 8 - - array323.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array323) - } - 21 => { - let lifted325 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + for index6 = 0; index6 < (mbt_ffi_load32((iter_base) + 12)); index6 = index6 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index6 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - @types.SchemaValueNode::OptionValue(lifted325) - } - 22 => { - let lifted328 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted326 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.ResultValuePayload::OkValue(lifted326) - } - 1 => { - let lifted327 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + } + 17 => { - @types.ResultValuePayload::ErrValue(lifted327) - } - _ => panic() - } + for index7 = 0; index7 < (mbt_ffi_load32((iter_base) + 12)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index7 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - @types.SchemaValueNode::ResultValue(lifted328) - } - 23 => { - let result329 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted331 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result330 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result330) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result329, - language: lifted331, - }) - } - 24 => { - let result332 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted334 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result333 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result333) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result332, - mime_type: lifted334, - }) - } - 25 => { - let result335 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.SchemaValueNode::PathValue(result335) - } - 26 => { - let result336 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result336) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result337 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result337, - }) - } - 30 => { - let result338 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result338, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array340.push(lifted339) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 32)) - - @common.AgentError::CustomError(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array304, - defs: array309, - root: mbt_ffi_load32(return_area + 28), - }, - value: @types.SchemaValueTree::{ - value_nodes: array340, - root: mbt_ffi_load32(return_area + 40), - }, - }) - } - _ => panic() - } + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { - RpcError::RemoteAgentError(lifted342) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Result::Err(lifted343) - } - _ => panic() - } - let ret = lifted344 - mbt_ffi_free(ptr) - mbt_ffi_free(address67) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 16)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index8 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) -///| -/// Triggers the invocation of a remote method with the given parameters, -/// and returns its final identity immediately. -pub fn WasmRpc::invoke( - self : WasmRpc, - method_name : String, - input : @types.SchemaValueTree, -) -> Result[InvocationMetadata, RpcError] { - let cleanup_list : Array[Int] = [] + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let WasmRpc(handle) = self + } + _ => panic() + } - let ptr = mbt_ffi_str2ptr(method_name) + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - let address67 = mbt_ffi_malloc(input.value_nodes.length() * 32) - for index68 = 0; index68 < input.value_nodes.length(); index68 = index68 + 1 { - let iter_elem : @types.SchemaValueNode = input.value_nodes[index68] - let iter_base = address67 + index68 * 32 + } + _ => panic() + } - match iter_elem { - BoolValue(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) + } + 25 => { - () - } - S8Value(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - S16Value(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + for index9 = 0; index9 < (mbt_ffi_load32((iter_base) + 16)); index9 = index9 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index9 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - S32Value(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - S64Value(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload3) + } + _ => panic() + } - () - } - U8Value(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload4.to_int()) + } + 26 => { - () - } - U16Value(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload5.reinterpret_as_int()) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { - () - } - U32Value(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload6.reinterpret_as_int()) + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 20)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index10 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - U64Value(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload7.reinterpret_as_int64()) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - F32Value(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload8) + } + _ => panic() + } - () - } - F64Value(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload9) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { - () - } - CharValue(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload10.to_int()) + for index11 = 0; index11 < (mbt_ffi_load32((iter_base) + 32)); index11 = index11 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index11 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - StringValue(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let ptr12 = mbt_ffi_str2ptr(payload11) - mbt_ffi_store32(iter_base + 12, payload11.length()) - mbt_ffi_store32(iter_base + 8, ptr12) - cleanup_list.push(ptr12) + } + _ => panic() + } - () - } - RecordValue(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address = mbt_ffi_malloc(payload13.length() * 4) - for index = 0; index < payload13.length(); index = index + 1 { - let iter_elem : Int = payload13[index] - let iter_base = address + index * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload13.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - VariantValue(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.case.reinterpret_as_int()) + } + 27 => { - match payload14.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload16) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload16) + for index12 = 0; index12 < (mbt_ffi_load32((iter_base) + 16)); index12 = index12 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index12 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - EnumValue(payload17) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload17.reinterpret_as_int()) + } + _ => panic() + } - () - } - FlagsValue(payload18) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address19 = mbt_ffi_malloc(payload18.length() * 1) - for index20 = 0; index20 < payload18.length(); index20 = index20 + 1 { - let iter_elem : Bool = payload18[index20] - let iter_base = address19 + index20 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload18.length()) - mbt_ffi_store32(iter_base + 8, address19) - cleanup_list.push(address19) - - () - } - TupleValue(payload21) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address22 = mbt_ffi_malloc(payload21.length() * 4) - for index23 = 0; index23 < payload21.length(); index23 = index23 + 1 { - let iter_elem : Int = payload21[index23] - let iter_base = address22 + index23 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, address22) - cleanup_list.push(address22) - - () - } - ListValue(payload24) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address25 = mbt_ffi_malloc(payload24.length() * 4) - for index26 = 0; index26 < payload24.length(); index26 = index26 + 1 { - let iter_elem : Int = payload24[index26] - let iter_base = address25 + index26 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, address25) - cleanup_list.push(address25) - - () - } - FixedListValue(payload27) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address28 = mbt_ffi_malloc(payload27.length() * 4) - for index29 = 0; index29 < payload27.length(); index29 = index29 + 1 { - let iter_elem : Int = payload27[index29] - let iter_base = address28 + index29 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, address28) - cleanup_list.push(address28) - - () - } - MapValue(payload30) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address31 = mbt_ffi_malloc(payload30.length() * 8) - for index32 = 0; index32 < payload30.length(); index32 = index32 + 1 { - let iter_elem : @types.MapEntry = payload30[index32] - let iter_base = address31 + index32 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload30.length()) - mbt_ffi_store32(iter_base + 8, address31) - cleanup_list.push(address31) - - () - } - OptionValue(payload33) => { - mbt_ffi_store8(iter_base + 0, 21) + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { - match payload33 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + for index13 = 0; index13 < (mbt_ffi_load32((iter_base) + 28)); index13 = index13 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index13 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload35) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload35) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - () - } - } + } + _ => panic() + } - () - } - ResultValue(payload36) => { - mbt_ffi_store8(iter_base + 0, 22) + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload36 { - OkValue(payload37) => { - mbt_ffi_store8(iter_base + 8, 0) + for index14 = 0; index14 < (mbt_ffi_load32((iter_base) + 20)); index14 = index14 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index14 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload37 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - Some(payload39) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload39) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - () - } - } + } + _ => panic() + } - () - } - ErrValue(payload40) => { - mbt_ffi_store8(iter_base + 8, 1) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) - match payload40 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + } + _ => panic() + } - () - } - Some(payload42) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload42) + } + 31 => { - () - } - } + for index17 = 0; index17 < (mbt_ffi_load32((iter_base) + 12)); index17 = index17 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index17 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - TextValue(payload43) => { - mbt_ffi_store8(iter_base + 0, 23) + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let ptr44 = mbt_ffi_str2ptr(payload43.text) - mbt_ffi_store32(iter_base + 12, payload43.text.length()) - mbt_ffi_store32(iter_base + 8, ptr44) + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index15 = 0; index15 < (mbt_ffi_load32((iter_base) + 52)); index15 = index15 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index15 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index16 = 0; index16 < (mbt_ffi_load32((iter_base) + 60)); index16 = index16 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index16 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index18 = 0; index18 < (mbt_ffi_load32((iter_base) + 104)); index18 = index18 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index18 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index19 = 0; index19 < (mbt_ffi_load32((iter_base) + 112)); index19 = index19 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index19 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + for index21 = 0; index21 < (mbt_ffi_load32((result_ptr) + 24)); index21 = index21 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 20)) + (index21 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) + + for index22 = 0; index22 < (mbt_ffi_load32((result_ptr) + 36)); index22 = index22 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 32)) + (index22 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => { + @types.Secret::Secret(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 32 => { + @types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 33 => { + @types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8)).drop() + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 32)) + + } + _ => panic() + } - match payload43.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + _ => panic() + } - () - } - Some(payload46) => { - mbt_ffi_store8(iter_base + 16, 1) + } + _ => panic() + } - let ptr47 = mbt_ffi_str2ptr(payload46) - mbt_ffi_store32(iter_base + 24, payload46.length()) - mbt_ffi_store32(iter_base + 20, ptr47) - cleanup_list.push(ptr47) + }, + ) - () - } - } - cleanup_list.push(ptr44) + let lifted272 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { - () - } - BinaryValue(payload48) => { - mbt_ffi_store8(iter_base + 0, 24) + let lifted27 : @types.SchemaValueTree? = match mbt_ffi_load8_u((result_ptr) + 4) { + 0 => Option::None + 1 => { - let ptr49 = mbt_ffi_bytes2ptr(payload48.bytes) + let array25 : Array[@types.SchemaValueNode] = []; + for index26 = 0; index26 < (mbt_ffi_load32((result_ptr) + 12)); index26 = index26 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 8)) + (index26 * 32) - mbt_ffi_store32(iter_base + 12, payload48.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr49) + let lifted24 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - match payload48.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - () - } - Some(payload51) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - let ptr52 = mbt_ffi_str2ptr(payload51) - mbt_ffi_store32(iter_base + 24, payload51.length()) - mbt_ffi_store32(iter_base + 20, ptr52) - cleanup_list.push(ptr52) + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - () - } - } - cleanup_list.push(ptr49) + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - () - } - PathValue(payload53) => { - mbt_ffi_store8(iter_base + 0, 25) + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - let ptr54 = mbt_ffi_str2ptr(payload53) - mbt_ffi_store32(iter_base + 12, payload53.length()) - mbt_ffi_store32(iter_base + 8, ptr54) - cleanup_list.push(ptr54) + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - () - } - UrlValue(payload55) => { - mbt_ffi_store8(iter_base + 0, 26) + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - let ptr56 = mbt_ffi_str2ptr(payload55) - mbt_ffi_store32(iter_base + 12, payload55.length()) - mbt_ffi_store32(iter_base + 8, ptr56) - cleanup_list.push(ptr56) + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - () - } - DatetimeValue(payload57) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload57.seconds) - mbt_ffi_store32( - iter_base + 16, - payload57.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload58) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload58.nanoseconds) + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - () - } - QuantityValueNode(payload59) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload59.mantissa) - mbt_ffi_store32(iter_base + 16, payload59.scale) + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - let ptr60 = mbt_ffi_str2ptr(payload59.unit) - mbt_ffi_store32(iter_base + 24, payload59.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr60) - cleanup_list.push(ptr60) + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - () - } - UnionValue(payload61) => { - mbt_ffi_store8(iter_base + 0, 30) + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - let ptr62 = mbt_ffi_str2ptr(payload61.tag) - mbt_ffi_store32(iter_base + 12, payload61.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr62) - mbt_ffi_store32(iter_base + 16, payload61.body) - cleanup_list.push(ptr62) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - SecretValue(payload63) => { - mbt_ffi_store8(iter_base + 0, 31) + @types.SchemaValueNode::StringValue(result) + } + 13 => { - let @types.Secret(handle64) = payload63 - mbt_ffi_store32(iter_base + 8, handle64) + let array : Array[Int] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index * 4) - () - } - QuotaTokenHandle(payload65) => { - mbt_ffi_store8(iter_base + 0, 32) + array.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let @types.QuotaToken(handle66) = payload65 - mbt_ffi_store32(iter_base + 8, handle66) + @types.SchemaValueNode::RecordValue(array) + } + 14 => { - () - } - } - } - let return_area = mbt_ffi_malloc(44) - wasmImportMethodWasmRpcInvoke( - handle, - ptr, - method_name.length(), - address67, - input.value_nodes.length(), - input.root, - return_area, - ) - - let lifted312 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) + let lifted : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let result69 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - Result::Ok(InvocationMetadata::{ - agent_id: result, - idempotency_key: result69, - }) - } - 1 => { - let lifted311 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result70 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - RpcError::ProtocolError(result70) - } - 1 => { - let result71 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - RpcError::Denied(result71) - } - 2 => { - let result72 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - RpcError::NotFound(result72) - } - 3 => { - let result73 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - RpcError::RemoteInternalError(result73) - } - 4 => { - let lifted310 = match mbt_ffi_load8_u(return_area + 8) { - 0 => { - let result74 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted}) + } + 15 => { - @common.AgentError::InvalidInput(result74) - } - 1 => { - let result75 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - @common.AgentError::InvalidMethod(result75) - } - 2 => { - let result76 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + let array0 : Array[Bool] = []; + for index1 = 0; index1 < (mbt_ffi_load32((iter_base) + 12)); index1 = index1 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1 * 1) - @common.AgentError::InvalidType(result76) - } - 3 => { - let result77 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + array0.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @common.AgentError::InvalidAgentId(result77) - } - 4 => { - let array272 : Array[@types.SchemaTypeNode] = [] - for index273 = 0 - index273 < mbt_ffi_load32(return_area + 16) - index273 = index273 + 1 { - let iter_base = mbt_ffi_load32(return_area + 12) + - index273 * 144 - - let lifted258 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted83 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted78 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted) - } - _ => panic() - } - - let lifted80 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted79 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::FlagsValue(array0) + } + 17 => { - Option::Some(lifted79) - } - _ => panic() - } + let array2 : Array[Int] = []; + for index3 = 0; index3 < (mbt_ffi_load32((iter_base) + 12)); index3 = index3 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3 * 4) - let lifted82 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result81 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + array2.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(result81) - } - _ => panic() - } + @types.SchemaValueNode::TupleValue(array2) + } + 18 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted78, - max: lifted80, - unit: lifted82, - }) - } - _ => panic() - } + let array4 : Array[Int] = []; + for index5 = 0; index5 < (mbt_ffi_load32((iter_base) + 12)); index5 = index5 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index5 * 4) - @types.SchemaTypeBody::S8Type(lifted83) - } - 3 => { - let lifted90 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted85 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted84 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted84) - } - _ => panic() - } - - let lifted87 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted86 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array4.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted86) - } - _ => panic() - } + @types.SchemaValueNode::ListValue(array4) + } + 19 => { - let lifted89 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result88 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let array6 : Array[Int] = []; + for index7 = 0; index7 < (mbt_ffi_load32((iter_base) + 12)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index7 * 4) - Option::Some(result88) - } - _ => panic() - } + array6.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(@types.NumericRestrictions::{ - min: lifted85, - max: lifted87, - unit: lifted89, - }) - } - _ => panic() - } + @types.SchemaValueNode::FixedListValue(array6) + } + 20 => { - @types.SchemaTypeBody::S16Type(lifted90) - } - 4 => { - let lifted97 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted92 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted91 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted91) - } - _ => panic() - } - - let lifted94 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted93 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array8 : Array[@types.MapEntry] = []; + for index9 = 0; index9 < (mbt_ffi_load32((iter_base) + 12)); index9 = index9 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index9 * 8) - Option::Some(lifted93) - } - _ => panic() - } + array8.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted96 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result95 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::MapValue(array8) + } + 21 => { - Option::Some(result95) - } - _ => panic() - } + let lifted10 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted92, - max: lifted94, - unit: lifted96, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - @types.SchemaTypeBody::S32Type(lifted97) - } - 5 => { - let lifted104 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted99 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted98 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted98) - } - _ => panic() - } - - let lifted101 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted100 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::OptionValue(lifted10) + } + 22 => { - Option::Some(lifted100) - } - _ => panic() - } + let lifted13 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - let lifted103 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result102 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted11 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(result102) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted99, - max: lifted101, - unit: lifted103, - }) - } - _ => panic() - } + @types.ResultValuePayload::OkValue(lifted11) + } + 1 => { - @types.SchemaTypeBody::S64Type(lifted104) - } - 6 => { - let lifted111 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted106 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted105 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted105) - } - _ => panic() - } - - let lifted108 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted107 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted12 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted107) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let lifted110 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result109 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.ResultValuePayload::ErrValue(lifted12) + } + _ => panic() + } - Option::Some(result109) - } - _ => panic() - } + @types.SchemaValueNode::ResultValue(lifted13) + } + 23 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted106, - max: lifted108, - unit: lifted110, - }) - } - _ => panic() - } + let result14 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::U8Type(lifted111) - } - 7 => { - let lifted118 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted113 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted112 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted112) - } - _ => panic() - } - - let lifted115 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted114 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted16 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted114) - } - _ => panic() - } + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted117 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result116 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(result15) + } + _ => panic() + } - Option::Some(result116) - } - _ => panic() - } + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result14, language : lifted16}) + } + 24 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted113, - max: lifted115, - unit: lifted117, - }) - } - _ => panic() - } + let result17 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::U16Type(lifted118) - } - 8 => { - let lifted125 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted120 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted119 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted119) - } - _ => panic() - } - - let lifted122 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted121 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted19 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted121) - } - _ => panic() - } + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted124 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result123 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(result18) + } + _ => panic() + } - Option::Some(result123) - } - _ => panic() - } + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result17, mime_type : lifted19}) + } + 25 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted120, - max: lifted122, - unit: lifted124, - }) - } - _ => panic() - } + let result20 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::U32Type(lifted125) - } - 9 => { - let lifted132 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted127 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted126 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted126) - } - _ => panic() - } - - let lifted129 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted128 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::PathValue(result20) + } + 26 => { - Option::Some(lifted128) - } - _ => panic() - } + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let lifted131 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result130 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::UrlValue(result21) + } + 27 => { - Option::Some(result130) - } - _ => panic() - } + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted127, - max: lifted129, - unit: lifted131, - }) - } - _ => panic() - } + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - @types.SchemaTypeBody::U64Type(lifted132) - } - 10 => { - let lifted139 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted134 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted133 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted133) - } - _ => panic() - } - - let lifted136 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted135 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result22 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Option::Some(lifted135) - } - _ => panic() - } + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result22}) + } + 30 => { - let lifted138 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result137 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(result137) - } - _ => panic() - } + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result23, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted134, - max: lifted136, - unit: lifted138, - }) - } - _ => panic() - } + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - @types.SchemaTypeBody::F32Type(lifted139) - } - 11 => { - let lifted146 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted141 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted140 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted140) - } - _ => panic() - } - - let lifted143 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted142 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - Option::Some(lifted142) - } - _ => panic() - } + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } - let lifted145 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result144 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + array25.push(lifted24) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) - Option::Some(result144) - } - _ => panic() + Option::Some(@types.SchemaValueTree::{value_nodes : array25, root : mbt_ffi_load32((result_ptr) + 16)}) } + _ => panic() + } + + Result::Ok(lifted27) + } + 1 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted141, - max: lifted143, - unit: lifted145, - }) - } - _ => panic() - } + let lifted271 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { - @types.SchemaTypeBody::F64Type(lifted146) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array160 : Array[@types.NamedFieldType] = [] - for index161 = 0 - index161 < mbt_ffi_load32(iter_base + 12) - index161 = index161 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index161 * 68 - - let result147 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted149 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result148 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let result28 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) - Option::Some(result148) + RpcError::ProtocolError(result28) } - _ => panic() - } - - let array : Array[String] = [] - for index151 = 0 - index151 < mbt_ffi_load32(iter_base + 28) - index151 = index151 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index151 * 8 - - let result150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result150) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array153 : Array[String] = [] - for index154 = 0 - index154 < mbt_ffi_load32(iter_base + 36) - index154 = index154 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index154 * 8 - - let result152 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array153.push(result152) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted156 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None 1 => { - let result155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - Option::Some(result155) - } - _ => panic() - } + let result29 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) - let lifted159 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted158 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result157 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result157) - } - _ => panic() - } - - Option::Some(lifted158) + RpcError::Denied(result29) } - _ => panic() - } - - array160.push(@types.NamedFieldType::{ - name: result147, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted149, - aliases: array, - examples: array153, - deprecated: lifted156, - role: lifted159, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array160) - } - 15 => { - let array177 : Array[@types.VariantCaseType] = [] - for index178 = 0 - index178 < mbt_ffi_load32(iter_base + 12) - index178 = index178 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index178 * 72 - - let result162 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted163 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + 2 => { - let lifted165 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result164 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + let result30 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) - Option::Some(result164) + RpcError::NotFound(result30) } - _ => panic() - } - - let array167 : Array[String] = [] - for index168 = 0 - index168 < mbt_ffi_load32(iter_base + 32) - index168 = index168 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index168 * 8 - - let result166 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array167.push(result166) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array170 : Array[String] = [] - for index171 = 0 - index171 < mbt_ffi_load32(iter_base + 40) - index171 = index171 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index171 * 8 - - let result169 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array170.push(result169) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted173 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result172 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) + 3 => { - Option::Some(result172) - } - _ => panic() - } + let result31 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) - let lifted176 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted175 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result174 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result174) - } - _ => panic() - } - - Option::Some(lifted175) + RpcError::RemoteInternalError(result31) } - _ => panic() - } - - array177.push(@types.VariantCaseType::{ - name: result162, - payload: lifted163, - metadata: @types.MetadataEnvelope::{ - doc: lifted165, - aliases: array167, - examples: array170, - deprecated: lifted173, - role: lifted176, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array177) - } - 16 => { - let array180 : Array[String] = [] - for index181 = 0 - index181 < mbt_ffi_load32(iter_base + 12) - index181 = index181 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index181 * 8 + 4 => { - let result179 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted270 = match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { - array180.push(result179) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result32 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) - @types.SchemaTypeBody::EnumType(array180) - } - 17 => { - let array183 : Array[String] = [] - for index184 = 0 - index184 < mbt_ffi_load32(iter_base + 12) - index184 = index184 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index184 * 8 + @common.AgentError::InvalidInput(result32) + } + 1 => { - let result182 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result33 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) - array183.push(result182) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + @common.AgentError::InvalidMethod(result33) + } + 2 => { - @types.SchemaTypeBody::FlagsType(array183) - } - 18 => { - let array185 : Array[Int] = [] - for index186 = 0 - index186 < mbt_ffi_load32(iter_base + 12) - index186 = index186 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index186 * 4 - - array185.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array185) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted187 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted188 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted187, - err: lifted188, - }) - } - 24 => { - let lifted192 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array190 : Array[String] = [] - for index191 = 0 - index191 < mbt_ffi_load32(iter_base + 16) - index191 = index191 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index191 * 8 - - let result189 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array190.push(result189) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array190) - } - _ => panic() - } - - let lifted193 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted194 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted196 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result195 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result195) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted192, - min_length: lifted193, - max_length: lifted194, - regex: lifted196, - }) - } - 25 => { - let lifted200 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array198 : Array[String] = [] - for index199 = 0 - index199 < mbt_ffi_load32(iter_base + 16) - index199 = index199 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index199 * 8 - - let result197 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array198.push(result197) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array198) - } - _ => panic() - } - - let lifted201 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted202 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted200, - min_bytes: lifted201, - max_bytes: lifted202, - }) - } - 26 => { - let lifted206 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array204 : Array[String] = [] - for index205 = 0 - index205 < mbt_ffi_load32(iter_base + 20) - index205 = index205 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index205 * 8 - - let result203 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array204.push(result203) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array204) - } - _ => panic() - } - - let lifted210 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array208 : Array[String] = [] - for index209 = 0 - index209 < mbt_ffi_load32(iter_base + 32) - index209 = index209 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index209 * 8 - - let result207 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array208.push(result207) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array208) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted206, - allowed_extensions: lifted210, - }) - } - 27 => { - let lifted214 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array212 : Array[String] = [] - for index213 = 0 - index213 < mbt_ffi_load32(iter_base + 16) - index213 = index213 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index213 * 8 - - let result211 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array212.push(result211) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array212) - } - _ => panic() - } - - let lifted218 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array216 : Array[String] = [] - for index217 = 0 - index217 < mbt_ffi_load32(iter_base + 28) - index217 = index217 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index217 * 8 - - let result215 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array216.push(result215) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array216) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted214, - allowed_hosts: lifted218, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result219 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array221 : Array[String] = [] - for index222 = 0 - index222 < mbt_ffi_load32(iter_base + 20) - index222 = index222 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index222 * 8 - - let result220 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array221.push(result220) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted224 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result223 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result223, - }) - } - _ => panic() - } - - let lifted226 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result225 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result225, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result219, - allowed_suffixes: array221, - min: lifted224, - max: lifted226, - }) - } - 31 => { - let array250 : Array[@types.UnionBranch] = [] - for index251 = 0 - index251 < mbt_ffi_load32(iter_base + 12) - index251 = index251 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index251 * 92 - - let result227 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted236 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result228 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let result34 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) - @types.DiscriminatorRule::Prefix(result228) - } - 1 => { - let result229 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @common.AgentError::InvalidType(result34) + } + 3 => { - @types.DiscriminatorRule::Suffix(result229) - } - 2 => { - let result230 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let result35 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) - @types.DiscriminatorRule::Contains(result230) - } - 3 => { - let result231 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @common.AgentError::InvalidAgentId(result35) + } + 4 => { - @types.DiscriminatorRule::Regex(result231) - } - 4 => { - let result232 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted234 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result233 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result233) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result232, - literal: lifted234, - }) - } - 5 => { - let result235 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let array232 : Array[@types.SchemaTypeNode] = []; + for index233 = 0; index233 < (mbt_ffi_load32((result_ptr) + 16)); index233 = index233 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 12)) + (index233 * 144) - @types.DiscriminatorRule::FieldAbsent(result235) - } - _ => panic() - } + let lifted218 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let lifted238 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result237 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { - Option::Some(result237) - } - _ => panic() - } - - let array240 : Array[String] = [] - for index241 = 0 - index241 < mbt_ffi_load32(iter_base + 52) - index241 = index241 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index241 * 8 - - let result239 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array240.push(result239) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array243 : Array[String] = [] - for index244 = 0 - index244 < mbt_ffi_load32(iter_base + 60) - index244 = index244 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index244 * 8 - - let result242 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array243.push(result242) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted246 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result245 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaTypeBody::BoolType + } + 2 => { - Option::Some(result245) - } - _ => panic() - } + let lifted42 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted249 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted248 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result247 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result247) - } - _ => panic() - } - - Option::Some(lifted248) - } - _ => panic() - } - - array250.push(@types.UnionBranch::{ - tag: result227, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted236, - metadata: @types.MetadataEnvelope::{ - doc: lifted238, - aliases: array240, - examples: array243, - deprecated: lifted246, - role: lifted249, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array250, - }) - } - 32 => { - let lifted253 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result252 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result252) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted253, - }) - } - 33 => { - let lifted255 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result254 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result254) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted255, - }) - } - 34 => { - let lifted256 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted256) - } - 35 => { - let lifted257 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted257) - } - _ => panic() - } + let lifted37 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted260 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result259 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) + let lifted36 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - Option::Some(result259) - } - _ => panic() - } - - let array262 : Array[String] = [] - for index263 = 0 - index263 < mbt_ffi_load32(iter_base + 104) - index263 = index263 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index263 * 8 - - let result261 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array262.push(result261) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array265 : Array[String] = [] - for index266 = 0 - index266 < mbt_ffi_load32(iter_base + 112) - index266 = index266 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index266 * 8 - - let result264 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array265.push(result264) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted268 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result267 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - Option::Some(result267) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - let lifted271 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted270 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result269 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result269) - } - _ => panic() - } - - Option::Some(lifted270) - } - _ => panic() - } - - array272.push(@types.SchemaTypeNode::{ - body: lifted258, - metadata: @types.MetadataEnvelope::{ - doc: lifted260, - aliases: array262, - examples: array265, - deprecated: lifted268, - role: lifted271, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 12)) - - let array277 : Array[@types.SchemaTypeDef] = [] - for index278 = 0 - index278 < mbt_ffi_load32(return_area + 24) - index278 = index278 + 1 { - let iter_base = mbt_ffi_load32(return_area + 20) + index278 * 24 - - let result274 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted276 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result275 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - Option::Some(result275) - } - _ => panic() - } - - array277.push(@types.SchemaTypeDef::{ - id: result274, - name: lifted276, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 20)) - - let array308 : Array[@types.SchemaValueNode] = [] - for index309 = 0 - index309 < mbt_ffi_load32(return_area + 36) - index309 = index309 + 1 { - let iter_base = mbt_ffi_load32(return_area + 32) + index309 * 32 - - let lifted307 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result279 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Option::Some(lifted36) + } + _ => panic() + } - @types.SchemaValueNode::StringValue(result279) - } - 13 => { - let array280 : Array[Int] = [] - for index281 = 0 - index281 < mbt_ffi_load32(iter_base + 12) - index281 = index281 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index281 * 4 + let lifted39 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - array280.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let lifted38 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - @types.SchemaValueNode::RecordValue(array280) - } - 14 => { - let lifted282 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted282, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array283 : Array[Bool] = [] - for index284 = 0 - index284 < mbt_ffi_load32(iter_base + 12) - index284 = index284 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index284 * 1 + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - array283.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - @types.SchemaValueNode::FlagsValue(array283) - } - 17 => { - let array285 : Array[Int] = [] - for index286 = 0 - index286 < mbt_ffi_load32(iter_base + 12) - index286 = index286 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index286 * 4 + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - array285.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + Option::Some(lifted38) + } + _ => panic() + } - @types.SchemaValueNode::TupleValue(array285) - } - 18 => { - let array287 : Array[Int] = [] - for index288 = 0 - index288 < mbt_ffi_load32(iter_base + 12) - index288 = index288 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index288 * 4 + let lifted41 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - array287.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result40 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - @types.SchemaValueNode::ListValue(array287) - } - 19 => { - let array289 : Array[Int] = [] - for index290 = 0 - index290 < mbt_ffi_load32(iter_base + 12) - index290 = index290 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index290 * 4 + Option::Some(result40) + } + _ => panic() + } - array289.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + Option::Some(@types.NumericRestrictions::{min : lifted37, max : lifted39, unit : lifted41}) + } + _ => panic() + } - @types.SchemaValueNode::FixedListValue(array289) - } - 20 => { - let array291 : Array[@types.MapEntry] = [] - for index292 = 0 - index292 < mbt_ffi_load32(iter_base + 12) - index292 = index292 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index292 * 8 - - array291.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array291) - } - 21 => { - let lifted293 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaTypeBody::S8Type(lifted42) + } + 3 => { - @types.SchemaValueNode::OptionValue(lifted293) - } - 22 => { - let lifted296 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted294 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let lifted49 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.ResultValuePayload::OkValue(lifted294) - } - 1 => { - let lifted295 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let lifted44 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted43 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - @types.ResultValuePayload::ErrValue(lifted295) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - @types.SchemaValueNode::ResultValue(lifted296) - } - 23 => { - let result297 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted299 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result298 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result298) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result297, - language: lifted299, - }) - } - 24 => { - let result300 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted302 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result301 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result301) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result300, - mime_type: lifted302, - }) - } - 25 => { - let result303 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted43) + } + _ => panic() + } + + let lifted46 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted45 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted45) + } + _ => panic() + } + + let lifted48 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result47 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result47) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted44, max : lifted46, unit : lifted48}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted49) + } + 4 => { + + let lifted56 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted51 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted50 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted50) + } + _ => panic() + } + + let lifted53 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted52 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted52) + } + _ => panic() + } + + let lifted55 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result54 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result54) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted51, max : lifted53, unit : lifted55}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted56) + } + 5 => { + + let lifted63 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted58 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted57 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted57) + } + _ => panic() + } + + let lifted60 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted59 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted59) + } + _ => panic() + } + + let lifted62 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result61 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result61) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted58, max : lifted60, unit : lifted62}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted63) + } + 6 => { + + let lifted70 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted65 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted64 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted64) + } + _ => panic() + } + + let lifted67 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted66 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted66) + } + _ => panic() + } + + let lifted69 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result68 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result68) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted65, max : lifted67, unit : lifted69}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted70) + } + 7 => { + + let lifted77 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted72 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted71 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted71) + } + _ => panic() + } + + let lifted74 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted73 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted73) + } + _ => panic() + } + + let lifted76 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result75 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result75) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted72, max : lifted74, unit : lifted76}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted77) + } + 8 => { + + let lifted84 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted79 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted78 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted78) + } + _ => panic() + } + + let lifted81 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted80 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted80) + } + _ => panic() + } + + let lifted83 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result82 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result82) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted79, max : lifted81, unit : lifted83}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted84) + } + 9 => { + + let lifted91 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted86 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted85 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted85) + } + _ => panic() + } + + let lifted88 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted87 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted87) + } + _ => panic() + } + + let lifted90 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result89 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result89) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted86, max : lifted88, unit : lifted90}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted91) + } + 10 => { + + let lifted98 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted93 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted92 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted92) + } + _ => panic() + } + + let lifted95 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted94 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted94) + } + _ => panic() + } + + let lifted97 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result96 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result96) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted93, max : lifted95, unit : lifted97}) + } + _ => panic() + } - @types.SchemaValueNode::PathValue(result303) - } - 26 => { - let result304 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result304) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result305 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.SchemaTypeBody::F32Type(lifted98) + } + 11 => { - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result305, - }) - } - 30 => { - let result306 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result306, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array308.push(lifted307) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 32)) - - @common.AgentError::CustomError(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array272, - defs: array277, - root: mbt_ffi_load32(return_area + 28), - }, - value: @types.SchemaValueTree::{ - value_nodes: array308, - root: mbt_ffi_load32(return_area + 40), - }, - }) - } - _ => panic() - } + let lifted105 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - RpcError::RemoteAgentError(lifted310) - } - _ => panic() - } + let lifted100 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Result::Err(lifted311) - } - _ => panic() - } - let ret = lifted312 - mbt_ffi_free(ptr) - mbt_ffi_free(address67) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let lifted99 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { -///| -/// Invokes a remote method with the given parameters, and returns a `future-invoke-result` value which can -/// be polled for the result together with the final invocation identity. -/// -/// With this function it is possible to call multiple (different) agents simultaneously. -pub fn WasmRpc::async_invoke_and_await( - self : WasmRpc, - method_name : String, - input : @types.SchemaValueTree, -) -> AsyncInvocationWithMetadata { - let cleanup_list : Array[Int] = [] + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let WasmRpc(handle) = self + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - let ptr = mbt_ffi_str2ptr(method_name) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - let address67 = mbt_ffi_malloc(input.value_nodes.length() * 32) - for index68 = 0; index68 < input.value_nodes.length(); index68 = index68 + 1 { - let iter_elem : @types.SchemaValueNode = input.value_nodes[index68] - let iter_base = address67 + index68 * 32 + Option::Some(lifted99) + } + _ => panic() + } - match iter_elem { - BoolValue(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) + let lifted102 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - S8Value(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + let lifted101 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - () - } - S16Value(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - () - } - S32Value(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - () - } - S64Value(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload3) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - U8Value(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload4.to_int()) + Option::Some(lifted101) + } + _ => panic() + } - () - } - U16Value(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload5.reinterpret_as_int()) + let lifted104 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - U32Value(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload6.reinterpret_as_int()) + let result103 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - () - } - U64Value(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload7.reinterpret_as_int64()) + Option::Some(result103) + } + _ => panic() + } - () - } - F32Value(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload8) + Option::Some(@types.NumericRestrictions::{min : lifted100, max : lifted102, unit : lifted104}) + } + _ => panic() + } - () - } - F64Value(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload9) + @types.SchemaTypeBody::F64Type(lifted105) + } + 12 => { - () - } - CharValue(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload10.to_int()) + @types.SchemaTypeBody::CharType + } + 13 => { - () - } - StringValue(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) + @types.SchemaTypeBody::StringType + } + 14 => { - let ptr12 = mbt_ffi_str2ptr(payload11) - mbt_ffi_store32(iter_base + 12, payload11.length()) - mbt_ffi_store32(iter_base + 8, ptr12) - cleanup_list.push(ptr12) + let array120 : Array[@types.NamedFieldType] = []; + for index121 = 0; index121 < (mbt_ffi_load32((iter_base) + 12)); index121 = index121 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index121 * 68) - () - } - RecordValue(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address = mbt_ffi_malloc(payload13.length() * 4) - for index = 0; index < payload13.length(); index = index + 1 { - let iter_elem : Int = payload13[index] - let iter_base = address + index * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload13.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - VariantValue(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.case.reinterpret_as_int()) + let result106 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload14.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let lifted108 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - Some(payload16) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload16) + let result107 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - } + Option::Some(result107) + } + _ => panic() + } - () - } - EnumValue(payload17) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload17.reinterpret_as_int()) + let array110 : Array[String] = []; + for index111 = 0; index111 < (mbt_ffi_load32((iter_base) + 28)); index111 = index111 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index111 * 8) - () - } - FlagsValue(payload18) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address19 = mbt_ffi_malloc(payload18.length() * 1) - for index20 = 0; index20 < payload18.length(); index20 = index20 + 1 { - let iter_elem : Bool = payload18[index20] - let iter_base = address19 + index20 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload18.length()) - mbt_ffi_store32(iter_base + 8, address19) - cleanup_list.push(address19) - - () - } - TupleValue(payload21) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address22 = mbt_ffi_malloc(payload21.length() * 4) - for index23 = 0; index23 < payload21.length(); index23 = index23 + 1 { - let iter_elem : Int = payload21[index23] - let iter_base = address22 + index23 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, address22) - cleanup_list.push(address22) - - () - } - ListValue(payload24) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address25 = mbt_ffi_malloc(payload24.length() * 4) - for index26 = 0; index26 < payload24.length(); index26 = index26 + 1 { - let iter_elem : Int = payload24[index26] - let iter_base = address25 + index26 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, address25) - cleanup_list.push(address25) - - () - } - FixedListValue(payload27) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address28 = mbt_ffi_malloc(payload27.length() * 4) - for index29 = 0; index29 < payload27.length(); index29 = index29 + 1 { - let iter_elem : Int = payload27[index29] - let iter_base = address28 + index29 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, address28) - cleanup_list.push(address28) - - () - } - MapValue(payload30) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address31 = mbt_ffi_malloc(payload30.length() * 8) - for index32 = 0; index32 < payload30.length(); index32 = index32 + 1 { - let iter_elem : @types.MapEntry = payload30[index32] - let iter_base = address31 + index32 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload30.length()) - mbt_ffi_store32(iter_base + 8, address31) - cleanup_list.push(address31) - - () - } - OptionValue(payload33) => { - mbt_ffi_store8(iter_base + 0, 21) + let result109 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload33 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + array110.push(result109) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - () - } - Some(payload35) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload35) + let array113 : Array[String] = []; + for index114 = 0; index114 < (mbt_ffi_load32((iter_base) + 36)); index114 = index114 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index114 * 8) - () - } - } + let result112 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - ResultValue(payload36) => { - mbt_ffi_store8(iter_base + 0, 22) + array113.push(result112) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - match payload36 { - OkValue(payload37) => { - mbt_ffi_store8(iter_base + 8, 0) + let lifted116 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - match payload37 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let result115 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - () - } - Some(payload39) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload39) + Option::Some(result115) + } + _ => panic() + } - () - } - } + let lifted119 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { - () - } - ErrValue(payload40) => { - mbt_ffi_store8(iter_base + 8, 1) + let lifted118 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { - match payload40 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + @types.Role::Multimodal + } + 1 => { - () - } - Some(payload42) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload42) + @types.Role::UnstructuredText + } + 2 => { - () - } - } + @types.Role::UnstructuredBinary + } + 3 => { - () - } - } + let result117 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - () - } - TextValue(payload43) => { - mbt_ffi_store8(iter_base + 0, 23) + @types.Role::Other(result117) + } + _ => panic() + } - let ptr44 = mbt_ffi_str2ptr(payload43.text) - mbt_ffi_store32(iter_base + 12, payload43.text.length()) - mbt_ffi_store32(iter_base + 8, ptr44) + Option::Some(lifted118) + } + _ => panic() + } - match payload43.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + array120.push(@types.NamedFieldType::{name : result106, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted108, aliases : array110, examples : array113, deprecated : lifted116, role : lifted119}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Some(payload46) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.SchemaTypeBody::RecordType(array120) + } + 15 => { - let ptr47 = mbt_ffi_str2ptr(payload46) - mbt_ffi_store32(iter_base + 24, payload46.length()) - mbt_ffi_store32(iter_base + 20, ptr47) - cleanup_list.push(ptr47) + let array137 : Array[@types.VariantCaseType] = []; + for index138 = 0; index138 < (mbt_ffi_load32((iter_base) + 12)); index138 = index138 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index138 * 72) - () - } - } - cleanup_list.push(ptr44) + let result122 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - BinaryValue(payload48) => { - mbt_ffi_store8(iter_base + 0, 24) + let lifted123 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let ptr49 = mbt_ffi_bytes2ptr(payload48.bytes) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - mbt_ffi_store32(iter_base + 12, payload48.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr49) + let lifted125 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - match payload48.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let result124 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - Some(payload51) => { - mbt_ffi_store8(iter_base + 16, 1) + Option::Some(result124) + } + _ => panic() + } - let ptr52 = mbt_ffi_str2ptr(payload51) - mbt_ffi_store32(iter_base + 24, payload51.length()) - mbt_ffi_store32(iter_base + 20, ptr52) - cleanup_list.push(ptr52) + let array127 : Array[String] = []; + for index128 = 0; index128 < (mbt_ffi_load32((iter_base) + 32)); index128 = index128 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index128 * 8) - () - } - } - cleanup_list.push(ptr49) + let result126 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - PathValue(payload53) => { - mbt_ffi_store8(iter_base + 0, 25) + array127.push(result126) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let ptr54 = mbt_ffi_str2ptr(payload53) - mbt_ffi_store32(iter_base + 12, payload53.length()) - mbt_ffi_store32(iter_base + 8, ptr54) - cleanup_list.push(ptr54) + let array130 : Array[String] = []; + for index131 = 0; index131 < (mbt_ffi_load32((iter_base) + 40)); index131 = index131 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index131 * 8) - () - } - UrlValue(payload55) => { - mbt_ffi_store8(iter_base + 0, 26) + let result129 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let ptr56 = mbt_ffi_str2ptr(payload55) - mbt_ffi_store32(iter_base + 12, payload55.length()) - mbt_ffi_store32(iter_base + 8, ptr56) - cleanup_list.push(ptr56) + array130.push(result129) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - () - } - DatetimeValue(payload57) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload57.seconds) - mbt_ffi_store32( - iter_base + 16, - payload57.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload58) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload58.nanoseconds) + let lifted133 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { - () - } - QuantityValueNode(payload59) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload59.mantissa) - mbt_ffi_store32(iter_base + 16, payload59.scale) + let result132 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - let ptr60 = mbt_ffi_str2ptr(payload59.unit) - mbt_ffi_store32(iter_base + 24, payload59.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr60) - cleanup_list.push(ptr60) + Option::Some(result132) + } + _ => panic() + } - () - } - UnionValue(payload61) => { - mbt_ffi_store8(iter_base + 0, 30) + let lifted136 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - let ptr62 = mbt_ffi_str2ptr(payload61.tag) - mbt_ffi_store32(iter_base + 12, payload61.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr62) - mbt_ffi_store32(iter_base + 16, payload61.body) - cleanup_list.push(ptr62) + let lifted135 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { - () - } - SecretValue(payload63) => { - mbt_ffi_store8(iter_base + 0, 31) + @types.Role::Multimodal + } + 1 => { - let @types.Secret(handle64) = payload63 - mbt_ffi_store32(iter_base + 8, handle64) + @types.Role::UnstructuredText + } + 2 => { - () - } - QuotaTokenHandle(payload65) => { - mbt_ffi_store8(iter_base + 0, 32) + @types.Role::UnstructuredBinary + } + 3 => { - let @types.QuotaToken(handle66) = payload65 - mbt_ffi_store32(iter_base + 8, handle66) + let result134 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) - () - } - } - } - let return_area = mbt_ffi_malloc(20) - wasmImportMethodWasmRpcAsyncInvokeAndAwait( - handle, - ptr, - method_name.length(), - address67, - input.value_nodes.length(), - input.root, - return_area, - ) - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 0), - mbt_ffi_load32(return_area + 4), - ) - - let result69 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - let ret = AsyncInvocationWithMetadata::{ - metadata: InvocationMetadata::{ - agent_id: result, - idempotency_key: result69, - }, - future: FutureInvokeResult::FutureInvokeResult( - mbt_ffi_load32(return_area + 16), - ), - } - mbt_ffi_free(ptr) - mbt_ffi_free(address67) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + @types.Role::Other(result134) + } + _ => panic() + } -///| -/// Schedules an invocation for later and returns its final identity. -pub fn WasmRpc::schedule_invocation( - self : WasmRpc, - scheduled_time : @system-clock.Instant, - method_name : String, - input : @types.SchemaValueTree, -) -> ScheduledInvocationReceipt { - let cleanup_list : Array[Int] = [] + Option::Some(lifted135) + } + _ => panic() + } - let WasmRpc(handle) = self + array137.push(@types.VariantCaseType::{name : result122, payload : lifted123, metadata : @types.MetadataEnvelope::{doc : lifted125, aliases : array127, examples : array130, deprecated : lifted133, role : lifted136}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let ptr = mbt_ffi_str2ptr(method_name) + @types.SchemaTypeBody::VariantType(array137) + } + 16 => { - let address67 = mbt_ffi_malloc(input.value_nodes.length() * 32) - for index68 = 0; index68 < input.value_nodes.length(); index68 = index68 + 1 { - let iter_elem : @types.SchemaValueNode = input.value_nodes[index68] - let iter_base = address67 + index68 * 32 + let array140 : Array[String] = []; + for index141 = 0; index141 < (mbt_ffi_load32((iter_base) + 12)); index141 = index141 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index141 * 8) - match iter_elem { - BoolValue(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) + let result139 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - S8Value(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + array140.push(result139) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - S16Value(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + @types.SchemaTypeBody::EnumType(array140) + } + 17 => { - () - } - S32Value(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + let array143 : Array[String] = []; + for index144 = 0; index144 < (mbt_ffi_load32((iter_base) + 12)); index144 = index144 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index144 * 8) - () - } - S64Value(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload3) + let result142 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - U8Value(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload4.to_int()) + array143.push(result142) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - U16Value(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload5.reinterpret_as_int()) + @types.SchemaTypeBody::FlagsType(array143) + } + 18 => { - () - } - U32Value(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload6.reinterpret_as_int()) + let array145 : Array[Int] = []; + for index146 = 0; index146 < (mbt_ffi_load32((iter_base) + 12)); index146 = index146 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index146 * 4) - () - } - U64Value(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload7.reinterpret_as_int64()) + array145.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - F32Value(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload8) + @types.SchemaTypeBody::TupleType(array145) + } + 19 => { - () - } - F64Value(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload9) + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { - () - } - CharValue(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload10.to_int()) + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { - () - } - StringValue(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { - let ptr12 = mbt_ffi_str2ptr(payload11) - mbt_ffi_store32(iter_base + 12, payload11.length()) - mbt_ffi_store32(iter_base + 8, ptr12) - cleanup_list.push(ptr12) + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { - () - } - RecordValue(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address = mbt_ffi_malloc(payload13.length() * 4) - for index = 0; index < payload13.length(); index = index + 1 { - let iter_elem : Int = payload13[index] - let iter_base = address + index * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload13.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - VariantValue(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.case.reinterpret_as_int()) + let lifted147 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload14.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - () - } - Some(payload16) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload16) + let lifted148 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - } + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } - () - } - EnumValue(payload17) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload17.reinterpret_as_int()) + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted147, err : lifted148}) + } + 24 => { - () - } - FlagsValue(payload18) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address19 = mbt_ffi_malloc(payload18.length() * 1) - for index20 = 0; index20 < payload18.length(); index20 = index20 + 1 { - let iter_elem : Bool = payload18[index20] - let iter_base = address19 + index20 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload18.length()) - mbt_ffi_store32(iter_base + 8, address19) - cleanup_list.push(address19) - - () - } - TupleValue(payload21) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address22 = mbt_ffi_malloc(payload21.length() * 4) - for index23 = 0; index23 < payload21.length(); index23 = index23 + 1 { - let iter_elem : Int = payload21[index23] - let iter_base = address22 + index23 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, address22) - cleanup_list.push(address22) - - () - } - ListValue(payload24) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address25 = mbt_ffi_malloc(payload24.length() * 4) - for index26 = 0; index26 < payload24.length(); index26 = index26 + 1 { - let iter_elem : Int = payload24[index26] - let iter_base = address25 + index26 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, address25) - cleanup_list.push(address25) - - () - } - FixedListValue(payload27) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address28 = mbt_ffi_malloc(payload27.length() * 4) - for index29 = 0; index29 < payload27.length(); index29 = index29 + 1 { - let iter_elem : Int = payload27[index29] - let iter_base = address28 + index29 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, address28) - cleanup_list.push(address28) - - () - } - MapValue(payload30) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address31 = mbt_ffi_malloc(payload30.length() * 8) - for index32 = 0; index32 < payload30.length(); index32 = index32 + 1 { - let iter_elem : @types.MapEntry = payload30[index32] - let iter_base = address31 + index32 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload30.length()) - mbt_ffi_store32(iter_base + 8, address31) - cleanup_list.push(address31) - - () - } - OptionValue(payload33) => { - mbt_ffi_store8(iter_base + 0, 21) + let lifted152 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload33 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let array150 : Array[String] = []; + for index151 = 0; index151 < (mbt_ffi_load32((iter_base) + 16)); index151 = index151 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index151 * 8) - () - } - Some(payload35) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload35) + let result149 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - } + array150.push(result149) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - ResultValue(payload36) => { - mbt_ffi_store8(iter_base + 0, 22) + Option::Some(array150) + } + _ => panic() + } - match payload36 { - OkValue(payload37) => { - mbt_ffi_store8(iter_base + 8, 0) + let lifted153 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - match payload37 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - Some(payload39) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload39) + let lifted154 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - () - } - } + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - ErrValue(payload40) => { - mbt_ffi_store8(iter_base + 8, 1) + let lifted156 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - match payload40 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let result155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - () - } - Some(payload42) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload42) + Option::Some(result155) + } + _ => panic() + } - () - } - } + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted152, min_length : lifted153, max_length : lifted154, regex : lifted156}) + } + 25 => { - () - } - } + let lifted160 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - TextValue(payload43) => { - mbt_ffi_store8(iter_base + 0, 23) + let array158 : Array[String] = []; + for index159 = 0; index159 < (mbt_ffi_load32((iter_base) + 16)); index159 = index159 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index159 * 8) - let ptr44 = mbt_ffi_str2ptr(payload43.text) - mbt_ffi_store32(iter_base + 12, payload43.text.length()) - mbt_ffi_store32(iter_base + 8, ptr44) + let result157 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload43.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + array158.push(result157) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - Some(payload46) => { - mbt_ffi_store8(iter_base + 16, 1) + Option::Some(array158) + } + _ => panic() + } - let ptr47 = mbt_ffi_str2ptr(payload46) - mbt_ffi_store32(iter_base + 24, payload46.length()) - mbt_ffi_store32(iter_base + 20, ptr47) - cleanup_list.push(ptr47) + let lifted161 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - () - } - } - cleanup_list.push(ptr44) + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - BinaryValue(payload48) => { - mbt_ffi_store8(iter_base + 0, 24) + let lifted162 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - let ptr49 = mbt_ffi_bytes2ptr(payload48.bytes) + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - mbt_ffi_store32(iter_base + 12, payload48.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr49) + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted160, min_bytes : lifted161, max_bytes : lifted162}) + } + 26 => { - match payload48.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted166 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - Some(payload51) => { - mbt_ffi_store8(iter_base + 16, 1) + let array164 : Array[String] = []; + for index165 = 0; index165 < (mbt_ffi_load32((iter_base) + 20)); index165 = index165 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index165 * 8) - let ptr52 = mbt_ffi_str2ptr(payload51) - mbt_ffi_store32(iter_base + 24, payload51.length()) - mbt_ffi_store32(iter_base + 20, ptr52) - cleanup_list.push(ptr52) + let result163 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - } - cleanup_list.push(ptr49) + array164.push(result163) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - PathValue(payload53) => { - mbt_ffi_store8(iter_base + 0, 25) + Option::Some(array164) + } + _ => panic() + } - let ptr54 = mbt_ffi_str2ptr(payload53) - mbt_ffi_store32(iter_base + 12, payload53.length()) - mbt_ffi_store32(iter_base + 8, ptr54) - cleanup_list.push(ptr54) + let lifted170 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - () - } - UrlValue(payload55) => { - mbt_ffi_store8(iter_base + 0, 26) + let array168 : Array[String] = []; + for index169 = 0; index169 < (mbt_ffi_load32((iter_base) + 32)); index169 = index169 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index169 * 8) - let ptr56 = mbt_ffi_str2ptr(payload55) - mbt_ffi_store32(iter_base + 12, payload55.length()) - mbt_ffi_store32(iter_base + 8, ptr56) - cleanup_list.push(ptr56) + let result167 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - DatetimeValue(payload57) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload57.seconds) - mbt_ffi_store32( - iter_base + 16, - payload57.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload58) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload58.nanoseconds) + array168.push(result167) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () - } - QuantityValueNode(payload59) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload59.mantissa) - mbt_ffi_store32(iter_base + 16, payload59.scale) + Option::Some(array168) + } + _ => panic() + } - let ptr60 = mbt_ffi_str2ptr(payload59.unit) - mbt_ffi_store32(iter_base + 24, payload59.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr60) - cleanup_list.push(ptr60) + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted166, allowed_extensions : lifted170}) + } + 27 => { - () - } - UnionValue(payload61) => { - mbt_ffi_store8(iter_base + 0, 30) + let lifted174 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let ptr62 = mbt_ffi_str2ptr(payload61.tag) - mbt_ffi_store32(iter_base + 12, payload61.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr62) - mbt_ffi_store32(iter_base + 16, payload61.body) - cleanup_list.push(ptr62) + let array172 : Array[String] = []; + for index173 = 0; index173 < (mbt_ffi_load32((iter_base) + 16)); index173 = index173 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index173 * 8) - () - } - SecretValue(payload63) => { - mbt_ffi_store8(iter_base + 0, 31) + let result171 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let @types.Secret(handle64) = payload63 - mbt_ffi_store32(iter_base + 8, handle64) + array172.push(result171) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - QuotaTokenHandle(payload65) => { - mbt_ffi_store8(iter_base + 0, 32) + Option::Some(array172) + } + _ => panic() + } - let @types.QuotaToken(handle66) = payload65 - mbt_ffi_store32(iter_base + 8, handle66) + let lifted178 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - () - } - } - } - let return_area = mbt_ffi_malloc(16) - wasmImportMethodWasmRpcScheduleInvocation( - handle, - scheduled_time.seconds, - scheduled_time.nanoseconds.reinterpret_as_int(), - ptr, - method_name.length(), - address67, - input.value_nodes.length(), - input.root, - return_area, - ) - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 0), - mbt_ffi_load32(return_area + 4), - ) - - let result69 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - let ret = ScheduledInvocationReceipt::{ - metadata: InvocationMetadata::{ - agent_id: result, - idempotency_key: result69, - }, - } - mbt_ffi_free(ptr) - mbt_ffi_free(address67) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let array176 : Array[String] = []; + for index177 = 0; index177 < (mbt_ffi_load32((iter_base) + 28)); index177 = index177 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index177 * 8) -///| -/// Schedules an invocation for later and returns its final identity and -/// cancellation capability. Call cancel on the returned resource to -/// cancel the invocation before the scheduled time. -pub fn WasmRpc::schedule_cancelable_invocation( - self : WasmRpc, - scheduled_time : @system-clock.Instant, - method_name : String, - input : @types.SchemaValueTree, -) -> CancelableScheduledInvocationReceipt { - let cleanup_list : Array[Int] = [] + let result175 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let WasmRpc(handle) = self + array176.push(result175) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - let ptr = mbt_ffi_str2ptr(method_name) + Option::Some(array176) + } + _ => panic() + } - let address67 = mbt_ffi_malloc(input.value_nodes.length() * 32) - for index68 = 0; index68 < input.value_nodes.length(); index68 = index68 + 1 { - let iter_elem : @types.SchemaValueNode = input.value_nodes[index68] - let iter_base = address67 + index68 * 32 + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted174, allowed_hosts : lifted178}) + } + 28 => { - match iter_elem { - BoolValue(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) + @types.SchemaTypeBody::DatetimeType + } + 29 => { - () - } - S8Value(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + @types.SchemaTypeBody::DurationType + } + 30 => { - () - } - S16Value(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + let result179 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - S32Value(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + let array181 : Array[String] = []; + for index182 = 0; index182 < (mbt_ffi_load32((iter_base) + 20)); index182 = index182 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index182 * 8) - () - } - S64Value(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload3) + let result180 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - U8Value(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload4.to_int()) + array181.push(result180) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - U16Value(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload5.reinterpret_as_int()) + let lifted184 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - () - } - U32Value(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload6.reinterpret_as_int()) + let result183 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - () - } - U64Value(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload7.reinterpret_as_int64()) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result183}) + } + _ => panic() + } - () - } - F32Value(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload8) + let lifted186 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - () - } - F64Value(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload9) + let result185 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - () - } - CharValue(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload10.to_int()) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result185}) + } + _ => panic() + } - () - } - StringValue(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result179, allowed_suffixes : array181, min : lifted184, max : lifted186}) + } + 31 => { - let ptr12 = mbt_ffi_str2ptr(payload11) - mbt_ffi_store32(iter_base + 12, payload11.length()) - mbt_ffi_store32(iter_base + 8, ptr12) - cleanup_list.push(ptr12) + let array210 : Array[@types.UnionBranch] = []; + for index211 = 0; index211 < (mbt_ffi_load32((iter_base) + 12)); index211 = index211 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index211 * 92) - () - } - RecordValue(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address = mbt_ffi_malloc(payload13.length() * 4) - for index = 0; index < payload13.length(); index = index + 1 { - let iter_elem : Int = payload13[index] - let iter_base = address + index * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload13.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - VariantValue(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.case.reinterpret_as_int()) + let result187 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload14.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let lifted196 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { - () - } - Some(payload16) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload16) + let result188 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - } + @types.DiscriminatorRule::Prefix(result188) + } + 1 => { - () - } - EnumValue(payload17) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload17.reinterpret_as_int()) + let result189 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - FlagsValue(payload18) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address19 = mbt_ffi_malloc(payload18.length() * 1) - for index20 = 0; index20 < payload18.length(); index20 = index20 + 1 { - let iter_elem : Bool = payload18[index20] - let iter_base = address19 + index20 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload18.length()) - mbt_ffi_store32(iter_base + 8, address19) - cleanup_list.push(address19) - - () - } - TupleValue(payload21) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address22 = mbt_ffi_malloc(payload21.length() * 4) - for index23 = 0; index23 < payload21.length(); index23 = index23 + 1 { - let iter_elem : Int = payload21[index23] - let iter_base = address22 + index23 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, address22) - cleanup_list.push(address22) - - () - } - ListValue(payload24) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address25 = mbt_ffi_malloc(payload24.length() * 4) - for index26 = 0; index26 < payload24.length(); index26 = index26 + 1 { - let iter_elem : Int = payload24[index26] - let iter_base = address25 + index26 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, address25) - cleanup_list.push(address25) - - () - } - FixedListValue(payload27) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address28 = mbt_ffi_malloc(payload27.length() * 4) - for index29 = 0; index29 < payload27.length(); index29 = index29 + 1 { - let iter_elem : Int = payload27[index29] - let iter_base = address28 + index29 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, address28) - cleanup_list.push(address28) - - () - } - MapValue(payload30) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address31 = mbt_ffi_malloc(payload30.length() * 8) - for index32 = 0; index32 < payload30.length(); index32 = index32 + 1 { - let iter_elem : @types.MapEntry = payload30[index32] - let iter_base = address31 + index32 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload30.length()) - mbt_ffi_store32(iter_base + 8, address31) - cleanup_list.push(address31) - - () - } - OptionValue(payload33) => { - mbt_ffi_store8(iter_base + 0, 21) + @types.DiscriminatorRule::Suffix(result189) + } + 2 => { - match payload33 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let result190 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - Some(payload35) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload35) + @types.DiscriminatorRule::Contains(result190) + } + 3 => { - () - } - } + let result191 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - ResultValue(payload36) => { - mbt_ffi_store8(iter_base + 0, 22) + @types.DiscriminatorRule::Regex(result191) + } + 4 => { - match payload36 { - OkValue(payload37) => { - mbt_ffi_store8(iter_base + 8, 0) + let result192 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match payload37 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let lifted194 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - () - } - Some(payload39) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload39) + let result193 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - () - } - } + Option::Some(result193) + } + _ => panic() + } - () - } - ErrValue(payload40) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result192, literal : lifted194}) + } + 5 => { - match payload40 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let result195 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - Some(payload42) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload42) + @types.DiscriminatorRule::FieldAbsent(result195) + } + _ => panic() + } - () - } - } + let lifted198 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - () - } - } + let result197 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - () - } - TextValue(payload43) => { - mbt_ffi_store8(iter_base + 0, 23) + Option::Some(result197) + } + _ => panic() + } - let ptr44 = mbt_ffi_str2ptr(payload43.text) - mbt_ffi_store32(iter_base + 12, payload43.text.length()) - mbt_ffi_store32(iter_base + 8, ptr44) + let array200 : Array[String] = []; + for index201 = 0; index201 < (mbt_ffi_load32((iter_base) + 52)); index201 = index201 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index201 * 8) - match payload43.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let result199 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload46) => { - mbt_ffi_store8(iter_base + 16, 1) + array200.push(result199) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - let ptr47 = mbt_ffi_str2ptr(payload46) - mbt_ffi_store32(iter_base + 24, payload46.length()) - mbt_ffi_store32(iter_base + 20, ptr47) - cleanup_list.push(ptr47) + let array203 : Array[String] = []; + for index204 = 0; index204 < (mbt_ffi_load32((iter_base) + 60)); index204 = index204 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index204 * 8) - () - } - } - cleanup_list.push(ptr44) + let result202 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - BinaryValue(payload48) => { - mbt_ffi_store8(iter_base + 0, 24) + array203.push(result202) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - let ptr49 = mbt_ffi_bytes2ptr(payload48.bytes) + let lifted206 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - mbt_ffi_store32(iter_base + 12, payload48.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr49) + let result205 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - match payload48.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + Option::Some(result205) + } + _ => panic() + } - () - } - Some(payload51) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted209 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - let ptr52 = mbt_ffi_str2ptr(payload51) - mbt_ffi_store32(iter_base + 24, payload51.length()) - mbt_ffi_store32(iter_base + 20, ptr52) - cleanup_list.push(ptr52) + let lifted208 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { - () - } - } - cleanup_list.push(ptr49) + @types.Role::Multimodal + } + 1 => { - () - } - PathValue(payload53) => { - mbt_ffi_store8(iter_base + 0, 25) + @types.Role::UnstructuredText + } + 2 => { - let ptr54 = mbt_ffi_str2ptr(payload53) - mbt_ffi_store32(iter_base + 12, payload53.length()) - mbt_ffi_store32(iter_base + 8, ptr54) - cleanup_list.push(ptr54) + @types.Role::UnstructuredBinary + } + 3 => { - () - } - UrlValue(payload55) => { - mbt_ffi_store8(iter_base + 0, 26) + let result207 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - let ptr56 = mbt_ffi_str2ptr(payload55) - mbt_ffi_store32(iter_base + 12, payload55.length()) - mbt_ffi_store32(iter_base + 8, ptr56) - cleanup_list.push(ptr56) + @types.Role::Other(result207) + } + _ => panic() + } - () - } - DatetimeValue(payload57) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload57.seconds) - mbt_ffi_store32( - iter_base + 16, - payload57.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload58) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload58.nanoseconds) + Option::Some(lifted208) + } + _ => panic() + } - () - } - QuantityValueNode(payload59) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload59.mantissa) - mbt_ffi_store32(iter_base + 16, payload59.scale) + array210.push(@types.UnionBranch::{tag : result187, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted196, metadata : @types.MetadataEnvelope::{doc : lifted198, aliases : array200, examples : array203, deprecated : lifted206, role : lifted209}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let ptr60 = mbt_ffi_str2ptr(payload59.unit) - mbt_ffi_store32(iter_base + 24, payload59.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr60) - cleanup_list.push(ptr60) + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array210}) + } + 32 => { - () - } - UnionValue(payload61) => { - mbt_ffi_store8(iter_base + 0, 30) + let lifted213 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let ptr62 = mbt_ffi_str2ptr(payload61.tag) - mbt_ffi_store32(iter_base + 12, payload61.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr62) - mbt_ffi_store32(iter_base + 16, payload61.body) - cleanup_list.push(ptr62) + let result212 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - SecretValue(payload63) => { - mbt_ffi_store8(iter_base + 0, 31) + Option::Some(result212) + } + _ => panic() + } - let @types.Secret(handle64) = payload63 - mbt_ffi_store32(iter_base + 8, handle64) + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted213}) + } + 33 => { - () - } - QuotaTokenHandle(payload65) => { - mbt_ffi_store8(iter_base + 0, 32) + let lifted215 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let @types.QuotaToken(handle66) = payload65 - mbt_ffi_store32(iter_base + 8, handle66) + let result214 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - () - } - } - } - let return_area = mbt_ffi_malloc(20) - wasmImportMethodWasmRpcScheduleCancelableInvocation( - handle, - scheduled_time.seconds, - scheduled_time.nanoseconds.reinterpret_as_int(), - ptr, - method_name.length(), - address67, - input.value_nodes.length(), - input.root, - return_area, - ) - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 0), - mbt_ffi_load32(return_area + 4), - ) - - let result69 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - let ret = CancelableScheduledInvocationReceipt::{ - metadata: InvocationMetadata::{ - agent_id: result, - idempotency_key: result69, - }, - cancellation_token: CancellationToken::CancellationToken( - mbt_ffi_load32(return_area + 16), - ), - } - mbt_ffi_free(ptr) - mbt_ffi_free(address67) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + Option::Some(result214) + } + _ => panic() + } -///| -/// Awaits the result of the invocation. -pub async fn FutureInvokeResult::get( - self : FutureInvokeResult, -) -> Result[@types.SchemaValueTree?, RpcError] { - let FutureInvokeResult(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(44 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodFutureInvokeResultGet( - lower_arg, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => { - for index = 0 - index < mbt_ffi_load32(result_ptr + 12) - index = index + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 8) + index * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted215}) + } + 34 => { - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)).drop() - 32 => - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)).drop() - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - } - _ => panic() - } - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 2 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 3 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 4 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 2 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 3 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 4 => { - for index20 = 0 - index20 < mbt_ffi_load32(result_ptr + 16) - index20 = index20 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 12) + - index20 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index2 = 0 - index2 < mbt_ffi_load32(iter_base + 12) - index2 = index2 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - for index0 = 0 - index0 < mbt_ffi_load32(iter_base + 28) - index0 = index0 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index0 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index1 = 0 - index1 < mbt_ffi_load32(iter_base + 36) - index1 = index1 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index5 = 0 - index5 < mbt_ffi_load32(iter_base + 12) - index5 = index5 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index5 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index3 = 0 - index3 < mbt_ffi_load32(iter_base + 32) - index3 = index3 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index3 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index4 = 0 - index4 < mbt_ffi_load32(iter_base + 40) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index4 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index6 = 0 - index6 < mbt_ffi_load32(iter_base + 12) - index6 = index6 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index6 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index7 = 0 - index7 < mbt_ffi_load32(iter_base + 12) - index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index7 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 16) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index8 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index9 = 0 - index9 < mbt_ffi_load32(iter_base + 16) - index9 = index9 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index9 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 20) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index10 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index11 = 0 - index11 < mbt_ffi_load32(iter_base + 32) - index11 = index11 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index11 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index12 = 0 - index12 < mbt_ffi_load32(iter_base + 16) - index12 = index12 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index12 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index13 = 0 - index13 < mbt_ffi_load32(iter_base + 28) - index13 = index13 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index13 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index14 = 0 - index14 < mbt_ffi_load32(iter_base + 20) - index14 = index14 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index14 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index17 = 0 - index17 < mbt_ffi_load32(iter_base + 12) - index17 = index17 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index17 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - - for index15 = 0 - index15 < mbt_ffi_load32(iter_base + 52) - index15 = index15 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index15 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - for index16 = 0 - index16 < mbt_ffi_load32(iter_base + 60) - index16 = index16 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index16 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index18 = 0 - index18 < mbt_ffi_load32(iter_base + 104) - index18 = index18 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index18 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index19 = 0 - index19 < mbt_ffi_load32(iter_base + 112) - index19 = index19 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index19 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - - for index21 = 0 - index21 < mbt_ffi_load32(result_ptr + 24) - index21 = index21 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 20) + - index21 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - - for index22 = 0 - index22 < mbt_ffi_load32(result_ptr + 36) - index22 = index22 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 32) + - index22 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)).drop() - 32 => - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ).drop() - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 32)) - } - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted272 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - let lifted27 : @types.SchemaValueTree? = match - mbt_ffi_load8_u(result_ptr + 4) { - 0 => Option::None - 1 => { - let array25 : Array[@types.SchemaValueNode] = [] - for index26 = 0 - index26 < mbt_ffi_load32(result_ptr + 12) - index26 = index26 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 8) + index26 * 32 - - let lifted24 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => - @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => - @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => - @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => - @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result) - } - 13 => { - let array : Array[Int] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 12) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index * 4 - - array.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array) - } - 14 => { - let lifted : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array0 : Array[Bool] = [] - for index1 = 0 - index1 < mbt_ffi_load32(iter_base + 12) - index1 = index1 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index1 * 1 - - array0.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array0) - } - 17 => { - let array2 : Array[Int] = [] - for index3 = 0 - index3 < mbt_ffi_load32(iter_base + 12) - index3 = index3 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index3 * 4 - - array2.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array2) - } - 18 => { - let array4 : Array[Int] = [] - for index5 = 0 - index5 < mbt_ffi_load32(iter_base + 12) - index5 = index5 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index5 * 4 - - array4.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array4) - } - 19 => { - let array6 : Array[Int] = [] - for index7 = 0 - index7 < mbt_ffi_load32(iter_base + 12) - index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index7 * 4 - - array6.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array6) - } - 20 => { - let array8 : Array[@types.MapEntry] = [] - for index9 = 0 - index9 < mbt_ffi_load32(iter_base + 12) - index9 = index9 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index9 * 8 - - array8.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array8) - } - 21 => { - let lifted10 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - @types.SchemaValueNode::OptionValue(lifted10) - } - 22 => { - let lifted13 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted11 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let lifted216 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.ResultValuePayload::OkValue(lifted11) - } - 1 => { - let lifted12 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - @types.ResultValuePayload::ErrValue(lifted12) - } - _ => panic() - } + @types.SchemaTypeBody::FutureType(lifted216) + } + 36 => { - @types.SchemaValueNode::ResultValue(lifted13) - } - 23 => { - let result14 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let lifted217 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted16 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(result15) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result14, - language: lifted16, - }) - } - 24 => { - let result17 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted19 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.SchemaTypeBody::StreamType(lifted217) + } + _ => panic() + } - Option::Some(result18) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result17, - mime_type: lifted19, - }) - } - 25 => { - let result20 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result20) - } - 26 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result21) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result22 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result22, - }) - } - 30 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result23, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } + let lifted220 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { - array25.push(lifted24) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) + let result219 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - Option::Some(@types.SchemaValueTree::{ - value_nodes: array25, - root: mbt_ffi_load32(result_ptr + 16), - }) - } - _ => panic() - } + Option::Some(result219) + } + _ => panic() + } - Result::Ok(lifted27) - } - 1 => { - let lifted271 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => { - let result28 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - RpcError::ProtocolError(result28) - } - 1 => { - let result29 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - RpcError::Denied(result29) - } - 2 => { - let result30 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - RpcError::NotFound(result30) - } - 3 => { - let result31 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - RpcError::RemoteInternalError(result31) - } - 4 => { - let lifted270 = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => { - let result32 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + let array222 : Array[String] = []; + for index223 = 0; index223 < (mbt_ffi_load32((iter_base) + 104)); index223 = index223 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index223 * 8) - @common.AgentError::InvalidInput(result32) - } - 1 => { - let result33 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + let result221 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @common.AgentError::InvalidMethod(result33) - } - 2 => { - let result34 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + array222.push(result221) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - @common.AgentError::InvalidType(result34) - } - 3 => { - let result35 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + let array225 : Array[String] = []; + for index226 = 0; index226 < (mbt_ffi_load32((iter_base) + 112)); index226 = index226 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index226 * 8) - @common.AgentError::InvalidAgentId(result35) - } - 4 => { - let array232 : Array[@types.SchemaTypeNode] = [] - for index233 = 0 - index233 < mbt_ffi_load32(result_ptr + 16) - index233 = index233 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 12) + index233 * 144 - - let lifted218 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted42 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted37 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted36 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted36) - } - _ => panic() - } - - let lifted39 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted38 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result224 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted38) - } - _ => panic() - } + array225.push(result224) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - let lifted41 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result40 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted228 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - Option::Some(result40) - } - _ => panic() - } + let result227 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - Option::Some(@types.NumericRestrictions::{ - min: lifted37, - max: lifted39, - unit: lifted41, - }) - } - _ => panic() - } + Option::Some(result227) + } + _ => panic() + } - @types.SchemaTypeBody::S8Type(lifted42) - } - 3 => { - let lifted49 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted44 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted43 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted43) - } - _ => panic() - } - - let lifted46 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted45 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted231 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - Option::Some(lifted45) - } - _ => panic() - } + let lifted230 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - let lifted48 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result47 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.Role::Multimodal + } + 1 => { - Option::Some(result47) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted44, - max: lifted46, - unit: lifted48, - }) - } - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - @types.SchemaTypeBody::S16Type(lifted49) - } - 4 => { - let lifted56 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted51 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted50 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted50) - } - _ => panic() - } - - let lifted53 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted52 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result229 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - Option::Some(lifted52) - } - _ => panic() - } + @types.Role::Other(result229) + } + _ => panic() + } - let lifted55 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result54 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(lifted230) + } + _ => panic() + } - Option::Some(result54) - } - _ => panic() - } + array232.push(@types.SchemaTypeNode::{body : lifted218, metadata : @types.MetadataEnvelope::{doc : lifted220, aliases : array222, examples : array225, deprecated : lifted228, role : lifted231}}) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) - Option::Some(@types.NumericRestrictions::{ - min: lifted51, - max: lifted53, - unit: lifted55, - }) - } - _ => panic() - } + let array237 : Array[@types.SchemaTypeDef] = []; + for index238 = 0; index238 < (mbt_ffi_load32((result_ptr) + 24)); index238 = index238 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 20)) + (index238 * 24) - @types.SchemaTypeBody::S32Type(lifted56) - } - 5 => { - let lifted63 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted58 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted57 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted57) - } - _ => panic() - } - - let lifted60 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted59 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result234 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted59) - } - _ => panic() - } + let lifted236 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted62 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result61 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let result235 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - Option::Some(result61) - } - _ => panic() - } + Option::Some(result235) + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted58, - max: lifted60, - unit: lifted62, - }) - } - _ => panic() - } + array237.push(@types.SchemaTypeDef::{id : result234, name : lifted236, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) - @types.SchemaTypeBody::S64Type(lifted63) - } - 6 => { - let lifted70 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted65 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted64 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted64) - } - _ => panic() - } - - let lifted67 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted66 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array268 : Array[@types.SchemaValueNode] = []; + for index269 = 0; index269 < (mbt_ffi_load32((result_ptr) + 36)); index269 = index269 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 32)) + (index269 * 32) - Option::Some(lifted66) - } - _ => panic() - } + let lifted267 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let lifted69 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result68 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - Option::Some(result68) - } - _ => panic() - } + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted65, - max: lifted67, - unit: lifted69, - }) - } - _ => panic() - } + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - @types.SchemaTypeBody::U8Type(lifted70) - } - 7 => { - let lifted77 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted72 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted71 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted71) - } - _ => panic() - } - - let lifted74 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted73 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - Option::Some(lifted73) - } - _ => panic() - } + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - let lifted76 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result75 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - Option::Some(result75) - } - _ => panic() - } + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted72, - max: lifted74, - unit: lifted76, - }) - } - _ => panic() - } + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - @types.SchemaTypeBody::U16Type(lifted77) - } - 8 => { - let lifted84 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted79 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted78 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted78) - } - _ => panic() - } - - let lifted81 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted80 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - Option::Some(lifted80) - } - _ => panic() - } + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - let lifted83 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result82 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - Option::Some(result82) - } - _ => panic() - } + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted79, - max: lifted81, - unit: lifted83, - }) - } - _ => panic() - } + let result239 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::U32Type(lifted84) - } - 9 => { - let lifted91 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted86 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted85 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted85) - } - _ => panic() - } - - let lifted88 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted87 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::StringValue(result239) + } + 13 => { - Option::Some(lifted87) - } - _ => panic() - } + let array240 : Array[Int] = []; + for index241 = 0; index241 < (mbt_ffi_load32((iter_base) + 12)); index241 = index241 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index241 * 4) - let lifted90 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result89 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + array240.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(result89) - } - _ => panic() - } + @types.SchemaValueNode::RecordValue(array240) + } + 14 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted86, - max: lifted88, - unit: lifted90, - }) - } - _ => panic() - } + let lifted242 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::U64Type(lifted91) - } - 10 => { - let lifted98 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted93 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted92 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted92) - } - _ => panic() - } - - let lifted95 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted94 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - Option::Some(lifted94) - } - _ => panic() - } + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted242}) + } + 15 => { - let lifted97 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result96 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - Option::Some(result96) - } - _ => panic() - } + let array243 : Array[Bool] = []; + for index244 = 0; index244 < (mbt_ffi_load32((iter_base) + 12)); index244 = index244 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index244 * 1) - Option::Some(@types.NumericRestrictions::{ - min: lifted93, - max: lifted95, - unit: lifted97, - }) - } - _ => panic() - } + array243.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.SchemaTypeBody::F32Type(lifted98) - } - 11 => { - let lifted105 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted100 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted99 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted99) - } - _ => panic() - } - - let lifted102 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted101 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::FlagsValue(array243) + } + 17 => { - Option::Some(lifted101) - } - _ => panic() - } + let array245 : Array[Int] = []; + for index246 = 0; index246 < (mbt_ffi_load32((iter_base) + 12)); index246 = index246 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index246 * 4) - let lifted104 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result103 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + array245.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(result103) - } - _ => panic() - } + @types.SchemaValueNode::TupleValue(array245) + } + 18 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted100, - max: lifted102, - unit: lifted104, - }) - } - _ => panic() - } + let array247 : Array[Int] = []; + for index248 = 0; index248 < (mbt_ffi_load32((iter_base) + 12)); index248 = index248 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index248 * 4) - @types.SchemaTypeBody::F64Type(lifted105) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array120 : Array[@types.NamedFieldType] = [] - for index121 = 0 - index121 < mbt_ffi_load32(iter_base + 12) - index121 = index121 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index121 * 68 - - let result106 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted108 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result107 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + array247.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(result107) - } - _ => panic() - } - - let array110 : Array[String] = [] - for index111 = 0 - index111 < mbt_ffi_load32(iter_base + 28) - index111 = index111 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index111 * 8 - - let result109 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array110.push(result109) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array113 : Array[String] = [] - for index114 = 0 - index114 < mbt_ffi_load32(iter_base + 36) - index114 = index114 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index114 * 8 - - let result112 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array113.push(result112) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted116 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result115 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) + @types.SchemaValueNode::ListValue(array247) + } + 19 => { - Option::Some(result115) - } - _ => panic() - } + let array249 : Array[Int] = []; + for index250 = 0; index250 < (mbt_ffi_load32((iter_base) + 12)); index250 = index250 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index250 * 4) - let lifted119 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted118 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result117 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result117) - } - _ => panic() - } - - Option::Some(lifted118) - } - _ => panic() - } - - array120.push(@types.NamedFieldType::{ - name: result106, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted108, - aliases: array110, - examples: array113, - deprecated: lifted116, - role: lifted119, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array120) - } - 15 => { - let array137 : Array[@types.VariantCaseType] = [] - for index138 = 0 - index138 < mbt_ffi_load32(iter_base + 12) - index138 = index138 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index138 * 72 - - let result122 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted123 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + array249.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted125 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result124 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.SchemaValueNode::FixedListValue(array249) + } + 20 => { - Option::Some(result124) - } - _ => panic() - } - - let array127 : Array[String] = [] - for index128 = 0 - index128 < mbt_ffi_load32(iter_base + 32) - index128 = index128 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index128 * 8 - - let result126 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array127.push(result126) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array130 : Array[String] = [] - for index131 = 0 - index131 < mbt_ffi_load32(iter_base + 40) - index131 = index131 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index131 * 8 - - let result129 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array130.push(result129) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted133 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result132 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) + let array251 : Array[@types.MapEntry] = []; + for index252 = 0; index252 < (mbt_ffi_load32((iter_base) + 12)); index252 = index252 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index252 * 8) - Option::Some(result132) - } - _ => panic() - } + array251.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted136 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted135 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result134 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result134) - } - _ => panic() - } - - Option::Some(lifted135) - } - _ => panic() - } - - array137.push(@types.VariantCaseType::{ - name: result122, - payload: lifted123, - metadata: @types.MetadataEnvelope::{ - doc: lifted125, - aliases: array127, - examples: array130, - deprecated: lifted133, - role: lifted136, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array137) - } - 16 => { - let array140 : Array[String] = [] - for index141 = 0 - index141 < mbt_ffi_load32(iter_base + 12) - index141 = index141 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index141 * 8 + @types.SchemaValueNode::MapValue(array251) + } + 21 => { - let result139 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted253 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array140.push(result139) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - @types.SchemaTypeBody::EnumType(array140) - } - 17 => { - let array143 : Array[String] = [] - for index144 = 0 - index144 < mbt_ffi_load32(iter_base + 12) - index144 = index144 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index144 * 8 + @types.SchemaValueNode::OptionValue(lifted253) + } + 22 => { - let result142 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted256 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - array143.push(result142) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let lifted254 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::FlagsType(array143) - } - 18 => { - let array145 : Array[Int] = [] - for index146 = 0 - index146 < mbt_ffi_load32(iter_base + 12) - index146 = index146 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index146 * 4 - - array145.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array145) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted147 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted148 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted147, - err: lifted148, - }) - } - 24 => { - let lifted152 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array150 : Array[String] = [] - for index151 = 0 - index151 < mbt_ffi_load32(iter_base + 16) - index151 = index151 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index151 * 8 - - let result149 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array150.push(result149) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array150) - } - _ => panic() - } - - let lifted153 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted154 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted156 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result155) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted152, - min_length: lifted153, - max_length: lifted154, - regex: lifted156, - }) - } - 25 => { - let lifted160 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array158 : Array[String] = [] - for index159 = 0 - index159 < mbt_ffi_load32(iter_base + 16) - index159 = index159 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index159 * 8 - - let result157 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array158.push(result157) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array158) - } - _ => panic() - } - - let lifted161 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted162 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted160, - min_bytes: lifted161, - max_bytes: lifted162, - }) - } - 26 => { - let lifted166 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array164 : Array[String] = [] - for index165 = 0 - index165 < mbt_ffi_load32(iter_base + 20) - index165 = index165 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index165 * 8 - - let result163 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array164.push(result163) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array164) - } - _ => panic() - } - - let lifted170 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array168 : Array[String] = [] - for index169 = 0 - index169 < mbt_ffi_load32(iter_base + 32) - index169 = index169 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index169 * 8 - - let result167 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array168.push(result167) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array168) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted166, - allowed_extensions: lifted170, - }) - } - 27 => { - let lifted174 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array172 : Array[String] = [] - for index173 = 0 - index173 < mbt_ffi_load32(iter_base + 16) - index173 = index173 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index173 * 8 - - let result171 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array172.push(result171) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array172) - } - _ => panic() - } - - let lifted178 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array176 : Array[String] = [] - for index177 = 0 - index177 < mbt_ffi_load32(iter_base + 28) - index177 = index177 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index177 * 8 - - let result175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array176.push(result175) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array176) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted174, - allowed_hosts: lifted178, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result179 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array181 : Array[String] = [] - for index182 = 0 - index182 < mbt_ffi_load32(iter_base + 20) - index182 = index182 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index182 * 8 - - let result180 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array181.push(result180) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted184 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result183 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result183, - }) - } - _ => panic() - } - - let lifted186 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result185 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result185, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result179, - allowed_suffixes: array181, - min: lifted184, - max: lifted186, - }) - } - 31 => { - let array210 : Array[@types.UnionBranch] = [] - for index211 = 0 - index211 < mbt_ffi_load32(iter_base + 12) - index211 = index211 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index211 * 92 - - let result187 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted196 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result188 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - @types.DiscriminatorRule::Prefix(result188) - } - 1 => { - let result189 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.ResultValuePayload::OkValue(lifted254) + } + 1 => { - @types.DiscriminatorRule::Suffix(result189) - } - 2 => { - let result190 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let lifted255 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.DiscriminatorRule::Contains(result190) - } - 3 => { - let result191 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - @types.DiscriminatorRule::Regex(result191) - } - 4 => { - let result192 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted194 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result193 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result193) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result192, - literal: lifted194, - }) - } - 5 => { - let result195 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.ResultValuePayload::ErrValue(lifted255) + } + _ => panic() + } - @types.DiscriminatorRule::FieldAbsent(result195) - } - _ => panic() - } + @types.SchemaValueNode::ResultValue(lifted256) + } + 23 => { - let lifted198 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result197 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + let result257 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(result197) - } - _ => panic() - } - - let array200 : Array[String] = [] - for index201 = 0 - index201 < mbt_ffi_load32(iter_base + 52) - index201 = index201 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index201 * 8 - - let result199 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array200.push(result199) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array203 : Array[String] = [] - for index204 = 0 - index204 < mbt_ffi_load32(iter_base + 60) - index204 = index204 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index204 * 8 - - let result202 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array203.push(result202) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted206 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result205 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted259 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(result205) - } - _ => panic() - } + let result258 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted209 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted208 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result207 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result207) - } - _ => panic() - } - - Option::Some(lifted208) - } - _ => panic() - } - - array210.push(@types.UnionBranch::{ - tag: result187, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted196, - metadata: @types.MetadataEnvelope::{ - doc: lifted198, - aliases: array200, - examples: array203, - deprecated: lifted206, - role: lifted209, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array210, - }) - } - 32 => { - let lifted213 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result212 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result212) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted213, - }) - } - 33 => { - let lifted215 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result214 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result214) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted215, - }) - } - 34 => { - let lifted216 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted216) - } - 35 => { - let lifted217 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted217) - } - _ => panic() - } + Option::Some(result258) + } + _ => panic() + } - let lifted220 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result219 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result257, language : lifted259}) + } + 24 => { - Option::Some(result219) - } - _ => panic() - } - - let array222 : Array[String] = [] - for index223 = 0 - index223 < mbt_ffi_load32(iter_base + 104) - index223 = index223 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index223 * 8 - - let result221 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array222.push(result221) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array225 : Array[String] = [] - for index226 = 0 - index226 < mbt_ffi_load32(iter_base + 112) - index226 = index226 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index226 * 8 - - let result224 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array225.push(result224) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted228 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result227 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) + let result260 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(result227) - } - _ => panic() - } + let lifted262 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted231 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted230 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result229 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result229) - } - _ => panic() - } - - Option::Some(lifted230) - } - _ => panic() - } - - array232.push(@types.SchemaTypeNode::{ - body: lifted218, - metadata: @types.MetadataEnvelope::{ - doc: lifted220, - aliases: array222, - examples: array225, - deprecated: lifted228, - role: lifted231, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - - let array237 : Array[@types.SchemaTypeDef] = [] - for index238 = 0 - index238 < mbt_ffi_load32(result_ptr + 24) - index238 = index238 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 20) + index238 * 24 - - let result234 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted236 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result235 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + let result261 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Option::Some(result235) - } - _ => panic() - } - - array237.push(@types.SchemaTypeDef::{ - id: result234, - name: lifted236, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - - let array268 : Array[@types.SchemaValueNode] = [] - for index269 = 0 - index269 < mbt_ffi_load32(result_ptr + 36) - index269 = index269 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 32) + index269 * 32 - - let lifted267 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result239 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Option::Some(result261) + } + _ => panic() + } - @types.SchemaValueNode::StringValue(result239) - } - 13 => { - let array240 : Array[Int] = [] - for index241 = 0 - index241 < mbt_ffi_load32(iter_base + 12) - index241 = index241 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index241 * 4 + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result260, mime_type : lifted262}) + } + 25 => { - array240.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result263 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaValueNode::RecordValue(array240) - } - 14 => { - let lifted242 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted242, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array243 : Array[Bool] = [] - for index244 = 0 - index244 < mbt_ffi_load32(iter_base + 12) - index244 = index244 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index244 * 1 + @types.SchemaValueNode::PathValue(result263) + } + 26 => { - array243.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result264 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaValueNode::FlagsValue(array243) - } - 17 => { - let array245 : Array[Int] = [] - for index246 = 0 - index246 < mbt_ffi_load32(iter_base + 12) - index246 = index246 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index246 * 4 + @types.SchemaValueNode::UrlValue(result264) + } + 27 => { - array245.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - @types.SchemaValueNode::TupleValue(array245) - } - 18 => { - let array247 : Array[Int] = [] - for index248 = 0 - index248 < mbt_ffi_load32(iter_base + 12) - index248 = index248 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index248 * 4 + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - array247.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result265 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - @types.SchemaValueNode::ListValue(array247) - } - 19 => { - let array249 : Array[Int] = [] - for index250 = 0 - index250 < mbt_ffi_load32(iter_base + 12) - index250 = index250 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index250 * 4 + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result265}) + } + 30 => { - array249.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result266 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaValueNode::FixedListValue(array249) - } - 20 => { - let array251 : Array[@types.MapEntry] = [] - for index252 = 0 - index252 < mbt_ffi_load32(iter_base + 12) - index252 = index252 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index252 * 8 - - array251.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array251) - } - 21 => { - let lifted253 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result266, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - @types.SchemaValueNode::OptionValue(lifted253) - } - 22 => { - let lifted256 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted254 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - @types.ResultValuePayload::OkValue(lifted254) - } - 1 => { - let lifted255 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - @types.ResultValuePayload::ErrValue(lifted255) - } - _ => panic() - } + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } - @types.SchemaValueNode::ResultValue(lifted256) - } - 23 => { - let result257 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted259 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result258 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result258) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result257, - language: lifted259, - }) - } - 24 => { - let result260 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted262 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result261 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result261) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result260, - mime_type: lifted262, - }) - } - 25 => { - let result263 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + array268.push(lifted267) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 32)) - @types.SchemaValueNode::PathValue(result263) - } - 26 => { - let result264 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result264) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result265 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @common.AgentError::CustomError(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array232, defs : array237, root : mbt_ffi_load32((result_ptr) + 28)}, value : @types.SchemaValueTree::{value_nodes : array268, root : mbt_ffi_load32((result_ptr) + 40)}}) + } + _ => panic() + } - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result265, - }) + RpcError::RemoteAgentError(lifted270) + } + _ => panic() } - 30 => { - let result266 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result266, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array268.push(lifted267) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 32)) - - @common.AgentError::CustomError(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array232, - defs: array237, - root: mbt_ffi_load32(result_ptr + 28), - }, - value: @types.SchemaValueTree::{ - value_nodes: array268, - root: mbt_ffi_load32(result_ptr + 40), - }, - }) + + Result::Err(lifted271) } _ => panic() - } - - RpcError::RemoteAgentError(lifted270) - } - _ => panic() } - Result::Err(lifted271) - } - _ => panic() - } + lifted272 - lifted272 } - ///| /// Best-effort attempt to cancel the remote invocation by idempotency key. /// If the invocation has already started or completed, this is a no-op. pub fn FutureInvokeResult::cancel(self : FutureInvokeResult) -> Unit { - let FutureInvokeResult(handle) = self - wasmImportMethodFutureInvokeResultCancel(handle) -} + let FutureInvokeResult(handle) = self + wasmImportMethodFutureInvokeResultCancel(handle); + +} ///| /// Cancel the scheduled invocation pub fn CancellationToken::cancel(self : CancellationToken) -> Unit { - let CancellationToken(handle) = self - wasmImportMethodCancellationTokenCancel(handle) -} + let CancellationToken(handle) = self + wasmImportMethodCancellationTokenCancel(handle); + +} ///| /// Get the current value of the config key. /// @@ -30273,2708 +27085,2542 @@ pub fn CancellationToken::cancel(self : CancellationToken) -> Unit { /// component revision + overrides declared during agent creation. /// /// Getting a shared key will get the current value of the key in the environment. -pub fn get_config_value( - key : Array[String], - expected : @types.SchemaGraph, -) -> @types.SchemaValueTree { - let cleanup_list : Array[Int] = [] - - let address = mbt_ffi_malloc(key.length() * 8) - for index = 0; index < key.length(); index = index + 1 { - let iter_elem : String = key[index] - let iter_base = address + index * 8 - - let ptr = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr) - cleanup_list.push(ptr) - } - - let address360 = mbt_ffi_malloc(expected.type_nodes.length() * 144) - for index361 = 0 - index361 < expected.type_nodes.length() - index361 = index361 + 1 { - let iter_elem : @types.SchemaTypeNode = expected.type_nodes[index361] - let iter_base = address360 + index361 * 144 - - match iter_elem.body { - RefType(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store32(iter_base + 8, payload) - - () - } - BoolType => { - mbt_ffi_store8(iter_base + 0, 1) +pub fn get_config_value(key : Array[String], expected : @types.SchemaGraph) -> @types.SchemaValueTree { + let cleanup_list : Array[Int] = [] - () - } - S8Type(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - - match payload1 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let address = mbt_ffi_malloc((key).length() * 8); + for index = 0; index < (key).length(); index = index + 1 { + let iter_elem : String = (key)[(index)] + let iter_base = address + (index * 8); - () - } - Some(payload3) => { - mbt_ffi_store8(iter_base + 8, 1) + let ptr = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr) + cleanup_list.push(ptr) - match payload3.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } - () - } - Some(payload5) => { - mbt_ffi_store8(iter_base + 16, 1) + let address361 = mbt_ffi_malloc(((expected).type_nodes).length() * 144); + for index362 = 0; index362 < ((expected).type_nodes).length(); index362 = index362 + 1 { + let iter_elem : @types.SchemaTypeNode = ((expected).type_nodes)[(index362)] + let iter_base = address361 + (index362 * 144); - match payload5 { - Signed(payload6) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload6) + match (iter_elem).body { + RefType(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store32((iter_base) + 8, payload) - () + () } - Unsigned(payload7) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload7.reinterpret_as_int64(), - ) + BoolType => { + mbt_ffi_store8((iter_base) + 0, (1)) - () + () } - FloatBits(payload8) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload8.reinterpret_as_int64(), - ) + S8Type(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) - () - } - } + match (payload1) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - } + () + } + Some(payload3) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload3).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload5) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload5 { + Signed(payload6) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload6) + + () + } + Unsigned(payload7) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload7).reinterpret_as_int64()) + + () + } + FloatBits(payload8) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload8).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload3).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload10) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload10 { + Signed(payload11) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload11) + + () + } + Unsigned(payload12) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload12).reinterpret_as_int64()) + + () + } + FloatBits(payload13) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload13).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload3).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload15) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr16 = mbt_ffi_str2ptr(payload15) + mbt_ffi_store32((iter_base) + 72, payload15.length()) + mbt_ffi_store32((iter_base) + 68, ptr16) + cleanup_list.push(ptr16) + + () + } + } + + () + } + } - match payload3.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + S16Type(payload17) => { + mbt_ffi_store8((iter_base) + 0, (3)) - () - } - Some(payload10) => { - mbt_ffi_store8(iter_base + 40, 1) + match (payload17) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload10 { - Signed(payload11) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload11) + () + } + Some(payload19) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload19).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload21) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload21 { + Signed(payload22) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload22) + + () + } + Unsigned(payload23) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload23).reinterpret_as_int64()) + + () + } + FloatBits(payload24) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload24).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload19).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload26) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload26 { + Signed(payload27) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload27) + + () + } + Unsigned(payload28) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload28).reinterpret_as_int64()) + + () + } + FloatBits(payload29) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload29).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload19).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload31) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr32 = mbt_ffi_str2ptr(payload31) + mbt_ffi_store32((iter_base) + 72, payload31.length()) + mbt_ffi_store32((iter_base) + 68, ptr32) + cleanup_list.push(ptr32) + + () + } + } + + () + } + } - () + () } - Unsigned(payload12) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload12.reinterpret_as_int64(), - ) + S32Type(payload33) => { + mbt_ffi_store8((iter_base) + 0, (4)) - () - } - FloatBits(payload13) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload13.reinterpret_as_int64(), - ) + match (payload33) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - } + () + } + Some(payload35) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload35).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload37) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload37 { + Signed(payload38) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload38) + + () + } + Unsigned(payload39) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload39).reinterpret_as_int64()) + + () + } + FloatBits(payload40) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload40).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload35).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload42) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload42 { + Signed(payload43) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload43) + + () + } + Unsigned(payload44) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload44).reinterpret_as_int64()) + + () + } + FloatBits(payload45) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload45).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload35).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload47) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr48 = mbt_ffi_str2ptr(payload47) + mbt_ffi_store32((iter_base) + 72, payload47.length()) + mbt_ffi_store32((iter_base) + 68, ptr48) + cleanup_list.push(ptr48) + + () + } + } + + () + } + } - () - } - } + () + } + S64Type(payload49) => { + mbt_ffi_store8((iter_base) + 0, (5)) - match payload3.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match (payload49) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - Some(payload15) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + Some(payload51) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload51).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload53) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload53 { + Signed(payload54) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload54) + + () + } + Unsigned(payload55) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload55).reinterpret_as_int64()) + + () + } + FloatBits(payload56) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload56).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload51).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload58) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload58 { + Signed(payload59) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload59) + + () + } + Unsigned(payload60) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload60).reinterpret_as_int64()) + + () + } + FloatBits(payload61) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload61).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload51).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload63) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr64 = mbt_ffi_str2ptr(payload63) + mbt_ffi_store32((iter_base) + 72, payload63.length()) + mbt_ffi_store32((iter_base) + 68, ptr64) + cleanup_list.push(ptr64) + + () + } + } + + () + } + } - let ptr16 = mbt_ffi_str2ptr(payload15) - mbt_ffi_store32(iter_base + 72, payload15.length()) - mbt_ffi_store32(iter_base + 68, ptr16) - cleanup_list.push(ptr16) + () + } + U8Type(payload65) => { + mbt_ffi_store8((iter_base) + 0, (6)) - () - } - } + match (payload65) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - } + () + } + Some(payload67) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload67).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload69) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload69 { + Signed(payload70) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload70) + + () + } + Unsigned(payload71) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload71).reinterpret_as_int64()) + + () + } + FloatBits(payload72) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload72).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload67).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload74) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload74 { + Signed(payload75) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload75) + + () + } + Unsigned(payload76) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload76).reinterpret_as_int64()) + + () + } + FloatBits(payload77) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload77).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload67).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload79) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr80 = mbt_ffi_str2ptr(payload79) + mbt_ffi_store32((iter_base) + 72, payload79.length()) + mbt_ffi_store32((iter_base) + 68, ptr80) + cleanup_list.push(ptr80) + + () + } + } + + () + } + } - () - } - S16Type(payload17) => { - mbt_ffi_store8(iter_base + 0, 3) + () + } + U16Type(payload81) => { + mbt_ffi_store8((iter_base) + 0, (7)) - match payload17 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match (payload81) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - Some(payload19) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + Some(payload83) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload83).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload85) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload85 { + Signed(payload86) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload86) + + () + } + Unsigned(payload87) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload87).reinterpret_as_int64()) + + () + } + FloatBits(payload88) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload88).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload83).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload90) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload90 { + Signed(payload91) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload91) + + () + } + Unsigned(payload92) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload92).reinterpret_as_int64()) + + () + } + FloatBits(payload93) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload93).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload83).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload95) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr96 = mbt_ffi_str2ptr(payload95) + mbt_ffi_store32((iter_base) + 72, payload95.length()) + mbt_ffi_store32((iter_base) + 68, ptr96) + cleanup_list.push(ptr96) + + () + } + } + + () + } + } - match payload19.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + U32Type(payload97) => { + mbt_ffi_store8((iter_base) + 0, (8)) - () - } - Some(payload21) => { - mbt_ffi_store8(iter_base + 16, 1) + match (payload97) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload21 { - Signed(payload22) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload22) + () + } + Some(payload99) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload99).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload101) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload101 { + Signed(payload102) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload102) + + () + } + Unsigned(payload103) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload103).reinterpret_as_int64()) + + () + } + FloatBits(payload104) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload104).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload99).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload106) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload106 { + Signed(payload107) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload107) + + () + } + Unsigned(payload108) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload108).reinterpret_as_int64()) + + () + } + FloatBits(payload109) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload109).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload99).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload111) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr112 = mbt_ffi_str2ptr(payload111) + mbt_ffi_store32((iter_base) + 72, payload111.length()) + mbt_ffi_store32((iter_base) + 68, ptr112) + cleanup_list.push(ptr112) + + () + } + } + + () + } + } - () + () } - Unsigned(payload23) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload23.reinterpret_as_int64(), - ) + U64Type(payload113) => { + mbt_ffi_store8((iter_base) + 0, (9)) - () - } - FloatBits(payload24) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload24.reinterpret_as_int64(), - ) + match (payload113) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload115) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload115).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload117) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload117 { + Signed(payload118) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload118) + + () + } + Unsigned(payload119) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload119).reinterpret_as_int64()) + + () + } + FloatBits(payload120) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload120).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload115).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload122) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload122 { + Signed(payload123) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload123) + + () + } + Unsigned(payload124) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload124).reinterpret_as_int64()) + + () + } + FloatBits(payload125) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload125).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload115).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload127) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr128 = mbt_ffi_str2ptr(payload127) + mbt_ffi_store32((iter_base) + 72, payload127.length()) + mbt_ffi_store32((iter_base) + 68, ptr128) + cleanup_list.push(ptr128) + + () + } + } + + () + } + } - () + () } - } + F32Type(payload129) => { + mbt_ffi_store8((iter_base) + 0, (10)) - () - } - } + match (payload129) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload19.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + Some(payload131) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload131).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload133) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload133 { + Signed(payload134) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload134) + + () + } + Unsigned(payload135) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload135).reinterpret_as_int64()) + + () + } + FloatBits(payload136) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload136).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload131).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload138) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload138 { + Signed(payload139) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload139) + + () + } + Unsigned(payload140) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload140).reinterpret_as_int64()) + + () + } + FloatBits(payload141) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload141).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload131).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload143) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr144 = mbt_ffi_str2ptr(payload143) + mbt_ffi_store32((iter_base) + 72, payload143.length()) + mbt_ffi_store32((iter_base) + 68, ptr144) + cleanup_list.push(ptr144) + + () + } + } + + () + } + } - () - } - Some(payload26) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + F64Type(payload145) => { + mbt_ffi_store8((iter_base) + 0, (11)) - match payload26 { - Signed(payload27) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload27) + match (payload145) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - Unsigned(payload28) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload28.reinterpret_as_int64(), - ) + () + } + Some(payload147) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload147).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload149) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload149 { + Signed(payload150) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload150) + + () + } + Unsigned(payload151) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload151).reinterpret_as_int64()) + + () + } + FloatBits(payload152) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload152).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload147).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload154) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload154 { + Signed(payload155) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload155) + + () + } + Unsigned(payload156) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload156).reinterpret_as_int64()) + + () + } + FloatBits(payload157) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload157).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload147).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload159) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr160 = mbt_ffi_str2ptr(payload159) + mbt_ffi_store32((iter_base) + 72, payload159.length()) + mbt_ffi_store32((iter_base) + 68, ptr160) + cleanup_list.push(ptr160) + + () + } + } + + () + } + } - () + () } - FloatBits(payload29) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload29.reinterpret_as_int64(), - ) + CharType => { + mbt_ffi_store8((iter_base) + 0, (12)) - () + () } - } - - () - } - } + StringType => { + mbt_ffi_store8((iter_base) + 0, (13)) - match payload19.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload31) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + RecordType(payload163) => { + mbt_ffi_store8((iter_base) + 0, (14)) - let ptr32 = mbt_ffi_str2ptr(payload31) - mbt_ffi_store32(iter_base + 72, payload31.length()) - mbt_ffi_store32(iter_base + 68, ptr32) - cleanup_list.push(ptr32) + let address184 = mbt_ffi_malloc((payload163).length() * 68); + for index185 = 0; index185 < (payload163).length(); index185 = index185 + 1 { + let iter_elem : @types.NamedFieldType = (payload163)[(index185)] + let iter_base = address184 + (index185 * 68); - () - } - } + let ptr164 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr164) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) - () - } - } + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - S32Type(payload33) => { - mbt_ffi_store8(iter_base + 0, 4) + () + } + Some(payload166) => { + mbt_ffi_store8((iter_base) + 12, (1)) - match payload33 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr167 = mbt_ffi_str2ptr(payload166) + mbt_ffi_store32((iter_base) + 20, payload166.length()) + mbt_ffi_store32((iter_base) + 16, ptr167) + cleanup_list.push(ptr167) - () - } - Some(payload35) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + } - match payload35.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let address169 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index170 = 0; index170 < (((iter_elem).metadata).aliases).length(); index170 = index170 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index170)] + let iter_base = address169 + (index170 * 8); - () - } - Some(payload37) => { - mbt_ffi_store8(iter_base + 16, 1) + let ptr168 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr168) + cleanup_list.push(ptr168) - match payload37 { - Signed(payload38) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload38) + } + mbt_ffi_store32((iter_base) + 28, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 24, address169) - () - } - Unsigned(payload39) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload39.reinterpret_as_int64(), - ) + let address172 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index173 = 0; index173 < (((iter_elem).metadata).examples).length(); index173 = index173 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index173)] + let iter_base = address172 + (index173 * 8); - () - } - FloatBits(payload40) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload40.reinterpret_as_int64(), - ) + let ptr171 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr171) + cleanup_list.push(ptr171) - () - } - } + } + mbt_ffi_store32((iter_base) + 36, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 32, address172) - () - } - } + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) - match payload35.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + Some(payload175) => { + mbt_ffi_store8((iter_base) + 40, (1)) - () - } - Some(payload42) => { - mbt_ffi_store8(iter_base + 40, 1) + let ptr176 = mbt_ffi_str2ptr(payload175) + mbt_ffi_store32((iter_base) + 48, payload175.length()) + mbt_ffi_store32((iter_base) + 44, ptr176) + cleanup_list.push(ptr176) - match payload42 { - Signed(payload43) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload43) + () + } + } - () - } - Unsigned(payload44) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload44.reinterpret_as_int64(), - ) + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 52, (0)) + + () + } + Some(payload178) => { + mbt_ffi_store8((iter_base) + 52, (1)) + + match payload178 { + Multimodal => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 56, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 56, (2)) + + () + } + Other(payload182) => { + mbt_ffi_store8((iter_base) + 56, (3)) + + let ptr183 = mbt_ffi_str2ptr(payload182) + mbt_ffi_store32((iter_base) + 64, payload182.length()) + mbt_ffi_store32((iter_base) + 60, ptr183) + cleanup_list.push(ptr183) + + () + } + } + + () + } + } + cleanup_list.push(ptr164) + cleanup_list.push(address169) + cleanup_list.push(address172) - () - } - FloatBits(payload45) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload45.reinterpret_as_int64(), - ) + } + mbt_ffi_store32((iter_base) + 12, (payload163).length()) + mbt_ffi_store32((iter_base) + 8, address184) + cleanup_list.push(address184) - () + () } - } + VariantType(payload186) => { + mbt_ffi_store8((iter_base) + 0, (15)) - () - } - } + let address209 = mbt_ffi_malloc((payload186).length() * 72); + for index210 = 0; index210 < (payload186).length(); index210 = index210 + 1 { + let iter_elem : @types.VariantCaseType = (payload186)[(index210)] + let iter_base = address209 + (index210 * 72); - match payload35.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let ptr187 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr187) - () - } - Some(payload47) => { - mbt_ffi_store8(iter_base + 64, 1) + match ((iter_elem).payload) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - let ptr48 = mbt_ffi_str2ptr(payload47) - mbt_ffi_store32(iter_base + 72, payload47.length()) - mbt_ffi_store32(iter_base + 68, ptr48) - cleanup_list.push(ptr48) + () + } + Some(payload189) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload189) - () - } - } + () + } + } - () - } - } + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - () - } - S64Type(payload49) => { - mbt_ffi_store8(iter_base + 0, 5) + () + } + Some(payload191) => { + mbt_ffi_store8((iter_base) + 16, (1)) - match payload49 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr192 = mbt_ffi_str2ptr(payload191) + mbt_ffi_store32((iter_base) + 24, payload191.length()) + mbt_ffi_store32((iter_base) + 20, ptr192) + cleanup_list.push(ptr192) - () - } - Some(payload51) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + } - match payload51.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let address194 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index195 = 0; index195 < (((iter_elem).metadata).aliases).length(); index195 = index195 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index195)] + let iter_base = address194 + (index195 * 8); - () - } - Some(payload53) => { - mbt_ffi_store8(iter_base + 16, 1) + let ptr193 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr193) + cleanup_list.push(ptr193) - match payload53 { - Signed(payload54) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload54) + } + mbt_ffi_store32((iter_base) + 32, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 28, address194) - () - } - Unsigned(payload55) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload55.reinterpret_as_int64(), - ) + let address197 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index198 = 0; index198 < (((iter_elem).metadata).examples).length(); index198 = index198 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index198)] + let iter_base = address197 + (index198 * 8); - () - } - FloatBits(payload56) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload56.reinterpret_as_int64(), - ) + let ptr196 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr196) + cleanup_list.push(ptr196) - () - } - } + } + mbt_ffi_store32((iter_base) + 40, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 36, address197) - () - } - } + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 44, (0)) - match payload51.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + Some(payload200) => { + mbt_ffi_store8((iter_base) + 44, (1)) - () - } - Some(payload58) => { - mbt_ffi_store8(iter_base + 40, 1) + let ptr201 = mbt_ffi_str2ptr(payload200) + mbt_ffi_store32((iter_base) + 52, payload200.length()) + mbt_ffi_store32((iter_base) + 48, ptr201) + cleanup_list.push(ptr201) - match payload58 { - Signed(payload59) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload59) + () + } + } - () - } - Unsigned(payload60) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload60.reinterpret_as_int64(), - ) + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload203) => { + mbt_ffi_store8((iter_base) + 56, (1)) + + match payload203 { + Multimodal => { + mbt_ffi_store8((iter_base) + 60, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 60, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 60, (2)) + + () + } + Other(payload207) => { + mbt_ffi_store8((iter_base) + 60, (3)) + + let ptr208 = mbt_ffi_str2ptr(payload207) + mbt_ffi_store32((iter_base) + 68, payload207.length()) + mbt_ffi_store32((iter_base) + 64, ptr208) + cleanup_list.push(ptr208) + + () + } + } + + () + } + } + cleanup_list.push(ptr187) + cleanup_list.push(address194) + cleanup_list.push(address197) - () - } - FloatBits(payload61) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload61.reinterpret_as_int64(), - ) + } + mbt_ffi_store32((iter_base) + 12, (payload186).length()) + mbt_ffi_store32((iter_base) + 8, address209) + cleanup_list.push(address209) - () + () } - } - - () - } - } - - match payload51.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload63) => { - mbt_ffi_store8(iter_base + 64, 1) + EnumType(payload211) => { + mbt_ffi_store8((iter_base) + 0, (16)) - let ptr64 = mbt_ffi_str2ptr(payload63) - mbt_ffi_store32(iter_base + 72, payload63.length()) - mbt_ffi_store32(iter_base + 68, ptr64) - cleanup_list.push(ptr64) + let address213 = mbt_ffi_malloc((payload211).length() * 8); + for index214 = 0; index214 < (payload211).length(); index214 = index214 + 1 { + let iter_elem : String = (payload211)[(index214)] + let iter_base = address213 + (index214 * 8); - () - } - } + let ptr212 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr212) + cleanup_list.push(ptr212) - () - } - } + } + mbt_ffi_store32((iter_base) + 12, (payload211).length()) + mbt_ffi_store32((iter_base) + 8, address213) + cleanup_list.push(address213) - () - } - U8Type(payload65) => { - mbt_ffi_store8(iter_base + 0, 6) + () + } + FlagsType(payload215) => { + mbt_ffi_store8((iter_base) + 0, (17)) - match payload65 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let address217 = mbt_ffi_malloc((payload215).length() * 8); + for index218 = 0; index218 < (payload215).length(); index218 = index218 + 1 { + let iter_elem : String = (payload215)[(index218)] + let iter_base = address217 + (index218 * 8); - () - } - Some(payload67) => { - mbt_ffi_store8(iter_base + 8, 1) + let ptr216 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr216) + cleanup_list.push(ptr216) - match payload67.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + mbt_ffi_store32((iter_base) + 12, (payload215).length()) + mbt_ffi_store32((iter_base) + 8, address217) + cleanup_list.push(address217) - () - } - Some(payload69) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + TupleType(payload219) => { + mbt_ffi_store8((iter_base) + 0, (18)) - match payload69 { - Signed(payload70) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload70) + let address220 = mbt_ffi_malloc((payload219).length() * 4); + for index221 = 0; index221 < (payload219).length(); index221 = index221 + 1 { + let iter_elem : Int = (payload219)[(index221)] + let iter_base = address220 + (index221 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () - } - Unsigned(payload71) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload71.reinterpret_as_int64(), - ) + } + mbt_ffi_store32((iter_base) + 12, (payload219).length()) + mbt_ffi_store32((iter_base) + 8, address220) + cleanup_list.push(address220) - () + () } - FloatBits(payload72) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload72.reinterpret_as_int64(), - ) + ListType(payload222) => { + mbt_ffi_store8((iter_base) + 0, (19)) + mbt_ffi_store32((iter_base) + 8, payload222) - () + () } - } + FixedListType(payload223) => { + mbt_ffi_store8((iter_base) + 0, (20)) + mbt_ffi_store32((iter_base) + 8, (payload223).element) + mbt_ffi_store32((iter_base) + 12, ((payload223).length).reinterpret_as_int()) - () - } - } - - match payload67.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload74) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload74 { - Signed(payload75) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload75) - - () + () } - Unsigned(payload76) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload76.reinterpret_as_int64(), - ) + MapType(payload224) => { + mbt_ffi_store8((iter_base) + 0, (21)) + mbt_ffi_store32((iter_base) + 8, (payload224).key) + mbt_ffi_store32((iter_base) + 12, (payload224).value) - () + () } - FloatBits(payload77) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload77.reinterpret_as_int64(), - ) + OptionType(payload225) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store32((iter_base) + 8, payload225) - () + () } - } + ResultType(payload226) => { + mbt_ffi_store8((iter_base) + 0, (23)) - () - } - } + match ((payload226).ok) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload67.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + () + } + Some(payload228) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload228) - () - } - Some(payload79) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + } - let ptr80 = mbt_ffi_str2ptr(payload79) - mbt_ffi_store32(iter_base + 72, payload79.length()) - mbt_ffi_store32(iter_base + 68, ptr80) - cleanup_list.push(ptr80) + match ((payload226).err) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - () - } - } + () + } + Some(payload230) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload230) - () - } - } + () + } + } - () - } - U16Type(payload81) => { - mbt_ffi_store8(iter_base + 0, 7) + () + } + TextType(payload231) => { + mbt_ffi_store8((iter_base) + 0, (24)) - match payload81 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match ((payload231).languages) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - Some(payload83) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + Some(payload233) => { + mbt_ffi_store8((iter_base) + 8, (1)) - match payload83.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let address235 = mbt_ffi_malloc((payload233).length() * 8); + for index236 = 0; index236 < (payload233).length(); index236 = index236 + 1 { + let iter_elem : String = (payload233)[(index236)] + let iter_base = address235 + (index236 * 8); - () - } - Some(payload85) => { - mbt_ffi_store8(iter_base + 16, 1) + let ptr234 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr234) + cleanup_list.push(ptr234) - match payload85 { - Signed(payload86) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload86) + } + mbt_ffi_store32((iter_base) + 16, (payload233).length()) + mbt_ffi_store32((iter_base) + 12, address235) + cleanup_list.push(address235) - () - } - Unsigned(payload87) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload87.reinterpret_as_int64(), - ) + () + } + } - () - } - FloatBits(payload88) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload88.reinterpret_as_int64(), - ) + match ((payload231).min_length) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) - () - } - } + () + } + Some(payload238) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload238).reinterpret_as_int()) - () - } - } + () + } + } - match payload83.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match ((payload231).max_length) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) - () - } - Some(payload90) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + Some(payload240) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload240).reinterpret_as_int()) - match payload90 { - Signed(payload91) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload91) + () + } + } - () - } - Unsigned(payload92) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload92.reinterpret_as_int64(), - ) + match ((payload231).regex) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) - () - } - FloatBits(payload93) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload93.reinterpret_as_int64(), - ) + () + } + Some(payload242) => { + mbt_ffi_store8((iter_base) + 36, (1)) - () - } - } + let ptr243 = mbt_ffi_str2ptr(payload242) + mbt_ffi_store32((iter_base) + 44, payload242.length()) + mbt_ffi_store32((iter_base) + 40, ptr243) + cleanup_list.push(ptr243) - () - } - } + () + } + } - match payload83.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + () + } + BinaryType(payload244) => { + mbt_ffi_store8((iter_base) + 0, (25)) - () - } - Some(payload95) => { - mbt_ffi_store8(iter_base + 64, 1) + match ((payload244).mime_types) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - let ptr96 = mbt_ffi_str2ptr(payload95) - mbt_ffi_store32(iter_base + 72, payload95.length()) - mbt_ffi_store32(iter_base + 68, ptr96) - cleanup_list.push(ptr96) + () + } + Some(payload246) => { + mbt_ffi_store8((iter_base) + 8, (1)) - () - } - } + let address248 = mbt_ffi_malloc((payload246).length() * 8); + for index249 = 0; index249 < (payload246).length(); index249 = index249 + 1 { + let iter_elem : String = (payload246)[(index249)] + let iter_base = address248 + (index249 * 8); - () - } - } + let ptr247 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr247) + cleanup_list.push(ptr247) - () - } - U32Type(payload97) => { - mbt_ffi_store8(iter_base + 0, 8) + } + mbt_ffi_store32((iter_base) + 16, (payload246).length()) + mbt_ffi_store32((iter_base) + 12, address248) + cleanup_list.push(address248) - match payload97 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + } - () - } - Some(payload99) => { - mbt_ffi_store8(iter_base + 8, 1) + match ((payload244).min_bytes) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) - match payload99.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + Some(payload251) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload251).reinterpret_as_int()) - () - } - Some(payload101) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + } - match payload101 { - Signed(payload102) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload102) + match ((payload244).max_bytes) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) - () - } - Unsigned(payload103) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload103.reinterpret_as_int64(), - ) + () + } + Some(payload253) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload253).reinterpret_as_int()) - () - } - FloatBits(payload104) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload104.reinterpret_as_int64(), - ) + () + } + } - () + () } - } - - () - } - } + PathType(payload254) => { + mbt_ffi_store8((iter_base) + 0, (26)) + mbt_ffi_store8((iter_base) + 8, (payload254).direction.ordinal()) + mbt_ffi_store8((iter_base) + 9, (payload254).kind.ordinal()) - match payload99.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match ((payload254).allowed_mime_types) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - Some(payload106) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + Some(payload256) => { + mbt_ffi_store8((iter_base) + 12, (1)) - match payload106 { - Signed(payload107) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload107) + let address258 = mbt_ffi_malloc((payload256).length() * 8); + for index259 = 0; index259 < (payload256).length(); index259 = index259 + 1 { + let iter_elem : String = (payload256)[(index259)] + let iter_base = address258 + (index259 * 8); - () - } - Unsigned(payload108) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload108.reinterpret_as_int64(), - ) + let ptr257 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr257) + cleanup_list.push(ptr257) - () - } - FloatBits(payload109) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload109.reinterpret_as_int64(), - ) + } + mbt_ffi_store32((iter_base) + 20, (payload256).length()) + mbt_ffi_store32((iter_base) + 16, address258) + cleanup_list.push(address258) - () - } - } + () + } + } - () - } - } + match ((payload254).allowed_extensions) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) - match payload99.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + () + } + Some(payload261) => { + mbt_ffi_store8((iter_base) + 24, (1)) - () - } - Some(payload111) => { - mbt_ffi_store8(iter_base + 64, 1) + let address263 = mbt_ffi_malloc((payload261).length() * 8); + for index264 = 0; index264 < (payload261).length(); index264 = index264 + 1 { + let iter_elem : String = (payload261)[(index264)] + let iter_base = address263 + (index264 * 8); - let ptr112 = mbt_ffi_str2ptr(payload111) - mbt_ffi_store32(iter_base + 72, payload111.length()) - mbt_ffi_store32(iter_base + 68, ptr112) - cleanup_list.push(ptr112) + let ptr262 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr262) + cleanup_list.push(ptr262) - () - } - } + } + mbt_ffi_store32((iter_base) + 32, (payload261).length()) + mbt_ffi_store32((iter_base) + 28, address263) + cleanup_list.push(address263) - () - } - } + () + } + } - () - } - U64Type(payload113) => { - mbt_ffi_store8(iter_base + 0, 9) + () + } + UrlType(payload265) => { + mbt_ffi_store8((iter_base) + 0, (27)) - match payload113 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match ((payload265).allowed_schemes) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - Some(payload115) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + Some(payload267) => { + mbt_ffi_store8((iter_base) + 8, (1)) - match payload115.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let address269 = mbt_ffi_malloc((payload267).length() * 8); + for index270 = 0; index270 < (payload267).length(); index270 = index270 + 1 { + let iter_elem : String = (payload267)[(index270)] + let iter_base = address269 + (index270 * 8); - () - } - Some(payload117) => { - mbt_ffi_store8(iter_base + 16, 1) + let ptr268 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr268) + cleanup_list.push(ptr268) - match payload117 { - Signed(payload118) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload118) + } + mbt_ffi_store32((iter_base) + 16, (payload267).length()) + mbt_ffi_store32((iter_base) + 12, address269) + cleanup_list.push(address269) - () - } - Unsigned(payload119) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload119.reinterpret_as_int64(), - ) + () + } + } - () - } - FloatBits(payload120) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload120.reinterpret_as_int64(), - ) + match ((payload265).allowed_hosts) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) - () - } - } + () + } + Some(payload272) => { + mbt_ffi_store8((iter_base) + 20, (1)) - () - } - } + let address274 = mbt_ffi_malloc((payload272).length() * 8); + for index275 = 0; index275 < (payload272).length(); index275 = index275 + 1 { + let iter_elem : String = (payload272)[(index275)] + let iter_base = address274 + (index275 * 8); - match payload115.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let ptr273 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr273) + cleanup_list.push(ptr273) - () - } - Some(payload122) => { - mbt_ffi_store8(iter_base + 40, 1) + } + mbt_ffi_store32((iter_base) + 28, (payload272).length()) + mbt_ffi_store32((iter_base) + 24, address274) + cleanup_list.push(address274) - match payload122 { - Signed(payload123) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload123) + () + } + } - () + () } - Unsigned(payload124) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload124.reinterpret_as_int64(), - ) + DatetimeType => { + mbt_ffi_store8((iter_base) + 0, (28)) - () + () } - FloatBits(payload125) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload125.reinterpret_as_int64(), - ) + DurationType => { + mbt_ffi_store8((iter_base) + 0, (29)) - () + () } - } - - () - } - } - - match payload115.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload127) => { - mbt_ffi_store8(iter_base + 64, 1) - - let ptr128 = mbt_ffi_str2ptr(payload127) - mbt_ffi_store32(iter_base + 72, payload127.length()) - mbt_ffi_store32(iter_base + 68, ptr128) - cleanup_list.push(ptr128) - - () - } - } - - () - } - } - - () - } - F32Type(payload129) => { - mbt_ffi_store8(iter_base + 0, 10) + QuantityType(payload278) => { + mbt_ffi_store8((iter_base) + 0, (30)) - match payload129 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr279 = mbt_ffi_str2ptr((payload278).base_unit) + mbt_ffi_store32((iter_base) + 12, (payload278).base_unit.length()) + mbt_ffi_store32((iter_base) + 8, ptr279) - () - } - Some(payload131) => { - mbt_ffi_store8(iter_base + 8, 1) + let address281 = mbt_ffi_malloc(((payload278).allowed_suffixes).length() * 8); + for index282 = 0; index282 < ((payload278).allowed_suffixes).length(); index282 = index282 + 1 { + let iter_elem : String = ((payload278).allowed_suffixes)[(index282)] + let iter_base = address281 + (index282 * 8); - match payload131.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let ptr280 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr280) + cleanup_list.push(ptr280) - () - } - Some(payload133) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload133 { - Signed(payload134) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload134) + } + mbt_ffi_store32((iter_base) + 20, ((payload278).allowed_suffixes).length()) + mbt_ffi_store32((iter_base) + 16, address281) - () - } - Unsigned(payload135) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload135.reinterpret_as_int64(), - ) + match ((payload278).min) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) - () - } - FloatBits(payload136) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload136.reinterpret_as_int64(), - ) + () + } + Some(payload284) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload284).mantissa) + mbt_ffi_store32((iter_base) + 40, (payload284).scale) - () - } - } + let ptr285 = mbt_ffi_str2ptr((payload284).unit) + mbt_ffi_store32((iter_base) + 48, (payload284).unit.length()) + mbt_ffi_store32((iter_base) + 44, ptr285) + cleanup_list.push(ptr285) - () - } - } + () + } + } - match payload131.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match ((payload278).max) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) - () - } - Some(payload138) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + Some(payload287) => { + mbt_ffi_store8((iter_base) + 56, (1)) + mbt_ffi_store64((iter_base) + 64, (payload287).mantissa) + mbt_ffi_store32((iter_base) + 72, (payload287).scale) - match payload138 { - Signed(payload139) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload139) + let ptr288 = mbt_ffi_str2ptr((payload287).unit) + mbt_ffi_store32((iter_base) + 80, (payload287).unit.length()) + mbt_ffi_store32((iter_base) + 76, ptr288) + cleanup_list.push(ptr288) - () - } - Unsigned(payload140) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload140.reinterpret_as_int64(), - ) + () + } + } + cleanup_list.push(ptr279) + cleanup_list.push(address281) + + () + } + UnionType(payload289) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let address325 = mbt_ffi_malloc(((payload289).branches).length() * 92); + for index326 = 0; index326 < ((payload289).branches).length(); index326 = index326 + 1 { + let iter_elem : @types.UnionBranch = ((payload289).branches)[(index326)] + let iter_base = address325 + (index326 * 92); + + let ptr290 = mbt_ffi_str2ptr((iter_elem).tag) + mbt_ffi_store32((iter_base) + 4, (iter_elem).tag.length()) + mbt_ffi_store32((iter_base) + 0, ptr290) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (iter_elem).discriminator { + Prefix(payload291) => { + mbt_ffi_store8((iter_base) + 12, (0)) + + let ptr292 = mbt_ffi_str2ptr(payload291) + mbt_ffi_store32((iter_base) + 20, payload291.length()) + mbt_ffi_store32((iter_base) + 16, ptr292) + cleanup_list.push(ptr292) + + () + } + Suffix(payload293) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr294 = mbt_ffi_str2ptr(payload293) + mbt_ffi_store32((iter_base) + 20, payload293.length()) + mbt_ffi_store32((iter_base) + 16, ptr294) + cleanup_list.push(ptr294) + + () + } + Contains(payload295) => { + mbt_ffi_store8((iter_base) + 12, (2)) + + let ptr296 = mbt_ffi_str2ptr(payload295) + mbt_ffi_store32((iter_base) + 20, payload295.length()) + mbt_ffi_store32((iter_base) + 16, ptr296) + cleanup_list.push(ptr296) + + () + } + Regex(payload297) => { + mbt_ffi_store8((iter_base) + 12, (3)) + + let ptr298 = mbt_ffi_str2ptr(payload297) + mbt_ffi_store32((iter_base) + 20, payload297.length()) + mbt_ffi_store32((iter_base) + 16, ptr298) + cleanup_list.push(ptr298) + + () + } + FieldEquals(payload299) => { + mbt_ffi_store8((iter_base) + 12, (4)) + + let ptr300 = mbt_ffi_str2ptr((payload299).field_name) + mbt_ffi_store32((iter_base) + 20, (payload299).field_name.length()) + mbt_ffi_store32((iter_base) + 16, ptr300) + + match ((payload299).literal) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload302) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let ptr303 = mbt_ffi_str2ptr(payload302) + mbt_ffi_store32((iter_base) + 32, payload302.length()) + mbt_ffi_store32((iter_base) + 28, ptr303) + cleanup_list.push(ptr303) + + () + } + } + cleanup_list.push(ptr300) + + () + } + FieldAbsent(payload304) => { + mbt_ffi_store8((iter_base) + 12, (5)) + + let ptr305 = mbt_ffi_str2ptr(payload304) + mbt_ffi_store32((iter_base) + 20, payload304.length()) + mbt_ffi_store32((iter_base) + 16, ptr305) + cleanup_list.push(ptr305) + + () + } + } - () - } - FloatBits(payload141) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload141.reinterpret_as_int64(), - ) + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) - () - } - } + () + } + Some(payload307) => { + mbt_ffi_store8((iter_base) + 36, (1)) - () - } - } + let ptr308 = mbt_ffi_str2ptr(payload307) + mbt_ffi_store32((iter_base) + 44, payload307.length()) + mbt_ffi_store32((iter_base) + 40, ptr308) + cleanup_list.push(ptr308) - match payload131.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + () + } + } - () - } - Some(payload143) => { - mbt_ffi_store8(iter_base + 64, 1) + let address310 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index311 = 0; index311 < (((iter_elem).metadata).aliases).length(); index311 = index311 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index311)] + let iter_base = address310 + (index311 * 8); - let ptr144 = mbt_ffi_str2ptr(payload143) - mbt_ffi_store32(iter_base + 72, payload143.length()) - mbt_ffi_store32(iter_base + 68, ptr144) - cleanup_list.push(ptr144) + let ptr309 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr309) + cleanup_list.push(ptr309) - () - } - } + } + mbt_ffi_store32((iter_base) + 52, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 48, address310) - () - } - } + let address313 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index314 = 0; index314 < (((iter_elem).metadata).examples).length(); index314 = index314 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index314)] + let iter_base = address313 + (index314 * 8); - () - } - F64Type(payload145) => { - mbt_ffi_store8(iter_base + 0, 11) + let ptr312 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr312) + cleanup_list.push(ptr312) - match payload145 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + mbt_ffi_store32((iter_base) + 60, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 56, address313) - () - } - Some(payload147) => { - mbt_ffi_store8(iter_base + 8, 1) + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) - match payload147.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + Some(payload316) => { + mbt_ffi_store8((iter_base) + 64, (1)) - () - } - Some(payload149) => { - mbt_ffi_store8(iter_base + 16, 1) + let ptr317 = mbt_ffi_str2ptr(payload316) + mbt_ffi_store32((iter_base) + 72, payload316.length()) + mbt_ffi_store32((iter_base) + 68, ptr317) + cleanup_list.push(ptr317) - match payload149 { - Signed(payload150) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload150) + () + } + } - () - } - Unsigned(payload151) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload151.reinterpret_as_int64(), - ) + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 76, (0)) + + () + } + Some(payload319) => { + mbt_ffi_store8((iter_base) + 76, (1)) + + match payload319 { + Multimodal => { + mbt_ffi_store8((iter_base) + 80, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 80, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 80, (2)) + + () + } + Other(payload323) => { + mbt_ffi_store8((iter_base) + 80, (3)) + + let ptr324 = mbt_ffi_str2ptr(payload323) + mbt_ffi_store32((iter_base) + 88, payload323.length()) + mbt_ffi_store32((iter_base) + 84, ptr324) + cleanup_list.push(ptr324) + + () + } + } + + () + } + } + cleanup_list.push(ptr290) + cleanup_list.push(address310) + cleanup_list.push(address313) - () - } - FloatBits(payload152) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload152.reinterpret_as_int64(), - ) + } + mbt_ffi_store32((iter_base) + 12, ((payload289).branches).length()) + mbt_ffi_store32((iter_base) + 8, address325) + cleanup_list.push(address325) - () + () } - } - - () - } - } + SecretType(payload327) => { + mbt_ffi_store8((iter_base) + 0, (32)) + mbt_ffi_store32((iter_base) + 8, (payload327).inner) - match payload147.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match ((payload327).category) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - Some(payload154) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + Some(payload329) => { + mbt_ffi_store8((iter_base) + 12, (1)) - match payload154 { - Signed(payload155) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload155) + let ptr330 = mbt_ffi_str2ptr(payload329) + mbt_ffi_store32((iter_base) + 20, payload329.length()) + mbt_ffi_store32((iter_base) + 16, ptr330) + cleanup_list.push(ptr330) - () - } - Unsigned(payload156) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload156.reinterpret_as_int64(), - ) + () + } + } - () + () } - FloatBits(payload157) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload157.reinterpret_as_int64(), - ) + QuotaTokenType(payload331) => { + mbt_ffi_store8((iter_base) + 0, (33)) - () - } - } + match ((payload331).resource_name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - } + () + } + Some(payload333) => { + mbt_ffi_store8((iter_base) + 8, (1)) - match payload147.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let ptr334 = mbt_ffi_str2ptr(payload333) + mbt_ffi_store32((iter_base) + 16, payload333.length()) + mbt_ffi_store32((iter_base) + 12, ptr334) + cleanup_list.push(ptr334) - () - } - Some(payload159) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + } - let ptr160 = mbt_ffi_str2ptr(payload159) - mbt_ffi_store32(iter_base + 72, payload159.length()) - mbt_ffi_store32(iter_base + 68, ptr160) - cleanup_list.push(ptr160) + () + } + PermissionCardType(payload335) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store8((iter_base) + 8, (if (payload335).polymorphic { 1 } else { 0 })) - () - } - } + () + } + FutureType(payload336) => { + mbt_ffi_store8((iter_base) + 0, (35)) - () - } - } + match (payload336) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - CharType => { - mbt_ffi_store8(iter_base + 0, 12) + () + } + Some(payload338) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload338) - () - } - StringType => { - mbt_ffi_store8(iter_base + 0, 13) + () + } + } - () - } - RecordType(payload163) => { - mbt_ffi_store8(iter_base + 0, 14) - - let address184 = mbt_ffi_malloc(payload163.length() * 68) - for index185 = 0 - index185 < payload163.length() - index185 = index185 + 1 { - let iter_elem : @types.NamedFieldType = payload163[index185] - let iter_base = address184 + index185 * 68 - - let ptr164 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr164) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 12, 0) + () + } + StreamType(payload339) => { + mbt_ffi_store8((iter_base) + 0, (36)) - () - } - Some(payload166) => { - mbt_ffi_store8(iter_base + 12, 1) + match (payload339) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - let ptr167 = mbt_ffi_str2ptr(payload166) - mbt_ffi_store32(iter_base + 20, payload166.length()) - mbt_ffi_store32(iter_base + 16, ptr167) - cleanup_list.push(ptr167) + () + } + Some(payload341) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload341) - () - } - } - - let address169 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index170 = 0 - index170 < iter_elem.metadata.aliases.length() - index170 = index170 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index170] - let iter_base = address169 + index170 * 8 - - let ptr168 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr168) - cleanup_list.push(ptr168) - } - mbt_ffi_store32(iter_base + 28, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 24, address169) - - let address172 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index173 = 0 - index173 < iter_elem.metadata.examples.length() - index173 = index173 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index173] - let iter_base = address172 + index173 * 8 - - let ptr171 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr171) - cleanup_list.push(ptr171) - } - mbt_ffi_store32(iter_base + 36, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 32, address172) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + } - () + () + } } - Some(payload175) => { - mbt_ffi_store8(iter_base + 40, 1) - let ptr176 = mbt_ffi_str2ptr(payload175) - mbt_ffi_store32(iter_base + 48, payload175.length()) - mbt_ffi_store32(iter_base + 44, ptr176) - cleanup_list.push(ptr176) + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 88, (0)) - () - } - } + () + } + Some(payload343) => { + mbt_ffi_store8((iter_base) + 88, (1)) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 52, 0) + let ptr344 = mbt_ffi_str2ptr(payload343) + mbt_ffi_store32((iter_base) + 96, payload343.length()) + mbt_ffi_store32((iter_base) + 92, ptr344) + cleanup_list.push(ptr344) - () + () + } } - Some(payload178) => { - mbt_ffi_store8(iter_base + 52, 1) - - match payload178 { - Multimodal => { - mbt_ffi_store8(iter_base + 56, 0) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 56, 1) + let address346 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index347 = 0; index347 < (((iter_elem).metadata).aliases).length(); index347 = index347 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index347)] + let iter_base = address346 + (index347 * 8); - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 56, 2) + let ptr345 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr345) + cleanup_list.push(ptr345) - () - } - Other(payload182) => { - mbt_ffi_store8(iter_base + 56, 3) + } + mbt_ffi_store32((iter_base) + 104, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 100, address346) - let ptr183 = mbt_ffi_str2ptr(payload182) - mbt_ffi_store32(iter_base + 64, payload182.length()) - mbt_ffi_store32(iter_base + 60, ptr183) - cleanup_list.push(ptr183) + let address349 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index350 = 0; index350 < (((iter_elem).metadata).examples).length(); index350 = index350 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index350)] + let iter_base = address349 + (index350 * 8); - () - } - } + let ptr348 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr348) + cleanup_list.push(ptr348) - () } - } - cleanup_list.push(ptr164) - cleanup_list.push(address169) - cleanup_list.push(address172) - } - mbt_ffi_store32(iter_base + 12, payload163.length()) - mbt_ffi_store32(iter_base + 8, address184) - cleanup_list.push(address184) - - () - } - VariantType(payload186) => { - mbt_ffi_store8(iter_base + 0, 15) + mbt_ffi_store32((iter_base) + 112, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 108, address349) - let address209 = mbt_ffi_malloc(payload186.length() * 72) - for index210 = 0 - index210 < payload186.length() - index210 = index210 + 1 { - let iter_elem : @types.VariantCaseType = payload186[index210] - let iter_base = address209 + index210 * 72 - - let ptr187 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr187) + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 116, (0)) - match iter_elem.payload { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + Some(payload352) => { + mbt_ffi_store8((iter_base) + 116, (1)) - () - } - Some(payload189) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload189) + let ptr353 = mbt_ffi_str2ptr(payload352) + mbt_ffi_store32((iter_base) + 124, payload352.length()) + mbt_ffi_store32((iter_base) + 120, ptr353) + cleanup_list.push(ptr353) - () + () + } } - } - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 16, 0) + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 128, (0)) - () - } - Some(payload191) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + Some(payload355) => { + mbt_ffi_store8((iter_base) + 128, (1)) - let ptr192 = mbt_ffi_str2ptr(payload191) - mbt_ffi_store32(iter_base + 24, payload191.length()) - mbt_ffi_store32(iter_base + 20, ptr192) - cleanup_list.push(ptr192) + match payload355 { + Multimodal => { + mbt_ffi_store8((iter_base) + 132, (0)) - () - } - } - - let address194 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index195 = 0 - index195 < iter_elem.metadata.aliases.length() - index195 = index195 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index195] - let iter_base = address194 + index195 * 8 - - let ptr193 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr193) - cleanup_list.push(ptr193) - } - mbt_ffi_store32(iter_base + 32, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 28, address194) - - let address197 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index198 = 0 - index198 < iter_elem.metadata.examples.length() - index198 = index198 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index198] - let iter_base = address197 + index198 * 8 - - let ptr196 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr196) - cleanup_list.push(ptr196) - } - mbt_ffi_store32(iter_base + 40, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 36, address197) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 44, 0) + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 132, (1)) - () - } - Some(payload200) => { - mbt_ffi_store8(iter_base + 44, 1) + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 132, (2)) - let ptr201 = mbt_ffi_str2ptr(payload200) - mbt_ffi_store32(iter_base + 52, payload200.length()) - mbt_ffi_store32(iter_base + 48, ptr201) - cleanup_list.push(ptr201) + () + } + Other(payload359) => { + mbt_ffi_store8((iter_base) + 132, (3)) - () - } - } + let ptr360 = mbt_ffi_str2ptr(payload359) + mbt_ffi_store32((iter_base) + 140, payload359.length()) + mbt_ffi_store32((iter_base) + 136, ptr360) + cleanup_list.push(ptr360) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 56, 0) + () + } + } - () + () + } } - Some(payload203) => { - mbt_ffi_store8(iter_base + 56, 1) + cleanup_list.push(address346) + cleanup_list.push(address349) - match payload203 { - Multimodal => { - mbt_ffi_store8(iter_base + 60, 0) + } - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 60, 1) + let address367 = mbt_ffi_malloc(((expected).defs).length() * 24); + for index368 = 0; index368 < ((expected).defs).length(); index368 = index368 + 1 { + let iter_elem : @types.SchemaTypeDef = ((expected).defs)[(index368)] + let iter_base = address367 + (index368 * 24); - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 60, 2) + let ptr363 = mbt_ffi_str2ptr((iter_elem).id) + mbt_ffi_store32((iter_base) + 4, (iter_elem).id.length()) + mbt_ffi_store32((iter_base) + 0, ptr363) - () - } - Other(payload207) => { - mbt_ffi_store8(iter_base + 60, 3) + match ((iter_elem).name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - let ptr208 = mbt_ffi_str2ptr(payload207) - mbt_ffi_store32(iter_base + 68, payload207.length()) - mbt_ffi_store32(iter_base + 64, ptr208) - cleanup_list.push(ptr208) + () + } + Some(payload365) => { + mbt_ffi_store8((iter_base) + 8, (1)) - () - } - } + let ptr366 = mbt_ffi_str2ptr(payload365) + mbt_ffi_store32((iter_base) + 16, payload365.length()) + mbt_ffi_store32((iter_base) + 12, ptr366) + cleanup_list.push(ptr366) - () + () + } } - } - cleanup_list.push(ptr187) - cleanup_list.push(address194) - cleanup_list.push(address197) - } - mbt_ffi_store32(iter_base + 12, payload186.length()) - mbt_ffi_store32(iter_base + 8, address209) - cleanup_list.push(address209) - - () - } - EnumType(payload211) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address213 = mbt_ffi_malloc(payload211.length() * 8) - for index214 = 0 - index214 < payload211.length() - index214 = index214 + 1 { - let iter_elem : String = payload211[index214] - let iter_base = address213 + index214 * 8 - - let ptr212 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr212) - cleanup_list.push(ptr212) - } - mbt_ffi_store32(iter_base + 12, payload211.length()) - mbt_ffi_store32(iter_base + 8, address213) - cleanup_list.push(address213) - - () - } - FlagsType(payload215) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address217 = mbt_ffi_malloc(payload215.length() * 8) - for index218 = 0 - index218 < payload215.length() - index218 = index218 + 1 { - let iter_elem : String = payload215[index218] - let iter_base = address217 + index218 * 8 - - let ptr216 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr216) - cleanup_list.push(ptr216) - } - mbt_ffi_store32(iter_base + 12, payload215.length()) - mbt_ffi_store32(iter_base + 8, address217) - cleanup_list.push(address217) - - () - } - TupleType(payload219) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address220 = mbt_ffi_malloc(payload219.length() * 4) - for index221 = 0 - index221 < payload219.length() - index221 = index221 + 1 { - let iter_elem : Int = payload219[index221] - let iter_base = address220 + index221 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload219.length()) - mbt_ffi_store32(iter_base + 8, address220) - cleanup_list.push(address220) - - () - } - ListType(payload222) => { - mbt_ffi_store8(iter_base + 0, 19) - mbt_ffi_store32(iter_base + 8, payload222) + mbt_ffi_store32((iter_base) + 20, (iter_elem).body) + cleanup_list.push(ptr363) - () } - FixedListType(payload223) => { - mbt_ffi_store8(iter_base + 0, 20) - mbt_ffi_store32(iter_base + 8, payload223.element) - mbt_ffi_store32(iter_base + 12, payload223.length.reinterpret_as_int()) + let return_area = mbt_ffi_malloc(12) + wasmImportGetConfigValue(address, (key).length(), address361, ((expected).type_nodes).length(), address367, ((expected).defs).length(), (expected).root, return_area); - () - } - MapType(payload224) => { - mbt_ffi_store8(iter_base + 0, 21) - mbt_ffi_store32(iter_base + 8, payload224.key) - mbt_ffi_store32(iter_base + 12, payload224.value) + let array395 : Array[@types.SchemaValueNode] = []; + for index396 = 0; index396 < (mbt_ffi_load32((return_area) + 4)); index396 = index396 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index396 * 32) - () - } - OptionType(payload225) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store32(iter_base + 8, payload225) + let lifted394 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - ResultType(payload226) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload226.ok { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload228) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload228) - - () - } - } - - match payload226.err { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload230) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload230) - - () - } - } - - () - } - TextType(payload231) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload231.languages { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload233) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address235 = mbt_ffi_malloc(payload233.length() * 8) - for index236 = 0 - index236 < payload233.length() - index236 = index236 + 1 { - let iter_elem : String = payload233[index236] - let iter_base = address235 + index236 * 8 - - let ptr234 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr234) - cleanup_list.push(ptr234) - } - mbt_ffi_store32(iter_base + 16, payload233.length()) - mbt_ffi_store32(iter_base + 12, address235) - cleanup_list.push(address235) - - () - } - } - - match payload231.min_length { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload238) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload238.reinterpret_as_int()) - - () - } - } - - match payload231.max_length { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload240) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload240.reinterpret_as_int()) - - () - } - } - - match payload231.regex { - None => { - mbt_ffi_store8(iter_base + 36, 0) - - () - } - Some(payload242) => { - mbt_ffi_store8(iter_base + 36, 1) - - let ptr243 = mbt_ffi_str2ptr(payload242) - mbt_ffi_store32(iter_base + 44, payload242.length()) - mbt_ffi_store32(iter_base + 40, ptr243) - cleanup_list.push(ptr243) - - () - } - } - - () - } - BinaryType(payload244) => { - mbt_ffi_store8(iter_base + 0, 25) - - match payload244.mime_types { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload246) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address248 = mbt_ffi_malloc(payload246.length() * 8) - for index249 = 0 - index249 < payload246.length() - index249 = index249 + 1 { - let iter_elem : String = payload246[index249] - let iter_base = address248 + index249 * 8 - - let ptr247 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr247) - cleanup_list.push(ptr247) - } - mbt_ffi_store32(iter_base + 16, payload246.length()) - mbt_ffi_store32(iter_base + 12, address248) - cleanup_list.push(address248) - - () - } - } - - match payload244.min_bytes { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload251) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload251.reinterpret_as_int()) - - () - } - } - - match payload244.max_bytes { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload253) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload253.reinterpret_as_int()) - - () - } - } - - () - } - PathType(payload254) => { - mbt_ffi_store8(iter_base + 0, 26) - mbt_ffi_store8(iter_base + 8, payload254.direction.ordinal()) - mbt_ffi_store8(iter_base + 9, payload254.kind.ordinal()) - - match payload254.allowed_mime_types { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload256) => { - mbt_ffi_store8(iter_base + 12, 1) - - let address258 = mbt_ffi_malloc(payload256.length() * 8) - for index259 = 0 - index259 < payload256.length() - index259 = index259 + 1 { - let iter_elem : String = payload256[index259] - let iter_base = address258 + index259 * 8 - - let ptr257 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr257) - cleanup_list.push(ptr257) - } - mbt_ffi_store32(iter_base + 20, payload256.length()) - mbt_ffi_store32(iter_base + 16, address258) - cleanup_list.push(address258) - - () - } - } - - match payload254.allowed_extensions { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload261) => { - mbt_ffi_store8(iter_base + 24, 1) - - let address263 = mbt_ffi_malloc(payload261.length() * 8) - for index264 = 0 - index264 < payload261.length() - index264 = index264 + 1 { - let iter_elem : String = payload261[index264] - let iter_base = address263 + index264 * 8 - - let ptr262 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr262) - cleanup_list.push(ptr262) - } - mbt_ffi_store32(iter_base + 32, payload261.length()) - mbt_ffi_store32(iter_base + 28, address263) - cleanup_list.push(address263) + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - () - } - } + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - () - } - UrlType(payload265) => { - mbt_ffi_store8(iter_base + 0, 27) - - match payload265.allowed_schemes { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload267) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address269 = mbt_ffi_malloc(payload267.length() * 8) - for index270 = 0 - index270 < payload267.length() - index270 = index270 + 1 { - let iter_elem : String = payload267[index270] - let iter_base = address269 + index270 * 8 - - let ptr268 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr268) - cleanup_list.push(ptr268) - } - mbt_ffi_store32(iter_base + 16, payload267.length()) - mbt_ffi_store32(iter_base + 12, address269) - cleanup_list.push(address269) - - () - } - } - - match payload265.allowed_hosts { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload272) => { - mbt_ffi_store8(iter_base + 20, 1) - - let address274 = mbt_ffi_malloc(payload272.length() * 8) - for index275 = 0 - index275 < payload272.length() - index275 = index275 + 1 { - let iter_elem : String = payload272[index275] - let iter_base = address274 + index275 * 8 - - let ptr273 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr273) - cleanup_list.push(ptr273) - } - mbt_ffi_store32(iter_base + 28, payload272.length()) - mbt_ffi_store32(iter_base + 24, address274) - cleanup_list.push(address274) + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - () - } - } + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - () - } - DatetimeType => { - mbt_ffi_store8(iter_base + 0, 28) + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - () - } - DurationType => { - mbt_ffi_store8(iter_base + 0, 29) + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - () - } - QuantityType(payload278) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr279 = mbt_ffi_str2ptr(payload278.base_unit) - mbt_ffi_store32(iter_base + 12, payload278.base_unit.length()) - mbt_ffi_store32(iter_base + 8, ptr279) - - let address281 = mbt_ffi_malloc( - payload278.allowed_suffixes.length() * 8, - ) - for index282 = 0 - index282 < payload278.allowed_suffixes.length() - index282 = index282 + 1 { - let iter_elem : String = payload278.allowed_suffixes[index282] - let iter_base = address281 + index282 * 8 - - let ptr280 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr280) - cleanup_list.push(ptr280) - } - mbt_ffi_store32(iter_base + 20, payload278.allowed_suffixes.length()) - mbt_ffi_store32(iter_base + 16, address281) - - match payload278.min { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload284) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload284.mantissa) - mbt_ffi_store32(iter_base + 40, payload284.scale) - - let ptr285 = mbt_ffi_str2ptr(payload284.unit) - mbt_ffi_store32(iter_base + 48, payload284.unit.length()) - mbt_ffi_store32(iter_base + 44, ptr285) - cleanup_list.push(ptr285) - - () - } - } - - match payload278.max { - None => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - Some(payload287) => { - mbt_ffi_store8(iter_base + 56, 1) - mbt_ffi_store64(iter_base + 64, payload287.mantissa) - mbt_ffi_store32(iter_base + 72, payload287.scale) - - let ptr288 = mbt_ffi_str2ptr(payload287.unit) - mbt_ffi_store32(iter_base + 80, payload287.unit.length()) - mbt_ffi_store32(iter_base + 76, ptr288) - cleanup_list.push(ptr288) - - () - } - } - cleanup_list.push(ptr279) - cleanup_list.push(address281) - - () - } - UnionType(payload289) => { - mbt_ffi_store8(iter_base + 0, 31) - - let address325 = mbt_ffi_malloc(payload289.branches.length() * 92) - for index326 = 0 - index326 < payload289.branches.length() - index326 = index326 + 1 { - let iter_elem : @types.UnionBranch = payload289.branches[index326] - let iter_base = address325 + index326 * 92 - - let ptr290 = mbt_ffi_str2ptr(iter_elem.tag) - mbt_ffi_store32(iter_base + 4, iter_elem.tag.length()) - mbt_ffi_store32(iter_base + 0, ptr290) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.discriminator { - Prefix(payload291) => { - mbt_ffi_store8(iter_base + 12, 0) - - let ptr292 = mbt_ffi_str2ptr(payload291) - mbt_ffi_store32(iter_base + 20, payload291.length()) - mbt_ffi_store32(iter_base + 16, ptr292) - cleanup_list.push(ptr292) - - () - } - Suffix(payload293) => { - mbt_ffi_store8(iter_base + 12, 1) + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - let ptr294 = mbt_ffi_str2ptr(payload293) - mbt_ffi_store32(iter_base + 20, payload293.length()) - mbt_ffi_store32(iter_base + 16, ptr294) - cleanup_list.push(ptr294) + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - () - } - Contains(payload295) => { - mbt_ffi_store8(iter_base + 12, 2) + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - let ptr296 = mbt_ffi_str2ptr(payload295) - mbt_ffi_store32(iter_base + 20, payload295.length()) - mbt_ffi_store32(iter_base + 16, ptr296) - cleanup_list.push(ptr296) + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - () - } - Regex(payload297) => { - mbt_ffi_store8(iter_base + 12, 3) + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - let ptr298 = mbt_ffi_str2ptr(payload297) - mbt_ffi_store32(iter_base + 20, payload297.length()) - mbt_ffi_store32(iter_base + 16, ptr298) - cleanup_list.push(ptr298) + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - () - } - FieldEquals(payload299) => { - mbt_ffi_store8(iter_base + 12, 4) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr300 = mbt_ffi_str2ptr(payload299.field_name) - mbt_ffi_store32(iter_base + 20, payload299.field_name.length()) - mbt_ffi_store32(iter_base + 16, ptr300) + @types.SchemaValueNode::StringValue(result) + } + 13 => { - match payload299.literal { - None => { - mbt_ffi_store8(iter_base + 24, 0) + let array : Array[Int] = []; + for index369 = 0; index369 < (mbt_ffi_load32((iter_base) + 12)); index369 = index369 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index369 * 4) - () - } - Some(payload302) => { - mbt_ffi_store8(iter_base + 24, 1) + array.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let ptr303 = mbt_ffi_str2ptr(payload302) - mbt_ffi_store32(iter_base + 32, payload302.length()) - mbt_ffi_store32(iter_base + 28, ptr303) - cleanup_list.push(ptr303) + @types.SchemaValueNode::RecordValue(array) + } + 14 => { - () - } - } - cleanup_list.push(ptr300) + let lifted : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - FieldAbsent(payload304) => { - mbt_ffi_store8(iter_base + 12, 5) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let ptr305 = mbt_ffi_str2ptr(payload304) - mbt_ffi_store32(iter_base + 20, payload304.length()) - mbt_ffi_store32(iter_base + 16, ptr305) - cleanup_list.push(ptr305) + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted}) + } + 15 => { - () - } - } + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 36, 0) + let array370 : Array[Bool] = []; + for index371 = 0; index371 < (mbt_ffi_load32((iter_base) + 12)); index371 = index371 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index371 * 1) - () - } - Some(payload307) => { - mbt_ffi_store8(iter_base + 36, 1) + array370.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let ptr308 = mbt_ffi_str2ptr(payload307) - mbt_ffi_store32(iter_base + 44, payload307.length()) - mbt_ffi_store32(iter_base + 40, ptr308) - cleanup_list.push(ptr308) + @types.SchemaValueNode::FlagsValue(array370) + } + 17 => { - () - } - } - - let address310 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index311 = 0 - index311 < iter_elem.metadata.aliases.length() - index311 = index311 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index311] - let iter_base = address310 + index311 * 8 - - let ptr309 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr309) - cleanup_list.push(ptr309) - } - mbt_ffi_store32(iter_base + 52, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 48, address310) - - let address313 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index314 = 0 - index314 < iter_elem.metadata.examples.length() - index314 = index314 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index314] - let iter_base = address313 + index314 * 8 - - let ptr312 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr312) - cleanup_list.push(ptr312) - } - mbt_ffi_store32(iter_base + 60, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 56, address313) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let array372 : Array[Int] = []; + for index373 = 0; index373 < (mbt_ffi_load32((iter_base) + 12)); index373 = index373 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index373 * 4) - () - } - Some(payload316) => { - mbt_ffi_store8(iter_base + 64, 1) + array372.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let ptr317 = mbt_ffi_str2ptr(payload316) - mbt_ffi_store32(iter_base + 72, payload316.length()) - mbt_ffi_store32(iter_base + 68, ptr317) - cleanup_list.push(ptr317) + @types.SchemaValueNode::TupleValue(array372) + } + 18 => { - () - } - } + let array374 : Array[Int] = []; + for index375 = 0; index375 < (mbt_ffi_load32((iter_base) + 12)); index375 = index375 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index375 * 4) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 76, 0) + array374.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Some(payload319) => { - mbt_ffi_store8(iter_base + 76, 1) + @types.SchemaValueNode::ListValue(array374) + } + 19 => { - match payload319 { - Multimodal => { - mbt_ffi_store8(iter_base + 80, 0) + let array376 : Array[Int] = []; + for index377 = 0; index377 < (mbt_ffi_load32((iter_base) + 12)); index377 = index377 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index377 * 4) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 80, 1) + array376.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 80, 2) + @types.SchemaValueNode::FixedListValue(array376) + } + 20 => { - () - } - Other(payload323) => { - mbt_ffi_store8(iter_base + 80, 3) + let array378 : Array[@types.MapEntry] = []; + for index379 = 0; index379 < (mbt_ffi_load32((iter_base) + 12)); index379 = index379 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index379 * 8) - let ptr324 = mbt_ffi_str2ptr(payload323) - mbt_ffi_store32(iter_base + 88, payload323.length()) - mbt_ffi_store32(iter_base + 84, ptr324) - cleanup_list.push(ptr324) + array378.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } + @types.SchemaValueNode::MapValue(array378) + } + 21 => { - () - } - } - cleanup_list.push(ptr290) - cleanup_list.push(address310) - cleanup_list.push(address313) - } - mbt_ffi_store32(iter_base + 12, payload289.branches.length()) - mbt_ffi_store32(iter_base + 8, address325) - cleanup_list.push(address325) - - () - } - SecretType(payload327) => { - mbt_ffi_store8(iter_base + 0, 32) - mbt_ffi_store32(iter_base + 8, payload327.inner) + let lifted380 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload327.category { - None => { - mbt_ffi_store8(iter_base + 12, 0) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - () - } - Some(payload329) => { - mbt_ffi_store8(iter_base + 12, 1) + @types.SchemaValueNode::OptionValue(lifted380) + } + 22 => { - let ptr330 = mbt_ffi_str2ptr(payload329) - mbt_ffi_store32(iter_base + 20, payload329.length()) - mbt_ffi_store32(iter_base + 16, ptr330) - cleanup_list.push(ptr330) + let lifted383 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - () - } - } + let lifted381 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - QuotaTokenType(payload331) => { - mbt_ffi_store8(iter_base + 0, 33) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - match payload331.resource_name { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.ResultValuePayload::OkValue(lifted381) + } + 1 => { - () - } - Some(payload333) => { - mbt_ffi_store8(iter_base + 8, 1) + let lifted382 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let ptr334 = mbt_ffi_str2ptr(payload333) - mbt_ffi_store32(iter_base + 16, payload333.length()) - mbt_ffi_store32(iter_base + 12, ptr334) - cleanup_list.push(ptr334) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - () - } - } + @types.ResultValuePayload::ErrValue(lifted382) + } + _ => panic() + } - () - } - FutureType(payload335) => { - mbt_ffi_store8(iter_base + 0, 34) + @types.SchemaValueNode::ResultValue(lifted383) + } + 23 => { - match payload335 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let result384 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Some(payload337) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload337) + let lifted386 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - } + let result385 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - StreamType(payload338) => { - mbt_ffi_store8(iter_base + 0, 35) + Option::Some(result385) + } + _ => panic() + } - match payload338 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result384, language : lifted386}) + } + 24 => { - () - } - Some(payload340) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload340) + let result387 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } + let lifted389 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - } + let result388 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 88, 0) + Option::Some(result388) + } + _ => panic() + } - () - } - Some(payload342) => { - mbt_ffi_store8(iter_base + 88, 1) + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result387, mime_type : lifted389}) + } + 25 => { - let ptr343 = mbt_ffi_str2ptr(payload342) - mbt_ffi_store32(iter_base + 96, payload342.length()) - mbt_ffi_store32(iter_base + 92, ptr343) - cleanup_list.push(ptr343) + let result390 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } - - let address345 = mbt_ffi_malloc(iter_elem.metadata.aliases.length() * 8) - for index346 = 0 - index346 < iter_elem.metadata.aliases.length() - index346 = index346 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index346] - let iter_base = address345 + index346 * 8 - - let ptr344 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr344) - cleanup_list.push(ptr344) - } - mbt_ffi_store32(iter_base + 104, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 100, address345) - - let address348 = mbt_ffi_malloc(iter_elem.metadata.examples.length() * 8) - for index349 = 0 - index349 < iter_elem.metadata.examples.length() - index349 = index349 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index349] - let iter_base = address348 + index349 * 8 - - let ptr347 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr347) - cleanup_list.push(ptr347) - } - mbt_ffi_store32(iter_base + 112, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 108, address348) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 116, 0) - - () - } - Some(payload351) => { - mbt_ffi_store8(iter_base + 116, 1) + @types.SchemaValueNode::PathValue(result390) + } + 26 => { - let ptr352 = mbt_ffi_str2ptr(payload351) - mbt_ffi_store32(iter_base + 124, payload351.length()) - mbt_ffi_store32(iter_base + 120, ptr352) - cleanup_list.push(ptr352) + let result391 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } + @types.SchemaValueNode::UrlValue(result391) + } + 27 => { - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 128, 0) + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - () - } - Some(payload354) => { - mbt_ffi_store8(iter_base + 128, 1) - - match payload354 { - Multimodal => { - mbt_ffi_store8(iter_base + 132, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 132, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 132, 2) - - () - } - Other(payload358) => { - mbt_ffi_store8(iter_base + 132, 3) - - let ptr359 = mbt_ffi_str2ptr(payload358) - mbt_ffi_store32(iter_base + 140, payload358.length()) - mbt_ffi_store32(iter_base + 136, ptr359) - cleanup_list.push(ptr359) - - () - } - } - - () - } - } - cleanup_list.push(address345) - cleanup_list.push(address348) - } + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - let address366 = mbt_ffi_malloc(expected.defs.length() * 24) - for index367 = 0; index367 < expected.defs.length(); index367 = index367 + 1 { - let iter_elem : @types.SchemaTypeDef = expected.defs[index367] - let iter_base = address366 + index367 * 24 + let result392 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let ptr362 = mbt_ffi_str2ptr(iter_elem.id) - mbt_ffi_store32(iter_base + 4, iter_elem.id.length()) - mbt_ffi_store32(iter_base + 0, ptr362) + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result392}) + } + 30 => { - match iter_elem.name { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let result393 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Some(payload364) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result393, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - let ptr365 = mbt_ffi_str2ptr(payload364) - mbt_ffi_store32(iter_base + 16, payload364.length()) - mbt_ffi_store32(iter_base + 12, ptr365) - cleanup_list.push(ptr365) + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - () - } - } - mbt_ffi_store32(iter_base + 20, iter_elem.body) - cleanup_list.push(ptr362) - } - let return_area = mbt_ffi_malloc(12) - wasmImportGetConfigValue( - address, - key.length(), - address360, - expected.type_nodes.length(), - address366, - expected.defs.length(), - expected.root, - return_area, - ) - - let array394 : Array[@types.SchemaValueNode] = [] - for index395 = 0 - index395 < mbt_ffi_load32(return_area + 4) - index395 = index395 + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index395 * 32 - - let lifted393 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue(mbt_ffi_load8_u(iter_base + 8) != 0) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8).land(0xFFFF).reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result) - } - 13 => { - let array : Array[Int] = [] - for index368 = 0 - index368 < mbt_ffi_load32(iter_base + 12) - index368 = index368 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index368 * 4 - - array.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array) - } - 14 => { - let lifted : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array369 : Array[Bool] = [] - for index370 = 0 - index370 < mbt_ffi_load32(iter_base + 12) - index370 = index370 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index370 * 1 - - array369.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array369) - } - 17 => { - let array371 : Array[Int] = [] - for index372 = 0 - index372 < mbt_ffi_load32(iter_base + 12) - index372 = index372 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index372 * 4 - - array371.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array371) - } - 18 => { - let array373 : Array[Int] = [] - for index374 = 0 - index374 < mbt_ffi_load32(iter_base + 12) - index374 = index374 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index374 * 4 - - array373.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array373) - } - 19 => { - let array375 : Array[Int] = [] - for index376 = 0 - index376 < mbt_ffi_load32(iter_base + 12) - index376 = index376 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index376 * 4 - - array375.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array375) - } - 20 => { - let array377 : Array[@types.MapEntry] = [] - for index378 = 0 - index378 < mbt_ffi_load32(iter_base + 12) - index378 = index378 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index378 * 8 - - array377.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array377) - } - 21 => { - let lifted379 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted379) - } - 22 => { - let lifted382 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted380 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - @types.ResultValuePayload::OkValue(lifted380) - } - 1 => { - let lifted381 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() } - @types.ResultValuePayload::ErrValue(lifted381) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted382) - } - 23 => { - let result383 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted385 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result384 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result384) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result383, - language: lifted385, - }) + array395.push(lifted394) } - 24 => { - let result386 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted388 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result387 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result387) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result386, - mime_type: lifted388, - }) - } - 25 => { - let result389 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = @types.SchemaValueTree::{value_nodes : array395, root : mbt_ffi_load32((return_area) + 8)} + mbt_ffi_free(address) + mbt_ffi_free(address361) + mbt_ffi_free(address367) + mbt_ffi_free(return_area) - @types.SchemaValueNode::PathValue(result389) - } - 26 => { - let result390 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + cleanup_list.each(mbt_ffi_free) + return ret - @types.SchemaValueNode::UrlValue(result390) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result391 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result391, - }) - } - 30 => { - let result392 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result392, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } - - array394.push(lifted393) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = @types.SchemaValueTree::{ - value_nodes: array394, - root: mbt_ffi_load32(return_area + 8), - } - mbt_ffi_free(address) - mbt_ffi_free(address360) - mbt_ffi_free(address366) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/api/context/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/api/context/ffi.mbt index 65d2535283..c8be433ecf 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/api/context/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/api/context/ffi.mbt @@ -1,113 +1,79 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropSpan(resource : Int) = "golem:api/context@1.5.0" "[resource-drop]span" -///| fn wasmImportResourceDropInvocationContext(resource : Int) = "golem:api/context@1.5.0" "[resource-drop]invocation-context" -///| fn wasmImportStartSpan(p0 : Int, p1 : Int) -> Int = "golem:api/context@1.5.0" "start-span" -///| fn wasmImportCurrentContext() -> Int = "golem:api/context@1.5.0" "current-context" -///| fn wasmImportAllowForwardingTraceContextHeaders(p0 : Int) -> Int = "golem:api/context@1.5.0" "allow-forwarding-trace-context-headers" -///| -fn wasmImportMethodSpanStartedAt(p0 : Int, p1 : Int) = "golem:api/context@1.5.0" "[method]span.started-at" +fn wasmImportMethodSpanStartedAt(p0 : Int, p1 : Int) = "golem:api/context@1.5.0" "[method]span.started-at" -///| -fn wasmImportMethodSpanSetAttribute( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:api/context@1.5.0" "[method]span.set-attribute" +fn wasmImportMethodSpanSetAttribute(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:api/context@1.5.0" "[method]span.set-attribute" -///| -fn wasmImportMethodSpanSetAttributes(p0 : Int, p1 : Int, p2 : Int) = "golem:api/context@1.5.0" "[method]span.set-attributes" +fn wasmImportMethodSpanSetAttributes(p0 : Int, p1 : Int, p2 : Int) = "golem:api/context@1.5.0" "[method]span.set-attributes" -///| -fn wasmImportMethodSpanFinish(p0 : Int) = "golem:api/context@1.5.0" "[method]span.finish" +fn wasmImportMethodSpanFinish(p0 : Int) = "golem:api/context@1.5.0" "[method]span.finish" -///| -fn wasmImportMethodInvocationContextTraceId(p0 : Int, p1 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.trace-id" - -///| -fn wasmImportMethodInvocationContextSpanId(p0 : Int, p1 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.span-id" +fn wasmImportMethodInvocationContextTraceId(p0 : Int, p1 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.trace-id" -///| -fn wasmImportMethodInvocationContextParent(p0 : Int, p1 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.parent" +fn wasmImportMethodInvocationContextSpanId(p0 : Int, p1 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.span-id" -///| -fn wasmImportMethodInvocationContextGetAttribute( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, -) = "golem:api/context@1.5.0" "[method]invocation-context.get-attribute" +fn wasmImportMethodInvocationContextParent(p0 : Int, p1 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.parent" -///| -fn wasmImportMethodInvocationContextGetAttributes(p0 : Int, p1 : Int, p2 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.get-attributes" +fn wasmImportMethodInvocationContextGetAttribute(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.get-attribute" -///| -fn wasmImportMethodInvocationContextGetAttributeChain( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, -) = "golem:api/context@1.5.0" "[method]invocation-context.get-attribute-chain" +fn wasmImportMethodInvocationContextGetAttributes(p0 : Int, p1 : Int, p2 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.get-attributes" -///| -fn wasmImportMethodInvocationContextGetAttributeChains(p0 : Int, p1 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.get-attribute-chains" +fn wasmImportMethodInvocationContextGetAttributeChain(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.get-attribute-chain" -///| -fn wasmImportMethodInvocationContextTraceContextHeaders(p0 : Int, p1 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.trace-context-headers" +fn wasmImportMethodInvocationContextGetAttributeChains(p0 : Int, p1 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.get-attribute-chains" -///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +fn wasmImportMethodInvocationContextTraceContextHeaders(p0 : Int, p1 : Int) = "golem:api/context@1.5.0" "[method]invocation-context.trace-context-headers" ///| #owned(str) extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) + +///| +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/api/context/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/api/context/top.mbt index d4ee364572..9cb82a6ecd 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/api/context/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/api/context/top.mbt @@ -1,446 +1,369 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Represents a unit of work or operation pub(all) struct Span(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Span::drop(self : Span) -> Unit { - let Span(resource) = self - wasmImportResourceDropSpan(resource) + let Span(resource) = self + wasmImportResourceDropSpan(resource) } - ///| /// Represents an invocation context wich allows querying the stack of attributes /// created by automatic and user-defined spans. pub(all) struct InvocationContext(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn InvocationContext::drop(self : InvocationContext) -> Unit { - let InvocationContext(resource) = self - wasmImportResourceDropInvocationContext(resource) + let InvocationContext(resource) = self + wasmImportResourceDropInvocationContext(resource) } - ///| /// Possible span attribute value types pub(all) enum AttributeValue { - String(String) + String(String) } derive(Show, Eq) - ///| /// An attribute of a span pub(all) struct Attribute { - key : String - value : AttributeValue + key : String; value : AttributeValue } derive(Show, Eq) - ///| /// A chain of attribute values, the first element representing the most recent value pub(all) struct AttributeChain { - key : String - values : Array[AttributeValue] + key : String; values : Array[AttributeValue] } derive(Show, Eq) - ///| /// Starts a new `span` with the given name, as a child of the current invocation context pub fn start_span(name : String) -> Span { - let ptr = mbt_ffi_str2ptr(name) - let result : Int = wasmImportStartSpan(ptr, name.length()) - let ret = Span::Span(result) - mbt_ffi_free(ptr) - return ret -} + let ptr = mbt_ffi_str2ptr(name) + let result : Int = wasmImportStartSpan(ptr, name.length()); + let ret = Span::Span(result) + mbt_ffi_free(ptr) + return ret + +} ///| /// Gets the current invocation context /// /// The function call captures the current context; if new spans are started, the returned `invocation-context` instance will not /// reflect that. pub fn current_context() -> InvocationContext { - let result : Int = wasmImportCurrentContext() - let ret = InvocationContext::InvocationContext(result) - return ret -} + let result : Int = wasmImportCurrentContext(); + let ret = InvocationContext::InvocationContext(result) + return ret + +} ///| /// Allows or disallows forwarding of trace context headers in outgoing HTTP requests /// /// Returns the previous value of the setting pub fn allow_forwarding_trace_context_headers(allow : Bool) -> Bool { - let result : Int = wasmImportAllowForwardingTraceContextHeaders( - if allow { - 1 - } else { - 0 - }, - ) - let ret = result != 0 - return ret -} + let result : Int = wasmImportAllowForwardingTraceContextHeaders((if allow { 1 } else { 0 })); + let ret = (result != 0) + return ret + +} ///| /// Gets the starting time of the span pub fn Span::started_at(self : Span) -> @system-clock.Instant { - let Span(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodSpanStartedAt(handle, return_area) - let ret = @system-clock.Instant::{ - seconds: mbt_ffi_load64(return_area + 0), - nanoseconds: mbt_ffi_load32(return_area + 8).reinterpret_as_uint(), - } - mbt_ffi_free(return_area) - return ret -} + let Span(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodSpanStartedAt(handle, return_area); + let ret = @system-clock.Instant::{seconds : mbt_ffi_load64((return_area) + 0), nanoseconds : (mbt_ffi_load32((return_area) + 8)).reinterpret_as_uint()} + mbt_ffi_free(return_area) + return ret + +} ///| /// Set an attribute on the span -pub fn Span::set_attribute( - self : Span, - name : String, - value : AttributeValue, -) -> Unit { - let cleanup_list : Array[Int] = [] - - let Span(handle) = self - - let ptr = mbt_ffi_str2ptr(name) - - let (lowered, lowered1, lowered2) = match value { - String(payload) => { - let ptr0 = mbt_ffi_str2ptr(payload) - cleanup_list.push(ptr0) - - (0, ptr0, payload.length()) - } - } - wasmImportMethodSpanSetAttribute( - handle, - ptr, - name.length(), - lowered, - lowered1, - lowered2, - ) - mbt_ffi_free(ptr) - - cleanup_list.each(mbt_ffi_free) -} +pub fn Span::set_attribute(self : Span, name : String, value : AttributeValue) -> Unit { + let cleanup_list : Array[Int] = [] + + let Span(handle) = self + + let ptr = mbt_ffi_str2ptr(name) + + let (lowered,lowered1,lowered2) = match value { + String(payload) => { + let ptr0 = mbt_ffi_str2ptr(payload) + cleanup_list.push(ptr0) + + ((0), ptr0, payload.length()) + } + } + wasmImportMethodSpanSetAttribute(handle, ptr, name.length(), lowered, lowered1, lowered2); + mbt_ffi_free(ptr) + + cleanup_list.each(mbt_ffi_free) + +} ///| /// Set multiple attributes on the span pub fn Span::set_attributes(self : Span, attributes : Array[Attribute]) -> Unit { - let cleanup_list : Array[Int] = [] + let cleanup_list : Array[Int] = [] + + let Span(handle) = self - let Span(handle) = self + let address = mbt_ffi_malloc((attributes).length() * 20); + for index = 0; index < (attributes).length(); index = index + 1 { + let iter_elem : Attribute = (attributes)[(index)] + let iter_base = address + (index * 20); - let address = mbt_ffi_malloc(attributes.length() * 20) - for index = 0; index < attributes.length(); index = index + 1 { - let iter_elem : Attribute = attributes[index] - let iter_base = address + index * 20 + let ptr = mbt_ffi_str2ptr((iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).key.length()) + mbt_ffi_store32((iter_base) + 0, ptr) - let ptr = mbt_ffi_str2ptr(iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.key.length()) - mbt_ffi_store32(iter_base + 0, ptr) + match (iter_elem).value { + String(payload) => { + mbt_ffi_store8((iter_base) + 8, (0)) - match iter_elem.value { - String(payload) => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr0 = mbt_ffi_str2ptr(payload) + mbt_ffi_store32((iter_base) + 16, payload.length()) + mbt_ffi_store32((iter_base) + 12, ptr0) + cleanup_list.push(ptr0) - let ptr0 = mbt_ffi_str2ptr(payload) - mbt_ffi_store32(iter_base + 16, payload.length()) - mbt_ffi_store32(iter_base + 12, ptr0) - cleanup_list.push(ptr0) + () + } + } + cleanup_list.push(ptr) - () } - } - cleanup_list.push(ptr) - } - wasmImportMethodSpanSetAttributes(handle, address, attributes.length()) - mbt_ffi_free(address) + wasmImportMethodSpanSetAttributes(handle, address, (attributes).length()); + mbt_ffi_free(address) - cleanup_list.each(mbt_ffi_free) -} + cleanup_list.each(mbt_ffi_free) +} ///| /// Early finishes the span; otherwise it will be finished when the resource is dropped pub fn Span::finish(self : Span) -> Unit { - let Span(handle) = self - wasmImportMethodSpanFinish(handle) -} + let Span(handle) = self + wasmImportMethodSpanFinish(handle); + +} ///| /// Gets the current trace id pub fn InvocationContext::trace_id(self : InvocationContext) -> String { - let InvocationContext(handle) = self - let return_area = mbt_ffi_malloc(8) - wasmImportMethodInvocationContextTraceId(handle, return_area) - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 0), - mbt_ffi_load32(return_area + 4), - ) - let ret = result - mbt_ffi_free(return_area) - return ret -} + let InvocationContext(handle) = self + let return_area = mbt_ffi_malloc(8) + wasmImportMethodInvocationContextTraceId(handle, return_area); + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 0), mbt_ffi_load32((return_area) + 4)) + let ret = result + mbt_ffi_free(return_area) + return ret + +} ///| /// Gets the current span id pub fn InvocationContext::span_id(self : InvocationContext) -> String { - let InvocationContext(handle) = self - let return_area = mbt_ffi_malloc(8) - wasmImportMethodInvocationContextSpanId(handle, return_area) - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 0), - mbt_ffi_load32(return_area + 4), - ) - let ret = result - mbt_ffi_free(return_area) - return ret -} + let InvocationContext(handle) = self + let return_area = mbt_ffi_malloc(8) + wasmImportMethodInvocationContextSpanId(handle, return_area); + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 0), mbt_ffi_load32((return_area) + 4)) + let ret = result + mbt_ffi_free(return_area) + return ret + +} ///| /// Gets the parent context, if any; allows recursive processing of the invocation context. /// /// Alternatively, the attribute query methods can return inherited values without having to /// traverse the stack manually. -pub fn InvocationContext::parent( - self : InvocationContext, -) -> InvocationContext? { - let InvocationContext(handle) = self - let return_area = mbt_ffi_malloc(8) - wasmImportMethodInvocationContextParent(handle, return_area) - - let lifted : InvocationContext? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => - Option::Some( - InvocationContext::InvocationContext(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} +pub fn InvocationContext::parent(self : InvocationContext) -> InvocationContext? { + + let InvocationContext(handle) = self + let return_area = mbt_ffi_malloc(8) + wasmImportMethodInvocationContextParent(handle, return_area); + + let lifted : InvocationContext? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + Option::Some(InvocationContext::InvocationContext(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret +} ///| /// Gets the value of an attribute `key`. If `inherited` is true, the value is searched in the stack of spans, /// otherwise only in the current span. -pub fn InvocationContext::get_attribute( - self : InvocationContext, - key : String, - inherited : Bool, -) -> AttributeValue? { - let InvocationContext(handle) = self - - let ptr = mbt_ffi_str2ptr(key) - let return_area = mbt_ffi_malloc(16) - wasmImportMethodInvocationContextGetAttribute( - handle, - ptr, - key.length(), - if inherited { - 1 - } else { - 0 - }, - return_area, - ) - - let lifted0 : AttributeValue? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - AttributeValue::String(result) - } - _ => panic() +pub fn InvocationContext::get_attribute(self : InvocationContext, key : String, inherited : Bool) -> AttributeValue? { + + let InvocationContext(handle) = self + + let ptr = mbt_ffi_str2ptr(key) + let return_area = mbt_ffi_malloc(16) + wasmImportMethodInvocationContextGetAttribute(handle, ptr, key.length(), (if inherited { 1 } else { 0 }), return_area); + + let lifted0 : AttributeValue? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + AttributeValue::String(result) + } + _ => panic() + } + + Option::Some(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret - Option::Some(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret } - ///| /// Gets all attributes of the current invocation context. If `inherited` is true, it returns the merged set of attributes, each /// key associated with the latest value found in the stack of spans. -pub fn InvocationContext::get_attributes( - self : InvocationContext, - inherited : Bool, -) -> Array[Attribute] { - let InvocationContext(handle) = self - let return_area = mbt_ffi_malloc(8) - wasmImportMethodInvocationContextGetAttributes( - handle, - if inherited { - 1 - } else { - 0 - }, - return_area, - ) - - let array : Array[Attribute] = [] - for index = 0; index < mbt_ffi_load32(return_area + 4); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index * 20 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - AttributeValue::String(result0) +pub fn InvocationContext::get_attributes(self : InvocationContext, inherited : Bool) -> Array[Attribute] { + + let InvocationContext(handle) = self + let return_area = mbt_ffi_malloc(8) + wasmImportMethodInvocationContextGetAttributes(handle, (if inherited { 1 } else { 0 }), return_area); + + let array : Array[Attribute] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 20) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + AttributeValue::String(result0) + } + _ => panic() + } + + array.push(Attribute::{key : result, value : lifted}) } - _ => panic() - } - - array.push(Attribute::{ key: result, value: lifted }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array - mbt_ffi_free(return_area) - return ret -} + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array + mbt_ffi_free(return_area) + return ret +} ///| /// Gets the chain of attribute values associated with the given `key`. If the key does not exist in any of the /// spans in the invocation context, the list is empty. The chain's first element contains the most recent (innermost) value. -pub fn InvocationContext::get_attribute_chain( - self : InvocationContext, - key : String, -) -> Array[AttributeValue] { - let InvocationContext(handle) = self - - let ptr = mbt_ffi_str2ptr(key) - let return_area = mbt_ffi_malloc(8) - wasmImportMethodInvocationContextGetAttributeChain( - handle, - ptr, - key.length(), - return_area, - ) - - let array : Array[AttributeValue] = [] - for index = 0; index < mbt_ffi_load32(return_area + 4); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index * 12 - - let lifted = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - AttributeValue::String(result) +pub fn InvocationContext::get_attribute_chain(self : InvocationContext, key : String) -> Array[AttributeValue] { + + let InvocationContext(handle) = self + + let ptr = mbt_ffi_str2ptr(key) + let return_area = mbt_ffi_malloc(8) + wasmImportMethodInvocationContextGetAttributeChain(handle, ptr, key.length(), return_area); + + let array : Array[AttributeValue] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 12) + + let lifted = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + AttributeValue::String(result) + } + _ => panic() + } + + array.push(lifted) } - _ => panic() - } - - array.push(lifted) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret +} ///| /// Gets all values of all attributes of the current invocation context. -pub fn InvocationContext::get_attribute_chains( - self : InvocationContext, -) -> Array[AttributeChain] { - let InvocationContext(handle) = self - let return_area = mbt_ffi_malloc(8) - wasmImportMethodInvocationContextGetAttributeChains(handle, return_area) - - let array1 : Array[AttributeChain] = [] - for index2 = 0; index2 < mbt_ffi_load32(return_area + 4); index2 = index2 + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index2 * 16 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let array : Array[AttributeValue] = [] - for index = 0; index < mbt_ffi_load32(iter_base + 12); index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index * 12 - - let lifted = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - AttributeValue::String(result0) - } - _ => panic() - } +pub fn InvocationContext::get_attribute_chains(self : InvocationContext) -> Array[AttributeChain] { - array.push(lifted) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let InvocationContext(handle) = self + let return_area = mbt_ffi_malloc(8) + wasmImportMethodInvocationContextGetAttributeChains(handle, return_area); - array1.push(AttributeChain::{ key: result, values: array }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array1 - mbt_ffi_free(return_area) - return ret -} + let array1 : Array[AttributeChain] = []; + for index2 = 0; index2 < (mbt_ffi_load32((return_area) + 4)); index2 = index2 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index2 * 16) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let array : Array[AttributeValue] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index * 12) + + let lifted = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + AttributeValue::String(result0) + } + _ => panic() + } + + array.push(lifted) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + array1.push(AttributeChain::{key : result, values : array}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array1 + mbt_ffi_free(return_area) + return ret + +} ///| /// Gets the W3C Trace Context headers associated with the current invocation context -pub fn InvocationContext::trace_context_headers( - self : InvocationContext, -) -> Array[(String, String)] { - let InvocationContext(handle) = self - let return_area = mbt_ffi_malloc(8) - wasmImportMethodInvocationContextTraceContextHeaders(handle, return_area) - - let array : Array[(String, String)] = [] - for index = 0; index < mbt_ffi_load32(return_area + 4); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index * 16 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array.push((result, result0)) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array - mbt_ffi_free(return_area) - return ret +pub fn InvocationContext::trace_context_headers(self : InvocationContext) -> Array[(String, String)] { + + let InvocationContext(handle) = self + let return_area = mbt_ffi_malloc(8) + wasmImportMethodInvocationContextTraceContextHeaders(handle, return_area); + + let array : Array[(String, String)] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 16) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array.push((result, result0)) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/api/host/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/api/host/ffi.mbt index 1edf6fde80..06f3f71302 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/api/host/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/api/host/ffi.mbt @@ -1,210 +1,117 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropGetAgents(resource : Int) = "golem:api/host@1.5.0" "[resource-drop]get-agents" -///| fn wasmImportResourceDropGetPromiseResult(resource : Int) = "golem:api/host@1.5.0" "[resource-drop]get-promise-result" -///| -fn wasmImportConstructorGetAgents( - p0 : Int64, - p1 : Int64, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) -> Int = "golem:api/host@1.5.0" "[constructor]get-agents" +fn wasmImportConstructorGetAgents(p0 : Int64, p1 : Int64, p2 : Int, p3 : Int, p4 : Int, p5 : Int) -> Int = "golem:api/host@1.5.0" "[constructor]get-agents" -///| -fn wasmImportMethodGetAgentsGetNext(p0 : Int, p1 : Int) = "golem:api/host@1.5.0" "[method]get-agents.get-next" +fn wasmImportMethodGetAgentsGetNext(p0 : Int, p1 : Int) = "golem:api/host@1.5.0" "[method]get-agents.get-next" -///| fn wasmImportMethodGetPromiseResultGet(p0 : Int, p1 : Int) -> Int = "golem:api/host@1.5.0" "[async-lower][method]get-promise-result.get" -///| -fn wasmImportCreatePromise(p0 : Int) = "golem:api/host@1.5.0" "create-promise" +fn wasmImportCreatePromise(p0 : Int) = "golem:api/host@1.5.0" "create-promise" -///| -fn wasmImportGetPromise( - p0 : Int64, - p1 : Int64, - p2 : Int, - p3 : Int, - p4 : Int64, -) -> Int = "golem:api/host@1.5.0" "get-promise" +fn wasmImportGetPromise(p0 : Int64, p1 : Int64, p2 : Int, p3 : Int, p4 : Int64) -> Int = "golem:api/host@1.5.0" "get-promise" -///| -fn wasmImportCompletePromise( - p0 : Int64, - p1 : Int64, - p2 : Int, - p3 : Int, - p4 : Int64, - p5 : Int, - p6 : Int, -) -> Int = "golem:api/host@1.5.0" "complete-promise" +fn wasmImportCompletePromise(p0 : Int64, p1 : Int64, p2 : Int, p3 : Int, p4 : Int64, p5 : Int, p6 : Int) -> Int = "golem:api/host@1.5.0" "complete-promise" -///| fn wasmImportGetOplogIndex() -> Int64 = "golem:api/host@1.5.0" "get-oplog-index" -///| -fn wasmImportSetOplogIndex(p0 : Int64) = "golem:api/host@1.5.0" "set-oplog-index" +fn wasmImportSetOplogIndex(p0 : Int64) = "golem:api/host@1.5.0" "set-oplog-index" -///| -fn wasmImportOplogCommit(p0 : Int) = "golem:api/host@1.5.0" "oplog-commit" +fn wasmImportOplogCommit(p0 : Int) = "golem:api/host@1.5.0" "oplog-commit" -///| fn wasmImportMarkBeginOperation() -> Int64 = "golem:api/host@1.5.0" "mark-begin-operation" -///| -fn wasmImportMarkEndOperation(p0 : Int64) = "golem:api/host@1.5.0" "mark-end-operation" +fn wasmImportMarkEndOperation(p0 : Int64) = "golem:api/host@1.5.0" "mark-end-operation" -///| -fn wasmImportTrap(p0 : Int, p1 : Int) = "golem:api/host@1.5.0" "trap" +fn wasmImportTrap(p0 : Int, p1 : Int) = "golem:api/host@1.5.0" "trap" -///| fn wasmImportGetOplogPersistenceLevel() -> Int = "golem:api/host@1.5.0" "get-oplog-persistence-level" -///| -fn wasmImportSetOplogPersistenceLevel(p0 : Int) = "golem:api/host@1.5.0" "set-oplog-persistence-level" +fn wasmImportSetOplogPersistenceLevel(p0 : Int) = "golem:api/host@1.5.0" "set-oplog-persistence-level" -///| fn wasmImportGetIdempotenceMode() -> Int = "golem:api/host@1.5.0" "get-idempotence-mode" -///| -fn wasmImportSetIdempotenceMode(p0 : Int) = "golem:api/host@1.5.0" "set-idempotence-mode" +fn wasmImportSetIdempotenceMode(p0 : Int) = "golem:api/host@1.5.0" "set-idempotence-mode" -///| -fn wasmImportGenerateIdempotencyKey(p0 : Int) = "golem:api/host@1.5.0" "generate-idempotency-key" +fn wasmImportGenerateIdempotencyKey(p0 : Int) = "golem:api/host@1.5.0" "generate-idempotency-key" -///| -fn wasmImportSelfCard(p0 : Int) = "golem:api/host@1.5.0" "self-card" +fn wasmImportUpdateAgent(p0 : Int64, p1 : Int64, p2 : Int, p3 : Int, p4 : Int64, p5 : Int) = "golem:api/host@1.5.0" "update-agent" -///| -fn wasmImportDeriveCard(p0 : Int64, p1 : Int64, p2 : Int) = "golem:api/host@1.5.0" "derive-card" +fn wasmImportGetSelfMetadata(p0 : Int) = "golem:api/host@1.5.0" "get-self-metadata" -///| -fn wasmImportInstallCard(p0 : Int64, p1 : Int64, p2 : Int) = "golem:api/host@1.5.0" "install-card" +fn wasmImportGetAgentMetadata(p0 : Int64, p1 : Int64, p2 : Int, p3 : Int, p4 : Int) = "golem:api/host@1.5.0" "get-agent-metadata" -///| -fn wasmImportUpdateAgent( - p0 : Int64, - p1 : Int64, - p2 : Int, - p3 : Int, - p4 : Int64, - p5 : Int, -) = "golem:api/host@1.5.0" "update-agent" +fn wasmImportForkAgent(p0 : Int64, p1 : Int64, p2 : Int, p3 : Int, p4 : Int64, p5 : Int64, p6 : Int, p7 : Int, p8 : Int64) = "golem:api/host@1.5.0" "fork-agent" -///| -fn wasmImportGetSelfMetadata(p0 : Int) = "golem:api/host@1.5.0" "get-self-metadata" +fn wasmImportRevertAgent(p0 : Int64, p1 : Int64, p2 : Int, p3 : Int, p4 : Int, p5 : Int64) = "golem:api/host@1.5.0" "revert-agent" -///| -fn wasmImportGetAgentMetadata( - p0 : Int64, - p1 : Int64, - p2 : Int, - p3 : Int, - p4 : Int, -) = "golem:api/host@1.5.0" "get-agent-metadata" +fn wasmImportResolveComponentId(p0 : Int, p1 : Int, p2 : Int) = "golem:api/host@1.5.0" "resolve-component-id" -///| -fn wasmImportForkAgent( - p0 : Int64, - p1 : Int64, - p2 : Int, - p3 : Int, - p4 : Int64, - p5 : Int64, - p6 : Int, - p7 : Int, - p8 : Int64, -) = "golem:api/host@1.5.0" "fork-agent" +fn wasmImportResolveAgentId(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) = "golem:api/host@1.5.0" "resolve-agent-id" -///| -fn wasmImportRevertAgent( - p0 : Int64, - p1 : Int64, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int64, -) = "golem:api/host@1.5.0" "revert-agent" +fn wasmImportResolveAgentIdStrict(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) = "golem:api/host@1.5.0" "resolve-agent-id-strict" -///| -fn wasmImportResolveComponentId(p0 : Int, p1 : Int, p2 : Int) = "golem:api/host@1.5.0" "resolve-component-id" +fn wasmImportFork(p0 : Int) = "golem:api/host@1.5.0" "fork" ///| -fn wasmImportResolveAgentId(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) = "golem:api/host@1.5.0" "resolve-agent-id" +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -fn wasmImportResolveAgentIdStrict( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, -) = "golem:api/host@1.5.0" "resolve-agent-id-strict" +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| -fn wasmImportFork(p0 : Int) = "golem:api/host@1.5.0" "fork" +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) - -///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) - -///| -#owned(bytes) -extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) - -///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +#owned(bytes) +extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/api/host/pkg.generated.mbti b/sdks/moonbit/golem_sdk/interface/golem/api/host/pkg.generated.mbti index 57999ca88a..ff061d36ac 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/api/host/pkg.generated.mbti +++ b/sdks/moonbit/golem_sdk/interface/golem/api/host/pkg.generated.mbti @@ -10,8 +10,6 @@ pub fn complete_promise(@types.PromiseId, FixedArray[Byte]) -> Bool pub fn create_promise() -> @types.PromiseId -pub fn derive_card(Card) -> Result[Card, String] - pub fn fork() -> ForkResult pub fn fork_agent(@types.AgentId, @types.AgentId, UInt64) -> Unit @@ -30,8 +28,6 @@ pub fn get_promise(@types.PromiseId) -> GetPromiseResult pub fn get_self_metadata() -> AgentMetadata -pub fn install_card(Card) -> Result[Unit, CardInstallError] - pub fn mark_begin_operation() -> UInt64 pub fn mark_end_operation(UInt64) -> Unit @@ -46,8 +42,6 @@ pub fn resolve_component_id(String) -> @types.ComponentId? pub fn revert_agent(@types.AgentId, RevertAgentTarget) -> Unit -pub fn self_card() -> Card? - pub fn set_idempotence_mode(Bool) -> Unit pub fn set_oplog_index(UInt64) -> Unit @@ -59,13 +53,6 @@ pub fn trap(String) -> Unit pub fn update_agent(@types.AgentId, UInt64, UpdateMode) -> Unit // Errors -pub(all) suberror CardInstallError { - REVOKED - NOT_FOUND - NOT_PERMITTED -} derive(Eq, Show) -pub fn CardInstallError::from(Int) -> Self -pub fn CardInstallError::ordinal(Self) -> Int // Types and methods pub(all) struct AgentAllFilter { @@ -140,10 +127,6 @@ pub(all) struct AgentVersionFilter { value : UInt64 } derive(Eq, Show) -pub(all) struct Card { - card_id : @types.CardId -} derive(Eq, Show) - pub(all) struct EnvironmentId { uuid : @types.Uuid } derive(Eq, Show) @@ -213,4 +196,3 @@ pub fn UpdateMode::ordinal(Self) -> Int // Type aliases // Traits - diff --git a/sdks/moonbit/golem_sdk/interface/golem/api/host/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/api/host/top.mbt index adf6e5c142..dfd78360c8 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/api/host/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/api/host/top.mbt @@ -1,681 +1,509 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Represents a Golem environment pub(all) struct EnvironmentId { - uuid : @types.Uuid + uuid : @types.Uuid } derive(Show, Eq) - ///| /// Configurable persistence level for agents pub(all) enum PersistenceLevel { - PersistNothing - PersistRemoteSideEffects - Smart + PersistNothing + PersistRemoteSideEffects + Smart } derive(Show, Eq) - ///| /// Describes how to update an agent to a different component version pub(all) enum UpdateMode { - AUTOMATIC - SNAPSHOT_BASED + AUTOMATIC; SNAPSHOT_BASED } derive(Show, Eq) -///| pub fn UpdateMode::ordinal(self : UpdateMode) -> Int { - match self { - AUTOMATIC => 0 - SNAPSHOT_BASED => 1 - } + match self { + AUTOMATIC => 0 + SNAPSHOT_BASED => 1 + } } -///| pub fn UpdateMode::from(self : Int) -> UpdateMode { - match self { - 0 => AUTOMATIC - 1 => SNAPSHOT_BASED - _ => panic() - } + match self { + 0 => AUTOMATIC + 1 => SNAPSHOT_BASED + _ => panic() + } } - ///| /// Operators used in filtering enumerated agents pub(all) enum FilterComparator { - EQUAL - NOT_EQUAL - GREATER_EQUAL - GREATER - LESS_EQUAL - LESS + EQUAL; NOT_EQUAL; GREATER_EQUAL; GREATER; LESS_EQUAL; LESS } derive(Show, Eq) -///| pub fn FilterComparator::ordinal(self : FilterComparator) -> Int { - match self { - EQUAL => 0 - NOT_EQUAL => 1 - GREATER_EQUAL => 2 - GREATER => 3 - LESS_EQUAL => 4 - LESS => 5 - } + match self { + EQUAL => 0 + NOT_EQUAL => 1 + GREATER_EQUAL => 2 + GREATER => 3 + LESS_EQUAL => 4 + LESS => 5 + } } -///| pub fn FilterComparator::from(self : Int) -> FilterComparator { - match self { - 0 => EQUAL - 1 => NOT_EQUAL - 2 => GREATER_EQUAL - 3 => GREATER - 4 => LESS_EQUAL - 5 => LESS - _ => panic() - } + match self { + 0 => EQUAL + 1 => NOT_EQUAL + 2 => GREATER_EQUAL + 3 => GREATER + 4 => LESS_EQUAL + 5 => LESS + _ => panic() + } } - ///| /// Operators used on strings in filtering enumerated agents pub(all) enum StringFilterComparator { - EQUAL - NOT_EQUAL - LIKE - NOT_LIKE - STARTS_WITH + EQUAL; NOT_EQUAL; LIKE; NOT_LIKE; STARTS_WITH } derive(Show, Eq) -///| pub fn StringFilterComparator::ordinal(self : StringFilterComparator) -> Int { - match self { - EQUAL => 0 - NOT_EQUAL => 1 - LIKE => 2 - NOT_LIKE => 3 - STARTS_WITH => 4 - } + match self { + EQUAL => 0 + NOT_EQUAL => 1 + LIKE => 2 + NOT_LIKE => 3 + STARTS_WITH => 4 + } } -///| pub fn StringFilterComparator::from(self : Int) -> StringFilterComparator { - match self { - 0 => EQUAL - 1 => NOT_EQUAL - 2 => LIKE - 3 => NOT_LIKE - 4 => STARTS_WITH - _ => panic() - } + match self { + 0 => EQUAL + 1 => NOT_EQUAL + 2 => LIKE + 3 => NOT_LIKE + 4 => STARTS_WITH + _ => panic() + } } - ///| /// The current status of an agent pub(all) enum AgentStatus { - RUNNING - IDLE - SUSPENDED - INTERRUPTED - RETRYING - FAILED - EXITED + RUNNING; IDLE; SUSPENDED; INTERRUPTED; RETRYING; FAILED; EXITED } derive(Show, Eq) -///| pub fn AgentStatus::ordinal(self : AgentStatus) -> Int { - match self { - RUNNING => 0 - IDLE => 1 - SUSPENDED => 2 - INTERRUPTED => 3 - RETRYING => 4 - FAILED => 5 - EXITED => 6 - } + match self { + RUNNING => 0 + IDLE => 1 + SUSPENDED => 2 + INTERRUPTED => 3 + RETRYING => 4 + FAILED => 5 + EXITED => 6 + } } -///| pub fn AgentStatus::from(self : Int) -> AgentStatus { - match self { - 0 => RUNNING - 1 => IDLE - 2 => SUSPENDED - 3 => INTERRUPTED - 4 => RETRYING - 5 => FAILED - 6 => EXITED - _ => panic() - } + match self { + 0 => RUNNING + 1 => IDLE + 2 => SUSPENDED + 3 => INTERRUPTED + 4 => RETRYING + 5 => FAILED + 6 => EXITED + _ => panic() + } } - ///| /// Describes a filter condition on agent IDs when enumerating agents pub(all) struct AgentNameFilter { - comparator : StringFilterComparator - value : String + comparator : StringFilterComparator; value : String } derive(Show, Eq) - ///| /// Describes a filter condition on the agent status when enumerating agents pub(all) struct AgentStatusFilter { - comparator : FilterComparator - value : AgentStatus + comparator : FilterComparator; value : AgentStatus } derive(Show, Eq) - ///| /// Describes a filter condition on the component version when enumerating agents pub(all) struct AgentVersionFilter { - comparator : FilterComparator - value : UInt64 + comparator : FilterComparator; value : UInt64 } derive(Show, Eq) - ///| /// Describes a filter condition on the agent's creation time when enumerating agents pub(all) struct AgentCreatedAtFilter { - comparator : FilterComparator - value : UInt64 + comparator : FilterComparator; value : UInt64 } derive(Show, Eq) - ///| /// Describes a filter condition on the agent's environment variables when enumerating agents pub(all) struct AgentEnvFilter { - name : String - comparator : StringFilterComparator - value : String + name : String; comparator : StringFilterComparator; value : String } derive(Show, Eq) - ///| /// Describes a filter condition on the agent's configuration variables when enumerating agents pub(all) struct AgentConfigVarsFilter { - name : String - comparator : StringFilterComparator - value : String + name : String; comparator : StringFilterComparator; value : String } derive(Show, Eq) - ///| /// Describes one filter condition for enumerating agents pub(all) enum AgentPropertyFilter { - Name(AgentNameFilter) - Status(AgentStatusFilter) - Version(AgentVersionFilter) - CreatedAt(AgentCreatedAtFilter) - Env(AgentEnvFilter) - Config(AgentConfigVarsFilter) + Name(AgentNameFilter) + Status(AgentStatusFilter) + Version(AgentVersionFilter) + CreatedAt(AgentCreatedAtFilter) + Env(AgentEnvFilter) + Config(AgentConfigVarsFilter) } derive(Show, Eq) - ///| /// Combines multiple filter conditions with an `AND` relationship for enumerating agents pub(all) struct AgentAllFilter { - filters : Array[AgentPropertyFilter] + filters : Array[AgentPropertyFilter] } derive(Show, Eq) - ///| /// Combines multiple groups of filter conditions with an `OR` relationship for enumerating agents pub(all) struct AgentAnyFilter { - filters : Array[AgentAllFilter] + filters : Array[AgentAllFilter] } derive(Show, Eq) - ///| /// Metadata about an agent pub(all) struct AgentMetadata { - agent_id : @types.AgentId - args : Array[String] - env : Array[(String, String)] - config : Array[(String, String)] - status : AgentStatus - component_revision : UInt64 - retry_count : UInt64 - environment_id : EnvironmentId + agent_id : @types.AgentId; args : Array[String]; env : Array[(String, String)]; config : Array[(String, String)]; status : AgentStatus; component_revision : UInt64; retry_count : UInt64; environment_id : EnvironmentId } derive(Show, Eq) - ///| /// Creates an agent enumeration pub(all) struct GetAgents(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn GetAgents::drop(self : GetAgents) -> Unit { - let GetAgents(resource) = self - wasmImportResourceDropGetAgents(resource) + let GetAgents(resource) = self + wasmImportResourceDropGetAgents(resource) } - ///| /// Target parameter for the `revert-agent` operation pub(all) enum RevertAgentTarget { - RevertToOplogIndex(UInt64) - RevertLastInvocations(UInt64) + RevertToOplogIndex(UInt64) + RevertLastInvocations(UInt64) } derive(Show, Eq) - ///| /// Details about the fork result pub(all) struct ForkDetails { - forked_phantom_id : @types.Uuid + forked_phantom_id : @types.Uuid } derive(Show, Eq) - ///| /// Indicates which agent the code is running on after `fork`. /// The parameter contains details about the fork result, such as the phantom-ID of the newly /// created agent. pub(all) enum ForkResult { - Original(ForkDetails) - Forked(ForkDetails) + Original(ForkDetails) + Forked(ForkDetails) } derive(Show, Eq) - ///| pub(all) struct GetPromiseResult(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn GetPromiseResult::drop(self : GetPromiseResult) -> Unit { - let GetPromiseResult(resource) = self - wasmImportResourceDropGetPromiseResult(resource) -} - -///| -/// Plain-data handle to a permission card visible to the guest. -pub(all) struct Card { - card_id : @types.CardId -} derive(Show, Eq) - -///| -pub(all) suberror CardInstallError { - REVOKED - NOT_FOUND - NOT_PERMITTED -} derive(Show, Eq) - -///| -pub fn CardInstallError::ordinal(self : CardInstallError) -> Int { - match self { - REVOKED => 0 - NOT_FOUND => 1 - NOT_PERMITTED => 2 - } -} - -///| -pub fn CardInstallError::from(self : Int) -> CardInstallError { - match self { - 0 => REVOKED - 1 => NOT_FOUND - 2 => NOT_PERMITTED - _ => panic() - } + let GetPromiseResult(resource) = self + wasmImportResourceDropGetPromiseResult(resource) } - ///| /// Snapshot payload pub(all) struct Snapshot { - payload : FixedArray[Byte] - mime_type : String + payload : FixedArray[Byte]; mime_type : String } derive(Show, Eq) - ///| /// Creates an agent enumeration request. It is going to enumerate all agents of all the agent types /// defined in `component-id`, filtered by the conditions given by `filter`. If `precise` is true, /// the server will calculate the most recent state of all the returned agents, otherwise the returned /// metadata will be not guaranteed to be up-to-date. -pub fn GetAgents::get_agents( - component_id : @types.ComponentId, - filter : AgentAnyFilter?, - precise : Bool, -) -> GetAgents { - let cleanup_list : Array[Int] = [] - - let (lowered, lowered13, lowered14) = match filter { - None => (0, 0, 0) - Some(payload0) => { - let address11 = mbt_ffi_malloc(payload0.filters.length() * 8) - for index12 = 0 - index12 < payload0.filters.length() - index12 = index12 + 1 { - let iter_elem : AgentAllFilter = payload0.filters[index12] - let iter_base = address11 + index12 * 8 - - let address = mbt_ffi_malloc(iter_elem.filters.length() * 32) - for index = 0; index < iter_elem.filters.length(); index = index + 1 { - let iter_elem : AgentPropertyFilter = iter_elem.filters[index] - let iter_base = address + index * 32 - - match iter_elem { - Name(payload1) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, payload1.comparator.ordinal()) - - let ptr = mbt_ffi_str2ptr(payload1.value) - mbt_ffi_store32(iter_base + 16, payload1.value.length()) - mbt_ffi_store32(iter_base + 12, ptr) - cleanup_list.push(ptr) - - () - } - Status(payload2) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, payload2.comparator.ordinal()) - mbt_ffi_store8(iter_base + 9, payload2.value.ordinal()) +pub fn GetAgents::get_agents(component_id : @types.ComponentId, filter : AgentAnyFilter?, precise : Bool) -> GetAgents { + let cleanup_list : Array[Int] = [] - () - } - Version(payload3) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store8(iter_base + 8, payload3.comparator.ordinal()) - mbt_ffi_store64( - iter_base + 16, - payload3.value.reinterpret_as_int64(), - ) - - () + let (lowered, lowered13, lowered14) = match (filter) { + None => { + + ((0), 0, 0) } - CreatedAt(payload4) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store8(iter_base + 8, payload4.comparator.ordinal()) - mbt_ffi_store64( - iter_base + 16, - payload4.value.reinterpret_as_int64(), - ) - - () + Some(payload0) => { + + let address11 = mbt_ffi_malloc(((payload0).filters).length() * 8); + for index12 = 0; index12 < ((payload0).filters).length(); index12 = index12 + 1 { + let iter_elem : AgentAllFilter = ((payload0).filters)[(index12)] + let iter_base = address11 + (index12 * 8); + + let address = mbt_ffi_malloc(((iter_elem).filters).length() * 32); + for index = 0; index < ((iter_elem).filters).length(); index = index + 1 { + let iter_elem : AgentPropertyFilter = ((iter_elem).filters)[(index)] + let iter_base = address + (index * 32); + + match iter_elem { + Name(payload1) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (payload1).comparator.ordinal()) + + let ptr = mbt_ffi_str2ptr((payload1).value) + mbt_ffi_store32((iter_base) + 16, (payload1).value.length()) + mbt_ffi_store32((iter_base) + 12, ptr) + cleanup_list.push(ptr) + + () + } + Status(payload2) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, (payload2).comparator.ordinal()) + mbt_ffi_store8((iter_base) + 9, (payload2).value.ordinal()) + + () + } + Version(payload3) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store8((iter_base) + 8, (payload3).comparator.ordinal()) + mbt_ffi_store64((iter_base) + 16, ((payload3).value).reinterpret_as_int64()) + + () + } + CreatedAt(payload4) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store8((iter_base) + 8, (payload4).comparator.ordinal()) + mbt_ffi_store64((iter_base) + 16, ((payload4).value).reinterpret_as_int64()) + + () + } + Env(payload5) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + let ptr6 = mbt_ffi_str2ptr((payload5).name) + mbt_ffi_store32((iter_base) + 12, (payload5).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr6) + mbt_ffi_store8((iter_base) + 16, (payload5).comparator.ordinal()) + + let ptr7 = mbt_ffi_str2ptr((payload5).value) + mbt_ffi_store32((iter_base) + 24, (payload5).value.length()) + mbt_ffi_store32((iter_base) + 20, ptr7) + cleanup_list.push(ptr6) + cleanup_list.push(ptr7) + + () + } + Config(payload8) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + let ptr9 = mbt_ffi_str2ptr((payload8).name) + mbt_ffi_store32((iter_base) + 12, (payload8).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + mbt_ffi_store8((iter_base) + 16, (payload8).comparator.ordinal()) + + let ptr10 = mbt_ffi_str2ptr((payload8).value) + mbt_ffi_store32((iter_base) + 24, (payload8).value.length()) + mbt_ffi_store32((iter_base) + 20, ptr10) + cleanup_list.push(ptr9) + cleanup_list.push(ptr10) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 4, ((iter_elem).filters).length()) + mbt_ffi_store32((iter_base) + 0, address) + cleanup_list.push(address) + + } + cleanup_list.push(address11) + + ((1), address11, ((payload0).filters).length()) } - Env(payload5) => { - mbt_ffi_store8(iter_base + 0, 4) + } + let result : Int = wasmImportConstructorGetAgents((((component_id).uuid).high_bits).reinterpret_as_int64(), (((component_id).uuid).low_bits).reinterpret_as_int64(), lowered, lowered13, lowered14, (if precise { 1 } else { 0 })); + let ret = GetAgents::GetAgents(result) - let ptr6 = mbt_ffi_str2ptr(payload5.name) - mbt_ffi_store32(iter_base + 12, payload5.name.length()) - mbt_ffi_store32(iter_base + 8, ptr6) - mbt_ffi_store8(iter_base + 16, payload5.comparator.ordinal()) + cleanup_list.each(mbt_ffi_free) + return ret - let ptr7 = mbt_ffi_str2ptr(payload5.value) - mbt_ffi_store32(iter_base + 24, payload5.value.length()) - mbt_ffi_store32(iter_base + 20, ptr7) - cleanup_list.push(ptr6) - cleanup_list.push(ptr7) +} +///| +/// Retrieves the next batch of agent metadata. +pub fn GetAgents::get_next(self : GetAgents) -> Array[AgentMetadata]? { - () - } - Config(payload8) => { - mbt_ffi_store8(iter_base + 0, 5) + let GetAgents(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodGetAgentsGetNext(handle, return_area); + + let lifted : Array[AgentMetadata]? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let array9 : Array[AgentMetadata] = []; + for index10 = 0; index10 < (mbt_ffi_load32((return_area) + 8)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index10 * 88) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 28)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index * 8) + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array3 : Array[(String, String)] = []; + for index4 = 0; index4 < (mbt_ffi_load32((iter_base) + 36)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index4 * 16) + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array3.push((result1, result2)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let array7 : Array[(String, String)] = []; + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 44)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index8 * 16) + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr9 = mbt_ffi_str2ptr(payload8.name) - mbt_ffi_store32(iter_base + 12, payload8.name.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - mbt_ffi_store8(iter_base + 16, payload8.comparator.ordinal()) + array7.push((result5, result6)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - let ptr10 = mbt_ffi_str2ptr(payload8.value) - mbt_ffi_store32(iter_base + 24, payload8.value.length()) - mbt_ffi_store32(iter_base + 20, ptr10) - cleanup_list.push(ptr9) - cleanup_list.push(ptr10) + array9.push(AgentMetadata::{agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()}}, agent_id : result}, args : array, env : array3, config : array7, status : AgentStatus::from(mbt_ffi_load8_u((iter_base) + 48)), component_revision : (mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64(), retry_count : (mbt_ffi_load64((iter_base) + 64)).reinterpret_as_uint64(), environment_id : EnvironmentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 72)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 80)).reinterpret_as_uint64()}}}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) - () + Option::Some(array9) } - } - } - mbt_ffi_store32(iter_base + 4, iter_elem.filters.length()) - mbt_ffi_store32(iter_base + 0, address) - cleanup_list.push(address) + _ => panic() } - cleanup_list.push(address11) - - (1, address11, payload0.filters.length()) - } - } - let result : Int = wasmImportConstructorGetAgents( - component_id.uuid.high_bits.reinterpret_as_int64(), - component_id.uuid.low_bits.reinterpret_as_int64(), - lowered, - lowered13, - lowered14, - if precise { - 1 - } else { - 0 - }, - ) - let ret = GetAgents::GetAgents(result) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let ret = lifted + mbt_ffi_free(return_area) + return ret -///| -/// Retrieves the next batch of agent metadata. -pub fn GetAgents::get_next(self : GetAgents) -> Array[AgentMetadata]? { - let GetAgents(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodGetAgentsGetNext(handle, return_area) - - let lifted : Array[AgentMetadata]? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let array9 : Array[AgentMetadata] = [] - for index10 = 0 - index10 < mbt_ffi_load32(return_area + 8) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index10 * 88 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let array : Array[String] = [] - for index = 0; index < mbt_ffi_load32(iter_base + 28); index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index * 8 - - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array3 : Array[(String, String)] = [] - for index4 = 0 - index4 < mbt_ffi_load32(iter_base + 36) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index4 * 16 - - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array3.push((result1, result2)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let array7 : Array[(String, String)] = [] - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 44) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index8 * 16 - - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array7.push((result5, result6)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - array9.push(AgentMetadata::{ - agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - }, - }, - agent_id: result, - }, - args: array, - env: array3, - config: array7, - status: AgentStatus::from(mbt_ffi_load8_u(iter_base + 48)), - component_revision: mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - retry_count: mbt_ffi_load64(iter_base + 64).reinterpret_as_uint64(), - environment_id: EnvironmentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 72).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 80).reinterpret_as_uint64(), - }, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Option::Some(array9) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret } - ///| /// Awaits the result of the promise. pub async fn GetPromiseResult::get(self : GetPromiseResult) -> FixedArray[Byte] { - let GetPromiseResult(handle) = self - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(8 * 1) - defer mbt_ffi_free(result_ptr) + let GetPromiseResult(handle) = self - let subtask_code = wasmImportMethodGetPromiseResultGet(lower_arg, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { mbt_ffi_free(mbt_ffi_load32(result_ptr + 0)) }, - ) + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(8 * 1) + defer mbt_ffi_free(result_ptr) - let result = mbt_ffi_ptr2bytes( - mbt_ffi_load32(result_ptr + 0), - mbt_ffi_load32(result_ptr + 4), - ) + let subtask_code = wasmImportMethodGetPromiseResultGet(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, - result -} + fn(before_started) { + if before_started { + () + } else { + () + } + } + , + fn() { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 0)) + + }, + ) + let result = mbt_ffi_ptr2bytes(mbt_ffi_load32((result_ptr) + 0), mbt_ffi_load32((result_ptr) + 4)) + + result + +} ///| /// Create a new promise pub fn create_promise() -> @types.PromiseId { - let return_area = mbt_ffi_malloc(32) - wasmImportCreatePromise(return_area) - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 16), - mbt_ffi_load32(return_area + 20), - ) - let ret = @types.PromiseId::{ - agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 0).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - }, - }, - agent_id: result, - }, - oplog_idx: mbt_ffi_load64(return_area + 24).reinterpret_as_uint64(), - } - mbt_ffi_free(return_area) - return ret -} + let return_area = mbt_ffi_malloc(32) + wasmImportCreatePromise(return_area); + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 16), mbt_ffi_load32((return_area) + 20)) + let ret = @types.PromiseId::{agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 0)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()}}, agent_id : result}, oplog_idx : (mbt_ffi_load64((return_area) + 24)).reinterpret_as_uint64()} + mbt_ffi_free(return_area) + return ret + +} ///| /// Gets a handle to the result of the promise. Can only be called in the same agent that orignally created the promise. pub fn get_promise(promise_id : @types.PromiseId) -> GetPromiseResult { - let ptr = mbt_ffi_str2ptr(promise_id.agent_id.agent_id) - let result : Int = wasmImportGetPromise( - promise_id.agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - promise_id.agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ptr, - promise_id.agent_id.agent_id.length(), - promise_id.oplog_idx.reinterpret_as_int64(), - ) - let ret = GetPromiseResult::GetPromiseResult(result) - mbt_ffi_free(ptr) - return ret -} + let ptr = mbt_ffi_str2ptr(((promise_id).agent_id).agent_id) + let result : Int = wasmImportGetPromise((((((promise_id).agent_id).component_id).uuid).high_bits).reinterpret_as_int64(), (((((promise_id).agent_id).component_id).uuid).low_bits).reinterpret_as_int64(), ptr, ((promise_id).agent_id).agent_id.length(), ((promise_id).oplog_idx).reinterpret_as_int64()); + let ret = GetPromiseResult::GetPromiseResult(result) + mbt_ffi_free(ptr) + return ret + +} ///| /// Completes the given promise with the given payload. Returns true if the promise was completed, false /// if the promise was already completed. The payload is passed to the agent that is awaiting the promise. -pub fn complete_promise( - promise_id : @types.PromiseId, - data : FixedArray[Byte], -) -> Bool { - let ptr = mbt_ffi_str2ptr(promise_id.agent_id.agent_id) - - let ptr0 = mbt_ffi_bytes2ptr(data) - - let result : Int = wasmImportCompletePromise( - promise_id.agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - promise_id.agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ptr, - promise_id.agent_id.agent_id.length(), - promise_id.oplog_idx.reinterpret_as_int64(), - ptr0, - data.length(), - ) - let ret = result != 0 - mbt_ffi_free(ptr) - mbt_ffi_free(ptr0) - return ret -} +pub fn complete_promise(promise_id : @types.PromiseId, data : FixedArray[Byte]) -> Bool { + + let ptr = mbt_ffi_str2ptr(((promise_id).agent_id).agent_id) + + let ptr0 = mbt_ffi_bytes2ptr(data) + + let result : Int = wasmImportCompletePromise((((((promise_id).agent_id).component_id).uuid).high_bits).reinterpret_as_int64(), (((((promise_id).agent_id).component_id).uuid).low_bits).reinterpret_as_int64(), ptr, ((promise_id).agent_id).agent_id.length(), ((promise_id).oplog_idx).reinterpret_as_int64(), ptr0, data.length()); + let ret = (result != 0) + mbt_ffi_free(ptr) + mbt_ffi_free(ptr0) + return ret +} ///| /// Returns the current position in the persistent op log pub fn get_oplog_index() -> UInt64 { - let result : Int64 = wasmImportGetOplogIndex() - let ret = result.reinterpret_as_uint64() - return ret -} + let result : Int64 = wasmImportGetOplogIndex(); + let ret = (result).reinterpret_as_uint64() + return ret + +} ///| /// Makes the current agent travel back in time and continue execution from the given position in the persistent /// op log. pub fn set_oplog_index(oplog_idx : UInt64) -> Unit { - wasmImportSetOplogIndex(oplog_idx.reinterpret_as_int64()) -} + wasmImportSetOplogIndex((oplog_idx).reinterpret_as_int64()); + +} ///| /// Blocks the execution until the oplog has been written to at least the specified number of replicas, /// or the maximum number of replicas if the requested number is higher. pub fn oplog_commit(replicas : Byte) -> Unit { - wasmImportOplogCommit(replicas.to_int()) -} + wasmImportOplogCommit((replicas).to_int()); + +} ///| /// Marks the beginning of an atomic operation. /// In case of a failure within the region selected by `mark-begin-operation` and `mark-end-operation` /// the whole region will be reexecuted on retry. /// The end of the region is when `mark-end-operation` is called with the returned oplog-index. pub fn mark_begin_operation() -> UInt64 { - let result : Int64 = wasmImportMarkBeginOperation() - let ret = result.reinterpret_as_uint64() - return ret -} + let result : Int64 = wasmImportMarkBeginOperation(); + let ret = (result).reinterpret_as_uint64() + return ret + +} ///| /// Commits this atomic operation. After `mark-end-operation` is called for a given index, further calls /// with the same parameter will do nothing. pub fn mark_end_operation(begin : UInt64) -> Unit { - wasmImportMarkEndOperation(begin.reinterpret_as_int64()) -} + wasmImportMarkEndOperation((begin).reinterpret_as_int64()); + +} ///| /// Unconditionally traps the current invocation with the given reason. /// @@ -684,411 +512,238 @@ pub fn mark_end_operation(begin : UInt64) -> Unit { /// to guarantee that a failed atomic region always leads to a trap, regardless of /// whether the guest language could otherwise catch the failure. pub fn trap(reason : String) -> Unit { - let ptr = mbt_ffi_str2ptr(reason) - wasmImportTrap(ptr, reason.length()) - mbt_ffi_free(ptr) -} + let ptr = mbt_ffi_str2ptr(reason) + wasmImportTrap(ptr, reason.length()); + mbt_ffi_free(ptr) + +} ///| /// Gets the agent's current persistence level. pub fn get_oplog_persistence_level() -> PersistenceLevel { - let result : Int = wasmImportGetOplogPersistenceLevel() - - let lifted = match result { - 0 => PersistenceLevel::PersistNothing - 1 => PersistenceLevel::PersistRemoteSideEffects - 2 => PersistenceLevel::Smart - _ => panic() - } - let ret = lifted - return ret -} + let result : Int = wasmImportGetOplogPersistenceLevel(); + + let lifted = match (result) { + 0 => { + + PersistenceLevel::PersistNothing + } + 1 => { + + PersistenceLevel::PersistRemoteSideEffects + } + 2 => { + + PersistenceLevel::Smart + } + _ => panic() + } + let ret = lifted + return ret + +} ///| /// Sets the agent's current persistence level. This can increase the performance of execution in cases where durable /// execution is not required. -pub fn set_oplog_persistence_level( - new_persistence_level : PersistenceLevel, -) -> Unit { - let lowered = match new_persistence_level { - PersistNothing => 0 - PersistRemoteSideEffects => 1 - Smart => 2 - } - wasmImportSetOplogPersistenceLevel(lowered) -} +pub fn set_oplog_persistence_level(new_persistence_level : PersistenceLevel) -> Unit { + + let (lowered) = match new_persistence_level { + PersistNothing => { + ((0)) + } + PersistRemoteSideEffects => { + + ((1)) + } + Smart => { + + ((2)) + } + } + wasmImportSetOplogPersistenceLevel(lowered); + +} ///| /// Gets the current idempotence mode. See `set-idempotence-mode` for details. pub fn get_idempotence_mode() -> Bool { - let result : Int = wasmImportGetIdempotenceMode() - let ret = result != 0 - return ret -} + let result : Int = wasmImportGetIdempotenceMode(); + let ret = (result != 0) + return ret + +} ///| /// Sets the current idempotence mode. The default is true. /// True means side-effects are treated idempotent and Golem guarantees at-least-once semantics. /// In case of false the executor provides at-most-once semantics, failing the agent in case it is /// not known if the side effect was already executed. pub fn set_idempotence_mode(idempotent : Bool) -> Unit { - wasmImportSetIdempotenceMode(if idempotent { 1 } else { 0 }) -} + wasmImportSetIdempotenceMode((if idempotent { 1 } else { 0 })); + +} ///| /// Generates an idempotency key. This operation will never be replayed — /// i.e. not only is this key generated, but it is persisted and committed, such that the key can be used in third-party systems (e.g. payment processing) /// to introduce idempotence. pub fn generate_idempotency_key() -> @types.Uuid { - let return_area = mbt_ffi_malloc(16) - wasmImportGenerateIdempotencyKey(return_area) - let ret = @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 0).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - } - mbt_ffi_free(return_area) - return ret -} -///| -/// Returns one permission card currently installed in this agent's wallet, if any. -pub fn self_card() -> Card? { - let return_area = mbt_ffi_malloc(24) - wasmImportSelfCard(return_area) - - let lifted : Card? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => - Option::Some(Card::{ - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 16).reinterpret_as_uint64(), - }, - }, - }) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} - -///| -/// Derives a card handle from an installed card. This minimal test-facing form keeps the card as plain data. -pub fn derive_card(card : Card) -> Result[Card, String] { - let return_area = mbt_ffi_malloc(24) - wasmImportDeriveCard( - card.card_id.uuid.high_bits.reinterpret_as_int64(), - card.card_id.uuid.low_bits.reinterpret_as_int64(), - return_area, - ) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok(Card::{ - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 16).reinterpret_as_uint64(), - }, - }, - }) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) + let return_area = mbt_ffi_malloc(16) + wasmImportGenerateIdempotencyKey(return_area); + let ret = @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 0)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()} + mbt_ffi_free(return_area) + return ret - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret } - -///| -/// Installs a card into this agent's own wallet. -pub fn install_card(card : Card) -> Result[Unit, CardInstallError] { - let return_area = mbt_ffi_malloc(2) - wasmImportInstallCard( - card.card_id.uuid.high_bits.reinterpret_as_int64(), - card.card_id.uuid.low_bits.reinterpret_as_int64(), - return_area, - ) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => Result::Err(CardInstallError::from(mbt_ffi_load8_u(return_area + 1))) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} - ///| /// Initiates an update attempt for the given agent. The function returns immediately once the request has been processed, /// not waiting for the agent to get updated. -pub fn update_agent( - agent_id : @types.AgentId, - target_revision : UInt64, - mode : UpdateMode, -) -> Unit { - let ptr = mbt_ffi_str2ptr(agent_id.agent_id) - wasmImportUpdateAgent( - agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ptr, - agent_id.agent_id.length(), - target_revision.reinterpret_as_int64(), - mode.ordinal(), - ) - mbt_ffi_free(ptr) -} +pub fn update_agent(agent_id : @types.AgentId, target_revision : UInt64, mode : UpdateMode) -> Unit { + let ptr = mbt_ffi_str2ptr((agent_id).agent_id) + wasmImportUpdateAgent(((((agent_id).component_id).uuid).high_bits).reinterpret_as_int64(), ((((agent_id).component_id).uuid).low_bits).reinterpret_as_int64(), ptr, (agent_id).agent_id.length(), (target_revision).reinterpret_as_int64(), mode.ordinal()); + mbt_ffi_free(ptr) + +} ///| /// Get the current agent's metadata pub fn get_self_metadata() -> AgentMetadata { - let return_area = mbt_ffi_malloc(88) - wasmImportGetSelfMetadata(return_area) - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 16), - mbt_ffi_load32(return_area + 20), - ) - - let array : Array[String] = [] - for index = 0; index < mbt_ffi_load32(return_area + 28); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 24) + index * 8 - - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result0) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 24)) - - let array3 : Array[(String, String)] = [] - for index4 = 0; index4 < mbt_ffi_load32(return_area + 36); index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(return_area + 32) + index4 * 16 - - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array3.push((result1, result2)) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 32)) - - let array7 : Array[(String, String)] = [] - for index8 = 0; index8 < mbt_ffi_load32(return_area + 44); index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(return_area + 40) + index8 * 16 - - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array7.push((result5, result6)) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 40)) - let ret = AgentMetadata::{ - agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 0).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - }, - }, - agent_id: result, - }, - args: array, - env: array3, - config: array7, - status: AgentStatus::from(mbt_ffi_load8_u(return_area + 48)), - component_revision: mbt_ffi_load64(return_area + 56).reinterpret_as_uint64(), - retry_count: mbt_ffi_load64(return_area + 64).reinterpret_as_uint64(), - environment_id: EnvironmentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 72).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 80).reinterpret_as_uint64(), - }, - }, - } - mbt_ffi_free(return_area) - return ret -} -///| -/// Get agent metadata -pub fn get_agent_metadata(agent_id : @types.AgentId) -> AgentMetadata? { - let ptr = mbt_ffi_str2ptr(agent_id.agent_id) - let return_area = mbt_ffi_malloc(96) - wasmImportGetAgentMetadata( - agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ptr, - agent_id.agent_id.length(), - return_area, - ) - - let lifted : AgentMetadata? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 24), - mbt_ffi_load32(return_area + 28), - ) + let return_area = mbt_ffi_malloc(88) + wasmImportGetSelfMetadata(return_area); - let array : Array[String] = [] - for index = 0; index < mbt_ffi_load32(return_area + 36); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 32) + index * 8 + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 16), mbt_ffi_load32((return_area) + 20)) - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 28)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 24)) + (index * 8) - array.push(result0) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result0) } - mbt_ffi_free(mbt_ffi_load32(return_area + 32)) + mbt_ffi_free(mbt_ffi_load32((return_area) + 24)) - let array3 : Array[(String, String)] = [] - for index4 = 0 - index4 < mbt_ffi_load32(return_area + 44) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(return_area + 40) + index4 * 16 + let array3 : Array[(String, String)] = []; + for index4 = 0; index4 < (mbt_ffi_load32((return_area) + 36)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 32)) + (index4 * 16) - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array3.push((result1, result2)) + array3.push((result1, result2)) } - mbt_ffi_free(mbt_ffi_load32(return_area + 40)) + mbt_ffi_free(mbt_ffi_load32((return_area) + 32)) - let array7 : Array[(String, String)] = [] - for index8 = 0 - index8 < mbt_ffi_load32(return_area + 52) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(return_area + 48) + index8 * 16 + let array7 : Array[(String, String)] = []; + for index8 = 0; index8 < (mbt_ffi_load32((return_area) + 44)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 40)) + (index8 * 16) - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array7.push((result5, result6)) + array7.push((result5, result6)) } - mbt_ffi_free(mbt_ffi_load32(return_area + 48)) - - Option::Some(AgentMetadata::{ - agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 16).reinterpret_as_uint64(), - }, - }, - agent_id: result, - }, - args: array, - env: array3, - config: array7, - status: AgentStatus::from(mbt_ffi_load8_u(return_area + 56)), - component_revision: mbt_ffi_load64(return_area + 64).reinterpret_as_uint64(), - retry_count: mbt_ffi_load64(return_area + 72).reinterpret_as_uint64(), - environment_id: EnvironmentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 80).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 88).reinterpret_as_uint64(), - }, - }, - }) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret + mbt_ffi_free(mbt_ffi_load32((return_area) + 40)) + let ret = AgentMetadata::{agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 0)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()}}, agent_id : result}, args : array, env : array3, config : array7, status : AgentStatus::from(mbt_ffi_load8_u((return_area) + 48)), component_revision : (mbt_ffi_load64((return_area) + 56)).reinterpret_as_uint64(), retry_count : (mbt_ffi_load64((return_area) + 64)).reinterpret_as_uint64(), environment_id : EnvironmentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 72)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 80)).reinterpret_as_uint64()}}} + mbt_ffi_free(return_area) + return ret + } +///| +/// Get agent metadata +pub fn get_agent_metadata(agent_id : @types.AgentId) -> AgentMetadata? { + + let ptr = mbt_ffi_str2ptr((agent_id).agent_id) + let return_area = mbt_ffi_malloc(96) + wasmImportGetAgentMetadata(((((agent_id).component_id).uuid).high_bits).reinterpret_as_int64(), ((((agent_id).component_id).uuid).low_bits).reinterpret_as_int64(), ptr, (agent_id).agent_id.length(), return_area); + + let lifted : AgentMetadata? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 24), mbt_ffi_load32((return_area) + 28)) + + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 36)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 32)) + (index * 8) + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result0) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 32)) + let array3 : Array[(String, String)] = []; + for index4 = 0; index4 < (mbt_ffi_load32((return_area) + 44)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 40)) + (index4 * 16) + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array3.push((result1, result2)) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 40)) + + let array7 : Array[(String, String)] = []; + for index8 = 0; index8 < (mbt_ffi_load32((return_area) + 52)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 48)) + (index8 * 16) + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array7.push((result5, result6)) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 48)) + + Option::Some(AgentMetadata::{agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 16)).reinterpret_as_uint64()}}, agent_id : result}, args : array, env : array3, config : array7, status : AgentStatus::from(mbt_ffi_load8_u((return_area) + 56)), component_revision : (mbt_ffi_load64((return_area) + 64)).reinterpret_as_uint64(), retry_count : (mbt_ffi_load64((return_area) + 72)).reinterpret_as_uint64(), environment_id : EnvironmentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 80)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 88)).reinterpret_as_uint64()}}}) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// Fork an agent to another agent at a given oplog index -pub fn fork_agent( - source_agent_id : @types.AgentId, - target_agent_id : @types.AgentId, - oplog_idx_cut_off : UInt64, -) -> Unit { - let ptr = mbt_ffi_str2ptr(source_agent_id.agent_id) - - let ptr0 = mbt_ffi_str2ptr(target_agent_id.agent_id) - wasmImportForkAgent( - source_agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - source_agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ptr, - source_agent_id.agent_id.length(), - target_agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - target_agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ptr0, - target_agent_id.agent_id.length(), - oplog_idx_cut_off.reinterpret_as_int64(), - ) - mbt_ffi_free(ptr) - mbt_ffi_free(ptr0) -} +pub fn fork_agent(source_agent_id : @types.AgentId, target_agent_id : @types.AgentId, oplog_idx_cut_off : UInt64) -> Unit { + + let ptr = mbt_ffi_str2ptr((source_agent_id).agent_id) + + let ptr0 = mbt_ffi_str2ptr((target_agent_id).agent_id) + wasmImportForkAgent(((((source_agent_id).component_id).uuid).high_bits).reinterpret_as_int64(), ((((source_agent_id).component_id).uuid).low_bits).reinterpret_as_int64(), ptr, (source_agent_id).agent_id.length(), ((((target_agent_id).component_id).uuid).high_bits).reinterpret_as_int64(), ((((target_agent_id).component_id).uuid).low_bits).reinterpret_as_int64(), ptr0, (target_agent_id).agent_id.length(), (oplog_idx_cut_off).reinterpret_as_int64()); + mbt_ffi_free(ptr) + mbt_ffi_free(ptr0) +} ///| /// Revert an agent to a previous state -pub fn revert_agent( - agent_id : @types.AgentId, - revert_target : RevertAgentTarget, -) -> Unit { - let ptr = mbt_ffi_str2ptr(agent_id.agent_id) - - let (lowered, lowered1) = match revert_target { - RevertToOplogIndex(payload) => (0, payload.reinterpret_as_int64()) - RevertLastInvocations(payload0) => (1, payload0.reinterpret_as_int64()) - } - wasmImportRevertAgent( - agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ptr, - agent_id.agent_id.length(), - lowered, - lowered1, - ) - mbt_ffi_free(ptr) -} +pub fn revert_agent(agent_id : @types.AgentId, revert_target : RevertAgentTarget) -> Unit { + + let ptr = mbt_ffi_str2ptr((agent_id).agent_id) + + let (lowered,lowered1) = match revert_target { + RevertToOplogIndex(payload) => { + ((0), (payload).reinterpret_as_int64()) + } + RevertLastInvocations(payload0) => { + + ((1), (payload0).reinterpret_as_int64()) + } + } + wasmImportRevertAgent(((((agent_id).component_id).uuid).high_bits).reinterpret_as_int64(), ((((agent_id).component_id).uuid).low_bits).reinterpret_as_int64(), ptr, (agent_id).agent_id.length(), lowered, lowered1); + mbt_ffi_free(ptr) + +} ///| /// Get the component-id for a given component reference. /// Returns none when no component with the specified reference exists. @@ -1099,149 +754,106 @@ pub fn revert_agent( /// 1: "{component_name}" -> will resolve in current account and project /// 2: "{project_name}/{component_name}" -> will resolve in current account /// 3: "{account_id}/{project_name}/{component_name}" -pub fn resolve_component_id( - component_reference : String, -) -> @types.ComponentId? { - let ptr = mbt_ffi_str2ptr(component_reference) - let return_area = mbt_ffi_malloc(24) - wasmImportResolveComponentId(ptr, component_reference.length(), return_area) - - let lifted : @types.ComponentId? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => - Option::Some(@types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 16).reinterpret_as_uint64(), - }, - }) - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} +pub fn resolve_component_id(component_reference : String) -> @types.ComponentId? { + + let ptr = mbt_ffi_str2ptr(component_reference) + let return_area = mbt_ffi_malloc(24) + wasmImportResolveComponentId(ptr, component_reference.length(), return_area); + let lifted : @types.ComponentId? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + Option::Some(@types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 16)).reinterpret_as_uint64()}}) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// Get the agent-id for a given component and agent name. /// Returns none when no component for the specified reference exists. -pub fn resolve_agent_id( - component_reference : String, - agent_name : String, -) -> @types.AgentId? { - let ptr = mbt_ffi_str2ptr(component_reference) - - let ptr0 = mbt_ffi_str2ptr(agent_name) - let return_area = mbt_ffi_malloc(32) - wasmImportResolveAgentId( - ptr, - component_reference.length(), - ptr0, - agent_name.length(), - return_area, - ) - - let lifted : @types.AgentId? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 24), - mbt_ffi_load32(return_area + 28), - ) +pub fn resolve_agent_id(component_reference : String, agent_name : String) -> @types.AgentId? { - Option::Some(@types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 16).reinterpret_as_uint64(), - }, - }, - agent_id: result, - }) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(ptr0) - mbt_ffi_free(return_area) - return ret -} + let ptr = mbt_ffi_str2ptr(component_reference) + let ptr0 = mbt_ffi_str2ptr(agent_name) + let return_area = mbt_ffi_malloc(32) + wasmImportResolveAgentId(ptr, component_reference.length(), ptr0, agent_name.length(), return_area); + + let lifted : @types.AgentId? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 24), mbt_ffi_load32((return_area) + 28)) + + Option::Some(@types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 16)).reinterpret_as_uint64()}}, agent_id : result}) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(ptr0) + mbt_ffi_free(return_area) + return ret + +} ///| /// Get the agent-id for a given component and agent-name. /// Returns none when no component for the specified component-reference or no agent with the specified agent-name exists. -pub fn resolve_agent_id_strict( - component_reference : String, - agent_name : String, -) -> @types.AgentId? { - let ptr = mbt_ffi_str2ptr(component_reference) - - let ptr0 = mbt_ffi_str2ptr(agent_name) - let return_area = mbt_ffi_malloc(32) - wasmImportResolveAgentIdStrict( - ptr, - component_reference.length(), - ptr0, - agent_name.length(), - return_area, - ) - - let lifted : @types.AgentId? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 24), - mbt_ffi_load32(return_area + 28), - ) +pub fn resolve_agent_id_strict(component_reference : String, agent_name : String) -> @types.AgentId? { - Option::Some(@types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 16).reinterpret_as_uint64(), - }, - }, - agent_id: result, - }) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(ptr0) - mbt_ffi_free(return_area) - return ret -} + let ptr = mbt_ffi_str2ptr(component_reference) + + let ptr0 = mbt_ffi_str2ptr(agent_name) + let return_area = mbt_ffi_malloc(32) + wasmImportResolveAgentIdStrict(ptr, component_reference.length(), ptr0, agent_name.length(), return_area); + + let lifted : @types.AgentId? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 24), mbt_ffi_load32((return_area) + 28)) + + Option::Some(@types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 16)).reinterpret_as_uint64()}}, agent_id : result}) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(ptr0) + mbt_ffi_free(return_area) + return ret + +} ///| /// Forks the current agent at the current execution point. The new agent gets the same base agent ID but /// with a new unique phantom ID. The phantom ID of the forked agent is returned in `fork-result` on /// both sides. The newly created agent continues running from the same point, but the return value is /// going to be different in this agent and the forked agent. pub fn fork() -> ForkResult { - let return_area = mbt_ffi_malloc(24) - wasmImportFork(return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => - ForkResult::Original(ForkDetails::{ - forked_phantom_id: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 16).reinterpret_as_uint64(), - }, - }) - 1 => - ForkResult::Forked(ForkDetails::{ - forked_phantom_id: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 16).reinterpret_as_uint64(), - }, - }) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret + + let return_area = mbt_ffi_malloc(24) + wasmImportFork(return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + ForkResult::Original(ForkDetails::{forked_phantom_id : @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 16)).reinterpret_as_uint64()}}) + } + 1 => { + + ForkResult::Forked(ForkDetails::{forked_phantom_id : @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 16)).reinterpret_as_uint64()}}) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/api/oplog/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/api/oplog/ffi.mbt index c4d35b4ab6..b1196d9982 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/api/oplog/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/api/oplog/ffi.mbt @@ -1,145 +1,115 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropGetOplog(resource : Int) = "golem:api/oplog@1.5.0" "[resource-drop]get-oplog" -///| fn wasmImportResourceDropSearchOplog(resource : Int) = "golem:api/oplog@1.5.0" "[resource-drop]search-oplog" -///| -fn wasmImportEnrichOplogEntries( - p0 : Int64, - p1 : Int64, - p2 : Int64, - p3 : Int64, - p4 : Int, - p5 : Int, - p6 : Int, - p7 : Int, - p8 : Int64, - p9 : Int, -) = "golem:api/oplog@1.5.0" "enrich-oplog-entries" +fn wasmImportEnrichOplogEntries(p0 : Int64, p1 : Int64, p2 : Int64, p3 : Int64, p4 : Int, p5 : Int, p6 : Int, p7 : Int, p8 : Int64, p9 : Int) = "golem:api/oplog@1.5.0" "enrich-oplog-entries" -///| -fn wasmImportConstructorGetOplog( - p0 : Int64, - p1 : Int64, - p2 : Int, - p3 : Int, - p4 : Int64, -) -> Int = "golem:api/oplog@1.5.0" "[constructor]get-oplog" +fn wasmImportConstructorGetOplog(p0 : Int64, p1 : Int64, p2 : Int, p3 : Int, p4 : Int64) -> Int = "golem:api/oplog@1.5.0" "[constructor]get-oplog" -///| -fn wasmImportMethodGetOplogGetNext(p0 : Int, p1 : Int) = "golem:api/oplog@1.5.0" "[method]get-oplog.get-next" +fn wasmImportMethodGetOplogGetNext(p0 : Int, p1 : Int) = "golem:api/oplog@1.5.0" "[method]get-oplog.get-next" + +fn wasmImportConstructorSearchOplog(p0 : Int64, p1 : Int64, p2 : Int, p3 : Int, p4 : Int, p5 : Int) -> Int = "golem:api/oplog@1.5.0" "[constructor]search-oplog" + +fn wasmImportMethodSearchOplogGetNext(p0 : Int, p1 : Int) = "golem:api/oplog@1.5.0" "[method]search-oplog.get-next" ///| -fn wasmImportConstructorSearchOplog( - p0 : Int64, - p1 : Int64, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) -> Int = "golem:api/oplog@1.5.0" "[constructor]search-oplog" +extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_u) ///| -fn wasmImportMethodSearchOplogGetNext(p0 : Int, p1 : Int) = "golem:api/oplog@1.5.0" "[method]search-oplog.get-next" +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| -extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = +#|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) ///| #owned(bytes) extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend16_s) - -///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_s) ///| -extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) +extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend8_s) ///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend16_s) ///| -extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = - #|(func (param i32) (result f64) local.get 0 f64.load) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = +#|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) ///| -extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_s) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = - #|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend8_s) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = +#|(func (param i32) (result f32) local.get 0 f32.load) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_s) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = +#|(func (param i32) (result f64) local.get 0 f64.load) ///| -extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_s) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = - #|(func (param i32) (result f32) local.get 0 f32.load) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) -///| -extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = - #|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) diff --git a/sdks/moonbit/golem_sdk/interface/golem/api/oplog/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/api/oplog/top.mbt index bd7d9ddf75..6cd7632fa3 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/api/oplog/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/api/oplog/top.mbt @@ -1,121 +1,82 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Whether an agent is durable (persistent oplog) or ephemeral. /// This mirrors the agent-mode enum in golem:agent/common@1.5.0; it is duplicated here to avoid /// a circular WIT package dependency between golem:api and golem:agent. pub(all) enum AgentMode { - DURABLE - EPHEMERAL + DURABLE; EPHEMERAL } derive(Show, Eq) -///| pub fn AgentMode::ordinal(self : AgentMode) -> Int { - match self { - DURABLE => 0 - EPHEMERAL => 1 - } + match self { + DURABLE => 0 + EPHEMERAL => 1 + } } -///| pub fn AgentMode::from(self : Int) -> AgentMode { - match self { - 0 => DURABLE - 1 => EPHEMERAL - _ => panic() - } + match self { + 0 => DURABLE + 1 => EPHEMERAL + _ => panic() + } } - ///| pub(all) struct CountBoxState { - attempts : UInt - inner : Int + attempts : UInt; inner : Int } derive(Show, Eq) - ///| pub(all) struct AndThenState { - left : Int - right : Int - on_right : Bool + left : Int; right : Int; on_right : Bool } derive(Show, Eq) - ///| pub(all) struct PairState { - left : Int - right : Int + left : Int; right : Int } derive(Show, Eq) - ///| pub(all) enum StateNode { - Counter(UInt) - Terminal - Wrapper(Int) - CountBox(CountBoxState) - AndThen(AndThenState) - Pair(PairState) + Counter(UInt) + Terminal + Wrapper(Int) + CountBox(CountBoxState) + AndThen(AndThenState) + Pair(PairState) } derive(Show, Eq) - ///| /// Persistent state of a retry policy across retry attempts. /// Root is nodes[0]. Children referenced by state-node-index. pub(all) struct RetryPolicyState { - nodes : Array[StateNode] + nodes : Array[StateNode] } derive(Show, Eq) - ///| pub(all) struct EnvironmentPluginGrantId { - uuid : @types.Uuid + uuid : @types.Uuid } derive(Show, Eq) - ///| pub(all) enum WrappedFunctionType { - ReadLocal - WriteLocal - ReadRemote - WriteRemote - WriteRemoteBatched(UInt64?) - WriteRemoteTransaction(UInt64?) + ReadLocal + WriteLocal + ReadRemote + WriteRemote + WriteRemoteBatched(UInt64?) + WriteRemoteTransaction(UInt64?) } derive(Show, Eq) - ///| pub(all) struct PluginInstallationDescription { - environment_plugin_grant_id : EnvironmentPluginGrantId - plugin_priority : Int - plugin_name : String - plugin_version : String - parameters : Array[(String, String)] + environment_plugin_grant_id : EnvironmentPluginGrantId; plugin_priority : Int; plugin_name : String; plugin_version : String; parameters : Array[(String, String)] } derive(Show, Eq) - ///| pub(all) struct RawLocalAgentConfigEntry { - path : Array[String] - value : @types.SchemaValueTree + path : Array[String]; value : @types.SchemaValueTree } derive(Show, Eq) - ///| pub(all) struct LocalAgentConfigEntry { - path : Array[String] - value : @types.TypedSchemaValue + path : Array[String]; value : @types.TypedSchemaValue } derive(Show, Eq) - ///| pub(all) struct CreateParameters { - timestamp : @system-clock.Instant - agent_id : @types.AgentId - agent_mode : AgentMode - component_revision : UInt64 - env : Array[(String, String)] - created_by : @types.AccountId - environment_id : @host.EnvironmentId - parent : @types.AgentId? - component_size : UInt64 - initial_total_linear_memory_size : UInt64 - initial_active_plugins : Array[PluginInstallationDescription] - local_agent_config : Array[LocalAgentConfigEntry] - original_phantom_id : @types.Uuid? - instance_id : @types.Uuid + timestamp : @system-clock.Instant; agent_id : @types.AgentId; agent_mode : AgentMode; component_revision : UInt64; env : Array[(String, String)]; created_by : @types.AccountId; environment_id : @host.EnvironmentId; parent : @types.AgentId?; component_size : UInt64; initial_total_linear_memory_size : UInt64; initial_active_plugins : Array[PluginInstallationDescription]; local_agent_config : Array[LocalAgentConfigEntry]; original_phantom_id : @types.Uuid?; instance_id : @types.Uuid } derive(Show, Eq) - ///| /// Parameters of an enriched durable host-call `start` entry. /// @@ -125,84131 +86,68722 @@ pub(all) struct CreateParameters { /// tree, identified by `function-name`; there are no per-interface named WIT /// variants for the payload shapes. pub(all) struct StartParameters { - timestamp : @system-clock.Instant - parent_start_index : UInt64? - function_name : String - request : @types.TypedSchemaValue? - durable_function_type : WrappedFunctionType + timestamp : @system-clock.Instant; parent_start_index : UInt64?; function_name : String; request : @types.TypedSchemaValue?; durable_function_type : WrappedFunctionType } derive(Show, Eq) - ///| /// Parameters of an enriched durable host-call `end` entry. Like the /// `start` `request`, the recorded `response` payload surfaces as a generic /// `typed-schema-value` tree (no per-interface named WIT variants). pub(all) struct EndParameters { - timestamp : @system-clock.Instant - start_index : UInt64 - response : @types.TypedSchemaValue? - forced_commit : Bool + timestamp : @system-clock.Instant; start_index : UInt64; response : @types.TypedSchemaValue?; forced_commit : Bool } derive(Show, Eq) - ///| /// Parameters of an enriched durable host-call `cancelled` entry. Like the /// `start` `request`, the optional recorded `partial` result surfaces as a /// generic `typed-schema-value` tree (no per-interface named WIT variants). pub(all) struct CancelledParameters { - timestamp : @system-clock.Instant - start_index : UInt64 - partial : @types.TypedSchemaValue? + timestamp : @system-clock.Instant; start_index : UInt64; partial : @types.TypedSchemaValue? } derive(Show, Eq) - ///| /// Parameters of a `completion-discarded` entry: the durable host call started at /// `start-index` completed successfully (its `end` entry was persisted) but the response /// was never delivered to the agent, because the agent dropped the call's completion /// future after the `end` was already recorded. pub(all) struct CompletionDiscardedParameters { - timestamp : @system-clock.Instant - start_index : UInt64 + timestamp : @system-clock.Instant; start_index : UInt64 } derive(Show, Eq) - ///| pub(all) struct LocalSpanData { - span_id : String - start : @system-clock.Instant - parent : String? - linked_context : UInt64? - attributes : Array[@context.Attribute] - inherited : Bool + span_id : String; start : @system-clock.Instant; parent : String?; linked_context : UInt64?; attributes : Array[@context.Attribute]; inherited : Bool } derive(Show, Eq) - ///| pub(all) struct ExternalSpanData { - span_id : String + span_id : String } derive(Show, Eq) - ///| pub(all) enum SpanData { - LocalSpan(LocalSpanData) - ExternalSpan(ExternalSpanData) + LocalSpan(LocalSpanData) + ExternalSpan(ExternalSpanData) } derive(Show, Eq) - ///| pub(all) struct ErrorParameters { - timestamp : @system-clock.Instant - error : String - retry_from : UInt64 - inside_atomic_region : Bool - retry_policy_state : RetryPolicyState? + timestamp : @system-clock.Instant; error : String; retry_from : UInt64; inside_atomic_region : Bool; retry_policy_state : RetryPolicyState? } derive(Show, Eq) - ///| pub(all) struct OplogRegion { - start : UInt64 - end : UInt64 + start : UInt64; end : UInt64 } derive(Show, Eq) - ///| pub(all) struct JumpParameters { - timestamp : @system-clock.Instant - jump : OplogRegion + timestamp : @system-clock.Instant; jump : OplogRegion } derive(Show, Eq) - ///| /// Parameters for a set-retry-policy oplog entry. pub(all) struct SetRetryPolicyParameters { - timestamp : @system-clock.Instant - policy : @retry.NamedRetryPolicy + timestamp : @system-clock.Instant; policy : @retry.NamedRetryPolicy } derive(Show, Eq) - ///| /// Parameters for a remove-retry-policy oplog entry. pub(all) struct RemoveRetryPolicyParameters { - timestamp : @system-clock.Instant - name : String + timestamp : @system-clock.Instant; name : String } derive(Show, Eq) - ///| pub(all) struct QueuedCardEventInstall { - card_id : @types.CardId + card_id : @types.CardId } derive(Show, Eq) - ///| pub(all) struct QueuedCardEventRevoke { - card_id : @types.CardId + card_id : @types.CardId } derive(Show, Eq) - ///| pub(all) enum QueuedCardEvent { - Install(QueuedCardEventInstall) - Revoke(QueuedCardEventRevoke) + Install(QueuedCardEventInstall) + Revoke(QueuedCardEventRevoke) } derive(Show, Eq) - ///| /// Parameters for a card-event-queued oplog entry. pub(all) struct CardEventQueuedParameters { - timestamp : @system-clock.Instant - event : QueuedCardEvent + timestamp : @system-clock.Instant; event : QueuedCardEvent } derive(Show, Eq) - ///| /// Parameters for a card-installed oplog entry. pub(all) struct CardInstalledParameters { - timestamp : @system-clock.Instant - queued_event_index : UInt64? - card_id : @types.CardId + timestamp : @system-clock.Instant; queued_event_index : UInt64?; card_id : @types.CardId } derive(Show, Eq) - ///| /// Raw parameters for a card-installed oplog entry. pub(all) struct RawCardInstalledParameters { - timestamp : @system-clock.Instant - queued_event_index : UInt64? - card : FixedArray[Byte] + timestamp : @system-clock.Instant; queued_event_index : UInt64?; card : FixedArray[Byte] } derive(Show, Eq) - ///| pub(all) enum CardInstallFailure { - CARD_REVOKED - NOT_FOUND - RECIPIENT_MISMATCH - NOT_PERMITTED + CARD_REVOKED; NOT_FOUND; RECIPIENT_MISMATCH; NOT_PERMITTED } derive(Show, Eq) -///| pub fn CardInstallFailure::ordinal(self : CardInstallFailure) -> Int { - match self { - CARD_REVOKED => 0 - NOT_FOUND => 1 - RECIPIENT_MISMATCH => 2 - NOT_PERMITTED => 3 - } + match self { + CARD_REVOKED => 0 + NOT_FOUND => 1 + RECIPIENT_MISMATCH => 2 + NOT_PERMITTED => 3 + } } -///| pub fn CardInstallFailure::from(self : Int) -> CardInstallFailure { - match self { - 0 => CARD_REVOKED - 1 => NOT_FOUND - 2 => RECIPIENT_MISMATCH - 3 => NOT_PERMITTED - _ => panic() - } + match self { + 0 => CARD_REVOKED + 1 => NOT_FOUND + 2 => RECIPIENT_MISMATCH + 3 => NOT_PERMITTED + _ => panic() + } } - ///| /// Parameters for a card-install-failed oplog entry. pub(all) struct CardInstallFailedParameters { - timestamp : @system-clock.Instant - queued_event_index : UInt64 - card_id : @types.CardId - reason : CardInstallFailure + timestamp : @system-clock.Instant; queued_event_index : UInt64; card_id : @types.CardId; reason : CardInstallFailure } derive(Show, Eq) - ///| /// Parameters for a card-revoked oplog entry. pub(all) struct CardRevokedParameters { - timestamp : @system-clock.Instant - queued_event_index : UInt64 - card_id : @types.CardId + timestamp : @system-clock.Instant; queued_event_index : UInt64; card_id : @types.CardId } derive(Show, Eq) - ///| /// Parameters for a card-expired oplog entry. pub(all) struct CardExpiredParameters { - timestamp : @system-clock.Instant - card_id : @types.CardId + timestamp : @system-clock.Instant; card_id : @types.CardId } derive(Show, Eq) - ///| /// Identifies which host-owned stream a host-stream-frame oplog entry belongs to. /// The kind determines how the entry's payload is interpreted. pub(all) enum HostStreamKind { - P3_HTTP_REQUEST_BODY + P3_HTTP_REQUEST_BODY } derive(Show, Eq) -///| pub fn HostStreamKind::ordinal(self : HostStreamKind) -> Int { - match self { - P3_HTTP_REQUEST_BODY => 0 - } + match self { + P3_HTTP_REQUEST_BODY => 0 + } } -///| pub fn HostStreamKind::from(self : Int) -> HostStreamKind { - match self { - 0 => P3_HTTP_REQUEST_BODY - _ => panic() - } + match self { + 0 => P3_HTTP_REQUEST_BODY + _ => panic() + } } - ///| /// Parameters for a host-stream-frame oplog entry: a durably recorded frame of a /// host-owned stream (e.g. the outgoing request body of a P3 HTTP client send), /// attached to the durable host call identified by its start entry's index. pub(all) struct HostStreamFrameParameters { - timestamp : @system-clock.Instant - parent_start_index : UInt64 - kind : HostStreamKind - payload : @types.TypedSchemaValue + timestamp : @system-clock.Instant; parent_start_index : UInt64; kind : HostStreamKind; payload : @types.TypedSchemaValue } derive(Show, Eq) - ///| pub(all) struct EndAtomicRegionParameters { - timestamp : @system-clock.Instant - begin_index : UInt64 + timestamp : @system-clock.Instant; begin_index : UInt64 } derive(Show, Eq) - ///| pub(all) struct AgentInitializationParameters { - idempotency_key : String - constructor_parameters : @types.TypedSchemaValue - trace_id : String - trace_states : Array[String] - invocation_context : Array[Array[SpanData]] + idempotency_key : String; constructor_parameters : @types.TypedSchemaValue; trace_id : String; trace_states : Array[String]; invocation_context : Array[Array[SpanData]] } derive(Show, Eq) - ///| pub(all) struct AgentMethodInvocationParameters { - idempotency_key : String - method_name : String - function_input : @types.TypedSchemaValue - trace_id : String - trace_states : Array[String] - invocation_context : Array[Array[SpanData]] + idempotency_key : String; method_name : String; function_input : @types.TypedSchemaValue; trace_id : String; trace_states : Array[String]; invocation_context : Array[Array[SpanData]] } derive(Show, Eq) - ///| pub(all) struct ProcessOplogEntriesParameters { - idempotency_key : String + idempotency_key : String } derive(Show, Eq) - ///| pub(all) struct ManualUpdateParameters { - target_revision : UInt64 + target_revision : UInt64 } derive(Show, Eq) - ///| pub(all) struct AgentInvocationOutputParameters { - output : @types.TypedSchemaValue + output : @types.TypedSchemaValue } derive(Show, Eq) - ///| pub(all) struct FallibleResultParameters { - error : String? + error : String? } derive(Show, Eq) - ///| pub(all) enum UpdateDescription { - AutoUpdate - SnapshotBased(@host.Snapshot) + AutoUpdate + SnapshotBased(@host.Snapshot) } derive(Show, Eq) - ///| pub(all) struct PendingUpdateParameters { - timestamp : @system-clock.Instant - target_revision : UInt64 - description : UpdateDescription + timestamp : @system-clock.Instant; target_revision : UInt64; description : UpdateDescription } derive(Show, Eq) - ///| pub(all) struct SuccessfulUpdateParameters { - timestamp : @system-clock.Instant - target_revision : UInt64 - new_component_size : UInt64 - new_active_plugins : Array[PluginInstallationDescription] + timestamp : @system-clock.Instant; target_revision : UInt64; new_component_size : UInt64; new_active_plugins : Array[PluginInstallationDescription] } derive(Show, Eq) - ///| pub(all) struct FailedUpdateParameters { - timestamp : @system-clock.Instant - target_revision : UInt64 - details : String? + timestamp : @system-clock.Instant; target_revision : UInt64; details : String? } derive(Show, Eq) - ///| pub(all) struct GrowMemoryParameters { - timestamp : @system-clock.Instant - delta : UInt64 + timestamp : @system-clock.Instant; delta : UInt64 } derive(Show, Eq) - ///| pub(all) struct FilesystemStorageUsageUpdateParameters { - timestamp : @system-clock.Instant - delta : Int64 + timestamp : @system-clock.Instant; delta : Int64 } derive(Show, Eq) - ///| pub(all) struct CreateResourceParameters { - timestamp : @system-clock.Instant - id : UInt64 - name : String - owner : String + timestamp : @system-clock.Instant; id : UInt64; name : String; owner : String } derive(Show, Eq) - ///| pub(all) struct DropResourceParameters { - timestamp : @system-clock.Instant - id : UInt64 - name : String - owner : String + timestamp : @system-clock.Instant; id : UInt64; name : String; owner : String } derive(Show, Eq) - ///| pub(all) enum LogLevel { - STDOUT - STDERR - TRACE - DEBUG - INFO - WARN - ERROR - CRITICAL + STDOUT; STDERR; TRACE; DEBUG; INFO; WARN; ERROR; CRITICAL } derive(Show, Eq) -///| pub fn LogLevel::ordinal(self : LogLevel) -> Int { - match self { - STDOUT => 0 - STDERR => 1 - TRACE => 2 - DEBUG => 3 - INFO => 4 - WARN => 5 - ERROR => 6 - CRITICAL => 7 - } + match self { + STDOUT => 0 + STDERR => 1 + TRACE => 2 + DEBUG => 3 + INFO => 4 + WARN => 5 + ERROR => 6 + CRITICAL => 7 + } } -///| pub fn LogLevel::from(self : Int) -> LogLevel { - match self { - 0 => STDOUT - 1 => STDERR - 2 => TRACE - 3 => DEBUG - 4 => INFO - 5 => WARN - 6 => ERROR - 7 => CRITICAL - _ => panic() - } + match self { + 0 => STDOUT + 1 => STDERR + 2 => TRACE + 3 => DEBUG + 4 => INFO + 5 => WARN + 6 => ERROR + 7 => CRITICAL + _ => panic() + } } - ///| pub(all) struct LogParameters { - timestamp : @system-clock.Instant - level : LogLevel - context : String - message : String + timestamp : @system-clock.Instant; level : LogLevel; context : String; message : String } derive(Show, Eq) - ///| pub(all) struct ActivatePluginParameters { - timestamp : @system-clock.Instant - plugin : PluginInstallationDescription + timestamp : @system-clock.Instant; plugin : PluginInstallationDescription } derive(Show, Eq) - ///| pub(all) struct DeactivatePluginParameters { - timestamp : @system-clock.Instant - plugin : PluginInstallationDescription + timestamp : @system-clock.Instant; plugin : PluginInstallationDescription } derive(Show, Eq) - ///| pub(all) struct RevertParameters { - timestamp : @system-clock.Instant - dropped_region : OplogRegion + timestamp : @system-clock.Instant; dropped_region : OplogRegion } derive(Show, Eq) - ///| pub(all) struct CancelPendingInvocationParameters { - timestamp : @system-clock.Instant - idempotency_key : String + timestamp : @system-clock.Instant; idempotency_key : String } derive(Show, Eq) - ///| pub(all) struct StartSpanParameters { - timestamp : @system-clock.Instant - span_id : String - parent : String? - linked_context_id : String? - attributes : Array[@context.Attribute] + timestamp : @system-clock.Instant; span_id : String; parent : String?; linked_context_id : String?; attributes : Array[@context.Attribute] } derive(Show, Eq) - ///| pub(all) struct FinishSpanParameters { - timestamp : @system-clock.Instant - span_id : String + timestamp : @system-clock.Instant; span_id : String } derive(Show, Eq) - ///| pub(all) struct SetSpanAttributeParameters { - timestamp : @system-clock.Instant - span_id : String - key : String - value : @context.AttributeValue + timestamp : @system-clock.Instant; span_id : String; key : String; value : @context.AttributeValue } derive(Show, Eq) - ///| pub(all) struct ChangePersistenceLevelParameters { - timestamp : @system-clock.Instant - persistence_level : @host.PersistenceLevel + timestamp : @system-clock.Instant; persistence_level : @host.PersistenceLevel } derive(Show, Eq) - ///| pub(all) struct BeginRemoteTransactionParameters { - timestamp : @system-clock.Instant - transaction_id : String + timestamp : @system-clock.Instant; transaction_id : String } derive(Show, Eq) - ///| pub(all) struct RemoteTransactionParameters { - timestamp : @system-clock.Instant - begin_index : UInt64 + timestamp : @system-clock.Instant; begin_index : UInt64 } derive(Show, Eq) - ///| pub(all) struct SnapshotData { - data : FixedArray[Byte] - mime_type : String + data : FixedArray[Byte]; mime_type : String } derive(Show, Eq) - ///| pub(all) struct LoadSnapshotParameters { - snapshot : SnapshotData + snapshot : SnapshotData } derive(Show, Eq) - ///| pub(all) enum AgentInvocation { - AgentInitialization(AgentInitializationParameters) - AgentMethodInvocation(AgentMethodInvocationParameters) - SaveSnapshot - LoadSnapshot(LoadSnapshotParameters) - ProcessOplogEntries(ProcessOplogEntriesParameters) - ManualUpdate(ManualUpdateParameters) + AgentInitialization(AgentInitializationParameters) + AgentMethodInvocation(AgentMethodInvocationParameters) + SaveSnapshot + LoadSnapshot(LoadSnapshotParameters) + ProcessOplogEntries(ProcessOplogEntriesParameters) + ManualUpdate(ManualUpdateParameters) } derive(Show, Eq) - ///| pub(all) struct AgentInvocationStartedParameters { - timestamp : @system-clock.Instant - invocation : AgentInvocation + timestamp : @system-clock.Instant; invocation : AgentInvocation } derive(Show, Eq) - ///| pub(all) struct SaveSnapshotResultParameters { - snapshot : SnapshotData + snapshot : SnapshotData } derive(Show, Eq) - ///| pub(all) enum AgentInvocationResult { - AgentInitialization(AgentInvocationOutputParameters) - AgentMethod(AgentInvocationOutputParameters) - ManualUpdate - LoadSnapshot(FallibleResultParameters) - SaveSnapshot(SaveSnapshotResultParameters) - ProcessOplogEntries(FallibleResultParameters) + AgentInitialization(AgentInvocationOutputParameters) + AgentMethod(AgentInvocationOutputParameters) + ManualUpdate + LoadSnapshot(FallibleResultParameters) + SaveSnapshot(SaveSnapshotResultParameters) + ProcessOplogEntries(FallibleResultParameters) } derive(Show, Eq) - ///| pub(all) struct AgentInvocationFinishedParameters { - timestamp : @system-clock.Instant - result : AgentInvocationResult - method_name : String? - consumed_fuel : Int64 - component_revision : UInt64 + timestamp : @system-clock.Instant; result : AgentInvocationResult; method_name : String?; consumed_fuel : Int64; component_revision : UInt64 } derive(Show, Eq) - ///| pub(all) struct PendingAgentInvocationParameters { - timestamp : @system-clock.Instant - invocation : AgentInvocation + timestamp : @system-clock.Instant; invocation : AgentInvocation } derive(Show, Eq) - ///| pub(all) struct SnapshotParameters { - timestamp : @system-clock.Instant - data : SnapshotData + timestamp : @system-clock.Instant; data : SnapshotData } derive(Show, Eq) - ///| pub(all) struct OplogProcessorCheckpointParameters { - timestamp : @system-clock.Instant - plugin : PluginInstallationDescription - target_agent_id : @types.AgentId - confirmed_up_to : UInt64 - sending_up_to : UInt64 - last_batch_start : UInt64 + timestamp : @system-clock.Instant; plugin : PluginInstallationDescription; target_agent_id : @types.AgentId; confirmed_up_to : UInt64; sending_up_to : UInt64; last_batch_start : UInt64 } derive(Show, Eq) - ///| pub(all) struct Timestamp { - timestamp : @system-clock.Instant + timestamp : @system-clock.Instant } derive(Show, Eq) - ///| pub(all) struct OplogExternalPayload { - payload_id : @types.Uuid - md5_hash : FixedArray[Byte] + payload_id : @types.Uuid; md5_hash : FixedArray[Byte] } derive(Show, Eq) - ///| /// Opaque oplog payload, which can either be serialized inline or stored externally pub(all) enum OplogPayload { - Inline(FixedArray[Byte]) - External(OplogExternalPayload) + Inline(FixedArray[Byte]) + External(OplogExternalPayload) } derive(Show, Eq) - ///| pub(all) struct AgentTerminatedByQuotaError { - environment_id : @host.EnvironmentId - resource_name : String + environment_id : @host.EnvironmentId; resource_name : String } derive(Show, Eq) - ///| pub(all) struct EphemeralSleepTooLong { - requested_nanos : UInt64 - max_nanos : UInt64 + requested_nanos : UInt64; max_nanos : UInt64 } derive(Show, Eq) - ///| pub(all) struct EphemeralFuelExhausted { - overdraft_limit : UInt64 + overdraft_limit : UInt64 } derive(Show, Eq) - ///| pub(all) struct EphemeralCannotSuspend { - reason : String + reason : String } derive(Show, Eq) - ///| pub(all) struct ReadOnlyViolation { - method_ : String - host_function : String + method_ : String; host_function : String } derive(Show, Eq) - ///| /// Describes the error that occurred in the agent pub(all) suberror WorkerError { - Unknown(String) - InvalidRequest(String) - StackOverflow - OutOfMemory - ExceededMemoryLimit - InternalError(String) - DeterministicTrap(String) - TransientError(String) - PermanentError(String) - ExceededTableLimit - ExceededHttpCallLimit - ExceededRpcCallLimit - NodeOutOfFilesystemStorage - AgentExceededFilesystemStorageLimit - AgentTerminatedByQuota(AgentTerminatedByQuotaError) - EphemeralSleepTooLong(EphemeralSleepTooLong) - EphemeralFuelExhausted(EphemeralFuelExhausted) - EphemeralCannotSuspend(EphemeralCannotSuspend) - ReadOnlyViolation(ReadOnlyViolation) + Unknown(String) + InvalidRequest(String) + StackOverflow + OutOfMemory + ExceededMemoryLimit + InternalError(String) + DeterministicTrap(String) + TransientError(String) + PermanentError(String) + ExceededTableLimit + ExceededHttpCallLimit + ExceededRpcCallLimit + NodeOutOfFilesystemStorage + AgentExceededFilesystemStorageLimit + AgentTerminatedByQuota(AgentTerminatedByQuotaError) + EphemeralSleepTooLong(EphemeralSleepTooLong) + EphemeralFuelExhausted(EphemeralFuelExhausted) + EphemeralCannotSuspend(EphemeralCannotSuspend) + ReadOnlyViolation(ReadOnlyViolation) } derive(Show, Eq) - ///| pub(all) struct RawCreateParameters { - timestamp : @system-clock.Instant - agent_id : @types.AgentId - agent_mode : AgentMode - component_revision : UInt64 - env : Array[(String, String)] - environment_id : @host.EnvironmentId - created_by : @types.AccountId - parent : @types.AgentId? - component_size : UInt64 - initial_total_linear_memory_size : UInt64 - initial_active_plugins : Array[EnvironmentPluginGrantId] - local_agent_config : Array[RawLocalAgentConfigEntry] - original_phantom_id : @types.Uuid? - instance_id : @types.Uuid + timestamp : @system-clock.Instant; agent_id : @types.AgentId; agent_mode : AgentMode; component_revision : UInt64; env : Array[(String, String)]; environment_id : @host.EnvironmentId; created_by : @types.AccountId; parent : @types.AgentId?; component_size : UInt64; initial_total_linear_memory_size : UInt64; initial_active_plugins : Array[EnvironmentPluginGrantId]; local_agent_config : Array[RawLocalAgentConfigEntry]; original_phantom_id : @types.Uuid?; instance_id : @types.Uuid } derive(Show, Eq) - ///| pub(all) struct RawStartParameters { - timestamp : @system-clock.Instant - parent_start_index : UInt64? - function_name : String - request : OplogPayload? - durable_function_type : WrappedFunctionType + timestamp : @system-clock.Instant; parent_start_index : UInt64?; function_name : String; request : OplogPayload?; durable_function_type : WrappedFunctionType } derive(Show, Eq) - ///| pub(all) struct RawEndParameters { - timestamp : @system-clock.Instant - start_index : UInt64 - response : OplogPayload? - forced_commit : Bool + timestamp : @system-clock.Instant; start_index : UInt64; response : OplogPayload?; forced_commit : Bool } derive(Show, Eq) - ///| pub(all) struct RawCancelledParameters { - timestamp : @system-clock.Instant - start_index : UInt64 - partial : OplogPayload? + timestamp : @system-clock.Instant; start_index : UInt64; partial : OplogPayload? } derive(Show, Eq) - ///| pub(all) struct RawCompletionDiscardedParameters { - timestamp : @system-clock.Instant - start_index : UInt64 + timestamp : @system-clock.Instant; start_index : UInt64 } derive(Show, Eq) - ///| /// Parameters for a host-stream-frame oplog entry, with the frame payload in raw /// (possibly externally stored) form. pub(all) struct RawHostStreamFrameParameters { - timestamp : @system-clock.Instant - parent_start_index : UInt64 - kind : HostStreamKind - payload : OplogPayload + timestamp : @system-clock.Instant; parent_start_index : UInt64; kind : HostStreamKind; payload : OplogPayload } derive(Show, Eq) - ///| pub(all) struct RawAgentInvocationStartedParameters { - timestamp : @system-clock.Instant - idempotency_key : String - payload : OplogPayload - trace_id : String - trace_states : Array[String] - invocation_context : Array[SpanData] + timestamp : @system-clock.Instant; idempotency_key : String; payload : OplogPayload; trace_id : String; trace_states : Array[String]; invocation_context : Array[SpanData] } derive(Show, Eq) - ///| pub(all) struct RawAgentInvocationFinishedParameters { - timestamp : @system-clock.Instant - result : OplogPayload - method_name : String? - consumed_fuel : Int64 - component_revision : UInt64 + timestamp : @system-clock.Instant; result : OplogPayload; method_name : String?; consumed_fuel : Int64; component_revision : UInt64 } derive(Show, Eq) - ///| pub(all) struct RawErrorParameters { - timestamp : @system-clock.Instant - error : WorkerError - retry_from : UInt64 - inside_atomic_region : Bool - retry_policy_state : RetryPolicyState? + timestamp : @system-clock.Instant; error : WorkerError; retry_from : UInt64; inside_atomic_region : Bool; retry_policy_state : RetryPolicyState? } derive(Show, Eq) - ///| pub(all) struct RawPendingAgentInvocationParameters { - timestamp : @system-clock.Instant - idempotency_key : String - payload : OplogPayload - trace_id : String - trace_states : Array[String] - invocation_context : Array[SpanData] + timestamp : @system-clock.Instant; idempotency_key : String; payload : OplogPayload; trace_id : String; trace_states : Array[String]; invocation_context : Array[SpanData] } derive(Show, Eq) - ///| pub(all) struct RawSnapshotBasedUpdate { - target_revision : UInt64 - payload : OplogPayload - mime_type : String + target_revision : UInt64; payload : OplogPayload; mime_type : String } derive(Show, Eq) - ///| /// Raw update description used in oplog entries pub(all) enum RawUpdateDescription { - Automatic(UInt64) - SnapshotBased(RawSnapshotBasedUpdate) + Automatic(UInt64) + SnapshotBased(RawSnapshotBasedUpdate) } derive(Show, Eq) - ///| pub(all) struct RawPendingUpdateParameters { - timestamp : @system-clock.Instant - description : RawUpdateDescription + timestamp : @system-clock.Instant; description : RawUpdateDescription } derive(Show, Eq) - ///| pub(all) struct RawSuccessfulUpdateParameters { - timestamp : @system-clock.Instant - target_revision : UInt64 - new_component_size : UInt64 - new_active_plugins : Array[EnvironmentPluginGrantId] + timestamp : @system-clock.Instant; target_revision : UInt64; new_component_size : UInt64; new_active_plugins : Array[EnvironmentPluginGrantId] } derive(Show, Eq) - ///| pub(all) struct ResourceTypeId { - name : String - owner : String + name : String; owner : String } derive(Show, Eq) - ///| pub(all) struct RawCreateResourceParameters { - timestamp : @system-clock.Instant - id : UInt64 - resource_type_id : ResourceTypeId + timestamp : @system-clock.Instant; id : UInt64; resource_type_id : ResourceTypeId } derive(Show, Eq) - ///| pub(all) struct RawDropResourceParameters { - timestamp : @system-clock.Instant - id : UInt64 - resource_type_id : ResourceTypeId + timestamp : @system-clock.Instant; id : UInt64; resource_type_id : ResourceTypeId } derive(Show, Eq) - ///| pub(all) struct RawActivatePluginParameters { - timestamp : @system-clock.Instant - plugin_grant_id : EnvironmentPluginGrantId + timestamp : @system-clock.Instant; plugin_grant_id : EnvironmentPluginGrantId } derive(Show, Eq) - ///| pub(all) struct RawDeactivatePluginParameters { - timestamp : @system-clock.Instant - plugin_grant_id : EnvironmentPluginGrantId + timestamp : @system-clock.Instant; plugin_grant_id : EnvironmentPluginGrantId } derive(Show, Eq) - ///| pub(all) struct RawBeginRemoteTransactionParameters { - timestamp : @system-clock.Instant - transaction_id : String - original_begin_index : UInt64? + timestamp : @system-clock.Instant; transaction_id : String; original_begin_index : UInt64? } derive(Show, Eq) - ///| pub(all) struct RawSnapshotParameters { - timestamp : @system-clock.Instant - data : OplogPayload - mime_type : String + timestamp : @system-clock.Instant; data : OplogPayload; mime_type : String } derive(Show, Eq) - ///| pub(all) struct RawOplogProcessorCheckpointParameters { - timestamp : @system-clock.Instant - plugin_grant_id : EnvironmentPluginGrantId - target_agent_id : @types.AgentId - confirmed_up_to : UInt64 - sending_up_to : UInt64 - last_batch_start : UInt64 + timestamp : @system-clock.Instant; plugin_grant_id : EnvironmentPluginGrantId; target_agent_id : @types.AgentId; confirmed_up_to : UInt64; sending_up_to : UInt64; last_batch_start : UInt64 } derive(Show, Eq) - ///| pub(all) enum OplogEntry { - Create(RawCreateParameters) - Start(RawStartParameters) - End(RawEndParameters) - Cancelled(RawCancelledParameters) - AgentInvocationStarted(RawAgentInvocationStartedParameters) - AgentInvocationFinished(RawAgentInvocationFinishedParameters) - Suspend(Timestamp) - Error(RawErrorParameters) - NoOp(Timestamp) - Jump(JumpParameters) - Interrupted(Timestamp) - Exited(Timestamp) - BeginAtomicRegion(Timestamp) - EndAtomicRegion(EndAtomicRegionParameters) - PendingAgentInvocation(RawPendingAgentInvocationParameters) - PendingUpdate(RawPendingUpdateParameters) - SuccessfulUpdate(RawSuccessfulUpdateParameters) - FailedUpdate(FailedUpdateParameters) - GrowMemory(GrowMemoryParameters) - FilesystemStorageUsageUpdate(FilesystemStorageUsageUpdateParameters) - CreateResource(RawCreateResourceParameters) - DropResource(RawDropResourceParameters) - Log(LogParameters) - Restart(Timestamp) - ActivatePlugin(RawActivatePluginParameters) - DeactivatePlugin(RawDeactivatePluginParameters) - Revert(RevertParameters) - CancelPendingInvocation(CancelPendingInvocationParameters) - StartSpan(StartSpanParameters) - FinishSpan(FinishSpanParameters) - SetSpanAttribute(SetSpanAttributeParameters) - ChangePersistenceLevel(ChangePersistenceLevelParameters) - BeginRemoteTransaction(RawBeginRemoteTransactionParameters) - PreCommitRemoteTransaction(RemoteTransactionParameters) - PreRollbackRemoteTransaction(RemoteTransactionParameters) - CommittedRemoteTransaction(RemoteTransactionParameters) - RolledBackRemoteTransaction(RemoteTransactionParameters) - Snapshot(RawSnapshotParameters) - OplogProcessorCheckpoint(RawOplogProcessorCheckpointParameters) - SetRetryPolicy(SetRetryPolicyParameters) - RemoveRetryPolicy(RemoveRetryPolicyParameters) - CardEventQueued(CardEventQueuedParameters) - CardInstalled(RawCardInstalledParameters) - CardInstallFailed(CardInstallFailedParameters) - CardRevoked(CardRevokedParameters) - CardExpired(CardExpiredParameters) - HostStreamFrame(RawHostStreamFrameParameters) - CompletionDiscarded(RawCompletionDiscardedParameters) + Create(RawCreateParameters) + Start(RawStartParameters) + End(RawEndParameters) + Cancelled(RawCancelledParameters) + AgentInvocationStarted(RawAgentInvocationStartedParameters) + AgentInvocationFinished(RawAgentInvocationFinishedParameters) + Suspend(Timestamp) + Error(RawErrorParameters) + NoOp(Timestamp) + Jump(JumpParameters) + Interrupted(Timestamp) + Exited(Timestamp) + BeginAtomicRegion(Timestamp) + EndAtomicRegion(EndAtomicRegionParameters) + PendingAgentInvocation(RawPendingAgentInvocationParameters) + PendingUpdate(RawPendingUpdateParameters) + SuccessfulUpdate(RawSuccessfulUpdateParameters) + FailedUpdate(FailedUpdateParameters) + GrowMemory(GrowMemoryParameters) + FilesystemStorageUsageUpdate(FilesystemStorageUsageUpdateParameters) + CreateResource(RawCreateResourceParameters) + DropResource(RawDropResourceParameters) + Log(LogParameters) + Restart(Timestamp) + ActivatePlugin(RawActivatePluginParameters) + DeactivatePlugin(RawDeactivatePluginParameters) + Revert(RevertParameters) + CancelPendingInvocation(CancelPendingInvocationParameters) + StartSpan(StartSpanParameters) + FinishSpan(FinishSpanParameters) + SetSpanAttribute(SetSpanAttributeParameters) + ChangePersistenceLevel(ChangePersistenceLevelParameters) + BeginRemoteTransaction(RawBeginRemoteTransactionParameters) + PreCommitRemoteTransaction(RemoteTransactionParameters) + PreRollbackRemoteTransaction(RemoteTransactionParameters) + CommittedRemoteTransaction(RemoteTransactionParameters) + RolledBackRemoteTransaction(RemoteTransactionParameters) + Snapshot(RawSnapshotParameters) + OplogProcessorCheckpoint(RawOplogProcessorCheckpointParameters) + SetRetryPolicy(SetRetryPolicyParameters) + RemoveRetryPolicy(RemoveRetryPolicyParameters) + CardEventQueued(CardEventQueuedParameters) + CardInstalled(RawCardInstalledParameters) + CardInstallFailed(CardInstallFailedParameters) + CardRevoked(CardRevokedParameters) + CardExpired(CardExpiredParameters) + HostStreamFrame(RawHostStreamFrameParameters) + CompletionDiscarded(RawCompletionDiscardedParameters) } derive(Show, Eq) - ///| pub(all) enum PublicOplogEntry { - Create(CreateParameters) - Start(StartParameters) - End(EndParameters) - Cancelled(CancelledParameters) - AgentInvocationStarted(AgentInvocationStartedParameters) - AgentInvocationFinished(AgentInvocationFinishedParameters) - Suspend(Timestamp) - Error(ErrorParameters) - NoOp(Timestamp) - Jump(JumpParameters) - Interrupted(Timestamp) - Exited(Timestamp) - BeginAtomicRegion(Timestamp) - EndAtomicRegion(EndAtomicRegionParameters) - PendingAgentInvocation(PendingAgentInvocationParameters) - PendingUpdate(PendingUpdateParameters) - SuccessfulUpdate(SuccessfulUpdateParameters) - FailedUpdate(FailedUpdateParameters) - GrowMemory(GrowMemoryParameters) - FilesystemStorageUsageUpdate(FilesystemStorageUsageUpdateParameters) - CreateResource(CreateResourceParameters) - DropResource(DropResourceParameters) - Log(LogParameters) - Restart(Timestamp) - ActivatePlugin(ActivatePluginParameters) - DeactivatePlugin(DeactivatePluginParameters) - Revert(RevertParameters) - CancelPendingInvocation(CancelPendingInvocationParameters) - StartSpan(StartSpanParameters) - FinishSpan(FinishSpanParameters) - SetSpanAttribute(SetSpanAttributeParameters) - ChangePersistenceLevel(ChangePersistenceLevelParameters) - BeginRemoteTransaction(BeginRemoteTransactionParameters) - PreCommitRemoteTransaction(RemoteTransactionParameters) - PreRollbackRemoteTransaction(RemoteTransactionParameters) - CommittedRemoteTransaction(RemoteTransactionParameters) - RolledBackRemoteTransaction(RemoteTransactionParameters) - Snapshot(SnapshotParameters) - OplogProcessorCheckpoint(OplogProcessorCheckpointParameters) - SetRetryPolicy(SetRetryPolicyParameters) - RemoveRetryPolicy(RemoveRetryPolicyParameters) - CardEventQueued(CardEventQueuedParameters) - CardInstalled(CardInstalledParameters) - CardInstallFailed(CardInstallFailedParameters) - CardRevoked(CardRevokedParameters) - CardExpired(CardExpiredParameters) - HostStreamFrame(HostStreamFrameParameters) - CompletionDiscarded(CompletionDiscardedParameters) + Create(CreateParameters) + Start(StartParameters) + End(EndParameters) + Cancelled(CancelledParameters) + AgentInvocationStarted(AgentInvocationStartedParameters) + AgentInvocationFinished(AgentInvocationFinishedParameters) + Suspend(Timestamp) + Error(ErrorParameters) + NoOp(Timestamp) + Jump(JumpParameters) + Interrupted(Timestamp) + Exited(Timestamp) + BeginAtomicRegion(Timestamp) + EndAtomicRegion(EndAtomicRegionParameters) + PendingAgentInvocation(PendingAgentInvocationParameters) + PendingUpdate(PendingUpdateParameters) + SuccessfulUpdate(SuccessfulUpdateParameters) + FailedUpdate(FailedUpdateParameters) + GrowMemory(GrowMemoryParameters) + FilesystemStorageUsageUpdate(FilesystemStorageUsageUpdateParameters) + CreateResource(CreateResourceParameters) + DropResource(DropResourceParameters) + Log(LogParameters) + Restart(Timestamp) + ActivatePlugin(ActivatePluginParameters) + DeactivatePlugin(DeactivatePluginParameters) + Revert(RevertParameters) + CancelPendingInvocation(CancelPendingInvocationParameters) + StartSpan(StartSpanParameters) + FinishSpan(FinishSpanParameters) + SetSpanAttribute(SetSpanAttributeParameters) + ChangePersistenceLevel(ChangePersistenceLevelParameters) + BeginRemoteTransaction(BeginRemoteTransactionParameters) + PreCommitRemoteTransaction(RemoteTransactionParameters) + PreRollbackRemoteTransaction(RemoteTransactionParameters) + CommittedRemoteTransaction(RemoteTransactionParameters) + RolledBackRemoteTransaction(RemoteTransactionParameters) + Snapshot(SnapshotParameters) + OplogProcessorCheckpoint(OplogProcessorCheckpointParameters) + SetRetryPolicy(SetRetryPolicyParameters) + RemoveRetryPolicy(RemoveRetryPolicyParameters) + CardEventQueued(CardEventQueuedParameters) + CardInstalled(CardInstalledParameters) + CardInstallFailed(CardInstallFailedParameters) + CardRevoked(CardRevokedParameters) + CardExpired(CardExpiredParameters) + HostStreamFrame(HostStreamFrameParameters) + CompletionDiscarded(CompletionDiscardedParameters) } derive(Show, Eq) - ///| pub(all) struct GetOplog(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn GetOplog::drop(self : GetOplog) -> Unit { - let GetOplog(resource) = self - wasmImportResourceDropGetOplog(resource) + let GetOplog(resource) = self + wasmImportResourceDropGetOplog(resource) } - ///| pub(all) struct SearchOplog(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn SearchOplog::drop(self : SearchOplog) -> Unit { - let SearchOplog(resource) = self - wasmImportResourceDropSearchOplog(resource) + let SearchOplog(resource) = self + wasmImportResourceDropSearchOplog(resource) } - ///| /// Enriches raw oplog entries into public oplog entries by resolving oplog payloads /// and augmenting entries with component metadata. -pub fn enrich_oplog_entries( - environment_id : @host.EnvironmentId, - agent_id : @types.AgentId, - entries : Array[(UInt64, OplogEntry)], - component_revision : UInt64, -) -> Result[Array[PublicOplogEntry], String] { - let cleanup_list : Array[Int] = [] - - let ptr = mbt_ffi_str2ptr(agent_id.agent_id) - - let address459 = mbt_ffi_malloc(entries.length() * 216) - for index460 = 0; index460 < entries.length(); index460 = index460 + 1 { - let iter_elem : (UInt64, OplogEntry) = entries[index460] - let iter_base = address459 + index460 * 216 - mbt_ffi_store64(iter_base + 0, iter_elem.0.reinterpret_as_int64()) - - match iter_elem.1 { - Create(payload) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store64(iter_base + 16, payload.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload.agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 40, - payload.agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ) - - let ptr0 = mbt_ffi_str2ptr(payload.agent_id.agent_id) - mbt_ffi_store32(iter_base + 52, payload.agent_id.agent_id.length()) - mbt_ffi_store32(iter_base + 48, ptr0) - mbt_ffi_store8(iter_base + 56, payload.agent_mode.ordinal()) - mbt_ffi_store64( - iter_base + 64, - payload.component_revision.reinterpret_as_int64(), - ) - - let address = mbt_ffi_malloc(payload.env.length() * 16) - for index = 0; index < payload.env.length(); index = index + 1 { - let iter_elem : (String, String) = payload.env[index] - let iter_base = address + index * 16 - - let ptr1 = mbt_ffi_str2ptr(iter_elem.0) - mbt_ffi_store32(iter_base + 4, iter_elem.0.length()) - mbt_ffi_store32(iter_base + 0, ptr1) - - let ptr2 = mbt_ffi_str2ptr(iter_elem.1) - mbt_ffi_store32(iter_base + 12, iter_elem.1.length()) - mbt_ffi_store32(iter_base + 8, ptr2) - cleanup_list.push(ptr1) - cleanup_list.push(ptr2) - } - mbt_ffi_store32(iter_base + 76, payload.env.length()) - mbt_ffi_store32(iter_base + 72, address) - mbt_ffi_store64( - iter_base + 80, - payload.environment_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 88, - payload.environment_id.uuid.low_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 96, - payload.created_by.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 104, - payload.created_by.uuid.low_bits.reinterpret_as_int64(), - ) - - match payload.parent { - None => { - mbt_ffi_store8(iter_base + 112, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(iter_base + 112, 1) - mbt_ffi_store64( - iter_base + 120, - payload4.component_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 128, - payload4.component_id.uuid.low_bits.reinterpret_as_int64(), - ) - - let ptr5 = mbt_ffi_str2ptr(payload4.agent_id) - mbt_ffi_store32(iter_base + 140, payload4.agent_id.length()) - mbt_ffi_store32(iter_base + 136, ptr5) - cleanup_list.push(ptr5) - - () - } - } - mbt_ffi_store64( - iter_base + 144, - payload.component_size.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 152, - payload.initial_total_linear_memory_size.reinterpret_as_int64(), - ) - - let address6 = mbt_ffi_malloc( - payload.initial_active_plugins.length() * 16, - ) - for index7 = 0 - index7 < payload.initial_active_plugins.length() - index7 = index7 + 1 { - let iter_elem : EnvironmentPluginGrantId = payload.initial_active_plugins[index7] - let iter_base = address6 + index7 * 16 - mbt_ffi_store64( - iter_base + 0, - iter_elem.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 8, - iter_elem.uuid.low_bits.reinterpret_as_int64(), - ) - } - mbt_ffi_store32( - iter_base + 164, - payload.initial_active_plugins.length(), - ) - mbt_ffi_store32(iter_base + 160, address6) - - let address82 = mbt_ffi_malloc(payload.local_agent_config.length() * 20) - for index83 = 0 - index83 < payload.local_agent_config.length() - index83 = index83 + 1 { - let iter_elem : RawLocalAgentConfigEntry = payload.local_agent_config[index83] - let iter_base = address82 + index83 * 20 - - let address9 = mbt_ffi_malloc(iter_elem.path.length() * 8) - for index10 = 0 - index10 < iter_elem.path.length() - index10 = index10 + 1 { - let iter_elem : String = iter_elem.path[index10] - let iter_base = address9 + index10 * 8 - - let ptr8 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr8) - cleanup_list.push(ptr8) - } - mbt_ffi_store32(iter_base + 4, iter_elem.path.length()) - mbt_ffi_store32(iter_base + 0, address9) - - let address80 = mbt_ffi_malloc( - iter_elem.value.value_nodes.length() * 32, - ) - for index81 = 0 - index81 < iter_elem.value.value_nodes.length() - index81 = index81 + 1 { - let iter_elem : @types.SchemaValueNode = iter_elem.value.value_nodes[index81] - let iter_base = address80 + index81 * 32 - - match iter_elem { - BoolValue(payload11) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload11 { 1 } else { 0 }) - - () - } - S8Value(payload12) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload12)) - - () - } - S16Value(payload13) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload13)) - - () - } - S32Value(payload14) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload14) - - () - } - S64Value(payload15) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload15) - - () - } - U8Value(payload16) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload16.to_int()) - - () - } - U16Value(payload17) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload17.reinterpret_as_int()) - - () - } - U32Value(payload18) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload18.reinterpret_as_int()) - - () - } - U64Value(payload19) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload19.reinterpret_as_int64()) - - () - } - F32Value(payload20) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload20) - - () - } - F64Value(payload21) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload21) - - () - } - CharValue(payload22) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload22.to_int()) - - () - } - StringValue(payload23) => { - mbt_ffi_store8(iter_base + 0, 12) - - let ptr24 = mbt_ffi_str2ptr(payload23) - mbt_ffi_store32(iter_base + 12, payload23.length()) - mbt_ffi_store32(iter_base + 8, ptr24) - cleanup_list.push(ptr24) - - () - } - RecordValue(payload25) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address26 = mbt_ffi_malloc(payload25.length() * 4) - for index27 = 0 - index27 < payload25.length() - index27 = index27 + 1 { - let iter_elem : Int = payload25[index27] - let iter_base = address26 + index27 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload25.length()) - mbt_ffi_store32(iter_base + 8, address26) - cleanup_list.push(address26) - - () - } - VariantValue(payload28) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32( - iter_base + 8, - payload28.case.reinterpret_as_int(), - ) - - match payload28.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload30) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload30) +pub fn enrich_oplog_entries(environment_id : @host.EnvironmentId, agent_id : @types.AgentId, entries : Array[(UInt64, OplogEntry)], component_revision : UInt64) -> Result[Array[PublicOplogEntry], String] { + let cleanup_list : Array[Int] = [] - () - } - } - - () - } - EnumValue(payload31) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload31.reinterpret_as_int()) - - () - } - FlagsValue(payload32) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address33 = mbt_ffi_malloc(payload32.length() * 1) - for index34 = 0 - index34 < payload32.length() - index34 = index34 + 1 { - let iter_elem : Bool = payload32[index34] - let iter_base = address33 + index34 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload32.length()) - mbt_ffi_store32(iter_base + 8, address33) - cleanup_list.push(address33) - - () - } - TupleValue(payload35) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address36 = mbt_ffi_malloc(payload35.length() * 4) - for index37 = 0 - index37 < payload35.length() - index37 = index37 + 1 { - let iter_elem : Int = payload35[index37] - let iter_base = address36 + index37 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload35.length()) - mbt_ffi_store32(iter_base + 8, address36) - cleanup_list.push(address36) - - () - } - ListValue(payload38) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address39 = mbt_ffi_malloc(payload38.length() * 4) - for index40 = 0 - index40 < payload38.length() - index40 = index40 + 1 { - let iter_elem : Int = payload38[index40] - let iter_base = address39 + index40 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload38.length()) - mbt_ffi_store32(iter_base + 8, address39) - cleanup_list.push(address39) - - () - } - FixedListValue(payload41) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address42 = mbt_ffi_malloc(payload41.length() * 4) - for index43 = 0 - index43 < payload41.length() - index43 = index43 + 1 { - let iter_elem : Int = payload41[index43] - let iter_base = address42 + index43 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload41.length()) - mbt_ffi_store32(iter_base + 8, address42) - cleanup_list.push(address42) - - () - } - MapValue(payload44) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address45 = mbt_ffi_malloc(payload44.length() * 8) - for index46 = 0 - index46 < payload44.length() - index46 = index46 + 1 { - let iter_elem : @types.MapEntry = payload44[index46] - let iter_base = address45 + index46 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload44.length()) - mbt_ffi_store32(iter_base + 8, address45) - cleanup_list.push(address45) - - () - } - OptionValue(payload47) => { - mbt_ffi_store8(iter_base + 0, 21) - - match payload47 { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload49) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload49) + let ptr = mbt_ffi_str2ptr((agent_id).agent_id) - () - } - } + let address461 = mbt_ffi_malloc((entries).length() * 216); + for index462 = 0; index462 < (entries).length(); index462 = index462 + 1 { + let iter_elem : (UInt64, OplogEntry) = (entries)[(index462)] + let iter_base = address461 + (index462 * 216); + mbt_ffi_store64((iter_base) + 0, ((iter_elem).0).reinterpret_as_int64()) - () - } - ResultValue(payload50) => { - mbt_ffi_store8(iter_base + 0, 22) + match (iter_elem).1 { + Create(payload) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store64((iter_base) + 16, ((payload).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, (((((payload).agent_id).component_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 40, (((((payload).agent_id).component_id).uuid).low_bits).reinterpret_as_int64()) + + let ptr0 = mbt_ffi_str2ptr(((payload).agent_id).agent_id) + mbt_ffi_store32((iter_base) + 52, ((payload).agent_id).agent_id.length()) + mbt_ffi_store32((iter_base) + 48, ptr0) + mbt_ffi_store8((iter_base) + 56, (payload).agent_mode.ordinal()) + mbt_ffi_store64((iter_base) + 64, ((payload).component_revision).reinterpret_as_int64()) + + let address = mbt_ffi_malloc(((payload).env).length() * 16); + for index = 0; index < ((payload).env).length(); index = index + 1 { + let iter_elem : (String, String) = ((payload).env)[(index)] + let iter_base = address + (index * 16); + + let ptr1 = mbt_ffi_str2ptr((iter_elem).0) + mbt_ffi_store32((iter_base) + 4, (iter_elem).0.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + let ptr2 = mbt_ffi_str2ptr((iter_elem).1) + mbt_ffi_store32((iter_base) + 12, (iter_elem).1.length()) + mbt_ffi_store32((iter_base) + 8, ptr2) + cleanup_list.push(ptr1) + cleanup_list.push(ptr2) + + } + mbt_ffi_store32((iter_base) + 76, ((payload).env).length()) + mbt_ffi_store32((iter_base) + 72, address) + mbt_ffi_store64((iter_base) + 80, ((((payload).environment_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 88, ((((payload).environment_id).uuid).low_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 96, ((((payload).created_by).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 104, ((((payload).created_by).uuid).low_bits).reinterpret_as_int64()) + + match ((payload).parent) { + None => { + mbt_ffi_store8((iter_base) + 112, (0)) + + () + } + Some(payload4) => { + mbt_ffi_store8((iter_base) + 112, (1)) + mbt_ffi_store64((iter_base) + 120, ((((payload4).component_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 128, ((((payload4).component_id).uuid).low_bits).reinterpret_as_int64()) + + let ptr5 = mbt_ffi_str2ptr((payload4).agent_id) + mbt_ffi_store32((iter_base) + 140, (payload4).agent_id.length()) + mbt_ffi_store32((iter_base) + 136, ptr5) + cleanup_list.push(ptr5) + + () + } + } + mbt_ffi_store64((iter_base) + 144, ((payload).component_size).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 152, ((payload).initial_total_linear_memory_size).reinterpret_as_int64()) + + let address6 = mbt_ffi_malloc(((payload).initial_active_plugins).length() * 16); + for index7 = 0; index7 < ((payload).initial_active_plugins).length(); index7 = index7 + 1 { + let iter_elem : EnvironmentPluginGrantId = ((payload).initial_active_plugins)[(index7)] + let iter_base = address6 + (index7 * 16); + mbt_ffi_store64((iter_base) + 0, (((iter_elem).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 8, (((iter_elem).uuid).low_bits).reinterpret_as_int64()) + + } + mbt_ffi_store32((iter_base) + 164, ((payload).initial_active_plugins).length()) + mbt_ffi_store32((iter_base) + 160, address6) + + let address84 = mbt_ffi_malloc(((payload).local_agent_config).length() * 20); + for index85 = 0; index85 < ((payload).local_agent_config).length(); index85 = index85 + 1 { + let iter_elem : RawLocalAgentConfigEntry = ((payload).local_agent_config)[(index85)] + let iter_base = address84 + (index85 * 20); + + let address9 = mbt_ffi_malloc(((iter_elem).path).length() * 8); + for index10 = 0; index10 < ((iter_elem).path).length(); index10 = index10 + 1 { + let iter_elem : String = ((iter_elem).path)[(index10)] + let iter_base = address9 + (index10 * 8); + + let ptr8 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr8) + cleanup_list.push(ptr8) + + } + mbt_ffi_store32((iter_base) + 4, ((iter_elem).path).length()) + mbt_ffi_store32((iter_base) + 0, address9) + + let address82 = mbt_ffi_malloc((((iter_elem).value).value_nodes).length() * 32); + for index83 = 0; index83 < (((iter_elem).value).value_nodes).length(); index83 = index83 + 1 { + let iter_elem : @types.SchemaValueNode = (((iter_elem).value).value_nodes)[(index83)] + let iter_base = address82 + (index83 * 32); + + match iter_elem { + BoolValue(payload11) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload11 { 1 } else { 0 })) + + () + } + S8Value(payload12) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload12)) + + () + } + S16Value(payload13) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload13)) + + () + } + S32Value(payload14) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload14) + + () + } + S64Value(payload15) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload15) + + () + } + U8Value(payload16) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload16).to_int()) + + () + } + U16Value(payload17) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload17).reinterpret_as_int()) + + () + } + U32Value(payload18) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload18).reinterpret_as_int()) + + () + } + U64Value(payload19) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload19).reinterpret_as_int64()) + + () + } + F32Value(payload20) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload20) + + () + } + F64Value(payload21) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload21) + + () + } + CharValue(payload22) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload22).to_int()) + + () + } + StringValue(payload23) => { + mbt_ffi_store8((iter_base) + 0, (12)) + + let ptr24 = mbt_ffi_str2ptr(payload23) + mbt_ffi_store32((iter_base) + 12, payload23.length()) + mbt_ffi_store32((iter_base) + 8, ptr24) + cleanup_list.push(ptr24) + + () + } + RecordValue(payload25) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let address26 = mbt_ffi_malloc((payload25).length() * 4); + for index27 = 0; index27 < (payload25).length(); index27 = index27 + 1 { + let iter_elem : Int = (payload25)[(index27)] + let iter_base = address26 + (index27 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload25).length()) + mbt_ffi_store32((iter_base) + 8, address26) + cleanup_list.push(address26) + + () + } + VariantValue(payload28) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload28).case).reinterpret_as_int()) + + match ((payload28).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload30) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload30) + + () + } + } + + () + } + EnumValue(payload31) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload31).reinterpret_as_int()) + + () + } + FlagsValue(payload32) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address33 = mbt_ffi_malloc((payload32).length() * 1); + for index34 = 0; index34 < (payload32).length(); index34 = index34 + 1 { + let iter_elem : Bool = (payload32)[(index34)] + let iter_base = address33 + (index34 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload32).length()) + mbt_ffi_store32((iter_base) + 8, address33) + cleanup_list.push(address33) + + () + } + TupleValue(payload35) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address36 = mbt_ffi_malloc((payload35).length() * 4); + for index37 = 0; index37 < (payload35).length(); index37 = index37 + 1 { + let iter_elem : Int = (payload35)[(index37)] + let iter_base = address36 + (index37 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload35).length()) + mbt_ffi_store32((iter_base) + 8, address36) + cleanup_list.push(address36) + + () + } + ListValue(payload38) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address39 = mbt_ffi_malloc((payload38).length() * 4); + for index40 = 0; index40 < (payload38).length(); index40 = index40 + 1 { + let iter_elem : Int = (payload38)[(index40)] + let iter_base = address39 + (index40 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload38).length()) + mbt_ffi_store32((iter_base) + 8, address39) + cleanup_list.push(address39) + + () + } + FixedListValue(payload41) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address42 = mbt_ffi_malloc((payload41).length() * 4); + for index43 = 0; index43 < (payload41).length(); index43 = index43 + 1 { + let iter_elem : Int = (payload41)[(index43)] + let iter_base = address42 + (index43 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload41).length()) + mbt_ffi_store32((iter_base) + 8, address42) + cleanup_list.push(address42) + + () + } + MapValue(payload44) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let address45 = mbt_ffi_malloc((payload44).length() * 8); + for index46 = 0; index46 < (payload44).length(); index46 = index46 + 1 { + let iter_elem : @types.MapEntry = (payload44)[(index46)] + let iter_base = address45 + (index46 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload44).length()) + mbt_ffi_store32((iter_base) + 8, address45) + cleanup_list.push(address45) + + () + } + OptionValue(payload47) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + match (payload47) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload49) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload49) + + () + } + } + + () + } + ResultValue(payload50) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload50 { + OkValue(payload51) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload51) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload53) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload53) + + () + } + } + + () + } + ErrValue(payload54) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload54) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload56) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload56) + + () + } + } + + () + } + } + + () + } + TextValue(payload57) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr58 = mbt_ffi_str2ptr((payload57).text) + mbt_ffi_store32((iter_base) + 12, (payload57).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr58) + + match ((payload57).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload60) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr61 = mbt_ffi_str2ptr(payload60) + mbt_ffi_store32((iter_base) + 24, payload60.length()) + mbt_ffi_store32((iter_base) + 20, ptr61) + cleanup_list.push(ptr61) + + () + } + } + cleanup_list.push(ptr58) + + () + } + BinaryValue(payload62) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr63 = mbt_ffi_bytes2ptr((payload62).bytes) + + mbt_ffi_store32((iter_base) + 12, (payload62).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr63) + + match ((payload62).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload65) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr66 = mbt_ffi_str2ptr(payload65) + mbt_ffi_store32((iter_base) + 24, payload65.length()) + mbt_ffi_store32((iter_base) + 20, ptr66) + cleanup_list.push(ptr66) + + () + } + } + cleanup_list.push(ptr63) + + () + } + PathValue(payload67) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr68 = mbt_ffi_str2ptr(payload67) + mbt_ffi_store32((iter_base) + 12, payload67.length()) + mbt_ffi_store32((iter_base) + 8, ptr68) + cleanup_list.push(ptr68) + + () + } + UrlValue(payload69) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr70 = mbt_ffi_str2ptr(payload69) + mbt_ffi_store32((iter_base) + 12, payload69.length()) + mbt_ffi_store32((iter_base) + 8, ptr70) + cleanup_list.push(ptr70) + + () + } + DatetimeValue(payload71) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload71).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload71).nanoseconds).reinterpret_as_int()) + + () + } + DurationValue(payload72) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload72).nanoseconds) + + () + } + QuantityValueNode(payload73) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload73).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload73).scale) + + let ptr74 = mbt_ffi_str2ptr((payload73).unit) + mbt_ffi_store32((iter_base) + 24, (payload73).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr74) + cleanup_list.push(ptr74) + + () + } + UnionValue(payload75) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr76 = mbt_ffi_str2ptr((payload75).tag) + mbt_ffi_store32((iter_base) + 12, (payload75).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr76) + mbt_ffi_store32((iter_base) + 16, (payload75).body) + cleanup_list.push(ptr76) + + () + } + SecretValue(payload77) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let @types.Secret(handle) = payload77 + mbt_ffi_store32((iter_base) + 8, handle) + + () + } + QuotaTokenHandle(payload78) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let @types.QuotaToken(handle79) = payload78 + mbt_ffi_store32((iter_base) + 8, handle79) + + () + } + PermissionCardHandle(payload80) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let @types.PermissionCard(handle81) = payload80 + mbt_ffi_store32((iter_base) + 8, handle81) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 12, (((iter_elem).value).value_nodes).length()) + mbt_ffi_store32((iter_base) + 8, address82) + mbt_ffi_store32((iter_base) + 16, ((iter_elem).value).root) + cleanup_list.push(address9) + cleanup_list.push(address82) + + } + mbt_ffi_store32((iter_base) + 172, ((payload).local_agent_config).length()) + mbt_ffi_store32((iter_base) + 168, address84) + + match ((payload).original_phantom_id) { + None => { + mbt_ffi_store8((iter_base) + 176, (0)) + + () + } + Some(payload87) => { + mbt_ffi_store8((iter_base) + 176, (1)) + mbt_ffi_store64((iter_base) + 184, ((payload87).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 192, ((payload87).low_bits).reinterpret_as_int64()) + + () + } + } + mbt_ffi_store64((iter_base) + 200, (((payload).instance_id).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 208, (((payload).instance_id).low_bits).reinterpret_as_int64()) + cleanup_list.push(ptr0) + cleanup_list.push(address) + cleanup_list.push(address6) + cleanup_list.push(address84) - match payload50 { - OkValue(payload51) => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + Start(payload88) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store64((iter_base) + 16, ((payload88).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload88).timestamp).nanoseconds).reinterpret_as_int()) - match payload51 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + match ((payload88).parent_start_index) { + None => { + mbt_ffi_store8((iter_base) + 32, (0)) - () - } - Some(payload53) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload53) + () + } + Some(payload90) => { + mbt_ffi_store8((iter_base) + 32, (1)) + mbt_ffi_store64((iter_base) + 40, (payload90).reinterpret_as_int64()) - () - } - } + () + } + } - () - } - ErrValue(payload54) => { - mbt_ffi_store8(iter_base + 8, 1) + let ptr91 = mbt_ffi_str2ptr((payload88).function_name) + mbt_ffi_store32((iter_base) + 52, (payload88).function_name.length()) + mbt_ffi_store32((iter_base) + 48, ptr91) - match payload54 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + match ((payload88).request) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) - () - } - Some(payload56) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload56) + () + } + Some(payload93) => { + mbt_ffi_store8((iter_base) + 56, (1)) - () - } - } + match payload93 { + Inline(payload94) => { + mbt_ffi_store8((iter_base) + 64, (0)) - () - } - } + let ptr95 = mbt_ffi_bytes2ptr(payload94) - () - } - TextValue(payload57) => { - mbt_ffi_store8(iter_base + 0, 23) + mbt_ffi_store32((iter_base) + 76, payload94.length()) + mbt_ffi_store32((iter_base) + 72, ptr95) + cleanup_list.push(ptr95) - let ptr58 = mbt_ffi_str2ptr(payload57.text) - mbt_ffi_store32(iter_base + 12, payload57.text.length()) - mbt_ffi_store32(iter_base + 8, ptr58) + () + } + External(payload96) => { + mbt_ffi_store8((iter_base) + 64, (1)) + mbt_ffi_store64((iter_base) + 72, (((payload96).payload_id).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 80, (((payload96).payload_id).low_bits).reinterpret_as_int64()) - match payload57.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let ptr97 = mbt_ffi_bytes2ptr((payload96).md5_hash) - () - } - Some(payload60) => { - mbt_ffi_store8(iter_base + 16, 1) + mbt_ffi_store32((iter_base) + 92, (payload96).md5_hash.length()) + mbt_ffi_store32((iter_base) + 88, ptr97) + cleanup_list.push(ptr97) - let ptr61 = mbt_ffi_str2ptr(payload60) - mbt_ffi_store32(iter_base + 24, payload60.length()) - mbt_ffi_store32(iter_base + 20, ptr61) - cleanup_list.push(ptr61) + () + } + } - () - } - } - cleanup_list.push(ptr58) + () + } + } - () - } - BinaryValue(payload62) => { - mbt_ffi_store8(iter_base + 0, 24) + match (payload88).durable_function_type { + ReadLocal => { + mbt_ffi_store8((iter_base) + 96, (0)) - let ptr63 = mbt_ffi_bytes2ptr(payload62.bytes) + () + } + WriteLocal => { + mbt_ffi_store8((iter_base) + 96, (1)) - mbt_ffi_store32(iter_base + 12, payload62.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr63) + () + } + ReadRemote => { + mbt_ffi_store8((iter_base) + 96, (2)) - match payload62.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + WriteRemote => { + mbt_ffi_store8((iter_base) + 96, (3)) - () - } - Some(payload65) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + WriteRemoteBatched(payload102) => { + mbt_ffi_store8((iter_base) + 96, (4)) - let ptr66 = mbt_ffi_str2ptr(payload65) - mbt_ffi_store32(iter_base + 24, payload65.length()) - mbt_ffi_store32(iter_base + 20, ptr66) - cleanup_list.push(ptr66) + match (payload102) { + None => { + mbt_ffi_store8((iter_base) + 104, (0)) - () - } - } - cleanup_list.push(ptr63) - - () - } - PathValue(payload67) => { - mbt_ffi_store8(iter_base + 0, 25) - - let ptr68 = mbt_ffi_str2ptr(payload67) - mbt_ffi_store32(iter_base + 12, payload67.length()) - mbt_ffi_store32(iter_base + 8, ptr68) - cleanup_list.push(ptr68) - - () - } - UrlValue(payload69) => { - mbt_ffi_store8(iter_base + 0, 26) - - let ptr70 = mbt_ffi_str2ptr(payload69) - mbt_ffi_store32(iter_base + 12, payload69.length()) - mbt_ffi_store32(iter_base + 8, ptr70) - cleanup_list.push(ptr70) - - () - } - DatetimeValue(payload71) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload71.seconds) - mbt_ffi_store32( - iter_base + 16, - payload71.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload72) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload72.nanoseconds) - - () - } - QuantityValueNode(payload73) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload73.mantissa) - mbt_ffi_store32(iter_base + 16, payload73.scale) - - let ptr74 = mbt_ffi_str2ptr(payload73.unit) - mbt_ffi_store32(iter_base + 24, payload73.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr74) - cleanup_list.push(ptr74) - - () - } - UnionValue(payload75) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr76 = mbt_ffi_str2ptr(payload75.tag) - mbt_ffi_store32(iter_base + 12, payload75.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr76) - mbt_ffi_store32(iter_base + 16, payload75.body) - cleanup_list.push(ptr76) - - () - } - SecretValue(payload77) => { - mbt_ffi_store8(iter_base + 0, 31) - - let @types.Secret(handle) = payload77 - mbt_ffi_store32(iter_base + 8, handle) - - () - } - QuotaTokenHandle(payload78) => { - mbt_ffi_store8(iter_base + 0, 32) - - let @types.QuotaToken(handle79) = payload78 - mbt_ffi_store32(iter_base + 8, handle79) - - () - } - } - } - mbt_ffi_store32(iter_base + 12, iter_elem.value.value_nodes.length()) - mbt_ffi_store32(iter_base + 8, address80) - mbt_ffi_store32(iter_base + 16, iter_elem.value.root) - cleanup_list.push(address9) - cleanup_list.push(address80) - } - mbt_ffi_store32(iter_base + 172, payload.local_agent_config.length()) - mbt_ffi_store32(iter_base + 168, address82) - - match payload.original_phantom_id { - None => { - mbt_ffi_store8(iter_base + 176, 0) - - () - } - Some(payload85) => { - mbt_ffi_store8(iter_base + 176, 1) - mbt_ffi_store64( - iter_base + 184, - payload85.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 192, - payload85.low_bits.reinterpret_as_int64(), - ) - - () - } - } - mbt_ffi_store64( - iter_base + 200, - payload.instance_id.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 208, - payload.instance_id.low_bits.reinterpret_as_int64(), - ) - cleanup_list.push(ptr0) - cleanup_list.push(address) - cleanup_list.push(address6) - cleanup_list.push(address82) - - () - } - Start(payload86) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store64(iter_base + 16, payload86.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload86.timestamp.nanoseconds.reinterpret_as_int(), - ) - - match payload86.parent_start_index { - None => { - mbt_ffi_store8(iter_base + 32, 0) - - () - } - Some(payload88) => { - mbt_ffi_store8(iter_base + 32, 1) - mbt_ffi_store64(iter_base + 40, payload88.reinterpret_as_int64()) - - () - } - } - - let ptr89 = mbt_ffi_str2ptr(payload86.function_name) - mbt_ffi_store32(iter_base + 52, payload86.function_name.length()) - mbt_ffi_store32(iter_base + 48, ptr89) - - match payload86.request { - None => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - Some(payload91) => { - mbt_ffi_store8(iter_base + 56, 1) - - match payload91 { - Inline(payload92) => { - mbt_ffi_store8(iter_base + 64, 0) - - let ptr93 = mbt_ffi_bytes2ptr(payload92) - - mbt_ffi_store32(iter_base + 76, payload92.length()) - mbt_ffi_store32(iter_base + 72, ptr93) - cleanup_list.push(ptr93) - - () - } - External(payload94) => { - mbt_ffi_store8(iter_base + 64, 1) - mbt_ffi_store64( - iter_base + 72, - payload94.payload_id.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 80, - payload94.payload_id.low_bits.reinterpret_as_int64(), - ) - - let ptr95 = mbt_ffi_bytes2ptr(payload94.md5_hash) - - mbt_ffi_store32(iter_base + 92, payload94.md5_hash.length()) - mbt_ffi_store32(iter_base + 88, ptr95) - cleanup_list.push(ptr95) - - () - } - } + () + } + Some(payload104) => { + mbt_ffi_store8((iter_base) + 104, (1)) + mbt_ffi_store64((iter_base) + 112, (payload104).reinterpret_as_int64()) - () - } - } - - match payload86.durable_function_type { - ReadLocal => { - mbt_ffi_store8(iter_base + 96, 0) - - () - } - WriteLocal => { - mbt_ffi_store8(iter_base + 96, 1) - - () - } - ReadRemote => { - mbt_ffi_store8(iter_base + 96, 2) - - () - } - WriteRemote => { - mbt_ffi_store8(iter_base + 96, 3) - - () - } - WriteRemoteBatched(payload100) => { - mbt_ffi_store8(iter_base + 96, 4) - - match payload100 { - None => { - mbt_ffi_store8(iter_base + 104, 0) - - () - } - Some(payload102) => { - mbt_ffi_store8(iter_base + 104, 1) - mbt_ffi_store64( - iter_base + 112, - payload102.reinterpret_as_int64(), - ) - - () - } - } + () + } + } - () - } - WriteRemoteTransaction(payload103) => { - mbt_ffi_store8(iter_base + 96, 5) - - match payload103 { - None => { - mbt_ffi_store8(iter_base + 104, 0) - - () - } - Some(payload105) => { - mbt_ffi_store8(iter_base + 104, 1) - mbt_ffi_store64( - iter_base + 112, - payload105.reinterpret_as_int64(), - ) - - () - } - } + () + } + WriteRemoteTransaction(payload105) => { + mbt_ffi_store8((iter_base) + 96, (5)) - () - } - } - cleanup_list.push(ptr89) + match (payload105) { + None => { + mbt_ffi_store8((iter_base) + 104, (0)) - () - } - End(payload106) => { - mbt_ffi_store8(iter_base + 8, 2) - mbt_ffi_store64(iter_base + 16, payload106.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload106.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload106.start_index.reinterpret_as_int64(), - ) - - match payload106.response { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload108) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload108 { - Inline(payload109) => { - mbt_ffi_store8(iter_base + 48, 0) - - let ptr110 = mbt_ffi_bytes2ptr(payload109) - - mbt_ffi_store32(iter_base + 60, payload109.length()) - mbt_ffi_store32(iter_base + 56, ptr110) - cleanup_list.push(ptr110) - - () - } - External(payload111) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload111.payload_id.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 64, - payload111.payload_id.low_bits.reinterpret_as_int64(), - ) - - let ptr112 = mbt_ffi_bytes2ptr(payload111.md5_hash) - - mbt_ffi_store32(iter_base + 76, payload111.md5_hash.length()) - mbt_ffi_store32(iter_base + 72, ptr112) - cleanup_list.push(ptr112) - - () - } - } + () + } + Some(payload107) => { + mbt_ffi_store8((iter_base) + 104, (1)) + mbt_ffi_store64((iter_base) + 112, (payload107).reinterpret_as_int64()) - () - } - } - mbt_ffi_store8( - iter_base + 80, - if payload106.forced_commit { - 1 - } else { - 0 - }, - ) - - () - } - Cancelled(payload113) => { - mbt_ffi_store8(iter_base + 8, 3) - mbt_ffi_store64(iter_base + 16, payload113.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload113.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload113.start_index.reinterpret_as_int64(), - ) - - match payload113.partial { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload115) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload115 { - Inline(payload116) => { - mbt_ffi_store8(iter_base + 48, 0) - - let ptr117 = mbt_ffi_bytes2ptr(payload116) - - mbt_ffi_store32(iter_base + 60, payload116.length()) - mbt_ffi_store32(iter_base + 56, ptr117) - cleanup_list.push(ptr117) - - () - } - External(payload118) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload118.payload_id.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 64, - payload118.payload_id.low_bits.reinterpret_as_int64(), - ) - - let ptr119 = mbt_ffi_bytes2ptr(payload118.md5_hash) - - mbt_ffi_store32(iter_base + 76, payload118.md5_hash.length()) - mbt_ffi_store32(iter_base + 72, ptr119) - cleanup_list.push(ptr119) - - () - } - } + () + } + } - () - } - } + () + } + } + cleanup_list.push(ptr91) - () - } - AgentInvocationStarted(payload120) => { - mbt_ffi_store8(iter_base + 8, 4) - mbt_ffi_store64(iter_base + 16, payload120.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload120.timestamp.nanoseconds.reinterpret_as_int(), - ) - - let ptr121 = mbt_ffi_str2ptr(payload120.idempotency_key) - mbt_ffi_store32(iter_base + 36, payload120.idempotency_key.length()) - mbt_ffi_store32(iter_base + 32, ptr121) - - match payload120.payload { - Inline(payload122) => { - mbt_ffi_store8(iter_base + 40, 0) - - let ptr123 = mbt_ffi_bytes2ptr(payload122) - - mbt_ffi_store32(iter_base + 52, payload122.length()) - mbt_ffi_store32(iter_base + 48, ptr123) - cleanup_list.push(ptr123) - - () - } - External(payload124) => { - mbt_ffi_store8(iter_base + 40, 1) - mbt_ffi_store64( - iter_base + 48, - payload124.payload_id.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 56, - payload124.payload_id.low_bits.reinterpret_as_int64(), - ) - - let ptr125 = mbt_ffi_bytes2ptr(payload124.md5_hash) - - mbt_ffi_store32(iter_base + 68, payload124.md5_hash.length()) - mbt_ffi_store32(iter_base + 64, ptr125) - cleanup_list.push(ptr125) - - () - } - } - - let ptr126 = mbt_ffi_str2ptr(payload120.trace_id) - mbt_ffi_store32(iter_base + 76, payload120.trace_id.length()) - mbt_ffi_store32(iter_base + 72, ptr126) - - let address128 = mbt_ffi_malloc(payload120.trace_states.length() * 8) - for index129 = 0 - index129 < payload120.trace_states.length() - index129 = index129 + 1 { - let iter_elem : String = payload120.trace_states[index129] - let iter_base = address128 + index129 * 8 - - let ptr127 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr127) - cleanup_list.push(ptr127) - } - mbt_ffi_store32(iter_base + 84, payload120.trace_states.length()) - mbt_ffi_store32(iter_base + 80, address128) - - let address144 = mbt_ffi_malloc( - payload120.invocation_context.length() * 80, - ) - for index145 = 0 - index145 < payload120.invocation_context.length() - index145 = index145 + 1 { - let iter_elem : SpanData = payload120.invocation_context[index145] - let iter_base = address144 + index145 * 80 - - match iter_elem { - LocalSpan(payload130) => { - mbt_ffi_store8(iter_base + 0, 0) - - let ptr131 = mbt_ffi_str2ptr(payload130.span_id) - mbt_ffi_store32(iter_base + 12, payload130.span_id.length()) - mbt_ffi_store32(iter_base + 8, ptr131) - mbt_ffi_store64(iter_base + 16, payload130.start.seconds) - mbt_ffi_store32( - iter_base + 24, - payload130.start.nanoseconds.reinterpret_as_int(), - ) - - match payload130.parent { - None => { - mbt_ffi_store8(iter_base + 32, 0) - - () - } - Some(payload133) => { - mbt_ffi_store8(iter_base + 32, 1) - - let ptr134 = mbt_ffi_str2ptr(payload133) - mbt_ffi_store32(iter_base + 40, payload133.length()) - mbt_ffi_store32(iter_base + 36, ptr134) - cleanup_list.push(ptr134) - - () - } - } - - match payload130.linked_context { - None => { - mbt_ffi_store8(iter_base + 48, 0) - - () - } - Some(payload136) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload136.reinterpret_as_int64(), - ) - - () - } - } - - let address140 = mbt_ffi_malloc( - payload130.attributes.length() * 20, - ) - for index141 = 0 - index141 < payload130.attributes.length() - index141 = index141 + 1 { - let iter_elem : @context.Attribute = payload130.attributes[index141] - let iter_base = address140 + index141 * 20 - - let ptr137 = mbt_ffi_str2ptr(iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.key.length()) - mbt_ffi_store32(iter_base + 0, ptr137) - - match iter_elem.value { - String(payload138) => { - mbt_ffi_store8(iter_base + 8, 0) - - let ptr139 = mbt_ffi_str2ptr(payload138) - mbt_ffi_store32(iter_base + 16, payload138.length()) - mbt_ffi_store32(iter_base + 12, ptr139) - cleanup_list.push(ptr139) - - () + () } - } - cleanup_list.push(ptr137) - } - mbt_ffi_store32(iter_base + 68, payload130.attributes.length()) - mbt_ffi_store32(iter_base + 64, address140) - mbt_ffi_store8( - iter_base + 72, - if payload130.inherited { - 1 - } else { - 0 - }, - ) - cleanup_list.push(ptr131) - cleanup_list.push(address140) - - () - } - ExternalSpan(payload142) => { - mbt_ffi_store8(iter_base + 0, 1) + End(payload108) => { + mbt_ffi_store8((iter_base) + 8, (2)) + mbt_ffi_store64((iter_base) + 16, ((payload108).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload108).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload108).start_index).reinterpret_as_int64()) - let ptr143 = mbt_ffi_str2ptr(payload142.span_id) - mbt_ffi_store32(iter_base + 12, payload142.span_id.length()) - mbt_ffi_store32(iter_base + 8, ptr143) - cleanup_list.push(ptr143) + match ((payload108).response) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) - () - } - } - } - mbt_ffi_store32(iter_base + 92, payload120.invocation_context.length()) - mbt_ffi_store32(iter_base + 88, address144) - cleanup_list.push(ptr121) - cleanup_list.push(ptr126) - cleanup_list.push(address128) - cleanup_list.push(address144) - - () - } - AgentInvocationFinished(payload146) => { - mbt_ffi_store8(iter_base + 8, 5) - mbt_ffi_store64(iter_base + 16, payload146.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload146.timestamp.nanoseconds.reinterpret_as_int(), - ) - - match payload146.result { - Inline(payload147) => { - mbt_ffi_store8(iter_base + 32, 0) - - let ptr148 = mbt_ffi_bytes2ptr(payload147) - - mbt_ffi_store32(iter_base + 44, payload147.length()) - mbt_ffi_store32(iter_base + 40, ptr148) - cleanup_list.push(ptr148) - - () - } - External(payload149) => { - mbt_ffi_store8(iter_base + 32, 1) - mbt_ffi_store64( - iter_base + 40, - payload149.payload_id.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 48, - payload149.payload_id.low_bits.reinterpret_as_int64(), - ) - - let ptr150 = mbt_ffi_bytes2ptr(payload149.md5_hash) - - mbt_ffi_store32(iter_base + 60, payload149.md5_hash.length()) - mbt_ffi_store32(iter_base + 56, ptr150) - cleanup_list.push(ptr150) - - () - } - } - - match payload146.method_name { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload152) => { - mbt_ffi_store8(iter_base + 64, 1) - - let ptr153 = mbt_ffi_str2ptr(payload152) - mbt_ffi_store32(iter_base + 72, payload152.length()) - mbt_ffi_store32(iter_base + 68, ptr153) - cleanup_list.push(ptr153) - - () - } - } - mbt_ffi_store64(iter_base + 80, payload146.consumed_fuel) - mbt_ffi_store64( - iter_base + 88, - payload146.component_revision.reinterpret_as_int64(), - ) - - () - } - Suspend(payload154) => { - mbt_ffi_store8(iter_base + 8, 6) - mbt_ffi_store64(iter_base + 16, payload154.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload154.timestamp.nanoseconds.reinterpret_as_int(), - ) - - () - } - Error(payload155) => { - mbt_ffi_store8(iter_base + 8, 7) - mbt_ffi_store64(iter_base + 16, payload155.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload155.timestamp.nanoseconds.reinterpret_as_int(), - ) - - match payload155.error { - Unknown(payload156) => { - mbt_ffi_store8(iter_base + 32, 0) - - let ptr157 = mbt_ffi_str2ptr(payload156) - mbt_ffi_store32(iter_base + 44, payload156.length()) - mbt_ffi_store32(iter_base + 40, ptr157) - cleanup_list.push(ptr157) - - () - } - InvalidRequest(payload158) => { - mbt_ffi_store8(iter_base + 32, 1) - - let ptr159 = mbt_ffi_str2ptr(payload158) - mbt_ffi_store32(iter_base + 44, payload158.length()) - mbt_ffi_store32(iter_base + 40, ptr159) - cleanup_list.push(ptr159) - - () - } - StackOverflow => { - mbt_ffi_store8(iter_base + 32, 2) - - () - } - OutOfMemory => { - mbt_ffi_store8(iter_base + 32, 3) - - () - } - ExceededMemoryLimit => { - mbt_ffi_store8(iter_base + 32, 4) - - () - } - InternalError(payload163) => { - mbt_ffi_store8(iter_base + 32, 5) - - let ptr164 = mbt_ffi_str2ptr(payload163) - mbt_ffi_store32(iter_base + 44, payload163.length()) - mbt_ffi_store32(iter_base + 40, ptr164) - cleanup_list.push(ptr164) - - () - } - DeterministicTrap(payload165) => { - mbt_ffi_store8(iter_base + 32, 6) - - let ptr166 = mbt_ffi_str2ptr(payload165) - mbt_ffi_store32(iter_base + 44, payload165.length()) - mbt_ffi_store32(iter_base + 40, ptr166) - cleanup_list.push(ptr166) - - () - } - TransientError(payload167) => { - mbt_ffi_store8(iter_base + 32, 7) - - let ptr168 = mbt_ffi_str2ptr(payload167) - mbt_ffi_store32(iter_base + 44, payload167.length()) - mbt_ffi_store32(iter_base + 40, ptr168) - cleanup_list.push(ptr168) - - () - } - PermanentError(payload169) => { - mbt_ffi_store8(iter_base + 32, 8) - - let ptr170 = mbt_ffi_str2ptr(payload169) - mbt_ffi_store32(iter_base + 44, payload169.length()) - mbt_ffi_store32(iter_base + 40, ptr170) - cleanup_list.push(ptr170) - - () - } - ExceededTableLimit => { - mbt_ffi_store8(iter_base + 32, 9) - - () - } - ExceededHttpCallLimit => { - mbt_ffi_store8(iter_base + 32, 10) - - () - } - ExceededRpcCallLimit => { - mbt_ffi_store8(iter_base + 32, 11) - - () - } - NodeOutOfFilesystemStorage => { - mbt_ffi_store8(iter_base + 32, 12) - - () - } - AgentExceededFilesystemStorageLimit => { - mbt_ffi_store8(iter_base + 32, 13) - - () - } - AgentTerminatedByQuota(payload176) => { - mbt_ffi_store8(iter_base + 32, 14) - mbt_ffi_store64( - iter_base + 40, - payload176.environment_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 48, - payload176.environment_id.uuid.low_bits.reinterpret_as_int64(), - ) - - let ptr177 = mbt_ffi_str2ptr(payload176.resource_name) - mbt_ffi_store32(iter_base + 60, payload176.resource_name.length()) - mbt_ffi_store32(iter_base + 56, ptr177) - cleanup_list.push(ptr177) - - () - } - EphemeralSleepTooLong(payload178) => { - mbt_ffi_store8(iter_base + 32, 15) - mbt_ffi_store64( - iter_base + 40, - payload178.requested_nanos.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 48, - payload178.max_nanos.reinterpret_as_int64(), - ) - - () - } - EphemeralFuelExhausted(payload179) => { - mbt_ffi_store8(iter_base + 32, 16) - mbt_ffi_store64( - iter_base + 40, - payload179.overdraft_limit.reinterpret_as_int64(), - ) - - () - } - EphemeralCannotSuspend(payload180) => { - mbt_ffi_store8(iter_base + 32, 17) - - let ptr181 = mbt_ffi_str2ptr(payload180.reason) - mbt_ffi_store32(iter_base + 44, payload180.reason.length()) - mbt_ffi_store32(iter_base + 40, ptr181) - cleanup_list.push(ptr181) - - () - } - ReadOnlyViolation(payload182) => { - mbt_ffi_store8(iter_base + 32, 18) - - let ptr183 = mbt_ffi_str2ptr(payload182.method_) - mbt_ffi_store32(iter_base + 44, payload182.method_.length()) - mbt_ffi_store32(iter_base + 40, ptr183) - - let ptr184 = mbt_ffi_str2ptr(payload182.host_function) - mbt_ffi_store32(iter_base + 52, payload182.host_function.length()) - mbt_ffi_store32(iter_base + 48, ptr184) - cleanup_list.push(ptr183) - cleanup_list.push(ptr184) - - () - } - } - mbt_ffi_store64( - iter_base + 64, - payload155.retry_from.reinterpret_as_int64(), - ) - mbt_ffi_store8( - iter_base + 72, - if payload155.inside_atomic_region { - 1 - } else { - 0 - }, - ) - - match payload155.retry_policy_state { - None => { - mbt_ffi_store8(iter_base + 76, 0) - - () - } - Some(payload186) => { - mbt_ffi_store8(iter_base + 76, 1) - - let address193 = mbt_ffi_malloc(payload186.nodes.length() * 16) - for index194 = 0 - index194 < payload186.nodes.length() - index194 = index194 + 1 { - let iter_elem : StateNode = payload186.nodes[index194] - let iter_base = address193 + index194 * 16 - - match iter_elem { - Counter(payload187) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store32( - iter_base + 4, - payload187.reinterpret_as_int(), - ) - - () - } - Terminal => { - mbt_ffi_store8(iter_base + 0, 1) - - () - } - Wrapper(payload189) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store32(iter_base + 4, payload189) - - () - } - CountBox(payload190) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32( - iter_base + 4, - payload190.attempts.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 8, payload190.inner) - - () - } - AndThen(payload191) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 4, payload191.left) - mbt_ffi_store32(iter_base + 8, payload191.right) - mbt_ffi_store8( - iter_base + 12, - if payload191.on_right { - 1 - } else { - 0 - }, - ) - - () - } - Pair(payload192) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store32(iter_base + 4, payload192.left) - mbt_ffi_store32(iter_base + 8, payload192.right) - - () - } - } - } - mbt_ffi_store32(iter_base + 84, payload186.nodes.length()) - mbt_ffi_store32(iter_base + 80, address193) - cleanup_list.push(address193) + () + } + Some(payload110) => { + mbt_ffi_store8((iter_base) + 40, (1)) - () - } - } + match payload110 { + Inline(payload111) => { + mbt_ffi_store8((iter_base) + 48, (0)) - () - } - NoOp(payload195) => { - mbt_ffi_store8(iter_base + 8, 8) - mbt_ffi_store64(iter_base + 16, payload195.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload195.timestamp.nanoseconds.reinterpret_as_int(), - ) - - () - } - Jump(payload196) => { - mbt_ffi_store8(iter_base + 8, 9) - mbt_ffi_store64(iter_base + 16, payload196.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload196.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload196.jump.start.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 40, - payload196.jump.end.reinterpret_as_int64(), - ) - - () - } - Interrupted(payload197) => { - mbt_ffi_store8(iter_base + 8, 10) - mbt_ffi_store64(iter_base + 16, payload197.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload197.timestamp.nanoseconds.reinterpret_as_int(), - ) - - () - } - Exited(payload198) => { - mbt_ffi_store8(iter_base + 8, 11) - mbt_ffi_store64(iter_base + 16, payload198.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload198.timestamp.nanoseconds.reinterpret_as_int(), - ) - - () - } - BeginAtomicRegion(payload199) => { - mbt_ffi_store8(iter_base + 8, 12) - mbt_ffi_store64(iter_base + 16, payload199.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload199.timestamp.nanoseconds.reinterpret_as_int(), - ) - - () - } - EndAtomicRegion(payload200) => { - mbt_ffi_store8(iter_base + 8, 13) - mbt_ffi_store64(iter_base + 16, payload200.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload200.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload200.begin_index.reinterpret_as_int64(), - ) - - () - } - PendingAgentInvocation(payload201) => { - mbt_ffi_store8(iter_base + 8, 14) - mbt_ffi_store64(iter_base + 16, payload201.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload201.timestamp.nanoseconds.reinterpret_as_int(), - ) - - let ptr202 = mbt_ffi_str2ptr(payload201.idempotency_key) - mbt_ffi_store32(iter_base + 36, payload201.idempotency_key.length()) - mbt_ffi_store32(iter_base + 32, ptr202) - - match payload201.payload { - Inline(payload203) => { - mbt_ffi_store8(iter_base + 40, 0) - - let ptr204 = mbt_ffi_bytes2ptr(payload203) - - mbt_ffi_store32(iter_base + 52, payload203.length()) - mbt_ffi_store32(iter_base + 48, ptr204) - cleanup_list.push(ptr204) - - () - } - External(payload205) => { - mbt_ffi_store8(iter_base + 40, 1) - mbt_ffi_store64( - iter_base + 48, - payload205.payload_id.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 56, - payload205.payload_id.low_bits.reinterpret_as_int64(), - ) - - let ptr206 = mbt_ffi_bytes2ptr(payload205.md5_hash) - - mbt_ffi_store32(iter_base + 68, payload205.md5_hash.length()) - mbt_ffi_store32(iter_base + 64, ptr206) - cleanup_list.push(ptr206) - - () - } - } - - let ptr207 = mbt_ffi_str2ptr(payload201.trace_id) - mbt_ffi_store32(iter_base + 76, payload201.trace_id.length()) - mbt_ffi_store32(iter_base + 72, ptr207) - - let address209 = mbt_ffi_malloc(payload201.trace_states.length() * 8) - for index210 = 0 - index210 < payload201.trace_states.length() - index210 = index210 + 1 { - let iter_elem : String = payload201.trace_states[index210] - let iter_base = address209 + index210 * 8 - - let ptr208 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr208) - cleanup_list.push(ptr208) - } - mbt_ffi_store32(iter_base + 84, payload201.trace_states.length()) - mbt_ffi_store32(iter_base + 80, address209) - - let address225 = mbt_ffi_malloc( - payload201.invocation_context.length() * 80, - ) - for index226 = 0 - index226 < payload201.invocation_context.length() - index226 = index226 + 1 { - let iter_elem : SpanData = payload201.invocation_context[index226] - let iter_base = address225 + index226 * 80 - - match iter_elem { - LocalSpan(payload211) => { - mbt_ffi_store8(iter_base + 0, 0) - - let ptr212 = mbt_ffi_str2ptr(payload211.span_id) - mbt_ffi_store32(iter_base + 12, payload211.span_id.length()) - mbt_ffi_store32(iter_base + 8, ptr212) - mbt_ffi_store64(iter_base + 16, payload211.start.seconds) - mbt_ffi_store32( - iter_base + 24, - payload211.start.nanoseconds.reinterpret_as_int(), - ) - - match payload211.parent { - None => { - mbt_ffi_store8(iter_base + 32, 0) - - () - } - Some(payload214) => { - mbt_ffi_store8(iter_base + 32, 1) - - let ptr215 = mbt_ffi_str2ptr(payload214) - mbt_ffi_store32(iter_base + 40, payload214.length()) - mbt_ffi_store32(iter_base + 36, ptr215) - cleanup_list.push(ptr215) - - () - } - } - - match payload211.linked_context { - None => { - mbt_ffi_store8(iter_base + 48, 0) - - () - } - Some(payload217) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload217.reinterpret_as_int64(), - ) - - () - } - } - - let address221 = mbt_ffi_malloc( - payload211.attributes.length() * 20, - ) - for index222 = 0 - index222 < payload211.attributes.length() - index222 = index222 + 1 { - let iter_elem : @context.Attribute = payload211.attributes[index222] - let iter_base = address221 + index222 * 20 - - let ptr218 = mbt_ffi_str2ptr(iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.key.length()) - mbt_ffi_store32(iter_base + 0, ptr218) - - match iter_elem.value { - String(payload219) => { - mbt_ffi_store8(iter_base + 8, 0) - - let ptr220 = mbt_ffi_str2ptr(payload219) - mbt_ffi_store32(iter_base + 16, payload219.length()) - mbt_ffi_store32(iter_base + 12, ptr220) - cleanup_list.push(ptr220) - - () - } - } - cleanup_list.push(ptr218) - } - mbt_ffi_store32(iter_base + 68, payload211.attributes.length()) - mbt_ffi_store32(iter_base + 64, address221) - mbt_ffi_store8( - iter_base + 72, - if payload211.inherited { - 1 - } else { - 0 - }, - ) - cleanup_list.push(ptr212) - cleanup_list.push(address221) - - () - } - ExternalSpan(payload223) => { - mbt_ffi_store8(iter_base + 0, 1) + let ptr112 = mbt_ffi_bytes2ptr(payload111) - let ptr224 = mbt_ffi_str2ptr(payload223.span_id) - mbt_ffi_store32(iter_base + 12, payload223.span_id.length()) - mbt_ffi_store32(iter_base + 8, ptr224) - cleanup_list.push(ptr224) + mbt_ffi_store32((iter_base) + 60, payload111.length()) + mbt_ffi_store32((iter_base) + 56, ptr112) + cleanup_list.push(ptr112) - () - } - } - } - mbt_ffi_store32(iter_base + 92, payload201.invocation_context.length()) - mbt_ffi_store32(iter_base + 88, address225) - cleanup_list.push(ptr202) - cleanup_list.push(ptr207) - cleanup_list.push(address209) - cleanup_list.push(address225) - - () - } - PendingUpdate(payload227) => { - mbt_ffi_store8(iter_base + 8, 15) - mbt_ffi_store64(iter_base + 16, payload227.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload227.timestamp.nanoseconds.reinterpret_as_int(), - ) - - match payload227.description { - Automatic(payload228) => { - mbt_ffi_store8(iter_base + 32, 0) - mbt_ffi_store64(iter_base + 40, payload228.reinterpret_as_int64()) - - () - } - SnapshotBased(payload229) => { - mbt_ffi_store8(iter_base + 32, 1) - mbt_ffi_store64( - iter_base + 40, - payload229.target_revision.reinterpret_as_int64(), - ) - - match payload229.payload { - Inline(payload230) => { - mbt_ffi_store8(iter_base + 48, 0) - - let ptr231 = mbt_ffi_bytes2ptr(payload230) - - mbt_ffi_store32(iter_base + 60, payload230.length()) - mbt_ffi_store32(iter_base + 56, ptr231) - cleanup_list.push(ptr231) - - () - } - External(payload232) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload232.payload_id.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 64, - payload232.payload_id.low_bits.reinterpret_as_int64(), - ) - - let ptr233 = mbt_ffi_bytes2ptr(payload232.md5_hash) - - mbt_ffi_store32(iter_base + 76, payload232.md5_hash.length()) - mbt_ffi_store32(iter_base + 72, ptr233) - cleanup_list.push(ptr233) - - () - } - } + () + } + External(payload113) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (((payload113).payload_id).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 64, (((payload113).payload_id).low_bits).reinterpret_as_int64()) - let ptr234 = mbt_ffi_str2ptr(payload229.mime_type) - mbt_ffi_store32(iter_base + 84, payload229.mime_type.length()) - mbt_ffi_store32(iter_base + 80, ptr234) - cleanup_list.push(ptr234) + let ptr114 = mbt_ffi_bytes2ptr((payload113).md5_hash) - () - } - } + mbt_ffi_store32((iter_base) + 76, (payload113).md5_hash.length()) + mbt_ffi_store32((iter_base) + 72, ptr114) + cleanup_list.push(ptr114) - () - } - SuccessfulUpdate(payload235) => { - mbt_ffi_store8(iter_base + 8, 16) - mbt_ffi_store64(iter_base + 16, payload235.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload235.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload235.target_revision.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 40, - payload235.new_component_size.reinterpret_as_int64(), - ) - - let address236 = mbt_ffi_malloc( - payload235.new_active_plugins.length() * 16, - ) - for index237 = 0 - index237 < payload235.new_active_plugins.length() - index237 = index237 + 1 { - let iter_elem : EnvironmentPluginGrantId = payload235.new_active_plugins[index237] - let iter_base = address236 + index237 * 16 - mbt_ffi_store64( - iter_base + 0, - iter_elem.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 8, - iter_elem.uuid.low_bits.reinterpret_as_int64(), - ) - } - mbt_ffi_store32(iter_base + 52, payload235.new_active_plugins.length()) - mbt_ffi_store32(iter_base + 48, address236) - cleanup_list.push(address236) - - () - } - FailedUpdate(payload238) => { - mbt_ffi_store8(iter_base + 8, 17) - mbt_ffi_store64(iter_base + 16, payload238.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload238.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload238.target_revision.reinterpret_as_int64(), - ) - - match payload238.details { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload240) => { - mbt_ffi_store8(iter_base + 40, 1) - - let ptr241 = mbt_ffi_str2ptr(payload240) - mbt_ffi_store32(iter_base + 48, payload240.length()) - mbt_ffi_store32(iter_base + 44, ptr241) - cleanup_list.push(ptr241) - - () - } - } - - () - } - GrowMemory(payload242) => { - mbt_ffi_store8(iter_base + 8, 18) - mbt_ffi_store64(iter_base + 16, payload242.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload242.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64(iter_base + 32, payload242.delta.reinterpret_as_int64()) - - () - } - FilesystemStorageUsageUpdate(payload243) => { - mbt_ffi_store8(iter_base + 8, 19) - mbt_ffi_store64(iter_base + 16, payload243.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload243.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64(iter_base + 32, payload243.delta) - - () - } - CreateResource(payload244) => { - mbt_ffi_store8(iter_base + 8, 20) - mbt_ffi_store64(iter_base + 16, payload244.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload244.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64(iter_base + 32, payload244.id.reinterpret_as_int64()) - - let ptr245 = mbt_ffi_str2ptr(payload244.resource_type_id.name) - mbt_ffi_store32( - iter_base + 44, - payload244.resource_type_id.name.length(), - ) - mbt_ffi_store32(iter_base + 40, ptr245) - - let ptr246 = mbt_ffi_str2ptr(payload244.resource_type_id.owner) - mbt_ffi_store32( - iter_base + 52, - payload244.resource_type_id.owner.length(), - ) - mbt_ffi_store32(iter_base + 48, ptr246) - cleanup_list.push(ptr245) - cleanup_list.push(ptr246) - - () - } - DropResource(payload247) => { - mbt_ffi_store8(iter_base + 8, 21) - mbt_ffi_store64(iter_base + 16, payload247.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload247.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64(iter_base + 32, payload247.id.reinterpret_as_int64()) - - let ptr248 = mbt_ffi_str2ptr(payload247.resource_type_id.name) - mbt_ffi_store32( - iter_base + 44, - payload247.resource_type_id.name.length(), - ) - mbt_ffi_store32(iter_base + 40, ptr248) - - let ptr249 = mbt_ffi_str2ptr(payload247.resource_type_id.owner) - mbt_ffi_store32( - iter_base + 52, - payload247.resource_type_id.owner.length(), - ) - mbt_ffi_store32(iter_base + 48, ptr249) - cleanup_list.push(ptr248) - cleanup_list.push(ptr249) - - () - } - Log(payload250) => { - mbt_ffi_store8(iter_base + 8, 22) - mbt_ffi_store64(iter_base + 16, payload250.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload250.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store8(iter_base + 32, payload250.level.ordinal()) - - let ptr251 = mbt_ffi_str2ptr(payload250.context) - mbt_ffi_store32(iter_base + 40, payload250.context.length()) - mbt_ffi_store32(iter_base + 36, ptr251) - - let ptr252 = mbt_ffi_str2ptr(payload250.message) - mbt_ffi_store32(iter_base + 48, payload250.message.length()) - mbt_ffi_store32(iter_base + 44, ptr252) - cleanup_list.push(ptr251) - cleanup_list.push(ptr252) - - () - } - Restart(payload253) => { - mbt_ffi_store8(iter_base + 8, 23) - mbt_ffi_store64(iter_base + 16, payload253.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload253.timestamp.nanoseconds.reinterpret_as_int(), - ) - - () - } - ActivatePlugin(payload254) => { - mbt_ffi_store8(iter_base + 8, 24) - mbt_ffi_store64(iter_base + 16, payload254.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload254.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload254.plugin_grant_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 40, - payload254.plugin_grant_id.uuid.low_bits.reinterpret_as_int64(), - ) - - () - } - DeactivatePlugin(payload255) => { - mbt_ffi_store8(iter_base + 8, 25) - mbt_ffi_store64(iter_base + 16, payload255.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload255.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload255.plugin_grant_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 40, - payload255.plugin_grant_id.uuid.low_bits.reinterpret_as_int64(), - ) - - () - } - Revert(payload256) => { - mbt_ffi_store8(iter_base + 8, 26) - mbt_ffi_store64(iter_base + 16, payload256.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload256.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload256.dropped_region.start.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 40, - payload256.dropped_region.end.reinterpret_as_int64(), - ) - - () - } - CancelPendingInvocation(payload257) => { - mbt_ffi_store8(iter_base + 8, 27) - mbt_ffi_store64(iter_base + 16, payload257.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload257.timestamp.nanoseconds.reinterpret_as_int(), - ) - - let ptr258 = mbt_ffi_str2ptr(payload257.idempotency_key) - mbt_ffi_store32(iter_base + 36, payload257.idempotency_key.length()) - mbt_ffi_store32(iter_base + 32, ptr258) - cleanup_list.push(ptr258) - - () - } - StartSpan(payload259) => { - mbt_ffi_store8(iter_base + 8, 28) - mbt_ffi_store64(iter_base + 16, payload259.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload259.timestamp.nanoseconds.reinterpret_as_int(), - ) - - let ptr260 = mbt_ffi_str2ptr(payload259.span_id) - mbt_ffi_store32(iter_base + 36, payload259.span_id.length()) - mbt_ffi_store32(iter_base + 32, ptr260) - - match payload259.parent { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload262) => { - mbt_ffi_store8(iter_base + 40, 1) - - let ptr263 = mbt_ffi_str2ptr(payload262) - mbt_ffi_store32(iter_base + 48, payload262.length()) - mbt_ffi_store32(iter_base + 44, ptr263) - cleanup_list.push(ptr263) - - () - } - } - - match payload259.linked_context_id { - None => { - mbt_ffi_store8(iter_base + 52, 0) - - () - } - Some(payload265) => { - mbt_ffi_store8(iter_base + 52, 1) - - let ptr266 = mbt_ffi_str2ptr(payload265) - mbt_ffi_store32(iter_base + 60, payload265.length()) - mbt_ffi_store32(iter_base + 56, ptr266) - cleanup_list.push(ptr266) - - () - } - } - - let address270 = mbt_ffi_malloc(payload259.attributes.length() * 20) - for index271 = 0 - index271 < payload259.attributes.length() - index271 = index271 + 1 { - let iter_elem : @context.Attribute = payload259.attributes[index271] - let iter_base = address270 + index271 * 20 - - let ptr267 = mbt_ffi_str2ptr(iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.key.length()) - mbt_ffi_store32(iter_base + 0, ptr267) - - match iter_elem.value { - String(payload268) => { - mbt_ffi_store8(iter_base + 8, 0) - - let ptr269 = mbt_ffi_str2ptr(payload268) - mbt_ffi_store32(iter_base + 16, payload268.length()) - mbt_ffi_store32(iter_base + 12, ptr269) - cleanup_list.push(ptr269) - - () - } - } - cleanup_list.push(ptr267) - } - mbt_ffi_store32(iter_base + 68, payload259.attributes.length()) - mbt_ffi_store32(iter_base + 64, address270) - cleanup_list.push(ptr260) - cleanup_list.push(address270) - - () - } - FinishSpan(payload272) => { - mbt_ffi_store8(iter_base + 8, 29) - mbt_ffi_store64(iter_base + 16, payload272.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload272.timestamp.nanoseconds.reinterpret_as_int(), - ) - - let ptr273 = mbt_ffi_str2ptr(payload272.span_id) - mbt_ffi_store32(iter_base + 36, payload272.span_id.length()) - mbt_ffi_store32(iter_base + 32, ptr273) - cleanup_list.push(ptr273) - - () - } - SetSpanAttribute(payload274) => { - mbt_ffi_store8(iter_base + 8, 30) - mbt_ffi_store64(iter_base + 16, payload274.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload274.timestamp.nanoseconds.reinterpret_as_int(), - ) - - let ptr275 = mbt_ffi_str2ptr(payload274.span_id) - mbt_ffi_store32(iter_base + 36, payload274.span_id.length()) - mbt_ffi_store32(iter_base + 32, ptr275) - - let ptr276 = mbt_ffi_str2ptr(payload274.key) - mbt_ffi_store32(iter_base + 44, payload274.key.length()) - mbt_ffi_store32(iter_base + 40, ptr276) - - match payload274.value { - String(payload277) => { - mbt_ffi_store8(iter_base + 48, 0) - - let ptr278 = mbt_ffi_str2ptr(payload277) - mbt_ffi_store32(iter_base + 56, payload277.length()) - mbt_ffi_store32(iter_base + 52, ptr278) - cleanup_list.push(ptr278) - - () - } - } - cleanup_list.push(ptr275) - cleanup_list.push(ptr276) - - () - } - ChangePersistenceLevel(payload279) => { - mbt_ffi_store8(iter_base + 8, 31) - mbt_ffi_store64(iter_base + 16, payload279.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload279.timestamp.nanoseconds.reinterpret_as_int(), - ) - - match payload279.persistence_level { - PersistNothing => { - mbt_ffi_store8(iter_base + 32, 0) - - () - } - PersistRemoteSideEffects => { - mbt_ffi_store8(iter_base + 32, 1) - - () - } - Smart => { - mbt_ffi_store8(iter_base + 32, 2) - - () - } - } - - () - } - BeginRemoteTransaction(payload283) => { - mbt_ffi_store8(iter_base + 8, 32) - mbt_ffi_store64(iter_base + 16, payload283.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload283.timestamp.nanoseconds.reinterpret_as_int(), - ) - - let ptr284 = mbt_ffi_str2ptr(payload283.transaction_id) - mbt_ffi_store32(iter_base + 36, payload283.transaction_id.length()) - mbt_ffi_store32(iter_base + 32, ptr284) - - match payload283.original_begin_index { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload286) => { - mbt_ffi_store8(iter_base + 40, 1) - mbt_ffi_store64(iter_base + 48, payload286.reinterpret_as_int64()) - - () - } - } - cleanup_list.push(ptr284) - - () - } - PreCommitRemoteTransaction(payload287) => { - mbt_ffi_store8(iter_base + 8, 33) - mbt_ffi_store64(iter_base + 16, payload287.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload287.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload287.begin_index.reinterpret_as_int64(), - ) - - () - } - PreRollbackRemoteTransaction(payload288) => { - mbt_ffi_store8(iter_base + 8, 34) - mbt_ffi_store64(iter_base + 16, payload288.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload288.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload288.begin_index.reinterpret_as_int64(), - ) - - () - } - CommittedRemoteTransaction(payload289) => { - mbt_ffi_store8(iter_base + 8, 35) - mbt_ffi_store64(iter_base + 16, payload289.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload289.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload289.begin_index.reinterpret_as_int64(), - ) - - () - } - RolledBackRemoteTransaction(payload290) => { - mbt_ffi_store8(iter_base + 8, 36) - mbt_ffi_store64(iter_base + 16, payload290.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload290.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload290.begin_index.reinterpret_as_int64(), - ) - - () - } - Snapshot(payload291) => { - mbt_ffi_store8(iter_base + 8, 37) - mbt_ffi_store64(iter_base + 16, payload291.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload291.timestamp.nanoseconds.reinterpret_as_int(), - ) - - match payload291.data { - Inline(payload292) => { - mbt_ffi_store8(iter_base + 32, 0) - - let ptr293 = mbt_ffi_bytes2ptr(payload292) - - mbt_ffi_store32(iter_base + 44, payload292.length()) - mbt_ffi_store32(iter_base + 40, ptr293) - cleanup_list.push(ptr293) - - () - } - External(payload294) => { - mbt_ffi_store8(iter_base + 32, 1) - mbt_ffi_store64( - iter_base + 40, - payload294.payload_id.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 48, - payload294.payload_id.low_bits.reinterpret_as_int64(), - ) - - let ptr295 = mbt_ffi_bytes2ptr(payload294.md5_hash) - - mbt_ffi_store32(iter_base + 60, payload294.md5_hash.length()) - mbt_ffi_store32(iter_base + 56, ptr295) - cleanup_list.push(ptr295) - - () - } - } - - let ptr296 = mbt_ffi_str2ptr(payload291.mime_type) - mbt_ffi_store32(iter_base + 68, payload291.mime_type.length()) - mbt_ffi_store32(iter_base + 64, ptr296) - cleanup_list.push(ptr296) - - () - } - OplogProcessorCheckpoint(payload297) => { - mbt_ffi_store8(iter_base + 8, 38) - mbt_ffi_store64(iter_base + 16, payload297.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload297.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload297.plugin_grant_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 40, - payload297.plugin_grant_id.uuid.low_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 48, - payload297.target_agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 56, - payload297.target_agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ) - - let ptr298 = mbt_ffi_str2ptr(payload297.target_agent_id.agent_id) - mbt_ffi_store32( - iter_base + 68, - payload297.target_agent_id.agent_id.length(), - ) - mbt_ffi_store32(iter_base + 64, ptr298) - mbt_ffi_store64( - iter_base + 72, - payload297.confirmed_up_to.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 80, - payload297.sending_up_to.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 88, - payload297.last_batch_start.reinterpret_as_int64(), - ) - cleanup_list.push(ptr298) - - () - } - SetRetryPolicy(payload299) => { - mbt_ffi_store8(iter_base + 8, 39) - mbt_ffi_store64(iter_base + 16, payload299.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload299.timestamp.nanoseconds.reinterpret_as_int(), - ) - - let ptr300 = mbt_ffi_str2ptr(payload299.policy.name) - mbt_ffi_store32(iter_base + 36, payload299.policy.name.length()) - mbt_ffi_store32(iter_base + 32, ptr300) - mbt_ffi_store32( - iter_base + 40, - payload299.policy.priority.reinterpret_as_int(), - ) - - let address361 = mbt_ffi_malloc( - payload299.policy.predicate.nodes.length() * 32, - ) - for index362 = 0 - index362 < payload299.policy.predicate.nodes.length() - index362 = index362 + 1 { - let iter_elem : @retry.PredicateNode = payload299.policy.predicate.nodes[index362] - let iter_base = address361 + index362 * 32 - - match iter_elem { - PropEq(payload301) => { - mbt_ffi_store8(iter_base + 0, 0) - - let ptr302 = mbt_ffi_str2ptr(payload301.property_name) - mbt_ffi_store32(iter_base + 12, payload301.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr302) - - match payload301.value { - Text(payload303) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr304 = mbt_ffi_str2ptr(payload303) - mbt_ffi_store32(iter_base + 28, payload303.length()) - mbt_ffi_store32(iter_base + 24, ptr304) - cleanup_list.push(ptr304) - - () - } - Integer(payload305) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload305) - - () - } - Boolean(payload306) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload306 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr302) - - () - } - PropNeq(payload307) => { - mbt_ffi_store8(iter_base + 0, 1) - - let ptr308 = mbt_ffi_str2ptr(payload307.property_name) - mbt_ffi_store32(iter_base + 12, payload307.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr308) - - match payload307.value { - Text(payload309) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr310 = mbt_ffi_str2ptr(payload309) - mbt_ffi_store32(iter_base + 28, payload309.length()) - mbt_ffi_store32(iter_base + 24, ptr310) - cleanup_list.push(ptr310) - - () - } - Integer(payload311) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload311) - - () - } - Boolean(payload312) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload312 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr308) - - () - } - PropGt(payload313) => { - mbt_ffi_store8(iter_base + 0, 2) - - let ptr314 = mbt_ffi_str2ptr(payload313.property_name) - mbt_ffi_store32(iter_base + 12, payload313.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr314) - - match payload313.value { - Text(payload315) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr316 = mbt_ffi_str2ptr(payload315) - mbt_ffi_store32(iter_base + 28, payload315.length()) - mbt_ffi_store32(iter_base + 24, ptr316) - cleanup_list.push(ptr316) - - () - } - Integer(payload317) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload317) - - () - } - Boolean(payload318) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload318 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr314) - - () - } - PropGte(payload319) => { - mbt_ffi_store8(iter_base + 0, 3) - - let ptr320 = mbt_ffi_str2ptr(payload319.property_name) - mbt_ffi_store32(iter_base + 12, payload319.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr320) - - match payload319.value { - Text(payload321) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr322 = mbt_ffi_str2ptr(payload321) - mbt_ffi_store32(iter_base + 28, payload321.length()) - mbt_ffi_store32(iter_base + 24, ptr322) - cleanup_list.push(ptr322) - - () - } - Integer(payload323) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload323) - - () - } - Boolean(payload324) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload324 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr320) - - () - } - PropLt(payload325) => { - mbt_ffi_store8(iter_base + 0, 4) - - let ptr326 = mbt_ffi_str2ptr(payload325.property_name) - mbt_ffi_store32(iter_base + 12, payload325.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr326) - - match payload325.value { - Text(payload327) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr328 = mbt_ffi_str2ptr(payload327) - mbt_ffi_store32(iter_base + 28, payload327.length()) - mbt_ffi_store32(iter_base + 24, ptr328) - cleanup_list.push(ptr328) - - () - } - Integer(payload329) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload329) - - () - } - Boolean(payload330) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload330 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr326) - - () - } - PropLte(payload331) => { - mbt_ffi_store8(iter_base + 0, 5) - - let ptr332 = mbt_ffi_str2ptr(payload331.property_name) - mbt_ffi_store32(iter_base + 12, payload331.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr332) - - match payload331.value { - Text(payload333) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr334 = mbt_ffi_str2ptr(payload333) - mbt_ffi_store32(iter_base + 28, payload333.length()) - mbt_ffi_store32(iter_base + 24, ptr334) - cleanup_list.push(ptr334) - - () - } - Integer(payload335) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload335) - - () - } - Boolean(payload336) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload336 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr332) - - () - } - PropExists(payload337) => { - mbt_ffi_store8(iter_base + 0, 6) + () + } + } - let ptr338 = mbt_ffi_str2ptr(payload337) - mbt_ffi_store32(iter_base + 12, payload337.length()) - mbt_ffi_store32(iter_base + 8, ptr338) - cleanup_list.push(ptr338) + () + } + } + mbt_ffi_store8((iter_base) + 80, (if (payload108).forced_commit { 1 } else { 0 })) - () - } - PropIn(payload339) => { - mbt_ffi_store8(iter_base + 0, 7) - - let ptr340 = mbt_ffi_str2ptr(payload339.property_name) - mbt_ffi_store32(iter_base + 12, payload339.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr340) - - let address345 = mbt_ffi_malloc(payload339.values.length() * 16) - for index346 = 0 - index346 < payload339.values.length() - index346 = index346 + 1 { - let iter_elem : @retry.PredicateValue = payload339.values[index346] - let iter_base = address345 + index346 * 16 - - match iter_elem { - Text(payload341) => { - mbt_ffi_store8(iter_base + 0, 0) - - let ptr342 = mbt_ffi_str2ptr(payload341) - mbt_ffi_store32(iter_base + 12, payload341.length()) - mbt_ffi_store32(iter_base + 8, ptr342) - cleanup_list.push(ptr342) - - () + () } - Integer(payload343) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store64(iter_base + 8, payload343) + Cancelled(payload115) => { + mbt_ffi_store8((iter_base) + 8, (3)) + mbt_ffi_store64((iter_base) + 16, ((payload115).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload115).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload115).start_index).reinterpret_as_int64()) - () - } - Boolean(payload344) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store8( - iter_base + 8, - if payload344 { - 1 - } else { - 0 - }, - ) - - () - } - } - } - mbt_ffi_store32(iter_base + 20, payload339.values.length()) - mbt_ffi_store32(iter_base + 16, address345) - cleanup_list.push(ptr340) - cleanup_list.push(address345) - - () - } - PropMatches(payload347) => { - mbt_ffi_store8(iter_base + 0, 8) + match ((payload115).partial) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) - let ptr348 = mbt_ffi_str2ptr(payload347.property_name) - mbt_ffi_store32(iter_base + 12, payload347.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr348) + () + } + Some(payload117) => { + mbt_ffi_store8((iter_base) + 40, (1)) - let ptr349 = mbt_ffi_str2ptr(payload347.pattern) - mbt_ffi_store32(iter_base + 20, payload347.pattern.length()) - mbt_ffi_store32(iter_base + 16, ptr349) - cleanup_list.push(ptr348) - cleanup_list.push(ptr349) + match payload117 { + Inline(payload118) => { + mbt_ffi_store8((iter_base) + 48, (0)) - () - } - PropStartsWith(payload350) => { - mbt_ffi_store8(iter_base + 0, 9) + let ptr119 = mbt_ffi_bytes2ptr(payload118) - let ptr351 = mbt_ffi_str2ptr(payload350.property_name) - mbt_ffi_store32(iter_base + 12, payload350.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr351) + mbt_ffi_store32((iter_base) + 60, payload118.length()) + mbt_ffi_store32((iter_base) + 56, ptr119) + cleanup_list.push(ptr119) - let ptr352 = mbt_ffi_str2ptr(payload350.pattern) - mbt_ffi_store32(iter_base + 20, payload350.pattern.length()) - mbt_ffi_store32(iter_base + 16, ptr352) - cleanup_list.push(ptr351) - cleanup_list.push(ptr352) + () + } + External(payload120) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (((payload120).payload_id).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 64, (((payload120).payload_id).low_bits).reinterpret_as_int64()) - () - } - PropContains(payload353) => { - mbt_ffi_store8(iter_base + 0, 10) + let ptr121 = mbt_ffi_bytes2ptr((payload120).md5_hash) - let ptr354 = mbt_ffi_str2ptr(payload353.property_name) - mbt_ffi_store32(iter_base + 12, payload353.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr354) + mbt_ffi_store32((iter_base) + 76, (payload120).md5_hash.length()) + mbt_ffi_store32((iter_base) + 72, ptr121) + cleanup_list.push(ptr121) - let ptr355 = mbt_ffi_str2ptr(payload353.pattern) - mbt_ffi_store32(iter_base + 20, payload353.pattern.length()) - mbt_ffi_store32(iter_base + 16, ptr355) - cleanup_list.push(ptr354) - cleanup_list.push(ptr355) + () + } + } - () - } - PredAnd(payload356) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload356.0) - mbt_ffi_store32(iter_base + 12, payload356.1) + () + } + } - () - } - PredOr(payload357) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store32(iter_base + 8, payload357.0) - mbt_ffi_store32(iter_base + 12, payload357.1) + () + } + AgentInvocationStarted(payload122) => { + mbt_ffi_store8((iter_base) + 8, (4)) + mbt_ffi_store64((iter_base) + 16, ((payload122).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload122).timestamp).nanoseconds).reinterpret_as_int()) - () - } - PredNot(payload358) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store32(iter_base + 8, payload358) + let ptr123 = mbt_ffi_str2ptr((payload122).idempotency_key) + mbt_ffi_store32((iter_base) + 36, (payload122).idempotency_key.length()) + mbt_ffi_store32((iter_base) + 32, ptr123) - () - } - PredTrue => { - mbt_ffi_store8(iter_base + 0, 14) + match (payload122).payload { + Inline(payload124) => { + mbt_ffi_store8((iter_base) + 40, (0)) - () - } - PredFalse => { - mbt_ffi_store8(iter_base + 0, 15) + let ptr125 = mbt_ffi_bytes2ptr(payload124) - () - } - } - } - mbt_ffi_store32( - iter_base + 48, - payload299.policy.predicate.nodes.length(), - ) - mbt_ffi_store32(iter_base + 44, address361) - - let address439 = mbt_ffi_malloc( - payload299.policy.policy.nodes.length() * 32, - ) - for index440 = 0 - index440 < payload299.policy.policy.nodes.length() - index440 = index440 + 1 { - let iter_elem : @retry.PolicyNode = payload299.policy.policy.nodes[index440] - let iter_base = address439 + index440 * 32 - - match iter_elem { - Periodic(payload363) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store64(iter_base + 8, payload363.reinterpret_as_int64()) - - () - } - Exponential(payload364) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store64( - iter_base + 8, - payload364.base_delay.reinterpret_as_int64(), - ) - mbt_ffi_storef64(iter_base + 16, payload364.factor) - - () - } - Fibonacci(payload365) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store64( - iter_base + 8, - payload365.first.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 16, - payload365.second.reinterpret_as_int64(), - ) - - () - } - Immediate => { - mbt_ffi_store8(iter_base + 0, 3) + mbt_ffi_store32((iter_base) + 52, payload124.length()) + mbt_ffi_store32((iter_base) + 48, ptr125) + cleanup_list.push(ptr125) - () - } - Never => { - mbt_ffi_store8(iter_base + 0, 4) + () + } + External(payload126) => { + mbt_ffi_store8((iter_base) + 40, (1)) + mbt_ffi_store64((iter_base) + 48, (((payload126).payload_id).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 56, (((payload126).payload_id).low_bits).reinterpret_as_int64()) - () - } - CountBox(payload368) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store32( - iter_base + 8, - payload368.max_retries.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 12, payload368.inner) - - () - } - TimeBox(payload369) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store64( - iter_base + 8, - payload369.limit.reinterpret_as_int64(), - ) - mbt_ffi_store32(iter_base + 16, payload369.inner) - - () - } - ClampDelay(payload370) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store64( - iter_base + 8, - payload370.min_delay.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 16, - payload370.max_delay.reinterpret_as_int64(), - ) - mbt_ffi_store32(iter_base + 24, payload370.inner) - - () - } - AddDelay(payload371) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64( - iter_base + 8, - payload371.delay.reinterpret_as_int64(), - ) - mbt_ffi_store32(iter_base + 16, payload371.inner) - - () - } - Jitter(payload372) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef64(iter_base + 8, payload372.factor) - mbt_ffi_store32(iter_base + 16, payload372.inner) + let ptr127 = mbt_ffi_bytes2ptr((payload126).md5_hash) - () - } - FilteredOn(payload373) => { - mbt_ffi_store8(iter_base + 0, 10) - - let address434 = mbt_ffi_malloc( - payload373.predicate.nodes.length() * 32, - ) - for index435 = 0 - index435 < payload373.predicate.nodes.length() - index435 = index435 + 1 { - let iter_elem : @retry.PredicateNode = payload373.predicate.nodes[index435] - let iter_base = address434 + index435 * 32 - - match iter_elem { - PropEq(payload374) => { - mbt_ffi_store8(iter_base + 0, 0) - - let ptr375 = mbt_ffi_str2ptr(payload374.property_name) - mbt_ffi_store32( - iter_base + 12, - payload374.property_name.length(), - ) - mbt_ffi_store32(iter_base + 8, ptr375) - - match payload374.value { - Text(payload376) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr377 = mbt_ffi_str2ptr(payload376) - mbt_ffi_store32(iter_base + 28, payload376.length()) - mbt_ffi_store32(iter_base + 24, ptr377) - cleanup_list.push(ptr377) + mbt_ffi_store32((iter_base) + 68, (payload126).md5_hash.length()) + mbt_ffi_store32((iter_base) + 64, ptr127) + cleanup_list.push(ptr127) - () - } - Integer(payload378) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload378) + () + } + } - () - } - Boolean(payload379) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8( - iter_base + 24, - if payload379 { - 1 - } else { - 0 - }, - ) + let ptr128 = mbt_ffi_str2ptr((payload122).trace_id) + mbt_ffi_store32((iter_base) + 76, (payload122).trace_id.length()) + mbt_ffi_store32((iter_base) + 72, ptr128) - () - } - } - cleanup_list.push(ptr375) + let address130 = mbt_ffi_malloc(((payload122).trace_states).length() * 8); + for index131 = 0; index131 < ((payload122).trace_states).length(); index131 = index131 + 1 { + let iter_elem : String = ((payload122).trace_states)[(index131)] + let iter_base = address130 + (index131 * 8); - () - } - PropNeq(payload380) => { - mbt_ffi_store8(iter_base + 0, 1) + let ptr129 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr129) + cleanup_list.push(ptr129) - let ptr381 = mbt_ffi_str2ptr(payload380.property_name) - mbt_ffi_store32( - iter_base + 12, - payload380.property_name.length(), - ) - mbt_ffi_store32(iter_base + 8, ptr381) + } + mbt_ffi_store32((iter_base) + 84, ((payload122).trace_states).length()) + mbt_ffi_store32((iter_base) + 80, address130) - match payload380.value { - Text(payload382) => { - mbt_ffi_store8(iter_base + 16, 0) + let address146 = mbt_ffi_malloc(((payload122).invocation_context).length() * 80); + for index147 = 0; index147 < ((payload122).invocation_context).length(); index147 = index147 + 1 { + let iter_elem : SpanData = ((payload122).invocation_context)[(index147)] + let iter_base = address146 + (index147 * 80); - let ptr383 = mbt_ffi_str2ptr(payload382) - mbt_ffi_store32(iter_base + 28, payload382.length()) - mbt_ffi_store32(iter_base + 24, ptr383) - cleanup_list.push(ptr383) + match iter_elem { + LocalSpan(payload132) => { + mbt_ffi_store8((iter_base) + 0, (0)) - () - } - Integer(payload384) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload384) + let ptr133 = mbt_ffi_str2ptr((payload132).span_id) + mbt_ffi_store32((iter_base) + 12, (payload132).span_id.length()) + mbt_ffi_store32((iter_base) + 8, ptr133) + mbt_ffi_store64((iter_base) + 16, ((payload132).start).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload132).start).nanoseconds).reinterpret_as_int()) - () - } - Boolean(payload385) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8( - iter_base + 24, - if payload385 { - 1 - } else { - 0 - }, - ) + match ((payload132).parent) { + None => { + mbt_ffi_store8((iter_base) + 32, (0)) - () - } - } - cleanup_list.push(ptr381) + () + } + Some(payload135) => { + mbt_ffi_store8((iter_base) + 32, (1)) - () - } - PropGt(payload386) => { - mbt_ffi_store8(iter_base + 0, 2) + let ptr136 = mbt_ffi_str2ptr(payload135) + mbt_ffi_store32((iter_base) + 40, payload135.length()) + mbt_ffi_store32((iter_base) + 36, ptr136) + cleanup_list.push(ptr136) - let ptr387 = mbt_ffi_str2ptr(payload386.property_name) - mbt_ffi_store32( - iter_base + 12, - payload386.property_name.length(), - ) - mbt_ffi_store32(iter_base + 8, ptr387) + () + } + } - match payload386.value { - Text(payload388) => { - mbt_ffi_store8(iter_base + 16, 0) + match ((payload132).linked_context) { + None => { + mbt_ffi_store8((iter_base) + 48, (0)) - let ptr389 = mbt_ffi_str2ptr(payload388) - mbt_ffi_store32(iter_base + 28, payload388.length()) - mbt_ffi_store32(iter_base + 24, ptr389) - cleanup_list.push(ptr389) + () + } + Some(payload138) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload138).reinterpret_as_int64()) - () - } - Integer(payload390) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload390) + () + } + } + + let address142 = mbt_ffi_malloc(((payload132).attributes).length() * 20); + for index143 = 0; index143 < ((payload132).attributes).length(); index143 = index143 + 1 { + let iter_elem : @context.Attribute = ((payload132).attributes)[(index143)] + let iter_base = address142 + (index143 * 20); + + let ptr139 = mbt_ffi_str2ptr((iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).key.length()) + mbt_ffi_store32((iter_base) + 0, ptr139) + + match (iter_elem).value { + String(payload140) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + let ptr141 = mbt_ffi_str2ptr(payload140) + mbt_ffi_store32((iter_base) + 16, payload140.length()) + mbt_ffi_store32((iter_base) + 12, ptr141) + cleanup_list.push(ptr141) + + () + } + } + cleanup_list.push(ptr139) + + } + mbt_ffi_store32((iter_base) + 68, ((payload132).attributes).length()) + mbt_ffi_store32((iter_base) + 64, address142) + mbt_ffi_store8((iter_base) + 72, (if (payload132).inherited { 1 } else { 0 })) + cleanup_list.push(ptr133) + cleanup_list.push(address142) + + () + } + ExternalSpan(payload144) => { + mbt_ffi_store8((iter_base) + 0, (1)) + + let ptr145 = mbt_ffi_str2ptr((payload144).span_id) + mbt_ffi_store32((iter_base) + 12, (payload144).span_id.length()) + mbt_ffi_store32((iter_base) + 8, ptr145) + cleanup_list.push(ptr145) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 92, ((payload122).invocation_context).length()) + mbt_ffi_store32((iter_base) + 88, address146) + cleanup_list.push(ptr123) + cleanup_list.push(ptr128) + cleanup_list.push(address130) + cleanup_list.push(address146) () - } - Boolean(payload391) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8( - iter_base + 24, - if payload391 { - 1 - } else { - 0 - }, - ) + } + AgentInvocationFinished(payload148) => { + mbt_ffi_store8((iter_base) + 8, (5)) + mbt_ffi_store64((iter_base) + 16, ((payload148).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload148).timestamp).nanoseconds).reinterpret_as_int()) + + match (payload148).result { + Inline(payload149) => { + mbt_ffi_store8((iter_base) + 32, (0)) + + let ptr150 = mbt_ffi_bytes2ptr(payload149) + + mbt_ffi_store32((iter_base) + 44, payload149.length()) + mbt_ffi_store32((iter_base) + 40, ptr150) + cleanup_list.push(ptr150) + + () + } + External(payload151) => { + mbt_ffi_store8((iter_base) + 32, (1)) + mbt_ffi_store64((iter_base) + 40, (((payload151).payload_id).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 48, (((payload151).payload_id).low_bits).reinterpret_as_int64()) + + let ptr152 = mbt_ffi_bytes2ptr((payload151).md5_hash) + + mbt_ffi_store32((iter_base) + 60, (payload151).md5_hash.length()) + mbt_ffi_store32((iter_base) + 56, ptr152) + cleanup_list.push(ptr152) + + () + } + } + + match ((payload148).method_name) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload154) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr155 = mbt_ffi_str2ptr(payload154) + mbt_ffi_store32((iter_base) + 72, payload154.length()) + mbt_ffi_store32((iter_base) + 68, ptr155) + cleanup_list.push(ptr155) + + () + } + } + mbt_ffi_store64((iter_base) + 80, (payload148).consumed_fuel) + mbt_ffi_store64((iter_base) + 88, ((payload148).component_revision).reinterpret_as_int64()) () - } - } - cleanup_list.push(ptr387) + } + Suspend(payload156) => { + mbt_ffi_store8((iter_base) + 8, (6)) + mbt_ffi_store64((iter_base) + 16, ((payload156).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload156).timestamp).nanoseconds).reinterpret_as_int()) - () + () } - PropGte(payload392) => { - mbt_ffi_store8(iter_base + 0, 3) + Error(payload157) => { + mbt_ffi_store8((iter_base) + 8, (7)) + mbt_ffi_store64((iter_base) + 16, ((payload157).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload157).timestamp).nanoseconds).reinterpret_as_int()) + + match (payload157).error { + Unknown(payload158) => { + mbt_ffi_store8((iter_base) + 32, (0)) - let ptr393 = mbt_ffi_str2ptr(payload392.property_name) - mbt_ffi_store32( - iter_base + 12, - payload392.property_name.length(), - ) - mbt_ffi_store32(iter_base + 8, ptr393) + let ptr159 = mbt_ffi_str2ptr(payload158) + mbt_ffi_store32((iter_base) + 44, payload158.length()) + mbt_ffi_store32((iter_base) + 40, ptr159) + cleanup_list.push(ptr159) - match payload392.value { - Text(payload394) => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + InvalidRequest(payload160) => { + mbt_ffi_store8((iter_base) + 32, (1)) - let ptr395 = mbt_ffi_str2ptr(payload394) - mbt_ffi_store32(iter_base + 28, payload394.length()) - mbt_ffi_store32(iter_base + 24, ptr395) - cleanup_list.push(ptr395) + let ptr161 = mbt_ffi_str2ptr(payload160) + mbt_ffi_store32((iter_base) + 44, payload160.length()) + mbt_ffi_store32((iter_base) + 40, ptr161) + cleanup_list.push(ptr161) - () - } - Integer(payload396) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload396) + () + } + StackOverflow => { + mbt_ffi_store8((iter_base) + 32, (2)) + + () + } + OutOfMemory => { + mbt_ffi_store8((iter_base) + 32, (3)) + + () + } + ExceededMemoryLimit => { + mbt_ffi_store8((iter_base) + 32, (4)) + + () + } + InternalError(payload165) => { + mbt_ffi_store8((iter_base) + 32, (5)) + + let ptr166 = mbt_ffi_str2ptr(payload165) + mbt_ffi_store32((iter_base) + 44, payload165.length()) + mbt_ffi_store32((iter_base) + 40, ptr166) + cleanup_list.push(ptr166) + + () + } + DeterministicTrap(payload167) => { + mbt_ffi_store8((iter_base) + 32, (6)) + + let ptr168 = mbt_ffi_str2ptr(payload167) + mbt_ffi_store32((iter_base) + 44, payload167.length()) + mbt_ffi_store32((iter_base) + 40, ptr168) + cleanup_list.push(ptr168) + + () + } + TransientError(payload169) => { + mbt_ffi_store8((iter_base) + 32, (7)) + + let ptr170 = mbt_ffi_str2ptr(payload169) + mbt_ffi_store32((iter_base) + 44, payload169.length()) + mbt_ffi_store32((iter_base) + 40, ptr170) + cleanup_list.push(ptr170) + + () + } + PermanentError(payload171) => { + mbt_ffi_store8((iter_base) + 32, (8)) + + let ptr172 = mbt_ffi_str2ptr(payload171) + mbt_ffi_store32((iter_base) + 44, payload171.length()) + mbt_ffi_store32((iter_base) + 40, ptr172) + cleanup_list.push(ptr172) + + () + } + ExceededTableLimit => { + mbt_ffi_store8((iter_base) + 32, (9)) + + () + } + ExceededHttpCallLimit => { + mbt_ffi_store8((iter_base) + 32, (10)) + + () + } + ExceededRpcCallLimit => { + mbt_ffi_store8((iter_base) + 32, (11)) + + () + } + NodeOutOfFilesystemStorage => { + mbt_ffi_store8((iter_base) + 32, (12)) + + () + } + AgentExceededFilesystemStorageLimit => { + mbt_ffi_store8((iter_base) + 32, (13)) + + () + } + AgentTerminatedByQuota(payload178) => { + mbt_ffi_store8((iter_base) + 32, (14)) + mbt_ffi_store64((iter_base) + 40, ((((payload178).environment_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 48, ((((payload178).environment_id).uuid).low_bits).reinterpret_as_int64()) + + let ptr179 = mbt_ffi_str2ptr((payload178).resource_name) + mbt_ffi_store32((iter_base) + 60, (payload178).resource_name.length()) + mbt_ffi_store32((iter_base) + 56, ptr179) + cleanup_list.push(ptr179) + + () + } + EphemeralSleepTooLong(payload180) => { + mbt_ffi_store8((iter_base) + 32, (15)) + mbt_ffi_store64((iter_base) + 40, ((payload180).requested_nanos).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 48, ((payload180).max_nanos).reinterpret_as_int64()) + + () + } + EphemeralFuelExhausted(payload181) => { + mbt_ffi_store8((iter_base) + 32, (16)) + mbt_ffi_store64((iter_base) + 40, ((payload181).overdraft_limit).reinterpret_as_int64()) + + () + } + EphemeralCannotSuspend(payload182) => { + mbt_ffi_store8((iter_base) + 32, (17)) + + let ptr183 = mbt_ffi_str2ptr((payload182).reason) + mbt_ffi_store32((iter_base) + 44, (payload182).reason.length()) + mbt_ffi_store32((iter_base) + 40, ptr183) + cleanup_list.push(ptr183) + + () + } + ReadOnlyViolation(payload184) => { + mbt_ffi_store8((iter_base) + 32, (18)) + + let ptr185 = mbt_ffi_str2ptr((payload184).method_) + mbt_ffi_store32((iter_base) + 44, (payload184).method_.length()) + mbt_ffi_store32((iter_base) + 40, ptr185) + + let ptr186 = mbt_ffi_str2ptr((payload184).host_function) + mbt_ffi_store32((iter_base) + 52, (payload184).host_function.length()) + mbt_ffi_store32((iter_base) + 48, ptr186) + cleanup_list.push(ptr185) + cleanup_list.push(ptr186) + + () + } + } + mbt_ffi_store64((iter_base) + 64, ((payload157).retry_from).reinterpret_as_int64()) + mbt_ffi_store8((iter_base) + 72, (if (payload157).inside_atomic_region { 1 } else { 0 })) + + match ((payload157).retry_policy_state) { + None => { + mbt_ffi_store8((iter_base) + 76, (0)) + + () + } + Some(payload188) => { + mbt_ffi_store8((iter_base) + 76, (1)) + + let address195 = mbt_ffi_malloc(((payload188).nodes).length() * 16); + for index196 = 0; index196 < ((payload188).nodes).length(); index196 = index196 + 1 { + let iter_elem : StateNode = ((payload188).nodes)[(index196)] + let iter_base = address195 + (index196 * 16); + + match iter_elem { + Counter(payload189) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store32((iter_base) + 4, (payload189).reinterpret_as_int()) + + () + } + Terminal => { + mbt_ffi_store8((iter_base) + 0, (1)) + + () + } + Wrapper(payload191) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store32((iter_base) + 4, payload191) + + () + } + CountBox(payload192) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 4, ((payload192).attempts).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 8, (payload192).inner) + + () + } + AndThen(payload193) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 4, (payload193).left) + mbt_ffi_store32((iter_base) + 8, (payload193).right) + mbt_ffi_store8((iter_base) + 12, (if (payload193).on_right { 1 } else { 0 })) + + () + } + Pair(payload194) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store32((iter_base) + 4, (payload194).left) + mbt_ffi_store32((iter_base) + 8, (payload194).right) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 84, ((payload188).nodes).length()) + mbt_ffi_store32((iter_base) + 80, address195) + cleanup_list.push(address195) + + () + } + } () - } - Boolean(payload397) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8( - iter_base + 24, - if payload397 { - 1 - } else { - 0 - }, - ) + } + NoOp(payload197) => { + mbt_ffi_store8((iter_base) + 8, (8)) + mbt_ffi_store64((iter_base) + 16, ((payload197).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload197).timestamp).nanoseconds).reinterpret_as_int()) () - } - } - cleanup_list.push(ptr393) + } + Jump(payload198) => { + mbt_ffi_store8((iter_base) + 8, (9)) + mbt_ffi_store64((iter_base) + 16, ((payload198).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload198).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, (((payload198).jump).start).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 40, (((payload198).jump).end).reinterpret_as_int64()) - () + () } - PropLt(payload398) => { - mbt_ffi_store8(iter_base + 0, 4) + Interrupted(payload199) => { + mbt_ffi_store8((iter_base) + 8, (10)) + mbt_ffi_store64((iter_base) + 16, ((payload199).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload199).timestamp).nanoseconds).reinterpret_as_int()) - let ptr399 = mbt_ffi_str2ptr(payload398.property_name) - mbt_ffi_store32( - iter_base + 12, - payload398.property_name.length(), - ) - mbt_ffi_store32(iter_base + 8, ptr399) + () + } + Exited(payload200) => { + mbt_ffi_store8((iter_base) + 8, (11)) + mbt_ffi_store64((iter_base) + 16, ((payload200).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload200).timestamp).nanoseconds).reinterpret_as_int()) - match payload398.value { - Text(payload400) => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + BeginAtomicRegion(payload201) => { + mbt_ffi_store8((iter_base) + 8, (12)) + mbt_ffi_store64((iter_base) + 16, ((payload201).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload201).timestamp).nanoseconds).reinterpret_as_int()) - let ptr401 = mbt_ffi_str2ptr(payload400) - mbt_ffi_store32(iter_base + 28, payload400.length()) - mbt_ffi_store32(iter_base + 24, ptr401) - cleanup_list.push(ptr401) + () + } + EndAtomicRegion(payload202) => { + mbt_ffi_store8((iter_base) + 8, (13)) + mbt_ffi_store64((iter_base) + 16, ((payload202).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload202).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload202).begin_index).reinterpret_as_int64()) () - } - Integer(payload402) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload402) + } + PendingAgentInvocation(payload203) => { + mbt_ffi_store8((iter_base) + 8, (14)) + mbt_ffi_store64((iter_base) + 16, ((payload203).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload203).timestamp).nanoseconds).reinterpret_as_int()) + + let ptr204 = mbt_ffi_str2ptr((payload203).idempotency_key) + mbt_ffi_store32((iter_base) + 36, (payload203).idempotency_key.length()) + mbt_ffi_store32((iter_base) + 32, ptr204) + + match (payload203).payload { + Inline(payload205) => { + mbt_ffi_store8((iter_base) + 40, (0)) + + let ptr206 = mbt_ffi_bytes2ptr(payload205) + + mbt_ffi_store32((iter_base) + 52, payload205.length()) + mbt_ffi_store32((iter_base) + 48, ptr206) + cleanup_list.push(ptr206) + + () + } + External(payload207) => { + mbt_ffi_store8((iter_base) + 40, (1)) + mbt_ffi_store64((iter_base) + 48, (((payload207).payload_id).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 56, (((payload207).payload_id).low_bits).reinterpret_as_int64()) + + let ptr208 = mbt_ffi_bytes2ptr((payload207).md5_hash) + + mbt_ffi_store32((iter_base) + 68, (payload207).md5_hash.length()) + mbt_ffi_store32((iter_base) + 64, ptr208) + cleanup_list.push(ptr208) + + () + } + } + + let ptr209 = mbt_ffi_str2ptr((payload203).trace_id) + mbt_ffi_store32((iter_base) + 76, (payload203).trace_id.length()) + mbt_ffi_store32((iter_base) + 72, ptr209) + + let address211 = mbt_ffi_malloc(((payload203).trace_states).length() * 8); + for index212 = 0; index212 < ((payload203).trace_states).length(); index212 = index212 + 1 { + let iter_elem : String = ((payload203).trace_states)[(index212)] + let iter_base = address211 + (index212 * 8); + + let ptr210 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr210) + cleanup_list.push(ptr210) + + } + mbt_ffi_store32((iter_base) + 84, ((payload203).trace_states).length()) + mbt_ffi_store32((iter_base) + 80, address211) + + let address227 = mbt_ffi_malloc(((payload203).invocation_context).length() * 80); + for index228 = 0; index228 < ((payload203).invocation_context).length(); index228 = index228 + 1 { + let iter_elem : SpanData = ((payload203).invocation_context)[(index228)] + let iter_base = address227 + (index228 * 80); + + match iter_elem { + LocalSpan(payload213) => { + mbt_ffi_store8((iter_base) + 0, (0)) + + let ptr214 = mbt_ffi_str2ptr((payload213).span_id) + mbt_ffi_store32((iter_base) + 12, (payload213).span_id.length()) + mbt_ffi_store32((iter_base) + 8, ptr214) + mbt_ffi_store64((iter_base) + 16, ((payload213).start).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload213).start).nanoseconds).reinterpret_as_int()) + + match ((payload213).parent) { + None => { + mbt_ffi_store8((iter_base) + 32, (0)) + + () + } + Some(payload216) => { + mbt_ffi_store8((iter_base) + 32, (1)) + + let ptr217 = mbt_ffi_str2ptr(payload216) + mbt_ffi_store32((iter_base) + 40, payload216.length()) + mbt_ffi_store32((iter_base) + 36, ptr217) + cleanup_list.push(ptr217) + + () + } + } + + match ((payload213).linked_context) { + None => { + mbt_ffi_store8((iter_base) + 48, (0)) + + () + } + Some(payload219) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload219).reinterpret_as_int64()) + + () + } + } + + let address223 = mbt_ffi_malloc(((payload213).attributes).length() * 20); + for index224 = 0; index224 < ((payload213).attributes).length(); index224 = index224 + 1 { + let iter_elem : @context.Attribute = ((payload213).attributes)[(index224)] + let iter_base = address223 + (index224 * 20); + + let ptr220 = mbt_ffi_str2ptr((iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).key.length()) + mbt_ffi_store32((iter_base) + 0, ptr220) + + match (iter_elem).value { + String(payload221) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + let ptr222 = mbt_ffi_str2ptr(payload221) + mbt_ffi_store32((iter_base) + 16, payload221.length()) + mbt_ffi_store32((iter_base) + 12, ptr222) + cleanup_list.push(ptr222) + + () + } + } + cleanup_list.push(ptr220) + + } + mbt_ffi_store32((iter_base) + 68, ((payload213).attributes).length()) + mbt_ffi_store32((iter_base) + 64, address223) + mbt_ffi_store8((iter_base) + 72, (if (payload213).inherited { 1 } else { 0 })) + cleanup_list.push(ptr214) + cleanup_list.push(address223) + + () + } + ExternalSpan(payload225) => { + mbt_ffi_store8((iter_base) + 0, (1)) + + let ptr226 = mbt_ffi_str2ptr((payload225).span_id) + mbt_ffi_store32((iter_base) + 12, (payload225).span_id.length()) + mbt_ffi_store32((iter_base) + 8, ptr226) + cleanup_list.push(ptr226) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 92, ((payload203).invocation_context).length()) + mbt_ffi_store32((iter_base) + 88, address227) + cleanup_list.push(ptr204) + cleanup_list.push(ptr209) + cleanup_list.push(address211) + cleanup_list.push(address227) () - } - Boolean(payload403) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8( - iter_base + 24, - if payload403 { - 1 - } else { - 0 - }, - ) + } + PendingUpdate(payload229) => { + mbt_ffi_store8((iter_base) + 8, (15)) + mbt_ffi_store64((iter_base) + 16, ((payload229).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload229).timestamp).nanoseconds).reinterpret_as_int()) + + match (payload229).description { + Automatic(payload230) => { + mbt_ffi_store8((iter_base) + 32, (0)) + mbt_ffi_store64((iter_base) + 40, (payload230).reinterpret_as_int64()) + + () + } + SnapshotBased(payload231) => { + mbt_ffi_store8((iter_base) + 32, (1)) + mbt_ffi_store64((iter_base) + 40, ((payload231).target_revision).reinterpret_as_int64()) + + match (payload231).payload { + Inline(payload232) => { + mbt_ffi_store8((iter_base) + 48, (0)) + + let ptr233 = mbt_ffi_bytes2ptr(payload232) + + mbt_ffi_store32((iter_base) + 60, payload232.length()) + mbt_ffi_store32((iter_base) + 56, ptr233) + cleanup_list.push(ptr233) + + () + } + External(payload234) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (((payload234).payload_id).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 64, (((payload234).payload_id).low_bits).reinterpret_as_int64()) + + let ptr235 = mbt_ffi_bytes2ptr((payload234).md5_hash) + + mbt_ffi_store32((iter_base) + 76, (payload234).md5_hash.length()) + mbt_ffi_store32((iter_base) + 72, ptr235) + cleanup_list.push(ptr235) + + () + } + } + + let ptr236 = mbt_ffi_str2ptr((payload231).mime_type) + mbt_ffi_store32((iter_base) + 84, (payload231).mime_type.length()) + mbt_ffi_store32((iter_base) + 80, ptr236) + cleanup_list.push(ptr236) + + () + } + } () - } - } - cleanup_list.push(ptr399) + } + SuccessfulUpdate(payload237) => { + mbt_ffi_store8((iter_base) + 8, (16)) + mbt_ffi_store64((iter_base) + 16, ((payload237).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload237).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload237).target_revision).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 40, ((payload237).new_component_size).reinterpret_as_int64()) - () + let address238 = mbt_ffi_malloc(((payload237).new_active_plugins).length() * 16); + for index239 = 0; index239 < ((payload237).new_active_plugins).length(); index239 = index239 + 1 { + let iter_elem : EnvironmentPluginGrantId = ((payload237).new_active_plugins)[(index239)] + let iter_base = address238 + (index239 * 16); + mbt_ffi_store64((iter_base) + 0, (((iter_elem).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 8, (((iter_elem).uuid).low_bits).reinterpret_as_int64()) + + } + mbt_ffi_store32((iter_base) + 52, ((payload237).new_active_plugins).length()) + mbt_ffi_store32((iter_base) + 48, address238) + cleanup_list.push(address238) + + () } - PropLte(payload404) => { - mbt_ffi_store8(iter_base + 0, 5) + FailedUpdate(payload240) => { + mbt_ffi_store8((iter_base) + 8, (17)) + mbt_ffi_store64((iter_base) + 16, ((payload240).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload240).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload240).target_revision).reinterpret_as_int64()) - let ptr405 = mbt_ffi_str2ptr(payload404.property_name) - mbt_ffi_store32( - iter_base + 12, - payload404.property_name.length(), - ) - mbt_ffi_store32(iter_base + 8, ptr405) + match ((payload240).details) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) - match payload404.value { - Text(payload406) => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + Some(payload242) => { + mbt_ffi_store8((iter_base) + 40, (1)) - let ptr407 = mbt_ffi_str2ptr(payload406) - mbt_ffi_store32(iter_base + 28, payload406.length()) - mbt_ffi_store32(iter_base + 24, ptr407) - cleanup_list.push(ptr407) + let ptr243 = mbt_ffi_str2ptr(payload242) + mbt_ffi_store32((iter_base) + 48, payload242.length()) + mbt_ffi_store32((iter_base) + 44, ptr243) + cleanup_list.push(ptr243) - () - } - Integer(payload408) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload408) + () + } + } () - } - Boolean(payload409) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8( - iter_base + 24, - if payload409 { - 1 - } else { - 0 - }, - ) + } + GrowMemory(payload244) => { + mbt_ffi_store8((iter_base) + 8, (18)) + mbt_ffi_store64((iter_base) + 16, ((payload244).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload244).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload244).delta).reinterpret_as_int64()) () - } - } - cleanup_list.push(ptr405) + } + FilesystemStorageUsageUpdate(payload245) => { + mbt_ffi_store8((iter_base) + 8, (19)) + mbt_ffi_store64((iter_base) + 16, ((payload245).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload245).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, (payload245).delta) - () + () } - PropExists(payload410) => { - mbt_ffi_store8(iter_base + 0, 6) + CreateResource(payload246) => { + mbt_ffi_store8((iter_base) + 8, (20)) + mbt_ffi_store64((iter_base) + 16, ((payload246).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload246).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload246).id).reinterpret_as_int64()) - let ptr411 = mbt_ffi_str2ptr(payload410) - mbt_ffi_store32(iter_base + 12, payload410.length()) - mbt_ffi_store32(iter_base + 8, ptr411) - cleanup_list.push(ptr411) + let ptr247 = mbt_ffi_str2ptr(((payload246).resource_type_id).name) + mbt_ffi_store32((iter_base) + 44, ((payload246).resource_type_id).name.length()) + mbt_ffi_store32((iter_base) + 40, ptr247) - () - } - PropIn(payload412) => { - mbt_ffi_store8(iter_base + 0, 7) - - let ptr413 = mbt_ffi_str2ptr(payload412.property_name) - mbt_ffi_store32( - iter_base + 12, - payload412.property_name.length(), - ) - mbt_ffi_store32(iter_base + 8, ptr413) - - let address418 = mbt_ffi_malloc( - payload412.values.length() * 16, - ) - for index419 = 0 - index419 < payload412.values.length() - index419 = index419 + 1 { - let iter_elem : @retry.PredicateValue = payload412.values[index419] - let iter_base = address418 + index419 * 16 - - match iter_elem { - Text(payload414) => { - mbt_ffi_store8(iter_base + 0, 0) - - let ptr415 = mbt_ffi_str2ptr(payload414) - mbt_ffi_store32(iter_base + 12, payload414.length()) - mbt_ffi_store32(iter_base + 8, ptr415) - cleanup_list.push(ptr415) - - () - } - Integer(payload416) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store64(iter_base + 8, payload416) + let ptr248 = mbt_ffi_str2ptr(((payload246).resource_type_id).owner) + mbt_ffi_store32((iter_base) + 52, ((payload246).resource_type_id).owner.length()) + mbt_ffi_store32((iter_base) + 48, ptr248) + cleanup_list.push(ptr247) + cleanup_list.push(ptr248) - () - } - Boolean(payload417) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store8( - iter_base + 8, - if payload417 { - 1 - } else { - 0 - }, - ) - - () - } - } - } - mbt_ffi_store32(iter_base + 20, payload412.values.length()) - mbt_ffi_store32(iter_base + 16, address418) - cleanup_list.push(ptr413) - cleanup_list.push(address418) - - () - } - PropMatches(payload420) => { - mbt_ffi_store8(iter_base + 0, 8) - - let ptr421 = mbt_ffi_str2ptr(payload420.property_name) - mbt_ffi_store32( - iter_base + 12, - payload420.property_name.length(), - ) - mbt_ffi_store32(iter_base + 8, ptr421) - - let ptr422 = mbt_ffi_str2ptr(payload420.pattern) - mbt_ffi_store32(iter_base + 20, payload420.pattern.length()) - mbt_ffi_store32(iter_base + 16, ptr422) - cleanup_list.push(ptr421) - cleanup_list.push(ptr422) - - () + () } - PropStartsWith(payload423) => { - mbt_ffi_store8(iter_base + 0, 9) - - let ptr424 = mbt_ffi_str2ptr(payload423.property_name) - mbt_ffi_store32( - iter_base + 12, - payload423.property_name.length(), - ) - mbt_ffi_store32(iter_base + 8, ptr424) - - let ptr425 = mbt_ffi_str2ptr(payload423.pattern) - mbt_ffi_store32(iter_base + 20, payload423.pattern.length()) - mbt_ffi_store32(iter_base + 16, ptr425) - cleanup_list.push(ptr424) - cleanup_list.push(ptr425) - - () + DropResource(payload249) => { + mbt_ffi_store8((iter_base) + 8, (21)) + mbt_ffi_store64((iter_base) + 16, ((payload249).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload249).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload249).id).reinterpret_as_int64()) + + let ptr250 = mbt_ffi_str2ptr(((payload249).resource_type_id).name) + mbt_ffi_store32((iter_base) + 44, ((payload249).resource_type_id).name.length()) + mbt_ffi_store32((iter_base) + 40, ptr250) + + let ptr251 = mbt_ffi_str2ptr(((payload249).resource_type_id).owner) + mbt_ffi_store32((iter_base) + 52, ((payload249).resource_type_id).owner.length()) + mbt_ffi_store32((iter_base) + 48, ptr251) + cleanup_list.push(ptr250) + cleanup_list.push(ptr251) + + () } - PropContains(payload426) => { - mbt_ffi_store8(iter_base + 0, 10) - - let ptr427 = mbt_ffi_str2ptr(payload426.property_name) - mbt_ffi_store32( - iter_base + 12, - payload426.property_name.length(), - ) - mbt_ffi_store32(iter_base + 8, ptr427) - - let ptr428 = mbt_ffi_str2ptr(payload426.pattern) - mbt_ffi_store32(iter_base + 20, payload426.pattern.length()) - mbt_ffi_store32(iter_base + 16, ptr428) - cleanup_list.push(ptr427) - cleanup_list.push(ptr428) - - () + Log(payload252) => { + mbt_ffi_store8((iter_base) + 8, (22)) + mbt_ffi_store64((iter_base) + 16, ((payload252).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload252).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store8((iter_base) + 32, (payload252).level.ordinal()) + + let ptr253 = mbt_ffi_str2ptr((payload252).context) + mbt_ffi_store32((iter_base) + 40, (payload252).context.length()) + mbt_ffi_store32((iter_base) + 36, ptr253) + + let ptr254 = mbt_ffi_str2ptr((payload252).message) + mbt_ffi_store32((iter_base) + 48, (payload252).message.length()) + mbt_ffi_store32((iter_base) + 44, ptr254) + cleanup_list.push(ptr253) + cleanup_list.push(ptr254) + + () } - PredAnd(payload429) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload429.0) - mbt_ffi_store32(iter_base + 12, payload429.1) + Restart(payload255) => { + mbt_ffi_store8((iter_base) + 8, (23)) + mbt_ffi_store64((iter_base) + 16, ((payload255).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload255).timestamp).nanoseconds).reinterpret_as_int()) - () + () } - PredOr(payload430) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store32(iter_base + 8, payload430.0) - mbt_ffi_store32(iter_base + 12, payload430.1) + ActivatePlugin(payload256) => { + mbt_ffi_store8((iter_base) + 8, (24)) + mbt_ffi_store64((iter_base) + 16, ((payload256).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload256).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((((payload256).plugin_grant_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 40, ((((payload256).plugin_grant_id).uuid).low_bits).reinterpret_as_int64()) - () + () } - PredNot(payload431) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store32(iter_base + 8, payload431) + DeactivatePlugin(payload257) => { + mbt_ffi_store8((iter_base) + 8, (25)) + mbt_ffi_store64((iter_base) + 16, ((payload257).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload257).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((((payload257).plugin_grant_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 40, ((((payload257).plugin_grant_id).uuid).low_bits).reinterpret_as_int64()) - () + () } - PredTrue => { - mbt_ffi_store8(iter_base + 0, 14) + Revert(payload258) => { + mbt_ffi_store8((iter_base) + 8, (26)) + mbt_ffi_store64((iter_base) + 16, ((payload258).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload258).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, (((payload258).dropped_region).start).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 40, (((payload258).dropped_region).end).reinterpret_as_int64()) - () + () } - PredFalse => { - mbt_ffi_store8(iter_base + 0, 15) + CancelPendingInvocation(payload259) => { + mbt_ffi_store8((iter_base) + 8, (27)) + mbt_ffi_store64((iter_base) + 16, ((payload259).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload259).timestamp).nanoseconds).reinterpret_as_int()) + + let ptr260 = mbt_ffi_str2ptr((payload259).idempotency_key) + mbt_ffi_store32((iter_base) + 36, (payload259).idempotency_key.length()) + mbt_ffi_store32((iter_base) + 32, ptr260) + cleanup_list.push(ptr260) - () + () } - } - } - mbt_ffi_store32( - iter_base + 12, - payload373.predicate.nodes.length(), - ) - mbt_ffi_store32(iter_base + 8, address434) - mbt_ffi_store32(iter_base + 16, payload373.inner) - cleanup_list.push(address434) - - () - } - AndThen(payload436) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload436.0) - mbt_ffi_store32(iter_base + 12, payload436.1) + StartSpan(payload261) => { + mbt_ffi_store8((iter_base) + 8, (28)) + mbt_ffi_store64((iter_base) + 16, ((payload261).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload261).timestamp).nanoseconds).reinterpret_as_int()) - () - } - PolicyUnion(payload437) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store32(iter_base + 8, payload437.0) - mbt_ffi_store32(iter_base + 12, payload437.1) + let ptr262 = mbt_ffi_str2ptr((payload261).span_id) + mbt_ffi_store32((iter_base) + 36, (payload261).span_id.length()) + mbt_ffi_store32((iter_base) + 32, ptr262) - () - } - PolicyIntersect(payload438) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store32(iter_base + 8, payload438.0) - mbt_ffi_store32(iter_base + 12, payload438.1) + match ((payload261).parent) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) - () - } - } - } - mbt_ffi_store32(iter_base + 56, payload299.policy.policy.nodes.length()) - mbt_ffi_store32(iter_base + 52, address439) - cleanup_list.push(ptr300) - cleanup_list.push(address361) - cleanup_list.push(address439) - - () - } - RemoveRetryPolicy(payload441) => { - mbt_ffi_store8(iter_base + 8, 40) - mbt_ffi_store64(iter_base + 16, payload441.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload441.timestamp.nanoseconds.reinterpret_as_int(), - ) - - let ptr442 = mbt_ffi_str2ptr(payload441.name) - mbt_ffi_store32(iter_base + 36, payload441.name.length()) - mbt_ffi_store32(iter_base + 32, ptr442) - cleanup_list.push(ptr442) - - () - } - CardEventQueued(payload443) => { - mbt_ffi_store8(iter_base + 8, 41) - mbt_ffi_store64(iter_base + 16, payload443.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload443.timestamp.nanoseconds.reinterpret_as_int(), - ) - - match payload443.event { - Install(payload444) => { - mbt_ffi_store8(iter_base + 32, 0) - mbt_ffi_store64( - iter_base + 40, - payload444.card_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 48, - payload444.card_id.uuid.low_bits.reinterpret_as_int64(), - ) - - () - } - Revoke(payload445) => { - mbt_ffi_store8(iter_base + 32, 1) - mbt_ffi_store64( - iter_base + 40, - payload445.card_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 48, - payload445.card_id.uuid.low_bits.reinterpret_as_int64(), - ) - - () - } - } - - () - } - CardInstalled(payload446) => { - mbt_ffi_store8(iter_base + 8, 42) - mbt_ffi_store64(iter_base + 16, payload446.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload446.timestamp.nanoseconds.reinterpret_as_int(), - ) - - match payload446.queued_event_index { - None => { - mbt_ffi_store8(iter_base + 32, 0) - - () - } - Some(payload448) => { - mbt_ffi_store8(iter_base + 32, 1) - mbt_ffi_store64(iter_base + 40, payload448.reinterpret_as_int64()) - - () - } - } - - let ptr449 = mbt_ffi_bytes2ptr(payload446.card) - - mbt_ffi_store32(iter_base + 52, payload446.card.length()) - mbt_ffi_store32(iter_base + 48, ptr449) - cleanup_list.push(ptr449) - - () - } - CardInstallFailed(payload450) => { - mbt_ffi_store8(iter_base + 8, 43) - mbt_ffi_store64(iter_base + 16, payload450.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload450.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload450.queued_event_index.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 40, - payload450.card_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 48, - payload450.card_id.uuid.low_bits.reinterpret_as_int64(), - ) - mbt_ffi_store8(iter_base + 56, payload450.reason.ordinal()) - - () - } - CardRevoked(payload451) => { - mbt_ffi_store8(iter_base + 8, 44) - mbt_ffi_store64(iter_base + 16, payload451.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload451.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload451.queued_event_index.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 40, - payload451.card_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 48, - payload451.card_id.uuid.low_bits.reinterpret_as_int64(), - ) - - () - } - CardExpired(payload452) => { - mbt_ffi_store8(iter_base + 8, 45) - mbt_ffi_store64(iter_base + 16, payload452.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload452.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload452.card_id.uuid.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 40, - payload452.card_id.uuid.low_bits.reinterpret_as_int64(), - ) - - () - } - HostStreamFrame(payload453) => { - mbt_ffi_store8(iter_base + 8, 46) - mbt_ffi_store64(iter_base + 16, payload453.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload453.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload453.parent_start_index.reinterpret_as_int64(), - ) - mbt_ffi_store8(iter_base + 40, payload453.kind.ordinal()) - - match payload453.payload { - Inline(payload454) => { - mbt_ffi_store8(iter_base + 48, 0) - - let ptr455 = mbt_ffi_bytes2ptr(payload454) - - mbt_ffi_store32(iter_base + 60, payload454.length()) - mbt_ffi_store32(iter_base + 56, ptr455) - cleanup_list.push(ptr455) - - () - } - External(payload456) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload456.payload_id.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 64, - payload456.payload_id.low_bits.reinterpret_as_int64(), - ) - - let ptr457 = mbt_ffi_bytes2ptr(payload456.md5_hash) - - mbt_ffi_store32(iter_base + 76, payload456.md5_hash.length()) - mbt_ffi_store32(iter_base + 72, ptr457) - cleanup_list.push(ptr457) - - () - } - } - - () - } - CompletionDiscarded(payload458) => { - mbt_ffi_store8(iter_base + 8, 47) - mbt_ffi_store64(iter_base + 16, payload458.timestamp.seconds) - mbt_ffi_store32( - iter_base + 24, - payload458.timestamp.nanoseconds.reinterpret_as_int(), - ) - mbt_ffi_store64( - iter_base + 32, - payload458.start_index.reinterpret_as_int64(), - ) - - () - } - } - } - let return_area = mbt_ffi_malloc(12) - wasmImportEnrichOplogEntries( - environment_id.uuid.high_bits.reinterpret_as_int64(), - environment_id.uuid.low_bits.reinterpret_as_int64(), - agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ptr, - agent_id.agent_id.length(), - address459, - entries.length(), - component_revision.reinterpret_as_int64(), - return_area, - ) - - let lifted3300 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array3297 : Array[PublicOplogEntry] = [] - for index3298 = 0 - index3298 < mbt_ffi_load32(return_area + 8) - index3298 = index3298 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index3298 * 208 - - let lifted3296 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let array : Array[(String, String)] = [] - for index463 = 0 - index463 < mbt_ffi_load32(iter_base + 68) - index463 = index463 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + index463 * 16 - - let result461 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result462 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array.push((result461, result462)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - let lifted : @types.AgentId? = match - mbt_ffi_load8_u(iter_base + 104) { - 0 => Option::None - 1 => { - let result464 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 128), - mbt_ffi_load32(iter_base + 132), - ) - - Option::Some(@types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 112).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 120).reinterpret_as_uint64(), - }, - }, - agent_id: result464, - }) - } - _ => panic() - } + () + } + Some(payload264) => { + mbt_ffi_store8((iter_base) + 40, (1)) - let array471 : Array[PluginInstallationDescription] = [] - for index472 = 0 - index472 < mbt_ffi_load32(iter_base + 156) - index472 = index472 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 152) + index472 * 48 - - let result465 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - let result466 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - let array469 : Array[(String, String)] = [] - for index470 = 0 - index470 < mbt_ffi_load32(iter_base + 40) - index470 = index470 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index470 * 16 - - let result467 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result468 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array469.push((result467, result468)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - array471.push(PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 16), - plugin_name: result465, - plugin_version: result466, - parameters: array469, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 152)) - - let array710 : Array[LocalAgentConfigEntry] = [] - for index711 = 0 - index711 < mbt_ffi_load32(iter_base + 164) - index711 = index711 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 160) + index711 * 40 - - let array474 : Array[String] = [] - for index475 = 0 - index475 < mbt_ffi_load32(iter_base + 4) - index475 = index475 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + index475 * 8 - - let result473 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array474.push(result473) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - let array672 : Array[@types.SchemaTypeNode] = [] - for index673 = 0 - index673 < mbt_ffi_load32(iter_base + 12) - index673 = index673 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index673 * 144 - - let lifted658 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted482 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted477 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted476 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let ptr265 = mbt_ffi_str2ptr(payload264) + mbt_ffi_store32((iter_base) + 48, payload264.length()) + mbt_ffi_store32((iter_base) + 44, ptr265) + cleanup_list.push(ptr265) - Option::Some(lifted476) - } - _ => panic() + () + } } - let lifted479 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted478 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + match ((payload261).linked_context_id) { + None => { + mbt_ffi_store8((iter_base) + 52, (0)) - Option::Some(lifted478) - } - _ => panic() - } + () + } + Some(payload267) => { + mbt_ffi_store8((iter_base) + 52, (1)) + + let ptr268 = mbt_ffi_str2ptr(payload267) + mbt_ffi_store32((iter_base) + 60, payload267.length()) + mbt_ffi_store32((iter_base) + 56, ptr268) + cleanup_list.push(ptr268) - let lifted481 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result480 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result480) - } - _ => panic() + () + } } - Option::Some(@types.NumericRestrictions::{ - min: lifted477, - max: lifted479, - unit: lifted481, - }) - } - _ => panic() - } + let address272 = mbt_ffi_malloc(((payload261).attributes).length() * 20); + for index273 = 0; index273 < ((payload261).attributes).length(); index273 = index273 + 1 { + let iter_elem : @context.Attribute = ((payload261).attributes)[(index273)] + let iter_base = address272 + (index273 * 20); - @types.SchemaTypeBody::S8Type(lifted482) - } - 3 => { - let lifted489 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted484 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted483 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let ptr269 = mbt_ffi_str2ptr((iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).key.length()) + mbt_ffi_store32((iter_base) + 0, ptr269) - Option::Some(lifted483) - } - _ => panic() - } + match (iter_elem).value { + String(payload270) => { + mbt_ffi_store8((iter_base) + 8, (0)) - let lifted486 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted485 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let ptr271 = mbt_ffi_str2ptr(payload270) + mbt_ffi_store32((iter_base) + 16, payload270.length()) + mbt_ffi_store32((iter_base) + 12, ptr271) + cleanup_list.push(ptr271) - Option::Some(lifted485) - } - _ => panic() - } + () + } + } + cleanup_list.push(ptr269) - let lifted488 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result487 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result487) - } - _ => panic() } + mbt_ffi_store32((iter_base) + 68, ((payload261).attributes).length()) + mbt_ffi_store32((iter_base) + 64, address272) + cleanup_list.push(ptr262) + cleanup_list.push(address272) + + () + } + FinishSpan(payload274) => { + mbt_ffi_store8((iter_base) + 8, (29)) + mbt_ffi_store64((iter_base) + 16, ((payload274).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload274).timestamp).nanoseconds).reinterpret_as_int()) - Option::Some(@types.NumericRestrictions::{ - min: lifted484, - max: lifted486, - unit: lifted488, - }) - } - _ => panic() - } + let ptr275 = mbt_ffi_str2ptr((payload274).span_id) + mbt_ffi_store32((iter_base) + 36, (payload274).span_id.length()) + mbt_ffi_store32((iter_base) + 32, ptr275) + cleanup_list.push(ptr275) - @types.SchemaTypeBody::S16Type(lifted489) + () } - 4 => { - let lifted496 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted491 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted490 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + SetSpanAttribute(payload276) => { + mbt_ffi_store8((iter_base) + 8, (30)) + mbt_ffi_store64((iter_base) + 16, ((payload276).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload276).timestamp).nanoseconds).reinterpret_as_int()) + + let ptr277 = mbt_ffi_str2ptr((payload276).span_id) + mbt_ffi_store32((iter_base) + 36, (payload276).span_id.length()) + mbt_ffi_store32((iter_base) + 32, ptr277) + + let ptr278 = mbt_ffi_str2ptr((payload276).key) + mbt_ffi_store32((iter_base) + 44, (payload276).key.length()) + mbt_ffi_store32((iter_base) + 40, ptr278) - Option::Some(lifted490) - } - _ => panic() + match (payload276).value { + String(payload279) => { + mbt_ffi_store8((iter_base) + 48, (0)) + + let ptr280 = mbt_ffi_str2ptr(payload279) + mbt_ffi_store32((iter_base) + 56, payload279.length()) + mbt_ffi_store32((iter_base) + 52, ptr280) + cleanup_list.push(ptr280) + + () + } } + cleanup_list.push(ptr277) + cleanup_list.push(ptr278) - let lifted493 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted492 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + () + } + ChangePersistenceLevel(payload281) => { + mbt_ffi_store8((iter_base) + 8, (31)) + mbt_ffi_store64((iter_base) + 16, ((payload281).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload281).timestamp).nanoseconds).reinterpret_as_int()) + + match (payload281).persistence_level { + PersistNothing => { + mbt_ffi_store8((iter_base) + 32, (0)) + + () + } + PersistRemoteSideEffects => { + mbt_ffi_store8((iter_base) + 32, (1)) + + () + } + Smart => { + mbt_ffi_store8((iter_base) + 32, (2)) - Option::Some(lifted492) - } - _ => panic() + () + } } - let lifted495 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result494 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result494) - } - _ => panic() + () + } + BeginRemoteTransaction(payload285) => { + mbt_ffi_store8((iter_base) + 8, (32)) + mbt_ffi_store64((iter_base) + 16, ((payload285).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload285).timestamp).nanoseconds).reinterpret_as_int()) + + let ptr286 = mbt_ffi_str2ptr((payload285).transaction_id) + mbt_ffi_store32((iter_base) + 36, (payload285).transaction_id.length()) + mbt_ffi_store32((iter_base) + 32, ptr286) + + match ((payload285).original_begin_index) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload288) => { + mbt_ffi_store8((iter_base) + 40, (1)) + mbt_ffi_store64((iter_base) + 48, (payload288).reinterpret_as_int64()) + + () + } } + cleanup_list.push(ptr286) - Option::Some(@types.NumericRestrictions::{ - min: lifted491, - max: lifted493, - unit: lifted495, - }) - } - _ => panic() - } + () + } + PreCommitRemoteTransaction(payload289) => { + mbt_ffi_store8((iter_base) + 8, (33)) + mbt_ffi_store64((iter_base) + 16, ((payload289).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload289).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload289).begin_index).reinterpret_as_int64()) - @types.SchemaTypeBody::S32Type(lifted496) + () } - 5 => { - let lifted503 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted498 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted497 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + PreRollbackRemoteTransaction(payload290) => { + mbt_ffi_store8((iter_base) + 8, (34)) + mbt_ffi_store64((iter_base) + 16, ((payload290).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload290).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload290).begin_index).reinterpret_as_int64()) + + () + } + CommittedRemoteTransaction(payload291) => { + mbt_ffi_store8((iter_base) + 8, (35)) + mbt_ffi_store64((iter_base) + 16, ((payload291).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload291).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload291).begin_index).reinterpret_as_int64()) + + () + } + RolledBackRemoteTransaction(payload292) => { + mbt_ffi_store8((iter_base) + 8, (36)) + mbt_ffi_store64((iter_base) + 16, ((payload292).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload292).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload292).begin_index).reinterpret_as_int64()) + + () + } + Snapshot(payload293) => { + mbt_ffi_store8((iter_base) + 8, (37)) + mbt_ffi_store64((iter_base) + 16, ((payload293).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload293).timestamp).nanoseconds).reinterpret_as_int()) + + match (payload293).data { + Inline(payload294) => { + mbt_ffi_store8((iter_base) + 32, (0)) + + let ptr295 = mbt_ffi_bytes2ptr(payload294) + + mbt_ffi_store32((iter_base) + 44, payload294.length()) + mbt_ffi_store32((iter_base) + 40, ptr295) + cleanup_list.push(ptr295) + + () + } + External(payload296) => { + mbt_ffi_store8((iter_base) + 32, (1)) + mbt_ffi_store64((iter_base) + 40, (((payload296).payload_id).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 48, (((payload296).payload_id).low_bits).reinterpret_as_int64()) + + let ptr297 = mbt_ffi_bytes2ptr((payload296).md5_hash) + + mbt_ffi_store32((iter_base) + 60, (payload296).md5_hash.length()) + mbt_ffi_store32((iter_base) + 56, ptr297) + cleanup_list.push(ptr297) + + () + } + } + + let ptr298 = mbt_ffi_str2ptr((payload293).mime_type) + mbt_ffi_store32((iter_base) + 68, (payload293).mime_type.length()) + mbt_ffi_store32((iter_base) + 64, ptr298) + cleanup_list.push(ptr298) + + () + } + OplogProcessorCheckpoint(payload299) => { + mbt_ffi_store8((iter_base) + 8, (38)) + mbt_ffi_store64((iter_base) + 16, ((payload299).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload299).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((((payload299).plugin_grant_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 40, ((((payload299).plugin_grant_id).uuid).low_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 48, (((((payload299).target_agent_id).component_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 56, (((((payload299).target_agent_id).component_id).uuid).low_bits).reinterpret_as_int64()) + + let ptr300 = mbt_ffi_str2ptr(((payload299).target_agent_id).agent_id) + mbt_ffi_store32((iter_base) + 68, ((payload299).target_agent_id).agent_id.length()) + mbt_ffi_store32((iter_base) + 64, ptr300) + mbt_ffi_store64((iter_base) + 72, ((payload299).confirmed_up_to).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 80, ((payload299).sending_up_to).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 88, ((payload299).last_batch_start).reinterpret_as_int64()) + cleanup_list.push(ptr300) + + () + } + SetRetryPolicy(payload301) => { + mbt_ffi_store8((iter_base) + 8, (39)) + mbt_ffi_store64((iter_base) + 16, ((payload301).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload301).timestamp).nanoseconds).reinterpret_as_int()) + + let ptr302 = mbt_ffi_str2ptr(((payload301).policy).name) + mbt_ffi_store32((iter_base) + 36, ((payload301).policy).name.length()) + mbt_ffi_store32((iter_base) + 32, ptr302) + mbt_ffi_store32((iter_base) + 40, (((payload301).policy).priority).reinterpret_as_int()) + + let address363 = mbt_ffi_malloc(((((payload301).policy).predicate).nodes).length() * 32); + for index364 = 0; index364 < ((((payload301).policy).predicate).nodes).length(); index364 = index364 + 1 { + let iter_elem : @retry.PredicateNode = ((((payload301).policy).predicate).nodes)[(index364)] + let iter_base = address363 + (index364 * 32); + + match iter_elem { + PropEq(payload303) => { + mbt_ffi_store8((iter_base) + 0, (0)) + + let ptr304 = mbt_ffi_str2ptr((payload303).property_name) + mbt_ffi_store32((iter_base) + 12, (payload303).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr304) + + match (payload303).value { + Text(payload305) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr306 = mbt_ffi_str2ptr(payload305) + mbt_ffi_store32((iter_base) + 28, payload305.length()) + mbt_ffi_store32((iter_base) + 24, ptr306) + cleanup_list.push(ptr306) + + () + } + Integer(payload307) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload307) + + () + } + Boolean(payload308) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload308 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr304) + + () + } + PropNeq(payload309) => { + mbt_ffi_store8((iter_base) + 0, (1)) + + let ptr310 = mbt_ffi_str2ptr((payload309).property_name) + mbt_ffi_store32((iter_base) + 12, (payload309).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr310) + + match (payload309).value { + Text(payload311) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr312 = mbt_ffi_str2ptr(payload311) + mbt_ffi_store32((iter_base) + 28, payload311.length()) + mbt_ffi_store32((iter_base) + 24, ptr312) + cleanup_list.push(ptr312) + + () + } + Integer(payload313) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload313) + + () + } + Boolean(payload314) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload314 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr310) + + () + } + PropGt(payload315) => { + mbt_ffi_store8((iter_base) + 0, (2)) + + let ptr316 = mbt_ffi_str2ptr((payload315).property_name) + mbt_ffi_store32((iter_base) + 12, (payload315).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr316) + + match (payload315).value { + Text(payload317) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr318 = mbt_ffi_str2ptr(payload317) + mbt_ffi_store32((iter_base) + 28, payload317.length()) + mbt_ffi_store32((iter_base) + 24, ptr318) + cleanup_list.push(ptr318) + + () + } + Integer(payload319) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload319) + + () + } + Boolean(payload320) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload320 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr316) + + () + } + PropGte(payload321) => { + mbt_ffi_store8((iter_base) + 0, (3)) + + let ptr322 = mbt_ffi_str2ptr((payload321).property_name) + mbt_ffi_store32((iter_base) + 12, (payload321).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr322) + + match (payload321).value { + Text(payload323) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr324 = mbt_ffi_str2ptr(payload323) + mbt_ffi_store32((iter_base) + 28, payload323.length()) + mbt_ffi_store32((iter_base) + 24, ptr324) + cleanup_list.push(ptr324) + + () + } + Integer(payload325) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload325) + + () + } + Boolean(payload326) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload326 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr322) + + () + } + PropLt(payload327) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + let ptr328 = mbt_ffi_str2ptr((payload327).property_name) + mbt_ffi_store32((iter_base) + 12, (payload327).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr328) + + match (payload327).value { + Text(payload329) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr330 = mbt_ffi_str2ptr(payload329) + mbt_ffi_store32((iter_base) + 28, payload329.length()) + mbt_ffi_store32((iter_base) + 24, ptr330) + cleanup_list.push(ptr330) + + () + } + Integer(payload331) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload331) + + () + } + Boolean(payload332) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload332 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr328) + + () + } + PropLte(payload333) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + let ptr334 = mbt_ffi_str2ptr((payload333).property_name) + mbt_ffi_store32((iter_base) + 12, (payload333).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr334) + + match (payload333).value { + Text(payload335) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr336 = mbt_ffi_str2ptr(payload335) + mbt_ffi_store32((iter_base) + 28, payload335.length()) + mbt_ffi_store32((iter_base) + 24, ptr336) + cleanup_list.push(ptr336) + + () + } + Integer(payload337) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload337) + + () + } + Boolean(payload338) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload338 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr334) + + () + } + PropExists(payload339) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + let ptr340 = mbt_ffi_str2ptr(payload339) + mbt_ffi_store32((iter_base) + 12, payload339.length()) + mbt_ffi_store32((iter_base) + 8, ptr340) + cleanup_list.push(ptr340) + + () + } + PropIn(payload341) => { + mbt_ffi_store8((iter_base) + 0, (7)) + + let ptr342 = mbt_ffi_str2ptr((payload341).property_name) + mbt_ffi_store32((iter_base) + 12, (payload341).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr342) + + let address347 = mbt_ffi_malloc(((payload341).values).length() * 16); + for index348 = 0; index348 < ((payload341).values).length(); index348 = index348 + 1 { + let iter_elem : @retry.PredicateValue = ((payload341).values)[(index348)] + let iter_base = address347 + (index348 * 16); + + match iter_elem { + Text(payload343) => { + mbt_ffi_store8((iter_base) + 0, (0)) + + let ptr344 = mbt_ffi_str2ptr(payload343) + mbt_ffi_store32((iter_base) + 12, payload343.length()) + mbt_ffi_store32((iter_base) + 8, ptr344) + cleanup_list.push(ptr344) + + () + } + Integer(payload345) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store64((iter_base) + 8, payload345) + + () + } + Boolean(payload346) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store8((iter_base) + 8, (if payload346 { 1 } else { 0 })) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 20, ((payload341).values).length()) + mbt_ffi_store32((iter_base) + 16, address347) + cleanup_list.push(ptr342) + cleanup_list.push(address347) + + () + } + PropMatches(payload349) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + let ptr350 = mbt_ffi_str2ptr((payload349).property_name) + mbt_ffi_store32((iter_base) + 12, (payload349).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr350) + + let ptr351 = mbt_ffi_str2ptr((payload349).pattern) + mbt_ffi_store32((iter_base) + 20, (payload349).pattern.length()) + mbt_ffi_store32((iter_base) + 16, ptr351) + cleanup_list.push(ptr350) + cleanup_list.push(ptr351) + + () + } + PropStartsWith(payload352) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr353 = mbt_ffi_str2ptr((payload352).property_name) + mbt_ffi_store32((iter_base) + 12, (payload352).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr353) + + let ptr354 = mbt_ffi_str2ptr((payload352).pattern) + mbt_ffi_store32((iter_base) + 20, (payload352).pattern.length()) + mbt_ffi_store32((iter_base) + 16, ptr354) + cleanup_list.push(ptr353) + cleanup_list.push(ptr354) + + () + } + PropContains(payload355) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + let ptr356 = mbt_ffi_str2ptr((payload355).property_name) + mbt_ffi_store32((iter_base) + 12, (payload355).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr356) + + let ptr357 = mbt_ffi_str2ptr((payload355).pattern) + mbt_ffi_store32((iter_base) + 20, (payload355).pattern.length()) + mbt_ffi_store32((iter_base) + 16, ptr357) + cleanup_list.push(ptr356) + cleanup_list.push(ptr357) + + () + } + PredAnd(payload358) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload358).0) + mbt_ffi_store32((iter_base) + 12, (payload358).1) + + () + } + PredOr(payload359) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store32((iter_base) + 8, (payload359).0) + mbt_ffi_store32((iter_base) + 12, (payload359).1) + + () + } + PredNot(payload360) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store32((iter_base) + 8, payload360) + + () + } + PredTrue => { + mbt_ffi_store8((iter_base) + 0, (14)) + + () + } + PredFalse => { + mbt_ffi_store8((iter_base) + 0, (15)) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 48, ((((payload301).policy).predicate).nodes).length()) + mbt_ffi_store32((iter_base) + 44, address363) + + let address441 = mbt_ffi_malloc(((((payload301).policy).policy).nodes).length() * 32); + for index442 = 0; index442 < ((((payload301).policy).policy).nodes).length(); index442 = index442 + 1 { + let iter_elem : @retry.PolicyNode = ((((payload301).policy).policy).nodes)[(index442)] + let iter_base = address441 + (index442 * 32); + + match iter_elem { + Periodic(payload365) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store64((iter_base) + 8, (payload365).reinterpret_as_int64()) + + () + } + Exponential(payload366) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store64((iter_base) + 8, ((payload366).base_delay).reinterpret_as_int64()) + mbt_ffi_storef64((iter_base) + 16, (payload366).factor) + + () + } + Fibonacci(payload367) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store64((iter_base) + 8, ((payload367).first).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload367).second).reinterpret_as_int64()) + + () + } + Immediate => { + mbt_ffi_store8((iter_base) + 0, (3)) + + () + } + Never => { + mbt_ffi_store8((iter_base) + 0, (4)) + + () + } + CountBox(payload370) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store32((iter_base) + 8, ((payload370).max_retries).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 12, (payload370).inner) + + () + } + TimeBox(payload371) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store64((iter_base) + 8, ((payload371).limit).reinterpret_as_int64()) + mbt_ffi_store32((iter_base) + 16, (payload371).inner) + + () + } + ClampDelay(payload372) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store64((iter_base) + 8, ((payload372).min_delay).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload372).max_delay).reinterpret_as_int64()) + mbt_ffi_store32((iter_base) + 24, (payload372).inner) + + () + } + AddDelay(payload373) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, ((payload373).delay).reinterpret_as_int64()) + mbt_ffi_store32((iter_base) + 16, (payload373).inner) + + () + } + Jitter(payload374) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef64((iter_base) + 8, (payload374).factor) + mbt_ffi_store32((iter_base) + 16, (payload374).inner) + + () + } + FilteredOn(payload375) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + let address436 = mbt_ffi_malloc((((payload375).predicate).nodes).length() * 32); + for index437 = 0; index437 < (((payload375).predicate).nodes).length(); index437 = index437 + 1 { + let iter_elem : @retry.PredicateNode = (((payload375).predicate).nodes)[(index437)] + let iter_base = address436 + (index437 * 32); + + match iter_elem { + PropEq(payload376) => { + mbt_ffi_store8((iter_base) + 0, (0)) + + let ptr377 = mbt_ffi_str2ptr((payload376).property_name) + mbt_ffi_store32((iter_base) + 12, (payload376).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr377) + + match (payload376).value { + Text(payload378) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr379 = mbt_ffi_str2ptr(payload378) + mbt_ffi_store32((iter_base) + 28, payload378.length()) + mbt_ffi_store32((iter_base) + 24, ptr379) + cleanup_list.push(ptr379) + + () + } + Integer(payload380) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload380) + + () + } + Boolean(payload381) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload381 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr377) + + () + } + PropNeq(payload382) => { + mbt_ffi_store8((iter_base) + 0, (1)) + + let ptr383 = mbt_ffi_str2ptr((payload382).property_name) + mbt_ffi_store32((iter_base) + 12, (payload382).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr383) + + match (payload382).value { + Text(payload384) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr385 = mbt_ffi_str2ptr(payload384) + mbt_ffi_store32((iter_base) + 28, payload384.length()) + mbt_ffi_store32((iter_base) + 24, ptr385) + cleanup_list.push(ptr385) + + () + } + Integer(payload386) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload386) + + () + } + Boolean(payload387) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload387 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr383) + + () + } + PropGt(payload388) => { + mbt_ffi_store8((iter_base) + 0, (2)) + + let ptr389 = mbt_ffi_str2ptr((payload388).property_name) + mbt_ffi_store32((iter_base) + 12, (payload388).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr389) + + match (payload388).value { + Text(payload390) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr391 = mbt_ffi_str2ptr(payload390) + mbt_ffi_store32((iter_base) + 28, payload390.length()) + mbt_ffi_store32((iter_base) + 24, ptr391) + cleanup_list.push(ptr391) + + () + } + Integer(payload392) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload392) + + () + } + Boolean(payload393) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload393 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr389) + + () + } + PropGte(payload394) => { + mbt_ffi_store8((iter_base) + 0, (3)) + + let ptr395 = mbt_ffi_str2ptr((payload394).property_name) + mbt_ffi_store32((iter_base) + 12, (payload394).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr395) + + match (payload394).value { + Text(payload396) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr397 = mbt_ffi_str2ptr(payload396) + mbt_ffi_store32((iter_base) + 28, payload396.length()) + mbt_ffi_store32((iter_base) + 24, ptr397) + cleanup_list.push(ptr397) + + () + } + Integer(payload398) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload398) + + () + } + Boolean(payload399) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload399 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr395) + + () + } + PropLt(payload400) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + let ptr401 = mbt_ffi_str2ptr((payload400).property_name) + mbt_ffi_store32((iter_base) + 12, (payload400).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr401) + + match (payload400).value { + Text(payload402) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr403 = mbt_ffi_str2ptr(payload402) + mbt_ffi_store32((iter_base) + 28, payload402.length()) + mbt_ffi_store32((iter_base) + 24, ptr403) + cleanup_list.push(ptr403) + + () + } + Integer(payload404) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload404) + + () + } + Boolean(payload405) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload405 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr401) + + () + } + PropLte(payload406) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + let ptr407 = mbt_ffi_str2ptr((payload406).property_name) + mbt_ffi_store32((iter_base) + 12, (payload406).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr407) + + match (payload406).value { + Text(payload408) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr409 = mbt_ffi_str2ptr(payload408) + mbt_ffi_store32((iter_base) + 28, payload408.length()) + mbt_ffi_store32((iter_base) + 24, ptr409) + cleanup_list.push(ptr409) + + () + } + Integer(payload410) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload410) + + () + } + Boolean(payload411) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload411 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr407) + + () + } + PropExists(payload412) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + let ptr413 = mbt_ffi_str2ptr(payload412) + mbt_ffi_store32((iter_base) + 12, payload412.length()) + mbt_ffi_store32((iter_base) + 8, ptr413) + cleanup_list.push(ptr413) + + () + } + PropIn(payload414) => { + mbt_ffi_store8((iter_base) + 0, (7)) + + let ptr415 = mbt_ffi_str2ptr((payload414).property_name) + mbt_ffi_store32((iter_base) + 12, (payload414).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr415) + + let address420 = mbt_ffi_malloc(((payload414).values).length() * 16); + for index421 = 0; index421 < ((payload414).values).length(); index421 = index421 + 1 { + let iter_elem : @retry.PredicateValue = ((payload414).values)[(index421)] + let iter_base = address420 + (index421 * 16); + + match iter_elem { + Text(payload416) => { + mbt_ffi_store8((iter_base) + 0, (0)) + + let ptr417 = mbt_ffi_str2ptr(payload416) + mbt_ffi_store32((iter_base) + 12, payload416.length()) + mbt_ffi_store32((iter_base) + 8, ptr417) + cleanup_list.push(ptr417) + + () + } + Integer(payload418) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store64((iter_base) + 8, payload418) + + () + } + Boolean(payload419) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store8((iter_base) + 8, (if payload419 { 1 } else { 0 })) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 20, ((payload414).values).length()) + mbt_ffi_store32((iter_base) + 16, address420) + cleanup_list.push(ptr415) + cleanup_list.push(address420) + + () + } + PropMatches(payload422) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + let ptr423 = mbt_ffi_str2ptr((payload422).property_name) + mbt_ffi_store32((iter_base) + 12, (payload422).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr423) + + let ptr424 = mbt_ffi_str2ptr((payload422).pattern) + mbt_ffi_store32((iter_base) + 20, (payload422).pattern.length()) + mbt_ffi_store32((iter_base) + 16, ptr424) + cleanup_list.push(ptr423) + cleanup_list.push(ptr424) + + () + } + PropStartsWith(payload425) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr426 = mbt_ffi_str2ptr((payload425).property_name) + mbt_ffi_store32((iter_base) + 12, (payload425).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr426) + + let ptr427 = mbt_ffi_str2ptr((payload425).pattern) + mbt_ffi_store32((iter_base) + 20, (payload425).pattern.length()) + mbt_ffi_store32((iter_base) + 16, ptr427) + cleanup_list.push(ptr426) + cleanup_list.push(ptr427) + + () + } + PropContains(payload428) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + let ptr429 = mbt_ffi_str2ptr((payload428).property_name) + mbt_ffi_store32((iter_base) + 12, (payload428).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr429) + + let ptr430 = mbt_ffi_str2ptr((payload428).pattern) + mbt_ffi_store32((iter_base) + 20, (payload428).pattern.length()) + mbt_ffi_store32((iter_base) + 16, ptr430) + cleanup_list.push(ptr429) + cleanup_list.push(ptr430) + + () + } + PredAnd(payload431) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload431).0) + mbt_ffi_store32((iter_base) + 12, (payload431).1) + + () + } + PredOr(payload432) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store32((iter_base) + 8, (payload432).0) + mbt_ffi_store32((iter_base) + 12, (payload432).1) + + () + } + PredNot(payload433) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store32((iter_base) + 8, payload433) + + () + } + PredTrue => { + mbt_ffi_store8((iter_base) + 0, (14)) + + () + } + PredFalse => { + mbt_ffi_store8((iter_base) + 0, (15)) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 12, (((payload375).predicate).nodes).length()) + mbt_ffi_store32((iter_base) + 8, address436) + mbt_ffi_store32((iter_base) + 16, (payload375).inner) + cleanup_list.push(address436) + + () + } + AndThen(payload438) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload438).0) + mbt_ffi_store32((iter_base) + 12, (payload438).1) + + () + } + PolicyUnion(payload439) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store32((iter_base) + 8, (payload439).0) + mbt_ffi_store32((iter_base) + 12, (payload439).1) + + () + } + PolicyIntersect(payload440) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store32((iter_base) + 8, (payload440).0) + mbt_ffi_store32((iter_base) + 12, (payload440).1) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 56, ((((payload301).policy).policy).nodes).length()) + mbt_ffi_store32((iter_base) + 52, address441) + cleanup_list.push(ptr302) + cleanup_list.push(address363) + cleanup_list.push(address441) + + () + } + RemoveRetryPolicy(payload443) => { + mbt_ffi_store8((iter_base) + 8, (40)) + mbt_ffi_store64((iter_base) + 16, ((payload443).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload443).timestamp).nanoseconds).reinterpret_as_int()) + + let ptr444 = mbt_ffi_str2ptr((payload443).name) + mbt_ffi_store32((iter_base) + 36, (payload443).name.length()) + mbt_ffi_store32((iter_base) + 32, ptr444) + cleanup_list.push(ptr444) + + () + } + CardEventQueued(payload445) => { + mbt_ffi_store8((iter_base) + 8, (41)) + mbt_ffi_store64((iter_base) + 16, ((payload445).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload445).timestamp).nanoseconds).reinterpret_as_int()) + + match (payload445).event { + Install(payload446) => { + mbt_ffi_store8((iter_base) + 32, (0)) + mbt_ffi_store64((iter_base) + 40, ((((payload446).card_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 48, ((((payload446).card_id).uuid).low_bits).reinterpret_as_int64()) + + () + } + Revoke(payload447) => { + mbt_ffi_store8((iter_base) + 32, (1)) + mbt_ffi_store64((iter_base) + 40, ((((payload447).card_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 48, ((((payload447).card_id).uuid).low_bits).reinterpret_as_int64()) + + () + } + } + + () + } + CardInstalled(payload448) => { + mbt_ffi_store8((iter_base) + 8, (42)) + mbt_ffi_store64((iter_base) + 16, ((payload448).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload448).timestamp).nanoseconds).reinterpret_as_int()) + + match ((payload448).queued_event_index) { + None => { + mbt_ffi_store8((iter_base) + 32, (0)) + + () + } + Some(payload450) => { + mbt_ffi_store8((iter_base) + 32, (1)) + mbt_ffi_store64((iter_base) + 40, (payload450).reinterpret_as_int64()) + + () + } + } + + let ptr451 = mbt_ffi_bytes2ptr((payload448).card) + + mbt_ffi_store32((iter_base) + 52, (payload448).card.length()) + mbt_ffi_store32((iter_base) + 48, ptr451) + cleanup_list.push(ptr451) + + () + } + CardInstallFailed(payload452) => { + mbt_ffi_store8((iter_base) + 8, (43)) + mbt_ffi_store64((iter_base) + 16, ((payload452).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload452).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload452).queued_event_index).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 40, ((((payload452).card_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 48, ((((payload452).card_id).uuid).low_bits).reinterpret_as_int64()) + mbt_ffi_store8((iter_base) + 56, (payload452).reason.ordinal()) + + () + } + CardRevoked(payload453) => { + mbt_ffi_store8((iter_base) + 8, (44)) + mbt_ffi_store64((iter_base) + 16, ((payload453).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload453).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload453).queued_event_index).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 40, ((((payload453).card_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 48, ((((payload453).card_id).uuid).low_bits).reinterpret_as_int64()) + + () + } + CardExpired(payload454) => { + mbt_ffi_store8((iter_base) + 8, (45)) + mbt_ffi_store64((iter_base) + 16, ((payload454).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload454).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((((payload454).card_id).uuid).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 40, ((((payload454).card_id).uuid).low_bits).reinterpret_as_int64()) + + () + } + HostStreamFrame(payload455) => { + mbt_ffi_store8((iter_base) + 8, (46)) + mbt_ffi_store64((iter_base) + 16, ((payload455).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload455).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload455).parent_start_index).reinterpret_as_int64()) + mbt_ffi_store8((iter_base) + 40, (payload455).kind.ordinal()) + + match (payload455).payload { + Inline(payload456) => { + mbt_ffi_store8((iter_base) + 48, (0)) + + let ptr457 = mbt_ffi_bytes2ptr(payload456) + + mbt_ffi_store32((iter_base) + 60, payload456.length()) + mbt_ffi_store32((iter_base) + 56, ptr457) + cleanup_list.push(ptr457) + + () + } + External(payload458) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (((payload458).payload_id).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 64, (((payload458).payload_id).low_bits).reinterpret_as_int64()) + + let ptr459 = mbt_ffi_bytes2ptr((payload458).md5_hash) + + mbt_ffi_store32((iter_base) + 76, (payload458).md5_hash.length()) + mbt_ffi_store32((iter_base) + 72, ptr459) + cleanup_list.push(ptr459) + + () + } + } + + () + } + CompletionDiscarded(payload460) => { + mbt_ffi_store8((iter_base) + 8, (47)) + mbt_ffi_store64((iter_base) + 16, ((payload460).timestamp).seconds) + mbt_ffi_store32((iter_base) + 24, (((payload460).timestamp).nanoseconds).reinterpret_as_int()) + mbt_ffi_store64((iter_base) + 32, ((payload460).start_index).reinterpret_as_int64()) + + () + } + } + + } + let return_area = mbt_ffi_malloc(12) + wasmImportEnrichOplogEntries((((environment_id).uuid).high_bits).reinterpret_as_int64(), (((environment_id).uuid).low_bits).reinterpret_as_int64(), ((((agent_id).component_id).uuid).high_bits).reinterpret_as_int64(), ((((agent_id).component_id).uuid).low_bits).reinterpret_as_int64(), ptr, (agent_id).agent_id.length(), address461, (entries).length(), (component_revision).reinterpret_as_int64(), return_area); + + let lifted3302 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let array3299 : Array[PublicOplogEntry] = []; + for index3300 = 0; index3300 < (mbt_ffi_load32((return_area) + 8)); index3300 = index3300 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index3300 * 208) + + let lifted3298 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + let array : Array[(String, String)] = []; + for index465 = 0; index465 < (mbt_ffi_load32((iter_base) + 68)); index465 = index465 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index465 * 16) + + let result463 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result464 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array.push((result463, result464)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + let lifted : @types.AgentId? = match mbt_ffi_load8_u((iter_base) + 104) { + 0 => Option::None + 1 => { + + let result466 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 128), mbt_ffi_load32((iter_base) + 132)) + + Option::Some(@types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 112)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 120)).reinterpret_as_uint64()}}, agent_id : result466}) + } + _ => panic() + } + + let array473 : Array[PluginInstallationDescription] = []; + for index474 = 0; index474 < (mbt_ffi_load32((iter_base) + 156)); index474 = index474 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 152)) + (index474 * 48) + + let result467 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + let result468 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + let array471 : Array[(String, String)] = []; + for index472 = 0; index472 < (mbt_ffi_load32((iter_base) + 40)); index472 = index472 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index472 * 16) + + let result469 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result470 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array471.push((result469, result470)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + array473.push(PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 16), plugin_name : result467, plugin_version : result468, parameters : array471}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 152)) + + let array712 : Array[LocalAgentConfigEntry] = []; + for index713 = 0; index713 < (mbt_ffi_load32((iter_base) + 164)); index713 = index713 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 160)) + (index713 * 40) + + let array476 : Array[String] = []; + for index477 = 0; index477 < (mbt_ffi_load32((iter_base) + 4)); index477 = index477 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index477 * 8) + + let result475 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array476.push(result475) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + let array674 : Array[@types.SchemaTypeNode] = []; + for index675 = 0; index675 < (mbt_ffi_load32((iter_base) + 12)); index675 = index675 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index675 * 144) + + let lifted660 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted484 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted479 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted478 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted478) + } + _ => panic() + } + + let lifted481 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted480 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted480) + } + _ => panic() + } + + let lifted483 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result482 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result482) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted479, max : lifted481, unit : lifted483}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted484) + } + 3 => { + + let lifted491 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted486 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted485 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted485) + } + _ => panic() + } + + let lifted488 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted487 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted487) + } + _ => panic() + } + + let lifted490 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result489 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result489) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted486, max : lifted488, unit : lifted490}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted491) + } + 4 => { + + let lifted498 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted493 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted492 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted492) + } + _ => panic() + } + + let lifted495 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted494 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted494) + } + _ => panic() + } + + let lifted497 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result496 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result496) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted493, max : lifted495, unit : lifted497}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted498) + } + 5 => { + + let lifted505 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted500 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted499 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted499) + } + _ => panic() + } + + let lifted502 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted501 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted501) + } + _ => panic() + } + + let lifted504 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result503 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result503) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted500, max : lifted502, unit : lifted504}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted505) + } + 6 => { + + let lifted512 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted507 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted506 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted506) + } + _ => panic() + } + + let lifted509 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted508 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted508) + } + _ => panic() + } + + let lifted511 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result510 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result510) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted507, max : lifted509, unit : lifted511}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted512) + } + 7 => { + + let lifted519 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted514 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted513 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted513) + } + _ => panic() + } + + let lifted516 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted515 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted515) + } + _ => panic() + } + + let lifted518 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result517 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result517) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted514, max : lifted516, unit : lifted518}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted519) + } + 8 => { + + let lifted526 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted521 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted520 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted520) + } + _ => panic() + } + + let lifted523 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted522 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted522) + } + _ => panic() + } + + let lifted525 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result524 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result524) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted521, max : lifted523, unit : lifted525}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted526) + } + 9 => { + + let lifted533 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted528 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted527 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted527) + } + _ => panic() + } + + let lifted530 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted529 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted529) + } + _ => panic() + } + + let lifted532 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result531 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result531) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted528, max : lifted530, unit : lifted532}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted533) + } + 10 => { + + let lifted540 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted535 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted534 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted534) + } + _ => panic() + } + + let lifted537 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted536 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted536) + } + _ => panic() + } + + let lifted539 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result538 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result538) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted535, max : lifted537, unit : lifted539}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted540) + } + 11 => { + + let lifted547 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted542 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted541 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted541) + } + _ => panic() + } + + let lifted544 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted543 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted543) + } + _ => panic() + } + + let lifted546 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result545 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result545) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted542, max : lifted544, unit : lifted546}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted547) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array562 : Array[@types.NamedFieldType] = []; + for index563 = 0; index563 < (mbt_ffi_load32((iter_base) + 12)); index563 = index563 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index563 * 68) + + let result548 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted550 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result549 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result549) + } + _ => panic() + } + + let array552 : Array[String] = []; + for index553 = 0; index553 < (mbt_ffi_load32((iter_base) + 28)); index553 = index553 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index553 * 8) + + let result551 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array552.push(result551) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array555 : Array[String] = []; + for index556 = 0; index556 < (mbt_ffi_load32((iter_base) + 36)); index556 = index556 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index556 * 8) + + let result554 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array555.push(result554) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted558 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result557 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result557) + } + _ => panic() + } + + let lifted561 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted560 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result559 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result559) + } + _ => panic() + } + + Option::Some(lifted560) + } + _ => panic() + } + + array562.push(@types.NamedFieldType::{name : result548, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted550, aliases : array552, examples : array555, deprecated : lifted558, role : lifted561}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array562) + } + 15 => { + + let array579 : Array[@types.VariantCaseType] = []; + for index580 = 0; index580 < (mbt_ffi_load32((iter_base) + 12)); index580 = index580 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index580 * 72) + + let result564 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted565 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted567 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result566 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result566) + } + _ => panic() + } + + let array569 : Array[String] = []; + for index570 = 0; index570 < (mbt_ffi_load32((iter_base) + 32)); index570 = index570 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index570 * 8) + + let result568 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array569.push(result568) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array572 : Array[String] = []; + for index573 = 0; index573 < (mbt_ffi_load32((iter_base) + 40)); index573 = index573 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index573 * 8) + + let result571 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array572.push(result571) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted575 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result574 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result574) + } + _ => panic() + } + + let lifted578 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted577 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result576 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result576) + } + _ => panic() + } + + Option::Some(lifted577) + } + _ => panic() + } + + array579.push(@types.VariantCaseType::{name : result564, payload : lifted565, metadata : @types.MetadataEnvelope::{doc : lifted567, aliases : array569, examples : array572, deprecated : lifted575, role : lifted578}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array579) + } + 16 => { + + let array582 : Array[String] = []; + for index583 = 0; index583 < (mbt_ffi_load32((iter_base) + 12)); index583 = index583 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index583 * 8) + + let result581 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array582.push(result581) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array582) + } + 17 => { + + let array585 : Array[String] = []; + for index586 = 0; index586 < (mbt_ffi_load32((iter_base) + 12)); index586 = index586 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index586 * 8) + + let result584 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array585.push(result584) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array585) + } + 18 => { + + let array587 : Array[Int] = []; + for index588 = 0; index588 < (mbt_ffi_load32((iter_base) + 12)); index588 = index588 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index588 * 4) + + array587.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array587) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted589 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted590 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted589, err : lifted590}) + } + 24 => { + + let lifted594 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array592 : Array[String] = []; + for index593 = 0; index593 < (mbt_ffi_load32((iter_base) + 16)); index593 = index593 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index593 * 8) + + let result591 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array592.push(result591) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array592) + } + _ => panic() + } + + let lifted595 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted596 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted598 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result597 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result597) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted594, min_length : lifted595, max_length : lifted596, regex : lifted598}) + } + 25 => { + + let lifted602 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array600 : Array[String] = []; + for index601 = 0; index601 < (mbt_ffi_load32((iter_base) + 16)); index601 = index601 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index601 * 8) + + let result599 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array600.push(result599) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array600) + } + _ => panic() + } + + let lifted603 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted604 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted602, min_bytes : lifted603, max_bytes : lifted604}) + } + 26 => { + + let lifted608 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array606 : Array[String] = []; + for index607 = 0; index607 < (mbt_ffi_load32((iter_base) + 20)); index607 = index607 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index607 * 8) + + let result605 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array606.push(result605) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array606) + } + _ => panic() + } + + let lifted612 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array610 : Array[String] = []; + for index611 = 0; index611 < (mbt_ffi_load32((iter_base) + 32)); index611 = index611 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index611 * 8) + + let result609 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array610.push(result609) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array610) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted608, allowed_extensions : lifted612}) + } + 27 => { + + let lifted616 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array614 : Array[String] = []; + for index615 = 0; index615 < (mbt_ffi_load32((iter_base) + 16)); index615 = index615 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index615 * 8) + + let result613 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array614.push(result613) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array614) + } + _ => panic() + } + + let lifted620 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array618 : Array[String] = []; + for index619 = 0; index619 < (mbt_ffi_load32((iter_base) + 28)); index619 = index619 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index619 * 8) + + let result617 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array618.push(result617) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array618) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted616, allowed_hosts : lifted620}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result621 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array623 : Array[String] = []; + for index624 = 0; index624 < (mbt_ffi_load32((iter_base) + 20)); index624 = index624 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index624 * 8) + + let result622 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array623.push(result622) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted626 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result625 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result625}) + } + _ => panic() + } + + let lifted628 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result627 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result627}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result621, allowed_suffixes : array623, min : lifted626, max : lifted628}) + } + 31 => { + + let array652 : Array[@types.UnionBranch] = []; + for index653 = 0; index653 < (mbt_ffi_load32((iter_base) + 12)); index653 = index653 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index653 * 92) + + let result629 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted638 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result630 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result630) + } + 1 => { + + let result631 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result631) + } + 2 => { + + let result632 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result632) + } + 3 => { + + let result633 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result633) + } + 4 => { + + let result634 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted636 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result635 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result635) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result634, literal : lifted636}) + } + 5 => { + + let result637 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result637) + } + _ => panic() + } + + let lifted640 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result639 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result639) + } + _ => panic() + } + + let array642 : Array[String] = []; + for index643 = 0; index643 < (mbt_ffi_load32((iter_base) + 52)); index643 = index643 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index643 * 8) + + let result641 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array642.push(result641) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array645 : Array[String] = []; + for index646 = 0; index646 < (mbt_ffi_load32((iter_base) + 60)); index646 = index646 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index646 * 8) + + let result644 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array645.push(result644) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted648 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result647 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result647) + } + _ => panic() + } + + let lifted651 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted650 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result649 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result649) + } + _ => panic() + } + + Option::Some(lifted650) + } + _ => panic() + } + + array652.push(@types.UnionBranch::{tag : result629, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted638, metadata : @types.MetadataEnvelope::{doc : lifted640, aliases : array642, examples : array645, deprecated : lifted648, role : lifted651}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array652}) + } + 32 => { + + let lifted655 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result654 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result654) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted655}) + } + 33 => { + + let lifted657 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result656 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result656) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted657}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted658 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted658) + } + 36 => { + + let lifted659 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted659) + } + _ => panic() + } + + let lifted662 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result661 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result661) + } + _ => panic() + } + + let array664 : Array[String] = []; + for index665 = 0; index665 < (mbt_ffi_load32((iter_base) + 104)); index665 = index665 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index665 * 8) + + let result663 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array664.push(result663) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array667 : Array[String] = []; + for index668 = 0; index668 < (mbt_ffi_load32((iter_base) + 112)); index668 = index668 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index668 * 8) + + let result666 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array667.push(result666) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted670 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result669 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result669) + } + _ => panic() + } + + let lifted673 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted672 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result671 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result671) + } + _ => panic() + } + + Option::Some(lifted672) + } + _ => panic() + } + + array674.push(@types.SchemaTypeNode::{body : lifted660, metadata : @types.MetadataEnvelope::{doc : lifted662, aliases : array664, examples : array667, deprecated : lifted670, role : lifted673}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + let array679 : Array[@types.SchemaTypeDef] = []; + for index680 = 0; index680 < (mbt_ffi_load32((iter_base) + 20)); index680 = index680 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index680 * 24) + + let result676 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted678 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result677 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result677) + } + _ => panic() + } + + array679.push(@types.SchemaTypeDef::{id : result676, name : lifted678, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let array710 : Array[@types.SchemaValueNode] = []; + for index711 = 0; index711 < (mbt_ffi_load32((iter_base) + 32)); index711 = index711 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index711 * 32) + + let lifted709 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result681 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result681) + } + 13 => { + + let array682 : Array[Int] = []; + for index683 = 0; index683 < (mbt_ffi_load32((iter_base) + 12)); index683 = index683 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index683 * 4) + + array682.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array682) + } + 14 => { + + let lifted684 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted684}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array685 : Array[Bool] = []; + for index686 = 0; index686 < (mbt_ffi_load32((iter_base) + 12)); index686 = index686 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index686 * 1) + + array685.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array685) + } + 17 => { + + let array687 : Array[Int] = []; + for index688 = 0; index688 < (mbt_ffi_load32((iter_base) + 12)); index688 = index688 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index688 * 4) + + array687.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array687) + } + 18 => { + + let array689 : Array[Int] = []; + for index690 = 0; index690 < (mbt_ffi_load32((iter_base) + 12)); index690 = index690 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index690 * 4) + + array689.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array689) + } + 19 => { + + let array691 : Array[Int] = []; + for index692 = 0; index692 < (mbt_ffi_load32((iter_base) + 12)); index692 = index692 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index692 * 4) + + array691.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array691) + } + 20 => { + + let array693 : Array[@types.MapEntry] = []; + for index694 = 0; index694 < (mbt_ffi_load32((iter_base) + 12)); index694 = index694 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index694 * 8) + + array693.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array693) + } + 21 => { + + let lifted695 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted695) + } + 22 => { + + let lifted698 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted696 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted696) + } + 1 => { + + let lifted697 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted697) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted698) + } + 23 => { + + let result699 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted701 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result700 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result700) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result699, language : lifted701}) + } + 24 => { + + let result702 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted704 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result703 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result703) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result702, mime_type : lifted704}) + } + 25 => { + + let result705 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result705) + } + 26 => { + + let result706 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result706) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result707 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result707}) + } + 30 => { + + let result708 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result708, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array710.push(lifted709) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + array712.push(LocalAgentConfigEntry::{path : array476, value : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array674, defs : array679, root : mbt_ffi_load32((iter_base) + 24)}, value : @types.SchemaValueTree::{value_nodes : array710, root : mbt_ffi_load32((iter_base) + 36)}}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 160)) + + let lifted714 : @types.Uuid? = match mbt_ffi_load8_u((iter_base) + 168) { + 0 => Option::None + 1 => { + + Option::Some(@types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 176)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 184)).reinterpret_as_uint64()}) + } + _ => panic() + } + + PublicOplogEntry::Create(CreateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}, agent_id : result}, agent_mode : AgentMode::from(mbt_ffi_load8_u((iter_base) + 48)), component_revision : (mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64(), env : array, created_by : @types.AccountId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 72)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 80)).reinterpret_as_uint64()}}, environment_id : @host.EnvironmentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 88)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 96)).reinterpret_as_uint64()}}, parent : lifted, component_size : (mbt_ffi_load64((iter_base) + 136)).reinterpret_as_uint64(), initial_total_linear_memory_size : (mbt_ffi_load64((iter_base) + 144)).reinterpret_as_uint64(), initial_active_plugins : array473, local_agent_config : array712, original_phantom_id : lifted714, instance_id : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 192)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 200)).reinterpret_as_uint64()}}) + } + 1 => { + + let lifted715 : UInt64? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + let result716 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + let lifted951 : @types.TypedSchemaValue? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + let array913 : Array[@types.SchemaTypeNode] = []; + for index914 = 0; index914 < (mbt_ffi_load32((iter_base) + 56)); index914 = index914 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 52)) + (index914 * 144) + + let lifted899 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted723 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted718 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted717 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted717) + } + _ => panic() + } + + let lifted720 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted719 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted719) + } + _ => panic() + } + + let lifted722 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result721 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result721) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted718, max : lifted720, unit : lifted722}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted723) + } + 3 => { + + let lifted730 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted725 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted724 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted724) + } + _ => panic() + } + + let lifted727 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted726 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted726) + } + _ => panic() + } + + let lifted729 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result728 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result728) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted725, max : lifted727, unit : lifted729}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted730) + } + 4 => { + + let lifted737 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted732 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted731 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted731) + } + _ => panic() + } + + let lifted734 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted733 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted733) + } + _ => panic() + } + + let lifted736 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result735 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result735) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted732, max : lifted734, unit : lifted736}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted737) + } + 5 => { + + let lifted744 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted739 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted738 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted738) + } + _ => panic() + } + + let lifted741 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted740 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted740) + } + _ => panic() + } + + let lifted743 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result742 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result742) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted739, max : lifted741, unit : lifted743}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted744) + } + 6 => { + + let lifted751 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted746 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted745 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted745) + } + _ => panic() + } + + let lifted748 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted747 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted747) + } + _ => panic() + } + + let lifted750 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result749 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result749) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted746, max : lifted748, unit : lifted750}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted751) + } + 7 => { + + let lifted758 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted753 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted752 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted752) + } + _ => panic() + } + + let lifted755 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted754 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted754) + } + _ => panic() + } + + let lifted757 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result756 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result756) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted753, max : lifted755, unit : lifted757}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted758) + } + 8 => { + + let lifted765 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted760 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted759 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted759) + } + _ => panic() + } + + let lifted762 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted761 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted761) + } + _ => panic() + } + + let lifted764 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result763 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result763) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted760, max : lifted762, unit : lifted764}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted765) + } + 9 => { + + let lifted772 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted767 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted766 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted766) + } + _ => panic() + } + + let lifted769 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted768 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted768) + } + _ => panic() + } + + let lifted771 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result770 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result770) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted767, max : lifted769, unit : lifted771}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted772) + } + 10 => { + + let lifted779 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted774 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted773 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted773) + } + _ => panic() + } + + let lifted776 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted775 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted775) + } + _ => panic() + } + + let lifted778 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result777 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result777) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted774, max : lifted776, unit : lifted778}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted779) + } + 11 => { + + let lifted786 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted781 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted780 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted780) + } + _ => panic() + } + + let lifted783 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted782 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted782) + } + _ => panic() + } + + let lifted785 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result784 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result784) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted781, max : lifted783, unit : lifted785}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted786) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array801 : Array[@types.NamedFieldType] = []; + for index802 = 0; index802 < (mbt_ffi_load32((iter_base) + 12)); index802 = index802 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index802 * 68) + + let result787 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted789 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result788 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result788) + } + _ => panic() + } + + let array791 : Array[String] = []; + for index792 = 0; index792 < (mbt_ffi_load32((iter_base) + 28)); index792 = index792 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index792 * 8) + + let result790 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array791.push(result790) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array794 : Array[String] = []; + for index795 = 0; index795 < (mbt_ffi_load32((iter_base) + 36)); index795 = index795 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index795 * 8) + + let result793 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array794.push(result793) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted797 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result796 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result796) + } + _ => panic() + } + + let lifted800 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted799 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result798 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result798) + } + _ => panic() + } + + Option::Some(lifted799) + } + _ => panic() + } + + array801.push(@types.NamedFieldType::{name : result787, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted789, aliases : array791, examples : array794, deprecated : lifted797, role : lifted800}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array801) + } + 15 => { + + let array818 : Array[@types.VariantCaseType] = []; + for index819 = 0; index819 < (mbt_ffi_load32((iter_base) + 12)); index819 = index819 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index819 * 72) + + let result803 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted804 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted806 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result805 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result805) + } + _ => panic() + } + + let array808 : Array[String] = []; + for index809 = 0; index809 < (mbt_ffi_load32((iter_base) + 32)); index809 = index809 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index809 * 8) + + let result807 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array808.push(result807) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array811 : Array[String] = []; + for index812 = 0; index812 < (mbt_ffi_load32((iter_base) + 40)); index812 = index812 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index812 * 8) + + let result810 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array811.push(result810) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted814 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result813 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result813) + } + _ => panic() + } + + let lifted817 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted816 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result815 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result815) + } + _ => panic() + } + + Option::Some(lifted816) + } + _ => panic() + } + + array818.push(@types.VariantCaseType::{name : result803, payload : lifted804, metadata : @types.MetadataEnvelope::{doc : lifted806, aliases : array808, examples : array811, deprecated : lifted814, role : lifted817}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array818) + } + 16 => { + + let array821 : Array[String] = []; + for index822 = 0; index822 < (mbt_ffi_load32((iter_base) + 12)); index822 = index822 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index822 * 8) + + let result820 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array821.push(result820) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array821) + } + 17 => { + + let array824 : Array[String] = []; + for index825 = 0; index825 < (mbt_ffi_load32((iter_base) + 12)); index825 = index825 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index825 * 8) + + let result823 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array824.push(result823) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array824) + } + 18 => { + + let array826 : Array[Int] = []; + for index827 = 0; index827 < (mbt_ffi_load32((iter_base) + 12)); index827 = index827 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index827 * 4) + + array826.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array826) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted828 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted829 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted828, err : lifted829}) + } + 24 => { + + let lifted833 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array831 : Array[String] = []; + for index832 = 0; index832 < (mbt_ffi_load32((iter_base) + 16)); index832 = index832 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index832 * 8) + + let result830 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array831.push(result830) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array831) + } + _ => panic() + } + + let lifted834 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted835 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted837 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result836 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result836) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted833, min_length : lifted834, max_length : lifted835, regex : lifted837}) + } + 25 => { + + let lifted841 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array839 : Array[String] = []; + for index840 = 0; index840 < (mbt_ffi_load32((iter_base) + 16)); index840 = index840 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index840 * 8) + + let result838 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array839.push(result838) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array839) + } + _ => panic() + } + + let lifted842 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted843 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted841, min_bytes : lifted842, max_bytes : lifted843}) + } + 26 => { + + let lifted847 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array845 : Array[String] = []; + for index846 = 0; index846 < (mbt_ffi_load32((iter_base) + 20)); index846 = index846 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index846 * 8) + + let result844 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array845.push(result844) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array845) + } + _ => panic() + } + + let lifted851 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array849 : Array[String] = []; + for index850 = 0; index850 < (mbt_ffi_load32((iter_base) + 32)); index850 = index850 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index850 * 8) + + let result848 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array849.push(result848) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array849) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted847, allowed_extensions : lifted851}) + } + 27 => { + + let lifted855 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array853 : Array[String] = []; + for index854 = 0; index854 < (mbt_ffi_load32((iter_base) + 16)); index854 = index854 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index854 * 8) + + let result852 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array853.push(result852) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array853) + } + _ => panic() + } + + let lifted859 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array857 : Array[String] = []; + for index858 = 0; index858 < (mbt_ffi_load32((iter_base) + 28)); index858 = index858 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index858 * 8) + + let result856 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array857.push(result856) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array857) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted855, allowed_hosts : lifted859}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result860 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array862 : Array[String] = []; + for index863 = 0; index863 < (mbt_ffi_load32((iter_base) + 20)); index863 = index863 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index863 * 8) + + let result861 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array862.push(result861) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted865 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result864 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result864}) + } + _ => panic() + } + + let lifted867 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result866 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result866}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result860, allowed_suffixes : array862, min : lifted865, max : lifted867}) + } + 31 => { + + let array891 : Array[@types.UnionBranch] = []; + for index892 = 0; index892 < (mbt_ffi_load32((iter_base) + 12)); index892 = index892 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index892 * 92) + + let result868 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted877 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result869 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result869) + } + 1 => { + + let result870 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result870) + } + 2 => { + + let result871 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result871) + } + 3 => { + + let result872 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result872) + } + 4 => { + + let result873 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted875 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result874 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result874) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result873, literal : lifted875}) + } + 5 => { + + let result876 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result876) + } + _ => panic() + } + + let lifted879 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result878 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result878) + } + _ => panic() + } + + let array881 : Array[String] = []; + for index882 = 0; index882 < (mbt_ffi_load32((iter_base) + 52)); index882 = index882 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index882 * 8) + + let result880 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array881.push(result880) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array884 : Array[String] = []; + for index885 = 0; index885 < (mbt_ffi_load32((iter_base) + 60)); index885 = index885 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index885 * 8) + + let result883 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array884.push(result883) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted887 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result886 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result886) + } + _ => panic() + } + + let lifted890 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted889 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result888 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result888) + } + _ => panic() + } + + Option::Some(lifted889) + } + _ => panic() + } + + array891.push(@types.UnionBranch::{tag : result868, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted877, metadata : @types.MetadataEnvelope::{doc : lifted879, aliases : array881, examples : array884, deprecated : lifted887, role : lifted890}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array891}) + } + 32 => { + + let lifted894 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result893 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result893) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted894}) + } + 33 => { + + let lifted896 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result895 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result895) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted896}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted897 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted897) + } + 36 => { + + let lifted898 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted898) + } + _ => panic() + } + + let lifted901 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result900 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result900) + } + _ => panic() + } + + let array903 : Array[String] = []; + for index904 = 0; index904 < (mbt_ffi_load32((iter_base) + 104)); index904 = index904 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index904 * 8) + + let result902 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array903.push(result902) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array906 : Array[String] = []; + for index907 = 0; index907 < (mbt_ffi_load32((iter_base) + 112)); index907 = index907 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index907 * 8) + + let result905 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array906.push(result905) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted909 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result908 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result908) + } + _ => panic() + } + + let lifted912 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted911 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result910 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result910) + } + _ => panic() + } + + Option::Some(lifted911) + } + _ => panic() + } + + array913.push(@types.SchemaTypeNode::{body : lifted899, metadata : @types.MetadataEnvelope::{doc : lifted901, aliases : array903, examples : array906, deprecated : lifted909, role : lifted912}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + let array918 : Array[@types.SchemaTypeDef] = []; + for index919 = 0; index919 < (mbt_ffi_load32((iter_base) + 64)); index919 = index919 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index919 * 24) + + let result915 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted917 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result916 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result916) + } + _ => panic() + } + + array918.push(@types.SchemaTypeDef::{id : result915, name : lifted917, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + let array949 : Array[@types.SchemaValueNode] = []; + for index950 = 0; index950 < (mbt_ffi_load32((iter_base) + 76)); index950 = index950 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 72)) + (index950 * 32) + + let lifted948 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result920 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result920) + } + 13 => { + + let array921 : Array[Int] = []; + for index922 = 0; index922 < (mbt_ffi_load32((iter_base) + 12)); index922 = index922 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index922 * 4) + + array921.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array921) + } + 14 => { + + let lifted923 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted923}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array924 : Array[Bool] = []; + for index925 = 0; index925 < (mbt_ffi_load32((iter_base) + 12)); index925 = index925 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index925 * 1) + + array924.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array924) + } + 17 => { + + let array926 : Array[Int] = []; + for index927 = 0; index927 < (mbt_ffi_load32((iter_base) + 12)); index927 = index927 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index927 * 4) + + array926.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array926) + } + 18 => { + + let array928 : Array[Int] = []; + for index929 = 0; index929 < (mbt_ffi_load32((iter_base) + 12)); index929 = index929 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index929 * 4) + + array928.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array928) + } + 19 => { + + let array930 : Array[Int] = []; + for index931 = 0; index931 < (mbt_ffi_load32((iter_base) + 12)); index931 = index931 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index931 * 4) + + array930.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array930) + } + 20 => { + + let array932 : Array[@types.MapEntry] = []; + for index933 = 0; index933 < (mbt_ffi_load32((iter_base) + 12)); index933 = index933 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index933 * 8) + + array932.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array932) + } + 21 => { + + let lifted934 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted934) + } + 22 => { + + let lifted937 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted935 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted935) + } + 1 => { + + let lifted936 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted936) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted937) + } + 23 => { + + let result938 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted940 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result939 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result939) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result938, language : lifted940}) + } + 24 => { + + let result941 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted943 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result942 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result942) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result941, mime_type : lifted943}) + } + 25 => { + + let result944 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result944) + } + 26 => { + + let result945 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result945) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result946 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result946}) + } + 30 => { + + let result947 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result947, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array949.push(lifted948) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 72)) + + Option::Some(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array913, defs : array918, root : mbt_ffi_load32((iter_base) + 68)}, value : @types.SchemaValueTree::{value_nodes : array949, root : mbt_ffi_load32((iter_base) + 80)}}) + } + _ => panic() + } + + let lifted954 = match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => { + + WrappedFunctionType::ReadLocal + } + 1 => { + + WrappedFunctionType::WriteLocal + } + 2 => { + + WrappedFunctionType::ReadRemote + } + 3 => { + + WrappedFunctionType::WriteRemote + } + 4 => { + + let lifted952 : UInt64? = match mbt_ffi_load8_u((iter_base) + 96) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 104)).reinterpret_as_uint64()) + } + _ => panic() + } + + WrappedFunctionType::WriteRemoteBatched(lifted952) + } + 5 => { + + let lifted953 : UInt64? = match mbt_ffi_load8_u((iter_base) + 96) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 104)).reinterpret_as_uint64()) + } + _ => panic() + } + + WrappedFunctionType::WriteRemoteTransaction(lifted953) + } + _ => panic() + } + + PublicOplogEntry::Start(StartParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, parent_start_index : lifted715, function_name : result716, request : lifted951, durable_function_type : lifted954}) + } + 2 => { + + let lifted1189 : @types.TypedSchemaValue? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let array1151 : Array[@types.SchemaTypeNode] = []; + for index1152 = 0; index1152 < (mbt_ffi_load32((iter_base) + 40)); index1152 = index1152 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1152 * 144) + + let lifted1137 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted961 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted956 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted955 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted955) + } + _ => panic() + } + + let lifted958 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted957 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted957) + } + _ => panic() + } + + let lifted960 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result959 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result959) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted956, max : lifted958, unit : lifted960}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted961) + } + 3 => { + + let lifted968 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted963 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted962 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted962) + } + _ => panic() + } + + let lifted965 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted964 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted964) + } + _ => panic() + } + + let lifted967 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result966 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result966) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted963, max : lifted965, unit : lifted967}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted968) + } + 4 => { + + let lifted975 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted970 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted969 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted969) + } + _ => panic() + } + + let lifted972 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted971 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted971) + } + _ => panic() + } + + let lifted974 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result973 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result973) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted970, max : lifted972, unit : lifted974}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted975) + } + 5 => { + + let lifted982 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted977 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted976 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted976) + } + _ => panic() + } + + let lifted979 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted978 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted978) + } + _ => panic() + } + + let lifted981 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result980 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result980) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted977, max : lifted979, unit : lifted981}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted982) + } + 6 => { + + let lifted989 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted984 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted983 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted983) + } + _ => panic() + } + + let lifted986 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted985 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted985) + } + _ => panic() + } + + let lifted988 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result987 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result987) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted984, max : lifted986, unit : lifted988}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted989) + } + 7 => { + + let lifted996 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted991 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted990 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted990) + } + _ => panic() + } + + let lifted993 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted992 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted992) + } + _ => panic() + } + + let lifted995 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result994 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result994) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted991, max : lifted993, unit : lifted995}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted996) + } + 8 => { + + let lifted1003 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted998 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted997 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted997) + } + _ => panic() + } + + let lifted1000 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted999 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted999) + } + _ => panic() + } + + let lifted1002 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1001 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1001) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted998, max : lifted1000, unit : lifted1002}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1003) + } + 9 => { + + let lifted1010 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1005 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1004 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1004) + } + _ => panic() + } + + let lifted1007 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1006 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1006) + } + _ => panic() + } + + let lifted1009 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1008 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1008) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1005, max : lifted1007, unit : lifted1009}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1010) + } + 10 => { + + let lifted1017 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1012 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1011 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1011) + } + _ => panic() + } + + let lifted1014 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1013 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1013) + } + _ => panic() + } + + let lifted1016 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1015 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1015) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1012, max : lifted1014, unit : lifted1016}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted1017) + } + 11 => { + + let lifted1024 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1019 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1018 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1018) + } + _ => panic() + } + + let lifted1021 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1020 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1020) + } + _ => panic() + } + + let lifted1023 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1022 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1022) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1019, max : lifted1021, unit : lifted1023}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted1024) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array1039 : Array[@types.NamedFieldType] = []; + for index1040 = 0; index1040 < (mbt_ffi_load32((iter_base) + 12)); index1040 = index1040 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1040 * 68) + + let result1025 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1027 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1026 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1026) + } + _ => panic() + } + + let array1029 : Array[String] = []; + for index1030 = 0; index1030 < (mbt_ffi_load32((iter_base) + 28)); index1030 = index1030 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1030 * 8) + + let result1028 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1029.push(result1028) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array1032 : Array[String] = []; + for index1033 = 0; index1033 < (mbt_ffi_load32((iter_base) + 36)); index1033 = index1033 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1033 * 8) + + let result1031 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1032.push(result1031) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted1035 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result1034 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result1034) + } + _ => panic() + } + + let lifted1038 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted1037 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1036 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result1036) + } + _ => panic() + } + + Option::Some(lifted1037) + } + _ => panic() + } + + array1039.push(@types.NamedFieldType::{name : result1025, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted1027, aliases : array1029, examples : array1032, deprecated : lifted1035, role : lifted1038}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array1039) + } + 15 => { + + let array1056 : Array[@types.VariantCaseType] = []; + for index1057 = 0; index1057 < (mbt_ffi_load32((iter_base) + 12)); index1057 = index1057 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1057 * 72) + + let result1041 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1042 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1044 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1043 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1043) + } + _ => panic() + } + + let array1046 : Array[String] = []; + for index1047 = 0; index1047 < (mbt_ffi_load32((iter_base) + 32)); index1047 = index1047 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1047 * 8) + + let result1045 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1046.push(result1045) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array1049 : Array[String] = []; + for index1050 = 0; index1050 < (mbt_ffi_load32((iter_base) + 40)); index1050 = index1050 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1050 * 8) + + let result1048 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1049.push(result1048) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted1052 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result1051 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result1051) + } + _ => panic() + } + + let lifted1055 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted1054 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1053 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result1053) + } + _ => panic() + } + + Option::Some(lifted1054) + } + _ => panic() + } + + array1056.push(@types.VariantCaseType::{name : result1041, payload : lifted1042, metadata : @types.MetadataEnvelope::{doc : lifted1044, aliases : array1046, examples : array1049, deprecated : lifted1052, role : lifted1055}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array1056) + } + 16 => { + + let array1059 : Array[String] = []; + for index1060 = 0; index1060 < (mbt_ffi_load32((iter_base) + 12)); index1060 = index1060 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1060 * 8) + + let result1058 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1059.push(result1058) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array1059) + } + 17 => { + + let array1062 : Array[String] = []; + for index1063 = 0; index1063 < (mbt_ffi_load32((iter_base) + 12)); index1063 = index1063 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1063 * 8) + + let result1061 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1062.push(result1061) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array1062) + } + 18 => { + + let array1064 : Array[Int] = []; + for index1065 = 0; index1065 < (mbt_ffi_load32((iter_base) + 12)); index1065 = index1065 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1065 * 4) + + array1064.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array1064) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted1066 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1067 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted1066, err : lifted1067}) + } + 24 => { + + let lifted1071 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1069 : Array[String] = []; + for index1070 = 0; index1070 < (mbt_ffi_load32((iter_base) + 16)); index1070 = index1070 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1070 * 8) + + let result1068 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1069.push(result1068) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1069) + } + _ => panic() + } + + let lifted1072 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1073 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1075 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1074 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1074) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted1071, min_length : lifted1072, max_length : lifted1073, regex : lifted1075}) + } + 25 => { + + let lifted1079 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1077 : Array[String] = []; + for index1078 = 0; index1078 < (mbt_ffi_load32((iter_base) + 16)); index1078 = index1078 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1078 * 8) + + let result1076 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1077.push(result1076) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1077) + } + _ => panic() + } + + let lifted1080 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1081 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted1079, min_bytes : lifted1080, max_bytes : lifted1081}) + } + 26 => { + + let lifted1085 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array1083 : Array[String] = []; + for index1084 = 0; index1084 < (mbt_ffi_load32((iter_base) + 20)); index1084 = index1084 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1084 * 8) + + let result1082 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1083.push(result1082) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array1083) + } + _ => panic() + } + + let lifted1089 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array1087 : Array[String] = []; + for index1088 = 0; index1088 < (mbt_ffi_load32((iter_base) + 32)); index1088 = index1088 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1088 * 8) + + let result1086 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1087.push(result1086) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array1087) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted1085, allowed_extensions : lifted1089}) + } + 27 => { + + let lifted1093 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1091 : Array[String] = []; + for index1092 = 0; index1092 < (mbt_ffi_load32((iter_base) + 16)); index1092 = index1092 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1092 * 8) + + let result1090 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1091.push(result1090) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1091) + } + _ => panic() + } + + let lifted1097 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array1095 : Array[String] = []; + for index1096 = 0; index1096 < (mbt_ffi_load32((iter_base) + 28)); index1096 = index1096 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1096 * 8) + + let result1094 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1095.push(result1094) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array1095) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted1093, allowed_hosts : lifted1097}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result1098 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array1100 : Array[String] = []; + for index1101 = 0; index1101 < (mbt_ffi_load32((iter_base) + 20)); index1101 = index1101 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1101 * 8) + + let result1099 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1100.push(result1099) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted1103 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1102 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result1102}) + } + _ => panic() + } + + let lifted1105 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result1104 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result1104}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result1098, allowed_suffixes : array1100, min : lifted1103, max : lifted1105}) + } + 31 => { + + let array1129 : Array[@types.UnionBranch] = []; + for index1130 = 0; index1130 < (mbt_ffi_load32((iter_base) + 12)); index1130 = index1130 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1130 * 92) + + let result1106 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1115 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result1107 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result1107) + } + 1 => { + + let result1108 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result1108) + } + 2 => { + + let result1109 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result1109) + } + 3 => { + + let result1110 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result1110) + } + 4 => { + + let result1111 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted1113 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1112 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result1112) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result1111, literal : lifted1113}) + } + 5 => { + + let result1114 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result1114) + } + _ => panic() + } + + let lifted1117 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1116 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1116) + } + _ => panic() + } + + let array1119 : Array[String] = []; + for index1120 = 0; index1120 < (mbt_ffi_load32((iter_base) + 52)); index1120 = index1120 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1120 * 8) + + let result1118 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1119.push(result1118) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1122 : Array[String] = []; + for index1123 = 0; index1123 < (mbt_ffi_load32((iter_base) + 60)); index1123 = index1123 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1123 * 8) + + let result1121 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1122.push(result1121) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted1125 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1124 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1124) + } + _ => panic() + } + + let lifted1128 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted1127 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1126 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result1126) + } + _ => panic() + } + + Option::Some(lifted1127) + } + _ => panic() + } + + array1129.push(@types.UnionBranch::{tag : result1106, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted1115, metadata : @types.MetadataEnvelope::{doc : lifted1117, aliases : array1119, examples : array1122, deprecated : lifted1125, role : lifted1128}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array1129}) + } + 32 => { + + let lifted1132 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1131 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1131) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted1132}) + } + 33 => { + + let lifted1134 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1133 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1133) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted1134}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted1135 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted1135) + } + 36 => { + + let lifted1136 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted1136) + } + _ => panic() + } + + let lifted1139 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result1138 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result1138) + } + _ => panic() + } + + let array1141 : Array[String] = []; + for index1142 = 0; index1142 < (mbt_ffi_load32((iter_base) + 104)); index1142 = index1142 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index1142 * 8) + + let result1140 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1141.push(result1140) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array1144 : Array[String] = []; + for index1145 = 0; index1145 < (mbt_ffi_load32((iter_base) + 112)); index1145 = index1145 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index1145 * 8) + + let result1143 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1144.push(result1143) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted1147 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result1146 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result1146) + } + _ => panic() + } + + let lifted1150 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted1149 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1148 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result1148) + } + _ => panic() + } + + Option::Some(lifted1149) + } + _ => panic() + } + + array1151.push(@types.SchemaTypeNode::{body : lifted1137, metadata : @types.MetadataEnvelope::{doc : lifted1139, aliases : array1141, examples : array1144, deprecated : lifted1147, role : lifted1150}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let array1156 : Array[@types.SchemaTypeDef] = []; + for index1157 = 0; index1157 < (mbt_ffi_load32((iter_base) + 48)); index1157 = index1157 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index1157 * 24) + + let result1153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1155 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1154 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1154) + } + _ => panic() + } + + array1156.push(@types.SchemaTypeDef::{id : result1153, name : lifted1155, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + let array1187 : Array[@types.SchemaValueNode] = []; + for index1188 = 0; index1188 < (mbt_ffi_load32((iter_base) + 60)); index1188 = index1188 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1188 * 32) + + let lifted1186 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result1158 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result1158) + } + 13 => { + + let array1159 : Array[Int] = []; + for index1160 = 0; index1160 < (mbt_ffi_load32((iter_base) + 12)); index1160 = index1160 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1160 * 4) + + array1159.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array1159) + } + 14 => { + + let lifted1161 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted1161}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array1162 : Array[Bool] = []; + for index1163 = 0; index1163 < (mbt_ffi_load32((iter_base) + 12)); index1163 = index1163 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1163 * 1) + + array1162.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array1162) + } + 17 => { + + let array1164 : Array[Int] = []; + for index1165 = 0; index1165 < (mbt_ffi_load32((iter_base) + 12)); index1165 = index1165 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1165 * 4) + + array1164.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array1164) + } + 18 => { + + let array1166 : Array[Int] = []; + for index1167 = 0; index1167 < (mbt_ffi_load32((iter_base) + 12)); index1167 = index1167 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1167 * 4) + + array1166.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array1166) + } + 19 => { + + let array1168 : Array[Int] = []; + for index1169 = 0; index1169 < (mbt_ffi_load32((iter_base) + 12)); index1169 = index1169 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1169 * 4) + + array1168.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array1168) + } + 20 => { + + let array1170 : Array[@types.MapEntry] = []; + for index1171 = 0; index1171 < (mbt_ffi_load32((iter_base) + 12)); index1171 = index1171 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1171 * 8) + + array1170.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array1170) + } + 21 => { + + let lifted1172 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted1172) + } + 22 => { + + let lifted1175 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted1173 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted1173) + } + 1 => { + + let lifted1174 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted1174) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted1175) + } + 23 => { + + let result1176 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1178 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1177 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1177) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result1176, language : lifted1178}) + } + 24 => { + + let result1179 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1181 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1180 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1180) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result1179, mime_type : lifted1181}) + } + 25 => { + + let result1182 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result1182) + } + 26 => { + + let result1183 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result1183) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result1184 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result1184}) + } + 30 => { + + let result1185 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result1185, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array1187.push(lifted1186) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + Option::Some(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array1151, defs : array1156, root : mbt_ffi_load32((iter_base) + 52)}, value : @types.SchemaValueTree::{value_nodes : array1187, root : mbt_ffi_load32((iter_base) + 64)}}) + } + _ => panic() + } + + PublicOplogEntry::End(EndParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, start_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), response : lifted1189, forced_commit : (mbt_ffi_load8_u((iter_base) + 68) != 0)}) + } + 3 => { + + let lifted1424 : @types.TypedSchemaValue? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let array1386 : Array[@types.SchemaTypeNode] = []; + for index1387 = 0; index1387 < (mbt_ffi_load32((iter_base) + 40)); index1387 = index1387 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1387 * 144) + + let lifted1372 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted1196 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1191 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1190 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1190) + } + _ => panic() + } + + let lifted1193 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1192 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1192) + } + _ => panic() + } + + let lifted1195 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1194 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1194) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1191, max : lifted1193, unit : lifted1195}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted1196) + } + 3 => { + + let lifted1203 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1198 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1197 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1197) + } + _ => panic() + } + + let lifted1200 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1199 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1199) + } + _ => panic() + } + + let lifted1202 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1201 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1201) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1198, max : lifted1200, unit : lifted1202}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted1203) + } + 4 => { + + let lifted1210 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1205 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1204 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1204) + } + _ => panic() + } + + let lifted1207 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1206 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1206) + } + _ => panic() + } + + let lifted1209 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1208 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1208) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1205, max : lifted1207, unit : lifted1209}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted1210) + } + 5 => { + + let lifted1217 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1212 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1211 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1211) + } + _ => panic() + } + + let lifted1214 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1213 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1213) + } + _ => panic() + } + + let lifted1216 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1215 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1215) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1212, max : lifted1214, unit : lifted1216}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted1217) + } + 6 => { + + let lifted1224 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1219 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1218 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1218) + } + _ => panic() + } + + let lifted1221 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1220 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1220) + } + _ => panic() + } + + let lifted1223 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1222 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1222) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1219, max : lifted1221, unit : lifted1223}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted1224) + } + 7 => { + + let lifted1231 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1226 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1225 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1225) + } + _ => panic() + } + + let lifted1228 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1227 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1227) + } + _ => panic() + } + + let lifted1230 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1229 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1229) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1226, max : lifted1228, unit : lifted1230}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1231) + } + 8 => { + + let lifted1238 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1233 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1232 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1232) + } + _ => panic() + } + + let lifted1235 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1234 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1234) + } + _ => panic() + } + + let lifted1237 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1236 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1236) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1233, max : lifted1235, unit : lifted1237}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1238) + } + 9 => { + + let lifted1245 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1240 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1239 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1239) + } + _ => panic() + } + + let lifted1242 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1241 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1241) + } + _ => panic() + } + + let lifted1244 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1243 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1243) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1240, max : lifted1242, unit : lifted1244}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1245) + } + 10 => { + + let lifted1252 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1247 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1246 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1246) + } + _ => panic() + } + + let lifted1249 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1248 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1248) + } + _ => panic() + } + + let lifted1251 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1250 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1250) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1247, max : lifted1249, unit : lifted1251}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted1252) + } + 11 => { + + let lifted1259 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1254 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1253 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1253) + } + _ => panic() + } + + let lifted1256 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1255 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1255) + } + _ => panic() + } + + let lifted1258 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1257 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1257) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1254, max : lifted1256, unit : lifted1258}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted1259) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array1274 : Array[@types.NamedFieldType] = []; + for index1275 = 0; index1275 < (mbt_ffi_load32((iter_base) + 12)); index1275 = index1275 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1275 * 68) + + let result1260 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1262 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1261 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1261) + } + _ => panic() + } + + let array1264 : Array[String] = []; + for index1265 = 0; index1265 < (mbt_ffi_load32((iter_base) + 28)); index1265 = index1265 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1265 * 8) + + let result1263 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1264.push(result1263) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array1267 : Array[String] = []; + for index1268 = 0; index1268 < (mbt_ffi_load32((iter_base) + 36)); index1268 = index1268 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1268 * 8) + + let result1266 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1267.push(result1266) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted1270 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result1269 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result1269) + } + _ => panic() + } + + let lifted1273 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted1272 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1271 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result1271) + } + _ => panic() + } + + Option::Some(lifted1272) + } + _ => panic() + } + + array1274.push(@types.NamedFieldType::{name : result1260, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted1262, aliases : array1264, examples : array1267, deprecated : lifted1270, role : lifted1273}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array1274) + } + 15 => { + + let array1291 : Array[@types.VariantCaseType] = []; + for index1292 = 0; index1292 < (mbt_ffi_load32((iter_base) + 12)); index1292 = index1292 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1292 * 72) + + let result1276 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1277 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1279 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1278 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1278) + } + _ => panic() + } + + let array1281 : Array[String] = []; + for index1282 = 0; index1282 < (mbt_ffi_load32((iter_base) + 32)); index1282 = index1282 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1282 * 8) + + let result1280 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1281.push(result1280) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array1284 : Array[String] = []; + for index1285 = 0; index1285 < (mbt_ffi_load32((iter_base) + 40)); index1285 = index1285 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1285 * 8) + + let result1283 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1284.push(result1283) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted1287 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result1286 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result1286) + } + _ => panic() + } + + let lifted1290 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted1289 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1288 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result1288) + } + _ => panic() + } + + Option::Some(lifted1289) + } + _ => panic() + } + + array1291.push(@types.VariantCaseType::{name : result1276, payload : lifted1277, metadata : @types.MetadataEnvelope::{doc : lifted1279, aliases : array1281, examples : array1284, deprecated : lifted1287, role : lifted1290}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array1291) + } + 16 => { + + let array1294 : Array[String] = []; + for index1295 = 0; index1295 < (mbt_ffi_load32((iter_base) + 12)); index1295 = index1295 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1295 * 8) + + let result1293 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1294.push(result1293) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array1294) + } + 17 => { + + let array1297 : Array[String] = []; + for index1298 = 0; index1298 < (mbt_ffi_load32((iter_base) + 12)); index1298 = index1298 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1298 * 8) + + let result1296 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1297.push(result1296) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array1297) + } + 18 => { + + let array1299 : Array[Int] = []; + for index1300 = 0; index1300 < (mbt_ffi_load32((iter_base) + 12)); index1300 = index1300 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1300 * 4) + + array1299.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array1299) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted1301 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1302 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted1301, err : lifted1302}) + } + 24 => { + + let lifted1306 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1304 : Array[String] = []; + for index1305 = 0; index1305 < (mbt_ffi_load32((iter_base) + 16)); index1305 = index1305 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1305 * 8) + + let result1303 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1304.push(result1303) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1304) + } + _ => panic() + } + + let lifted1307 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1308 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1310 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1309 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1309) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted1306, min_length : lifted1307, max_length : lifted1308, regex : lifted1310}) + } + 25 => { + + let lifted1314 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1312 : Array[String] = []; + for index1313 = 0; index1313 < (mbt_ffi_load32((iter_base) + 16)); index1313 = index1313 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1313 * 8) + + let result1311 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1312.push(result1311) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1312) + } + _ => panic() + } + + let lifted1315 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1316 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted1314, min_bytes : lifted1315, max_bytes : lifted1316}) + } + 26 => { + + let lifted1320 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array1318 : Array[String] = []; + for index1319 = 0; index1319 < (mbt_ffi_load32((iter_base) + 20)); index1319 = index1319 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1319 * 8) + + let result1317 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1318.push(result1317) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array1318) + } + _ => panic() + } + + let lifted1324 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array1322 : Array[String] = []; + for index1323 = 0; index1323 < (mbt_ffi_load32((iter_base) + 32)); index1323 = index1323 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1323 * 8) + + let result1321 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1322.push(result1321) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array1322) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted1320, allowed_extensions : lifted1324}) + } + 27 => { + + let lifted1328 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1326 : Array[String] = []; + for index1327 = 0; index1327 < (mbt_ffi_load32((iter_base) + 16)); index1327 = index1327 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1327 * 8) + + let result1325 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1326.push(result1325) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1326) + } + _ => panic() + } + + let lifted1332 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array1330 : Array[String] = []; + for index1331 = 0; index1331 < (mbt_ffi_load32((iter_base) + 28)); index1331 = index1331 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1331 * 8) + + let result1329 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1330.push(result1329) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array1330) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted1328, allowed_hosts : lifted1332}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result1333 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array1335 : Array[String] = []; + for index1336 = 0; index1336 < (mbt_ffi_load32((iter_base) + 20)); index1336 = index1336 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1336 * 8) + + let result1334 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1335.push(result1334) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted1338 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1337 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result1337}) + } + _ => panic() + } + + let lifted1340 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result1339 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result1339}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result1333, allowed_suffixes : array1335, min : lifted1338, max : lifted1340}) + } + 31 => { + + let array1364 : Array[@types.UnionBranch] = []; + for index1365 = 0; index1365 < (mbt_ffi_load32((iter_base) + 12)); index1365 = index1365 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1365 * 92) + + let result1341 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1350 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result1342 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result1342) + } + 1 => { + + let result1343 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result1343) + } + 2 => { + + let result1344 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result1344) + } + 3 => { + + let result1345 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result1345) + } + 4 => { + + let result1346 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted1348 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1347 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result1347) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result1346, literal : lifted1348}) + } + 5 => { + + let result1349 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result1349) + } + _ => panic() + } + + let lifted1352 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1351 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1351) + } + _ => panic() + } + + let array1354 : Array[String] = []; + for index1355 = 0; index1355 < (mbt_ffi_load32((iter_base) + 52)); index1355 = index1355 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1355 * 8) + + let result1353 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1354.push(result1353) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1357 : Array[String] = []; + for index1358 = 0; index1358 < (mbt_ffi_load32((iter_base) + 60)); index1358 = index1358 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1358 * 8) + + let result1356 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1357.push(result1356) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted1360 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1359 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1359) + } + _ => panic() + } + + let lifted1363 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted1362 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1361 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result1361) + } + _ => panic() + } + + Option::Some(lifted1362) + } + _ => panic() + } + + array1364.push(@types.UnionBranch::{tag : result1341, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted1350, metadata : @types.MetadataEnvelope::{doc : lifted1352, aliases : array1354, examples : array1357, deprecated : lifted1360, role : lifted1363}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array1364}) + } + 32 => { + + let lifted1367 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1366 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1366) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted1367}) + } + 33 => { + + let lifted1369 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1368 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1368) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted1369}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted1370 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted1370) + } + 36 => { + + let lifted1371 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted1371) + } + _ => panic() + } + + let lifted1374 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result1373 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result1373) + } + _ => panic() + } + + let array1376 : Array[String] = []; + for index1377 = 0; index1377 < (mbt_ffi_load32((iter_base) + 104)); index1377 = index1377 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index1377 * 8) + + let result1375 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1376.push(result1375) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array1379 : Array[String] = []; + for index1380 = 0; index1380 < (mbt_ffi_load32((iter_base) + 112)); index1380 = index1380 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index1380 * 8) + + let result1378 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1379.push(result1378) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted1382 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result1381 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result1381) + } + _ => panic() + } + + let lifted1385 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted1384 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1383 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result1383) + } + _ => panic() + } + + Option::Some(lifted1384) + } + _ => panic() + } + + array1386.push(@types.SchemaTypeNode::{body : lifted1372, metadata : @types.MetadataEnvelope::{doc : lifted1374, aliases : array1376, examples : array1379, deprecated : lifted1382, role : lifted1385}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let array1391 : Array[@types.SchemaTypeDef] = []; + for index1392 = 0; index1392 < (mbt_ffi_load32((iter_base) + 48)); index1392 = index1392 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index1392 * 24) + + let result1388 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1390 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1389 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1389) + } + _ => panic() + } + + array1391.push(@types.SchemaTypeDef::{id : result1388, name : lifted1390, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + let array1422 : Array[@types.SchemaValueNode] = []; + for index1423 = 0; index1423 < (mbt_ffi_load32((iter_base) + 60)); index1423 = index1423 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1423 * 32) + + let lifted1421 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result1393 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result1393) + } + 13 => { + + let array1394 : Array[Int] = []; + for index1395 = 0; index1395 < (mbt_ffi_load32((iter_base) + 12)); index1395 = index1395 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1395 * 4) + + array1394.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array1394) + } + 14 => { + + let lifted1396 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted1396}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array1397 : Array[Bool] = []; + for index1398 = 0; index1398 < (mbt_ffi_load32((iter_base) + 12)); index1398 = index1398 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1398 * 1) + + array1397.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array1397) + } + 17 => { + + let array1399 : Array[Int] = []; + for index1400 = 0; index1400 < (mbt_ffi_load32((iter_base) + 12)); index1400 = index1400 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1400 * 4) + + array1399.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array1399) + } + 18 => { + + let array1401 : Array[Int] = []; + for index1402 = 0; index1402 < (mbt_ffi_load32((iter_base) + 12)); index1402 = index1402 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1402 * 4) + + array1401.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array1401) + } + 19 => { + + let array1403 : Array[Int] = []; + for index1404 = 0; index1404 < (mbt_ffi_load32((iter_base) + 12)); index1404 = index1404 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1404 * 4) + + array1403.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array1403) + } + 20 => { + + let array1405 : Array[@types.MapEntry] = []; + for index1406 = 0; index1406 < (mbt_ffi_load32((iter_base) + 12)); index1406 = index1406 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1406 * 8) + + array1405.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array1405) + } + 21 => { + + let lifted1407 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted1407) + } + 22 => { + + let lifted1410 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted1408 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted1408) + } + 1 => { + + let lifted1409 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted1409) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted1410) + } + 23 => { + + let result1411 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1413 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1412 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1412) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result1411, language : lifted1413}) + } + 24 => { + + let result1414 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1416 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1415 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1415) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result1414, mime_type : lifted1416}) + } + 25 => { + + let result1417 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result1417) + } + 26 => { + + let result1418 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result1418) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result1419 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result1419}) + } + 30 => { + + let result1420 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result1420, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array1422.push(lifted1421) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + Option::Some(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array1386, defs : array1391, root : mbt_ffi_load32((iter_base) + 52)}, value : @types.SchemaValueTree::{value_nodes : array1422, root : mbt_ffi_load32((iter_base) + 64)}}) + } + _ => panic() + } + + PublicOplogEntry::Cancelled(CancelledParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, start_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), partial : lifted1424}) + } + 4 => { + + let lifted1937 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + let result1425 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let array1622 : Array[@types.SchemaTypeNode] = []; + for index1623 = 0; index1623 < (mbt_ffi_load32((iter_base) + 44)); index1623 = index1623 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index1623 * 144) + + let lifted1608 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted1432 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1427 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1426 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1426) + } + _ => panic() + } + + let lifted1429 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1428 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1428) + } + _ => panic() + } + + let lifted1431 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1430 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1430) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1427, max : lifted1429, unit : lifted1431}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted1432) + } + 3 => { + + let lifted1439 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1434 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1433 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1433) + } + _ => panic() + } + + let lifted1436 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1435 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1435) + } + _ => panic() + } + + let lifted1438 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1437 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1437) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1434, max : lifted1436, unit : lifted1438}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted1439) + } + 4 => { + + let lifted1446 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1441 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1440 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1440) + } + _ => panic() + } + + let lifted1443 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1442 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1442) + } + _ => panic() + } + + let lifted1445 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1444 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1444) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1441, max : lifted1443, unit : lifted1445}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted1446) + } + 5 => { + + let lifted1453 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1448 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1447 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1447) + } + _ => panic() + } + + let lifted1450 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1449 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1449) + } + _ => panic() + } + + let lifted1452 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1451 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1451) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1448, max : lifted1450, unit : lifted1452}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted1453) + } + 6 => { + + let lifted1460 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1455 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1454 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1454) + } + _ => panic() + } + + let lifted1457 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1456 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1456) + } + _ => panic() + } + + let lifted1459 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1458 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1458) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1455, max : lifted1457, unit : lifted1459}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted1460) + } + 7 => { + + let lifted1467 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1462 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1461 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1461) + } + _ => panic() + } + + let lifted1464 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1463 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1463) + } + _ => panic() + } + + let lifted1466 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1465 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1465) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1462, max : lifted1464, unit : lifted1466}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1467) + } + 8 => { + + let lifted1474 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1469 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1468 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1468) + } + _ => panic() + } + + let lifted1471 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1470 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1470) + } + _ => panic() + } + + let lifted1473 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1472 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1472) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1469, max : lifted1471, unit : lifted1473}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1474) + } + 9 => { + + let lifted1481 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1476 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1475 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1475) + } + _ => panic() + } + + let lifted1478 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1477 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1477) + } + _ => panic() + } + + let lifted1480 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1479 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1479) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1476, max : lifted1478, unit : lifted1480}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1481) + } + 10 => { + + let lifted1488 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1483 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1482 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1482) + } + _ => panic() + } + + let lifted1485 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1484 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1484) + } + _ => panic() + } + + let lifted1487 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1486 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1486) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1483, max : lifted1485, unit : lifted1487}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted1488) + } + 11 => { + + let lifted1495 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1490 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1489 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1489) + } + _ => panic() + } + + let lifted1492 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1491 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1491) + } + _ => panic() + } + + let lifted1494 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1493 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1493) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1490, max : lifted1492, unit : lifted1494}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted1495) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array1510 : Array[@types.NamedFieldType] = []; + for index1511 = 0; index1511 < (mbt_ffi_load32((iter_base) + 12)); index1511 = index1511 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1511 * 68) + + let result1496 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1498 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1497 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1497) + } + _ => panic() + } + + let array1500 : Array[String] = []; + for index1501 = 0; index1501 < (mbt_ffi_load32((iter_base) + 28)); index1501 = index1501 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1501 * 8) + + let result1499 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1500.push(result1499) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array1503 : Array[String] = []; + for index1504 = 0; index1504 < (mbt_ffi_load32((iter_base) + 36)); index1504 = index1504 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1504 * 8) + + let result1502 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1503.push(result1502) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted1506 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result1505 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result1505) + } + _ => panic() + } + + let lifted1509 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted1508 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1507 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result1507) + } + _ => panic() + } + + Option::Some(lifted1508) + } + _ => panic() + } + + array1510.push(@types.NamedFieldType::{name : result1496, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted1498, aliases : array1500, examples : array1503, deprecated : lifted1506, role : lifted1509}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array1510) + } + 15 => { + + let array1527 : Array[@types.VariantCaseType] = []; + for index1528 = 0; index1528 < (mbt_ffi_load32((iter_base) + 12)); index1528 = index1528 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1528 * 72) + + let result1512 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1513 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1515 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1514 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1514) + } + _ => panic() + } + + let array1517 : Array[String] = []; + for index1518 = 0; index1518 < (mbt_ffi_load32((iter_base) + 32)); index1518 = index1518 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1518 * 8) + + let result1516 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1517.push(result1516) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array1520 : Array[String] = []; + for index1521 = 0; index1521 < (mbt_ffi_load32((iter_base) + 40)); index1521 = index1521 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1521 * 8) + + let result1519 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1520.push(result1519) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted1523 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result1522 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result1522) + } + _ => panic() + } + + let lifted1526 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted1525 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1524 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result1524) + } + _ => panic() + } + + Option::Some(lifted1525) + } + _ => panic() + } + + array1527.push(@types.VariantCaseType::{name : result1512, payload : lifted1513, metadata : @types.MetadataEnvelope::{doc : lifted1515, aliases : array1517, examples : array1520, deprecated : lifted1523, role : lifted1526}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array1527) + } + 16 => { + + let array1530 : Array[String] = []; + for index1531 = 0; index1531 < (mbt_ffi_load32((iter_base) + 12)); index1531 = index1531 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1531 * 8) + + let result1529 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1530.push(result1529) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array1530) + } + 17 => { + + let array1533 : Array[String] = []; + for index1534 = 0; index1534 < (mbt_ffi_load32((iter_base) + 12)); index1534 = index1534 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1534 * 8) + + let result1532 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1533.push(result1532) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array1533) + } + 18 => { + + let array1535 : Array[Int] = []; + for index1536 = 0; index1536 < (mbt_ffi_load32((iter_base) + 12)); index1536 = index1536 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1536 * 4) + + array1535.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array1535) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted1537 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1538 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted1537, err : lifted1538}) + } + 24 => { + + let lifted1542 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1540 : Array[String] = []; + for index1541 = 0; index1541 < (mbt_ffi_load32((iter_base) + 16)); index1541 = index1541 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1541 * 8) + + let result1539 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1540.push(result1539) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1540) + } + _ => panic() + } + + let lifted1543 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1544 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1546 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1545 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1545) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted1542, min_length : lifted1543, max_length : lifted1544, regex : lifted1546}) + } + 25 => { + + let lifted1550 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1548 : Array[String] = []; + for index1549 = 0; index1549 < (mbt_ffi_load32((iter_base) + 16)); index1549 = index1549 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1549 * 8) + + let result1547 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1548.push(result1547) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1548) + } + _ => panic() + } + + let lifted1551 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1552 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted1550, min_bytes : lifted1551, max_bytes : lifted1552}) + } + 26 => { + + let lifted1556 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array1554 : Array[String] = []; + for index1555 = 0; index1555 < (mbt_ffi_load32((iter_base) + 20)); index1555 = index1555 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1555 * 8) + + let result1553 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1554.push(result1553) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array1554) + } + _ => panic() + } + + let lifted1560 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array1558 : Array[String] = []; + for index1559 = 0; index1559 < (mbt_ffi_load32((iter_base) + 32)); index1559 = index1559 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1559 * 8) + + let result1557 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1558.push(result1557) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array1558) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted1556, allowed_extensions : lifted1560}) + } + 27 => { + + let lifted1564 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1562 : Array[String] = []; + for index1563 = 0; index1563 < (mbt_ffi_load32((iter_base) + 16)); index1563 = index1563 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1563 * 8) + + let result1561 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1562.push(result1561) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1562) + } + _ => panic() + } + + let lifted1568 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array1566 : Array[String] = []; + for index1567 = 0; index1567 < (mbt_ffi_load32((iter_base) + 28)); index1567 = index1567 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1567 * 8) + + let result1565 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1566.push(result1565) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array1566) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted1564, allowed_hosts : lifted1568}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result1569 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array1571 : Array[String] = []; + for index1572 = 0; index1572 < (mbt_ffi_load32((iter_base) + 20)); index1572 = index1572 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1572 * 8) + + let result1570 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1571.push(result1570) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted1574 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1573 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result1573}) + } + _ => panic() + } + + let lifted1576 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result1575 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result1575}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result1569, allowed_suffixes : array1571, min : lifted1574, max : lifted1576}) + } + 31 => { + + let array1600 : Array[@types.UnionBranch] = []; + for index1601 = 0; index1601 < (mbt_ffi_load32((iter_base) + 12)); index1601 = index1601 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1601 * 92) + + let result1577 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1586 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result1578 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result1578) + } + 1 => { + + let result1579 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result1579) + } + 2 => { + + let result1580 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result1580) + } + 3 => { + + let result1581 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result1581) + } + 4 => { + + let result1582 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted1584 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1583 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result1583) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result1582, literal : lifted1584}) + } + 5 => { + + let result1585 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result1585) + } + _ => panic() + } + + let lifted1588 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1587 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1587) + } + _ => panic() + } + + let array1590 : Array[String] = []; + for index1591 = 0; index1591 < (mbt_ffi_load32((iter_base) + 52)); index1591 = index1591 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1591 * 8) + + let result1589 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1590.push(result1589) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1593 : Array[String] = []; + for index1594 = 0; index1594 < (mbt_ffi_load32((iter_base) + 60)); index1594 = index1594 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1594 * 8) + + let result1592 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1593.push(result1592) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted1596 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1595 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1595) + } + _ => panic() + } + + let lifted1599 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted1598 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1597 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result1597) + } + _ => panic() + } + + Option::Some(lifted1598) + } + _ => panic() + } + + array1600.push(@types.UnionBranch::{tag : result1577, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted1586, metadata : @types.MetadataEnvelope::{doc : lifted1588, aliases : array1590, examples : array1593, deprecated : lifted1596, role : lifted1599}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array1600}) + } + 32 => { + + let lifted1603 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1602 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1602) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted1603}) + } + 33 => { + + let lifted1605 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1604 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1604) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted1605}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted1606 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted1606) + } + 36 => { + + let lifted1607 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted1607) + } + _ => panic() + } + + let lifted1610 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result1609 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result1609) + } + _ => panic() + } + + let array1612 : Array[String] = []; + for index1613 = 0; index1613 < (mbt_ffi_load32((iter_base) + 104)); index1613 = index1613 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index1613 * 8) + + let result1611 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1612.push(result1611) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array1615 : Array[String] = []; + for index1616 = 0; index1616 < (mbt_ffi_load32((iter_base) + 112)); index1616 = index1616 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index1616 * 8) + + let result1614 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1615.push(result1614) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted1618 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result1617 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result1617) + } + _ => panic() + } + + let lifted1621 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted1620 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1619 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result1619) + } + _ => panic() + } + + Option::Some(lifted1620) + } + _ => panic() + } + + array1622.push(@types.SchemaTypeNode::{body : lifted1608, metadata : @types.MetadataEnvelope::{doc : lifted1610, aliases : array1612, examples : array1615, deprecated : lifted1618, role : lifted1621}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let array1627 : Array[@types.SchemaTypeDef] = []; + for index1628 = 0; index1628 < (mbt_ffi_load32((iter_base) + 52)); index1628 = index1628 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1628 * 24) + + let result1624 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1626 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1625 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1625) + } + _ => panic() + } + + array1627.push(@types.SchemaTypeDef::{id : result1624, name : lifted1626, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1658 : Array[@types.SchemaValueNode] = []; + for index1659 = 0; index1659 < (mbt_ffi_load32((iter_base) + 64)); index1659 = index1659 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index1659 * 32) + + let lifted1657 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result1629 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result1629) + } + 13 => { + + let array1630 : Array[Int] = []; + for index1631 = 0; index1631 < (mbt_ffi_load32((iter_base) + 12)); index1631 = index1631 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1631 * 4) + + array1630.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array1630) + } + 14 => { + + let lifted1632 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted1632}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array1633 : Array[Bool] = []; + for index1634 = 0; index1634 < (mbt_ffi_load32((iter_base) + 12)); index1634 = index1634 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1634 * 1) + + array1633.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array1633) + } + 17 => { + + let array1635 : Array[Int] = []; + for index1636 = 0; index1636 < (mbt_ffi_load32((iter_base) + 12)); index1636 = index1636 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1636 * 4) + + array1635.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array1635) + } + 18 => { + + let array1637 : Array[Int] = []; + for index1638 = 0; index1638 < (mbt_ffi_load32((iter_base) + 12)); index1638 = index1638 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1638 * 4) + + array1637.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array1637) + } + 19 => { + + let array1639 : Array[Int] = []; + for index1640 = 0; index1640 < (mbt_ffi_load32((iter_base) + 12)); index1640 = index1640 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1640 * 4) + + array1639.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array1639) + } + 20 => { + + let array1641 : Array[@types.MapEntry] = []; + for index1642 = 0; index1642 < (mbt_ffi_load32((iter_base) + 12)); index1642 = index1642 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1642 * 8) + + array1641.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array1641) + } + 21 => { + + let lifted1643 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted1643) + } + 22 => { + + let lifted1646 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted1644 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted1644) + } + 1 => { + + let lifted1645 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted1645) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted1646) + } + 23 => { + + let result1647 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1649 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1648 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1648) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result1647, language : lifted1649}) + } + 24 => { + + let result1650 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1652 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1651 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1651) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result1650, mime_type : lifted1652}) + } + 25 => { + + let result1653 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result1653) + } + 26 => { + + let result1654 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result1654) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result1655 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result1655}) + } + 30 => { + + let result1656 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result1656, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array1658.push(lifted1657) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + let result1660 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 72), mbt_ffi_load32((iter_base) + 76)) + + let array1662 : Array[String] = []; + for index1663 = 0; index1663 < (mbt_ffi_load32((iter_base) + 84)); index1663 = index1663 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 80)) + (index1663 * 8) + + let result1661 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1662.push(result1661) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 80)) + + let array1677 : Array[Array[SpanData]] = []; + for index1678 = 0; index1678 < (mbt_ffi_load32((iter_base) + 92)); index1678 = index1678 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 88)) + (index1678 * 8) + + let array1675 : Array[SpanData] = []; + for index1676 = 0; index1676 < (mbt_ffi_load32((iter_base) + 4)); index1676 = index1676 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index1676 * 80) + + let lifted1674 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result1664 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1666 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result1665 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result1665) + } + _ => panic() + } + + let lifted1667 : UInt64? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + let array1671 : Array[@context.Attribute] = []; + for index1672 = 0; index1672 < (mbt_ffi_load32((iter_base) + 68)); index1672 = index1672 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index1672 * 20) + + let result1668 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1670 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result1669 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + @context.AttributeValue::String(result1669) + } + _ => panic() + } + + array1671.push(@context.Attribute::{key : result1668, value : lifted1670}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + SpanData::LocalSpan(LocalSpanData::{span_id : result1664, start : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent : lifted1666, linked_context : lifted1667, attributes : array1671, inherited : (mbt_ffi_load8_u((iter_base) + 72) != 0)}) + } + 1 => { + + let result1673 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + SpanData::ExternalSpan(ExternalSpanData::{span_id : result1673}) + } + _ => panic() + } + + array1675.push(lifted1674) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array1677.push(array1675) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + + AgentInvocation::AgentInitialization(AgentInitializationParameters::{idempotency_key : result1425, constructor_parameters : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array1622, defs : array1627, root : mbt_ffi_load32((iter_base) + 56)}, value : @types.SchemaValueTree::{value_nodes : array1658, root : mbt_ffi_load32((iter_base) + 68)}}, trace_id : result1660, trace_states : array1662, invocation_context : array1677}) + } + 1 => { + + let result1679 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let result1680 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + let array1877 : Array[@types.SchemaTypeNode] = []; + for index1878 = 0; index1878 < (mbt_ffi_load32((iter_base) + 52)); index1878 = index1878 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1878 * 144) + + let lifted1863 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted1687 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1682 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1681 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1681) + } + _ => panic() + } + + let lifted1684 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1683 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1683) + } + _ => panic() + } + + let lifted1686 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1685 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1685) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1682, max : lifted1684, unit : lifted1686}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted1687) + } + 3 => { + + let lifted1694 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1689 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1688 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1688) + } + _ => panic() + } + + let lifted1691 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1690 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1690) + } + _ => panic() + } + + let lifted1693 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1692 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1692) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1689, max : lifted1691, unit : lifted1693}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted1694) + } + 4 => { + + let lifted1701 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1696 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1695 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1695) + } + _ => panic() + } + + let lifted1698 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1697 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1697) + } + _ => panic() + } + + let lifted1700 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1699 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1699) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1696, max : lifted1698, unit : lifted1700}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted1701) + } + 5 => { + + let lifted1708 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1703 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1702 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1702) + } + _ => panic() + } + + let lifted1705 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1704 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1704) + } + _ => panic() + } + + let lifted1707 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1706 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1706) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1703, max : lifted1705, unit : lifted1707}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted1708) + } + 6 => { + + let lifted1715 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1710 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1709 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1709) + } + _ => panic() + } + + let lifted1712 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1711 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1711) + } + _ => panic() + } + + let lifted1714 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1713 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1713) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1710, max : lifted1712, unit : lifted1714}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted1715) + } + 7 => { + + let lifted1722 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1717 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1716 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1716) + } + _ => panic() + } + + let lifted1719 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1718 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1718) + } + _ => panic() + } + + let lifted1721 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1720 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1720) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1717, max : lifted1719, unit : lifted1721}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1722) + } + 8 => { + + let lifted1729 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1724 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1723 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1723) + } + _ => panic() + } + + let lifted1726 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1725 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1725) + } + _ => panic() + } + + let lifted1728 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1727 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1727) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1724, max : lifted1726, unit : lifted1728}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1729) + } + 9 => { + + let lifted1736 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1731 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1730 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1730) + } + _ => panic() + } + + let lifted1733 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1732 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1732) + } + _ => panic() + } + + let lifted1735 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1734 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1734) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1731, max : lifted1733, unit : lifted1735}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1736) + } + 10 => { + + let lifted1743 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1738 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1737 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1737) + } + _ => panic() + } + + let lifted1740 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1739 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1739) + } + _ => panic() + } + + let lifted1742 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1741 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1741) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1738, max : lifted1740, unit : lifted1742}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted1743) + } + 11 => { + + let lifted1750 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1745 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1744 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1744) + } + _ => panic() + } + + let lifted1747 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1746 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1746) + } + _ => panic() + } + + let lifted1749 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1748 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1748) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1745, max : lifted1747, unit : lifted1749}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted1750) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array1765 : Array[@types.NamedFieldType] = []; + for index1766 = 0; index1766 < (mbt_ffi_load32((iter_base) + 12)); index1766 = index1766 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1766 * 68) + + let result1751 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1753 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1752 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1752) + } + _ => panic() + } + + let array1755 : Array[String] = []; + for index1756 = 0; index1756 < (mbt_ffi_load32((iter_base) + 28)); index1756 = index1756 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1756 * 8) + + let result1754 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1755.push(result1754) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array1758 : Array[String] = []; + for index1759 = 0; index1759 < (mbt_ffi_load32((iter_base) + 36)); index1759 = index1759 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1759 * 8) + + let result1757 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1758.push(result1757) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted1761 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result1760 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result1760) + } + _ => panic() + } + + let lifted1764 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted1763 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1762 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result1762) + } + _ => panic() + } + + Option::Some(lifted1763) + } + _ => panic() + } + + array1765.push(@types.NamedFieldType::{name : result1751, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted1753, aliases : array1755, examples : array1758, deprecated : lifted1761, role : lifted1764}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array1765) + } + 15 => { + + let array1782 : Array[@types.VariantCaseType] = []; + for index1783 = 0; index1783 < (mbt_ffi_load32((iter_base) + 12)); index1783 = index1783 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1783 * 72) + + let result1767 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1768 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1770 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1769 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1769) + } + _ => panic() + } + + let array1772 : Array[String] = []; + for index1773 = 0; index1773 < (mbt_ffi_load32((iter_base) + 32)); index1773 = index1773 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1773 * 8) + + let result1771 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1772.push(result1771) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array1775 : Array[String] = []; + for index1776 = 0; index1776 < (mbt_ffi_load32((iter_base) + 40)); index1776 = index1776 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1776 * 8) + + let result1774 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1775.push(result1774) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted1778 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result1777 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result1777) + } + _ => panic() + } + + let lifted1781 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted1780 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1779 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result1779) + } + _ => panic() + } + + Option::Some(lifted1780) + } + _ => panic() + } + + array1782.push(@types.VariantCaseType::{name : result1767, payload : lifted1768, metadata : @types.MetadataEnvelope::{doc : lifted1770, aliases : array1772, examples : array1775, deprecated : lifted1778, role : lifted1781}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array1782) + } + 16 => { + + let array1785 : Array[String] = []; + for index1786 = 0; index1786 < (mbt_ffi_load32((iter_base) + 12)); index1786 = index1786 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1786 * 8) + + let result1784 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1785.push(result1784) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array1785) + } + 17 => { + + let array1788 : Array[String] = []; + for index1789 = 0; index1789 < (mbt_ffi_load32((iter_base) + 12)); index1789 = index1789 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1789 * 8) + + let result1787 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1788.push(result1787) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array1788) + } + 18 => { + + let array1790 : Array[Int] = []; + for index1791 = 0; index1791 < (mbt_ffi_load32((iter_base) + 12)); index1791 = index1791 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1791 * 4) + + array1790.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array1790) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted1792 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1793 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted1792, err : lifted1793}) + } + 24 => { + + let lifted1797 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1795 : Array[String] = []; + for index1796 = 0; index1796 < (mbt_ffi_load32((iter_base) + 16)); index1796 = index1796 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1796 * 8) + + let result1794 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1795.push(result1794) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1795) + } + _ => panic() + } + + let lifted1798 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1799 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1801 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1800 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1800) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted1797, min_length : lifted1798, max_length : lifted1799, regex : lifted1801}) + } + 25 => { + + let lifted1805 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1803 : Array[String] = []; + for index1804 = 0; index1804 < (mbt_ffi_load32((iter_base) + 16)); index1804 = index1804 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1804 * 8) + + let result1802 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1803.push(result1802) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1803) + } + _ => panic() + } + + let lifted1806 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1807 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted1805, min_bytes : lifted1806, max_bytes : lifted1807}) + } + 26 => { + + let lifted1811 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array1809 : Array[String] = []; + for index1810 = 0; index1810 < (mbt_ffi_load32((iter_base) + 20)); index1810 = index1810 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1810 * 8) + + let result1808 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1809.push(result1808) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array1809) + } + _ => panic() + } + + let lifted1815 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array1813 : Array[String] = []; + for index1814 = 0; index1814 < (mbt_ffi_load32((iter_base) + 32)); index1814 = index1814 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1814 * 8) + + let result1812 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1813.push(result1812) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array1813) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted1811, allowed_extensions : lifted1815}) + } + 27 => { + + let lifted1819 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1817 : Array[String] = []; + for index1818 = 0; index1818 < (mbt_ffi_load32((iter_base) + 16)); index1818 = index1818 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1818 * 8) + + let result1816 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1817.push(result1816) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1817) + } + _ => panic() + } + + let lifted1823 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array1821 : Array[String] = []; + for index1822 = 0; index1822 < (mbt_ffi_load32((iter_base) + 28)); index1822 = index1822 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1822 * 8) + + let result1820 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1821.push(result1820) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array1821) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted1819, allowed_hosts : lifted1823}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result1824 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array1826 : Array[String] = []; + for index1827 = 0; index1827 < (mbt_ffi_load32((iter_base) + 20)); index1827 = index1827 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1827 * 8) + + let result1825 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1826.push(result1825) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted1829 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1828 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result1828}) + } + _ => panic() + } + + let lifted1831 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result1830 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result1830}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result1824, allowed_suffixes : array1826, min : lifted1829, max : lifted1831}) + } + 31 => { + + let array1855 : Array[@types.UnionBranch] = []; + for index1856 = 0; index1856 < (mbt_ffi_load32((iter_base) + 12)); index1856 = index1856 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1856 * 92) + + let result1832 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1841 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result1833 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result1833) + } + 1 => { + + let result1834 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result1834) + } + 2 => { + + let result1835 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result1835) + } + 3 => { + + let result1836 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result1836) + } + 4 => { + + let result1837 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted1839 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1838 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result1838) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result1837, literal : lifted1839}) + } + 5 => { + + let result1840 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result1840) + } + _ => panic() + } + + let lifted1843 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1842 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1842) + } + _ => panic() + } + + let array1845 : Array[String] = []; + for index1846 = 0; index1846 < (mbt_ffi_load32((iter_base) + 52)); index1846 = index1846 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1846 * 8) + + let result1844 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1845.push(result1844) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1848 : Array[String] = []; + for index1849 = 0; index1849 < (mbt_ffi_load32((iter_base) + 60)); index1849 = index1849 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1849 * 8) + + let result1847 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1848.push(result1847) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted1851 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1850 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1850) + } + _ => panic() + } + + let lifted1854 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted1853 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1852 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result1852) + } + _ => panic() + } + + Option::Some(lifted1853) + } + _ => panic() + } + + array1855.push(@types.UnionBranch::{tag : result1832, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted1841, metadata : @types.MetadataEnvelope::{doc : lifted1843, aliases : array1845, examples : array1848, deprecated : lifted1851, role : lifted1854}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array1855}) + } + 32 => { + + let lifted1858 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1857 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1857) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted1858}) + } + 33 => { + + let lifted1860 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1859 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1859) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted1860}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted1861 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted1861) + } + 36 => { + + let lifted1862 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted1862) + } + _ => panic() + } + + let lifted1865 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result1864 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result1864) + } + _ => panic() + } + + let array1867 : Array[String] = []; + for index1868 = 0; index1868 < (mbt_ffi_load32((iter_base) + 104)); index1868 = index1868 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index1868 * 8) + + let result1866 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1867.push(result1866) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array1870 : Array[String] = []; + for index1871 = 0; index1871 < (mbt_ffi_load32((iter_base) + 112)); index1871 = index1871 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index1871 * 8) + + let result1869 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1870.push(result1869) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted1873 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result1872 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result1872) + } + _ => panic() + } + + let lifted1876 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted1875 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1874 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result1874) + } + _ => panic() + } + + Option::Some(lifted1875) + } + _ => panic() + } + + array1877.push(@types.SchemaTypeNode::{body : lifted1863, metadata : @types.MetadataEnvelope::{doc : lifted1865, aliases : array1867, examples : array1870, deprecated : lifted1873, role : lifted1876}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1882 : Array[@types.SchemaTypeDef] = []; + for index1883 = 0; index1883 < (mbt_ffi_load32((iter_base) + 60)); index1883 = index1883 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1883 * 24) + + let result1879 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1881 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1880 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1880) + } + _ => panic() + } + + array1882.push(@types.SchemaTypeDef::{id : result1879, name : lifted1881, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let array1913 : Array[@types.SchemaValueNode] = []; + for index1914 = 0; index1914 < (mbt_ffi_load32((iter_base) + 72)); index1914 = index1914 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index1914 * 32) + + let lifted1912 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result1884 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result1884) + } + 13 => { + + let array1885 : Array[Int] = []; + for index1886 = 0; index1886 < (mbt_ffi_load32((iter_base) + 12)); index1886 = index1886 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1886 * 4) + + array1885.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array1885) + } + 14 => { + + let lifted1887 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted1887}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array1888 : Array[Bool] = []; + for index1889 = 0; index1889 < (mbt_ffi_load32((iter_base) + 12)); index1889 = index1889 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1889 * 1) + + array1888.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array1888) + } + 17 => { + + let array1890 : Array[Int] = []; + for index1891 = 0; index1891 < (mbt_ffi_load32((iter_base) + 12)); index1891 = index1891 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1891 * 4) + + array1890.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array1890) + } + 18 => { + + let array1892 : Array[Int] = []; + for index1893 = 0; index1893 < (mbt_ffi_load32((iter_base) + 12)); index1893 = index1893 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1893 * 4) + + array1892.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array1892) + } + 19 => { + + let array1894 : Array[Int] = []; + for index1895 = 0; index1895 < (mbt_ffi_load32((iter_base) + 12)); index1895 = index1895 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1895 * 4) + + array1894.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array1894) + } + 20 => { + + let array1896 : Array[@types.MapEntry] = []; + for index1897 = 0; index1897 < (mbt_ffi_load32((iter_base) + 12)); index1897 = index1897 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1897 * 8) + + array1896.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array1896) + } + 21 => { + + let lifted1898 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted1898) + } + 22 => { + + let lifted1901 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted1899 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted1899) + } + 1 => { + + let lifted1900 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted1900) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted1901) + } + 23 => { + + let result1902 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1904 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1903 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1903) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result1902, language : lifted1904}) + } + 24 => { + + let result1905 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1907 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1906 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1906) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result1905, mime_type : lifted1907}) + } + 25 => { + + let result1908 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result1908) + } + 26 => { + + let result1909 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result1909) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result1910 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result1910}) + } + 30 => { + + let result1911 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result1911, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array1913.push(lifted1912) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + let result1915 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 80), mbt_ffi_load32((iter_base) + 84)) + + let array1917 : Array[String] = []; + for index1918 = 0; index1918 < (mbt_ffi_load32((iter_base) + 92)); index1918 = index1918 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 88)) + (index1918 * 8) + + let result1916 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1917.push(result1916) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + + let array1932 : Array[Array[SpanData]] = []; + for index1933 = 0; index1933 < (mbt_ffi_load32((iter_base) + 100)); index1933 = index1933 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 96)) + (index1933 * 8) + + let array1930 : Array[SpanData] = []; + for index1931 = 0; index1931 < (mbt_ffi_load32((iter_base) + 4)); index1931 = index1931 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index1931 * 80) + + let lifted1929 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result1919 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1921 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result1920 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result1920) + } + _ => panic() + } + + let lifted1922 : UInt64? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + let array1926 : Array[@context.Attribute] = []; + for index1927 = 0; index1927 < (mbt_ffi_load32((iter_base) + 68)); index1927 = index1927 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index1927 * 20) + + let result1923 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1925 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result1924 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + @context.AttributeValue::String(result1924) + } + _ => panic() + } + + array1926.push(@context.Attribute::{key : result1923, value : lifted1925}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + SpanData::LocalSpan(LocalSpanData::{span_id : result1919, start : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent : lifted1921, linked_context : lifted1922, attributes : array1926, inherited : (mbt_ffi_load8_u((iter_base) + 72) != 0)}) + } + 1 => { + + let result1928 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + SpanData::ExternalSpan(ExternalSpanData::{span_id : result1928}) + } + _ => panic() + } + + array1930.push(lifted1929) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array1932.push(array1930) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 96)) + + AgentInvocation::AgentMethodInvocation(AgentMethodInvocationParameters::{idempotency_key : result1679, method_name : result1680, function_input : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array1877, defs : array1882, root : mbt_ffi_load32((iter_base) + 64)}, value : @types.SchemaValueTree::{value_nodes : array1913, root : mbt_ffi_load32((iter_base) + 76)}}, trace_id : result1915, trace_states : array1917, invocation_context : array1932}) + } + 2 => { + + AgentInvocation::SaveSnapshot + } + 3 => { + + let result1934 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let result1935 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + AgentInvocation::LoadSnapshot(LoadSnapshotParameters::{snapshot : SnapshotData::{data : result1934, mime_type : result1935}}) + } + 4 => { + + let result1936 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + AgentInvocation::ProcessOplogEntries(ProcessOplogEntriesParameters::{idempotency_key : result1936}) + } + 5 => { + + AgentInvocation::ManualUpdate(ManualUpdateParameters::{target_revision : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}) + } + _ => panic() + } + + PublicOplogEntry::AgentInvocationStarted(AgentInvocationStartedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, invocation : lifted1937}) + } + 5 => { + + let lifted2412 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + let array2134 : Array[@types.SchemaTypeNode] = []; + for index2135 = 0; index2135 < (mbt_ffi_load32((iter_base) + 32)); index2135 = index2135 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2135 * 144) + + let lifted2120 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted1944 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1939 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1938 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1938) + } + _ => panic() + } + + let lifted1941 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1940 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1940) + } + _ => panic() + } + + let lifted1943 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1942 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1942) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1939, max : lifted1941, unit : lifted1943}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted1944) + } + 3 => { + + let lifted1951 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1946 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1945 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1945) + } + _ => panic() + } + + let lifted1948 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1947 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1947) + } + _ => panic() + } + + let lifted1950 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1949 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1949) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1946, max : lifted1948, unit : lifted1950}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted1951) + } + 4 => { + + let lifted1958 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1953 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1952 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1952) + } + _ => panic() + } + + let lifted1955 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1954 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1954) + } + _ => panic() + } + + let lifted1957 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1956 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1956) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1953, max : lifted1955, unit : lifted1957}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted1958) + } + 5 => { + + let lifted1965 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1960 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1959 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1959) + } + _ => panic() + } + + let lifted1962 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1961 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1961) + } + _ => panic() + } + + let lifted1964 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1963 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1963) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1960, max : lifted1962, unit : lifted1964}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted1965) + } + 6 => { + + let lifted1972 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1967 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1966 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1966) + } + _ => panic() + } + + let lifted1969 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1968 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1968) + } + _ => panic() + } + + let lifted1971 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1970 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1970) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1967, max : lifted1969, unit : lifted1971}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted1972) + } + 7 => { + + let lifted1979 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1974 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1973 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1973) + } + _ => panic() + } + + let lifted1976 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1975 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1975) + } + _ => panic() + } + + let lifted1978 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1977 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1977) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1974, max : lifted1976, unit : lifted1978}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1979) + } + 8 => { + + let lifted1986 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1981 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1980 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1980) + } + _ => panic() + } + + let lifted1983 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1982 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1982) + } + _ => panic() + } + + let lifted1985 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1984 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1984) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1981, max : lifted1983, unit : lifted1985}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1986) + } + 9 => { + + let lifted1993 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1988 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1987 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1987) + } + _ => panic() + } + + let lifted1990 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1989 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1989) + } + _ => panic() + } + + let lifted1992 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1991 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1991) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1988, max : lifted1990, unit : lifted1992}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1993) + } + 10 => { + + let lifted2000 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1995 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1994 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1994) + } + _ => panic() + } + + let lifted1997 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1996 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1996) + } + _ => panic() + } + + let lifted1999 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1998 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1998) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1995, max : lifted1997, unit : lifted1999}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted2000) + } + 11 => { + + let lifted2007 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2002 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2001 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2001) + } + _ => panic() + } + + let lifted2004 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2003 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2003) + } + _ => panic() + } + + let lifted2006 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2005 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2005) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2002, max : lifted2004, unit : lifted2006}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted2007) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array2022 : Array[@types.NamedFieldType] = []; + for index2023 = 0; index2023 < (mbt_ffi_load32((iter_base) + 12)); index2023 = index2023 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2023 * 68) + + let result2008 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2010 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2009 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2009) + } + _ => panic() + } + + let array2012 : Array[String] = []; + for index2013 = 0; index2013 < (mbt_ffi_load32((iter_base) + 28)); index2013 = index2013 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2013 * 8) + + let result2011 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2012.push(result2011) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array2015 : Array[String] = []; + for index2016 = 0; index2016 < (mbt_ffi_load32((iter_base) + 36)); index2016 = index2016 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index2016 * 8) + + let result2014 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2015.push(result2014) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted2018 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result2017 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result2017) + } + _ => panic() + } + + let lifted2021 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted2020 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2019 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result2019) + } + _ => panic() + } + + Option::Some(lifted2020) + } + _ => panic() + } + + array2022.push(@types.NamedFieldType::{name : result2008, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted2010, aliases : array2012, examples : array2015, deprecated : lifted2018, role : lifted2021}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array2022) + } + 15 => { + + let array2039 : Array[@types.VariantCaseType] = []; + for index2040 = 0; index2040 < (mbt_ffi_load32((iter_base) + 12)); index2040 = index2040 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2040 * 72) + + let result2024 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2025 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2027 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2026 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2026) + } + _ => panic() + } + + let array2029 : Array[String] = []; + for index2030 = 0; index2030 < (mbt_ffi_load32((iter_base) + 32)); index2030 = index2030 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2030 * 8) + + let result2028 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2029.push(result2028) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array2032 : Array[String] = []; + for index2033 = 0; index2033 < (mbt_ffi_load32((iter_base) + 40)); index2033 = index2033 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2033 * 8) + + let result2031 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2032.push(result2031) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted2035 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result2034 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result2034) + } + _ => panic() + } + + let lifted2038 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted2037 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2036 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result2036) + } + _ => panic() + } + + Option::Some(lifted2037) + } + _ => panic() + } + + array2039.push(@types.VariantCaseType::{name : result2024, payload : lifted2025, metadata : @types.MetadataEnvelope::{doc : lifted2027, aliases : array2029, examples : array2032, deprecated : lifted2035, role : lifted2038}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array2039) + } + 16 => { + + let array2042 : Array[String] = []; + for index2043 = 0; index2043 < (mbt_ffi_load32((iter_base) + 12)); index2043 = index2043 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2043 * 8) + + let result2041 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2042.push(result2041) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array2042) + } + 17 => { + + let array2045 : Array[String] = []; + for index2046 = 0; index2046 < (mbt_ffi_load32((iter_base) + 12)); index2046 = index2046 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2046 * 8) + + let result2044 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2045.push(result2044) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array2045) + } + 18 => { + + let array2047 : Array[Int] = []; + for index2048 = 0; index2048 < (mbt_ffi_load32((iter_base) + 12)); index2048 = index2048 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2048 * 4) + + array2047.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array2047) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted2049 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2050 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted2049, err : lifted2050}) + } + 24 => { + + let lifted2054 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2052 : Array[String] = []; + for index2053 = 0; index2053 < (mbt_ffi_load32((iter_base) + 16)); index2053 = index2053 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2053 * 8) + + let result2051 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2052.push(result2051) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2052) + } + _ => panic() + } + + let lifted2055 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2056 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2058 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2057 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2057) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted2054, min_length : lifted2055, max_length : lifted2056, regex : lifted2058}) + } + 25 => { + + let lifted2062 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2060 : Array[String] = []; + for index2061 = 0; index2061 < (mbt_ffi_load32((iter_base) + 16)); index2061 = index2061 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2061 * 8) + + let result2059 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2060.push(result2059) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2060) + } + _ => panic() + } + + let lifted2063 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2064 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted2062, min_bytes : lifted2063, max_bytes : lifted2064}) + } + 26 => { + + let lifted2068 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array2066 : Array[String] = []; + for index2067 = 0; index2067 < (mbt_ffi_load32((iter_base) + 20)); index2067 = index2067 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2067 * 8) + + let result2065 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2066.push(result2065) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array2066) + } + _ => panic() + } + + let lifted2072 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array2070 : Array[String] = []; + for index2071 = 0; index2071 < (mbt_ffi_load32((iter_base) + 32)); index2071 = index2071 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2071 * 8) + + let result2069 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2070.push(result2069) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array2070) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted2068, allowed_extensions : lifted2072}) + } + 27 => { + + let lifted2076 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2074 : Array[String] = []; + for index2075 = 0; index2075 < (mbt_ffi_load32((iter_base) + 16)); index2075 = index2075 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2075 * 8) + + let result2073 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2074.push(result2073) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2074) + } + _ => panic() + } + + let lifted2080 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array2078 : Array[String] = []; + for index2079 = 0; index2079 < (mbt_ffi_load32((iter_base) + 28)); index2079 = index2079 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2079 * 8) + + let result2077 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2078.push(result2077) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array2078) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted2076, allowed_hosts : lifted2080}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result2081 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array2083 : Array[String] = []; + for index2084 = 0; index2084 < (mbt_ffi_load32((iter_base) + 20)); index2084 = index2084 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2084 * 8) + + let result2082 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2083.push(result2082) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted2086 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2085 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result2085}) + } + _ => panic() + } + + let lifted2088 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result2087 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result2087}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result2081, allowed_suffixes : array2083, min : lifted2086, max : lifted2088}) + } + 31 => { + + let array2112 : Array[@types.UnionBranch] = []; + for index2113 = 0; index2113 < (mbt_ffi_load32((iter_base) + 12)); index2113 = index2113 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2113 * 92) + + let result2089 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2098 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result2090 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result2090) + } + 1 => { + + let result2091 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result2091) + } + 2 => { + + let result2092 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result2092) + } + 3 => { + + let result2093 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result2093) + } + 4 => { + + let result2094 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted2096 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2095 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result2095) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result2094, literal : lifted2096}) + } + 5 => { + + let result2097 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result2097) + } + _ => panic() + } + + let lifted2100 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2099 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2099) + } + _ => panic() + } + + let array2102 : Array[String] = []; + for index2103 = 0; index2103 < (mbt_ffi_load32((iter_base) + 52)); index2103 = index2103 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2103 * 8) + + let result2101 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2102.push(result2101) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array2105 : Array[String] = []; + for index2106 = 0; index2106 < (mbt_ffi_load32((iter_base) + 60)); index2106 = index2106 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2106 * 8) + + let result2104 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2105.push(result2104) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted2108 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2107 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2107) + } + _ => panic() + } + + let lifted2111 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted2110 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2109 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result2109) + } + _ => panic() + } + + Option::Some(lifted2110) + } + _ => panic() + } + + array2112.push(@types.UnionBranch::{tag : result2089, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted2098, metadata : @types.MetadataEnvelope::{doc : lifted2100, aliases : array2102, examples : array2105, deprecated : lifted2108, role : lifted2111}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array2112}) + } + 32 => { + + let lifted2115 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2114 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2114) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted2115}) + } + 33 => { + + let lifted2117 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2116 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2116) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted2117}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted2118 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted2118) + } + 36 => { + + let lifted2119 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted2119) + } + _ => panic() + } + + let lifted2122 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result2121 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result2121) + } + _ => panic() + } + + let array2124 : Array[String] = []; + for index2125 = 0; index2125 < (mbt_ffi_load32((iter_base) + 104)); index2125 = index2125 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index2125 * 8) + + let result2123 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2124.push(result2123) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array2127 : Array[String] = []; + for index2128 = 0; index2128 < (mbt_ffi_load32((iter_base) + 112)); index2128 = index2128 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index2128 * 8) + + let result2126 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2127.push(result2126) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted2130 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result2129 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result2129) + } + _ => panic() + } + + let lifted2133 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted2132 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2131 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result2131) + } + _ => panic() + } + + Option::Some(lifted2132) + } + _ => panic() + } + + array2134.push(@types.SchemaTypeNode::{body : lifted2120, metadata : @types.MetadataEnvelope::{doc : lifted2122, aliases : array2124, examples : array2127, deprecated : lifted2130, role : lifted2133}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array2139 : Array[@types.SchemaTypeDef] = []; + for index2140 = 0; index2140 < (mbt_ffi_load32((iter_base) + 40)); index2140 = index2140 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2140 * 24) + + let result2136 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2138 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2137 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2137) + } + _ => panic() + } + + array2139.push(@types.SchemaTypeDef::{id : result2136, name : lifted2138, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let array2170 : Array[@types.SchemaValueNode] = []; + for index2171 = 0; index2171 < (mbt_ffi_load32((iter_base) + 52)); index2171 = index2171 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2171 * 32) + + let lifted2169 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result2141 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result2141) + } + 13 => { + + let array2142 : Array[Int] = []; + for index2143 = 0; index2143 < (mbt_ffi_load32((iter_base) + 12)); index2143 = index2143 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2143 * 4) + + array2142.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array2142) + } + 14 => { + + let lifted2144 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted2144}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array2145 : Array[Bool] = []; + for index2146 = 0; index2146 < (mbt_ffi_load32((iter_base) + 12)); index2146 = index2146 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2146 * 1) + + array2145.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array2145) + } + 17 => { + + let array2147 : Array[Int] = []; + for index2148 = 0; index2148 < (mbt_ffi_load32((iter_base) + 12)); index2148 = index2148 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2148 * 4) + + array2147.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array2147) + } + 18 => { + + let array2149 : Array[Int] = []; + for index2150 = 0; index2150 < (mbt_ffi_load32((iter_base) + 12)); index2150 = index2150 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2150 * 4) + + array2149.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array2149) + } + 19 => { + + let array2151 : Array[Int] = []; + for index2152 = 0; index2152 < (mbt_ffi_load32((iter_base) + 12)); index2152 = index2152 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2152 * 4) + + array2151.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array2151) + } + 20 => { + + let array2153 : Array[@types.MapEntry] = []; + for index2154 = 0; index2154 < (mbt_ffi_load32((iter_base) + 12)); index2154 = index2154 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2154 * 8) + + array2153.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array2153) + } + 21 => { + + let lifted2155 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted2155) + } + 22 => { + + let lifted2158 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted2156 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted2156) + } + 1 => { + + let lifted2157 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted2157) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted2158) + } + 23 => { + + let result2159 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2161 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2160 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2160) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result2159, language : lifted2161}) + } + 24 => { + + let result2162 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2164 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2163 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2163) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result2162, mime_type : lifted2164}) + } + 25 => { + + let result2165 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result2165) + } + 26 => { + + let result2166 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result2166) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result2167 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result2167}) + } + 30 => { + + let result2168 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result2168, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array2170.push(lifted2169) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + AgentInvocationResult::AgentInitialization(AgentInvocationOutputParameters::{output : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array2134, defs : array2139, root : mbt_ffi_load32((iter_base) + 44)}, value : @types.SchemaValueTree::{value_nodes : array2170, root : mbt_ffi_load32((iter_base) + 56)}}}) + } + 1 => { + + let array2368 : Array[@types.SchemaTypeNode] = []; + for index2369 = 0; index2369 < (mbt_ffi_load32((iter_base) + 32)); index2369 = index2369 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2369 * 144) + + let lifted2354 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted2178 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2173 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2172 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2172) + } + _ => panic() + } + + let lifted2175 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2174 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2174) + } + _ => panic() + } + + let lifted2177 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2176 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2176) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2173, max : lifted2175, unit : lifted2177}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted2178) + } + 3 => { + + let lifted2185 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2180 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2179 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2179) + } + _ => panic() + } + + let lifted2182 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2181 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2181) + } + _ => panic() + } + + let lifted2184 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2183 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2183) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2180, max : lifted2182, unit : lifted2184}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted2185) + } + 4 => { + + let lifted2192 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2187 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2186 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2186) + } + _ => panic() + } + + let lifted2189 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2188 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2188) + } + _ => panic() + } + + let lifted2191 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2190 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2190) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2187, max : lifted2189, unit : lifted2191}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted2192) + } + 5 => { + + let lifted2199 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2194 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2193 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2193) + } + _ => panic() + } + + let lifted2196 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2195 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2195) + } + _ => panic() + } + + let lifted2198 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2197 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2197) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2194, max : lifted2196, unit : lifted2198}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted2199) + } + 6 => { + + let lifted2206 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2201 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2200 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2200) + } + _ => panic() + } + + let lifted2203 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2202 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2202) + } + _ => panic() + } + + let lifted2205 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2204 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2204) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2201, max : lifted2203, unit : lifted2205}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted2206) + } + 7 => { + + let lifted2213 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2208 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2207 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2207) + } + _ => panic() + } + + let lifted2210 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2209 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2209) + } + _ => panic() + } + + let lifted2212 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2211 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2211) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2208, max : lifted2210, unit : lifted2212}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted2213) + } + 8 => { + + let lifted2220 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2215 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2214 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2214) + } + _ => panic() + } + + let lifted2217 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2216 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2216) + } + _ => panic() + } + + let lifted2219 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2218 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2218) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2215, max : lifted2217, unit : lifted2219}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted2220) + } + 9 => { + + let lifted2227 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2222 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2221 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2221) + } + _ => panic() + } + + let lifted2224 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2223 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2223) + } + _ => panic() + } + + let lifted2226 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2225 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2225) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2222, max : lifted2224, unit : lifted2226}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted2227) + } + 10 => { + + let lifted2234 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2229 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2228 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2228) + } + _ => panic() + } + + let lifted2231 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2230 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2230) + } + _ => panic() + } + + let lifted2233 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2232 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2232) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2229, max : lifted2231, unit : lifted2233}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted2234) + } + 11 => { + + let lifted2241 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2236 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2235 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2235) + } + _ => panic() + } + + let lifted2238 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2237 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2237) + } + _ => panic() + } + + let lifted2240 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2239 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2239) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2236, max : lifted2238, unit : lifted2240}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted2241) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array2256 : Array[@types.NamedFieldType] = []; + for index2257 = 0; index2257 < (mbt_ffi_load32((iter_base) + 12)); index2257 = index2257 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2257 * 68) + + let result2242 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2244 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2243 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2243) + } + _ => panic() + } + + let array2246 : Array[String] = []; + for index2247 = 0; index2247 < (mbt_ffi_load32((iter_base) + 28)); index2247 = index2247 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2247 * 8) + + let result2245 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2246.push(result2245) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array2249 : Array[String] = []; + for index2250 = 0; index2250 < (mbt_ffi_load32((iter_base) + 36)); index2250 = index2250 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index2250 * 8) + + let result2248 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2249.push(result2248) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted2252 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result2251 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result2251) + } + _ => panic() + } + + let lifted2255 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted2254 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2253 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result2253) + } + _ => panic() + } + + Option::Some(lifted2254) + } + _ => panic() + } + + array2256.push(@types.NamedFieldType::{name : result2242, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted2244, aliases : array2246, examples : array2249, deprecated : lifted2252, role : lifted2255}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array2256) + } + 15 => { + + let array2273 : Array[@types.VariantCaseType] = []; + for index2274 = 0; index2274 < (mbt_ffi_load32((iter_base) + 12)); index2274 = index2274 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2274 * 72) + + let result2258 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2259 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2261 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2260 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2260) + } + _ => panic() + } + + let array2263 : Array[String] = []; + for index2264 = 0; index2264 < (mbt_ffi_load32((iter_base) + 32)); index2264 = index2264 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2264 * 8) + + let result2262 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2263.push(result2262) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array2266 : Array[String] = []; + for index2267 = 0; index2267 < (mbt_ffi_load32((iter_base) + 40)); index2267 = index2267 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2267 * 8) + + let result2265 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2266.push(result2265) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted2269 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result2268 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result2268) + } + _ => panic() + } + + let lifted2272 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted2271 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2270 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result2270) + } + _ => panic() + } + + Option::Some(lifted2271) + } + _ => panic() + } + + array2273.push(@types.VariantCaseType::{name : result2258, payload : lifted2259, metadata : @types.MetadataEnvelope::{doc : lifted2261, aliases : array2263, examples : array2266, deprecated : lifted2269, role : lifted2272}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array2273) + } + 16 => { + + let array2276 : Array[String] = []; + for index2277 = 0; index2277 < (mbt_ffi_load32((iter_base) + 12)); index2277 = index2277 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2277 * 8) + + let result2275 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2276.push(result2275) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array2276) + } + 17 => { + + let array2279 : Array[String] = []; + for index2280 = 0; index2280 < (mbt_ffi_load32((iter_base) + 12)); index2280 = index2280 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2280 * 8) + + let result2278 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2279.push(result2278) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array2279) + } + 18 => { + + let array2281 : Array[Int] = []; + for index2282 = 0; index2282 < (mbt_ffi_load32((iter_base) + 12)); index2282 = index2282 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2282 * 4) + + array2281.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array2281) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted2283 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2284 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted2283, err : lifted2284}) + } + 24 => { + + let lifted2288 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2286 : Array[String] = []; + for index2287 = 0; index2287 < (mbt_ffi_load32((iter_base) + 16)); index2287 = index2287 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2287 * 8) + + let result2285 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2286.push(result2285) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2286) + } + _ => panic() + } + + let lifted2289 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2290 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2292 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2291 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2291) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted2288, min_length : lifted2289, max_length : lifted2290, regex : lifted2292}) + } + 25 => { + + let lifted2296 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2294 : Array[String] = []; + for index2295 = 0; index2295 < (mbt_ffi_load32((iter_base) + 16)); index2295 = index2295 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2295 * 8) + + let result2293 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2294.push(result2293) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2294) + } + _ => panic() + } + + let lifted2297 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2298 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted2296, min_bytes : lifted2297, max_bytes : lifted2298}) + } + 26 => { + + let lifted2302 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array2300 : Array[String] = []; + for index2301 = 0; index2301 < (mbt_ffi_load32((iter_base) + 20)); index2301 = index2301 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2301 * 8) + + let result2299 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2300.push(result2299) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array2300) + } + _ => panic() + } + + let lifted2306 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array2304 : Array[String] = []; + for index2305 = 0; index2305 < (mbt_ffi_load32((iter_base) + 32)); index2305 = index2305 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2305 * 8) + + let result2303 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2304.push(result2303) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array2304) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted2302, allowed_extensions : lifted2306}) + } + 27 => { + + let lifted2310 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2308 : Array[String] = []; + for index2309 = 0; index2309 < (mbt_ffi_load32((iter_base) + 16)); index2309 = index2309 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2309 * 8) + + let result2307 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2308.push(result2307) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2308) + } + _ => panic() + } + + let lifted2314 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array2312 : Array[String] = []; + for index2313 = 0; index2313 < (mbt_ffi_load32((iter_base) + 28)); index2313 = index2313 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2313 * 8) + + let result2311 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2312.push(result2311) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array2312) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted2310, allowed_hosts : lifted2314}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result2315 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array2317 : Array[String] = []; + for index2318 = 0; index2318 < (mbt_ffi_load32((iter_base) + 20)); index2318 = index2318 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2318 * 8) + + let result2316 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2317.push(result2316) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted2320 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2319 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result2319}) + } + _ => panic() + } + + let lifted2322 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result2321 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result2321}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result2315, allowed_suffixes : array2317, min : lifted2320, max : lifted2322}) + } + 31 => { + + let array2346 : Array[@types.UnionBranch] = []; + for index2347 = 0; index2347 < (mbt_ffi_load32((iter_base) + 12)); index2347 = index2347 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2347 * 92) + + let result2323 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2332 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result2324 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result2324) + } + 1 => { + + let result2325 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result2325) + } + 2 => { + + let result2326 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result2326) + } + 3 => { + + let result2327 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result2327) + } + 4 => { + + let result2328 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted2330 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2329 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result2329) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result2328, literal : lifted2330}) + } + 5 => { + + let result2331 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result2331) + } + _ => panic() + } + + let lifted2334 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2333 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2333) + } + _ => panic() + } + + let array2336 : Array[String] = []; + for index2337 = 0; index2337 < (mbt_ffi_load32((iter_base) + 52)); index2337 = index2337 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2337 * 8) + + let result2335 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2336.push(result2335) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array2339 : Array[String] = []; + for index2340 = 0; index2340 < (mbt_ffi_load32((iter_base) + 60)); index2340 = index2340 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2340 * 8) + + let result2338 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2339.push(result2338) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted2342 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2341 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2341) + } + _ => panic() + } + + let lifted2345 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted2344 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2343 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result2343) + } + _ => panic() + } + + Option::Some(lifted2344) + } + _ => panic() + } + + array2346.push(@types.UnionBranch::{tag : result2323, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted2332, metadata : @types.MetadataEnvelope::{doc : lifted2334, aliases : array2336, examples : array2339, deprecated : lifted2342, role : lifted2345}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array2346}) + } + 32 => { + + let lifted2349 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2348 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2348) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted2349}) + } + 33 => { + + let lifted2351 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2350 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2350) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted2351}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted2352 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted2352) + } + 36 => { + + let lifted2353 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted2353) + } + _ => panic() + } + + let lifted2356 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result2355 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result2355) + } + _ => panic() + } + + let array2358 : Array[String] = []; + for index2359 = 0; index2359 < (mbt_ffi_load32((iter_base) + 104)); index2359 = index2359 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index2359 * 8) + + let result2357 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2358.push(result2357) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array2361 : Array[String] = []; + for index2362 = 0; index2362 < (mbt_ffi_load32((iter_base) + 112)); index2362 = index2362 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index2362 * 8) + + let result2360 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2361.push(result2360) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted2364 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result2363 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result2363) + } + _ => panic() + } + + let lifted2367 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted2366 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2365 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result2365) + } + _ => panic() + } + + Option::Some(lifted2366) + } + _ => panic() + } + + array2368.push(@types.SchemaTypeNode::{body : lifted2354, metadata : @types.MetadataEnvelope::{doc : lifted2356, aliases : array2358, examples : array2361, deprecated : lifted2364, role : lifted2367}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array2373 : Array[@types.SchemaTypeDef] = []; + for index2374 = 0; index2374 < (mbt_ffi_load32((iter_base) + 40)); index2374 = index2374 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2374 * 24) + + let result2370 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2372 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2371 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2371) + } + _ => panic() + } + + array2373.push(@types.SchemaTypeDef::{id : result2370, name : lifted2372, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let array2404 : Array[@types.SchemaValueNode] = []; + for index2405 = 0; index2405 < (mbt_ffi_load32((iter_base) + 52)); index2405 = index2405 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2405 * 32) + + let lifted2403 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result2375 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result2375) + } + 13 => { + + let array2376 : Array[Int] = []; + for index2377 = 0; index2377 < (mbt_ffi_load32((iter_base) + 12)); index2377 = index2377 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2377 * 4) + + array2376.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array2376) + } + 14 => { + + let lifted2378 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted2378}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array2379 : Array[Bool] = []; + for index2380 = 0; index2380 < (mbt_ffi_load32((iter_base) + 12)); index2380 = index2380 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2380 * 1) + + array2379.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array2379) + } + 17 => { + + let array2381 : Array[Int] = []; + for index2382 = 0; index2382 < (mbt_ffi_load32((iter_base) + 12)); index2382 = index2382 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2382 * 4) + + array2381.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array2381) + } + 18 => { + + let array2383 : Array[Int] = []; + for index2384 = 0; index2384 < (mbt_ffi_load32((iter_base) + 12)); index2384 = index2384 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2384 * 4) + + array2383.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array2383) + } + 19 => { + + let array2385 : Array[Int] = []; + for index2386 = 0; index2386 < (mbt_ffi_load32((iter_base) + 12)); index2386 = index2386 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2386 * 4) + + array2385.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array2385) + } + 20 => { + + let array2387 : Array[@types.MapEntry] = []; + for index2388 = 0; index2388 < (mbt_ffi_load32((iter_base) + 12)); index2388 = index2388 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2388 * 8) + + array2387.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array2387) + } + 21 => { + + let lifted2389 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted2389) + } + 22 => { + + let lifted2392 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted2390 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted2390) + } + 1 => { + + let lifted2391 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted2391) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted2392) + } + 23 => { + + let result2393 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2395 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2394 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2394) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result2393, language : lifted2395}) + } + 24 => { + + let result2396 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2398 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2397 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2397) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result2396, mime_type : lifted2398}) + } + 25 => { + + let result2399 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result2399) + } + 26 => { + + let result2400 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result2400) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result2401 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result2401}) + } + 30 => { + + let result2402 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result2402, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array2404.push(lifted2403) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + AgentInvocationResult::AgentMethod(AgentInvocationOutputParameters::{output : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array2368, defs : array2373, root : mbt_ffi_load32((iter_base) + 44)}, value : @types.SchemaValueTree::{value_nodes : array2404, root : mbt_ffi_load32((iter_base) + 56)}}}) + } + 2 => { + + AgentInvocationResult::ManualUpdate + } + 3 => { + + let lifted2407 : String? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + let result2406 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + Option::Some(result2406) + } + _ => panic() + } + + AgentInvocationResult::LoadSnapshot(FallibleResultParameters::{error : lifted2407}) + } + 4 => { + + let result2408 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + let result2409 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + AgentInvocationResult::SaveSnapshot(SaveSnapshotResultParameters::{snapshot : SnapshotData::{data : result2408, mime_type : result2409}}) + } + 5 => { + + let lifted2411 : String? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + let result2410 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + Option::Some(result2410) + } + _ => panic() + } + + AgentInvocationResult::ProcessOplogEntries(FallibleResultParameters::{error : lifted2411}) + } + _ => panic() + } + + let lifted2414 : String? = match mbt_ffi_load8_u((iter_base) + 60) { + 0 => Option::None + 1 => { + + let result2413 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + Option::Some(result2413) + } + _ => panic() + } + + PublicOplogEntry::AgentInvocationFinished(AgentInvocationFinishedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, result : lifted2412, method_name : lifted2414, consumed_fuel : mbt_ffi_load64((iter_base) + 72), component_revision : (mbt_ffi_load64((iter_base) + 80)).reinterpret_as_uint64()}) + } + 6 => { + + PublicOplogEntry::Suspend(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}}) + } + 7 => { + + let result2415 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let lifted2419 : RetryPolicyState? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let array2417 : Array[StateNode] = []; + for index2418 = 0; index2418 < (mbt_ffi_load32((iter_base) + 52)); index2418 = index2418 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2418 * 16) + + let lifted2416 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + StateNode::Counter((mbt_ffi_load32((iter_base) + 4)).reinterpret_as_uint()) + } + 1 => { + + StateNode::Terminal + } + 2 => { + + StateNode::Wrapper(mbt_ffi_load32((iter_base) + 4)) + } + 3 => { + + StateNode::CountBox(CountBoxState::{attempts : (mbt_ffi_load32((iter_base) + 4)).reinterpret_as_uint(), inner : mbt_ffi_load32((iter_base) + 8)}) + } + 4 => { + + StateNode::AndThen(AndThenState::{left : mbt_ffi_load32((iter_base) + 4), right : mbt_ffi_load32((iter_base) + 8), on_right : (mbt_ffi_load8_u((iter_base) + 12) != 0)}) + } + 5 => { + + StateNode::Pair(PairState::{left : mbt_ffi_load32((iter_base) + 4), right : mbt_ffi_load32((iter_base) + 8)}) + } + _ => panic() + } + + array2417.push(lifted2416) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + Option::Some(RetryPolicyState::{nodes : array2417}) + } + _ => panic() + } + + PublicOplogEntry::Error(ErrorParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, error : result2415, retry_from : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), inside_atomic_region : (mbt_ffi_load8_u((iter_base) + 40) != 0), retry_policy_state : lifted2419}) + } + 8 => { + + PublicOplogEntry::NoOp(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}}) + } + 9 => { + + PublicOplogEntry::Jump(JumpParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, jump : OplogRegion::{start : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), end : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}) + } + 10 => { + + PublicOplogEntry::Interrupted(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}}) + } + 11 => { + + PublicOplogEntry::Exited(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}}) + } + 12 => { + + PublicOplogEntry::BeginAtomicRegion(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}}) + } + 13 => { + + PublicOplogEntry::EndAtomicRegion(EndAtomicRegionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + 14 => { + + let lifted2932 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + let result2420 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let array2617 : Array[@types.SchemaTypeNode] = []; + for index2618 = 0; index2618 < (mbt_ffi_load32((iter_base) + 44)); index2618 = index2618 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index2618 * 144) + + let lifted2603 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted2427 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2422 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2421 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2421) + } + _ => panic() + } + + let lifted2424 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2423 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2423) + } + _ => panic() + } + + let lifted2426 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2425 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2425) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2422, max : lifted2424, unit : lifted2426}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted2427) + } + 3 => { + + let lifted2434 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2429 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2428 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2428) + } + _ => panic() + } + + let lifted2431 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2430 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2430) + } + _ => panic() + } + + let lifted2433 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2432 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2432) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2429, max : lifted2431, unit : lifted2433}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted2434) + } + 4 => { + + let lifted2441 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2436 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2435 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2435) + } + _ => panic() + } + + let lifted2438 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2437 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2437) + } + _ => panic() + } + + let lifted2440 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2439 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2439) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2436, max : lifted2438, unit : lifted2440}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted2441) + } + 5 => { + + let lifted2448 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2443 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2442 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2442) + } + _ => panic() + } + + let lifted2445 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2444 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2444) + } + _ => panic() + } + + let lifted2447 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2446 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2446) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2443, max : lifted2445, unit : lifted2447}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted2448) + } + 6 => { + + let lifted2455 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2450 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2449 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2449) + } + _ => panic() + } + + let lifted2452 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2451 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2451) + } + _ => panic() + } + + let lifted2454 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2453 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2453) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2450, max : lifted2452, unit : lifted2454}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted2455) + } + 7 => { + + let lifted2462 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2457 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2456 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2456) + } + _ => panic() + } + + let lifted2459 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2458 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2458) + } + _ => panic() + } + + let lifted2461 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2460 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2460) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2457, max : lifted2459, unit : lifted2461}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted2462) + } + 8 => { + + let lifted2469 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2464 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2463 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2463) + } + _ => panic() + } + + let lifted2466 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2465 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2465) + } + _ => panic() + } + + let lifted2468 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2467 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2467) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2464, max : lifted2466, unit : lifted2468}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted2469) + } + 9 => { + + let lifted2476 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2471 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2470 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2470) + } + _ => panic() + } + + let lifted2473 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2472 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2472) + } + _ => panic() + } + + let lifted2475 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2474 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2474) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2471, max : lifted2473, unit : lifted2475}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted2476) + } + 10 => { + + let lifted2483 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2478 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2477 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2477) + } + _ => panic() + } + + let lifted2480 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2479 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2479) + } + _ => panic() + } + + let lifted2482 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2481 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2481) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2478, max : lifted2480, unit : lifted2482}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted2483) + } + 11 => { + + let lifted2490 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2485 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2484 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2484) + } + _ => panic() + } + + let lifted2487 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2486 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2486) + } + _ => panic() + } + + let lifted2489 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2488 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2488) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2485, max : lifted2487, unit : lifted2489}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted2490) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array2505 : Array[@types.NamedFieldType] = []; + for index2506 = 0; index2506 < (mbt_ffi_load32((iter_base) + 12)); index2506 = index2506 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2506 * 68) + + let result2491 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2493 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2492 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2492) + } + _ => panic() + } + + let array2495 : Array[String] = []; + for index2496 = 0; index2496 < (mbt_ffi_load32((iter_base) + 28)); index2496 = index2496 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2496 * 8) + + let result2494 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2495.push(result2494) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array2498 : Array[String] = []; + for index2499 = 0; index2499 < (mbt_ffi_load32((iter_base) + 36)); index2499 = index2499 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index2499 * 8) + + let result2497 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2498.push(result2497) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted2501 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result2500 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result2500) + } + _ => panic() + } + + let lifted2504 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted2503 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2502 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result2502) + } + _ => panic() + } + + Option::Some(lifted2503) + } + _ => panic() + } + + array2505.push(@types.NamedFieldType::{name : result2491, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted2493, aliases : array2495, examples : array2498, deprecated : lifted2501, role : lifted2504}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array2505) + } + 15 => { + + let array2522 : Array[@types.VariantCaseType] = []; + for index2523 = 0; index2523 < (mbt_ffi_load32((iter_base) + 12)); index2523 = index2523 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2523 * 72) + + let result2507 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2508 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2510 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2509 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2509) + } + _ => panic() + } + + let array2512 : Array[String] = []; + for index2513 = 0; index2513 < (mbt_ffi_load32((iter_base) + 32)); index2513 = index2513 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2513 * 8) + + let result2511 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2512.push(result2511) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array2515 : Array[String] = []; + for index2516 = 0; index2516 < (mbt_ffi_load32((iter_base) + 40)); index2516 = index2516 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2516 * 8) + + let result2514 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2515.push(result2514) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted2518 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result2517 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result2517) + } + _ => panic() + } + + let lifted2521 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted2520 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2519 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result2519) + } + _ => panic() + } + + Option::Some(lifted2520) + } + _ => panic() + } + + array2522.push(@types.VariantCaseType::{name : result2507, payload : lifted2508, metadata : @types.MetadataEnvelope::{doc : lifted2510, aliases : array2512, examples : array2515, deprecated : lifted2518, role : lifted2521}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array2522) + } + 16 => { + + let array2525 : Array[String] = []; + for index2526 = 0; index2526 < (mbt_ffi_load32((iter_base) + 12)); index2526 = index2526 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2526 * 8) + + let result2524 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2525.push(result2524) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array2525) + } + 17 => { + + let array2528 : Array[String] = []; + for index2529 = 0; index2529 < (mbt_ffi_load32((iter_base) + 12)); index2529 = index2529 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2529 * 8) + + let result2527 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2528.push(result2527) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array2528) + } + 18 => { + + let array2530 : Array[Int] = []; + for index2531 = 0; index2531 < (mbt_ffi_load32((iter_base) + 12)); index2531 = index2531 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2531 * 4) + + array2530.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array2530) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted2532 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2533 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted2532, err : lifted2533}) + } + 24 => { + + let lifted2537 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2535 : Array[String] = []; + for index2536 = 0; index2536 < (mbt_ffi_load32((iter_base) + 16)); index2536 = index2536 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2536 * 8) + + let result2534 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2535.push(result2534) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2535) + } + _ => panic() + } + + let lifted2538 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2539 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2541 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2540 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2540) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted2537, min_length : lifted2538, max_length : lifted2539, regex : lifted2541}) + } + 25 => { + + let lifted2545 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2543 : Array[String] = []; + for index2544 = 0; index2544 < (mbt_ffi_load32((iter_base) + 16)); index2544 = index2544 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2544 * 8) + + let result2542 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2543.push(result2542) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2543) + } + _ => panic() + } + + let lifted2546 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2547 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted2545, min_bytes : lifted2546, max_bytes : lifted2547}) + } + 26 => { + + let lifted2551 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array2549 : Array[String] = []; + for index2550 = 0; index2550 < (mbt_ffi_load32((iter_base) + 20)); index2550 = index2550 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2550 * 8) + + let result2548 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2549.push(result2548) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array2549) + } + _ => panic() + } + + let lifted2555 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array2553 : Array[String] = []; + for index2554 = 0; index2554 < (mbt_ffi_load32((iter_base) + 32)); index2554 = index2554 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2554 * 8) + + let result2552 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2553.push(result2552) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array2553) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted2551, allowed_extensions : lifted2555}) + } + 27 => { + + let lifted2559 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2557 : Array[String] = []; + for index2558 = 0; index2558 < (mbt_ffi_load32((iter_base) + 16)); index2558 = index2558 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2558 * 8) + + let result2556 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2557.push(result2556) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2557) + } + _ => panic() + } + + let lifted2563 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array2561 : Array[String] = []; + for index2562 = 0; index2562 < (mbt_ffi_load32((iter_base) + 28)); index2562 = index2562 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2562 * 8) + + let result2560 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2561.push(result2560) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array2561) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted2559, allowed_hosts : lifted2563}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result2564 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array2566 : Array[String] = []; + for index2567 = 0; index2567 < (mbt_ffi_load32((iter_base) + 20)); index2567 = index2567 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2567 * 8) + + let result2565 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2566.push(result2565) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted2569 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2568 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result2568}) + } + _ => panic() + } + + let lifted2571 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result2570 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result2570}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result2564, allowed_suffixes : array2566, min : lifted2569, max : lifted2571}) + } + 31 => { + + let array2595 : Array[@types.UnionBranch] = []; + for index2596 = 0; index2596 < (mbt_ffi_load32((iter_base) + 12)); index2596 = index2596 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2596 * 92) + + let result2572 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2581 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result2573 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result2573) + } + 1 => { + + let result2574 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result2574) + } + 2 => { + + let result2575 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result2575) + } + 3 => { + + let result2576 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result2576) + } + 4 => { + + let result2577 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted2579 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2578 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result2578) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result2577, literal : lifted2579}) + } + 5 => { + + let result2580 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result2580) + } + _ => panic() + } + + let lifted2583 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2582 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2582) + } + _ => panic() + } + + let array2585 : Array[String] = []; + for index2586 = 0; index2586 < (mbt_ffi_load32((iter_base) + 52)); index2586 = index2586 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2586 * 8) + + let result2584 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2585.push(result2584) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array2588 : Array[String] = []; + for index2589 = 0; index2589 < (mbt_ffi_load32((iter_base) + 60)); index2589 = index2589 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2589 * 8) + + let result2587 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2588.push(result2587) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted2591 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2590 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2590) + } + _ => panic() + } + + let lifted2594 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted2593 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2592 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result2592) + } + _ => panic() + } + + Option::Some(lifted2593) + } + _ => panic() + } + + array2595.push(@types.UnionBranch::{tag : result2572, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted2581, metadata : @types.MetadataEnvelope::{doc : lifted2583, aliases : array2585, examples : array2588, deprecated : lifted2591, role : lifted2594}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array2595}) + } + 32 => { + + let lifted2598 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2597 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2597) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted2598}) + } + 33 => { + + let lifted2600 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2599 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2599) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted2600}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted2601 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted2601) + } + 36 => { + + let lifted2602 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted2602) + } + _ => panic() + } + + let lifted2605 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result2604 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result2604) + } + _ => panic() + } + + let array2607 : Array[String] = []; + for index2608 = 0; index2608 < (mbt_ffi_load32((iter_base) + 104)); index2608 = index2608 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index2608 * 8) + + let result2606 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2607.push(result2606) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array2610 : Array[String] = []; + for index2611 = 0; index2611 < (mbt_ffi_load32((iter_base) + 112)); index2611 = index2611 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index2611 * 8) + + let result2609 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2610.push(result2609) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted2613 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result2612 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result2612) + } + _ => panic() + } + + let lifted2616 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted2615 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2614 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result2614) + } + _ => panic() + } + + Option::Some(lifted2615) + } + _ => panic() + } + + array2617.push(@types.SchemaTypeNode::{body : lifted2603, metadata : @types.MetadataEnvelope::{doc : lifted2605, aliases : array2607, examples : array2610, deprecated : lifted2613, role : lifted2616}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let array2622 : Array[@types.SchemaTypeDef] = []; + for index2623 = 0; index2623 < (mbt_ffi_load32((iter_base) + 52)); index2623 = index2623 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2623 * 24) + + let result2619 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2621 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2620 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2620) + } + _ => panic() + } + + array2622.push(@types.SchemaTypeDef::{id : result2619, name : lifted2621, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array2653 : Array[@types.SchemaValueNode] = []; + for index2654 = 0; index2654 < (mbt_ffi_load32((iter_base) + 64)); index2654 = index2654 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index2654 * 32) + + let lifted2652 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result2624 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result2624) + } + 13 => { + + let array2625 : Array[Int] = []; + for index2626 = 0; index2626 < (mbt_ffi_load32((iter_base) + 12)); index2626 = index2626 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2626 * 4) + + array2625.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array2625) + } + 14 => { + + let lifted2627 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted2627}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array2628 : Array[Bool] = []; + for index2629 = 0; index2629 < (mbt_ffi_load32((iter_base) + 12)); index2629 = index2629 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2629 * 1) + + array2628.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array2628) + } + 17 => { + + let array2630 : Array[Int] = []; + for index2631 = 0; index2631 < (mbt_ffi_load32((iter_base) + 12)); index2631 = index2631 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2631 * 4) + + array2630.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array2630) + } + 18 => { + + let array2632 : Array[Int] = []; + for index2633 = 0; index2633 < (mbt_ffi_load32((iter_base) + 12)); index2633 = index2633 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2633 * 4) + + array2632.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array2632) + } + 19 => { + + let array2634 : Array[Int] = []; + for index2635 = 0; index2635 < (mbt_ffi_load32((iter_base) + 12)); index2635 = index2635 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2635 * 4) + + array2634.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array2634) + } + 20 => { + + let array2636 : Array[@types.MapEntry] = []; + for index2637 = 0; index2637 < (mbt_ffi_load32((iter_base) + 12)); index2637 = index2637 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2637 * 8) + + array2636.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array2636) + } + 21 => { + + let lifted2638 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted2638) + } + 22 => { + + let lifted2641 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted2639 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted2639) + } + 1 => { + + let lifted2640 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted2640) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted2641) + } + 23 => { + + let result2642 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2644 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2643 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2643) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result2642, language : lifted2644}) + } + 24 => { + + let result2645 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2647 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2646 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2646) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result2645, mime_type : lifted2647}) + } + 25 => { + + let result2648 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result2648) + } + 26 => { + + let result2649 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result2649) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result2650 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result2650}) + } + 30 => { + + let result2651 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result2651, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array2653.push(lifted2652) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + let result2655 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 72), mbt_ffi_load32((iter_base) + 76)) + + let array2657 : Array[String] = []; + for index2658 = 0; index2658 < (mbt_ffi_load32((iter_base) + 84)); index2658 = index2658 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 80)) + (index2658 * 8) + + let result2656 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2657.push(result2656) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 80)) + + let array2672 : Array[Array[SpanData]] = []; + for index2673 = 0; index2673 < (mbt_ffi_load32((iter_base) + 92)); index2673 = index2673 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 88)) + (index2673 * 8) + + let array2670 : Array[SpanData] = []; + for index2671 = 0; index2671 < (mbt_ffi_load32((iter_base) + 4)); index2671 = index2671 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index2671 * 80) + + let lifted2669 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result2659 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2661 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result2660 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result2660) + } + _ => panic() + } + + let lifted2662 : UInt64? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + let array2666 : Array[@context.Attribute] = []; + for index2667 = 0; index2667 < (mbt_ffi_load32((iter_base) + 68)); index2667 = index2667 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index2667 * 20) + + let result2663 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2665 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result2664 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + @context.AttributeValue::String(result2664) + } + _ => panic() + } + + array2666.push(@context.Attribute::{key : result2663, value : lifted2665}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + SpanData::LocalSpan(LocalSpanData::{span_id : result2659, start : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent : lifted2661, linked_context : lifted2662, attributes : array2666, inherited : (mbt_ffi_load8_u((iter_base) + 72) != 0)}) + } + 1 => { + + let result2668 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + SpanData::ExternalSpan(ExternalSpanData::{span_id : result2668}) + } + _ => panic() + } + + array2670.push(lifted2669) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array2672.push(array2670) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + + AgentInvocation::AgentInitialization(AgentInitializationParameters::{idempotency_key : result2420, constructor_parameters : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array2617, defs : array2622, root : mbt_ffi_load32((iter_base) + 56)}, value : @types.SchemaValueTree::{value_nodes : array2653, root : mbt_ffi_load32((iter_base) + 68)}}, trace_id : result2655, trace_states : array2657, invocation_context : array2672}) + } + 1 => { + + let result2674 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let result2675 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + let array2872 : Array[@types.SchemaTypeNode] = []; + for index2873 = 0; index2873 < (mbt_ffi_load32((iter_base) + 52)); index2873 = index2873 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2873 * 144) + + let lifted2858 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted2682 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2677 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2676 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2676) + } + _ => panic() + } + + let lifted2679 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2678 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2678) + } + _ => panic() + } + + let lifted2681 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2680 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2680) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2677, max : lifted2679, unit : lifted2681}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted2682) + } + 3 => { + + let lifted2689 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2684 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2683 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2683) + } + _ => panic() + } + + let lifted2686 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2685 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2685) + } + _ => panic() + } + + let lifted2688 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2687 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2687) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2684, max : lifted2686, unit : lifted2688}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted2689) + } + 4 => { + + let lifted2696 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2691 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2690 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2690) + } + _ => panic() + } + + let lifted2693 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2692 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2692) + } + _ => panic() + } + + let lifted2695 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2694 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2694) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2691, max : lifted2693, unit : lifted2695}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted2696) + } + 5 => { + + let lifted2703 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2698 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2697 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2697) + } + _ => panic() + } + + let lifted2700 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2699 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2699) + } + _ => panic() + } + + let lifted2702 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2701 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2701) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2698, max : lifted2700, unit : lifted2702}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted2703) + } + 6 => { + + let lifted2710 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2705 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2704 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2704) + } + _ => panic() + } + + let lifted2707 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2706 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2706) + } + _ => panic() + } + + let lifted2709 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2708 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2708) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2705, max : lifted2707, unit : lifted2709}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted2710) + } + 7 => { + + let lifted2717 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2712 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2711 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2711) + } + _ => panic() + } + + let lifted2714 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2713 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2713) + } + _ => panic() + } + + let lifted2716 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2715 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2715) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2712, max : lifted2714, unit : lifted2716}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted2717) + } + 8 => { + + let lifted2724 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2719 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2718 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2718) + } + _ => panic() + } + + let lifted2721 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2720 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2720) + } + _ => panic() + } + + let lifted2723 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2722 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2722) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2719, max : lifted2721, unit : lifted2723}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted2724) + } + 9 => { + + let lifted2731 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2726 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2725 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2725) + } + _ => panic() + } + + let lifted2728 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2727 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2727) + } + _ => panic() + } + + let lifted2730 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2729 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2729) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2726, max : lifted2728, unit : lifted2730}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted2731) + } + 10 => { + + let lifted2738 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2733 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2732 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2732) + } + _ => panic() + } + + let lifted2735 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2734 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2734) + } + _ => panic() + } + + let lifted2737 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2736 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2736) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2733, max : lifted2735, unit : lifted2737}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted2738) + } + 11 => { + + let lifted2745 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2740 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2739 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2739) + } + _ => panic() + } + + let lifted2742 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2741 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2741) + } + _ => panic() + } + + let lifted2744 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2743 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2743) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2740, max : lifted2742, unit : lifted2744}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted2745) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array2760 : Array[@types.NamedFieldType] = []; + for index2761 = 0; index2761 < (mbt_ffi_load32((iter_base) + 12)); index2761 = index2761 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2761 * 68) + + let result2746 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2748 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2747 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2747) + } + _ => panic() + } + + let array2750 : Array[String] = []; + for index2751 = 0; index2751 < (mbt_ffi_load32((iter_base) + 28)); index2751 = index2751 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2751 * 8) + + let result2749 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2750.push(result2749) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array2753 : Array[String] = []; + for index2754 = 0; index2754 < (mbt_ffi_load32((iter_base) + 36)); index2754 = index2754 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index2754 * 8) + + let result2752 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2753.push(result2752) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted2756 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result2755 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result2755) + } + _ => panic() + } + + let lifted2759 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted2758 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2757 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result2757) + } + _ => panic() + } + + Option::Some(lifted2758) + } + _ => panic() + } + + array2760.push(@types.NamedFieldType::{name : result2746, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted2748, aliases : array2750, examples : array2753, deprecated : lifted2756, role : lifted2759}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array2760) + } + 15 => { + + let array2777 : Array[@types.VariantCaseType] = []; + for index2778 = 0; index2778 < (mbt_ffi_load32((iter_base) + 12)); index2778 = index2778 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2778 * 72) + + let result2762 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2763 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2765 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2764 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2764) + } + _ => panic() + } + + let array2767 : Array[String] = []; + for index2768 = 0; index2768 < (mbt_ffi_load32((iter_base) + 32)); index2768 = index2768 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2768 * 8) + + let result2766 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2767.push(result2766) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array2770 : Array[String] = []; + for index2771 = 0; index2771 < (mbt_ffi_load32((iter_base) + 40)); index2771 = index2771 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2771 * 8) + + let result2769 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2770.push(result2769) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted2773 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result2772 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result2772) + } + _ => panic() + } + + let lifted2776 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted2775 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2774 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result2774) + } + _ => panic() + } + + Option::Some(lifted2775) + } + _ => panic() + } + + array2777.push(@types.VariantCaseType::{name : result2762, payload : lifted2763, metadata : @types.MetadataEnvelope::{doc : lifted2765, aliases : array2767, examples : array2770, deprecated : lifted2773, role : lifted2776}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array2777) + } + 16 => { + + let array2780 : Array[String] = []; + for index2781 = 0; index2781 < (mbt_ffi_load32((iter_base) + 12)); index2781 = index2781 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2781 * 8) + + let result2779 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2780.push(result2779) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array2780) + } + 17 => { + + let array2783 : Array[String] = []; + for index2784 = 0; index2784 < (mbt_ffi_load32((iter_base) + 12)); index2784 = index2784 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2784 * 8) + + let result2782 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2783.push(result2782) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array2783) + } + 18 => { + + let array2785 : Array[Int] = []; + for index2786 = 0; index2786 < (mbt_ffi_load32((iter_base) + 12)); index2786 = index2786 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2786 * 4) + + array2785.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array2785) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted2787 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2788 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted2787, err : lifted2788}) + } + 24 => { + + let lifted2792 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2790 : Array[String] = []; + for index2791 = 0; index2791 < (mbt_ffi_load32((iter_base) + 16)); index2791 = index2791 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2791 * 8) + + let result2789 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2790.push(result2789) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2790) + } + _ => panic() + } + + let lifted2793 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2794 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2796 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2795 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2795) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted2792, min_length : lifted2793, max_length : lifted2794, regex : lifted2796}) + } + 25 => { + + let lifted2800 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2798 : Array[String] = []; + for index2799 = 0; index2799 < (mbt_ffi_load32((iter_base) + 16)); index2799 = index2799 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2799 * 8) + + let result2797 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2798.push(result2797) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2798) + } + _ => panic() + } + + let lifted2801 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2802 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted2800, min_bytes : lifted2801, max_bytes : lifted2802}) + } + 26 => { + + let lifted2806 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array2804 : Array[String] = []; + for index2805 = 0; index2805 < (mbt_ffi_load32((iter_base) + 20)); index2805 = index2805 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2805 * 8) + + let result2803 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2804.push(result2803) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array2804) + } + _ => panic() + } + + let lifted2810 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array2808 : Array[String] = []; + for index2809 = 0; index2809 < (mbt_ffi_load32((iter_base) + 32)); index2809 = index2809 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2809 * 8) + + let result2807 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2808.push(result2807) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array2808) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted2806, allowed_extensions : lifted2810}) + } + 27 => { + + let lifted2814 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2812 : Array[String] = []; + for index2813 = 0; index2813 < (mbt_ffi_load32((iter_base) + 16)); index2813 = index2813 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2813 * 8) + + let result2811 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2812.push(result2811) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2812) + } + _ => panic() + } + + let lifted2818 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array2816 : Array[String] = []; + for index2817 = 0; index2817 < (mbt_ffi_load32((iter_base) + 28)); index2817 = index2817 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2817 * 8) + + let result2815 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2816.push(result2815) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array2816) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted2814, allowed_hosts : lifted2818}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result2819 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array2821 : Array[String] = []; + for index2822 = 0; index2822 < (mbt_ffi_load32((iter_base) + 20)); index2822 = index2822 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2822 * 8) + + let result2820 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2821.push(result2820) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted2824 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2823 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result2823}) + } + _ => panic() + } + + let lifted2826 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result2825 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result2825}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result2819, allowed_suffixes : array2821, min : lifted2824, max : lifted2826}) + } + 31 => { + + let array2850 : Array[@types.UnionBranch] = []; + for index2851 = 0; index2851 < (mbt_ffi_load32((iter_base) + 12)); index2851 = index2851 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2851 * 92) + + let result2827 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2836 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result2828 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result2828) + } + 1 => { + + let result2829 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result2829) + } + 2 => { + + let result2830 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result2830) + } + 3 => { + + let result2831 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result2831) + } + 4 => { + + let result2832 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted2834 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2833 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result2833) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result2832, literal : lifted2834}) + } + 5 => { + + let result2835 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result2835) + } + _ => panic() + } + + let lifted2838 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2837 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2837) + } + _ => panic() + } + + let array2840 : Array[String] = []; + for index2841 = 0; index2841 < (mbt_ffi_load32((iter_base) + 52)); index2841 = index2841 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2841 * 8) + + let result2839 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2840.push(result2839) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array2843 : Array[String] = []; + for index2844 = 0; index2844 < (mbt_ffi_load32((iter_base) + 60)); index2844 = index2844 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2844 * 8) + + let result2842 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2843.push(result2842) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted2846 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2845 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2845) + } + _ => panic() + } + + let lifted2849 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted2848 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2847 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result2847) + } + _ => panic() + } + + Option::Some(lifted2848) + } + _ => panic() + } + + array2850.push(@types.UnionBranch::{tag : result2827, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted2836, metadata : @types.MetadataEnvelope::{doc : lifted2838, aliases : array2840, examples : array2843, deprecated : lifted2846, role : lifted2849}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array2850}) + } + 32 => { + + let lifted2853 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2852 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2852) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted2853}) + } + 33 => { + + let lifted2855 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2854 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2854) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted2855}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted2856 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted2856) + } + 36 => { + + let lifted2857 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted2857) + } + _ => panic() + } + + let lifted2860 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result2859 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result2859) + } + _ => panic() + } + + let array2862 : Array[String] = []; + for index2863 = 0; index2863 < (mbt_ffi_load32((iter_base) + 104)); index2863 = index2863 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index2863 * 8) + + let result2861 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2862.push(result2861) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array2865 : Array[String] = []; + for index2866 = 0; index2866 < (mbt_ffi_load32((iter_base) + 112)); index2866 = index2866 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index2866 * 8) + + let result2864 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2865.push(result2864) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted2868 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result2867 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result2867) + } + _ => panic() + } + + let lifted2871 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted2870 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2869 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result2869) + } + _ => panic() + } + + Option::Some(lifted2870) + } + _ => panic() + } + + array2872.push(@types.SchemaTypeNode::{body : lifted2858, metadata : @types.MetadataEnvelope::{doc : lifted2860, aliases : array2862, examples : array2865, deprecated : lifted2868, role : lifted2871}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array2877 : Array[@types.SchemaTypeDef] = []; + for index2878 = 0; index2878 < (mbt_ffi_load32((iter_base) + 60)); index2878 = index2878 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2878 * 24) + + let result2874 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2876 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2875 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2875) + } + _ => panic() + } + + array2877.push(@types.SchemaTypeDef::{id : result2874, name : lifted2876, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let array2908 : Array[@types.SchemaValueNode] = []; + for index2909 = 0; index2909 < (mbt_ffi_load32((iter_base) + 72)); index2909 = index2909 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index2909 * 32) + + let lifted2907 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result2879 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result2879) + } + 13 => { + + let array2880 : Array[Int] = []; + for index2881 = 0; index2881 < (mbt_ffi_load32((iter_base) + 12)); index2881 = index2881 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2881 * 4) + + array2880.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array2880) + } + 14 => { + + let lifted2882 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted2882}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array2883 : Array[Bool] = []; + for index2884 = 0; index2884 < (mbt_ffi_load32((iter_base) + 12)); index2884 = index2884 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2884 * 1) + + array2883.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array2883) + } + 17 => { + + let array2885 : Array[Int] = []; + for index2886 = 0; index2886 < (mbt_ffi_load32((iter_base) + 12)); index2886 = index2886 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2886 * 4) + + array2885.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array2885) + } + 18 => { + + let array2887 : Array[Int] = []; + for index2888 = 0; index2888 < (mbt_ffi_load32((iter_base) + 12)); index2888 = index2888 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2888 * 4) + + array2887.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array2887) + } + 19 => { + + let array2889 : Array[Int] = []; + for index2890 = 0; index2890 < (mbt_ffi_load32((iter_base) + 12)); index2890 = index2890 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2890 * 4) + + array2889.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array2889) + } + 20 => { + + let array2891 : Array[@types.MapEntry] = []; + for index2892 = 0; index2892 < (mbt_ffi_load32((iter_base) + 12)); index2892 = index2892 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2892 * 8) + + array2891.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array2891) + } + 21 => { + + let lifted2893 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted2893) + } + 22 => { + + let lifted2896 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted2894 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted2894) + } + 1 => { + + let lifted2895 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted2895) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted2896) + } + 23 => { + + let result2897 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2899 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2898 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2898) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result2897, language : lifted2899}) + } + 24 => { + + let result2900 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2902 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2901 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2901) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result2900, mime_type : lifted2902}) + } + 25 => { + + let result2903 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result2903) + } + 26 => { + + let result2904 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result2904) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result2905 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result2905}) + } + 30 => { + + let result2906 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result2906, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array2908.push(lifted2907) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + let result2910 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 80), mbt_ffi_load32((iter_base) + 84)) + + let array2912 : Array[String] = []; + for index2913 = 0; index2913 < (mbt_ffi_load32((iter_base) + 92)); index2913 = index2913 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 88)) + (index2913 * 8) + + let result2911 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2912.push(result2911) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + + let array2927 : Array[Array[SpanData]] = []; + for index2928 = 0; index2928 < (mbt_ffi_load32((iter_base) + 100)); index2928 = index2928 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 96)) + (index2928 * 8) + + let array2925 : Array[SpanData] = []; + for index2926 = 0; index2926 < (mbt_ffi_load32((iter_base) + 4)); index2926 = index2926 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index2926 * 80) + + let lifted2924 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result2914 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2916 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result2915 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result2915) + } + _ => panic() + } + + let lifted2917 : UInt64? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + let array2921 : Array[@context.Attribute] = []; + for index2922 = 0; index2922 < (mbt_ffi_load32((iter_base) + 68)); index2922 = index2922 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index2922 * 20) + + let result2918 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2920 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result2919 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + @context.AttributeValue::String(result2919) + } + _ => panic() + } + + array2921.push(@context.Attribute::{key : result2918, value : lifted2920}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + SpanData::LocalSpan(LocalSpanData::{span_id : result2914, start : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent : lifted2916, linked_context : lifted2917, attributes : array2921, inherited : (mbt_ffi_load8_u((iter_base) + 72) != 0)}) + } + 1 => { + + let result2923 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + SpanData::ExternalSpan(ExternalSpanData::{span_id : result2923}) + } + _ => panic() + } + + array2925.push(lifted2924) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array2927.push(array2925) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 96)) + + AgentInvocation::AgentMethodInvocation(AgentMethodInvocationParameters::{idempotency_key : result2674, method_name : result2675, function_input : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array2872, defs : array2877, root : mbt_ffi_load32((iter_base) + 64)}, value : @types.SchemaValueTree::{value_nodes : array2908, root : mbt_ffi_load32((iter_base) + 76)}}, trace_id : result2910, trace_states : array2912, invocation_context : array2927}) + } + 2 => { + + AgentInvocation::SaveSnapshot + } + 3 => { + + let result2929 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let result2930 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + AgentInvocation::LoadSnapshot(LoadSnapshotParameters::{snapshot : SnapshotData::{data : result2929, mime_type : result2930}}) + } + 4 => { + + let result2931 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + AgentInvocation::ProcessOplogEntries(ProcessOplogEntriesParameters::{idempotency_key : result2931}) + } + 5 => { + + AgentInvocation::ManualUpdate(ManualUpdateParameters::{target_revision : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}) + } + _ => panic() + } + + PublicOplogEntry::PendingAgentInvocation(PendingAgentInvocationParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, invocation : lifted2932}) + } + 15 => { + + let lifted2935 = match (mbt_ffi_load8_u((iter_base) + 32)) { + 0 => { + + UpdateDescription::AutoUpdate + } + 1 => { + + let result2933 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + let result2934 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + UpdateDescription::SnapshotBased(@host.Snapshot::{payload : result2933, mime_type : result2934}) + } + _ => panic() + } + + PublicOplogEntry::PendingUpdate(PendingUpdateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, target_revision : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), description : lifted2935}) + } + 16 => { + + let array2942 : Array[PluginInstallationDescription] = []; + for index2943 = 0; index2943 < (mbt_ffi_load32((iter_base) + 44)); index2943 = index2943 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index2943 * 48) + + let result2936 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + let result2937 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + let array2940 : Array[(String, String)] = []; + for index2941 = 0; index2941 < (mbt_ffi_load32((iter_base) + 40)); index2941 = index2941 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2941 * 16) + + let result2938 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result2939 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array2940.push((result2938, result2939)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + array2942.push(PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 16), plugin_name : result2936, plugin_version : result2937, parameters : array2940}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + PublicOplogEntry::SuccessfulUpdate(SuccessfulUpdateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, target_revision : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), new_component_size : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), new_active_plugins : array2942}) + } + 17 => { + + let lifted2945 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result2944 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result2944) + } + _ => panic() + } + + PublicOplogEntry::FailedUpdate(FailedUpdateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, target_revision : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), details : lifted2945}) + } + 18 => { + + PublicOplogEntry::GrowMemory(GrowMemoryParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, delta : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + 19 => { + + PublicOplogEntry::FilesystemStorageUsageUpdate(FilesystemStorageUsageUpdateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, delta : mbt_ffi_load64((iter_base) + 24)}) + } + 20 => { + + let result2946 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let result2947 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + PublicOplogEntry::CreateResource(CreateResourceParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, id : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), name : result2946, owner : result2947}) + } + 21 => { + + let result2948 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let result2949 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + PublicOplogEntry::DropResource(DropResourceParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, id : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), name : result2948, owner : result2949}) + } + 22 => { + + let result2950 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + let result2951 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + PublicOplogEntry::Log(LogParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, level : LogLevel::from(mbt_ffi_load8_u((iter_base) + 24)), context : result2950, message : result2951}) + } + 23 => { + + PublicOplogEntry::Restart(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}}) + } + 24 => { + + let result2952 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + let result2953 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) + + let array2956 : Array[(String, String)] = []; + for index2957 = 0; index2957 < (mbt_ffi_load32((iter_base) + 64)); index2957 = index2957 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index2957 * 16) + + let result2954 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result2955 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array2956.push((result2954, result2955)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + PublicOplogEntry::ActivatePlugin(ActivatePluginParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, plugin : PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 40), plugin_name : result2952, plugin_version : result2953, parameters : array2956}}) + } + 25 => { + + let result2958 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + let result2959 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) + + let array2962 : Array[(String, String)] = []; + for index2963 = 0; index2963 < (mbt_ffi_load32((iter_base) + 64)); index2963 = index2963 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index2963 * 16) + + let result2960 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result2961 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array2962.push((result2960, result2961)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + PublicOplogEntry::DeactivatePlugin(DeactivatePluginParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, plugin : PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 40), plugin_name : result2958, plugin_version : result2959, parameters : array2962}}) + } + 26 => { + + PublicOplogEntry::Revert(RevertParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, dropped_region : OplogRegion::{start : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), end : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}) + } + 27 => { + + let result2964 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PublicOplogEntry::CancelPendingInvocation(CancelPendingInvocationParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, idempotency_key : result2964}) + } + 28 => { + + let result2965 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let lifted2967 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result2966 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result2966) + } + _ => panic() + } + + let lifted2969 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result2968 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result2968) + } + _ => panic() + } + + let array2973 : Array[@context.Attribute] = []; + for index2974 = 0; index2974 < (mbt_ffi_load32((iter_base) + 60)); index2974 = index2974 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2974 * 20) + + let result2970 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2972 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result2971 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + @context.AttributeValue::String(result2971) + } + _ => panic() + } + + array2973.push(@context.Attribute::{key : result2970, value : lifted2972}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + PublicOplogEntry::StartSpan(StartSpanParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, span_id : result2965, parent : lifted2967, linked_context_id : lifted2969, attributes : array2973}) + } + 29 => { + + let result2975 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PublicOplogEntry::FinishSpan(FinishSpanParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, span_id : result2975}) + } + 30 => { + + let result2976 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let result2977 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let lifted2979 = match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => { + + let result2978 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + @context.AttributeValue::String(result2978) + } + _ => panic() + } + + PublicOplogEntry::SetSpanAttribute(SetSpanAttributeParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, span_id : result2976, key : result2977, value : lifted2979}) + } + 31 => { + + let lifted2980 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @host.PersistenceLevel::PersistNothing + } + 1 => { + + @host.PersistenceLevel::PersistRemoteSideEffects + } + 2 => { + + @host.PersistenceLevel::Smart + } + _ => panic() + } + + PublicOplogEntry::ChangePersistenceLevel(ChangePersistenceLevelParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, persistence_level : lifted2980}) + } + 32 => { + + let result2981 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PublicOplogEntry::BeginRemoteTransaction(BeginRemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, transaction_id : result2981}) + } + 33 => { + + PublicOplogEntry::PreCommitRemoteTransaction(RemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + 34 => { + + PublicOplogEntry::PreRollbackRemoteTransaction(RemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + 35 => { + + PublicOplogEntry::CommittedRemoteTransaction(RemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + 36 => { + + PublicOplogEntry::RolledBackRemoteTransaction(RemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + 37 => { + + let result2982 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let result2983 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + PublicOplogEntry::Snapshot(SnapshotParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, data : SnapshotData::{data : result2982, mime_type : result2983}}) + } + 38 => { + + let result2984 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + let result2985 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) + + let array2988 : Array[(String, String)] = []; + for index2989 = 0; index2989 < (mbt_ffi_load32((iter_base) + 64)); index2989 = index2989 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index2989 * 16) + + let result2986 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result2987 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array2988.push((result2986, result2987)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + let result2990 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 88), mbt_ffi_load32((iter_base) + 92)) + + PublicOplogEntry::OplogProcessorCheckpoint(OplogProcessorCheckpointParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, plugin : PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 40), plugin_name : result2984, plugin_version : result2985, parameters : array2988}, target_agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 72)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 80)).reinterpret_as_uint64()}}, agent_id : result2990}, confirmed_up_to : (mbt_ffi_load64((iter_base) + 96)).reinterpret_as_uint64(), sending_up_to : (mbt_ffi_load64((iter_base) + 104)).reinterpret_as_uint64(), last_batch_start : (mbt_ffi_load64((iter_base) + 112)).reinterpret_as_uint64()}) + } + 39 => { + + let result2991 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let array3023 : Array[@retry.PredicateNode] = []; + for index3024 = 0; index3024 < (mbt_ffi_load32((iter_base) + 40)); index3024 = index3024 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index3024 * 32) + + let lifted3022 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result2992 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2994 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2993 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2993) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropEq(@retry.PropertyComparison::{property_name : result2992, value : lifted2994}) + } + 1 => { + + let result2995 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2997 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2996 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2996) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropNeq(@retry.PropertyComparison::{property_name : result2995, value : lifted2997}) + } + 2 => { + + let result2998 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted3000 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2999 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2999) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropGt(@retry.PropertyComparison::{property_name : result2998, value : lifted3000}) + } + 3 => { + + let result3001 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted3003 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result3002 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result3002) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropGte(@retry.PropertyComparison::{property_name : result3001, value : lifted3003}) + } + 4 => { + + let result3004 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted3006 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result3005 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result3005) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropLt(@retry.PropertyComparison::{property_name : result3004, value : lifted3006}) + } + 5 => { + + let result3007 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted3009 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result3008 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result3008) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropLte(@retry.PropertyComparison::{property_name : result3007, value : lifted3009}) + } + 6 => { + + let result3010 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @retry.PredicateNode::PropExists(result3010) + } + 7 => { + + let result3011 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array3014 : Array[@retry.PredicateValue] = []; + for index3015 = 0; index3015 < (mbt_ffi_load32((iter_base) + 20)); index3015 = index3015 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index3015 * 16) + + let lifted3013 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result3012 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @retry.PredicateValue::Text(result3012) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 8)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + _ => panic() + } + + array3014.push(lifted3013) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + @retry.PredicateNode::PropIn(@retry.PropertySetCheck::{property_name : result3011, values : array3014}) + } + 8 => { + + let result3016 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result3017 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @retry.PredicateNode::PropMatches(@retry.PropertyPattern::{property_name : result3016, pattern : result3017}) + } + 9 => { + + let result3018 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result3019 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @retry.PredicateNode::PropStartsWith(@retry.PropertyPattern::{property_name : result3018, pattern : result3019}) + } + 10 => { + + let result3020 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result3021 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @retry.PredicateNode::PropContains(@retry.PropertyPattern::{property_name : result3020, pattern : result3021}) + } + 11 => { + + @retry.PredicateNode::PredAnd((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + @retry.PredicateNode::PredOr((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + @retry.PredicateNode::PredNot(mbt_ffi_load32((iter_base) + 8)) + } + 14 => { + + @retry.PredicateNode::PredTrue + } + 15 => { + + @retry.PredicateNode::PredFalse + } + _ => panic() + } + + array3023.push(lifted3022) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let array3059 : Array[@retry.PolicyNode] = []; + for index3060 = 0; index3060 < (mbt_ffi_load32((iter_base) + 48)); index3060 = index3060 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index3060 * 32) + + let lifted3058 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @retry.PolicyNode::Periodic((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 1 => { + + @retry.PolicyNode::Exponential(@retry.ExponentialConfig::{base_delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), factor : mbt_ffi_loadf64((iter_base) + 16)}) + } + 2 => { + + @retry.PolicyNode::Fibonacci(@retry.FibonacciConfig::{first : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), second : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64()}) + } + 3 => { + + @retry.PolicyNode::Immediate + } + 4 => { + + @retry.PolicyNode::Never + } + 5 => { + + @retry.PolicyNode::CountBox(@retry.CountBoxConfig::{max_retries : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), inner : mbt_ffi_load32((iter_base) + 12)}) + } + 6 => { + + @retry.PolicyNode::TimeBox(@retry.TimeBoxConfig::{limit : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 7 => { + + @retry.PolicyNode::ClampDelay(@retry.ClampConfig::{min_delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), max_delay : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 24)}) + } + 8 => { + + @retry.PolicyNode::AddDelay(@retry.AddDelayConfig::{delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 9 => { + + @retry.PolicyNode::Jitter(@retry.JitterConfig::{factor : mbt_ffi_loadf64((iter_base) + 8), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 10 => { + + let array3056 : Array[@retry.PredicateNode] = []; + for index3057 = 0; index3057 < (mbt_ffi_load32((iter_base) + 12)); index3057 = index3057 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3057 * 32) + + let lifted3055 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result3025 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted3027 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result3026 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result3026) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropEq(@retry.PropertyComparison::{property_name : result3025, value : lifted3027}) + } + 1 => { + + let result3028 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted3030 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result3029 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result3029) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropNeq(@retry.PropertyComparison::{property_name : result3028, value : lifted3030}) + } + 2 => { + + let result3031 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted3033 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result3032 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result3032) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropGt(@retry.PropertyComparison::{property_name : result3031, value : lifted3033}) + } + 3 => { + + let result3034 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted3036 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result3035 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result3035) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropGte(@retry.PropertyComparison::{property_name : result3034, value : lifted3036}) + } + 4 => { + + let result3037 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted3039 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result3038 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result3038) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropLt(@retry.PropertyComparison::{property_name : result3037, value : lifted3039}) + } + 5 => { + + let result3040 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted3042 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result3041 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result3041) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropLte(@retry.PropertyComparison::{property_name : result3040, value : lifted3042}) + } + 6 => { + + let result3043 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @retry.PredicateNode::PropExists(result3043) + } + 7 => { + + let result3044 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array3047 : Array[@retry.PredicateValue] = []; + for index3048 = 0; index3048 < (mbt_ffi_load32((iter_base) + 20)); index3048 = index3048 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index3048 * 16) + + let lifted3046 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result3045 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @retry.PredicateValue::Text(result3045) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 8)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + _ => panic() + } + + array3047.push(lifted3046) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + @retry.PredicateNode::PropIn(@retry.PropertySetCheck::{property_name : result3044, values : array3047}) + } + 8 => { + + let result3049 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result3050 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @retry.PredicateNode::PropMatches(@retry.PropertyPattern::{property_name : result3049, pattern : result3050}) + } + 9 => { + + let result3051 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result3052 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @retry.PredicateNode::PropStartsWith(@retry.PropertyPattern::{property_name : result3051, pattern : result3052}) + } + 10 => { + + let result3053 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result3054 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @retry.PredicateNode::PropContains(@retry.PropertyPattern::{property_name : result3053, pattern : result3054}) + } + 11 => { + + @retry.PredicateNode::PredAnd((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + @retry.PredicateNode::PredOr((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + @retry.PredicateNode::PredNot(mbt_ffi_load32((iter_base) + 8)) + } + 14 => { + + @retry.PredicateNode::PredTrue + } + 15 => { + + @retry.PredicateNode::PredFalse + } + _ => panic() + } + + array3056.push(lifted3055) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @retry.PolicyNode::FilteredOn(@retry.FilteredConfig::{predicate : @retry.RetryPredicate::{nodes : array3056}, inner : mbt_ffi_load32((iter_base) + 16)}) + } + 11 => { + + @retry.PolicyNode::AndThen((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + @retry.PolicyNode::PolicyUnion((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + @retry.PolicyNode::PolicyIntersect((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } + + array3059.push(lifted3058) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + PublicOplogEntry::SetRetryPolicy(SetRetryPolicyParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, policy : @retry.NamedRetryPolicy::{name : result2991, priority : (mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint(), predicate : @retry.RetryPredicate::{nodes : array3023}, policy : @retry.RetryPolicy::{nodes : array3059}}}) + } + 40 => { + + let result3061 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PublicOplogEntry::RemoveRetryPolicy(RemoveRetryPolicyParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, name : result3061}) + } + 41 => { + + let lifted3062 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + QueuedCardEvent::Install(QueuedCardEventInstall::{card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}}) + } + 1 => { + + QueuedCardEvent::Revoke(QueuedCardEventRevoke::{card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}}) + } + _ => panic() + } + + PublicOplogEntry::CardEventQueued(CardEventQueuedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, event : lifted3062}) + } + 42 => { + + let lifted3063 : UInt64? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + PublicOplogEntry::CardInstalled(CardInstalledParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, queued_event_index : lifted3063, card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 48)).reinterpret_as_uint64()}}}) + } + 43 => { + + PublicOplogEntry::CardInstallFailed(CardInstallFailedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, queued_event_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}, reason : CardInstallFailure::from(mbt_ffi_load8_u((iter_base) + 48))}) + } + 44 => { + + PublicOplogEntry::CardRevoked(CardRevokedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, queued_event_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}}) + } + 45 => { + + PublicOplogEntry::CardExpired(CardExpiredParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}}) + } + 46 => { + + let array3260 : Array[@types.SchemaTypeNode] = []; + for index3261 = 0; index3261 < (mbt_ffi_load32((iter_base) + 40)); index3261 = index3261 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index3261 * 144) + + let lifted3246 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted3070 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted3065 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted3064 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3064) + } + _ => panic() + } + + let lifted3067 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted3066 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3066) + } + _ => panic() + } + + let lifted3069 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result3068 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result3068) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted3065, max : lifted3067, unit : lifted3069}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted3070) + } + 3 => { + + let lifted3077 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted3072 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted3071 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3071) + } + _ => panic() + } + + let lifted3074 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted3073 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3073) + } + _ => panic() + } + + let lifted3076 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result3075 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result3075) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted3072, max : lifted3074, unit : lifted3076}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted3077) + } + 4 => { + + let lifted3084 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted3079 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted3078 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3078) + } + _ => panic() + } + + let lifted3081 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted3080 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3080) + } + _ => panic() + } + + let lifted3083 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result3082 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result3082) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted3079, max : lifted3081, unit : lifted3083}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted3084) + } + 5 => { + + let lifted3091 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted3086 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted3085 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3085) + } + _ => panic() + } + + let lifted3088 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted3087 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3087) + } + _ => panic() + } + + let lifted3090 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result3089 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result3089) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted3086, max : lifted3088, unit : lifted3090}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted3091) + } + 6 => { + + let lifted3098 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted3093 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted3092 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3092) + } + _ => panic() + } + + let lifted3095 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted3094 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3094) + } + _ => panic() + } + + let lifted3097 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result3096 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result3096) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted3093, max : lifted3095, unit : lifted3097}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted3098) + } + 7 => { + + let lifted3105 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted3100 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted3099 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3099) + } + _ => panic() + } + + let lifted3102 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted3101 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3101) + } + _ => panic() + } + + let lifted3104 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result3103 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result3103) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted3100, max : lifted3102, unit : lifted3104}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted3105) + } + 8 => { + + let lifted3112 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted3107 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted3106 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3106) + } + _ => panic() + } + + let lifted3109 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted3108 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3108) + } + _ => panic() + } + + let lifted3111 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result3110 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result3110) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted3107, max : lifted3109, unit : lifted3111}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted3112) + } + 9 => { + + let lifted3119 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted3114 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted3113 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3113) + } + _ => panic() + } + + let lifted3116 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted3115 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3115) + } + _ => panic() + } + + let lifted3118 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result3117 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result3117) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted3114, max : lifted3116, unit : lifted3118}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted3119) + } + 10 => { + + let lifted3126 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted3121 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted3120 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3120) + } + _ => panic() + } + + let lifted3123 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted3122 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3122) + } + _ => panic() + } + + let lifted3125 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result3124 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result3124) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted3121, max : lifted3123, unit : lifted3125}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted3126) + } + 11 => { + + let lifted3133 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted3128 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted3127 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3127) + } + _ => panic() + } + + let lifted3130 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted3129 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted3129) + } + _ => panic() + } + + let lifted3132 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result3131 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result3131) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted3128, max : lifted3130, unit : lifted3132}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted3133) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array3148 : Array[@types.NamedFieldType] = []; + for index3149 = 0; index3149 < (mbt_ffi_load32((iter_base) + 12)); index3149 = index3149 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3149 * 68) + + let result3134 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted3136 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result3135 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result3135) + } + _ => panic() + } + + let array3138 : Array[String] = []; + for index3139 = 0; index3139 < (mbt_ffi_load32((iter_base) + 28)); index3139 = index3139 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index3139 * 8) + + let result3137 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3138.push(result3137) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array3141 : Array[String] = []; + for index3142 = 0; index3142 < (mbt_ffi_load32((iter_base) + 36)); index3142 = index3142 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index3142 * 8) + + let result3140 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3141.push(result3140) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted3144 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result3143 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result3143) + } + _ => panic() + } + + let lifted3147 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted3146 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result3145 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result3145) + } + _ => panic() + } + + Option::Some(lifted3146) + } + _ => panic() + } + + array3148.push(@types.NamedFieldType::{name : result3134, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted3136, aliases : array3138, examples : array3141, deprecated : lifted3144, role : lifted3147}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array3148) + } + 15 => { + + let array3165 : Array[@types.VariantCaseType] = []; + for index3166 = 0; index3166 < (mbt_ffi_load32((iter_base) + 12)); index3166 = index3166 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3166 * 72) + + let result3150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted3151 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted3153 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result3152 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result3152) + } + _ => panic() + } + + let array3155 : Array[String] = []; + for index3156 = 0; index3156 < (mbt_ffi_load32((iter_base) + 32)); index3156 = index3156 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index3156 * 8) + + let result3154 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3155.push(result3154) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array3158 : Array[String] = []; + for index3159 = 0; index3159 < (mbt_ffi_load32((iter_base) + 40)); index3159 = index3159 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index3159 * 8) + + let result3157 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3158.push(result3157) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted3161 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result3160 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result3160) + } + _ => panic() + } + + let lifted3164 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted3163 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result3162 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result3162) + } + _ => panic() + } + + Option::Some(lifted3163) + } + _ => panic() + } + + array3165.push(@types.VariantCaseType::{name : result3150, payload : lifted3151, metadata : @types.MetadataEnvelope::{doc : lifted3153, aliases : array3155, examples : array3158, deprecated : lifted3161, role : lifted3164}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array3165) + } + 16 => { + + let array3168 : Array[String] = []; + for index3169 = 0; index3169 < (mbt_ffi_load32((iter_base) + 12)); index3169 = index3169 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3169 * 8) + + let result3167 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3168.push(result3167) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array3168) + } + 17 => { + + let array3171 : Array[String] = []; + for index3172 = 0; index3172 < (mbt_ffi_load32((iter_base) + 12)); index3172 = index3172 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3172 * 8) + + let result3170 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3171.push(result3170) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array3171) + } + 18 => { + + let array3173 : Array[Int] = []; + for index3174 = 0; index3174 < (mbt_ffi_load32((iter_base) + 12)); index3174 = index3174 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3174 * 4) + + array3173.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array3173) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted3175 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted3176 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted3175, err : lifted3176}) + } + 24 => { + + let lifted3180 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array3178 : Array[String] = []; + for index3179 = 0; index3179 < (mbt_ffi_load32((iter_base) + 16)); index3179 = index3179 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index3179 * 8) + + let result3177 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3178.push(result3177) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array3178) + } + _ => panic() + } + + let lifted3181 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted3182 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted3184 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result3183 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result3183) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted3180, min_length : lifted3181, max_length : lifted3182, regex : lifted3184}) + } + 25 => { + + let lifted3188 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array3186 : Array[String] = []; + for index3187 = 0; index3187 < (mbt_ffi_load32((iter_base) + 16)); index3187 = index3187 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index3187 * 8) + + let result3185 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3186.push(result3185) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array3186) + } + _ => panic() + } + + let lifted3189 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted3190 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted3188, min_bytes : lifted3189, max_bytes : lifted3190}) + } + 26 => { + + let lifted3194 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array3192 : Array[String] = []; + for index3193 = 0; index3193 < (mbt_ffi_load32((iter_base) + 20)); index3193 = index3193 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index3193 * 8) + + let result3191 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3192.push(result3191) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array3192) + } + _ => panic() + } + + let lifted3198 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array3196 : Array[String] = []; + for index3197 = 0; index3197 < (mbt_ffi_load32((iter_base) + 32)); index3197 = index3197 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index3197 * 8) + + let result3195 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3196.push(result3195) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array3196) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted3194, allowed_extensions : lifted3198}) + } + 27 => { + + let lifted3202 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array3200 : Array[String] = []; + for index3201 = 0; index3201 < (mbt_ffi_load32((iter_base) + 16)); index3201 = index3201 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index3201 * 8) + + let result3199 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3200.push(result3199) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array3200) + } + _ => panic() + } + + let lifted3206 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array3204 : Array[String] = []; + for index3205 = 0; index3205 < (mbt_ffi_load32((iter_base) + 28)); index3205 = index3205 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index3205 * 8) + + let result3203 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3204.push(result3203) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array3204) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted3202, allowed_hosts : lifted3206}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result3207 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array3209 : Array[String] = []; + for index3210 = 0; index3210 < (mbt_ffi_load32((iter_base) + 20)); index3210 = index3210 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index3210 * 8) + + let result3208 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3209.push(result3208) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted3212 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result3211 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result3211}) + } + _ => panic() + } + + let lifted3214 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result3213 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result3213}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result3207, allowed_suffixes : array3209, min : lifted3212, max : lifted3214}) + } + 31 => { + + let array3238 : Array[@types.UnionBranch] = []; + for index3239 = 0; index3239 < (mbt_ffi_load32((iter_base) + 12)); index3239 = index3239 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3239 * 92) + + let result3215 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted3224 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result3216 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result3216) + } + 1 => { + + let result3217 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result3217) + } + 2 => { + + let result3218 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result3218) + } + 3 => { + + let result3219 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result3219) + } + 4 => { + + let result3220 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted3222 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result3221 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result3221) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result3220, literal : lifted3222}) + } + 5 => { + + let result3223 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result3223) + } + _ => panic() + } + + let lifted3226 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result3225 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result3225) + } + _ => panic() + } + + let array3228 : Array[String] = []; + for index3229 = 0; index3229 < (mbt_ffi_load32((iter_base) + 52)); index3229 = index3229 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index3229 * 8) + + let result3227 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3228.push(result3227) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array3231 : Array[String] = []; + for index3232 = 0; index3232 < (mbt_ffi_load32((iter_base) + 60)); index3232 = index3232 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index3232 * 8) + + let result3230 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3231.push(result3230) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted3234 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result3233 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result3233) + } + _ => panic() + } + + let lifted3237 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted3236 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result3235 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result3235) + } + _ => panic() + } + + Option::Some(lifted3236) + } + _ => panic() + } + + array3238.push(@types.UnionBranch::{tag : result3215, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted3224, metadata : @types.MetadataEnvelope::{doc : lifted3226, aliases : array3228, examples : array3231, deprecated : lifted3234, role : lifted3237}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array3238}) + } + 32 => { + + let lifted3241 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result3240 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result3240) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted3241}) + } + 33 => { + + let lifted3243 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result3242 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result3242) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted3243}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted3244 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted3244) + } + 36 => { + + let lifted3245 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted3245) + } + _ => panic() + } + + let lifted3248 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result3247 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result3247) + } + _ => panic() + } + + let array3250 : Array[String] = []; + for index3251 = 0; index3251 < (mbt_ffi_load32((iter_base) + 104)); index3251 = index3251 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index3251 * 8) + + let result3249 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3250.push(result3249) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array3253 : Array[String] = []; + for index3254 = 0; index3254 < (mbt_ffi_load32((iter_base) + 112)); index3254 = index3254 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index3254 * 8) + + let result3252 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array3253.push(result3252) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted3256 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result3255 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result3255) + } + _ => panic() + } + + let lifted3259 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted3258 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result3257 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result3257) + } + _ => panic() + } + + Option::Some(lifted3258) + } + _ => panic() + } + + array3260.push(@types.SchemaTypeNode::{body : lifted3246, metadata : @types.MetadataEnvelope::{doc : lifted3248, aliases : array3250, examples : array3253, deprecated : lifted3256, role : lifted3259}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let array3265 : Array[@types.SchemaTypeDef] = []; + for index3266 = 0; index3266 < (mbt_ffi_load32((iter_base) + 48)); index3266 = index3266 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index3266 * 24) + + let result3262 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted3264 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result3263 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result3263) + } + _ => panic() + } + + array3265.push(@types.SchemaTypeDef::{id : result3262, name : lifted3264, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + let array3296 : Array[@types.SchemaValueNode] = []; + for index3297 = 0; index3297 < (mbt_ffi_load32((iter_base) + 60)); index3297 = index3297 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index3297 * 32) + + let lifted3295 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result3267 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result3267) + } + 13 => { + + let array3268 : Array[Int] = []; + for index3269 = 0; index3269 < (mbt_ffi_load32((iter_base) + 12)); index3269 = index3269 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3269 * 4) + + array3268.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array3268) + } + 14 => { + + let lifted3270 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted3270}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array3271 : Array[Bool] = []; + for index3272 = 0; index3272 < (mbt_ffi_load32((iter_base) + 12)); index3272 = index3272 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3272 * 1) + + array3271.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array3271) + } + 17 => { + + let array3273 : Array[Int] = []; + for index3274 = 0; index3274 < (mbt_ffi_load32((iter_base) + 12)); index3274 = index3274 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3274 * 4) + + array3273.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array3273) + } + 18 => { + + let array3275 : Array[Int] = []; + for index3276 = 0; index3276 < (mbt_ffi_load32((iter_base) + 12)); index3276 = index3276 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3276 * 4) + + array3275.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array3275) + } + 19 => { + + let array3277 : Array[Int] = []; + for index3278 = 0; index3278 < (mbt_ffi_load32((iter_base) + 12)); index3278 = index3278 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3278 * 4) + + array3277.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array3277) + } + 20 => { + + let array3279 : Array[@types.MapEntry] = []; + for index3280 = 0; index3280 < (mbt_ffi_load32((iter_base) + 12)); index3280 = index3280 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index3280 * 8) + + array3279.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array3279) + } + 21 => { + + let lifted3281 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted3281) + } + 22 => { + + let lifted3284 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted3282 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted3282) + } + 1 => { + + let lifted3283 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted3283) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted3284) + } + 23 => { + + let result3285 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted3287 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result3286 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result3286) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result3285, language : lifted3287}) + } + 24 => { + + let result3288 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted3290 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result3289 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result3289) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result3288, mime_type : lifted3290}) + } + 25 => { + + let result3291 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result3291) + } + 26 => { + + let result3292 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result3292) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result3293 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result3293}) + } + 30 => { + + let result3294 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result3294, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array3296.push(lifted3295) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + PublicOplogEntry::HostStreamFrame(HostStreamFrameParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, parent_start_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), kind : HostStreamKind::from(mbt_ffi_load8_u((iter_base) + 32)), payload : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array3260, defs : array3265, root : mbt_ffi_load32((iter_base) + 52)}, value : @types.SchemaValueTree::{value_nodes : array3296, root : mbt_ffi_load32((iter_base) + 64)}}}) + } + 47 => { + + PublicOplogEntry::CompletionDiscarded(CompletionDiscardedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, start_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + _ => panic() + } + + array3299.push(lifted3298) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) + + Result::Ok(array3299) + } + 1 => { + + let result3301 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result3301) + } + _ => panic() + } + let ret = lifted3302 + mbt_ffi_free(ptr) + mbt_ffi_free(address461) + mbt_ffi_free(return_area) + + cleanup_list.each(mbt_ffi_free) + return ret + +} +///| +pub fn GetOplog::get_oplog(agent_id : @types.AgentId, start : UInt64) -> GetOplog { + + let ptr = mbt_ffi_str2ptr((agent_id).agent_id) + let result : Int = wasmImportConstructorGetOplog(((((agent_id).component_id).uuid).high_bits).reinterpret_as_int64(), ((((agent_id).component_id).uuid).low_bits).reinterpret_as_int64(), ptr, (agent_id).agent_id.length(), (start).reinterpret_as_int64()); + let ret = GetOplog::GetOplog(result) + mbt_ffi_free(ptr) + return ret + +} +///| +pub fn GetOplog::get_next(self : GetOplog) -> Array[PublicOplogEntry]? { + + let GetOplog(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodGetOplogGetNext(handle, return_area); + + let lifted2837 : Array[PublicOplogEntry]? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let array2835 : Array[PublicOplogEntry] = []; + for index2836 = 0; index2836 < (mbt_ffi_load32((return_area) + 8)); index2836 = index2836 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index2836 * 208) + + let lifted2834 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + let array : Array[(String, String)] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 68)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index * 16) + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array.push((result0, result1)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + let lifted : @types.AgentId? = match mbt_ffi_load8_u((iter_base) + 104) { + 0 => Option::None + 1 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 128), mbt_ffi_load32((iter_base) + 132)) + + Option::Some(@types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 112)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 120)).reinterpret_as_uint64()}}, agent_id : result2}) + } + _ => panic() + } + + let array9 : Array[PluginInstallationDescription] = []; + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 156)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 152)) + (index10 * 48) + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + let array7 : Array[(String, String)] = []; + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 40)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index8 * 16) + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array7.push((result5, result6)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + array9.push(PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 16), plugin_name : result3, plugin_version : result4, parameters : array7}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 152)) + + let array248 : Array[LocalAgentConfigEntry] = []; + for index249 = 0; index249 < (mbt_ffi_load32((iter_base) + 164)); index249 = index249 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 160)) + (index249 * 40) + + let array12 : Array[String] = []; + for index13 = 0; index13 < (mbt_ffi_load32((iter_base) + 4)); index13 = index13 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index13 * 8) + + let result11 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array12.push(result11) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + let array210 : Array[@types.SchemaTypeNode] = []; + for index211 = 0; index211 < (mbt_ffi_load32((iter_base) + 12)); index211 = index211 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index211 * 144) + + let lifted196 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted20 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted15 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted14 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted14) + } + _ => panic() + } + + let lifted17 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted16 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted16) + } + _ => panic() + } + + let lifted19 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result18) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted15, max : lifted17, unit : lifted19}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted20) + } + 3 => { + + let lifted27 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted22 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted21 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted21) + } + _ => panic() + } + + let lifted24 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted23 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted23) + } + _ => panic() + } + + let lifted26 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result25 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result25) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted22, max : lifted24, unit : lifted26}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted27) + } + 4 => { + + let lifted34 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted29 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted28 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted28) + } + _ => panic() + } + + let lifted31 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted30 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted30) + } + _ => panic() + } + + let lifted33 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result32 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result32) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted29, max : lifted31, unit : lifted33}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted34) + } + 5 => { + + let lifted41 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted36 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted35 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted35) + } + _ => panic() + } + + let lifted38 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted37 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted37) + } + _ => panic() + } + + let lifted40 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result39 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result39) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted36, max : lifted38, unit : lifted40}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted41) + } + 6 => { + + let lifted48 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted43 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted42 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted42) + } + _ => panic() + } + + let lifted45 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted44 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted44) + } + _ => panic() + } + + let lifted47 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result46 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result46) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted43, max : lifted45, unit : lifted47}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted48) + } + 7 => { + + let lifted55 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted50 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted49 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted49) + } + _ => panic() + } + + let lifted52 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted51 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted51) + } + _ => panic() + } + + let lifted54 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result53 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result53) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted50, max : lifted52, unit : lifted54}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted55) + } + 8 => { + + let lifted62 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted57 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted56 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted56) + } + _ => panic() + } + + let lifted59 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted58 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted58) + } + _ => panic() + } + + let lifted61 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result60 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result60) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted57, max : lifted59, unit : lifted61}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted62) + } + 9 => { + + let lifted69 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted64 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted63 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted63) + } + _ => panic() + } + + let lifted66 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted65 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted65) + } + _ => panic() + } + + let lifted68 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result67 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result67) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted64, max : lifted66, unit : lifted68}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted69) + } + 10 => { + + let lifted76 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted71 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted70 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted70) + } + _ => panic() + } + + let lifted73 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted72 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted72) + } + _ => panic() + } + + let lifted75 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result74 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result74) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted71, max : lifted73, unit : lifted75}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted76) + } + 11 => { + + let lifted83 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted78 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted77 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted77) + } + _ => panic() + } + + let lifted80 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted79 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted79) + } + _ => panic() + } + + let lifted82 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result81 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result81) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted78, max : lifted80, unit : lifted82}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted83) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array98 : Array[@types.NamedFieldType] = []; + for index99 = 0; index99 < (mbt_ffi_load32((iter_base) + 12)); index99 = index99 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index99 * 68) + + let result84 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted86 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result85 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result85) + } + _ => panic() + } + + let array88 : Array[String] = []; + for index89 = 0; index89 < (mbt_ffi_load32((iter_base) + 28)); index89 = index89 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index89 * 8) + + let result87 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array88.push(result87) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array91 : Array[String] = []; + for index92 = 0; index92 < (mbt_ffi_load32((iter_base) + 36)); index92 = index92 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index92 * 8) + + let result90 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array91.push(result90) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted94 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result93 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result93) + } + _ => panic() + } + + let lifted97 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted96 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result95 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result95) + } + _ => panic() + } + + Option::Some(lifted96) + } + _ => panic() + } + + array98.push(@types.NamedFieldType::{name : result84, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted86, aliases : array88, examples : array91, deprecated : lifted94, role : lifted97}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array98) + } + 15 => { + + let array115 : Array[@types.VariantCaseType] = []; + for index116 = 0; index116 < (mbt_ffi_load32((iter_base) + 12)); index116 = index116 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index116 * 72) + + let result100 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted101 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted103 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result102 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result102) + } + _ => panic() + } + + let array105 : Array[String] = []; + for index106 = 0; index106 < (mbt_ffi_load32((iter_base) + 32)); index106 = index106 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index106 * 8) + + let result104 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array105.push(result104) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array108 : Array[String] = []; + for index109 = 0; index109 < (mbt_ffi_load32((iter_base) + 40)); index109 = index109 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index109 * 8) + + let result107 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array108.push(result107) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted111 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result110 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result110) + } + _ => panic() + } + + let lifted114 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted113 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result112 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result112) + } + _ => panic() + } + + Option::Some(lifted113) + } + _ => panic() + } + + array115.push(@types.VariantCaseType::{name : result100, payload : lifted101, metadata : @types.MetadataEnvelope::{doc : lifted103, aliases : array105, examples : array108, deprecated : lifted111, role : lifted114}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array115) + } + 16 => { + + let array118 : Array[String] = []; + for index119 = 0; index119 < (mbt_ffi_load32((iter_base) + 12)); index119 = index119 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index119 * 8) + + let result117 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array118.push(result117) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array118) + } + 17 => { + + let array121 : Array[String] = []; + for index122 = 0; index122 < (mbt_ffi_load32((iter_base) + 12)); index122 = index122 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index122 * 8) + + let result120 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array121.push(result120) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array121) + } + 18 => { + + let array123 : Array[Int] = []; + for index124 = 0; index124 < (mbt_ffi_load32((iter_base) + 12)); index124 = index124 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index124 * 4) + + array123.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array123) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted125 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted126 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted125, err : lifted126}) + } + 24 => { + + let lifted130 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array128 : Array[String] = []; + for index129 = 0; index129 < (mbt_ffi_load32((iter_base) + 16)); index129 = index129 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index129 * 8) + + let result127 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array128.push(result127) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array128) + } + _ => panic() + } + + let lifted131 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted132 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted134 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result133 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result133) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted130, min_length : lifted131, max_length : lifted132, regex : lifted134}) + } + 25 => { + + let lifted138 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array136 : Array[String] = []; + for index137 = 0; index137 < (mbt_ffi_load32((iter_base) + 16)); index137 = index137 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index137 * 8) + + let result135 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array136.push(result135) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array136) + } + _ => panic() + } + + let lifted139 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted140 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted138, min_bytes : lifted139, max_bytes : lifted140}) + } + 26 => { + + let lifted144 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array142 : Array[String] = []; + for index143 = 0; index143 < (mbt_ffi_load32((iter_base) + 20)); index143 = index143 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index143 * 8) + + let result141 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array142.push(result141) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array142) + } + _ => panic() + } + + let lifted148 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array146 : Array[String] = []; + for index147 = 0; index147 < (mbt_ffi_load32((iter_base) + 32)); index147 = index147 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index147 * 8) + + let result145 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array146.push(result145) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array146) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted144, allowed_extensions : lifted148}) + } + 27 => { + + let lifted152 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array150 : Array[String] = []; + for index151 = 0; index151 < (mbt_ffi_load32((iter_base) + 16)); index151 = index151 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index151 * 8) + + let result149 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array150.push(result149) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array150) + } + _ => panic() + } + + let lifted156 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array154 : Array[String] = []; + for index155 = 0; index155 < (mbt_ffi_load32((iter_base) + 28)); index155 = index155 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index155 * 8) + + let result153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array154.push(result153) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array154) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted152, allowed_hosts : lifted156}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result157 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array159 : Array[String] = []; + for index160 = 0; index160 < (mbt_ffi_load32((iter_base) + 20)); index160 = index160 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index160 * 8) + + let result158 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array159.push(result158) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted162 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result161 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result161}) + } + _ => panic() + } + + let lifted164 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result163 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result163}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result157, allowed_suffixes : array159, min : lifted162, max : lifted164}) + } + 31 => { + + let array188 : Array[@types.UnionBranch] = []; + for index189 = 0; index189 < (mbt_ffi_load32((iter_base) + 12)); index189 = index189 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index189 * 92) + + let result165 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted174 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result166 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result166) + } + 1 => { + + let result167 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result167) + } + 2 => { + + let result168 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result168) + } + 3 => { + + let result169 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result169) + } + 4 => { + + let result170 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted172 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result171 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result171) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result170, literal : lifted172}) + } + 5 => { + + let result173 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result173) + } + _ => panic() + } + + let lifted176 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result175 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result175) + } + _ => panic() + } + + let array178 : Array[String] = []; + for index179 = 0; index179 < (mbt_ffi_load32((iter_base) + 52)); index179 = index179 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index179 * 8) + + let result177 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array178.push(result177) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array181 : Array[String] = []; + for index182 = 0; index182 < (mbt_ffi_load32((iter_base) + 60)); index182 = index182 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index182 * 8) + + let result180 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array181.push(result180) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted184 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result183 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result183) + } + _ => panic() + } + + let lifted187 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted186 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result185 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result185) + } + _ => panic() + } + + Option::Some(lifted186) + } + _ => panic() + } + + array188.push(@types.UnionBranch::{tag : result165, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted174, metadata : @types.MetadataEnvelope::{doc : lifted176, aliases : array178, examples : array181, deprecated : lifted184, role : lifted187}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array188}) + } + 32 => { + + let lifted191 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result190 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result190) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted191}) + } + 33 => { + + let lifted193 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result192 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result192) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted193}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted194 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted194) + } + 36 => { + + let lifted195 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted195) + } + _ => panic() + } + + let lifted198 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result197 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result197) + } + _ => panic() + } + + let array200 : Array[String] = []; + for index201 = 0; index201 < (mbt_ffi_load32((iter_base) + 104)); index201 = index201 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index201 * 8) + + let result199 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array200.push(result199) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array203 : Array[String] = []; + for index204 = 0; index204 < (mbt_ffi_load32((iter_base) + 112)); index204 = index204 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index204 * 8) + + let result202 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array203.push(result202) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted206 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result205 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result205) + } + _ => panic() + } + + let lifted209 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted208 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result207 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result207) + } + _ => panic() + } + + Option::Some(lifted208) + } + _ => panic() + } + + array210.push(@types.SchemaTypeNode::{body : lifted196, metadata : @types.MetadataEnvelope::{doc : lifted198, aliases : array200, examples : array203, deprecated : lifted206, role : lifted209}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + let array215 : Array[@types.SchemaTypeDef] = []; + for index216 = 0; index216 < (mbt_ffi_load32((iter_base) + 20)); index216 = index216 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index216 * 24) + + let result212 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted214 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result213 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result213) + } + _ => panic() + } + + array215.push(@types.SchemaTypeDef::{id : result212, name : lifted214, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let array246 : Array[@types.SchemaValueNode] = []; + for index247 = 0; index247 < (mbt_ffi_load32((iter_base) + 32)); index247 = index247 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index247 * 32) + + let lifted245 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result217 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result217) + } + 13 => { + + let array218 : Array[Int] = []; + for index219 = 0; index219 < (mbt_ffi_load32((iter_base) + 12)); index219 = index219 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index219 * 4) + + array218.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array218) + } + 14 => { + + let lifted220 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted220}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array221 : Array[Bool] = []; + for index222 = 0; index222 < (mbt_ffi_load32((iter_base) + 12)); index222 = index222 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index222 * 1) + + array221.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array221) + } + 17 => { + + let array223 : Array[Int] = []; + for index224 = 0; index224 < (mbt_ffi_load32((iter_base) + 12)); index224 = index224 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index224 * 4) + + array223.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array223) + } + 18 => { + + let array225 : Array[Int] = []; + for index226 = 0; index226 < (mbt_ffi_load32((iter_base) + 12)); index226 = index226 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index226 * 4) + + array225.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array225) + } + 19 => { + + let array227 : Array[Int] = []; + for index228 = 0; index228 < (mbt_ffi_load32((iter_base) + 12)); index228 = index228 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index228 * 4) + + array227.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array227) + } + 20 => { + + let array229 : Array[@types.MapEntry] = []; + for index230 = 0; index230 < (mbt_ffi_load32((iter_base) + 12)); index230 = index230 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index230 * 8) + + array229.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array229) + } + 21 => { + + let lifted231 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted231) + } + 22 => { + + let lifted234 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted232 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted232) + } + 1 => { + + let lifted233 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted233) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted234) + } + 23 => { + + let result235 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted237 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result236 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result236) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result235, language : lifted237}) + } + 24 => { + + let result238 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted240 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result239 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result239) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result238, mime_type : lifted240}) + } + 25 => { + + let result241 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result241) + } + 26 => { + + let result242 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result242) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result243 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result243}) + } + 30 => { + + let result244 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result244, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array246.push(lifted245) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + array248.push(LocalAgentConfigEntry::{path : array12, value : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array210, defs : array215, root : mbt_ffi_load32((iter_base) + 24)}, value : @types.SchemaValueTree::{value_nodes : array246, root : mbt_ffi_load32((iter_base) + 36)}}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 160)) + + let lifted250 : @types.Uuid? = match mbt_ffi_load8_u((iter_base) + 168) { + 0 => Option::None + 1 => { + + Option::Some(@types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 176)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 184)).reinterpret_as_uint64()}) + } + _ => panic() + } + + PublicOplogEntry::Create(CreateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}, agent_id : result}, agent_mode : AgentMode::from(mbt_ffi_load8_u((iter_base) + 48)), component_revision : (mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64(), env : array, created_by : @types.AccountId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 72)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 80)).reinterpret_as_uint64()}}, environment_id : @host.EnvironmentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 88)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 96)).reinterpret_as_uint64()}}, parent : lifted, component_size : (mbt_ffi_load64((iter_base) + 136)).reinterpret_as_uint64(), initial_total_linear_memory_size : (mbt_ffi_load64((iter_base) + 144)).reinterpret_as_uint64(), initial_active_plugins : array9, local_agent_config : array248, original_phantom_id : lifted250, instance_id : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 192)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 200)).reinterpret_as_uint64()}}) + } + 1 => { + + let lifted251 : UInt64? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + let result252 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + let lifted487 : @types.TypedSchemaValue? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + let array449 : Array[@types.SchemaTypeNode] = []; + for index450 = 0; index450 < (mbt_ffi_load32((iter_base) + 56)); index450 = index450 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 52)) + (index450 * 144) + + let lifted435 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted259 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted254 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted253 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted253) + } + _ => panic() + } + + let lifted256 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted255 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted255) + } + _ => panic() + } + + let lifted258 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result257 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result257) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted254, max : lifted256, unit : lifted258}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted259) + } + 3 => { + + let lifted266 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted261 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted260 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted260) + } + _ => panic() + } + + let lifted263 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted262 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted262) + } + _ => panic() + } + + let lifted265 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result264 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result264) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted261, max : lifted263, unit : lifted265}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted266) + } + 4 => { + + let lifted273 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted268 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted267 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted267) + } + _ => panic() + } + + let lifted270 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted269 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted269) + } + _ => panic() + } + + let lifted272 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result271 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result271) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted268, max : lifted270, unit : lifted272}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted273) + } + 5 => { + + let lifted280 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted275 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted274 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted274) + } + _ => panic() + } + + let lifted277 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted276 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted276) + } + _ => panic() + } + + let lifted279 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result278 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result278) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted275, max : lifted277, unit : lifted279}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted280) + } + 6 => { + + let lifted287 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted282 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted281 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted281) + } + _ => panic() + } + + let lifted284 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted283 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted283) + } + _ => panic() + } + + let lifted286 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result285 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result285) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted282, max : lifted284, unit : lifted286}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted287) + } + 7 => { + + let lifted294 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted289 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted288 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted288) + } + _ => panic() + } + + let lifted291 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted290 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted290) + } + _ => panic() + } + + let lifted293 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result292 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result292) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted289, max : lifted291, unit : lifted293}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted294) + } + 8 => { + + let lifted301 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted296 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted295 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted295) + } + _ => panic() + } + + let lifted298 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted297 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted297) + } + _ => panic() + } + + let lifted300 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result299 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result299) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted296, max : lifted298, unit : lifted300}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted301) + } + 9 => { + + let lifted308 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted303 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted302 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted302) + } + _ => panic() + } + + let lifted305 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted304 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted304) + } + _ => panic() + } + + let lifted307 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result306 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result306) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted303, max : lifted305, unit : lifted307}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted308) + } + 10 => { + + let lifted315 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted310 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted309 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted309) + } + _ => panic() + } + + let lifted312 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted311 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted311) + } + _ => panic() + } + + let lifted314 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result313 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result313) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted310, max : lifted312, unit : lifted314}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted315) + } + 11 => { + + let lifted322 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted317 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted316 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted316) + } + _ => panic() + } + + let lifted319 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted318 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted318) + } + _ => panic() + } + + let lifted321 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result320 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result320) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted317, max : lifted319, unit : lifted321}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted322) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array337 : Array[@types.NamedFieldType] = []; + for index338 = 0; index338 < (mbt_ffi_load32((iter_base) + 12)); index338 = index338 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index338 * 68) + + let result323 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted325 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result324 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result324) + } + _ => panic() + } + + let array327 : Array[String] = []; + for index328 = 0; index328 < (mbt_ffi_load32((iter_base) + 28)); index328 = index328 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index328 * 8) + + let result326 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array327.push(result326) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array330 : Array[String] = []; + for index331 = 0; index331 < (mbt_ffi_load32((iter_base) + 36)); index331 = index331 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index331 * 8) + + let result329 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array330.push(result329) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted333 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result332 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result332) + } + _ => panic() + } + + let lifted336 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted335 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result334 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result334) + } + _ => panic() + } + + Option::Some(lifted335) + } + _ => panic() + } + + array337.push(@types.NamedFieldType::{name : result323, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted325, aliases : array327, examples : array330, deprecated : lifted333, role : lifted336}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array337) + } + 15 => { + + let array354 : Array[@types.VariantCaseType] = []; + for index355 = 0; index355 < (mbt_ffi_load32((iter_base) + 12)); index355 = index355 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index355 * 72) + + let result339 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted340 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted342 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result341 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result341) + } + _ => panic() + } + + let array344 : Array[String] = []; + for index345 = 0; index345 < (mbt_ffi_load32((iter_base) + 32)); index345 = index345 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index345 * 8) + + let result343 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array344.push(result343) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array347 : Array[String] = []; + for index348 = 0; index348 < (mbt_ffi_load32((iter_base) + 40)); index348 = index348 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index348 * 8) + + let result346 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array347.push(result346) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted350 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result349 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result349) + } + _ => panic() + } + + let lifted353 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted352 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result351 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result351) + } + _ => panic() + } + + Option::Some(lifted352) + } + _ => panic() + } + + array354.push(@types.VariantCaseType::{name : result339, payload : lifted340, metadata : @types.MetadataEnvelope::{doc : lifted342, aliases : array344, examples : array347, deprecated : lifted350, role : lifted353}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array354) + } + 16 => { + + let array357 : Array[String] = []; + for index358 = 0; index358 < (mbt_ffi_load32((iter_base) + 12)); index358 = index358 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index358 * 8) + + let result356 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array357.push(result356) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array357) + } + 17 => { + + let array360 : Array[String] = []; + for index361 = 0; index361 < (mbt_ffi_load32((iter_base) + 12)); index361 = index361 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index361 * 8) + + let result359 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array360.push(result359) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array360) + } + 18 => { + + let array362 : Array[Int] = []; + for index363 = 0; index363 < (mbt_ffi_load32((iter_base) + 12)); index363 = index363 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index363 * 4) + + array362.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array362) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted364 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted365 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted364, err : lifted365}) + } + 24 => { + + let lifted369 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array367 : Array[String] = []; + for index368 = 0; index368 < (mbt_ffi_load32((iter_base) + 16)); index368 = index368 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index368 * 8) + + let result366 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array367.push(result366) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array367) + } + _ => panic() + } + + let lifted370 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted371 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted373 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result372 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result372) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted369, min_length : lifted370, max_length : lifted371, regex : lifted373}) + } + 25 => { + + let lifted377 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array375 : Array[String] = []; + for index376 = 0; index376 < (mbt_ffi_load32((iter_base) + 16)); index376 = index376 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index376 * 8) + + let result374 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array375.push(result374) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array375) + } + _ => panic() + } + + let lifted378 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted379 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted377, min_bytes : lifted378, max_bytes : lifted379}) + } + 26 => { + + let lifted383 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array381 : Array[String] = []; + for index382 = 0; index382 < (mbt_ffi_load32((iter_base) + 20)); index382 = index382 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index382 * 8) + + let result380 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array381.push(result380) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array381) + } + _ => panic() + } + + let lifted387 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array385 : Array[String] = []; + for index386 = 0; index386 < (mbt_ffi_load32((iter_base) + 32)); index386 = index386 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index386 * 8) + + let result384 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array385.push(result384) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array385) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted383, allowed_extensions : lifted387}) + } + 27 => { + + let lifted391 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array389 : Array[String] = []; + for index390 = 0; index390 < (mbt_ffi_load32((iter_base) + 16)); index390 = index390 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index390 * 8) + + let result388 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array389.push(result388) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array389) + } + _ => panic() + } + + let lifted395 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array393 : Array[String] = []; + for index394 = 0; index394 < (mbt_ffi_load32((iter_base) + 28)); index394 = index394 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index394 * 8) + + let result392 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array393.push(result392) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array393) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted391, allowed_hosts : lifted395}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result396 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array398 : Array[String] = []; + for index399 = 0; index399 < (mbt_ffi_load32((iter_base) + 20)); index399 = index399 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index399 * 8) + + let result397 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array398.push(result397) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted401 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result400 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result400}) + } + _ => panic() + } + + let lifted403 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result402 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result402}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result396, allowed_suffixes : array398, min : lifted401, max : lifted403}) + } + 31 => { + + let array427 : Array[@types.UnionBranch] = []; + for index428 = 0; index428 < (mbt_ffi_load32((iter_base) + 12)); index428 = index428 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index428 * 92) + + let result404 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted413 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result405 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result405) + } + 1 => { + + let result406 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result406) + } + 2 => { + + let result407 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result407) + } + 3 => { + + let result408 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result408) + } + 4 => { + + let result409 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted411 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result410 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result410) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result409, literal : lifted411}) + } + 5 => { + + let result412 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result412) + } + _ => panic() + } + + let lifted415 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result414 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result414) + } + _ => panic() + } + + let array417 : Array[String] = []; + for index418 = 0; index418 < (mbt_ffi_load32((iter_base) + 52)); index418 = index418 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index418 * 8) + + let result416 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array417.push(result416) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array420 : Array[String] = []; + for index421 = 0; index421 < (mbt_ffi_load32((iter_base) + 60)); index421 = index421 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index421 * 8) + + let result419 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array420.push(result419) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted423 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result422 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result422) + } + _ => panic() + } + + let lifted426 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted425 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result424 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result424) + } + _ => panic() + } + + Option::Some(lifted425) + } + _ => panic() + } + + array427.push(@types.UnionBranch::{tag : result404, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted413, metadata : @types.MetadataEnvelope::{doc : lifted415, aliases : array417, examples : array420, deprecated : lifted423, role : lifted426}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array427}) + } + 32 => { + + let lifted430 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result429 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result429) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted430}) + } + 33 => { + + let lifted432 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result431 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result431) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted432}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted433 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted433) + } + 36 => { + + let lifted434 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted434) + } + _ => panic() + } + + let lifted437 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result436 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result436) + } + _ => panic() + } + + let array439 : Array[String] = []; + for index440 = 0; index440 < (mbt_ffi_load32((iter_base) + 104)); index440 = index440 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index440 * 8) + + let result438 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array439.push(result438) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array442 : Array[String] = []; + for index443 = 0; index443 < (mbt_ffi_load32((iter_base) + 112)); index443 = index443 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index443 * 8) + + let result441 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array442.push(result441) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted445 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result444 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result444) + } + _ => panic() + } + + let lifted448 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted447 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result446 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result446) + } + _ => panic() + } + + Option::Some(lifted447) + } + _ => panic() + } + + array449.push(@types.SchemaTypeNode::{body : lifted435, metadata : @types.MetadataEnvelope::{doc : lifted437, aliases : array439, examples : array442, deprecated : lifted445, role : lifted448}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + let array454 : Array[@types.SchemaTypeDef] = []; + for index455 = 0; index455 < (mbt_ffi_load32((iter_base) + 64)); index455 = index455 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index455 * 24) + + let result451 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted453 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result452 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result452) + } + _ => panic() + } + + array454.push(@types.SchemaTypeDef::{id : result451, name : lifted453, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + let array485 : Array[@types.SchemaValueNode] = []; + for index486 = 0; index486 < (mbt_ffi_load32((iter_base) + 76)); index486 = index486 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 72)) + (index486 * 32) + + let lifted484 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result456 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result456) + } + 13 => { + + let array457 : Array[Int] = []; + for index458 = 0; index458 < (mbt_ffi_load32((iter_base) + 12)); index458 = index458 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index458 * 4) + + array457.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array457) + } + 14 => { + + let lifted459 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted459}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array460 : Array[Bool] = []; + for index461 = 0; index461 < (mbt_ffi_load32((iter_base) + 12)); index461 = index461 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index461 * 1) + + array460.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array460) + } + 17 => { + + let array462 : Array[Int] = []; + for index463 = 0; index463 < (mbt_ffi_load32((iter_base) + 12)); index463 = index463 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index463 * 4) + + array462.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array462) + } + 18 => { + + let array464 : Array[Int] = []; + for index465 = 0; index465 < (mbt_ffi_load32((iter_base) + 12)); index465 = index465 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index465 * 4) + + array464.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array464) + } + 19 => { + + let array466 : Array[Int] = []; + for index467 = 0; index467 < (mbt_ffi_load32((iter_base) + 12)); index467 = index467 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index467 * 4) + + array466.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array466) + } + 20 => { + + let array468 : Array[@types.MapEntry] = []; + for index469 = 0; index469 < (mbt_ffi_load32((iter_base) + 12)); index469 = index469 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index469 * 8) + + array468.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array468) + } + 21 => { + + let lifted470 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted470) + } + 22 => { + + let lifted473 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted471 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted471) + } + 1 => { + + let lifted472 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted472) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted473) + } + 23 => { + + let result474 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted476 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result475 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result475) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result474, language : lifted476}) + } + 24 => { + + let result477 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted479 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result478 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result478) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result477, mime_type : lifted479}) + } + 25 => { + + let result480 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result480) + } + 26 => { + + let result481 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result481) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result482 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result482}) + } + 30 => { + + let result483 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result483, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array485.push(lifted484) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 72)) + + Option::Some(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array449, defs : array454, root : mbt_ffi_load32((iter_base) + 68)}, value : @types.SchemaValueTree::{value_nodes : array485, root : mbt_ffi_load32((iter_base) + 80)}}) + } + _ => panic() + } + + let lifted490 = match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => { + + WrappedFunctionType::ReadLocal + } + 1 => { + + WrappedFunctionType::WriteLocal + } + 2 => { + + WrappedFunctionType::ReadRemote + } + 3 => { + + WrappedFunctionType::WriteRemote + } + 4 => { + + let lifted488 : UInt64? = match mbt_ffi_load8_u((iter_base) + 96) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 104)).reinterpret_as_uint64()) + } + _ => panic() + } + + WrappedFunctionType::WriteRemoteBatched(lifted488) + } + 5 => { + + let lifted489 : UInt64? = match mbt_ffi_load8_u((iter_base) + 96) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 104)).reinterpret_as_uint64()) + } + _ => panic() + } + + WrappedFunctionType::WriteRemoteTransaction(lifted489) + } + _ => panic() + } + + PublicOplogEntry::Start(StartParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, parent_start_index : lifted251, function_name : result252, request : lifted487, durable_function_type : lifted490}) + } + 2 => { + + let lifted725 : @types.TypedSchemaValue? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let array687 : Array[@types.SchemaTypeNode] = []; + for index688 = 0; index688 < (mbt_ffi_load32((iter_base) + 40)); index688 = index688 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index688 * 144) + + let lifted673 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted497 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted492 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted491 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted491) + } + _ => panic() + } + + let lifted494 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted493 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted493) + } + _ => panic() + } + + let lifted496 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result495 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result495) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted492, max : lifted494, unit : lifted496}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted497) + } + 3 => { + + let lifted504 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted499 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted498 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted498) + } + _ => panic() + } + + let lifted501 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted500 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted500) + } + _ => panic() + } + + let lifted503 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result502 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result502) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted499, max : lifted501, unit : lifted503}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted504) + } + 4 => { + + let lifted511 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted506 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted505 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted505) + } + _ => panic() + } + + let lifted508 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted507 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted507) + } + _ => panic() + } + + let lifted510 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result509 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result509) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted506, max : lifted508, unit : lifted510}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted511) + } + 5 => { + + let lifted518 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted513 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted512 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted512) + } + _ => panic() + } + + let lifted515 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted514 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted514) + } + _ => panic() + } + + let lifted517 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result516 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result516) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted513, max : lifted515, unit : lifted517}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted518) + } + 6 => { + + let lifted525 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted520 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted519 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted519) + } + _ => panic() + } + + let lifted522 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted521 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted521) + } + _ => panic() + } + + let lifted524 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result523 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result523) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted520, max : lifted522, unit : lifted524}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted525) + } + 7 => { + + let lifted532 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted527 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted526 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted526) + } + _ => panic() + } + + let lifted529 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted528 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted528) + } + _ => panic() + } + + let lifted531 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result530 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result530) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted527, max : lifted529, unit : lifted531}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted532) + } + 8 => { + + let lifted539 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted534 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted533 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted533) + } + _ => panic() + } + + let lifted536 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted535 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted535) + } + _ => panic() + } + + let lifted538 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result537 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result537) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted534, max : lifted536, unit : lifted538}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted539) + } + 9 => { + + let lifted546 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted541 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted540 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted540) + } + _ => panic() + } + + let lifted543 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted542 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted542) + } + _ => panic() + } + + let lifted545 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result544 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result544) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted541, max : lifted543, unit : lifted545}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted546) + } + 10 => { + + let lifted553 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted548 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted547 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted547) + } + _ => panic() + } + + let lifted550 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted549 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted549) + } + _ => panic() + } + + let lifted552 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result551 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result551) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted548, max : lifted550, unit : lifted552}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted553) + } + 11 => { + + let lifted560 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted555 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted554 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted554) + } + _ => panic() + } + + let lifted557 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted556 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted556) + } + _ => panic() + } + + let lifted559 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result558 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result558) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted555, max : lifted557, unit : lifted559}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted560) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array575 : Array[@types.NamedFieldType] = []; + for index576 = 0; index576 < (mbt_ffi_load32((iter_base) + 12)); index576 = index576 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index576 * 68) + + let result561 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted563 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result562 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result562) + } + _ => panic() + } + + let array565 : Array[String] = []; + for index566 = 0; index566 < (mbt_ffi_load32((iter_base) + 28)); index566 = index566 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index566 * 8) + + let result564 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array565.push(result564) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array568 : Array[String] = []; + for index569 = 0; index569 < (mbt_ffi_load32((iter_base) + 36)); index569 = index569 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index569 * 8) + + let result567 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array568.push(result567) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted571 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result570 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result570) + } + _ => panic() + } + + let lifted574 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted573 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result572 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result572) + } + _ => panic() + } + + Option::Some(lifted573) + } + _ => panic() + } + + array575.push(@types.NamedFieldType::{name : result561, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted563, aliases : array565, examples : array568, deprecated : lifted571, role : lifted574}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array575) + } + 15 => { + + let array592 : Array[@types.VariantCaseType] = []; + for index593 = 0; index593 < (mbt_ffi_load32((iter_base) + 12)); index593 = index593 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index593 * 72) + + let result577 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted578 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted580 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result579 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result579) + } + _ => panic() + } + + let array582 : Array[String] = []; + for index583 = 0; index583 < (mbt_ffi_load32((iter_base) + 32)); index583 = index583 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index583 * 8) + + let result581 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array582.push(result581) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array585 : Array[String] = []; + for index586 = 0; index586 < (mbt_ffi_load32((iter_base) + 40)); index586 = index586 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index586 * 8) + + let result584 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array585.push(result584) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted588 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result587 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result587) + } + _ => panic() + } + + let lifted591 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted590 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result589 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result589) + } + _ => panic() + } + + Option::Some(lifted590) + } + _ => panic() + } + + array592.push(@types.VariantCaseType::{name : result577, payload : lifted578, metadata : @types.MetadataEnvelope::{doc : lifted580, aliases : array582, examples : array585, deprecated : lifted588, role : lifted591}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array592) + } + 16 => { + + let array595 : Array[String] = []; + for index596 = 0; index596 < (mbt_ffi_load32((iter_base) + 12)); index596 = index596 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index596 * 8) + + let result594 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array595.push(result594) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array595) + } + 17 => { + + let array598 : Array[String] = []; + for index599 = 0; index599 < (mbt_ffi_load32((iter_base) + 12)); index599 = index599 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index599 * 8) + + let result597 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array598.push(result597) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array598) + } + 18 => { + + let array600 : Array[Int] = []; + for index601 = 0; index601 < (mbt_ffi_load32((iter_base) + 12)); index601 = index601 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index601 * 4) + + array600.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array600) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted602 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted603 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted602, err : lifted603}) + } + 24 => { + + let lifted607 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array605 : Array[String] = []; + for index606 = 0; index606 < (mbt_ffi_load32((iter_base) + 16)); index606 = index606 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index606 * 8) + + let result604 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array605.push(result604) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array605) + } + _ => panic() + } + + let lifted608 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted609 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted611 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result610 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result610) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted607, min_length : lifted608, max_length : lifted609, regex : lifted611}) + } + 25 => { + + let lifted615 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array613 : Array[String] = []; + for index614 = 0; index614 < (mbt_ffi_load32((iter_base) + 16)); index614 = index614 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index614 * 8) + + let result612 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array613.push(result612) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array613) + } + _ => panic() + } + + let lifted616 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted617 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted615, min_bytes : lifted616, max_bytes : lifted617}) + } + 26 => { + + let lifted621 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array619 : Array[String] = []; + for index620 = 0; index620 < (mbt_ffi_load32((iter_base) + 20)); index620 = index620 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index620 * 8) + + let result618 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array619.push(result618) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array619) + } + _ => panic() + } + + let lifted625 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array623 : Array[String] = []; + for index624 = 0; index624 < (mbt_ffi_load32((iter_base) + 32)); index624 = index624 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index624 * 8) + + let result622 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array623.push(result622) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array623) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted621, allowed_extensions : lifted625}) + } + 27 => { + + let lifted629 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array627 : Array[String] = []; + for index628 = 0; index628 < (mbt_ffi_load32((iter_base) + 16)); index628 = index628 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index628 * 8) + + let result626 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array627.push(result626) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array627) + } + _ => panic() + } + + let lifted633 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array631 : Array[String] = []; + for index632 = 0; index632 < (mbt_ffi_load32((iter_base) + 28)); index632 = index632 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index632 * 8) + + let result630 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array631.push(result630) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array631) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted629, allowed_hosts : lifted633}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result634 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array636 : Array[String] = []; + for index637 = 0; index637 < (mbt_ffi_load32((iter_base) + 20)); index637 = index637 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index637 * 8) + + let result635 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array636.push(result635) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted639 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result638 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result638}) + } + _ => panic() + } + + let lifted641 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result640 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result640}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result634, allowed_suffixes : array636, min : lifted639, max : lifted641}) + } + 31 => { + + let array665 : Array[@types.UnionBranch] = []; + for index666 = 0; index666 < (mbt_ffi_load32((iter_base) + 12)); index666 = index666 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index666 * 92) + + let result642 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted651 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result643 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result643) + } + 1 => { + + let result644 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result644) + } + 2 => { + + let result645 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result645) + } + 3 => { + + let result646 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result646) + } + 4 => { + + let result647 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted649 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result648 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result648) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result647, literal : lifted649}) + } + 5 => { + + let result650 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result650) + } + _ => panic() + } + + let lifted653 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result652 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result652) + } + _ => panic() + } + + let array655 : Array[String] = []; + for index656 = 0; index656 < (mbt_ffi_load32((iter_base) + 52)); index656 = index656 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index656 * 8) + + let result654 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array655.push(result654) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array658 : Array[String] = []; + for index659 = 0; index659 < (mbt_ffi_load32((iter_base) + 60)); index659 = index659 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index659 * 8) + + let result657 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array658.push(result657) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted661 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result660 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result660) + } + _ => panic() + } + + let lifted664 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted663 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result662 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result662) + } + _ => panic() + } + + Option::Some(lifted663) + } + _ => panic() + } + + array665.push(@types.UnionBranch::{tag : result642, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted651, metadata : @types.MetadataEnvelope::{doc : lifted653, aliases : array655, examples : array658, deprecated : lifted661, role : lifted664}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array665}) + } + 32 => { + + let lifted668 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result667 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result667) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted668}) + } + 33 => { + + let lifted670 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result669 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result669) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted670}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted671 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted671) + } + 36 => { + + let lifted672 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted672) + } + _ => panic() + } + + let lifted675 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result674 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result674) + } + _ => panic() + } + + let array677 : Array[String] = []; + for index678 = 0; index678 < (mbt_ffi_load32((iter_base) + 104)); index678 = index678 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index678 * 8) + + let result676 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array677.push(result676) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array680 : Array[String] = []; + for index681 = 0; index681 < (mbt_ffi_load32((iter_base) + 112)); index681 = index681 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index681 * 8) + + let result679 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array680.push(result679) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted683 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result682 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result682) + } + _ => panic() + } + + let lifted686 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted685 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result684 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result684) + } + _ => panic() + } + + Option::Some(lifted685) + } + _ => panic() + } + + array687.push(@types.SchemaTypeNode::{body : lifted673, metadata : @types.MetadataEnvelope::{doc : lifted675, aliases : array677, examples : array680, deprecated : lifted683, role : lifted686}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let array692 : Array[@types.SchemaTypeDef] = []; + for index693 = 0; index693 < (mbt_ffi_load32((iter_base) + 48)); index693 = index693 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index693 * 24) + + let result689 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted691 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result690 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result690) + } + _ => panic() + } + + array692.push(@types.SchemaTypeDef::{id : result689, name : lifted691, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + let array723 : Array[@types.SchemaValueNode] = []; + for index724 = 0; index724 < (mbt_ffi_load32((iter_base) + 60)); index724 = index724 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index724 * 32) + + let lifted722 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result694 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result694) + } + 13 => { + + let array695 : Array[Int] = []; + for index696 = 0; index696 < (mbt_ffi_load32((iter_base) + 12)); index696 = index696 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index696 * 4) + + array695.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array695) + } + 14 => { + + let lifted697 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted697}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array698 : Array[Bool] = []; + for index699 = 0; index699 < (mbt_ffi_load32((iter_base) + 12)); index699 = index699 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index699 * 1) + + array698.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array698) + } + 17 => { + + let array700 : Array[Int] = []; + for index701 = 0; index701 < (mbt_ffi_load32((iter_base) + 12)); index701 = index701 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index701 * 4) + + array700.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array700) + } + 18 => { + + let array702 : Array[Int] = []; + for index703 = 0; index703 < (mbt_ffi_load32((iter_base) + 12)); index703 = index703 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index703 * 4) + + array702.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array702) + } + 19 => { + + let array704 : Array[Int] = []; + for index705 = 0; index705 < (mbt_ffi_load32((iter_base) + 12)); index705 = index705 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index705 * 4) + + array704.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array704) + } + 20 => { + + let array706 : Array[@types.MapEntry] = []; + for index707 = 0; index707 < (mbt_ffi_load32((iter_base) + 12)); index707 = index707 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index707 * 8) + + array706.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array706) + } + 21 => { + + let lifted708 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted708) + } + 22 => { + + let lifted711 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted709 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted709) + } + 1 => { + + let lifted710 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted710) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted711) + } + 23 => { + + let result712 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted714 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result713 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result713) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result712, language : lifted714}) + } + 24 => { + + let result715 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted717 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result716 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result716) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result715, mime_type : lifted717}) + } + 25 => { + + let result718 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result718) + } + 26 => { + + let result719 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result719) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result720 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result720}) + } + 30 => { + + let result721 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result721, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array723.push(lifted722) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + Option::Some(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array687, defs : array692, root : mbt_ffi_load32((iter_base) + 52)}, value : @types.SchemaValueTree::{value_nodes : array723, root : mbt_ffi_load32((iter_base) + 64)}}) + } + _ => panic() + } + + PublicOplogEntry::End(EndParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, start_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), response : lifted725, forced_commit : (mbt_ffi_load8_u((iter_base) + 68) != 0)}) + } + 3 => { + + let lifted960 : @types.TypedSchemaValue? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let array922 : Array[@types.SchemaTypeNode] = []; + for index923 = 0; index923 < (mbt_ffi_load32((iter_base) + 40)); index923 = index923 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index923 * 144) + + let lifted908 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted732 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted727 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted726 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted726) + } + _ => panic() + } + + let lifted729 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted728 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted728) + } + _ => panic() + } + + let lifted731 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result730 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result730) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted727, max : lifted729, unit : lifted731}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted732) + } + 3 => { + + let lifted739 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted734 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted733 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted733) + } + _ => panic() + } + + let lifted736 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted735 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted735) + } + _ => panic() + } + + let lifted738 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result737 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result737) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted734, max : lifted736, unit : lifted738}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted739) + } + 4 => { + + let lifted746 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted741 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted740 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted740) + } + _ => panic() + } + + let lifted743 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted742 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted742) + } + _ => panic() + } + + let lifted745 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result744 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result744) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted741, max : lifted743, unit : lifted745}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted746) + } + 5 => { + + let lifted753 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted748 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted747 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted747) + } + _ => panic() + } + + let lifted750 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted749 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted749) + } + _ => panic() + } + + let lifted752 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result751 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result751) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted748, max : lifted750, unit : lifted752}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted753) + } + 6 => { + + let lifted760 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted755 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted754 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted754) + } + _ => panic() + } + + let lifted757 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted756 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted756) + } + _ => panic() + } + + let lifted759 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result758 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result758) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted755, max : lifted757, unit : lifted759}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted760) + } + 7 => { + + let lifted767 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted762 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted761 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted761) + } + _ => panic() + } + + let lifted764 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted763 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted763) + } + _ => panic() + } + + let lifted766 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result765 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result765) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted762, max : lifted764, unit : lifted766}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted767) + } + 8 => { + + let lifted774 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted769 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted768 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted768) + } + _ => panic() + } + + let lifted771 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted770 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted770) + } + _ => panic() + } + + let lifted773 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result772 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result772) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted769, max : lifted771, unit : lifted773}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted774) + } + 9 => { + + let lifted781 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted776 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted775 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted775) + } + _ => panic() + } + + let lifted778 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted777 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted777) + } + _ => panic() + } + + let lifted780 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result779 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result779) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted776, max : lifted778, unit : lifted780}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted781) + } + 10 => { + + let lifted788 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted783 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted782 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted782) + } + _ => panic() + } + + let lifted785 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted784 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted784) + } + _ => panic() + } + + let lifted787 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result786 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result786) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted783, max : lifted785, unit : lifted787}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted788) + } + 11 => { + + let lifted795 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted790 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted789 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted789) + } + _ => panic() + } + + let lifted792 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted791 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted791) + } + _ => panic() + } + + let lifted794 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result793 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result793) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted790, max : lifted792, unit : lifted794}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted795) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array810 : Array[@types.NamedFieldType] = []; + for index811 = 0; index811 < (mbt_ffi_load32((iter_base) + 12)); index811 = index811 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index811 * 68) + + let result796 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted798 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result797 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result797) + } + _ => panic() + } + + let array800 : Array[String] = []; + for index801 = 0; index801 < (mbt_ffi_load32((iter_base) + 28)); index801 = index801 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index801 * 8) + + let result799 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array800.push(result799) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array803 : Array[String] = []; + for index804 = 0; index804 < (mbt_ffi_load32((iter_base) + 36)); index804 = index804 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index804 * 8) + + let result802 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array803.push(result802) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted806 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result805 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result805) + } + _ => panic() + } + + let lifted809 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted808 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result807 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result807) + } + _ => panic() + } + + Option::Some(lifted808) + } + _ => panic() + } + + array810.push(@types.NamedFieldType::{name : result796, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted798, aliases : array800, examples : array803, deprecated : lifted806, role : lifted809}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array810) + } + 15 => { + + let array827 : Array[@types.VariantCaseType] = []; + for index828 = 0; index828 < (mbt_ffi_load32((iter_base) + 12)); index828 = index828 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index828 * 72) + + let result812 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted813 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted815 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result814 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result814) + } + _ => panic() + } + + let array817 : Array[String] = []; + for index818 = 0; index818 < (mbt_ffi_load32((iter_base) + 32)); index818 = index818 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index818 * 8) + + let result816 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array817.push(result816) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array820 : Array[String] = []; + for index821 = 0; index821 < (mbt_ffi_load32((iter_base) + 40)); index821 = index821 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index821 * 8) + + let result819 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array820.push(result819) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted823 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result822 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result822) + } + _ => panic() + } + + let lifted826 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted825 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result824 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result824) + } + _ => panic() + } + + Option::Some(lifted825) + } + _ => panic() + } + + array827.push(@types.VariantCaseType::{name : result812, payload : lifted813, metadata : @types.MetadataEnvelope::{doc : lifted815, aliases : array817, examples : array820, deprecated : lifted823, role : lifted826}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array827) + } + 16 => { + + let array830 : Array[String] = []; + for index831 = 0; index831 < (mbt_ffi_load32((iter_base) + 12)); index831 = index831 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index831 * 8) + + let result829 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array830.push(result829) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array830) + } + 17 => { + + let array833 : Array[String] = []; + for index834 = 0; index834 < (mbt_ffi_load32((iter_base) + 12)); index834 = index834 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index834 * 8) + + let result832 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array833.push(result832) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array833) + } + 18 => { + + let array835 : Array[Int] = []; + for index836 = 0; index836 < (mbt_ffi_load32((iter_base) + 12)); index836 = index836 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index836 * 4) + + array835.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array835) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted837 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted838 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted837, err : lifted838}) + } + 24 => { + + let lifted842 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array840 : Array[String] = []; + for index841 = 0; index841 < (mbt_ffi_load32((iter_base) + 16)); index841 = index841 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index841 * 8) + + let result839 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array840.push(result839) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array840) + } + _ => panic() + } + + let lifted843 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted844 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted846 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result845 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result845) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted842, min_length : lifted843, max_length : lifted844, regex : lifted846}) + } + 25 => { + + let lifted850 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array848 : Array[String] = []; + for index849 = 0; index849 < (mbt_ffi_load32((iter_base) + 16)); index849 = index849 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index849 * 8) + + let result847 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array848.push(result847) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array848) + } + _ => panic() + } + + let lifted851 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted852 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted850, min_bytes : lifted851, max_bytes : lifted852}) + } + 26 => { + + let lifted856 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array854 : Array[String] = []; + for index855 = 0; index855 < (mbt_ffi_load32((iter_base) + 20)); index855 = index855 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index855 * 8) + + let result853 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array854.push(result853) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array854) + } + _ => panic() + } + + let lifted860 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array858 : Array[String] = []; + for index859 = 0; index859 < (mbt_ffi_load32((iter_base) + 32)); index859 = index859 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index859 * 8) + + let result857 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array858.push(result857) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array858) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted856, allowed_extensions : lifted860}) + } + 27 => { + + let lifted864 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array862 : Array[String] = []; + for index863 = 0; index863 < (mbt_ffi_load32((iter_base) + 16)); index863 = index863 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index863 * 8) + + let result861 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array862.push(result861) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array862) + } + _ => panic() + } + + let lifted868 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array866 : Array[String] = []; + for index867 = 0; index867 < (mbt_ffi_load32((iter_base) + 28)); index867 = index867 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index867 * 8) + + let result865 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array866.push(result865) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array866) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted864, allowed_hosts : lifted868}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result869 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array871 : Array[String] = []; + for index872 = 0; index872 < (mbt_ffi_load32((iter_base) + 20)); index872 = index872 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index872 * 8) + + let result870 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array871.push(result870) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted874 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result873 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result873}) + } + _ => panic() + } + + let lifted876 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result875 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result875}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result869, allowed_suffixes : array871, min : lifted874, max : lifted876}) + } + 31 => { + + let array900 : Array[@types.UnionBranch] = []; + for index901 = 0; index901 < (mbt_ffi_load32((iter_base) + 12)); index901 = index901 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index901 * 92) + + let result877 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted886 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result878 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result878) + } + 1 => { + + let result879 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result879) + } + 2 => { + + let result880 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result880) + } + 3 => { + + let result881 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result881) + } + 4 => { + + let result882 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted884 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result883 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result883) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result882, literal : lifted884}) + } + 5 => { + + let result885 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result885) + } + _ => panic() + } + + let lifted888 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result887 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result887) + } + _ => panic() + } + + let array890 : Array[String] = []; + for index891 = 0; index891 < (mbt_ffi_load32((iter_base) + 52)); index891 = index891 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index891 * 8) + + let result889 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array890.push(result889) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array893 : Array[String] = []; + for index894 = 0; index894 < (mbt_ffi_load32((iter_base) + 60)); index894 = index894 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index894 * 8) + + let result892 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array893.push(result892) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted896 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result895 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result895) + } + _ => panic() + } + + let lifted899 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted898 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result897 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result897) + } + _ => panic() + } + + Option::Some(lifted898) + } + _ => panic() + } + + array900.push(@types.UnionBranch::{tag : result877, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted886, metadata : @types.MetadataEnvelope::{doc : lifted888, aliases : array890, examples : array893, deprecated : lifted896, role : lifted899}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array900}) + } + 32 => { + + let lifted903 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result902 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result902) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted903}) + } + 33 => { + + let lifted905 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result904 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result904) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted905}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted906 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted906) + } + 36 => { + + let lifted907 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted907) + } + _ => panic() + } + + let lifted910 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result909 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result909) + } + _ => panic() + } + + let array912 : Array[String] = []; + for index913 = 0; index913 < (mbt_ffi_load32((iter_base) + 104)); index913 = index913 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index913 * 8) + + let result911 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array912.push(result911) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array915 : Array[String] = []; + for index916 = 0; index916 < (mbt_ffi_load32((iter_base) + 112)); index916 = index916 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index916 * 8) + + let result914 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array915.push(result914) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted918 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result917 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result917) + } + _ => panic() + } + + let lifted921 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted920 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result919 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result919) + } + _ => panic() + } + + Option::Some(lifted920) + } + _ => panic() + } + + array922.push(@types.SchemaTypeNode::{body : lifted908, metadata : @types.MetadataEnvelope::{doc : lifted910, aliases : array912, examples : array915, deprecated : lifted918, role : lifted921}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let array927 : Array[@types.SchemaTypeDef] = []; + for index928 = 0; index928 < (mbt_ffi_load32((iter_base) + 48)); index928 = index928 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index928 * 24) + + let result924 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted926 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result925 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result925) + } + _ => panic() + } + + array927.push(@types.SchemaTypeDef::{id : result924, name : lifted926, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + let array958 : Array[@types.SchemaValueNode] = []; + for index959 = 0; index959 < (mbt_ffi_load32((iter_base) + 60)); index959 = index959 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index959 * 32) + + let lifted957 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result929 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result929) + } + 13 => { + + let array930 : Array[Int] = []; + for index931 = 0; index931 < (mbt_ffi_load32((iter_base) + 12)); index931 = index931 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index931 * 4) + + array930.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array930) + } + 14 => { + + let lifted932 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted932}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array933 : Array[Bool] = []; + for index934 = 0; index934 < (mbt_ffi_load32((iter_base) + 12)); index934 = index934 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index934 * 1) + + array933.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array933) + } + 17 => { + + let array935 : Array[Int] = []; + for index936 = 0; index936 < (mbt_ffi_load32((iter_base) + 12)); index936 = index936 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index936 * 4) + + array935.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array935) + } + 18 => { + + let array937 : Array[Int] = []; + for index938 = 0; index938 < (mbt_ffi_load32((iter_base) + 12)); index938 = index938 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index938 * 4) + + array937.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array937) + } + 19 => { + + let array939 : Array[Int] = []; + for index940 = 0; index940 < (mbt_ffi_load32((iter_base) + 12)); index940 = index940 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index940 * 4) + + array939.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array939) + } + 20 => { + + let array941 : Array[@types.MapEntry] = []; + for index942 = 0; index942 < (mbt_ffi_load32((iter_base) + 12)); index942 = index942 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index942 * 8) + + array941.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array941) + } + 21 => { + + let lifted943 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted943) + } + 22 => { + + let lifted946 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted944 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted944) + } + 1 => { + + let lifted945 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted945) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted946) + } + 23 => { + + let result947 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted949 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result948 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result948) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result947, language : lifted949}) + } + 24 => { + + let result950 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted952 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result951 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result951) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result950, mime_type : lifted952}) + } + 25 => { + + let result953 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result953) + } + 26 => { + + let result954 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result954) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result955 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result955}) + } + 30 => { + + let result956 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result956, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array958.push(lifted957) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + Option::Some(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array922, defs : array927, root : mbt_ffi_load32((iter_base) + 52)}, value : @types.SchemaValueTree::{value_nodes : array958, root : mbt_ffi_load32((iter_base) + 64)}}) + } + _ => panic() + } + + PublicOplogEntry::Cancelled(CancelledParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, start_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), partial : lifted960}) + } + 4 => { + + let lifted1473 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + let result961 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let array1158 : Array[@types.SchemaTypeNode] = []; + for index1159 = 0; index1159 < (mbt_ffi_load32((iter_base) + 44)); index1159 = index1159 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index1159 * 144) + + let lifted1144 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted968 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted963 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted962 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted962) + } + _ => panic() + } + + let lifted965 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted964 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted964) + } + _ => panic() + } + + let lifted967 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result966 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result966) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted963, max : lifted965, unit : lifted967}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted968) + } + 3 => { + + let lifted975 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted970 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted969 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted969) + } + _ => panic() + } + + let lifted972 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted971 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted971) + } + _ => panic() + } + + let lifted974 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result973 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result973) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted970, max : lifted972, unit : lifted974}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted975) + } + 4 => { + + let lifted982 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted977 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted976 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted976) + } + _ => panic() + } + + let lifted979 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted978 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted978) + } + _ => panic() + } + + let lifted981 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result980 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result980) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted977, max : lifted979, unit : lifted981}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted982) + } + 5 => { + + let lifted989 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted984 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted983 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted983) + } + _ => panic() + } + + let lifted986 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted985 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted985) + } + _ => panic() + } + + let lifted988 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result987 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result987) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted984, max : lifted986, unit : lifted988}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted989) + } + 6 => { + + let lifted996 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted991 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted990 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted990) + } + _ => panic() + } + + let lifted993 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted992 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted992) + } + _ => panic() + } + + let lifted995 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result994 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result994) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted991, max : lifted993, unit : lifted995}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted996) + } + 7 => { + + let lifted1003 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted998 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted997 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted997) + } + _ => panic() + } + + let lifted1000 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted999 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted999) + } + _ => panic() + } + + let lifted1002 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1001 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1001) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted998, max : lifted1000, unit : lifted1002}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1003) + } + 8 => { + + let lifted1010 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1005 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1004 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1004) + } + _ => panic() + } + + let lifted1007 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1006 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1006) + } + _ => panic() + } + + let lifted1009 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1008 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1008) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1005, max : lifted1007, unit : lifted1009}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1010) + } + 9 => { + + let lifted1017 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1012 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1011 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1011) + } + _ => panic() + } + + let lifted1014 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1013 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1013) + } + _ => panic() + } + + let lifted1016 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1015 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1015) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1012, max : lifted1014, unit : lifted1016}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1017) + } + 10 => { + + let lifted1024 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1019 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1018 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1018) + } + _ => panic() + } + + let lifted1021 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1020 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1020) + } + _ => panic() + } + + let lifted1023 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1022 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1022) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1019, max : lifted1021, unit : lifted1023}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted1024) + } + 11 => { + + let lifted1031 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1026 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1025 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1025) + } + _ => panic() + } + + let lifted1028 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1027 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1027) + } + _ => panic() + } + + let lifted1030 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1029 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1029) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1026, max : lifted1028, unit : lifted1030}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted1031) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array1046 : Array[@types.NamedFieldType] = []; + for index1047 = 0; index1047 < (mbt_ffi_load32((iter_base) + 12)); index1047 = index1047 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1047 * 68) + + let result1032 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1034 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1033 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1033) + } + _ => panic() + } + + let array1036 : Array[String] = []; + for index1037 = 0; index1037 < (mbt_ffi_load32((iter_base) + 28)); index1037 = index1037 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1037 * 8) + + let result1035 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1036.push(result1035) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array1039 : Array[String] = []; + for index1040 = 0; index1040 < (mbt_ffi_load32((iter_base) + 36)); index1040 = index1040 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1040 * 8) + + let result1038 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1039.push(result1038) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted1042 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result1041 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result1041) + } + _ => panic() + } + + let lifted1045 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted1044 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1043 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result1043) + } + _ => panic() + } + + Option::Some(lifted1044) + } + _ => panic() + } + + array1046.push(@types.NamedFieldType::{name : result1032, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted1034, aliases : array1036, examples : array1039, deprecated : lifted1042, role : lifted1045}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array1046) + } + 15 => { + + let array1063 : Array[@types.VariantCaseType] = []; + for index1064 = 0; index1064 < (mbt_ffi_load32((iter_base) + 12)); index1064 = index1064 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1064 * 72) + + let result1048 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1049 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1051 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1050 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1050) + } + _ => panic() + } + + let array1053 : Array[String] = []; + for index1054 = 0; index1054 < (mbt_ffi_load32((iter_base) + 32)); index1054 = index1054 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1054 * 8) + + let result1052 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1053.push(result1052) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array1056 : Array[String] = []; + for index1057 = 0; index1057 < (mbt_ffi_load32((iter_base) + 40)); index1057 = index1057 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1057 * 8) + + let result1055 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1056.push(result1055) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted1059 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result1058 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result1058) + } + _ => panic() + } + + let lifted1062 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted1061 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1060 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result1060) + } + _ => panic() + } + + Option::Some(lifted1061) + } + _ => panic() + } + + array1063.push(@types.VariantCaseType::{name : result1048, payload : lifted1049, metadata : @types.MetadataEnvelope::{doc : lifted1051, aliases : array1053, examples : array1056, deprecated : lifted1059, role : lifted1062}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array1063) + } + 16 => { + + let array1066 : Array[String] = []; + for index1067 = 0; index1067 < (mbt_ffi_load32((iter_base) + 12)); index1067 = index1067 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1067 * 8) + + let result1065 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1066.push(result1065) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array1066) + } + 17 => { + + let array1069 : Array[String] = []; + for index1070 = 0; index1070 < (mbt_ffi_load32((iter_base) + 12)); index1070 = index1070 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1070 * 8) + + let result1068 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1069.push(result1068) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array1069) + } + 18 => { + + let array1071 : Array[Int] = []; + for index1072 = 0; index1072 < (mbt_ffi_load32((iter_base) + 12)); index1072 = index1072 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1072 * 4) + + array1071.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array1071) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted1073 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1074 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted1073, err : lifted1074}) + } + 24 => { + + let lifted1078 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1076 : Array[String] = []; + for index1077 = 0; index1077 < (mbt_ffi_load32((iter_base) + 16)); index1077 = index1077 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1077 * 8) + + let result1075 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1076.push(result1075) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1076) + } + _ => panic() + } + + let lifted1079 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1080 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1082 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1081 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1081) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted1078, min_length : lifted1079, max_length : lifted1080, regex : lifted1082}) + } + 25 => { + + let lifted1086 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1084 : Array[String] = []; + for index1085 = 0; index1085 < (mbt_ffi_load32((iter_base) + 16)); index1085 = index1085 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1085 * 8) + + let result1083 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1084.push(result1083) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1084) + } + _ => panic() + } + + let lifted1087 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1088 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted1086, min_bytes : lifted1087, max_bytes : lifted1088}) + } + 26 => { + + let lifted1092 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array1090 : Array[String] = []; + for index1091 = 0; index1091 < (mbt_ffi_load32((iter_base) + 20)); index1091 = index1091 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1091 * 8) + + let result1089 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1090.push(result1089) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array1090) + } + _ => panic() + } + + let lifted1096 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array1094 : Array[String] = []; + for index1095 = 0; index1095 < (mbt_ffi_load32((iter_base) + 32)); index1095 = index1095 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1095 * 8) + + let result1093 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1094.push(result1093) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array1094) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted1092, allowed_extensions : lifted1096}) + } + 27 => { + + let lifted1100 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1098 : Array[String] = []; + for index1099 = 0; index1099 < (mbt_ffi_load32((iter_base) + 16)); index1099 = index1099 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1099 * 8) + + let result1097 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1098.push(result1097) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1098) + } + _ => panic() + } + + let lifted1104 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array1102 : Array[String] = []; + for index1103 = 0; index1103 < (mbt_ffi_load32((iter_base) + 28)); index1103 = index1103 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1103 * 8) + + let result1101 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1102.push(result1101) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array1102) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted1100, allowed_hosts : lifted1104}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result1105 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array1107 : Array[String] = []; + for index1108 = 0; index1108 < (mbt_ffi_load32((iter_base) + 20)); index1108 = index1108 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1108 * 8) + + let result1106 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1107.push(result1106) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted1110 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1109 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result1109}) + } + _ => panic() + } + + let lifted1112 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result1111 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result1111}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result1105, allowed_suffixes : array1107, min : lifted1110, max : lifted1112}) + } + 31 => { + + let array1136 : Array[@types.UnionBranch] = []; + for index1137 = 0; index1137 < (mbt_ffi_load32((iter_base) + 12)); index1137 = index1137 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1137 * 92) + + let result1113 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1122 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result1114 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result1114) + } + 1 => { + + let result1115 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result1115) + } + 2 => { + + let result1116 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result1116) + } + 3 => { + + let result1117 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result1117) + } + 4 => { + + let result1118 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted1120 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1119 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result1119) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result1118, literal : lifted1120}) + } + 5 => { + + let result1121 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result1121) + } + _ => panic() + } + + let lifted1124 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1123 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1123) + } + _ => panic() + } + + let array1126 : Array[String] = []; + for index1127 = 0; index1127 < (mbt_ffi_load32((iter_base) + 52)); index1127 = index1127 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1127 * 8) + + let result1125 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1126.push(result1125) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1129 : Array[String] = []; + for index1130 = 0; index1130 < (mbt_ffi_load32((iter_base) + 60)); index1130 = index1130 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1130 * 8) + + let result1128 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1129.push(result1128) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted1132 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1131 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1131) + } + _ => panic() + } + + let lifted1135 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted1134 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1133 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result1133) + } + _ => panic() + } + + Option::Some(lifted1134) + } + _ => panic() + } + + array1136.push(@types.UnionBranch::{tag : result1113, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted1122, metadata : @types.MetadataEnvelope::{doc : lifted1124, aliases : array1126, examples : array1129, deprecated : lifted1132, role : lifted1135}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array1136}) + } + 32 => { + + let lifted1139 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1138 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1138) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted1139}) + } + 33 => { + + let lifted1141 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1140 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1140) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted1141}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted1142 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted1142) + } + 36 => { + + let lifted1143 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted1143) + } + _ => panic() + } + + let lifted1146 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result1145 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result1145) + } + _ => panic() + } + + let array1148 : Array[String] = []; + for index1149 = 0; index1149 < (mbt_ffi_load32((iter_base) + 104)); index1149 = index1149 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index1149 * 8) + + let result1147 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1148.push(result1147) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array1151 : Array[String] = []; + for index1152 = 0; index1152 < (mbt_ffi_load32((iter_base) + 112)); index1152 = index1152 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index1152 * 8) + + let result1150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1151.push(result1150) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted1154 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result1153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result1153) + } + _ => panic() + } + + let lifted1157 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted1156 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result1155) + } + _ => panic() + } + + Option::Some(lifted1156) + } + _ => panic() + } + + array1158.push(@types.SchemaTypeNode::{body : lifted1144, metadata : @types.MetadataEnvelope::{doc : lifted1146, aliases : array1148, examples : array1151, deprecated : lifted1154, role : lifted1157}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let array1163 : Array[@types.SchemaTypeDef] = []; + for index1164 = 0; index1164 < (mbt_ffi_load32((iter_base) + 52)); index1164 = index1164 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1164 * 24) + + let result1160 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1162 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1161 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1161) + } + _ => panic() + } + + array1163.push(@types.SchemaTypeDef::{id : result1160, name : lifted1162, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1194 : Array[@types.SchemaValueNode] = []; + for index1195 = 0; index1195 < (mbt_ffi_load32((iter_base) + 64)); index1195 = index1195 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index1195 * 32) + + let lifted1193 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result1165 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result1165) + } + 13 => { + + let array1166 : Array[Int] = []; + for index1167 = 0; index1167 < (mbt_ffi_load32((iter_base) + 12)); index1167 = index1167 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1167 * 4) + + array1166.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array1166) + } + 14 => { + + let lifted1168 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted1168}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array1169 : Array[Bool] = []; + for index1170 = 0; index1170 < (mbt_ffi_load32((iter_base) + 12)); index1170 = index1170 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1170 * 1) + + array1169.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array1169) + } + 17 => { + + let array1171 : Array[Int] = []; + for index1172 = 0; index1172 < (mbt_ffi_load32((iter_base) + 12)); index1172 = index1172 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1172 * 4) + + array1171.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array1171) + } + 18 => { + + let array1173 : Array[Int] = []; + for index1174 = 0; index1174 < (mbt_ffi_load32((iter_base) + 12)); index1174 = index1174 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1174 * 4) + + array1173.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array1173) + } + 19 => { + + let array1175 : Array[Int] = []; + for index1176 = 0; index1176 < (mbt_ffi_load32((iter_base) + 12)); index1176 = index1176 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1176 * 4) + + array1175.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array1175) + } + 20 => { + + let array1177 : Array[@types.MapEntry] = []; + for index1178 = 0; index1178 < (mbt_ffi_load32((iter_base) + 12)); index1178 = index1178 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1178 * 8) + + array1177.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array1177) + } + 21 => { + + let lifted1179 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted1179) + } + 22 => { + + let lifted1182 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted1180 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted1180) + } + 1 => { + + let lifted1181 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted1181) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted1182) + } + 23 => { + + let result1183 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1185 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1184 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1184) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result1183, language : lifted1185}) + } + 24 => { + + let result1186 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1188 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1187 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1187) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result1186, mime_type : lifted1188}) + } + 25 => { + + let result1189 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result1189) + } + 26 => { + + let result1190 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result1190) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result1191 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result1191}) + } + 30 => { + + let result1192 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result1192, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array1194.push(lifted1193) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + let result1196 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 72), mbt_ffi_load32((iter_base) + 76)) + + let array1198 : Array[String] = []; + for index1199 = 0; index1199 < (mbt_ffi_load32((iter_base) + 84)); index1199 = index1199 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 80)) + (index1199 * 8) + + let result1197 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1198.push(result1197) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 80)) + + let array1213 : Array[Array[SpanData]] = []; + for index1214 = 0; index1214 < (mbt_ffi_load32((iter_base) + 92)); index1214 = index1214 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 88)) + (index1214 * 8) + + let array1211 : Array[SpanData] = []; + for index1212 = 0; index1212 < (mbt_ffi_load32((iter_base) + 4)); index1212 = index1212 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index1212 * 80) + + let lifted1210 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result1200 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1202 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result1201 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result1201) + } + _ => panic() + } + + let lifted1203 : UInt64? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + let array1207 : Array[@context.Attribute] = []; + for index1208 = 0; index1208 < (mbt_ffi_load32((iter_base) + 68)); index1208 = index1208 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index1208 * 20) + + let result1204 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1206 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result1205 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + @context.AttributeValue::String(result1205) + } + _ => panic() + } + + array1207.push(@context.Attribute::{key : result1204, value : lifted1206}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + SpanData::LocalSpan(LocalSpanData::{span_id : result1200, start : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent : lifted1202, linked_context : lifted1203, attributes : array1207, inherited : (mbt_ffi_load8_u((iter_base) + 72) != 0)}) + } + 1 => { + + let result1209 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + SpanData::ExternalSpan(ExternalSpanData::{span_id : result1209}) + } + _ => panic() + } + + array1211.push(lifted1210) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array1213.push(array1211) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + + AgentInvocation::AgentInitialization(AgentInitializationParameters::{idempotency_key : result961, constructor_parameters : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array1158, defs : array1163, root : mbt_ffi_load32((iter_base) + 56)}, value : @types.SchemaValueTree::{value_nodes : array1194, root : mbt_ffi_load32((iter_base) + 68)}}, trace_id : result1196, trace_states : array1198, invocation_context : array1213}) + } + 1 => { + + let result1215 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let result1216 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + let array1413 : Array[@types.SchemaTypeNode] = []; + for index1414 = 0; index1414 < (mbt_ffi_load32((iter_base) + 52)); index1414 = index1414 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1414 * 144) + + let lifted1399 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted1223 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1218 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1217 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1217) + } + _ => panic() + } + + let lifted1220 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1219 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1219) + } + _ => panic() + } + + let lifted1222 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1221 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1221) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1218, max : lifted1220, unit : lifted1222}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted1223) + } + 3 => { + + let lifted1230 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1225 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1224 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1224) + } + _ => panic() + } + + let lifted1227 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1226 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1226) + } + _ => panic() + } + + let lifted1229 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1228 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1228) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1225, max : lifted1227, unit : lifted1229}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted1230) + } + 4 => { + + let lifted1237 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1232 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1231 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1231) + } + _ => panic() + } + + let lifted1234 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1233 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1233) + } + _ => panic() + } + + let lifted1236 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1235 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1235) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1232, max : lifted1234, unit : lifted1236}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted1237) + } + 5 => { + + let lifted1244 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1239 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1238 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1238) + } + _ => panic() + } + + let lifted1241 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1240 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1240) + } + _ => panic() + } + + let lifted1243 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1242 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1242) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1239, max : lifted1241, unit : lifted1243}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted1244) + } + 6 => { + + let lifted1251 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1246 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1245 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1245) + } + _ => panic() + } + + let lifted1248 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1247 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1247) + } + _ => panic() + } + + let lifted1250 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1249 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1249) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1246, max : lifted1248, unit : lifted1250}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted1251) + } + 7 => { + + let lifted1258 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1253 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1252 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1252) + } + _ => panic() + } + + let lifted1255 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1254 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1254) + } + _ => panic() + } + + let lifted1257 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1256 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1256) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1253, max : lifted1255, unit : lifted1257}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1258) + } + 8 => { + + let lifted1265 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1260 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1259 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1259) + } + _ => panic() + } + + let lifted1262 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1261 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1261) + } + _ => panic() + } + + let lifted1264 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1263 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1263) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1260, max : lifted1262, unit : lifted1264}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1265) + } + 9 => { + + let lifted1272 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1267 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1266 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1266) + } + _ => panic() + } + + let lifted1269 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1268 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1268) + } + _ => panic() + } + + let lifted1271 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1270 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1270) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1267, max : lifted1269, unit : lifted1271}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1272) + } + 10 => { + + let lifted1279 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1274 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1273 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1273) + } + _ => panic() + } + + let lifted1276 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1275 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1275) + } + _ => panic() + } + + let lifted1278 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1277 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1277) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1274, max : lifted1276, unit : lifted1278}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted1279) + } + 11 => { + + let lifted1286 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1281 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1280 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1280) + } + _ => panic() + } + + let lifted1283 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1282 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1282) + } + _ => panic() + } + + let lifted1285 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1284 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1284) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1281, max : lifted1283, unit : lifted1285}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted1286) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array1301 : Array[@types.NamedFieldType] = []; + for index1302 = 0; index1302 < (mbt_ffi_load32((iter_base) + 12)); index1302 = index1302 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1302 * 68) + + let result1287 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1289 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1288 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1288) + } + _ => panic() + } + + let array1291 : Array[String] = []; + for index1292 = 0; index1292 < (mbt_ffi_load32((iter_base) + 28)); index1292 = index1292 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1292 * 8) + + let result1290 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1291.push(result1290) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array1294 : Array[String] = []; + for index1295 = 0; index1295 < (mbt_ffi_load32((iter_base) + 36)); index1295 = index1295 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1295 * 8) + + let result1293 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1294.push(result1293) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted1297 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result1296 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result1296) + } + _ => panic() + } + + let lifted1300 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted1299 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1298 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result1298) + } + _ => panic() + } + + Option::Some(lifted1299) + } + _ => panic() + } + + array1301.push(@types.NamedFieldType::{name : result1287, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted1289, aliases : array1291, examples : array1294, deprecated : lifted1297, role : lifted1300}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array1301) + } + 15 => { + + let array1318 : Array[@types.VariantCaseType] = []; + for index1319 = 0; index1319 < (mbt_ffi_load32((iter_base) + 12)); index1319 = index1319 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1319 * 72) + + let result1303 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1304 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1306 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1305 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1305) + } + _ => panic() + } + + let array1308 : Array[String] = []; + for index1309 = 0; index1309 < (mbt_ffi_load32((iter_base) + 32)); index1309 = index1309 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1309 * 8) + + let result1307 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1308.push(result1307) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array1311 : Array[String] = []; + for index1312 = 0; index1312 < (mbt_ffi_load32((iter_base) + 40)); index1312 = index1312 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1312 * 8) + + let result1310 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1311.push(result1310) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted1314 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result1313 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result1313) + } + _ => panic() + } + + let lifted1317 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted1316 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1315 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result1315) + } + _ => panic() + } + + Option::Some(lifted1316) + } + _ => panic() + } + + array1318.push(@types.VariantCaseType::{name : result1303, payload : lifted1304, metadata : @types.MetadataEnvelope::{doc : lifted1306, aliases : array1308, examples : array1311, deprecated : lifted1314, role : lifted1317}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array1318) + } + 16 => { + + let array1321 : Array[String] = []; + for index1322 = 0; index1322 < (mbt_ffi_load32((iter_base) + 12)); index1322 = index1322 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1322 * 8) + + let result1320 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1321.push(result1320) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array1321) + } + 17 => { + + let array1324 : Array[String] = []; + for index1325 = 0; index1325 < (mbt_ffi_load32((iter_base) + 12)); index1325 = index1325 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1325 * 8) + + let result1323 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1324.push(result1323) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array1324) + } + 18 => { + + let array1326 : Array[Int] = []; + for index1327 = 0; index1327 < (mbt_ffi_load32((iter_base) + 12)); index1327 = index1327 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1327 * 4) + + array1326.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array1326) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted1328 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1329 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted1328, err : lifted1329}) + } + 24 => { + + let lifted1333 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1331 : Array[String] = []; + for index1332 = 0; index1332 < (mbt_ffi_load32((iter_base) + 16)); index1332 = index1332 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1332 * 8) + + let result1330 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1331.push(result1330) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1331) + } + _ => panic() + } + + let lifted1334 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1335 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1337 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1336 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1336) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted1333, min_length : lifted1334, max_length : lifted1335, regex : lifted1337}) + } + 25 => { + + let lifted1341 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1339 : Array[String] = []; + for index1340 = 0; index1340 < (mbt_ffi_load32((iter_base) + 16)); index1340 = index1340 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1340 * 8) + + let result1338 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1339.push(result1338) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1339) + } + _ => panic() + } + + let lifted1342 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1343 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted1341, min_bytes : lifted1342, max_bytes : lifted1343}) + } + 26 => { + + let lifted1347 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array1345 : Array[String] = []; + for index1346 = 0; index1346 < (mbt_ffi_load32((iter_base) + 20)); index1346 = index1346 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1346 * 8) + + let result1344 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1345.push(result1344) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array1345) + } + _ => panic() + } + + let lifted1351 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array1349 : Array[String] = []; + for index1350 = 0; index1350 < (mbt_ffi_load32((iter_base) + 32)); index1350 = index1350 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1350 * 8) + + let result1348 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1349.push(result1348) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array1349) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted1347, allowed_extensions : lifted1351}) + } + 27 => { + + let lifted1355 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1353 : Array[String] = []; + for index1354 = 0; index1354 < (mbt_ffi_load32((iter_base) + 16)); index1354 = index1354 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1354 * 8) + + let result1352 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1353.push(result1352) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1353) + } + _ => panic() + } + + let lifted1359 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array1357 : Array[String] = []; + for index1358 = 0; index1358 < (mbt_ffi_load32((iter_base) + 28)); index1358 = index1358 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1358 * 8) + + let result1356 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1357.push(result1356) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array1357) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted1355, allowed_hosts : lifted1359}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result1360 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array1362 : Array[String] = []; + for index1363 = 0; index1363 < (mbt_ffi_load32((iter_base) + 20)); index1363 = index1363 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1363 * 8) + + let result1361 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1362.push(result1361) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted1365 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1364 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result1364}) + } + _ => panic() + } + + let lifted1367 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result1366 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result1366}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result1360, allowed_suffixes : array1362, min : lifted1365, max : lifted1367}) + } + 31 => { + + let array1391 : Array[@types.UnionBranch] = []; + for index1392 = 0; index1392 < (mbt_ffi_load32((iter_base) + 12)); index1392 = index1392 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1392 * 92) + + let result1368 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1377 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result1369 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result1369) + } + 1 => { + + let result1370 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result1370) + } + 2 => { + + let result1371 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result1371) + } + 3 => { + + let result1372 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result1372) + } + 4 => { + + let result1373 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted1375 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1374 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result1374) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result1373, literal : lifted1375}) + } + 5 => { + + let result1376 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result1376) + } + _ => panic() + } + + let lifted1379 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1378 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1378) + } + _ => panic() + } + + let array1381 : Array[String] = []; + for index1382 = 0; index1382 < (mbt_ffi_load32((iter_base) + 52)); index1382 = index1382 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1382 * 8) + + let result1380 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1381.push(result1380) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1384 : Array[String] = []; + for index1385 = 0; index1385 < (mbt_ffi_load32((iter_base) + 60)); index1385 = index1385 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1385 * 8) + + let result1383 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1384.push(result1383) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted1387 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1386 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1386) + } + _ => panic() + } + + let lifted1390 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted1389 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1388 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result1388) + } + _ => panic() + } + + Option::Some(lifted1389) + } + _ => panic() + } + + array1391.push(@types.UnionBranch::{tag : result1368, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted1377, metadata : @types.MetadataEnvelope::{doc : lifted1379, aliases : array1381, examples : array1384, deprecated : lifted1387, role : lifted1390}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array1391}) + } + 32 => { + + let lifted1394 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1393 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1393) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted1394}) + } + 33 => { + + let lifted1396 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1395 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1395) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted1396}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted1397 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted1397) + } + 36 => { + + let lifted1398 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted1398) + } + _ => panic() + } + + let lifted1401 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result1400 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result1400) + } + _ => panic() + } + + let array1403 : Array[String] = []; + for index1404 = 0; index1404 < (mbt_ffi_load32((iter_base) + 104)); index1404 = index1404 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index1404 * 8) + + let result1402 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1403.push(result1402) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array1406 : Array[String] = []; + for index1407 = 0; index1407 < (mbt_ffi_load32((iter_base) + 112)); index1407 = index1407 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index1407 * 8) + + let result1405 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1406.push(result1405) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted1409 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result1408 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result1408) + } + _ => panic() + } + + let lifted1412 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted1411 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1410 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result1410) + } + _ => panic() + } + + Option::Some(lifted1411) + } + _ => panic() + } + + array1413.push(@types.SchemaTypeNode::{body : lifted1399, metadata : @types.MetadataEnvelope::{doc : lifted1401, aliases : array1403, examples : array1406, deprecated : lifted1409, role : lifted1412}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1418 : Array[@types.SchemaTypeDef] = []; + for index1419 = 0; index1419 < (mbt_ffi_load32((iter_base) + 60)); index1419 = index1419 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1419 * 24) + + let result1415 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1417 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1416 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1416) + } + _ => panic() + } + + array1418.push(@types.SchemaTypeDef::{id : result1415, name : lifted1417, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let array1449 : Array[@types.SchemaValueNode] = []; + for index1450 = 0; index1450 < (mbt_ffi_load32((iter_base) + 72)); index1450 = index1450 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index1450 * 32) + + let lifted1448 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result1420 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result1420) + } + 13 => { + + let array1421 : Array[Int] = []; + for index1422 = 0; index1422 < (mbt_ffi_load32((iter_base) + 12)); index1422 = index1422 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1422 * 4) + + array1421.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array1421) + } + 14 => { + + let lifted1423 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted1423}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array1424 : Array[Bool] = []; + for index1425 = 0; index1425 < (mbt_ffi_load32((iter_base) + 12)); index1425 = index1425 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1425 * 1) + + array1424.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array1424) + } + 17 => { + + let array1426 : Array[Int] = []; + for index1427 = 0; index1427 < (mbt_ffi_load32((iter_base) + 12)); index1427 = index1427 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1427 * 4) + + array1426.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array1426) + } + 18 => { + + let array1428 : Array[Int] = []; + for index1429 = 0; index1429 < (mbt_ffi_load32((iter_base) + 12)); index1429 = index1429 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1429 * 4) + + array1428.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array1428) + } + 19 => { + + let array1430 : Array[Int] = []; + for index1431 = 0; index1431 < (mbt_ffi_load32((iter_base) + 12)); index1431 = index1431 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1431 * 4) + + array1430.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array1430) + } + 20 => { + + let array1432 : Array[@types.MapEntry] = []; + for index1433 = 0; index1433 < (mbt_ffi_load32((iter_base) + 12)); index1433 = index1433 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1433 * 8) + + array1432.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array1432) + } + 21 => { + + let lifted1434 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted1434) + } + 22 => { + + let lifted1437 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted1435 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted1435) + } + 1 => { + + let lifted1436 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted1436) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted1437) + } + 23 => { + + let result1438 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1440 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1439 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1439) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result1438, language : lifted1440}) + } + 24 => { + + let result1441 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1443 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1442 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1442) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result1441, mime_type : lifted1443}) + } + 25 => { + + let result1444 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result1444) + } + 26 => { + + let result1445 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result1445) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result1446 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result1446}) + } + 30 => { + + let result1447 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result1447, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array1449.push(lifted1448) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + let result1451 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 80), mbt_ffi_load32((iter_base) + 84)) + + let array1453 : Array[String] = []; + for index1454 = 0; index1454 < (mbt_ffi_load32((iter_base) + 92)); index1454 = index1454 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 88)) + (index1454 * 8) + + let result1452 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1453.push(result1452) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + + let array1468 : Array[Array[SpanData]] = []; + for index1469 = 0; index1469 < (mbt_ffi_load32((iter_base) + 100)); index1469 = index1469 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 96)) + (index1469 * 8) + + let array1466 : Array[SpanData] = []; + for index1467 = 0; index1467 < (mbt_ffi_load32((iter_base) + 4)); index1467 = index1467 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index1467 * 80) + + let lifted1465 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result1455 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1457 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result1456 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result1456) + } + _ => panic() + } + + let lifted1458 : UInt64? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + let array1462 : Array[@context.Attribute] = []; + for index1463 = 0; index1463 < (mbt_ffi_load32((iter_base) + 68)); index1463 = index1463 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index1463 * 20) + + let result1459 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1461 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result1460 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + @context.AttributeValue::String(result1460) + } + _ => panic() + } + + array1462.push(@context.Attribute::{key : result1459, value : lifted1461}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + SpanData::LocalSpan(LocalSpanData::{span_id : result1455, start : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent : lifted1457, linked_context : lifted1458, attributes : array1462, inherited : (mbt_ffi_load8_u((iter_base) + 72) != 0)}) + } + 1 => { + + let result1464 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + SpanData::ExternalSpan(ExternalSpanData::{span_id : result1464}) + } + _ => panic() + } + + array1466.push(lifted1465) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array1468.push(array1466) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 96)) + + AgentInvocation::AgentMethodInvocation(AgentMethodInvocationParameters::{idempotency_key : result1215, method_name : result1216, function_input : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array1413, defs : array1418, root : mbt_ffi_load32((iter_base) + 64)}, value : @types.SchemaValueTree::{value_nodes : array1449, root : mbt_ffi_load32((iter_base) + 76)}}, trace_id : result1451, trace_states : array1453, invocation_context : array1468}) + } + 2 => { + + AgentInvocation::SaveSnapshot + } + 3 => { + + let result1470 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let result1471 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + AgentInvocation::LoadSnapshot(LoadSnapshotParameters::{snapshot : SnapshotData::{data : result1470, mime_type : result1471}}) + } + 4 => { + + let result1472 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + AgentInvocation::ProcessOplogEntries(ProcessOplogEntriesParameters::{idempotency_key : result1472}) + } + 5 => { + + AgentInvocation::ManualUpdate(ManualUpdateParameters::{target_revision : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}) + } + _ => panic() + } + + PublicOplogEntry::AgentInvocationStarted(AgentInvocationStartedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, invocation : lifted1473}) + } + 5 => { + + let lifted1948 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + let array1670 : Array[@types.SchemaTypeNode] = []; + for index1671 = 0; index1671 < (mbt_ffi_load32((iter_base) + 32)); index1671 = index1671 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1671 * 144) + + let lifted1656 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted1480 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1475 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1474 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1474) + } + _ => panic() + } + + let lifted1477 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1476 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1476) + } + _ => panic() + } + + let lifted1479 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1478 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1478) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1475, max : lifted1477, unit : lifted1479}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted1480) + } + 3 => { + + let lifted1487 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1482 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1481 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1481) + } + _ => panic() + } + + let lifted1484 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1483 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1483) + } + _ => panic() + } + + let lifted1486 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1485 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1485) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1482, max : lifted1484, unit : lifted1486}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted1487) + } + 4 => { + + let lifted1494 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1489 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1488 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1488) + } + _ => panic() + } + + let lifted1491 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1490 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1490) + } + _ => panic() + } + + let lifted1493 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1492 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1492) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1489, max : lifted1491, unit : lifted1493}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted1494) + } + 5 => { + + let lifted1501 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1496 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1495 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1495) + } + _ => panic() + } + + let lifted1498 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1497 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1497) + } + _ => panic() + } + + let lifted1500 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1499 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1499) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1496, max : lifted1498, unit : lifted1500}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted1501) + } + 6 => { + + let lifted1508 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1503 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1502 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1502) + } + _ => panic() + } + + let lifted1505 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1504 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1504) + } + _ => panic() + } + + let lifted1507 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1506 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1506) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1503, max : lifted1505, unit : lifted1507}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted1508) + } + 7 => { + + let lifted1515 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1510 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1509 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1509) + } + _ => panic() + } + + let lifted1512 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1511 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1511) + } + _ => panic() + } + + let lifted1514 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1513 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1513) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1510, max : lifted1512, unit : lifted1514}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1515) + } + 8 => { + + let lifted1522 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1517 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1516 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1516) + } + _ => panic() + } + + let lifted1519 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1518 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1518) + } + _ => panic() + } + + let lifted1521 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1520 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1520) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1517, max : lifted1519, unit : lifted1521}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1522) + } + 9 => { + + let lifted1529 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1524 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1523 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1523) + } + _ => panic() + } + + let lifted1526 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1525 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1525) + } + _ => panic() + } + + let lifted1528 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1527 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1527) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1524, max : lifted1526, unit : lifted1528}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1529) + } + 10 => { + + let lifted1536 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1531 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1530 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1530) + } + _ => panic() + } + + let lifted1533 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1532 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1532) + } + _ => panic() + } + + let lifted1535 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1534 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1534) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1531, max : lifted1533, unit : lifted1535}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted1536) + } + 11 => { + + let lifted1543 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1538 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1537 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1537) + } + _ => panic() + } + + let lifted1540 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1539 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1539) + } + _ => panic() + } + + let lifted1542 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1541 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1541) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1538, max : lifted1540, unit : lifted1542}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted1543) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array1558 : Array[@types.NamedFieldType] = []; + for index1559 = 0; index1559 < (mbt_ffi_load32((iter_base) + 12)); index1559 = index1559 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1559 * 68) + + let result1544 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1546 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1545 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1545) + } + _ => panic() + } + + let array1548 : Array[String] = []; + for index1549 = 0; index1549 < (mbt_ffi_load32((iter_base) + 28)); index1549 = index1549 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1549 * 8) + + let result1547 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1548.push(result1547) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array1551 : Array[String] = []; + for index1552 = 0; index1552 < (mbt_ffi_load32((iter_base) + 36)); index1552 = index1552 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1552 * 8) + + let result1550 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1551.push(result1550) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted1554 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result1553 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result1553) + } + _ => panic() + } + + let lifted1557 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted1556 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1555 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result1555) + } + _ => panic() + } + + Option::Some(lifted1556) + } + _ => panic() + } + + array1558.push(@types.NamedFieldType::{name : result1544, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted1546, aliases : array1548, examples : array1551, deprecated : lifted1554, role : lifted1557}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array1558) + } + 15 => { + + let array1575 : Array[@types.VariantCaseType] = []; + for index1576 = 0; index1576 < (mbt_ffi_load32((iter_base) + 12)); index1576 = index1576 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1576 * 72) + + let result1560 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1561 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1563 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1562 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1562) + } + _ => panic() + } + + let array1565 : Array[String] = []; + for index1566 = 0; index1566 < (mbt_ffi_load32((iter_base) + 32)); index1566 = index1566 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1566 * 8) + + let result1564 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1565.push(result1564) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array1568 : Array[String] = []; + for index1569 = 0; index1569 < (mbt_ffi_load32((iter_base) + 40)); index1569 = index1569 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1569 * 8) + + let result1567 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1568.push(result1567) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted1571 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result1570 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result1570) + } + _ => panic() + } + + let lifted1574 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted1573 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1572 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result1572) + } + _ => panic() + } + + Option::Some(lifted1573) + } + _ => panic() + } + + array1575.push(@types.VariantCaseType::{name : result1560, payload : lifted1561, metadata : @types.MetadataEnvelope::{doc : lifted1563, aliases : array1565, examples : array1568, deprecated : lifted1571, role : lifted1574}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array1575) + } + 16 => { + + let array1578 : Array[String] = []; + for index1579 = 0; index1579 < (mbt_ffi_load32((iter_base) + 12)); index1579 = index1579 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1579 * 8) + + let result1577 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1578.push(result1577) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array1578) + } + 17 => { + + let array1581 : Array[String] = []; + for index1582 = 0; index1582 < (mbt_ffi_load32((iter_base) + 12)); index1582 = index1582 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1582 * 8) + + let result1580 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1581.push(result1580) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array1581) + } + 18 => { + + let array1583 : Array[Int] = []; + for index1584 = 0; index1584 < (mbt_ffi_load32((iter_base) + 12)); index1584 = index1584 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1584 * 4) + + array1583.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array1583) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted1585 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1586 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted1585, err : lifted1586}) + } + 24 => { + + let lifted1590 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1588 : Array[String] = []; + for index1589 = 0; index1589 < (mbt_ffi_load32((iter_base) + 16)); index1589 = index1589 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1589 * 8) + + let result1587 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1588.push(result1587) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1588) + } + _ => panic() + } + + let lifted1591 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1592 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1594 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1593 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1593) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted1590, min_length : lifted1591, max_length : lifted1592, regex : lifted1594}) + } + 25 => { + + let lifted1598 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1596 : Array[String] = []; + for index1597 = 0; index1597 < (mbt_ffi_load32((iter_base) + 16)); index1597 = index1597 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1597 * 8) + + let result1595 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1596.push(result1595) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1596) + } + _ => panic() + } + + let lifted1599 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1600 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted1598, min_bytes : lifted1599, max_bytes : lifted1600}) + } + 26 => { + + let lifted1604 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array1602 : Array[String] = []; + for index1603 = 0; index1603 < (mbt_ffi_load32((iter_base) + 20)); index1603 = index1603 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1603 * 8) + + let result1601 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1602.push(result1601) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array1602) + } + _ => panic() + } + + let lifted1608 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array1606 : Array[String] = []; + for index1607 = 0; index1607 < (mbt_ffi_load32((iter_base) + 32)); index1607 = index1607 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1607 * 8) + + let result1605 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1606.push(result1605) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array1606) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted1604, allowed_extensions : lifted1608}) + } + 27 => { + + let lifted1612 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1610 : Array[String] = []; + for index1611 = 0; index1611 < (mbt_ffi_load32((iter_base) + 16)); index1611 = index1611 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1611 * 8) + + let result1609 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1610.push(result1609) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1610) + } + _ => panic() + } + + let lifted1616 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array1614 : Array[String] = []; + for index1615 = 0; index1615 < (mbt_ffi_load32((iter_base) + 28)); index1615 = index1615 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1615 * 8) + + let result1613 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1614.push(result1613) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array1614) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted1612, allowed_hosts : lifted1616}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result1617 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array1619 : Array[String] = []; + for index1620 = 0; index1620 < (mbt_ffi_load32((iter_base) + 20)); index1620 = index1620 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1620 * 8) + + let result1618 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1619.push(result1618) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted1622 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1621 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result1621}) + } + _ => panic() + } + + let lifted1624 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result1623 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result1623}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result1617, allowed_suffixes : array1619, min : lifted1622, max : lifted1624}) + } + 31 => { + + let array1648 : Array[@types.UnionBranch] = []; + for index1649 = 0; index1649 < (mbt_ffi_load32((iter_base) + 12)); index1649 = index1649 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1649 * 92) + + let result1625 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1634 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result1626 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result1626) + } + 1 => { + + let result1627 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result1627) + } + 2 => { + + let result1628 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result1628) + } + 3 => { + + let result1629 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result1629) + } + 4 => { + + let result1630 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted1632 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1631 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result1631) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result1630, literal : lifted1632}) + } + 5 => { + + let result1633 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result1633) + } + _ => panic() + } + + let lifted1636 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1635 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1635) + } + _ => panic() + } + + let array1638 : Array[String] = []; + for index1639 = 0; index1639 < (mbt_ffi_load32((iter_base) + 52)); index1639 = index1639 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1639 * 8) + + let result1637 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1638.push(result1637) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1641 : Array[String] = []; + for index1642 = 0; index1642 < (mbt_ffi_load32((iter_base) + 60)); index1642 = index1642 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1642 * 8) + + let result1640 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1641.push(result1640) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted1644 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1643 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1643) + } + _ => panic() + } + + let lifted1647 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted1646 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1645 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result1645) + } + _ => panic() + } + + Option::Some(lifted1646) + } + _ => panic() + } + + array1648.push(@types.UnionBranch::{tag : result1625, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted1634, metadata : @types.MetadataEnvelope::{doc : lifted1636, aliases : array1638, examples : array1641, deprecated : lifted1644, role : lifted1647}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array1648}) + } + 32 => { + + let lifted1651 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1650 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1650) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted1651}) + } + 33 => { + + let lifted1653 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1652 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1652) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted1653}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted1654 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted1654) + } + 36 => { + + let lifted1655 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted1655) + } + _ => panic() + } + + let lifted1658 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result1657 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result1657) + } + _ => panic() + } + + let array1660 : Array[String] = []; + for index1661 = 0; index1661 < (mbt_ffi_load32((iter_base) + 104)); index1661 = index1661 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index1661 * 8) + + let result1659 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1660.push(result1659) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array1663 : Array[String] = []; + for index1664 = 0; index1664 < (mbt_ffi_load32((iter_base) + 112)); index1664 = index1664 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index1664 * 8) + + let result1662 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1663.push(result1662) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted1666 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result1665 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result1665) + } + _ => panic() + } + + let lifted1669 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted1668 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1667 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result1667) + } + _ => panic() + } + + Option::Some(lifted1668) + } + _ => panic() + } + + array1670.push(@types.SchemaTypeNode::{body : lifted1656, metadata : @types.MetadataEnvelope::{doc : lifted1658, aliases : array1660, examples : array1663, deprecated : lifted1666, role : lifted1669}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array1675 : Array[@types.SchemaTypeDef] = []; + for index1676 = 0; index1676 < (mbt_ffi_load32((iter_base) + 40)); index1676 = index1676 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1676 * 24) + + let result1672 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1674 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1673 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1673) + } + _ => panic() + } + + array1675.push(@types.SchemaTypeDef::{id : result1672, name : lifted1674, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let array1706 : Array[@types.SchemaValueNode] = []; + for index1707 = 0; index1707 < (mbt_ffi_load32((iter_base) + 52)); index1707 = index1707 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1707 * 32) + + let lifted1705 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result1677 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result1677) + } + 13 => { + + let array1678 : Array[Int] = []; + for index1679 = 0; index1679 < (mbt_ffi_load32((iter_base) + 12)); index1679 = index1679 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1679 * 4) + + array1678.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array1678) + } + 14 => { + + let lifted1680 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted1680}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array1681 : Array[Bool] = []; + for index1682 = 0; index1682 < (mbt_ffi_load32((iter_base) + 12)); index1682 = index1682 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1682 * 1) + + array1681.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array1681) + } + 17 => { + + let array1683 : Array[Int] = []; + for index1684 = 0; index1684 < (mbt_ffi_load32((iter_base) + 12)); index1684 = index1684 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1684 * 4) + + array1683.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array1683) + } + 18 => { + + let array1685 : Array[Int] = []; + for index1686 = 0; index1686 < (mbt_ffi_load32((iter_base) + 12)); index1686 = index1686 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1686 * 4) + + array1685.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array1685) + } + 19 => { + + let array1687 : Array[Int] = []; + for index1688 = 0; index1688 < (mbt_ffi_load32((iter_base) + 12)); index1688 = index1688 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1688 * 4) + + array1687.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array1687) + } + 20 => { + + let array1689 : Array[@types.MapEntry] = []; + for index1690 = 0; index1690 < (mbt_ffi_load32((iter_base) + 12)); index1690 = index1690 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1690 * 8) + + array1689.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array1689) + } + 21 => { + + let lifted1691 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted1691) + } + 22 => { + + let lifted1694 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted1692 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted1692) + } + 1 => { + + let lifted1693 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted1693) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted1694) + } + 23 => { + + let result1695 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1697 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1696 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1696) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result1695, language : lifted1697}) + } + 24 => { + + let result1698 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1700 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1699 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1699) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result1698, mime_type : lifted1700}) + } + 25 => { + + let result1701 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result1701) + } + 26 => { + + let result1702 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result1702) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result1703 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result1703}) + } + 30 => { + + let result1704 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result1704, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array1706.push(lifted1705) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + AgentInvocationResult::AgentInitialization(AgentInvocationOutputParameters::{output : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array1670, defs : array1675, root : mbt_ffi_load32((iter_base) + 44)}, value : @types.SchemaValueTree::{value_nodes : array1706, root : mbt_ffi_load32((iter_base) + 56)}}}) + } + 1 => { + + let array1904 : Array[@types.SchemaTypeNode] = []; + for index1905 = 0; index1905 < (mbt_ffi_load32((iter_base) + 32)); index1905 = index1905 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1905 * 144) + + let lifted1890 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted1714 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1709 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1708 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1708) + } + _ => panic() + } + + let lifted1711 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1710 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1710) + } + _ => panic() + } + + let lifted1713 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1712 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1712) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1709, max : lifted1711, unit : lifted1713}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted1714) + } + 3 => { + + let lifted1721 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1716 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1715 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1715) + } + _ => panic() + } + + let lifted1718 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1717 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1717) + } + _ => panic() + } + + let lifted1720 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1719 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1719) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1716, max : lifted1718, unit : lifted1720}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted1721) + } + 4 => { + + let lifted1728 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1723 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1722 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1722) + } + _ => panic() + } + + let lifted1725 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1724 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1724) + } + _ => panic() + } + + let lifted1727 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1726 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1726) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1723, max : lifted1725, unit : lifted1727}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted1728) + } + 5 => { + + let lifted1735 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1730 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1729 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1729) + } + _ => panic() + } + + let lifted1732 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1731 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1731) + } + _ => panic() + } + + let lifted1734 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1733 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1733) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1730, max : lifted1732, unit : lifted1734}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted1735) + } + 6 => { + + let lifted1742 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1737 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1736 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1736) + } + _ => panic() + } + + let lifted1739 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1738 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1738) + } + _ => panic() + } + + let lifted1741 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1740 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1740) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1737, max : lifted1739, unit : lifted1741}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted1742) + } + 7 => { + + let lifted1749 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1744 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1743 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1743) + } + _ => panic() + } + + let lifted1746 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1745 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1745) + } + _ => panic() + } + + let lifted1748 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1747 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1747) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1744, max : lifted1746, unit : lifted1748}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1749) + } + 8 => { + + let lifted1756 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1751 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1750 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1750) + } + _ => panic() + } + + let lifted1753 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1752 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1752) + } + _ => panic() + } + + let lifted1755 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1754 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1754) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1751, max : lifted1753, unit : lifted1755}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1756) + } + 9 => { + + let lifted1763 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1758 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1757 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1757) + } + _ => panic() + } + + let lifted1760 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1759 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1759) + } + _ => panic() + } + + let lifted1762 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1761 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1761) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1758, max : lifted1760, unit : lifted1762}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1763) + } + 10 => { + + let lifted1770 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1765 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1764 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1764) + } + _ => panic() + } + + let lifted1767 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1766 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1766) + } + _ => panic() + } + + let lifted1769 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1768 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1768) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1765, max : lifted1767, unit : lifted1769}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted1770) + } + 11 => { + + let lifted1777 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1772 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1771 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1771) + } + _ => panic() + } + + let lifted1774 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1773 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1773) + } + _ => panic() + } + + let lifted1776 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1775 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1775) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1772, max : lifted1774, unit : lifted1776}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted1777) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array1792 : Array[@types.NamedFieldType] = []; + for index1793 = 0; index1793 < (mbt_ffi_load32((iter_base) + 12)); index1793 = index1793 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1793 * 68) + + let result1778 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1780 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1779 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1779) + } + _ => panic() + } + + let array1782 : Array[String] = []; + for index1783 = 0; index1783 < (mbt_ffi_load32((iter_base) + 28)); index1783 = index1783 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1783 * 8) + + let result1781 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1782.push(result1781) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array1785 : Array[String] = []; + for index1786 = 0; index1786 < (mbt_ffi_load32((iter_base) + 36)); index1786 = index1786 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1786 * 8) + + let result1784 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1785.push(result1784) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted1788 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result1787 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result1787) + } + _ => panic() + } + + let lifted1791 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted1790 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1789 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result1789) + } + _ => panic() + } + + Option::Some(lifted1790) + } + _ => panic() + } + + array1792.push(@types.NamedFieldType::{name : result1778, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted1780, aliases : array1782, examples : array1785, deprecated : lifted1788, role : lifted1791}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array1792) + } + 15 => { + + let array1809 : Array[@types.VariantCaseType] = []; + for index1810 = 0; index1810 < (mbt_ffi_load32((iter_base) + 12)); index1810 = index1810 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1810 * 72) + + let result1794 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1795 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1797 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1796 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1796) + } + _ => panic() + } + + let array1799 : Array[String] = []; + for index1800 = 0; index1800 < (mbt_ffi_load32((iter_base) + 32)); index1800 = index1800 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1800 * 8) + + let result1798 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1799.push(result1798) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array1802 : Array[String] = []; + for index1803 = 0; index1803 < (mbt_ffi_load32((iter_base) + 40)); index1803 = index1803 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1803 * 8) + + let result1801 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1802.push(result1801) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted1805 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result1804 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result1804) + } + _ => panic() + } + + let lifted1808 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted1807 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1806 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result1806) + } + _ => panic() + } + + Option::Some(lifted1807) + } + _ => panic() + } + + array1809.push(@types.VariantCaseType::{name : result1794, payload : lifted1795, metadata : @types.MetadataEnvelope::{doc : lifted1797, aliases : array1799, examples : array1802, deprecated : lifted1805, role : lifted1808}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array1809) + } + 16 => { + + let array1812 : Array[String] = []; + for index1813 = 0; index1813 < (mbt_ffi_load32((iter_base) + 12)); index1813 = index1813 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1813 * 8) + + let result1811 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1812.push(result1811) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array1812) + } + 17 => { + + let array1815 : Array[String] = []; + for index1816 = 0; index1816 < (mbt_ffi_load32((iter_base) + 12)); index1816 = index1816 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1816 * 8) + + let result1814 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1815.push(result1814) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array1815) + } + 18 => { + + let array1817 : Array[Int] = []; + for index1818 = 0; index1818 < (mbt_ffi_load32((iter_base) + 12)); index1818 = index1818 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1818 * 4) + + array1817.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array1817) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted1819 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1820 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted1819, err : lifted1820}) + } + 24 => { + + let lifted1824 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1822 : Array[String] = []; + for index1823 = 0; index1823 < (mbt_ffi_load32((iter_base) + 16)); index1823 = index1823 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1823 * 8) + + let result1821 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1822.push(result1821) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1822) + } + _ => panic() + } + + let lifted1825 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1826 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1828 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1827 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1827) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted1824, min_length : lifted1825, max_length : lifted1826, regex : lifted1828}) + } + 25 => { + + let lifted1832 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1830 : Array[String] = []; + for index1831 = 0; index1831 < (mbt_ffi_load32((iter_base) + 16)); index1831 = index1831 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1831 * 8) + + let result1829 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1830.push(result1829) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1830) + } + _ => panic() + } + + let lifted1833 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1834 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted1832, min_bytes : lifted1833, max_bytes : lifted1834}) + } + 26 => { + + let lifted1838 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array1836 : Array[String] = []; + for index1837 = 0; index1837 < (mbt_ffi_load32((iter_base) + 20)); index1837 = index1837 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1837 * 8) + + let result1835 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1836.push(result1835) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array1836) + } + _ => panic() + } + + let lifted1842 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array1840 : Array[String] = []; + for index1841 = 0; index1841 < (mbt_ffi_load32((iter_base) + 32)); index1841 = index1841 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1841 * 8) + + let result1839 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1840.push(result1839) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array1840) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted1838, allowed_extensions : lifted1842}) + } + 27 => { + + let lifted1846 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1844 : Array[String] = []; + for index1845 = 0; index1845 < (mbt_ffi_load32((iter_base) + 16)); index1845 = index1845 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1845 * 8) + + let result1843 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1844.push(result1843) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1844) + } + _ => panic() + } + + let lifted1850 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array1848 : Array[String] = []; + for index1849 = 0; index1849 < (mbt_ffi_load32((iter_base) + 28)); index1849 = index1849 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1849 * 8) + + let result1847 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1848.push(result1847) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array1848) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted1846, allowed_hosts : lifted1850}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result1851 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array1853 : Array[String] = []; + for index1854 = 0; index1854 < (mbt_ffi_load32((iter_base) + 20)); index1854 = index1854 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1854 * 8) + + let result1852 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1853.push(result1852) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted1856 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1855 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result1855}) + } + _ => panic() + } + + let lifted1858 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result1857 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result1857}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result1851, allowed_suffixes : array1853, min : lifted1856, max : lifted1858}) + } + 31 => { + + let array1882 : Array[@types.UnionBranch] = []; + for index1883 = 0; index1883 < (mbt_ffi_load32((iter_base) + 12)); index1883 = index1883 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1883 * 92) + + let result1859 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1868 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result1860 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result1860) + } + 1 => { + + let result1861 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result1861) + } + 2 => { + + let result1862 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result1862) + } + 3 => { + + let result1863 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result1863) + } + 4 => { + + let result1864 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted1866 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1865 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result1865) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result1864, literal : lifted1866}) + } + 5 => { + + let result1867 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result1867) + } + _ => panic() + } + + let lifted1870 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1869 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1869) + } + _ => panic() + } + + let array1872 : Array[String] = []; + for index1873 = 0; index1873 < (mbt_ffi_load32((iter_base) + 52)); index1873 = index1873 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1873 * 8) + + let result1871 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1872.push(result1871) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1875 : Array[String] = []; + for index1876 = 0; index1876 < (mbt_ffi_load32((iter_base) + 60)); index1876 = index1876 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1876 * 8) + + let result1874 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1875.push(result1874) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted1878 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1877 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1877) + } + _ => panic() + } + + let lifted1881 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted1880 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1879 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result1879) + } + _ => panic() + } + + Option::Some(lifted1880) + } + _ => panic() + } + + array1882.push(@types.UnionBranch::{tag : result1859, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted1868, metadata : @types.MetadataEnvelope::{doc : lifted1870, aliases : array1872, examples : array1875, deprecated : lifted1878, role : lifted1881}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array1882}) + } + 32 => { + + let lifted1885 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1884 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1884) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted1885}) + } + 33 => { + + let lifted1887 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1886 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1886) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted1887}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted1888 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted1888) + } + 36 => { + + let lifted1889 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted1889) + } + _ => panic() + } + + let lifted1892 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result1891 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result1891) + } + _ => panic() + } + + let array1894 : Array[String] = []; + for index1895 = 0; index1895 < (mbt_ffi_load32((iter_base) + 104)); index1895 = index1895 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index1895 * 8) + + let result1893 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1894.push(result1893) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array1897 : Array[String] = []; + for index1898 = 0; index1898 < (mbt_ffi_load32((iter_base) + 112)); index1898 = index1898 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index1898 * 8) + + let result1896 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1897.push(result1896) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted1900 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result1899 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result1899) + } + _ => panic() + } + + let lifted1903 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted1902 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1901 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result1901) + } + _ => panic() + } + + Option::Some(lifted1902) + } + _ => panic() + } + + array1904.push(@types.SchemaTypeNode::{body : lifted1890, metadata : @types.MetadataEnvelope::{doc : lifted1892, aliases : array1894, examples : array1897, deprecated : lifted1900, role : lifted1903}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array1909 : Array[@types.SchemaTypeDef] = []; + for index1910 = 0; index1910 < (mbt_ffi_load32((iter_base) + 40)); index1910 = index1910 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1910 * 24) + + let result1906 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1908 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1907 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1907) + } + _ => panic() + } + + array1909.push(@types.SchemaTypeDef::{id : result1906, name : lifted1908, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let array1940 : Array[@types.SchemaValueNode] = []; + for index1941 = 0; index1941 < (mbt_ffi_load32((iter_base) + 52)); index1941 = index1941 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1941 * 32) + + let lifted1939 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result1911 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result1911) + } + 13 => { + + let array1912 : Array[Int] = []; + for index1913 = 0; index1913 < (mbt_ffi_load32((iter_base) + 12)); index1913 = index1913 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1913 * 4) + + array1912.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array1912) + } + 14 => { + + let lifted1914 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted1914}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array1915 : Array[Bool] = []; + for index1916 = 0; index1916 < (mbt_ffi_load32((iter_base) + 12)); index1916 = index1916 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1916 * 1) + + array1915.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array1915) + } + 17 => { + + let array1917 : Array[Int] = []; + for index1918 = 0; index1918 < (mbt_ffi_load32((iter_base) + 12)); index1918 = index1918 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1918 * 4) + + array1917.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array1917) + } + 18 => { + + let array1919 : Array[Int] = []; + for index1920 = 0; index1920 < (mbt_ffi_load32((iter_base) + 12)); index1920 = index1920 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1920 * 4) + + array1919.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array1919) + } + 19 => { + + let array1921 : Array[Int] = []; + for index1922 = 0; index1922 < (mbt_ffi_load32((iter_base) + 12)); index1922 = index1922 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1922 * 4) + + array1921.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array1921) + } + 20 => { + + let array1923 : Array[@types.MapEntry] = []; + for index1924 = 0; index1924 < (mbt_ffi_load32((iter_base) + 12)); index1924 = index1924 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1924 * 8) + + array1923.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array1923) + } + 21 => { + + let lifted1925 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted1925) + } + 22 => { + + let lifted1928 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted1926 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted1926) + } + 1 => { + + let lifted1927 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted1927) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted1928) + } + 23 => { + + let result1929 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1931 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1930 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1930) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result1929, language : lifted1931}) + } + 24 => { + + let result1932 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1934 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1933 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1933) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result1932, mime_type : lifted1934}) + } + 25 => { + + let result1935 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result1935) + } + 26 => { + + let result1936 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result1936) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result1937 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result1937}) + } + 30 => { + + let result1938 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result1938, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array1940.push(lifted1939) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + AgentInvocationResult::AgentMethod(AgentInvocationOutputParameters::{output : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array1904, defs : array1909, root : mbt_ffi_load32((iter_base) + 44)}, value : @types.SchemaValueTree::{value_nodes : array1940, root : mbt_ffi_load32((iter_base) + 56)}}}) + } + 2 => { + + AgentInvocationResult::ManualUpdate + } + 3 => { + + let lifted1943 : String? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + let result1942 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + Option::Some(result1942) + } + _ => panic() + } + + AgentInvocationResult::LoadSnapshot(FallibleResultParameters::{error : lifted1943}) + } + 4 => { + + let result1944 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + let result1945 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + AgentInvocationResult::SaveSnapshot(SaveSnapshotResultParameters::{snapshot : SnapshotData::{data : result1944, mime_type : result1945}}) + } + 5 => { + + let lifted1947 : String? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + let result1946 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + Option::Some(result1946) + } + _ => panic() + } + + AgentInvocationResult::ProcessOplogEntries(FallibleResultParameters::{error : lifted1947}) + } + _ => panic() + } + + let lifted1950 : String? = match mbt_ffi_load8_u((iter_base) + 60) { + 0 => Option::None + 1 => { + + let result1949 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + Option::Some(result1949) + } + _ => panic() + } + + PublicOplogEntry::AgentInvocationFinished(AgentInvocationFinishedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, result : lifted1948, method_name : lifted1950, consumed_fuel : mbt_ffi_load64((iter_base) + 72), component_revision : (mbt_ffi_load64((iter_base) + 80)).reinterpret_as_uint64()}) + } + 6 => { + + PublicOplogEntry::Suspend(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}}) + } + 7 => { + + let result1951 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let lifted1955 : RetryPolicyState? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let array1953 : Array[StateNode] = []; + for index1954 = 0; index1954 < (mbt_ffi_load32((iter_base) + 52)); index1954 = index1954 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1954 * 16) + + let lifted1952 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + StateNode::Counter((mbt_ffi_load32((iter_base) + 4)).reinterpret_as_uint()) + } + 1 => { + + StateNode::Terminal + } + 2 => { + + StateNode::Wrapper(mbt_ffi_load32((iter_base) + 4)) + } + 3 => { + + StateNode::CountBox(CountBoxState::{attempts : (mbt_ffi_load32((iter_base) + 4)).reinterpret_as_uint(), inner : mbt_ffi_load32((iter_base) + 8)}) + } + 4 => { + + StateNode::AndThen(AndThenState::{left : mbt_ffi_load32((iter_base) + 4), right : mbt_ffi_load32((iter_base) + 8), on_right : (mbt_ffi_load8_u((iter_base) + 12) != 0)}) + } + 5 => { + + StateNode::Pair(PairState::{left : mbt_ffi_load32((iter_base) + 4), right : mbt_ffi_load32((iter_base) + 8)}) + } + _ => panic() + } + + array1953.push(lifted1952) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + Option::Some(RetryPolicyState::{nodes : array1953}) + } + _ => panic() + } + + PublicOplogEntry::Error(ErrorParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, error : result1951, retry_from : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), inside_atomic_region : (mbt_ffi_load8_u((iter_base) + 40) != 0), retry_policy_state : lifted1955}) + } + 8 => { + + PublicOplogEntry::NoOp(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}}) + } + 9 => { + + PublicOplogEntry::Jump(JumpParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, jump : OplogRegion::{start : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), end : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}) + } + 10 => { + + PublicOplogEntry::Interrupted(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}}) + } + 11 => { + + PublicOplogEntry::Exited(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}}) + } + 12 => { + + PublicOplogEntry::BeginAtomicRegion(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}}) + } + 13 => { + + PublicOplogEntry::EndAtomicRegion(EndAtomicRegionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + 14 => { + + let lifted2468 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + let result1956 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let array2153 : Array[@types.SchemaTypeNode] = []; + for index2154 = 0; index2154 < (mbt_ffi_load32((iter_base) + 44)); index2154 = index2154 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index2154 * 144) + + let lifted2139 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted1963 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1958 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1957 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1957) + } + _ => panic() + } + + let lifted1960 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1959 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1959) + } + _ => panic() + } + + let lifted1962 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1961 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1961) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1958, max : lifted1960, unit : lifted1962}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted1963) + } + 3 => { + + let lifted1970 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1965 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1964 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1964) + } + _ => panic() + } + + let lifted1967 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1966 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1966) + } + _ => panic() + } + + let lifted1969 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1968 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1968) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1965, max : lifted1967, unit : lifted1969}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted1970) + } + 4 => { + + let lifted1977 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1972 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1971 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1971) + } + _ => panic() + } + + let lifted1974 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1973 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1973) + } + _ => panic() + } + + let lifted1976 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1975 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1975) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1972, max : lifted1974, unit : lifted1976}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted1977) + } + 5 => { + + let lifted1984 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1979 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1978 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1978) + } + _ => panic() + } + + let lifted1981 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1980 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1980) + } + _ => panic() + } + + let lifted1983 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1982 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1982) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1979, max : lifted1981, unit : lifted1983}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted1984) + } + 6 => { + + let lifted1991 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1986 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1985 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1985) + } + _ => panic() + } + + let lifted1988 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1987 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1987) + } + _ => panic() + } + + let lifted1990 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1989 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1989) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1986, max : lifted1988, unit : lifted1990}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted1991) + } + 7 => { + + let lifted1998 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1993 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1992 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1992) + } + _ => panic() + } + + let lifted1995 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1994 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1994) + } + _ => panic() + } + + let lifted1997 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1996 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1996) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1993, max : lifted1995, unit : lifted1997}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1998) + } + 8 => { + + let lifted2005 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2000 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1999 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1999) + } + _ => panic() + } + + let lifted2002 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2001 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2001) + } + _ => panic() + } + + let lifted2004 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2003 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2003) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2000, max : lifted2002, unit : lifted2004}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted2005) + } + 9 => { + + let lifted2012 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2007 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2006 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2006) + } + _ => panic() + } + + let lifted2009 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2008 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2008) + } + _ => panic() + } + + let lifted2011 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2010 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2010) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2007, max : lifted2009, unit : lifted2011}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted2012) + } + 10 => { + + let lifted2019 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2014 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2013 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2013) + } + _ => panic() + } + + let lifted2016 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2015 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2015) + } + _ => panic() + } + + let lifted2018 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2017 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2017) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2014, max : lifted2016, unit : lifted2018}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted2019) + } + 11 => { + + let lifted2026 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2021 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2020 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2020) + } + _ => panic() + } + + let lifted2023 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2022 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2022) + } + _ => panic() + } + + let lifted2025 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2024 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2024) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2021, max : lifted2023, unit : lifted2025}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted2026) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array2041 : Array[@types.NamedFieldType] = []; + for index2042 = 0; index2042 < (mbt_ffi_load32((iter_base) + 12)); index2042 = index2042 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2042 * 68) + + let result2027 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2029 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2028 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2028) + } + _ => panic() + } + + let array2031 : Array[String] = []; + for index2032 = 0; index2032 < (mbt_ffi_load32((iter_base) + 28)); index2032 = index2032 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2032 * 8) + + let result2030 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2031.push(result2030) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array2034 : Array[String] = []; + for index2035 = 0; index2035 < (mbt_ffi_load32((iter_base) + 36)); index2035 = index2035 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index2035 * 8) + + let result2033 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2034.push(result2033) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted2037 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result2036 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result2036) + } + _ => panic() + } + + let lifted2040 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted2039 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2038 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result2038) + } + _ => panic() + } + + Option::Some(lifted2039) + } + _ => panic() + } + + array2041.push(@types.NamedFieldType::{name : result2027, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted2029, aliases : array2031, examples : array2034, deprecated : lifted2037, role : lifted2040}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array2041) + } + 15 => { + + let array2058 : Array[@types.VariantCaseType] = []; + for index2059 = 0; index2059 < (mbt_ffi_load32((iter_base) + 12)); index2059 = index2059 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2059 * 72) + + let result2043 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2044 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2046 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2045 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2045) + } + _ => panic() + } + + let array2048 : Array[String] = []; + for index2049 = 0; index2049 < (mbt_ffi_load32((iter_base) + 32)); index2049 = index2049 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2049 * 8) + + let result2047 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2048.push(result2047) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array2051 : Array[String] = []; + for index2052 = 0; index2052 < (mbt_ffi_load32((iter_base) + 40)); index2052 = index2052 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2052 * 8) + + let result2050 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2051.push(result2050) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted2054 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result2053 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result2053) + } + _ => panic() + } + + let lifted2057 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted2056 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2055 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result2055) + } + _ => panic() + } + + Option::Some(lifted2056) + } + _ => panic() + } + + array2058.push(@types.VariantCaseType::{name : result2043, payload : lifted2044, metadata : @types.MetadataEnvelope::{doc : lifted2046, aliases : array2048, examples : array2051, deprecated : lifted2054, role : lifted2057}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array2058) + } + 16 => { + + let array2061 : Array[String] = []; + for index2062 = 0; index2062 < (mbt_ffi_load32((iter_base) + 12)); index2062 = index2062 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2062 * 8) + + let result2060 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2061.push(result2060) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array2061) + } + 17 => { + + let array2064 : Array[String] = []; + for index2065 = 0; index2065 < (mbt_ffi_load32((iter_base) + 12)); index2065 = index2065 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2065 * 8) + + let result2063 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2064.push(result2063) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array2064) + } + 18 => { + + let array2066 : Array[Int] = []; + for index2067 = 0; index2067 < (mbt_ffi_load32((iter_base) + 12)); index2067 = index2067 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2067 * 4) + + array2066.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array2066) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted2068 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2069 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted2068, err : lifted2069}) + } + 24 => { + + let lifted2073 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2071 : Array[String] = []; + for index2072 = 0; index2072 < (mbt_ffi_load32((iter_base) + 16)); index2072 = index2072 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2072 * 8) + + let result2070 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2071.push(result2070) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2071) + } + _ => panic() + } + + let lifted2074 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2075 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2077 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2076 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2076) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted2073, min_length : lifted2074, max_length : lifted2075, regex : lifted2077}) + } + 25 => { + + let lifted2081 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2079 : Array[String] = []; + for index2080 = 0; index2080 < (mbt_ffi_load32((iter_base) + 16)); index2080 = index2080 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2080 * 8) + + let result2078 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2079.push(result2078) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2079) + } + _ => panic() + } + + let lifted2082 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2083 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted2081, min_bytes : lifted2082, max_bytes : lifted2083}) + } + 26 => { + + let lifted2087 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array2085 : Array[String] = []; + for index2086 = 0; index2086 < (mbt_ffi_load32((iter_base) + 20)); index2086 = index2086 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2086 * 8) + + let result2084 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2085.push(result2084) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array2085) + } + _ => panic() + } + + let lifted2091 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array2089 : Array[String] = []; + for index2090 = 0; index2090 < (mbt_ffi_load32((iter_base) + 32)); index2090 = index2090 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2090 * 8) + + let result2088 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2089.push(result2088) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array2089) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted2087, allowed_extensions : lifted2091}) + } + 27 => { + + let lifted2095 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2093 : Array[String] = []; + for index2094 = 0; index2094 < (mbt_ffi_load32((iter_base) + 16)); index2094 = index2094 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2094 * 8) + + let result2092 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2093.push(result2092) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2093) + } + _ => panic() + } + + let lifted2099 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array2097 : Array[String] = []; + for index2098 = 0; index2098 < (mbt_ffi_load32((iter_base) + 28)); index2098 = index2098 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2098 * 8) + + let result2096 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2097.push(result2096) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array2097) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted2095, allowed_hosts : lifted2099}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result2100 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array2102 : Array[String] = []; + for index2103 = 0; index2103 < (mbt_ffi_load32((iter_base) + 20)); index2103 = index2103 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2103 * 8) + + let result2101 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2102.push(result2101) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted2105 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2104 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result2104}) + } + _ => panic() + } + + let lifted2107 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result2106 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result2106}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result2100, allowed_suffixes : array2102, min : lifted2105, max : lifted2107}) + } + 31 => { + + let array2131 : Array[@types.UnionBranch] = []; + for index2132 = 0; index2132 < (mbt_ffi_load32((iter_base) + 12)); index2132 = index2132 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2132 * 92) + + let result2108 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2117 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result2109 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result2109) + } + 1 => { + + let result2110 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result2110) + } + 2 => { + + let result2111 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result2111) + } + 3 => { + + let result2112 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result2112) + } + 4 => { + + let result2113 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted2115 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2114 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result2114) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result2113, literal : lifted2115}) + } + 5 => { + + let result2116 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result2116) + } + _ => panic() + } + + let lifted2119 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2118 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2118) + } + _ => panic() + } + + let array2121 : Array[String] = []; + for index2122 = 0; index2122 < (mbt_ffi_load32((iter_base) + 52)); index2122 = index2122 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2122 * 8) + + let result2120 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2121.push(result2120) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array2124 : Array[String] = []; + for index2125 = 0; index2125 < (mbt_ffi_load32((iter_base) + 60)); index2125 = index2125 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2125 * 8) + + let result2123 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2124.push(result2123) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted2127 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2126 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2126) + } + _ => panic() + } + + let lifted2130 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted2129 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2128 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result2128) + } + _ => panic() + } + + Option::Some(lifted2129) + } + _ => panic() + } + + array2131.push(@types.UnionBranch::{tag : result2108, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted2117, metadata : @types.MetadataEnvelope::{doc : lifted2119, aliases : array2121, examples : array2124, deprecated : lifted2127, role : lifted2130}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array2131}) + } + 32 => { + + let lifted2134 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2133 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2133) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted2134}) + } + 33 => { + + let lifted2136 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2135 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2135) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted2136}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted2137 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted2137) + } + 36 => { + + let lifted2138 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted2138) + } + _ => panic() + } + + let lifted2141 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result2140 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result2140) + } + _ => panic() + } + + let array2143 : Array[String] = []; + for index2144 = 0; index2144 < (mbt_ffi_load32((iter_base) + 104)); index2144 = index2144 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index2144 * 8) + + let result2142 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2143.push(result2142) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array2146 : Array[String] = []; + for index2147 = 0; index2147 < (mbt_ffi_load32((iter_base) + 112)); index2147 = index2147 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index2147 * 8) + + let result2145 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2146.push(result2145) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted2149 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result2148 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result2148) + } + _ => panic() + } + + let lifted2152 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted2151 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result2150) + } + _ => panic() + } + + Option::Some(lifted2151) + } + _ => panic() + } + + array2153.push(@types.SchemaTypeNode::{body : lifted2139, metadata : @types.MetadataEnvelope::{doc : lifted2141, aliases : array2143, examples : array2146, deprecated : lifted2149, role : lifted2152}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let array2158 : Array[@types.SchemaTypeDef] = []; + for index2159 = 0; index2159 < (mbt_ffi_load32((iter_base) + 52)); index2159 = index2159 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2159 * 24) + + let result2155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2157 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2156 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2156) + } + _ => panic() + } + + array2158.push(@types.SchemaTypeDef::{id : result2155, name : lifted2157, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array2189 : Array[@types.SchemaValueNode] = []; + for index2190 = 0; index2190 < (mbt_ffi_load32((iter_base) + 64)); index2190 = index2190 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index2190 * 32) + + let lifted2188 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result2160 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result2160) + } + 13 => { + + let array2161 : Array[Int] = []; + for index2162 = 0; index2162 < (mbt_ffi_load32((iter_base) + 12)); index2162 = index2162 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2162 * 4) + + array2161.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array2161) + } + 14 => { + + let lifted2163 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted2163}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array2164 : Array[Bool] = []; + for index2165 = 0; index2165 < (mbt_ffi_load32((iter_base) + 12)); index2165 = index2165 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2165 * 1) + + array2164.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array2164) + } + 17 => { + + let array2166 : Array[Int] = []; + for index2167 = 0; index2167 < (mbt_ffi_load32((iter_base) + 12)); index2167 = index2167 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2167 * 4) + + array2166.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array2166) + } + 18 => { + + let array2168 : Array[Int] = []; + for index2169 = 0; index2169 < (mbt_ffi_load32((iter_base) + 12)); index2169 = index2169 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2169 * 4) + + array2168.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array2168) + } + 19 => { + + let array2170 : Array[Int] = []; + for index2171 = 0; index2171 < (mbt_ffi_load32((iter_base) + 12)); index2171 = index2171 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2171 * 4) + + array2170.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array2170) + } + 20 => { + + let array2172 : Array[@types.MapEntry] = []; + for index2173 = 0; index2173 < (mbt_ffi_load32((iter_base) + 12)); index2173 = index2173 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2173 * 8) + + array2172.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array2172) + } + 21 => { + + let lifted2174 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted2174) + } + 22 => { + + let lifted2177 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted2175 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted2175) + } + 1 => { + + let lifted2176 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted2176) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted2177) + } + 23 => { + + let result2178 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2180 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2179 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2179) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result2178, language : lifted2180}) + } + 24 => { + + let result2181 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2183 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2182 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2182) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result2181, mime_type : lifted2183}) + } + 25 => { + + let result2184 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result2184) + } + 26 => { + + let result2185 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result2185) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result2186 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result2186}) + } + 30 => { + + let result2187 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result2187, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array2189.push(lifted2188) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + let result2191 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 72), mbt_ffi_load32((iter_base) + 76)) + + let array2193 : Array[String] = []; + for index2194 = 0; index2194 < (mbt_ffi_load32((iter_base) + 84)); index2194 = index2194 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 80)) + (index2194 * 8) + + let result2192 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2193.push(result2192) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 80)) + + let array2208 : Array[Array[SpanData]] = []; + for index2209 = 0; index2209 < (mbt_ffi_load32((iter_base) + 92)); index2209 = index2209 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 88)) + (index2209 * 8) + + let array2206 : Array[SpanData] = []; + for index2207 = 0; index2207 < (mbt_ffi_load32((iter_base) + 4)); index2207 = index2207 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index2207 * 80) + + let lifted2205 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result2195 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2197 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result2196 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result2196) + } + _ => panic() + } + + let lifted2198 : UInt64? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + let array2202 : Array[@context.Attribute] = []; + for index2203 = 0; index2203 < (mbt_ffi_load32((iter_base) + 68)); index2203 = index2203 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index2203 * 20) + + let result2199 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2201 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result2200 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + @context.AttributeValue::String(result2200) + } + _ => panic() + } + + array2202.push(@context.Attribute::{key : result2199, value : lifted2201}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + SpanData::LocalSpan(LocalSpanData::{span_id : result2195, start : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent : lifted2197, linked_context : lifted2198, attributes : array2202, inherited : (mbt_ffi_load8_u((iter_base) + 72) != 0)}) + } + 1 => { + + let result2204 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + SpanData::ExternalSpan(ExternalSpanData::{span_id : result2204}) + } + _ => panic() + } + + array2206.push(lifted2205) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array2208.push(array2206) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + + AgentInvocation::AgentInitialization(AgentInitializationParameters::{idempotency_key : result1956, constructor_parameters : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array2153, defs : array2158, root : mbt_ffi_load32((iter_base) + 56)}, value : @types.SchemaValueTree::{value_nodes : array2189, root : mbt_ffi_load32((iter_base) + 68)}}, trace_id : result2191, trace_states : array2193, invocation_context : array2208}) + } + 1 => { + + let result2210 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let result2211 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + let array2408 : Array[@types.SchemaTypeNode] = []; + for index2409 = 0; index2409 < (mbt_ffi_load32((iter_base) + 52)); index2409 = index2409 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2409 * 144) + + let lifted2394 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted2218 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2213 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2212 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2212) + } + _ => panic() + } + + let lifted2215 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2214 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2214) + } + _ => panic() + } + + let lifted2217 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2216 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2216) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2213, max : lifted2215, unit : lifted2217}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted2218) + } + 3 => { + + let lifted2225 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2220 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2219 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2219) + } + _ => panic() + } + + let lifted2222 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2221 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2221) + } + _ => panic() + } + + let lifted2224 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2223 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2223) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2220, max : lifted2222, unit : lifted2224}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted2225) + } + 4 => { + + let lifted2232 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2227 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2226 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2226) + } + _ => panic() + } + + let lifted2229 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2228 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2228) + } + _ => panic() + } + + let lifted2231 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2230 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2230) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2227, max : lifted2229, unit : lifted2231}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted2232) + } + 5 => { + + let lifted2239 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2234 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2233 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2233) + } + _ => panic() + } + + let lifted2236 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2235 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2235) + } + _ => panic() + } + + let lifted2238 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2237 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2237) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2234, max : lifted2236, unit : lifted2238}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted2239) + } + 6 => { + + let lifted2246 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2241 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2240 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2240) + } + _ => panic() + } + + let lifted2243 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2242 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2242) + } + _ => panic() + } + + let lifted2245 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2244 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2244) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2241, max : lifted2243, unit : lifted2245}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted2246) + } + 7 => { + + let lifted2253 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2248 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2247 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2247) + } + _ => panic() + } + + let lifted2250 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2249 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2249) + } + _ => panic() + } + + let lifted2252 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2251 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2251) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2248, max : lifted2250, unit : lifted2252}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted2253) + } + 8 => { + + let lifted2260 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2255 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2254 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2254) + } + _ => panic() + } + + let lifted2257 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2256 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2256) + } + _ => panic() + } + + let lifted2259 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2258 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2258) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2255, max : lifted2257, unit : lifted2259}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted2260) + } + 9 => { + + let lifted2267 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2262 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2261 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2261) + } + _ => panic() + } + + let lifted2264 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2263 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2263) + } + _ => panic() + } + + let lifted2266 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2265 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2265) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2262, max : lifted2264, unit : lifted2266}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted2267) + } + 10 => { + + let lifted2274 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2269 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2268 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2268) + } + _ => panic() + } + + let lifted2271 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2270 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2270) + } + _ => panic() + } + + let lifted2273 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2272 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2272) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2269, max : lifted2271, unit : lifted2273}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted2274) + } + 11 => { + + let lifted2281 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2276 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2275 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2275) + } + _ => panic() + } + + let lifted2278 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2277 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2277) + } + _ => panic() + } + + let lifted2280 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2279 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2279) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2276, max : lifted2278, unit : lifted2280}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted2281) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array2296 : Array[@types.NamedFieldType] = []; + for index2297 = 0; index2297 < (mbt_ffi_load32((iter_base) + 12)); index2297 = index2297 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2297 * 68) + + let result2282 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2284 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2283 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2283) + } + _ => panic() + } + + let array2286 : Array[String] = []; + for index2287 = 0; index2287 < (mbt_ffi_load32((iter_base) + 28)); index2287 = index2287 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2287 * 8) + + let result2285 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2286.push(result2285) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array2289 : Array[String] = []; + for index2290 = 0; index2290 < (mbt_ffi_load32((iter_base) + 36)); index2290 = index2290 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index2290 * 8) + + let result2288 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2289.push(result2288) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted2292 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result2291 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result2291) + } + _ => panic() + } + + let lifted2295 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted2294 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2293 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result2293) + } + _ => panic() + } + + Option::Some(lifted2294) + } + _ => panic() + } + + array2296.push(@types.NamedFieldType::{name : result2282, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted2284, aliases : array2286, examples : array2289, deprecated : lifted2292, role : lifted2295}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array2296) + } + 15 => { + + let array2313 : Array[@types.VariantCaseType] = []; + for index2314 = 0; index2314 < (mbt_ffi_load32((iter_base) + 12)); index2314 = index2314 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2314 * 72) + + let result2298 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2299 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2301 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2300 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2300) + } + _ => panic() + } + + let array2303 : Array[String] = []; + for index2304 = 0; index2304 < (mbt_ffi_load32((iter_base) + 32)); index2304 = index2304 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2304 * 8) + + let result2302 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2303.push(result2302) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array2306 : Array[String] = []; + for index2307 = 0; index2307 < (mbt_ffi_load32((iter_base) + 40)); index2307 = index2307 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2307 * 8) + + let result2305 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2306.push(result2305) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted2309 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result2308 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result2308) + } + _ => panic() + } + + let lifted2312 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted2311 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2310 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result2310) + } + _ => panic() + } + + Option::Some(lifted2311) + } + _ => panic() + } + + array2313.push(@types.VariantCaseType::{name : result2298, payload : lifted2299, metadata : @types.MetadataEnvelope::{doc : lifted2301, aliases : array2303, examples : array2306, deprecated : lifted2309, role : lifted2312}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array2313) + } + 16 => { + + let array2316 : Array[String] = []; + for index2317 = 0; index2317 < (mbt_ffi_load32((iter_base) + 12)); index2317 = index2317 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2317 * 8) + + let result2315 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2316.push(result2315) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array2316) + } + 17 => { + + let array2319 : Array[String] = []; + for index2320 = 0; index2320 < (mbt_ffi_load32((iter_base) + 12)); index2320 = index2320 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2320 * 8) + + let result2318 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2319.push(result2318) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array2319) + } + 18 => { + + let array2321 : Array[Int] = []; + for index2322 = 0; index2322 < (mbt_ffi_load32((iter_base) + 12)); index2322 = index2322 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2322 * 4) + + array2321.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array2321) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted2323 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2324 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted2323, err : lifted2324}) + } + 24 => { + + let lifted2328 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2326 : Array[String] = []; + for index2327 = 0; index2327 < (mbt_ffi_load32((iter_base) + 16)); index2327 = index2327 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2327 * 8) + + let result2325 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2326.push(result2325) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2326) + } + _ => panic() + } + + let lifted2329 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2330 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2332 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2331 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2331) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted2328, min_length : lifted2329, max_length : lifted2330, regex : lifted2332}) + } + 25 => { + + let lifted2336 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2334 : Array[String] = []; + for index2335 = 0; index2335 < (mbt_ffi_load32((iter_base) + 16)); index2335 = index2335 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2335 * 8) + + let result2333 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2334.push(result2333) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2334) + } + _ => panic() + } + + let lifted2337 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2338 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted2336, min_bytes : lifted2337, max_bytes : lifted2338}) + } + 26 => { + + let lifted2342 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array2340 : Array[String] = []; + for index2341 = 0; index2341 < (mbt_ffi_load32((iter_base) + 20)); index2341 = index2341 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2341 * 8) + + let result2339 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2340.push(result2339) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array2340) + } + _ => panic() + } + + let lifted2346 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array2344 : Array[String] = []; + for index2345 = 0; index2345 < (mbt_ffi_load32((iter_base) + 32)); index2345 = index2345 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2345 * 8) + + let result2343 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2344.push(result2343) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array2344) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted2342, allowed_extensions : lifted2346}) + } + 27 => { + + let lifted2350 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2348 : Array[String] = []; + for index2349 = 0; index2349 < (mbt_ffi_load32((iter_base) + 16)); index2349 = index2349 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2349 * 8) + + let result2347 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2348.push(result2347) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2348) + } + _ => panic() + } + + let lifted2354 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array2352 : Array[String] = []; + for index2353 = 0; index2353 < (mbt_ffi_load32((iter_base) + 28)); index2353 = index2353 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2353 * 8) + + let result2351 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2352.push(result2351) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array2352) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted2350, allowed_hosts : lifted2354}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result2355 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array2357 : Array[String] = []; + for index2358 = 0; index2358 < (mbt_ffi_load32((iter_base) + 20)); index2358 = index2358 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2358 * 8) + + let result2356 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2357.push(result2356) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted2360 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2359 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result2359}) + } + _ => panic() + } + + let lifted2362 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result2361 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result2361}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result2355, allowed_suffixes : array2357, min : lifted2360, max : lifted2362}) + } + 31 => { + + let array2386 : Array[@types.UnionBranch] = []; + for index2387 = 0; index2387 < (mbt_ffi_load32((iter_base) + 12)); index2387 = index2387 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2387 * 92) + + let result2363 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2372 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result2364 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result2364) + } + 1 => { + + let result2365 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result2365) + } + 2 => { + + let result2366 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result2366) + } + 3 => { + + let result2367 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result2367) + } + 4 => { + + let result2368 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted2370 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2369 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result2369) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result2368, literal : lifted2370}) + } + 5 => { + + let result2371 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result2371) + } + _ => panic() + } + + let lifted2374 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2373 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2373) + } + _ => panic() + } + + let array2376 : Array[String] = []; + for index2377 = 0; index2377 < (mbt_ffi_load32((iter_base) + 52)); index2377 = index2377 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2377 * 8) + + let result2375 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2376.push(result2375) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array2379 : Array[String] = []; + for index2380 = 0; index2380 < (mbt_ffi_load32((iter_base) + 60)); index2380 = index2380 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2380 * 8) + + let result2378 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2379.push(result2378) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted2382 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2381 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2381) + } + _ => panic() + } + + let lifted2385 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted2384 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2383 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result2383) + } + _ => panic() + } + + Option::Some(lifted2384) + } + _ => panic() + } + + array2386.push(@types.UnionBranch::{tag : result2363, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted2372, metadata : @types.MetadataEnvelope::{doc : lifted2374, aliases : array2376, examples : array2379, deprecated : lifted2382, role : lifted2385}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array2386}) + } + 32 => { + + let lifted2389 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2388 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2388) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted2389}) + } + 33 => { + + let lifted2391 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2390 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2390) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted2391}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted2392 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted2392) + } + 36 => { + + let lifted2393 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted2393) + } + _ => panic() + } + + let lifted2396 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result2395 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result2395) + } + _ => panic() + } + + let array2398 : Array[String] = []; + for index2399 = 0; index2399 < (mbt_ffi_load32((iter_base) + 104)); index2399 = index2399 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index2399 * 8) + + let result2397 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2398.push(result2397) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array2401 : Array[String] = []; + for index2402 = 0; index2402 < (mbt_ffi_load32((iter_base) + 112)); index2402 = index2402 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index2402 * 8) + + let result2400 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2401.push(result2400) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted2404 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result2403 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result2403) + } + _ => panic() + } + + let lifted2407 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted2406 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2405 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result2405) + } + _ => panic() + } + + Option::Some(lifted2406) + } + _ => panic() + } + + array2408.push(@types.SchemaTypeNode::{body : lifted2394, metadata : @types.MetadataEnvelope::{doc : lifted2396, aliases : array2398, examples : array2401, deprecated : lifted2404, role : lifted2407}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array2413 : Array[@types.SchemaTypeDef] = []; + for index2414 = 0; index2414 < (mbt_ffi_load32((iter_base) + 60)); index2414 = index2414 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2414 * 24) + + let result2410 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2412 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2411 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2411) + } + _ => panic() + } + + array2413.push(@types.SchemaTypeDef::{id : result2410, name : lifted2412, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let array2444 : Array[@types.SchemaValueNode] = []; + for index2445 = 0; index2445 < (mbt_ffi_load32((iter_base) + 72)); index2445 = index2445 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index2445 * 32) + + let lifted2443 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result2415 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result2415) + } + 13 => { + + let array2416 : Array[Int] = []; + for index2417 = 0; index2417 < (mbt_ffi_load32((iter_base) + 12)); index2417 = index2417 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2417 * 4) + + array2416.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array2416) + } + 14 => { + + let lifted2418 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted2418}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array2419 : Array[Bool] = []; + for index2420 = 0; index2420 < (mbt_ffi_load32((iter_base) + 12)); index2420 = index2420 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2420 * 1) + + array2419.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array2419) + } + 17 => { + + let array2421 : Array[Int] = []; + for index2422 = 0; index2422 < (mbt_ffi_load32((iter_base) + 12)); index2422 = index2422 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2422 * 4) + + array2421.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array2421) + } + 18 => { + + let array2423 : Array[Int] = []; + for index2424 = 0; index2424 < (mbt_ffi_load32((iter_base) + 12)); index2424 = index2424 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2424 * 4) + + array2423.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array2423) + } + 19 => { + + let array2425 : Array[Int] = []; + for index2426 = 0; index2426 < (mbt_ffi_load32((iter_base) + 12)); index2426 = index2426 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2426 * 4) + + array2425.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array2425) + } + 20 => { + + let array2427 : Array[@types.MapEntry] = []; + for index2428 = 0; index2428 < (mbt_ffi_load32((iter_base) + 12)); index2428 = index2428 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2428 * 8) + + array2427.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array2427) + } + 21 => { + + let lifted2429 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted2429) + } + 22 => { + + let lifted2432 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted2430 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted2430) + } + 1 => { + + let lifted2431 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted2431) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted2432) + } + 23 => { + + let result2433 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2435 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2434 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2434) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result2433, language : lifted2435}) + } + 24 => { + + let result2436 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2438 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2437 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2437) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result2436, mime_type : lifted2438}) + } + 25 => { + + let result2439 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result2439) + } + 26 => { + + let result2440 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result2440) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result2441 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result2441}) + } + 30 => { + + let result2442 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result2442, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array2444.push(lifted2443) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + let result2446 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 80), mbt_ffi_load32((iter_base) + 84)) + + let array2448 : Array[String] = []; + for index2449 = 0; index2449 < (mbt_ffi_load32((iter_base) + 92)); index2449 = index2449 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 88)) + (index2449 * 8) + + let result2447 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2448.push(result2447) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + + let array2463 : Array[Array[SpanData]] = []; + for index2464 = 0; index2464 < (mbt_ffi_load32((iter_base) + 100)); index2464 = index2464 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 96)) + (index2464 * 8) + + let array2461 : Array[SpanData] = []; + for index2462 = 0; index2462 < (mbt_ffi_load32((iter_base) + 4)); index2462 = index2462 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index2462 * 80) + + let lifted2460 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result2450 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2452 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result2451 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result2451) + } + _ => panic() + } + + let lifted2453 : UInt64? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + let array2457 : Array[@context.Attribute] = []; + for index2458 = 0; index2458 < (mbt_ffi_load32((iter_base) + 68)); index2458 = index2458 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index2458 * 20) + + let result2454 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2456 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result2455 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + @context.AttributeValue::String(result2455) + } + _ => panic() + } + + array2457.push(@context.Attribute::{key : result2454, value : lifted2456}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + SpanData::LocalSpan(LocalSpanData::{span_id : result2450, start : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent : lifted2452, linked_context : lifted2453, attributes : array2457, inherited : (mbt_ffi_load8_u((iter_base) + 72) != 0)}) + } + 1 => { + + let result2459 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + SpanData::ExternalSpan(ExternalSpanData::{span_id : result2459}) + } + _ => panic() + } + + array2461.push(lifted2460) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array2463.push(array2461) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 96)) + + AgentInvocation::AgentMethodInvocation(AgentMethodInvocationParameters::{idempotency_key : result2210, method_name : result2211, function_input : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array2408, defs : array2413, root : mbt_ffi_load32((iter_base) + 64)}, value : @types.SchemaValueTree::{value_nodes : array2444, root : mbt_ffi_load32((iter_base) + 76)}}, trace_id : result2446, trace_states : array2448, invocation_context : array2463}) + } + 2 => { + + AgentInvocation::SaveSnapshot + } + 3 => { + + let result2465 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let result2466 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + AgentInvocation::LoadSnapshot(LoadSnapshotParameters::{snapshot : SnapshotData::{data : result2465, mime_type : result2466}}) + } + 4 => { + + let result2467 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + AgentInvocation::ProcessOplogEntries(ProcessOplogEntriesParameters::{idempotency_key : result2467}) + } + 5 => { + + AgentInvocation::ManualUpdate(ManualUpdateParameters::{target_revision : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}) + } + _ => panic() + } + + PublicOplogEntry::PendingAgentInvocation(PendingAgentInvocationParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, invocation : lifted2468}) + } + 15 => { + + let lifted2471 = match (mbt_ffi_load8_u((iter_base) + 32)) { + 0 => { + + UpdateDescription::AutoUpdate + } + 1 => { + + let result2469 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + let result2470 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + UpdateDescription::SnapshotBased(@host.Snapshot::{payload : result2469, mime_type : result2470}) + } + _ => panic() + } + + PublicOplogEntry::PendingUpdate(PendingUpdateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, target_revision : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), description : lifted2471}) + } + 16 => { + + let array2478 : Array[PluginInstallationDescription] = []; + for index2479 = 0; index2479 < (mbt_ffi_load32((iter_base) + 44)); index2479 = index2479 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index2479 * 48) + + let result2472 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + let result2473 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + let array2476 : Array[(String, String)] = []; + for index2477 = 0; index2477 < (mbt_ffi_load32((iter_base) + 40)); index2477 = index2477 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2477 * 16) + + let result2474 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result2475 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array2476.push((result2474, result2475)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + array2478.push(PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 16), plugin_name : result2472, plugin_version : result2473, parameters : array2476}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + PublicOplogEntry::SuccessfulUpdate(SuccessfulUpdateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, target_revision : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), new_component_size : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), new_active_plugins : array2478}) + } + 17 => { + + let lifted2481 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result2480 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result2480) + } + _ => panic() + } + + PublicOplogEntry::FailedUpdate(FailedUpdateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, target_revision : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), details : lifted2481}) + } + 18 => { + + PublicOplogEntry::GrowMemory(GrowMemoryParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, delta : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + 19 => { + + PublicOplogEntry::FilesystemStorageUsageUpdate(FilesystemStorageUsageUpdateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, delta : mbt_ffi_load64((iter_base) + 24)}) + } + 20 => { + + let result2482 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let result2483 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + PublicOplogEntry::CreateResource(CreateResourceParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, id : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), name : result2482, owner : result2483}) + } + 21 => { + + let result2484 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let result2485 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + PublicOplogEntry::DropResource(DropResourceParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, id : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), name : result2484, owner : result2485}) + } + 22 => { + + let result2486 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + let result2487 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + PublicOplogEntry::Log(LogParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, level : LogLevel::from(mbt_ffi_load8_u((iter_base) + 24)), context : result2486, message : result2487}) + } + 23 => { + + PublicOplogEntry::Restart(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}}) + } + 24 => { + + let result2488 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + let result2489 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) + + let array2492 : Array[(String, String)] = []; + for index2493 = 0; index2493 < (mbt_ffi_load32((iter_base) + 64)); index2493 = index2493 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index2493 * 16) + + let result2490 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result2491 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array2492.push((result2490, result2491)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + PublicOplogEntry::ActivatePlugin(ActivatePluginParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, plugin : PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 40), plugin_name : result2488, plugin_version : result2489, parameters : array2492}}) + } + 25 => { + + let result2494 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + let result2495 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) + + let array2498 : Array[(String, String)] = []; + for index2499 = 0; index2499 < (mbt_ffi_load32((iter_base) + 64)); index2499 = index2499 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index2499 * 16) + + let result2496 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result2497 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array2498.push((result2496, result2497)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + PublicOplogEntry::DeactivatePlugin(DeactivatePluginParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, plugin : PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 40), plugin_name : result2494, plugin_version : result2495, parameters : array2498}}) + } + 26 => { + + PublicOplogEntry::Revert(RevertParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, dropped_region : OplogRegion::{start : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), end : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}) + } + 27 => { + + let result2500 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PublicOplogEntry::CancelPendingInvocation(CancelPendingInvocationParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, idempotency_key : result2500}) + } + 28 => { + + let result2501 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let lifted2503 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result2502 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result2502) + } + _ => panic() + } + + let lifted2505 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result2504 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result2504) + } + _ => panic() + } + + let array2509 : Array[@context.Attribute] = []; + for index2510 = 0; index2510 < (mbt_ffi_load32((iter_base) + 60)); index2510 = index2510 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2510 * 20) + + let result2506 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2508 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result2507 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + @context.AttributeValue::String(result2507) + } + _ => panic() + } + + array2509.push(@context.Attribute::{key : result2506, value : lifted2508}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + PublicOplogEntry::StartSpan(StartSpanParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, span_id : result2501, parent : lifted2503, linked_context_id : lifted2505, attributes : array2509}) + } + 29 => { + + let result2511 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PublicOplogEntry::FinishSpan(FinishSpanParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, span_id : result2511}) + } + 30 => { + + let result2512 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let result2513 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let lifted2515 = match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => { + + let result2514 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + @context.AttributeValue::String(result2514) + } + _ => panic() + } + + PublicOplogEntry::SetSpanAttribute(SetSpanAttributeParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, span_id : result2512, key : result2513, value : lifted2515}) + } + 31 => { + + let lifted2516 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @host.PersistenceLevel::PersistNothing + } + 1 => { + + @host.PersistenceLevel::PersistRemoteSideEffects + } + 2 => { + + @host.PersistenceLevel::Smart + } + _ => panic() + } + + PublicOplogEntry::ChangePersistenceLevel(ChangePersistenceLevelParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, persistence_level : lifted2516}) + } + 32 => { + + let result2517 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PublicOplogEntry::BeginRemoteTransaction(BeginRemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, transaction_id : result2517}) + } + 33 => { + + PublicOplogEntry::PreCommitRemoteTransaction(RemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + 34 => { + + PublicOplogEntry::PreRollbackRemoteTransaction(RemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + 35 => { + + PublicOplogEntry::CommittedRemoteTransaction(RemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + 36 => { + + PublicOplogEntry::RolledBackRemoteTransaction(RemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + 37 => { + + let result2518 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let result2519 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + PublicOplogEntry::Snapshot(SnapshotParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, data : SnapshotData::{data : result2518, mime_type : result2519}}) + } + 38 => { + + let result2520 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + let result2521 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) + + let array2524 : Array[(String, String)] = []; + for index2525 = 0; index2525 < (mbt_ffi_load32((iter_base) + 64)); index2525 = index2525 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index2525 * 16) + + let result2522 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result2523 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array2524.push((result2522, result2523)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + let result2526 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 88), mbt_ffi_load32((iter_base) + 92)) + + PublicOplogEntry::OplogProcessorCheckpoint(OplogProcessorCheckpointParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, plugin : PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 40), plugin_name : result2520, plugin_version : result2521, parameters : array2524}, target_agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 72)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 80)).reinterpret_as_uint64()}}, agent_id : result2526}, confirmed_up_to : (mbt_ffi_load64((iter_base) + 96)).reinterpret_as_uint64(), sending_up_to : (mbt_ffi_load64((iter_base) + 104)).reinterpret_as_uint64(), last_batch_start : (mbt_ffi_load64((iter_base) + 112)).reinterpret_as_uint64()}) + } + 39 => { + + let result2527 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let array2559 : Array[@retry.PredicateNode] = []; + for index2560 = 0; index2560 < (mbt_ffi_load32((iter_base) + 40)); index2560 = index2560 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2560 * 32) + + let lifted2558 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result2528 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2530 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2529 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2529) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropEq(@retry.PropertyComparison::{property_name : result2528, value : lifted2530}) + } + 1 => { + + let result2531 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2533 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2532 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2532) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropNeq(@retry.PropertyComparison::{property_name : result2531, value : lifted2533}) + } + 2 => { + + let result2534 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2536 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2535 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2535) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropGt(@retry.PropertyComparison::{property_name : result2534, value : lifted2536}) + } + 3 => { + + let result2537 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2539 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2538 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2538) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropGte(@retry.PropertyComparison::{property_name : result2537, value : lifted2539}) + } + 4 => { + + let result2540 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2542 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2541 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2541) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropLt(@retry.PropertyComparison::{property_name : result2540, value : lifted2542}) + } + 5 => { + + let result2543 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2545 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2544 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2544) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropLte(@retry.PropertyComparison::{property_name : result2543, value : lifted2545}) + } + 6 => { + + let result2546 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @retry.PredicateNode::PropExists(result2546) + } + 7 => { + + let result2547 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array2550 : Array[@retry.PredicateValue] = []; + for index2551 = 0; index2551 < (mbt_ffi_load32((iter_base) + 20)); index2551 = index2551 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2551 * 16) + + let lifted2549 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result2548 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @retry.PredicateValue::Text(result2548) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 8)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + _ => panic() + } + + array2550.push(lifted2549) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + @retry.PredicateNode::PropIn(@retry.PropertySetCheck::{property_name : result2547, values : array2550}) + } + 8 => { + + let result2552 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result2553 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @retry.PredicateNode::PropMatches(@retry.PropertyPattern::{property_name : result2552, pattern : result2553}) + } + 9 => { + + let result2554 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result2555 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @retry.PredicateNode::PropStartsWith(@retry.PropertyPattern::{property_name : result2554, pattern : result2555}) + } + 10 => { + + let result2556 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result2557 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @retry.PredicateNode::PropContains(@retry.PropertyPattern::{property_name : result2556, pattern : result2557}) + } + 11 => { + + @retry.PredicateNode::PredAnd((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + @retry.PredicateNode::PredOr((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + @retry.PredicateNode::PredNot(mbt_ffi_load32((iter_base) + 8)) + } + 14 => { + + @retry.PredicateNode::PredTrue + } + 15 => { + + @retry.PredicateNode::PredFalse + } + _ => panic() + } + + array2559.push(lifted2558) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let array2595 : Array[@retry.PolicyNode] = []; + for index2596 = 0; index2596 < (mbt_ffi_load32((iter_base) + 48)); index2596 = index2596 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index2596 * 32) + + let lifted2594 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @retry.PolicyNode::Periodic((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 1 => { + + @retry.PolicyNode::Exponential(@retry.ExponentialConfig::{base_delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), factor : mbt_ffi_loadf64((iter_base) + 16)}) + } + 2 => { + + @retry.PolicyNode::Fibonacci(@retry.FibonacciConfig::{first : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), second : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64()}) + } + 3 => { + + @retry.PolicyNode::Immediate + } + 4 => { + + @retry.PolicyNode::Never + } + 5 => { + + @retry.PolicyNode::CountBox(@retry.CountBoxConfig::{max_retries : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), inner : mbt_ffi_load32((iter_base) + 12)}) + } + 6 => { + + @retry.PolicyNode::TimeBox(@retry.TimeBoxConfig::{limit : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 7 => { + + @retry.PolicyNode::ClampDelay(@retry.ClampConfig::{min_delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), max_delay : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 24)}) + } + 8 => { + + @retry.PolicyNode::AddDelay(@retry.AddDelayConfig::{delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 9 => { + + @retry.PolicyNode::Jitter(@retry.JitterConfig::{factor : mbt_ffi_loadf64((iter_base) + 8), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 10 => { + + let array2592 : Array[@retry.PredicateNode] = []; + for index2593 = 0; index2593 < (mbt_ffi_load32((iter_base) + 12)); index2593 = index2593 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2593 * 32) + + let lifted2591 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result2561 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2563 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2562 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2562) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropEq(@retry.PropertyComparison::{property_name : result2561, value : lifted2563}) + } + 1 => { + + let result2564 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2566 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2565 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2565) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropNeq(@retry.PropertyComparison::{property_name : result2564, value : lifted2566}) + } + 2 => { + + let result2567 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2569 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2568 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2568) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropGt(@retry.PropertyComparison::{property_name : result2567, value : lifted2569}) + } + 3 => { + + let result2570 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2572 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2571 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2571) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropGte(@retry.PropertyComparison::{property_name : result2570, value : lifted2572}) + } + 4 => { + + let result2573 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2575 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2574 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2574) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropLt(@retry.PropertyComparison::{property_name : result2573, value : lifted2575}) + } + 5 => { + + let result2576 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2578 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result2577 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + @retry.PredicateValue::Text(result2577) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + @retry.PredicateNode::PropLte(@retry.PropertyComparison::{property_name : result2576, value : lifted2578}) + } + 6 => { + + let result2579 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @retry.PredicateNode::PropExists(result2579) + } + 7 => { + + let result2580 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array2583 : Array[@retry.PredicateValue] = []; + for index2584 = 0; index2584 < (mbt_ffi_load32((iter_base) + 20)); index2584 = index2584 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2584 * 16) + + let lifted2582 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result2581 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @retry.PredicateValue::Text(result2581) + } + 1 => { + + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 8)) + } + 2 => { + + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + _ => panic() + } + + array2583.push(lifted2582) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + @retry.PredicateNode::PropIn(@retry.PropertySetCheck::{property_name : result2580, values : array2583}) + } + 8 => { + + let result2585 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result2586 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @retry.PredicateNode::PropMatches(@retry.PropertyPattern::{property_name : result2585, pattern : result2586}) + } + 9 => { + + let result2587 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result2588 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @retry.PredicateNode::PropStartsWith(@retry.PropertyPattern::{property_name : result2587, pattern : result2588}) + } + 10 => { + + let result2589 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result2590 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @retry.PredicateNode::PropContains(@retry.PropertyPattern::{property_name : result2589, pattern : result2590}) + } + 11 => { + + @retry.PredicateNode::PredAnd((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + @retry.PredicateNode::PredOr((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + @retry.PredicateNode::PredNot(mbt_ffi_load32((iter_base) + 8)) + } + 14 => { + + @retry.PredicateNode::PredTrue + } + 15 => { + + @retry.PredicateNode::PredFalse + } + _ => panic() + } + + array2592.push(lifted2591) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @retry.PolicyNode::FilteredOn(@retry.FilteredConfig::{predicate : @retry.RetryPredicate::{nodes : array2592}, inner : mbt_ffi_load32((iter_base) + 16)}) + } + 11 => { + + @retry.PolicyNode::AndThen((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + @retry.PolicyNode::PolicyUnion((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + @retry.PolicyNode::PolicyIntersect((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } + + array2595.push(lifted2594) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + PublicOplogEntry::SetRetryPolicy(SetRetryPolicyParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, policy : @retry.NamedRetryPolicy::{name : result2527, priority : (mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint(), predicate : @retry.RetryPredicate::{nodes : array2559}, policy : @retry.RetryPolicy::{nodes : array2595}}}) + } + 40 => { + + let result2597 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PublicOplogEntry::RemoveRetryPolicy(RemoveRetryPolicyParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, name : result2597}) + } + 41 => { + + let lifted2598 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + QueuedCardEvent::Install(QueuedCardEventInstall::{card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}}) + } + 1 => { + + QueuedCardEvent::Revoke(QueuedCardEventRevoke::{card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}}) + } + _ => panic() + } + + PublicOplogEntry::CardEventQueued(CardEventQueuedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, event : lifted2598}) + } + 42 => { + + let lifted2599 : UInt64? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + PublicOplogEntry::CardInstalled(CardInstalledParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, queued_event_index : lifted2599, card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 48)).reinterpret_as_uint64()}}}) + } + 43 => { + + PublicOplogEntry::CardInstallFailed(CardInstallFailedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, queued_event_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}, reason : CardInstallFailure::from(mbt_ffi_load8_u((iter_base) + 48))}) + } + 44 => { + + PublicOplogEntry::CardRevoked(CardRevokedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, queued_event_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}}) + } + 45 => { + + PublicOplogEntry::CardExpired(CardExpiredParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}}}) + } + 46 => { + + let array2796 : Array[@types.SchemaTypeNode] = []; + for index2797 = 0; index2797 < (mbt_ffi_load32((iter_base) + 40)); index2797 = index2797 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2797 * 144) + + let lifted2782 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted2606 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2601 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2600 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2600) + } + _ => panic() + } + + let lifted2603 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2602 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2602) + } + _ => panic() + } + + let lifted2605 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2604 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2604) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2601, max : lifted2603, unit : lifted2605}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted2606) + } + 3 => { + + let lifted2613 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2608 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2607 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2607) + } + _ => panic() + } + + let lifted2610 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2609 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2609) + } + _ => panic() + } + + let lifted2612 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2611 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2611) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2608, max : lifted2610, unit : lifted2612}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted2613) + } + 4 => { + + let lifted2620 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2615 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2614 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2614) + } + _ => panic() + } + + let lifted2617 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2616 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2616) + } + _ => panic() + } + + let lifted2619 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2618 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2618) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2615, max : lifted2617, unit : lifted2619}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted2620) + } + 5 => { + + let lifted2627 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2622 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2621 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2621) + } + _ => panic() + } + + let lifted2624 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2623 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2623) + } + _ => panic() + } + + let lifted2626 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2625 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2625) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2622, max : lifted2624, unit : lifted2626}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted2627) + } + 6 => { + + let lifted2634 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2629 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2628 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2628) + } + _ => panic() + } + + let lifted2631 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2630 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2630) + } + _ => panic() + } + + let lifted2633 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2632 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2632) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2629, max : lifted2631, unit : lifted2633}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted2634) + } + 7 => { + + let lifted2641 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2636 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2635 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2635) + } + _ => panic() + } + + let lifted2638 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2637 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2637) + } + _ => panic() + } + + let lifted2640 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2639 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2639) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2636, max : lifted2638, unit : lifted2640}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted2641) + } + 8 => { + + let lifted2648 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2643 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2642 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2642) + } + _ => panic() + } + + let lifted2645 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2644 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2644) + } + _ => panic() + } + + let lifted2647 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2646 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2646) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2643, max : lifted2645, unit : lifted2647}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted2648) + } + 9 => { + + let lifted2655 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2650 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2649 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2649) + } + _ => panic() + } + + let lifted2652 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2651 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2651) + } + _ => panic() + } + + let lifted2654 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2653 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2653) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2650, max : lifted2652, unit : lifted2654}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted2655) + } + 10 => { + + let lifted2662 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2657 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2656 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2656) + } + _ => panic() + } + + let lifted2659 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2658 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2658) + } + _ => panic() + } + + let lifted2661 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2660 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2660) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2657, max : lifted2659, unit : lifted2661}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted2662) + } + 11 => { + + let lifted2669 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2664 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2663 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2663) + } + _ => panic() + } + + let lifted2666 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2665 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2665) + } + _ => panic() + } + + let lifted2668 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2667 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2667) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2664, max : lifted2666, unit : lifted2668}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted2669) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array2684 : Array[@types.NamedFieldType] = []; + for index2685 = 0; index2685 < (mbt_ffi_load32((iter_base) + 12)); index2685 = index2685 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2685 * 68) + + let result2670 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2672 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2671 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2671) + } + _ => panic() + } + + let array2674 : Array[String] = []; + for index2675 = 0; index2675 < (mbt_ffi_load32((iter_base) + 28)); index2675 = index2675 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2675 * 8) + + let result2673 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2674.push(result2673) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array2677 : Array[String] = []; + for index2678 = 0; index2678 < (mbt_ffi_load32((iter_base) + 36)); index2678 = index2678 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index2678 * 8) + + let result2676 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2677.push(result2676) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted2680 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result2679 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result2679) + } + _ => panic() + } + + let lifted2683 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted2682 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2681 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result2681) + } + _ => panic() + } + + Option::Some(lifted2682) + } + _ => panic() + } + + array2684.push(@types.NamedFieldType::{name : result2670, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted2672, aliases : array2674, examples : array2677, deprecated : lifted2680, role : lifted2683}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array2684) + } + 15 => { + + let array2701 : Array[@types.VariantCaseType] = []; + for index2702 = 0; index2702 < (mbt_ffi_load32((iter_base) + 12)); index2702 = index2702 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2702 * 72) + + let result2686 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2687 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2689 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2688 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2688) + } + _ => panic() + } + + let array2691 : Array[String] = []; + for index2692 = 0; index2692 < (mbt_ffi_load32((iter_base) + 32)); index2692 = index2692 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2692 * 8) + + let result2690 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2691.push(result2690) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array2694 : Array[String] = []; + for index2695 = 0; index2695 < (mbt_ffi_load32((iter_base) + 40)); index2695 = index2695 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2695 * 8) + + let result2693 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2694.push(result2693) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted2697 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result2696 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result2696) + } + _ => panic() + } + + let lifted2700 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted2699 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2698 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result2698) + } + _ => panic() + } + + Option::Some(lifted2699) + } + _ => panic() + } + + array2701.push(@types.VariantCaseType::{name : result2686, payload : lifted2687, metadata : @types.MetadataEnvelope::{doc : lifted2689, aliases : array2691, examples : array2694, deprecated : lifted2697, role : lifted2700}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array2701) + } + 16 => { + + let array2704 : Array[String] = []; + for index2705 = 0; index2705 < (mbt_ffi_load32((iter_base) + 12)); index2705 = index2705 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2705 * 8) + + let result2703 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2704.push(result2703) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array2704) + } + 17 => { + + let array2707 : Array[String] = []; + for index2708 = 0; index2708 < (mbt_ffi_load32((iter_base) + 12)); index2708 = index2708 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2708 * 8) + + let result2706 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2707.push(result2706) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array2707) + } + 18 => { + + let array2709 : Array[Int] = []; + for index2710 = 0; index2710 < (mbt_ffi_load32((iter_base) + 12)); index2710 = index2710 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2710 * 4) + + array2709.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array2709) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted2711 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted2712 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted2711, err : lifted2712}) + } + 24 => { + + let lifted2716 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2714 : Array[String] = []; + for index2715 = 0; index2715 < (mbt_ffi_load32((iter_base) + 16)); index2715 = index2715 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2715 * 8) + + let result2713 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2714.push(result2713) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2714) + } + _ => panic() + } + + let lifted2717 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2718 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2720 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2719 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2719) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted2716, min_length : lifted2717, max_length : lifted2718, regex : lifted2720}) + } + 25 => { + + let lifted2724 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2722 : Array[String] = []; + for index2723 = 0; index2723 < (mbt_ffi_load32((iter_base) + 16)); index2723 = index2723 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2723 * 8) + + let result2721 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2722.push(result2721) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2722) + } + _ => panic() + } + + let lifted2725 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted2726 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted2724, min_bytes : lifted2725, max_bytes : lifted2726}) + } + 26 => { + + let lifted2730 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array2728 : Array[String] = []; + for index2729 = 0; index2729 < (mbt_ffi_load32((iter_base) + 20)); index2729 = index2729 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2729 * 8) + + let result2727 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2728.push(result2727) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array2728) + } + _ => panic() + } + + let lifted2734 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array2732 : Array[String] = []; + for index2733 = 0; index2733 < (mbt_ffi_load32((iter_base) + 32)); index2733 = index2733 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2733 * 8) + + let result2731 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2732.push(result2731) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array2732) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted2730, allowed_extensions : lifted2734}) + } + 27 => { + + let lifted2738 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2736 : Array[String] = []; + for index2737 = 0; index2737 < (mbt_ffi_load32((iter_base) + 16)); index2737 = index2737 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2737 * 8) + + let result2735 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2736.push(result2735) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2736) + } + _ => panic() + } + + let lifted2742 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array2740 : Array[String] = []; + for index2741 = 0; index2741 < (mbt_ffi_load32((iter_base) + 28)); index2741 = index2741 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2741 * 8) + + let result2739 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2740.push(result2739) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array2740) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted2738, allowed_hosts : lifted2742}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result2743 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array2745 : Array[String] = []; + for index2746 = 0; index2746 < (mbt_ffi_load32((iter_base) + 20)); index2746 = index2746 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2746 * 8) + + let result2744 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2745.push(result2744) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted2748 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2747 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result2747}) + } + _ => panic() + } + + let lifted2750 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result2749 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result2749}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result2743, allowed_suffixes : array2745, min : lifted2748, max : lifted2750}) + } + 31 => { + + let array2774 : Array[@types.UnionBranch] = []; + for index2775 = 0; index2775 < (mbt_ffi_load32((iter_base) + 12)); index2775 = index2775 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2775 * 92) + + let result2751 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2760 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result2752 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result2752) + } + 1 => { + + let result2753 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result2753) + } + 2 => { + + let result2754 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result2754) + } + 3 => { + + let result2755 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result2755) + } + 4 => { + + let result2756 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted2758 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result2757 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result2757) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result2756, literal : lifted2758}) + } + 5 => { + + let result2759 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result2759) + } + _ => panic() + } + + let lifted2762 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result2761 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result2761) + } + _ => panic() + } + + let array2764 : Array[String] = []; + for index2765 = 0; index2765 < (mbt_ffi_load32((iter_base) + 52)); index2765 = index2765 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2765 * 8) + + let result2763 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2764.push(result2763) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array2767 : Array[String] = []; + for index2768 = 0; index2768 < (mbt_ffi_load32((iter_base) + 60)); index2768 = index2768 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2768 * 8) + + let result2766 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2767.push(result2766) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted2770 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2769 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2769) + } + _ => panic() + } + + let lifted2773 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted2772 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2771 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result2771) + } + _ => panic() + } + + Option::Some(lifted2772) + } + _ => panic() + } + + array2774.push(@types.UnionBranch::{tag : result2751, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted2760, metadata : @types.MetadataEnvelope::{doc : lifted2762, aliases : array2764, examples : array2767, deprecated : lifted2770, role : lifted2773}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array2774}) + } + 32 => { + + let lifted2777 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result2776 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result2776) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted2777}) + } + 33 => { + + let lifted2779 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2778 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2778) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted2779}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted2780 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted2780) + } + 36 => { + + let lifted2781 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted2781) + } + _ => panic() + } + + let lifted2784 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result2783 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result2783) + } + _ => panic() + } + + let array2786 : Array[String] = []; + for index2787 = 0; index2787 < (mbt_ffi_load32((iter_base) + 104)); index2787 = index2787 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index2787 * 8) + + let result2785 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2786.push(result2785) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array2789 : Array[String] = []; + for index2790 = 0; index2790 < (mbt_ffi_load32((iter_base) + 112)); index2790 = index2790 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index2790 * 8) + + let result2788 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2789.push(result2788) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted2792 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result2791 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result2791) + } + _ => panic() + } + + let lifted2795 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted2794 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result2793 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result2793) + } + _ => panic() + } + + Option::Some(lifted2794) + } + _ => panic() + } + + array2796.push(@types.SchemaTypeNode::{body : lifted2782, metadata : @types.MetadataEnvelope::{doc : lifted2784, aliases : array2786, examples : array2789, deprecated : lifted2792, role : lifted2795}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let array2801 : Array[@types.SchemaTypeDef] = []; + for index2802 = 0; index2802 < (mbt_ffi_load32((iter_base) + 48)); index2802 = index2802 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index2802 * 24) + + let result2798 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted2800 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result2799 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result2799) + } + _ => panic() + } + + array2801.push(@types.SchemaTypeDef::{id : result2798, name : lifted2800, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + let array2832 : Array[@types.SchemaValueNode] = []; + for index2833 = 0; index2833 < (mbt_ffi_load32((iter_base) + 60)); index2833 = index2833 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2833 * 32) + + let lifted2831 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result2803 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result2803) + } + 13 => { + + let array2804 : Array[Int] = []; + for index2805 = 0; index2805 < (mbt_ffi_load32((iter_base) + 12)); index2805 = index2805 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2805 * 4) + + array2804.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array2804) + } + 14 => { + + let lifted2806 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted2806}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array2807 : Array[Bool] = []; + for index2808 = 0; index2808 < (mbt_ffi_load32((iter_base) + 12)); index2808 = index2808 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2808 * 1) + + array2807.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array2807) + } + 17 => { + + let array2809 : Array[Int] = []; + for index2810 = 0; index2810 < (mbt_ffi_load32((iter_base) + 12)); index2810 = index2810 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2810 * 4) + + array2809.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array2809) + } + 18 => { + + let array2811 : Array[Int] = []; + for index2812 = 0; index2812 < (mbt_ffi_load32((iter_base) + 12)); index2812 = index2812 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2812 * 4) + + array2811.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array2811) + } + 19 => { + + let array2813 : Array[Int] = []; + for index2814 = 0; index2814 < (mbt_ffi_load32((iter_base) + 12)); index2814 = index2814 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2814 * 4) + + array2813.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array2813) + } + 20 => { + + let array2815 : Array[@types.MapEntry] = []; + for index2816 = 0; index2816 < (mbt_ffi_load32((iter_base) + 12)); index2816 = index2816 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2816 * 8) + + array2815.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array2815) + } + 21 => { + + let lifted2817 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted2817) + } + 22 => { + + let lifted2820 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted2818 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted2818) + } + 1 => { + + let lifted2819 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted2819) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted2820) + } + 23 => { + + let result2821 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2823 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2822 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2822) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result2821, language : lifted2823}) + } + 24 => { + + let result2824 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted2826 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result2825 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result2825) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result2824, mime_type : lifted2826}) + } + 25 => { + + let result2827 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result2827) + } + 26 => { + + let result2828 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result2828) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result2829 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result2829}) + } + 30 => { + + let result2830 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result2830, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array2832.push(lifted2831) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + PublicOplogEntry::HostStreamFrame(HostStreamFrameParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, parent_start_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64(), kind : HostStreamKind::from(mbt_ffi_load8_u((iter_base) + 32)), payload : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array2796, defs : array2801, root : mbt_ffi_load32((iter_base) + 52)}, value : @types.SchemaValueTree::{value_nodes : array2832, root : mbt_ffi_load32((iter_base) + 64)}}}) + } + 47 => { + + PublicOplogEntry::CompletionDiscarded(CompletionDiscardedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, start_index : (mbt_ffi_load64((iter_base) + 24)).reinterpret_as_uint64()}) + } + _ => panic() + } + + array2835.push(lifted2834) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) + + Option::Some(array2835) + } + _ => panic() + } + let ret = lifted2837 + mbt_ffi_free(return_area) + return ret + +} +///| +pub fn SearchOplog::search_oplog(agent_id : @types.AgentId, text : String) -> SearchOplog { + + let ptr = mbt_ffi_str2ptr((agent_id).agent_id) + + let ptr0 = mbt_ffi_str2ptr(text) + let result : Int = wasmImportConstructorSearchOplog(((((agent_id).component_id).uuid).high_bits).reinterpret_as_int64(), ((((agent_id).component_id).uuid).low_bits).reinterpret_as_int64(), ptr, (agent_id).agent_id.length(), ptr0, text.length()); + let ret = SearchOplog::SearchOplog(result) + mbt_ffi_free(ptr) + mbt_ffi_free(ptr0) + return ret + +} +///| +pub fn SearchOplog::get_next(self : SearchOplog) -> Array[(UInt64, PublicOplogEntry)]? { + + let SearchOplog(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodSearchOplogGetNext(handle, return_area); + + let lifted2837 : Array[(UInt64, PublicOplogEntry)]? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let array2835 : Array[(UInt64, PublicOplogEntry)] = []; + for index2836 = 0; index2836 < (mbt_ffi_load32((return_area) + 8)); index2836 = index2836 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index2836 * 216) + + let lifted2834 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + let array : Array[(String, String)] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 76)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 72)) + (index * 16) + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array.push((result0, result1)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 72)) + + let lifted : @types.AgentId? = match mbt_ffi_load8_u((iter_base) + 112) { + 0 => Option::None + 1 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + Option::Some(@types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 120)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 128)).reinterpret_as_uint64()}}, agent_id : result2}) + } + _ => panic() + } + + let array9 : Array[PluginInstallationDescription] = []; + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 164)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 160)) + (index10 * 48) + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + let array7 : Array[(String, String)] = []; + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 40)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index8 * 16) + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array7.push((result5, result6)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + array9.push(PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 16), plugin_name : result3, plugin_version : result4, parameters : array7}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 160)) + + let array248 : Array[LocalAgentConfigEntry] = []; + for index249 = 0; index249 < (mbt_ffi_load32((iter_base) + 172)); index249 = index249 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 168)) + (index249 * 40) + + let array12 : Array[String] = []; + for index13 = 0; index13 < (mbt_ffi_load32((iter_base) + 4)); index13 = index13 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index13 * 8) + + let result11 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array12.push(result11) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + let array210 : Array[@types.SchemaTypeNode] = []; + for index211 = 0; index211 < (mbt_ffi_load32((iter_base) + 12)); index211 = index211 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index211 * 144) + + let lifted196 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted20 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted15 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted14 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted14) + } + _ => panic() + } + + let lifted17 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted16 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted16) + } + _ => panic() + } + + let lifted19 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result18) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted15, max : lifted17, unit : lifted19}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted20) + } + 3 => { + + let lifted27 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted22 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted21 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted21) + } + _ => panic() + } + + let lifted24 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted23 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted23) + } + _ => panic() + } + + let lifted26 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result25 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result25) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted22, max : lifted24, unit : lifted26}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted27) + } + 4 => { + + let lifted34 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted29 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted28 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted28) + } + _ => panic() + } + + let lifted31 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted30 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted30) + } + _ => panic() + } + + let lifted33 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result32 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result32) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted29, max : lifted31, unit : lifted33}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted34) + } + 5 => { + + let lifted41 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted36 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted35 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted35) + } + _ => panic() + } + + let lifted38 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted37 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted37) + } + _ => panic() + } + + let lifted40 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result39 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result39) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted36, max : lifted38, unit : lifted40}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted41) + } + 6 => { + + let lifted48 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted43 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted42 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted42) + } + _ => panic() + } + + let lifted45 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted44 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted44) + } + _ => panic() + } + + let lifted47 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result46 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result46) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted43, max : lifted45, unit : lifted47}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted48) + } + 7 => { + + let lifted55 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted50 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted49 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted49) + } + _ => panic() + } + + let lifted52 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted51 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted51) + } + _ => panic() + } + + let lifted54 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result53 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result53) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted50, max : lifted52, unit : lifted54}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted55) + } + 8 => { + + let lifted62 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted57 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted56 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted56) + } + _ => panic() + } + + let lifted59 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted58 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted58) + } + _ => panic() + } + + let lifted61 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result60 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result60) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted57, max : lifted59, unit : lifted61}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted62) + } + 9 => { + + let lifted69 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted64 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted63 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted63) + } + _ => panic() + } + + let lifted66 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted65 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted65) + } + _ => panic() + } + + let lifted68 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result67 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result67) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted64, max : lifted66, unit : lifted68}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted69) + } + 10 => { + + let lifted76 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted71 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted70 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted70) + } + _ => panic() + } + + let lifted73 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted72 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted72) + } + _ => panic() + } + + let lifted75 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result74 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result74) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted71, max : lifted73, unit : lifted75}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted76) + } + 11 => { + + let lifted83 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted78 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted77 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted77) + } + _ => panic() + } + + let lifted80 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted79 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted79) + } + _ => panic() + } + + let lifted82 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result81 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result81) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted78, max : lifted80, unit : lifted82}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted83) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array98 : Array[@types.NamedFieldType] = []; + for index99 = 0; index99 < (mbt_ffi_load32((iter_base) + 12)); index99 = index99 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index99 * 68) + + let result84 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted86 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result85 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result85) + } + _ => panic() + } + + let array88 : Array[String] = []; + for index89 = 0; index89 < (mbt_ffi_load32((iter_base) + 28)); index89 = index89 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index89 * 8) + + let result87 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array88.push(result87) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array91 : Array[String] = []; + for index92 = 0; index92 < (mbt_ffi_load32((iter_base) + 36)); index92 = index92 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index92 * 8) + + let result90 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array91.push(result90) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted94 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result93 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result93) + } + _ => panic() + } + + let lifted97 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted96 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result95 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result95) + } + _ => panic() + } + + Option::Some(lifted96) + } + _ => panic() + } + + array98.push(@types.NamedFieldType::{name : result84, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted86, aliases : array88, examples : array91, deprecated : lifted94, role : lifted97}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array98) + } + 15 => { + + let array115 : Array[@types.VariantCaseType] = []; + for index116 = 0; index116 < (mbt_ffi_load32((iter_base) + 12)); index116 = index116 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index116 * 72) + + let result100 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted101 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted103 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result102 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result102) + } + _ => panic() + } + + let array105 : Array[String] = []; + for index106 = 0; index106 < (mbt_ffi_load32((iter_base) + 32)); index106 = index106 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index106 * 8) + + let result104 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array105.push(result104) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array108 : Array[String] = []; + for index109 = 0; index109 < (mbt_ffi_load32((iter_base) + 40)); index109 = index109 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index109 * 8) + + let result107 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array108.push(result107) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted111 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result110 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result110) + } + _ => panic() + } + + let lifted114 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted113 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result112 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result112) + } + _ => panic() + } + + Option::Some(lifted113) + } + _ => panic() + } + + array115.push(@types.VariantCaseType::{name : result100, payload : lifted101, metadata : @types.MetadataEnvelope::{doc : lifted103, aliases : array105, examples : array108, deprecated : lifted111, role : lifted114}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array115) + } + 16 => { + + let array118 : Array[String] = []; + for index119 = 0; index119 < (mbt_ffi_load32((iter_base) + 12)); index119 = index119 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index119 * 8) + + let result117 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array118.push(result117) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array118) + } + 17 => { + + let array121 : Array[String] = []; + for index122 = 0; index122 < (mbt_ffi_load32((iter_base) + 12)); index122 = index122 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index122 * 8) + + let result120 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array121.push(result120) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array121) + } + 18 => { + + let array123 : Array[Int] = []; + for index124 = 0; index124 < (mbt_ffi_load32((iter_base) + 12)); index124 = index124 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index124 * 4) + + array123.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array123) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted125 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted126 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted125, err : lifted126}) + } + 24 => { + + let lifted130 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array128 : Array[String] = []; + for index129 = 0; index129 < (mbt_ffi_load32((iter_base) + 16)); index129 = index129 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index129 * 8) + + let result127 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array128.push(result127) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array128) + } + _ => panic() + } + + let lifted131 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted132 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted134 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result133 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result133) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted130, min_length : lifted131, max_length : lifted132, regex : lifted134}) + } + 25 => { + + let lifted138 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array136 : Array[String] = []; + for index137 = 0; index137 < (mbt_ffi_load32((iter_base) + 16)); index137 = index137 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index137 * 8) + + let result135 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array136.push(result135) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array136) + } + _ => panic() + } + + let lifted139 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted140 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted138, min_bytes : lifted139, max_bytes : lifted140}) + } + 26 => { + + let lifted144 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array142 : Array[String] = []; + for index143 = 0; index143 < (mbt_ffi_load32((iter_base) + 20)); index143 = index143 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index143 * 8) + + let result141 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array142.push(result141) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array142) + } + _ => panic() + } + + let lifted148 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array146 : Array[String] = []; + for index147 = 0; index147 < (mbt_ffi_load32((iter_base) + 32)); index147 = index147 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index147 * 8) + + let result145 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array146.push(result145) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array146) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted144, allowed_extensions : lifted148}) + } + 27 => { + + let lifted152 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array150 : Array[String] = []; + for index151 = 0; index151 < (mbt_ffi_load32((iter_base) + 16)); index151 = index151 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index151 * 8) + + let result149 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array150.push(result149) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array150) + } + _ => panic() + } + + let lifted156 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array154 : Array[String] = []; + for index155 = 0; index155 < (mbt_ffi_load32((iter_base) + 28)); index155 = index155 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index155 * 8) + + let result153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array154.push(result153) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array154) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted152, allowed_hosts : lifted156}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result157 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array159 : Array[String] = []; + for index160 = 0; index160 < (mbt_ffi_load32((iter_base) + 20)); index160 = index160 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index160 * 8) + + let result158 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array159.push(result158) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted162 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result161 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result161}) + } + _ => panic() + } + + let lifted164 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result163 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result163}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result157, allowed_suffixes : array159, min : lifted162, max : lifted164}) + } + 31 => { + + let array188 : Array[@types.UnionBranch] = []; + for index189 = 0; index189 < (mbt_ffi_load32((iter_base) + 12)); index189 = index189 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index189 * 92) + + let result165 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted174 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result166 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result166) + } + 1 => { + + let result167 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result167) + } + 2 => { + + let result168 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result168) + } + 3 => { + + let result169 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result169) + } + 4 => { + + let result170 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted172 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result171 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result171) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result170, literal : lifted172}) + } + 5 => { + + let result173 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result173) + } + _ => panic() + } + + let lifted176 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result175 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result175) + } + _ => panic() + } + + let array178 : Array[String] = []; + for index179 = 0; index179 < (mbt_ffi_load32((iter_base) + 52)); index179 = index179 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index179 * 8) + + let result177 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array178.push(result177) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array181 : Array[String] = []; + for index182 = 0; index182 < (mbt_ffi_load32((iter_base) + 60)); index182 = index182 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index182 * 8) + + let result180 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array181.push(result180) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted184 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result183 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result183) + } + _ => panic() + } + + let lifted187 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted186 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result185 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result185) + } + _ => panic() + } + + Option::Some(lifted186) + } + _ => panic() + } + + array188.push(@types.UnionBranch::{tag : result165, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted174, metadata : @types.MetadataEnvelope::{doc : lifted176, aliases : array178, examples : array181, deprecated : lifted184, role : lifted187}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array188}) + } + 32 => { + + let lifted191 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result190 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result190) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted191}) + } + 33 => { + + let lifted193 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result192 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result192) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted193}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted194 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted194) + } + 36 => { + + let lifted195 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted195) + } + _ => panic() + } + + let lifted198 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result197 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result197) + } + _ => panic() + } + + let array200 : Array[String] = []; + for index201 = 0; index201 < (mbt_ffi_load32((iter_base) + 104)); index201 = index201 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index201 * 8) + + let result199 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array200.push(result199) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array203 : Array[String] = []; + for index204 = 0; index204 < (mbt_ffi_load32((iter_base) + 112)); index204 = index204 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index204 * 8) + + let result202 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array203.push(result202) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted206 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result205 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result205) + } + _ => panic() + } + + let lifted209 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted208 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result207 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result207) + } + _ => panic() + } + + Option::Some(lifted208) + } + _ => panic() + } + + array210.push(@types.SchemaTypeNode::{body : lifted196, metadata : @types.MetadataEnvelope::{doc : lifted198, aliases : array200, examples : array203, deprecated : lifted206, role : lifted209}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + let array215 : Array[@types.SchemaTypeDef] = []; + for index216 = 0; index216 < (mbt_ffi_load32((iter_base) + 20)); index216 = index216 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index216 * 24) + + let result212 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted214 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result213 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result213) + } + _ => panic() + } + + array215.push(@types.SchemaTypeDef::{id : result212, name : lifted214, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let array246 : Array[@types.SchemaValueNode] = []; + for index247 = 0; index247 < (mbt_ffi_load32((iter_base) + 32)); index247 = index247 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index247 * 32) + + let lifted245 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result217 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result217) + } + 13 => { + + let array218 : Array[Int] = []; + for index219 = 0; index219 < (mbt_ffi_load32((iter_base) + 12)); index219 = index219 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index219 * 4) + + array218.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array218) + } + 14 => { + + let lifted220 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted220}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array221 : Array[Bool] = []; + for index222 = 0; index222 < (mbt_ffi_load32((iter_base) + 12)); index222 = index222 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index222 * 1) + + array221.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array221) + } + 17 => { + + let array223 : Array[Int] = []; + for index224 = 0; index224 < (mbt_ffi_load32((iter_base) + 12)); index224 = index224 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index224 * 4) + + array223.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array223) + } + 18 => { + + let array225 : Array[Int] = []; + for index226 = 0; index226 < (mbt_ffi_load32((iter_base) + 12)); index226 = index226 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index226 * 4) + + array225.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array225) + } + 19 => { + + let array227 : Array[Int] = []; + for index228 = 0; index228 < (mbt_ffi_load32((iter_base) + 12)); index228 = index228 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index228 * 4) + + array227.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array227) + } + 20 => { + + let array229 : Array[@types.MapEntry] = []; + for index230 = 0; index230 < (mbt_ffi_load32((iter_base) + 12)); index230 = index230 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index230 * 8) + + array229.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array229) + } + 21 => { + + let lifted231 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted231) + } + 22 => { + + let lifted234 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted232 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted232) + } + 1 => { + + let lifted233 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted233) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted234) + } + 23 => { + + let result235 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted237 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result236 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result236) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result235, language : lifted237}) + } + 24 => { + + let result238 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted240 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result239 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result239) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result238, mime_type : lifted240}) + } + 25 => { + + let result241 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result241) + } + 26 => { + + let result242 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result242) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result243 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result243}) + } + 30 => { + + let result244 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result244, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array246.push(lifted245) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + array248.push(LocalAgentConfigEntry::{path : array12, value : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array210, defs : array215, root : mbt_ffi_load32((iter_base) + 24)}, value : @types.SchemaValueTree::{value_nodes : array246, root : mbt_ffi_load32((iter_base) + 36)}}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 168)) + + let lifted250 : @types.Uuid? = match mbt_ffi_load8_u((iter_base) + 176) { + 0 => Option::None + 1 => { + + Option::Some(@types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 184)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 192)).reinterpret_as_uint64()}) + } + _ => panic() + } + + PublicOplogEntry::Create(CreateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}, agent_id : result}, agent_mode : AgentMode::from(mbt_ffi_load8_u((iter_base) + 56)), component_revision : (mbt_ffi_load64((iter_base) + 64)).reinterpret_as_uint64(), env : array, created_by : @types.AccountId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 80)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 88)).reinterpret_as_uint64()}}, environment_id : @host.EnvironmentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 96)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 104)).reinterpret_as_uint64()}}, parent : lifted, component_size : (mbt_ffi_load64((iter_base) + 144)).reinterpret_as_uint64(), initial_total_linear_memory_size : (mbt_ffi_load64((iter_base) + 152)).reinterpret_as_uint64(), initial_active_plugins : array9, local_agent_config : array248, original_phantom_id : lifted250, instance_id : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 200)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 208)).reinterpret_as_uint64()}}) + } + 1 => { + + let lifted251 : UInt64? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()) + } + _ => panic() + } + + let result252 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + let lifted487 : @types.TypedSchemaValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let array449 : Array[@types.SchemaTypeNode] = []; + for index450 = 0; index450 < (mbt_ffi_load32((iter_base) + 64)); index450 = index450 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 60)) + (index450 * 144) + + let lifted435 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted259 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted254 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted253 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted253) + } + _ => panic() + } + + let lifted256 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted255 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted255) + } + _ => panic() + } + + let lifted258 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result257 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result257) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted254, max : lifted256, unit : lifted258}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted259) + } + 3 => { + + let lifted266 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted261 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted260 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted260) + } + _ => panic() + } + + let lifted263 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted262 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted262) + } + _ => panic() + } + + let lifted265 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result264 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result264) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted261, max : lifted263, unit : lifted265}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted266) + } + 4 => { + + let lifted273 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted268 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted267 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted267) + } + _ => panic() + } + + let lifted270 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted269 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted269) + } + _ => panic() + } + + let lifted272 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result271 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result271) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted268, max : lifted270, unit : lifted272}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted273) + } + 5 => { + + let lifted280 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted275 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted274 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted274) + } + _ => panic() + } + + let lifted277 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted276 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted276) + } + _ => panic() + } + + let lifted279 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result278 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result278) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted275, max : lifted277, unit : lifted279}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted280) + } + 6 => { + + let lifted287 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted282 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted281 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted281) + } + _ => panic() + } + + let lifted284 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted283 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted283) + } + _ => panic() + } + + let lifted286 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result285 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result285) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted282, max : lifted284, unit : lifted286}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted287) + } + 7 => { + + let lifted294 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted289 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted288 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted288) + } + _ => panic() + } + + let lifted291 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted290 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted290) + } + _ => panic() + } + + let lifted293 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result292 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result292) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted289, max : lifted291, unit : lifted293}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted294) + } + 8 => { + + let lifted301 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted296 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted295 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted295) + } + _ => panic() + } + + let lifted298 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted297 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted297) + } + _ => panic() + } + + let lifted300 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result299 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result299) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted296, max : lifted298, unit : lifted300}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted301) + } + 9 => { + + let lifted308 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted303 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted302 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted302) + } + _ => panic() + } + + let lifted305 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted304 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted304) + } + _ => panic() + } + + let lifted307 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result306 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result306) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted303, max : lifted305, unit : lifted307}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted308) + } + 10 => { + + let lifted315 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted310 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted309 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted309) + } + _ => panic() + } + + let lifted312 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted311 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted311) + } + _ => panic() + } + + let lifted314 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result313 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result313) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted310, max : lifted312, unit : lifted314}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted315) + } + 11 => { + + let lifted322 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted317 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted316 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted316) + } + _ => panic() + } + + let lifted319 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted318 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted318) + } + _ => panic() + } + + let lifted321 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result320 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result320) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted317, max : lifted319, unit : lifted321}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted322) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array337 : Array[@types.NamedFieldType] = []; + for index338 = 0; index338 < (mbt_ffi_load32((iter_base) + 12)); index338 = index338 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index338 * 68) + + let result323 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted325 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result324 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result324) + } + _ => panic() + } + + let array327 : Array[String] = []; + for index328 = 0; index328 < (mbt_ffi_load32((iter_base) + 28)); index328 = index328 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index328 * 8) + + let result326 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array327.push(result326) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array330 : Array[String] = []; + for index331 = 0; index331 < (mbt_ffi_load32((iter_base) + 36)); index331 = index331 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index331 * 8) + + let result329 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array330.push(result329) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted333 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result332 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result332) + } + _ => panic() + } + + let lifted336 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted335 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result334 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result334) + } + _ => panic() + } + + Option::Some(lifted335) + } + _ => panic() + } + + array337.push(@types.NamedFieldType::{name : result323, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted325, aliases : array327, examples : array330, deprecated : lifted333, role : lifted336}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array337) + } + 15 => { + + let array354 : Array[@types.VariantCaseType] = []; + for index355 = 0; index355 < (mbt_ffi_load32((iter_base) + 12)); index355 = index355 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index355 * 72) + + let result339 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted340 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted342 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result341 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result341) + } + _ => panic() + } + + let array344 : Array[String] = []; + for index345 = 0; index345 < (mbt_ffi_load32((iter_base) + 32)); index345 = index345 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index345 * 8) + + let result343 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array344.push(result343) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array347 : Array[String] = []; + for index348 = 0; index348 < (mbt_ffi_load32((iter_base) + 40)); index348 = index348 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index348 * 8) + + let result346 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array347.push(result346) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted350 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result349 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result349) + } + _ => panic() + } + + let lifted353 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted352 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result351 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result351) + } + _ => panic() + } + + Option::Some(lifted352) + } + _ => panic() + } + + array354.push(@types.VariantCaseType::{name : result339, payload : lifted340, metadata : @types.MetadataEnvelope::{doc : lifted342, aliases : array344, examples : array347, deprecated : lifted350, role : lifted353}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array354) + } + 16 => { + + let array357 : Array[String] = []; + for index358 = 0; index358 < (mbt_ffi_load32((iter_base) + 12)); index358 = index358 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index358 * 8) + + let result356 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array357.push(result356) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array357) + } + 17 => { + + let array360 : Array[String] = []; + for index361 = 0; index361 < (mbt_ffi_load32((iter_base) + 12)); index361 = index361 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index361 * 8) + + let result359 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array360.push(result359) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array360) + } + 18 => { + + let array362 : Array[Int] = []; + for index363 = 0; index363 < (mbt_ffi_load32((iter_base) + 12)); index363 = index363 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index363 * 4) + + array362.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array362) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted364 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted365 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted364, err : lifted365}) + } + 24 => { + + let lifted369 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array367 : Array[String] = []; + for index368 = 0; index368 < (mbt_ffi_load32((iter_base) + 16)); index368 = index368 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index368 * 8) + + let result366 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array367.push(result366) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array367) + } + _ => panic() + } + + let lifted370 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted371 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted373 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result372 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result372) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted369, min_length : lifted370, max_length : lifted371, regex : lifted373}) + } + 25 => { + + let lifted377 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array375 : Array[String] = []; + for index376 = 0; index376 < (mbt_ffi_load32((iter_base) + 16)); index376 = index376 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index376 * 8) + + let result374 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array375.push(result374) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array375) + } + _ => panic() + } + + let lifted378 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted379 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted377, min_bytes : lifted378, max_bytes : lifted379}) + } + 26 => { + + let lifted383 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array381 : Array[String] = []; + for index382 = 0; index382 < (mbt_ffi_load32((iter_base) + 20)); index382 = index382 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index382 * 8) + + let result380 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array381.push(result380) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array381) + } + _ => panic() + } + + let lifted387 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array385 : Array[String] = []; + for index386 = 0; index386 < (mbt_ffi_load32((iter_base) + 32)); index386 = index386 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index386 * 8) + + let result384 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array385.push(result384) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array385) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted383, allowed_extensions : lifted387}) + } + 27 => { + + let lifted391 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array389 : Array[String] = []; + for index390 = 0; index390 < (mbt_ffi_load32((iter_base) + 16)); index390 = index390 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index390 * 8) + + let result388 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array389.push(result388) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array389) + } + _ => panic() + } + + let lifted395 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array393 : Array[String] = []; + for index394 = 0; index394 < (mbt_ffi_load32((iter_base) + 28)); index394 = index394 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index394 * 8) + + let result392 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array393.push(result392) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array393) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted391, allowed_hosts : lifted395}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result396 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array398 : Array[String] = []; + for index399 = 0; index399 < (mbt_ffi_load32((iter_base) + 20)); index399 = index399 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index399 * 8) + + let result397 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array398.push(result397) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted401 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result400 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result400}) + } + _ => panic() + } + + let lifted403 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result402 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result402}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result396, allowed_suffixes : array398, min : lifted401, max : lifted403}) + } + 31 => { + + let array427 : Array[@types.UnionBranch] = []; + for index428 = 0; index428 < (mbt_ffi_load32((iter_base) + 12)); index428 = index428 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index428 * 92) + + let result404 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted413 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result405 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result405) + } + 1 => { + + let result406 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result406) + } + 2 => { + + let result407 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result407) + } + 3 => { + + let result408 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result408) + } + 4 => { + + let result409 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted411 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result410 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result410) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result409, literal : lifted411}) + } + 5 => { + + let result412 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result412) + } + _ => panic() + } + + let lifted415 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result414 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result414) + } + _ => panic() + } + + let array417 : Array[String] = []; + for index418 = 0; index418 < (mbt_ffi_load32((iter_base) + 52)); index418 = index418 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index418 * 8) + + let result416 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array417.push(result416) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array420 : Array[String] = []; + for index421 = 0; index421 < (mbt_ffi_load32((iter_base) + 60)); index421 = index421 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index421 * 8) + + let result419 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array420.push(result419) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted423 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result422 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result422) + } + _ => panic() + } + + let lifted426 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted425 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result424 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result424) + } + _ => panic() + } + + Option::Some(lifted425) + } + _ => panic() + } + + array427.push(@types.UnionBranch::{tag : result404, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted413, metadata : @types.MetadataEnvelope::{doc : lifted415, aliases : array417, examples : array420, deprecated : lifted423, role : lifted426}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array427}) + } + 32 => { + + let lifted430 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result429 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result429) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted430}) + } + 33 => { + + let lifted432 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result431 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result431) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted432}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted433 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted433) + } + 36 => { + + let lifted434 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted434) + } + _ => panic() + } + + let lifted437 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result436 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result436) + } + _ => panic() + } + + let array439 : Array[String] = []; + for index440 = 0; index440 < (mbt_ffi_load32((iter_base) + 104)); index440 = index440 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index440 * 8) + + let result438 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array439.push(result438) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array442 : Array[String] = []; + for index443 = 0; index443 < (mbt_ffi_load32((iter_base) + 112)); index443 = index443 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index443 * 8) + + let result441 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array442.push(result441) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted445 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result444 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result444) + } + _ => panic() + } + + let lifted448 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted447 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result446 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result446) + } + _ => panic() + } + + Option::Some(lifted447) + } + _ => panic() + } + + array449.push(@types.SchemaTypeNode::{body : lifted435, metadata : @types.MetadataEnvelope::{doc : lifted437, aliases : array439, examples : array442, deprecated : lifted445, role : lifted448}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + let array454 : Array[@types.SchemaTypeDef] = []; + for index455 = 0; index455 < (mbt_ffi_load32((iter_base) + 72)); index455 = index455 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index455 * 24) + + let result451 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted453 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result452 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result452) + } + _ => panic() + } + + array454.push(@types.SchemaTypeDef::{id : result451, name : lifted453, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + let array485 : Array[@types.SchemaValueNode] = []; + for index486 = 0; index486 < (mbt_ffi_load32((iter_base) + 84)); index486 = index486 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 80)) + (index486 * 32) + + let lifted484 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result456 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result456) + } + 13 => { + + let array457 : Array[Int] = []; + for index458 = 0; index458 < (mbt_ffi_load32((iter_base) + 12)); index458 = index458 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index458 * 4) + + array457.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array457) + } + 14 => { + + let lifted459 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted459}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array460 : Array[Bool] = []; + for index461 = 0; index461 < (mbt_ffi_load32((iter_base) + 12)); index461 = index461 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index461 * 1) + + array460.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array460) + } + 17 => { + + let array462 : Array[Int] = []; + for index463 = 0; index463 < (mbt_ffi_load32((iter_base) + 12)); index463 = index463 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index463 * 4) + + array462.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array462) + } + 18 => { + + let array464 : Array[Int] = []; + for index465 = 0; index465 < (mbt_ffi_load32((iter_base) + 12)); index465 = index465 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index465 * 4) + + array464.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array464) + } + 19 => { + + let array466 : Array[Int] = []; + for index467 = 0; index467 < (mbt_ffi_load32((iter_base) + 12)); index467 = index467 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index467 * 4) + + array466.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array466) + } + 20 => { + + let array468 : Array[@types.MapEntry] = []; + for index469 = 0; index469 < (mbt_ffi_load32((iter_base) + 12)); index469 = index469 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index469 * 8) + + array468.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array468) + } + 21 => { + + let lifted470 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted470) + } + 22 => { + + let lifted473 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted471 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted471) + } + 1 => { + + let lifted472 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted472) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted473) + } + 23 => { + + let result474 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted476 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result475 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result475) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result474, language : lifted476}) + } + 24 => { + + let result477 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted479 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result478 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result478) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result477, mime_type : lifted479}) + } + 25 => { + + let result480 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result480) + } + 26 => { + + let result481 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result481) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result482 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result482}) + } + 30 => { + + let result483 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result483, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array485.push(lifted484) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array449, defs : array454, root : mbt_ffi_load32((iter_base) + 76)}, value : @types.SchemaValueTree::{value_nodes : array485, root : mbt_ffi_load32((iter_base) + 88)}}) + } + _ => panic() + } + + let lifted490 = match (mbt_ffi_load8_u((iter_base) + 96)) { + 0 => { + + WrappedFunctionType::ReadLocal + } + 1 => { + + WrappedFunctionType::WriteLocal + } + 2 => { + + WrappedFunctionType::ReadRemote + } + 3 => { + + WrappedFunctionType::WriteRemote + } + 4 => { + + let lifted488 : UInt64? = match mbt_ffi_load8_u((iter_base) + 104) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 112)).reinterpret_as_uint64()) + } + _ => panic() + } + + WrappedFunctionType::WriteRemoteBatched(lifted488) + } + 5 => { + + let lifted489 : UInt64? = match mbt_ffi_load8_u((iter_base) + 104) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 112)).reinterpret_as_uint64()) + } + _ => panic() + } + + WrappedFunctionType::WriteRemoteTransaction(lifted489) + } + _ => panic() + } + + PublicOplogEntry::Start(StartParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent_start_index : lifted251, function_name : result252, request : lifted487, durable_function_type : lifted490}) + } + 2 => { + + let lifted725 : @types.TypedSchemaValue? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let array687 : Array[@types.SchemaTypeNode] = []; + for index688 = 0; index688 < (mbt_ffi_load32((iter_base) + 48)); index688 = index688 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index688 * 144) + + let lifted673 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted497 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted492 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted491 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted491) + } + _ => panic() + } + + let lifted494 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted493 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted493) + } + _ => panic() + } + + let lifted496 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result495 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result495) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted492, max : lifted494, unit : lifted496}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted497) + } + 3 => { + + let lifted504 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted499 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted498 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted498) + } + _ => panic() + } + + let lifted501 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted500 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted500) + } + _ => panic() + } + + let lifted503 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result502 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result502) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted499, max : lifted501, unit : lifted503}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted504) + } + 4 => { + + let lifted511 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted506 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted505 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted505) + } + _ => panic() + } + + let lifted508 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted507 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted507) + } + _ => panic() + } + + let lifted510 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result509 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result509) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted506, max : lifted508, unit : lifted510}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted511) + } + 5 => { + + let lifted518 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted513 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted512 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted512) + } + _ => panic() + } + + let lifted515 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted514 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted514) + } + _ => panic() + } + + let lifted517 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result516 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result516) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted513, max : lifted515, unit : lifted517}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted518) + } + 6 => { + + let lifted525 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted520 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted519 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted519) + } + _ => panic() + } + + let lifted522 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted521 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted521) + } + _ => panic() + } + + let lifted524 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result523 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result523) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted520, max : lifted522, unit : lifted524}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted525) + } + 7 => { + + let lifted532 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted527 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted526 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted526) + } + _ => panic() + } + + let lifted529 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted528 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted528) + } + _ => panic() + } + + let lifted531 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result530 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result530) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted527, max : lifted529, unit : lifted531}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted532) + } + 8 => { + + let lifted539 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted534 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted533 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted533) + } + _ => panic() + } + + let lifted536 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted535 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted535) + } + _ => panic() + } + + let lifted538 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result537 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result537) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted534, max : lifted536, unit : lifted538}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted539) + } + 9 => { + + let lifted546 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted541 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted540 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted540) + } + _ => panic() + } + + let lifted543 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted542 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted542) + } + _ => panic() + } + + let lifted545 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result544 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result544) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted541, max : lifted543, unit : lifted545}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted546) + } + 10 => { + + let lifted553 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted548 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted547 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted547) + } + _ => panic() + } + + let lifted550 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted549 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted549) + } + _ => panic() + } + + let lifted552 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result551 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result551) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted548, max : lifted550, unit : lifted552}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted553) + } + 11 => { + + let lifted560 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted555 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted554 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted554) + } + _ => panic() + } + + let lifted557 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted556 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted556) + } + _ => panic() + } + + let lifted559 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result558 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result558) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted555, max : lifted557, unit : lifted559}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted560) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array575 : Array[@types.NamedFieldType] = []; + for index576 = 0; index576 < (mbt_ffi_load32((iter_base) + 12)); index576 = index576 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index576 * 68) + + let result561 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted563 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result562 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result562) + } + _ => panic() + } + + let array565 : Array[String] = []; + for index566 = 0; index566 < (mbt_ffi_load32((iter_base) + 28)); index566 = index566 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index566 * 8) + + let result564 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array565.push(result564) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array568 : Array[String] = []; + for index569 = 0; index569 < (mbt_ffi_load32((iter_base) + 36)); index569 = index569 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index569 * 8) + + let result567 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array568.push(result567) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted571 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result570 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result570) + } + _ => panic() + } + + let lifted574 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted573 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result572 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result572) + } + _ => panic() + } + + Option::Some(lifted573) + } + _ => panic() + } + + array575.push(@types.NamedFieldType::{name : result561, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted563, aliases : array565, examples : array568, deprecated : lifted571, role : lifted574}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array575) + } + 15 => { + + let array592 : Array[@types.VariantCaseType] = []; + for index593 = 0; index593 < (mbt_ffi_load32((iter_base) + 12)); index593 = index593 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index593 * 72) + + let result577 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted578 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted580 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result579 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result579) + } + _ => panic() + } + + let array582 : Array[String] = []; + for index583 = 0; index583 < (mbt_ffi_load32((iter_base) + 32)); index583 = index583 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index583 * 8) + + let result581 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array582.push(result581) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array585 : Array[String] = []; + for index586 = 0; index586 < (mbt_ffi_load32((iter_base) + 40)); index586 = index586 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index586 * 8) + + let result584 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array585.push(result584) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted588 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result587 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result587) + } + _ => panic() + } + + let lifted591 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted590 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result589 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result589) + } + _ => panic() + } + + Option::Some(lifted590) + } + _ => panic() + } + + array592.push(@types.VariantCaseType::{name : result577, payload : lifted578, metadata : @types.MetadataEnvelope::{doc : lifted580, aliases : array582, examples : array585, deprecated : lifted588, role : lifted591}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array592) + } + 16 => { + + let array595 : Array[String] = []; + for index596 = 0; index596 < (mbt_ffi_load32((iter_base) + 12)); index596 = index596 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index596 * 8) + + let result594 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array595.push(result594) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array595) + } + 17 => { + + let array598 : Array[String] = []; + for index599 = 0; index599 < (mbt_ffi_load32((iter_base) + 12)); index599 = index599 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index599 * 8) + + let result597 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array598.push(result597) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array598) + } + 18 => { + + let array600 : Array[Int] = []; + for index601 = 0; index601 < (mbt_ffi_load32((iter_base) + 12)); index601 = index601 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index601 * 4) + + array600.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array600) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted602 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted603 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted602, err : lifted603}) + } + 24 => { + + let lifted607 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array605 : Array[String] = []; + for index606 = 0; index606 < (mbt_ffi_load32((iter_base) + 16)); index606 = index606 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index606 * 8) + + let result604 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array605.push(result604) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array605) + } + _ => panic() + } + + let lifted608 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted609 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted611 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result610 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result610) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted607, min_length : lifted608, max_length : lifted609, regex : lifted611}) + } + 25 => { + + let lifted615 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array613 : Array[String] = []; + for index614 = 0; index614 < (mbt_ffi_load32((iter_base) + 16)); index614 = index614 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index614 * 8) + + let result612 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array613.push(result612) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array613) + } + _ => panic() + } + + let lifted616 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted617 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted615, min_bytes : lifted616, max_bytes : lifted617}) + } + 26 => { + + let lifted621 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array619 : Array[String] = []; + for index620 = 0; index620 < (mbt_ffi_load32((iter_base) + 20)); index620 = index620 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index620 * 8) + + let result618 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array619.push(result618) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array619) + } + _ => panic() + } + + let lifted625 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array623 : Array[String] = []; + for index624 = 0; index624 < (mbt_ffi_load32((iter_base) + 32)); index624 = index624 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index624 * 8) + + let result622 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array623.push(result622) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array623) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted621, allowed_extensions : lifted625}) + } + 27 => { + + let lifted629 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array627 : Array[String] = []; + for index628 = 0; index628 < (mbt_ffi_load32((iter_base) + 16)); index628 = index628 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index628 * 8) + + let result626 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array627.push(result626) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array627) + } + _ => panic() + } + + let lifted633 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array631 : Array[String] = []; + for index632 = 0; index632 < (mbt_ffi_load32((iter_base) + 28)); index632 = index632 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index632 * 8) + + let result630 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array631.push(result630) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array631) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted629, allowed_hosts : lifted633}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result634 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array636 : Array[String] = []; + for index637 = 0; index637 < (mbt_ffi_load32((iter_base) + 20)); index637 = index637 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index637 * 8) + + let result635 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array636.push(result635) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted639 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result638 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result638}) + } + _ => panic() + } + + let lifted641 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result640 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result640}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result634, allowed_suffixes : array636, min : lifted639, max : lifted641}) + } + 31 => { + + let array665 : Array[@types.UnionBranch] = []; + for index666 = 0; index666 < (mbt_ffi_load32((iter_base) + 12)); index666 = index666 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index666 * 92) + + let result642 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted651 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result643 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result643) + } + 1 => { + + let result644 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result644) + } + 2 => { + + let result645 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result645) + } + 3 => { + + let result646 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result646) + } + 4 => { + + let result647 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted649 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result648 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result648) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result647, literal : lifted649}) + } + 5 => { + + let result650 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result650) + } + _ => panic() + } + + let lifted653 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result652 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result652) + } + _ => panic() + } + + let array655 : Array[String] = []; + for index656 = 0; index656 < (mbt_ffi_load32((iter_base) + 52)); index656 = index656 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index656 * 8) + + let result654 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array655.push(result654) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array658 : Array[String] = []; + for index659 = 0; index659 < (mbt_ffi_load32((iter_base) + 60)); index659 = index659 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index659 * 8) + + let result657 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array658.push(result657) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted661 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result660 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result660) + } + _ => panic() + } + + let lifted664 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted663 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result662 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result662) + } + _ => panic() + } + + Option::Some(lifted663) + } + _ => panic() + } + + array665.push(@types.UnionBranch::{tag : result642, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted651, metadata : @types.MetadataEnvelope::{doc : lifted653, aliases : array655, examples : array658, deprecated : lifted661, role : lifted664}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array665}) + } + 32 => { + + let lifted668 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result667 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result667) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted668}) + } + 33 => { + + let lifted670 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result669 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result669) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted670}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted671 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted671) + } + 36 => { + + let lifted672 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted672) + } + _ => panic() + } + + let lifted675 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result674 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result674) + } + _ => panic() + } + + let array677 : Array[String] = []; + for index678 = 0; index678 < (mbt_ffi_load32((iter_base) + 104)); index678 = index678 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index678 * 8) + + let result676 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array677.push(result676) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array680 : Array[String] = []; + for index681 = 0; index681 < (mbt_ffi_load32((iter_base) + 112)); index681 = index681 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index681 * 8) + + let result679 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array680.push(result679) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted683 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result682 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result682) + } + _ => panic() + } + + let lifted686 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted685 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result684 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result684) + } + _ => panic() + } + + Option::Some(lifted685) + } + _ => panic() + } + + array687.push(@types.SchemaTypeNode::{body : lifted673, metadata : @types.MetadataEnvelope::{doc : lifted675, aliases : array677, examples : array680, deprecated : lifted683, role : lifted686}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + let array692 : Array[@types.SchemaTypeDef] = []; + for index693 = 0; index693 < (mbt_ffi_load32((iter_base) + 56)); index693 = index693 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 52)) + (index693 * 24) + + let result689 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted691 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result690 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result690) + } + _ => panic() + } + + array692.push(@types.SchemaTypeDef::{id : result689, name : lifted691, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + let array723 : Array[@types.SchemaValueNode] = []; + for index724 = 0; index724 < (mbt_ffi_load32((iter_base) + 68)); index724 = index724 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index724 * 32) + + let lifted722 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result694 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result694) + } + 13 => { + + let array695 : Array[Int] = []; + for index696 = 0; index696 < (mbt_ffi_load32((iter_base) + 12)); index696 = index696 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index696 * 4) + + array695.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array695) + } + 14 => { + + let lifted697 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted697}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array698 : Array[Bool] = []; + for index699 = 0; index699 < (mbt_ffi_load32((iter_base) + 12)); index699 = index699 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index699 * 1) + + array698.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array698) + } + 17 => { + + let array700 : Array[Int] = []; + for index701 = 0; index701 < (mbt_ffi_load32((iter_base) + 12)); index701 = index701 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index701 * 4) + + array700.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array700) + } + 18 => { + + let array702 : Array[Int] = []; + for index703 = 0; index703 < (mbt_ffi_load32((iter_base) + 12)); index703 = index703 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index703 * 4) + + array702.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array702) + } + 19 => { + + let array704 : Array[Int] = []; + for index705 = 0; index705 < (mbt_ffi_load32((iter_base) + 12)); index705 = index705 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index705 * 4) + + array704.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array704) + } + 20 => { + + let array706 : Array[@types.MapEntry] = []; + for index707 = 0; index707 < (mbt_ffi_load32((iter_base) + 12)); index707 = index707 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index707 * 8) + + array706.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array706) + } + 21 => { + + let lifted708 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted708) + } + 22 => { + + let lifted711 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted709 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted709) + } + 1 => { + + let lifted710 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted710) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted711) + } + 23 => { + + let result712 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted714 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result713 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result713) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result712, language : lifted714}) + } + 24 => { + + let result715 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted717 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result716 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result716) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result715, mime_type : lifted717}) + } + 25 => { + + let result718 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result718) + } + 26 => { + + let result719 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result719) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result720 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result720}) + } + 30 => { + + let result721 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result721, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array723.push(lifted722) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + Option::Some(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array687, defs : array692, root : mbt_ffi_load32((iter_base) + 60)}, value : @types.SchemaValueTree::{value_nodes : array723, root : mbt_ffi_load32((iter_base) + 72)}}) + } + _ => panic() + } + + PublicOplogEntry::End(EndParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, start_index : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), response : lifted725, forced_commit : (mbt_ffi_load8_u((iter_base) + 76) != 0)}) + } + 3 => { + + let lifted960 : @types.TypedSchemaValue? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let array922 : Array[@types.SchemaTypeNode] = []; + for index923 = 0; index923 < (mbt_ffi_load32((iter_base) + 48)); index923 = index923 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index923 * 144) + + let lifted908 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted732 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted727 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted726 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted726) + } + _ => panic() + } + + let lifted729 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted728 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted728) + } + _ => panic() + } + + let lifted731 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result730 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result730) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted727, max : lifted729, unit : lifted731}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted732) + } + 3 => { + + let lifted739 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted734 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted733 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted733) + } + _ => panic() + } + + let lifted736 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted735 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted735) + } + _ => panic() + } + + let lifted738 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result737 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result737) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted734, max : lifted736, unit : lifted738}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted739) + } + 4 => { + + let lifted746 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted741 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted740 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted740) + } + _ => panic() + } + + let lifted743 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted742 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted742) + } + _ => panic() + } + + let lifted745 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result744 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result744) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted741, max : lifted743, unit : lifted745}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted746) + } + 5 => { + + let lifted753 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted748 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted747 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted747) + } + _ => panic() + } + + let lifted750 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted749 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted749) + } + _ => panic() + } + + let lifted752 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result751 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result751) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted748, max : lifted750, unit : lifted752}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted753) + } + 6 => { + + let lifted760 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted755 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted754 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted754) + } + _ => panic() + } + + let lifted757 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted756 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted756) + } + _ => panic() + } + + let lifted759 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result758 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result758) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted755, max : lifted757, unit : lifted759}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted760) + } + 7 => { + + let lifted767 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted762 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted761 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted761) + } + _ => panic() + } + + let lifted764 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted763 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted763) + } + _ => panic() + } + + let lifted766 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result765 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result765) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted762, max : lifted764, unit : lifted766}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted767) + } + 8 => { + + let lifted774 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted769 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted768 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted768) + } + _ => panic() + } + + let lifted771 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted770 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted770) + } + _ => panic() + } + + let lifted773 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result772 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result772) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted769, max : lifted771, unit : lifted773}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted774) + } + 9 => { + + let lifted781 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted776 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted775 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted775) + } + _ => panic() + } + + let lifted778 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted777 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted777) + } + _ => panic() + } + + let lifted780 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result779 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result779) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted776, max : lifted778, unit : lifted780}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted781) + } + 10 => { + + let lifted788 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted783 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted782 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted782) + } + _ => panic() + } + + let lifted785 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted784 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted784) + } + _ => panic() + } + + let lifted787 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result786 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result786) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted783, max : lifted785, unit : lifted787}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted788) + } + 11 => { + + let lifted795 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted790 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted789 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted789) + } + _ => panic() + } + + let lifted792 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted791 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted791) + } + _ => panic() + } + + let lifted794 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result793 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result793) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted790, max : lifted792, unit : lifted794}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted795) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array810 : Array[@types.NamedFieldType] = []; + for index811 = 0; index811 < (mbt_ffi_load32((iter_base) + 12)); index811 = index811 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index811 * 68) + + let result796 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted798 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result797 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result797) + } + _ => panic() + } + + let array800 : Array[String] = []; + for index801 = 0; index801 < (mbt_ffi_load32((iter_base) + 28)); index801 = index801 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index801 * 8) + + let result799 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array800.push(result799) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array803 : Array[String] = []; + for index804 = 0; index804 < (mbt_ffi_load32((iter_base) + 36)); index804 = index804 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index804 * 8) + + let result802 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array803.push(result802) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted806 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result805 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result805) + } + _ => panic() + } + + let lifted809 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted808 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result807 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result807) + } + _ => panic() + } + + Option::Some(lifted808) + } + _ => panic() + } + + array810.push(@types.NamedFieldType::{name : result796, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted798, aliases : array800, examples : array803, deprecated : lifted806, role : lifted809}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array810) + } + 15 => { + + let array827 : Array[@types.VariantCaseType] = []; + for index828 = 0; index828 < (mbt_ffi_load32((iter_base) + 12)); index828 = index828 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index828 * 72) + + let result812 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted813 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted815 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result814 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result814) + } + _ => panic() + } + + let array817 : Array[String] = []; + for index818 = 0; index818 < (mbt_ffi_load32((iter_base) + 32)); index818 = index818 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index818 * 8) + + let result816 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array817.push(result816) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array820 : Array[String] = []; + for index821 = 0; index821 < (mbt_ffi_load32((iter_base) + 40)); index821 = index821 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index821 * 8) + + let result819 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array820.push(result819) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted823 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result822 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result822) + } + _ => panic() + } + + let lifted826 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted825 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result824 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result824) + } + _ => panic() + } + + Option::Some(lifted825) + } + _ => panic() + } + + array827.push(@types.VariantCaseType::{name : result812, payload : lifted813, metadata : @types.MetadataEnvelope::{doc : lifted815, aliases : array817, examples : array820, deprecated : lifted823, role : lifted826}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array827) + } + 16 => { + + let array830 : Array[String] = []; + for index831 = 0; index831 < (mbt_ffi_load32((iter_base) + 12)); index831 = index831 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index831 * 8) + + let result829 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array830.push(result829) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array830) + } + 17 => { + + let array833 : Array[String] = []; + for index834 = 0; index834 < (mbt_ffi_load32((iter_base) + 12)); index834 = index834 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index834 * 8) + + let result832 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array833.push(result832) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array833) + } + 18 => { + + let array835 : Array[Int] = []; + for index836 = 0; index836 < (mbt_ffi_load32((iter_base) + 12)); index836 = index836 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index836 * 4) + + array835.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array835) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted837 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted838 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted837, err : lifted838}) + } + 24 => { + + let lifted842 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array840 : Array[String] = []; + for index841 = 0; index841 < (mbt_ffi_load32((iter_base) + 16)); index841 = index841 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index841 * 8) + + let result839 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array840.push(result839) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array840) + } + _ => panic() + } + + let lifted843 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted844 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted846 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result845 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result845) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted842, min_length : lifted843, max_length : lifted844, regex : lifted846}) + } + 25 => { + + let lifted850 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array848 : Array[String] = []; + for index849 = 0; index849 < (mbt_ffi_load32((iter_base) + 16)); index849 = index849 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index849 * 8) + + let result847 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array848.push(result847) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array848) + } + _ => panic() + } + + let lifted851 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted852 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted850, min_bytes : lifted851, max_bytes : lifted852}) + } + 26 => { + + let lifted856 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array854 : Array[String] = []; + for index855 = 0; index855 < (mbt_ffi_load32((iter_base) + 20)); index855 = index855 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index855 * 8) + + let result853 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array854.push(result853) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array854) + } + _ => panic() + } + + let lifted860 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array858 : Array[String] = []; + for index859 = 0; index859 < (mbt_ffi_load32((iter_base) + 32)); index859 = index859 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index859 * 8) + + let result857 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array858.push(result857) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array858) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted856, allowed_extensions : lifted860}) + } + 27 => { + + let lifted864 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array862 : Array[String] = []; + for index863 = 0; index863 < (mbt_ffi_load32((iter_base) + 16)); index863 = index863 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index863 * 8) + + let result861 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array862.push(result861) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array862) + } + _ => panic() + } + + let lifted868 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array866 : Array[String] = []; + for index867 = 0; index867 < (mbt_ffi_load32((iter_base) + 28)); index867 = index867 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index867 * 8) + + let result865 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array866.push(result865) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array866) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted864, allowed_hosts : lifted868}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result869 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array871 : Array[String] = []; + for index872 = 0; index872 < (mbt_ffi_load32((iter_base) + 20)); index872 = index872 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index872 * 8) + + let result870 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array871.push(result870) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted874 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result873 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result873}) + } + _ => panic() + } + + let lifted876 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result875 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result875}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result869, allowed_suffixes : array871, min : lifted874, max : lifted876}) + } + 31 => { + + let array900 : Array[@types.UnionBranch] = []; + for index901 = 0; index901 < (mbt_ffi_load32((iter_base) + 12)); index901 = index901 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index901 * 92) + + let result877 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted886 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result878 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result878) + } + 1 => { + + let result879 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result879) + } + 2 => { + + let result880 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result880) + } + 3 => { + + let result881 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result881) + } + 4 => { + + let result882 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted884 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result883 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result883) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result882, literal : lifted884}) + } + 5 => { + + let result885 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result885) + } + _ => panic() + } + + let lifted888 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result887 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result887) + } + _ => panic() + } + + let array890 : Array[String] = []; + for index891 = 0; index891 < (mbt_ffi_load32((iter_base) + 52)); index891 = index891 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index891 * 8) + + let result889 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array890.push(result889) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array893 : Array[String] = []; + for index894 = 0; index894 < (mbt_ffi_load32((iter_base) + 60)); index894 = index894 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index894 * 8) + + let result892 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array893.push(result892) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted896 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result895 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result895) + } + _ => panic() + } + + let lifted899 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted898 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result897 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result897) + } + _ => panic() + } + + Option::Some(lifted898) + } + _ => panic() + } + + array900.push(@types.UnionBranch::{tag : result877, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted886, metadata : @types.MetadataEnvelope::{doc : lifted888, aliases : array890, examples : array893, deprecated : lifted896, role : lifted899}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array900}) + } + 32 => { + + let lifted903 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result902 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result902) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted903}) + } + 33 => { + + let lifted905 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result904 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result904) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted905}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted906 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted906) + } + 36 => { + + let lifted907 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted907) + } + _ => panic() + } + + let lifted910 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result909 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result909) + } + _ => panic() + } + + let array912 : Array[String] = []; + for index913 = 0; index913 < (mbt_ffi_load32((iter_base) + 104)); index913 = index913 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index913 * 8) + + let result911 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array912.push(result911) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array915 : Array[String] = []; + for index916 = 0; index916 < (mbt_ffi_load32((iter_base) + 112)); index916 = index916 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index916 * 8) + + let result914 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array915.push(result914) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted918 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result917 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result917) + } + _ => panic() + } + + let lifted921 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted920 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result919 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result919) + } + _ => panic() + } + + Option::Some(lifted920) + } + _ => panic() + } + + array922.push(@types.SchemaTypeNode::{body : lifted908, metadata : @types.MetadataEnvelope::{doc : lifted910, aliases : array912, examples : array915, deprecated : lifted918, role : lifted921}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + let array927 : Array[@types.SchemaTypeDef] = []; + for index928 = 0; index928 < (mbt_ffi_load32((iter_base) + 56)); index928 = index928 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 52)) + (index928 * 24) + + let result924 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted926 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result925 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result925) + } + _ => panic() + } + + array927.push(@types.SchemaTypeDef::{id : result924, name : lifted926, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + let array958 : Array[@types.SchemaValueNode] = []; + for index959 = 0; index959 < (mbt_ffi_load32((iter_base) + 68)); index959 = index959 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index959 * 32) + + let lifted957 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result929 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result929) + } + 13 => { + + let array930 : Array[Int] = []; + for index931 = 0; index931 < (mbt_ffi_load32((iter_base) + 12)); index931 = index931 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index931 * 4) + + array930.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array930) + } + 14 => { + + let lifted932 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted932}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array933 : Array[Bool] = []; + for index934 = 0; index934 < (mbt_ffi_load32((iter_base) + 12)); index934 = index934 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index934 * 1) + + array933.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array933) + } + 17 => { + + let array935 : Array[Int] = []; + for index936 = 0; index936 < (mbt_ffi_load32((iter_base) + 12)); index936 = index936 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index936 * 4) + + array935.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array935) + } + 18 => { + + let array937 : Array[Int] = []; + for index938 = 0; index938 < (mbt_ffi_load32((iter_base) + 12)); index938 = index938 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index938 * 4) + + array937.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array937) + } + 19 => { + + let array939 : Array[Int] = []; + for index940 = 0; index940 < (mbt_ffi_load32((iter_base) + 12)); index940 = index940 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index940 * 4) + + array939.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array939) + } + 20 => { + + let array941 : Array[@types.MapEntry] = []; + for index942 = 0; index942 < (mbt_ffi_load32((iter_base) + 12)); index942 = index942 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index942 * 8) + + array941.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array941) + } + 21 => { + + let lifted943 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted943) + } + 22 => { + + let lifted946 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted944 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted944) + } + 1 => { + + let lifted945 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted945) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted946) + } + 23 => { + + let result947 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted949 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result948 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result948) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result947, language : lifted949}) + } + 24 => { + + let result950 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted952 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result951 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result951) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result950, mime_type : lifted952}) + } + 25 => { + + let result953 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result953) + } + 26 => { + + let result954 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result954) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result955 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result955}) + } + 30 => { + + let result956 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result956, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array958.push(lifted957) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + Option::Some(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array922, defs : array927, root : mbt_ffi_load32((iter_base) + 60)}, value : @types.SchemaValueTree::{value_nodes : array958, root : mbt_ffi_load32((iter_base) + 72)}}) + } + _ => panic() + } + + PublicOplogEntry::Cancelled(CancelledParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, start_index : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), partial : lifted960}) + } + 4 => { + + let lifted1473 = match (mbt_ffi_load8_u((iter_base) + 32)) { + 0 => { + + let result961 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + let array1158 : Array[@types.SchemaTypeNode] = []; + for index1159 = 0; index1159 < (mbt_ffi_load32((iter_base) + 52)); index1159 = index1159 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1159 * 144) + + let lifted1144 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted968 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted963 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted962 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted962) + } + _ => panic() + } + + let lifted965 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted964 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted964) + } + _ => panic() + } + + let lifted967 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result966 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result966) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted963, max : lifted965, unit : lifted967}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted968) + } + 3 => { + + let lifted975 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted970 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted969 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted969) + } + _ => panic() + } + + let lifted972 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted971 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted971) + } + _ => panic() + } + + let lifted974 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result973 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result973) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted970, max : lifted972, unit : lifted974}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted975) + } + 4 => { + + let lifted982 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted977 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted976 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted976) + } + _ => panic() + } + + let lifted979 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted978 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted978) + } + _ => panic() + } + + let lifted981 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result980 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result980) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted977, max : lifted979, unit : lifted981}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted982) + } + 5 => { + + let lifted989 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted984 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted983 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted983) + } + _ => panic() + } + + let lifted986 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted985 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted985) + } + _ => panic() + } + + let lifted988 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result987 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result987) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted984, max : lifted986, unit : lifted988}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted989) + } + 6 => { + + let lifted996 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted991 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted990 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted990) + } + _ => panic() + } + + let lifted993 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted992 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted992) + } + _ => panic() + } + + let lifted995 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result994 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result994) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted991, max : lifted993, unit : lifted995}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted996) + } + 7 => { + + let lifted1003 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted998 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted997 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted997) + } + _ => panic() + } + + let lifted1000 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted999 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted999) + } + _ => panic() + } + + let lifted1002 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1001 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1001) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted998, max : lifted1000, unit : lifted1002}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1003) + } + 8 => { + + let lifted1010 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1005 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1004 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1004) + } + _ => panic() + } + + let lifted1007 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1006 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1006) + } + _ => panic() + } + + let lifted1009 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1008 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1008) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1005, max : lifted1007, unit : lifted1009}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1010) + } + 9 => { + + let lifted1017 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1012 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1011 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1011) + } + _ => panic() + } + + let lifted1014 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1013 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1013) + } + _ => panic() + } + + let lifted1016 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1015 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1015) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1012, max : lifted1014, unit : lifted1016}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1017) + } + 10 => { + + let lifted1024 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1019 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1018 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1018) + } + _ => panic() + } + + let lifted1021 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1020 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1020) + } + _ => panic() + } + + let lifted1023 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1022 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1022) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1019, max : lifted1021, unit : lifted1023}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted1024) + } + 11 => { + + let lifted1031 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1026 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1025 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1025) + } + _ => panic() + } + + let lifted1028 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1027 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1027) + } + _ => panic() + } + + let lifted1030 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1029 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1029) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1026, max : lifted1028, unit : lifted1030}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted1031) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array1046 : Array[@types.NamedFieldType] = []; + for index1047 = 0; index1047 < (mbt_ffi_load32((iter_base) + 12)); index1047 = index1047 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1047 * 68) + + let result1032 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1034 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1033 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1033) + } + _ => panic() + } + + let array1036 : Array[String] = []; + for index1037 = 0; index1037 < (mbt_ffi_load32((iter_base) + 28)); index1037 = index1037 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1037 * 8) + + let result1035 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1036.push(result1035) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array1039 : Array[String] = []; + for index1040 = 0; index1040 < (mbt_ffi_load32((iter_base) + 36)); index1040 = index1040 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1040 * 8) + + let result1038 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1039.push(result1038) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted1042 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result1041 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result1041) + } + _ => panic() + } + + let lifted1045 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted1044 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1043 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result1043) + } + _ => panic() + } + + Option::Some(lifted1044) + } + _ => panic() + } + + array1046.push(@types.NamedFieldType::{name : result1032, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted1034, aliases : array1036, examples : array1039, deprecated : lifted1042, role : lifted1045}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array1046) + } + 15 => { + + let array1063 : Array[@types.VariantCaseType] = []; + for index1064 = 0; index1064 < (mbt_ffi_load32((iter_base) + 12)); index1064 = index1064 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1064 * 72) + + let result1048 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1049 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1051 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1050 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1050) + } + _ => panic() + } + + let array1053 : Array[String] = []; + for index1054 = 0; index1054 < (mbt_ffi_load32((iter_base) + 32)); index1054 = index1054 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1054 * 8) + + let result1052 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1053.push(result1052) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array1056 : Array[String] = []; + for index1057 = 0; index1057 < (mbt_ffi_load32((iter_base) + 40)); index1057 = index1057 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1057 * 8) + + let result1055 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1056.push(result1055) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted1059 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result1058 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result1058) + } + _ => panic() + } + + let lifted1062 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted1061 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1060 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result1060) + } + _ => panic() + } + + Option::Some(lifted1061) + } + _ => panic() + } + + array1063.push(@types.VariantCaseType::{name : result1048, payload : lifted1049, metadata : @types.MetadataEnvelope::{doc : lifted1051, aliases : array1053, examples : array1056, deprecated : lifted1059, role : lifted1062}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array1063) + } + 16 => { + + let array1066 : Array[String] = []; + for index1067 = 0; index1067 < (mbt_ffi_load32((iter_base) + 12)); index1067 = index1067 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1067 * 8) + + let result1065 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1066.push(result1065) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array1066) + } + 17 => { + + let array1069 : Array[String] = []; + for index1070 = 0; index1070 < (mbt_ffi_load32((iter_base) + 12)); index1070 = index1070 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1070 * 8) + + let result1068 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1069.push(result1068) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array1069) + } + 18 => { + + let array1071 : Array[Int] = []; + for index1072 = 0; index1072 < (mbt_ffi_load32((iter_base) + 12)); index1072 = index1072 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1072 * 4) + + array1071.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array1071) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted1073 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1074 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted1073, err : lifted1074}) + } + 24 => { + + let lifted1078 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1076 : Array[String] = []; + for index1077 = 0; index1077 < (mbt_ffi_load32((iter_base) + 16)); index1077 = index1077 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1077 * 8) + + let result1075 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1076.push(result1075) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1076) + } + _ => panic() + } + + let lifted1079 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1080 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1082 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1081 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1081) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted1078, min_length : lifted1079, max_length : lifted1080, regex : lifted1082}) + } + 25 => { + + let lifted1086 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1084 : Array[String] = []; + for index1085 = 0; index1085 < (mbt_ffi_load32((iter_base) + 16)); index1085 = index1085 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1085 * 8) + + let result1083 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1084.push(result1083) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1084) + } + _ => panic() + } + + let lifted1087 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1088 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted1086, min_bytes : lifted1087, max_bytes : lifted1088}) + } + 26 => { + + let lifted1092 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array1090 : Array[String] = []; + for index1091 = 0; index1091 < (mbt_ffi_load32((iter_base) + 20)); index1091 = index1091 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1091 * 8) + + let result1089 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1090.push(result1089) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array1090) + } + _ => panic() + } + + let lifted1096 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array1094 : Array[String] = []; + for index1095 = 0; index1095 < (mbt_ffi_load32((iter_base) + 32)); index1095 = index1095 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1095 * 8) + + let result1093 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1094.push(result1093) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array1094) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted1092, allowed_extensions : lifted1096}) + } + 27 => { + + let lifted1100 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1098 : Array[String] = []; + for index1099 = 0; index1099 < (mbt_ffi_load32((iter_base) + 16)); index1099 = index1099 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1099 * 8) + + let result1097 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1098.push(result1097) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1098) + } + _ => panic() + } + + let lifted1104 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array1102 : Array[String] = []; + for index1103 = 0; index1103 < (mbt_ffi_load32((iter_base) + 28)); index1103 = index1103 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1103 * 8) + + let result1101 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1102.push(result1101) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array1102) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted1100, allowed_hosts : lifted1104}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result1105 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array1107 : Array[String] = []; + for index1108 = 0; index1108 < (mbt_ffi_load32((iter_base) + 20)); index1108 = index1108 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1108 * 8) + + let result1106 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1107.push(result1106) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted1110 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1109 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result1109}) + } + _ => panic() + } + + let lifted1112 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result1111 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result1111}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result1105, allowed_suffixes : array1107, min : lifted1110, max : lifted1112}) + } + 31 => { + + let array1136 : Array[@types.UnionBranch] = []; + for index1137 = 0; index1137 < (mbt_ffi_load32((iter_base) + 12)); index1137 = index1137 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1137 * 92) + + let result1113 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1122 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result1114 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result1114) + } + 1 => { + + let result1115 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result1115) + } + 2 => { + + let result1116 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result1116) + } + 3 => { + + let result1117 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result1117) + } + 4 => { + + let result1118 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted1120 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result1119 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result1119) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result1118, literal : lifted1120}) + } + 5 => { + + let result1121 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result1121) + } + _ => panic() + } + + let lifted1124 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1123 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1123) + } + _ => panic() + } + + let array1126 : Array[String] = []; + for index1127 = 0; index1127 < (mbt_ffi_load32((iter_base) + 52)); index1127 = index1127 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1127 * 8) + + let result1125 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1126.push(result1125) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1129 : Array[String] = []; + for index1130 = 0; index1130 < (mbt_ffi_load32((iter_base) + 60)); index1130 = index1130 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1130 * 8) + + let result1128 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1129.push(result1128) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted1132 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1131 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1131) + } + _ => panic() + } + + let lifted1135 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted1134 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1133 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result1133) + } + _ => panic() + } + + Option::Some(lifted1134) + } + _ => panic() + } + + array1136.push(@types.UnionBranch::{tag : result1113, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted1122, metadata : @types.MetadataEnvelope::{doc : lifted1124, aliases : array1126, examples : array1129, deprecated : lifted1132, role : lifted1135}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array1136}) + } + 32 => { + + let lifted1139 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1138 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1138) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted1139}) + } + 33 => { + + let lifted1141 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1140 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1140) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted1141}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted1142 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted1142) + } + 36 => { + + let lifted1143 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted1143) + } + _ => panic() + } + + let lifted1146 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result1145 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result1145) + } + _ => panic() + } + + let array1148 : Array[String] = []; + for index1149 = 0; index1149 < (mbt_ffi_load32((iter_base) + 104)); index1149 = index1149 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index1149 * 8) + + let result1147 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1148.push(result1147) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array1151 : Array[String] = []; + for index1152 = 0; index1152 < (mbt_ffi_load32((iter_base) + 112)); index1152 = index1152 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index1152 * 8) + + let result1150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1151.push(result1150) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted1154 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result1153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result1153) + } + _ => panic() + } + + let lifted1157 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted1156 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result1155) + } + _ => panic() + } + + Option::Some(lifted1156) + } + _ => panic() + } + + array1158.push(@types.SchemaTypeNode::{body : lifted1144, metadata : @types.MetadataEnvelope::{doc : lifted1146, aliases : array1148, examples : array1151, deprecated : lifted1154, role : lifted1157}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array1163 : Array[@types.SchemaTypeDef] = []; + for index1164 = 0; index1164 < (mbt_ffi_load32((iter_base) + 60)); index1164 = index1164 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1164 * 24) + + let result1160 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1162 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result1161 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result1161) + } + _ => panic() + } + + array1163.push(@types.SchemaTypeDef::{id : result1160, name : lifted1162, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let array1194 : Array[@types.SchemaValueNode] = []; + for index1195 = 0; index1195 < (mbt_ffi_load32((iter_base) + 72)); index1195 = index1195 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index1195 * 32) + + let lifted1193 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result1165 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result1165) + } + 13 => { + + let array1166 : Array[Int] = []; + for index1167 = 0; index1167 < (mbt_ffi_load32((iter_base) + 12)); index1167 = index1167 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1167 * 4) + + array1166.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array1166) + } + 14 => { + + let lifted1168 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted1168}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array1169 : Array[Bool] = []; + for index1170 = 0; index1170 < (mbt_ffi_load32((iter_base) + 12)); index1170 = index1170 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1170 * 1) + + array1169.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array1169) + } + 17 => { + + let array1171 : Array[Int] = []; + for index1172 = 0; index1172 < (mbt_ffi_load32((iter_base) + 12)); index1172 = index1172 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1172 * 4) + + array1171.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array1171) + } + 18 => { + + let array1173 : Array[Int] = []; + for index1174 = 0; index1174 < (mbt_ffi_load32((iter_base) + 12)); index1174 = index1174 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1174 * 4) + + array1173.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array1173) + } + 19 => { + + let array1175 : Array[Int] = []; + for index1176 = 0; index1176 < (mbt_ffi_load32((iter_base) + 12)); index1176 = index1176 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1176 * 4) + + array1175.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array1175) + } + 20 => { + + let array1177 : Array[@types.MapEntry] = []; + for index1178 = 0; index1178 < (mbt_ffi_load32((iter_base) + 12)); index1178 = index1178 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1178 * 8) + + array1177.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array1177) + } + 21 => { + + let lifted1179 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted1179) + } + 22 => { + + let lifted1182 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted1180 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted1180) + } + 1 => { + + let lifted1181 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted1181) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted1182) + } + 23 => { + + let result1183 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1185 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1184 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1184) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result1183, language : lifted1185}) + } + 24 => { + + let result1186 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1188 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1187 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1187) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result1186, mime_type : lifted1188}) + } + 25 => { + + let result1189 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result1189) + } + 26 => { + + let result1190 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result1190) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result1191 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result1191}) + } + 30 => { + + let result1192 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result1192, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array1194.push(lifted1193) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + let result1196 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 80), mbt_ffi_load32((iter_base) + 84)) + + let array1198 : Array[String] = []; + for index1199 = 0; index1199 < (mbt_ffi_load32((iter_base) + 92)); index1199 = index1199 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 88)) + (index1199 * 8) + + let result1197 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1198.push(result1197) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) + + let array1213 : Array[Array[SpanData]] = []; + for index1214 = 0; index1214 < (mbt_ffi_load32((iter_base) + 100)); index1214 = index1214 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 96)) + (index1214 * 8) + + let array1211 : Array[SpanData] = []; + for index1212 = 0; index1212 < (mbt_ffi_load32((iter_base) + 4)); index1212 = index1212 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index1212 * 80) + + let lifted1210 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result1200 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted1202 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result1201 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result1201) + } + _ => panic() + } + + let lifted1203 : UInt64? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + let array1207 : Array[@context.Attribute] = []; + for index1208 = 0; index1208 < (mbt_ffi_load32((iter_base) + 68)); index1208 = index1208 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index1208 * 20) + + let result1204 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1206 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result1205 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + @context.AttributeValue::String(result1205) + } + _ => panic() + } + + array1207.push(@context.Attribute::{key : result1204, value : lifted1206}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + SpanData::LocalSpan(LocalSpanData::{span_id : result1200, start : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent : lifted1202, linked_context : lifted1203, attributes : array1207, inherited : (mbt_ffi_load8_u((iter_base) + 72) != 0)}) + } + 1 => { + + let result1209 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + SpanData::ExternalSpan(ExternalSpanData::{span_id : result1209}) + } + _ => panic() + } + + array1211.push(lifted1210) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array1213.push(array1211) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 96)) + + AgentInvocation::AgentInitialization(AgentInitializationParameters::{idempotency_key : result961, constructor_parameters : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array1158, defs : array1163, root : mbt_ffi_load32((iter_base) + 64)}, value : @types.SchemaValueTree::{value_nodes : array1194, root : mbt_ffi_load32((iter_base) + 76)}}, trace_id : result1196, trace_states : array1198, invocation_context : array1213}) + } + 1 => { + + let result1215 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + let result1216 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + let array1413 : Array[@types.SchemaTypeNode] = []; + for index1414 = 0; index1414 < (mbt_ffi_load32((iter_base) + 60)); index1414 = index1414 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1414 * 144) + + let lifted1399 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted1223 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1218 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1217 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1217) + } + _ => panic() + } + + let lifted1220 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1219 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1219) + } + _ => panic() + } + + let lifted1222 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1221 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1221) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1218, max : lifted1220, unit : lifted1222}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted1223) + } + 3 => { + + let lifted1230 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1225 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1224 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1224) + } + _ => panic() + } + + let lifted1227 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1226 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1226) + } + _ => panic() + } + + let lifted1229 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1228 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1228) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1225, max : lifted1227, unit : lifted1229}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted1230) + } + 4 => { + + let lifted1237 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1232 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1231 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1231) + } + _ => panic() + } + + let lifted1234 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1233 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1233) + } + _ => panic() + } + + let lifted1236 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1235 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1235) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1232, max : lifted1234, unit : lifted1236}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted1237) + } + 5 => { + + let lifted1244 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1239 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1238 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1238) + } + _ => panic() + } + + let lifted1241 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1240 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1240) + } + _ => panic() + } + + let lifted1243 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1242 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1242) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1239, max : lifted1241, unit : lifted1243}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted1244) + } + 6 => { + + let lifted1251 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1246 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1245 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1245) + } + _ => panic() + } + + let lifted1248 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1247 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1247) + } + _ => panic() + } + + let lifted1250 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1249 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1249) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1246, max : lifted1248, unit : lifted1250}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted1251) + } + 7 => { + + let lifted1258 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1253 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1252 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1252) + } + _ => panic() + } + + let lifted1255 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1254 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1254) + } + _ => panic() + } + + let lifted1257 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1256 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1256) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1253, max : lifted1255, unit : lifted1257}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1258) + } + 8 => { + + let lifted1265 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1260 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1259 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1259) + } + _ => panic() + } + + let lifted1262 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1261 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1261) + } + _ => panic() + } + + let lifted1264 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1263 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1263) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1260, max : lifted1262, unit : lifted1264}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1265) + } + 9 => { + + let lifted1272 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1267 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1266 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1266) + } + _ => panic() + } + + let lifted1269 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1268 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1268) + } + _ => panic() + } + + let lifted1271 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1270 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1270) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1267, max : lifted1269, unit : lifted1271}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1272) + } + 10 => { + + let lifted1279 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1274 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1273 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1273) + } + _ => panic() + } + + let lifted1276 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1275 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1275) + } + _ => panic() + } + + let lifted1278 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1277 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1277) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1274, max : lifted1276, unit : lifted1278}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted1279) + } + 11 => { + + let lifted1286 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1281 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1280 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1280) + } + _ => panic() + } + + let lifted1283 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1282 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1282) + } + _ => panic() + } + + let lifted1285 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1284 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1284) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1281, max : lifted1283, unit : lifted1285}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted1286) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array1301 : Array[@types.NamedFieldType] = []; + for index1302 = 0; index1302 < (mbt_ffi_load32((iter_base) + 12)); index1302 = index1302 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1302 * 68) + + let result1287 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1289 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result1288 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result1288) + } + _ => panic() + } + + let array1291 : Array[String] = []; + for index1292 = 0; index1292 < (mbt_ffi_load32((iter_base) + 28)); index1292 = index1292 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1292 * 8) + + let result1290 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1291.push(result1290) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array1294 : Array[String] = []; + for index1295 = 0; index1295 < (mbt_ffi_load32((iter_base) + 36)); index1295 = index1295 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1295 * 8) + + let result1293 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1294.push(result1293) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted1297 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result1296 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result1296) + } + _ => panic() + } + + let lifted1300 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted1299 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1298 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result1298) + } + _ => panic() + } + + Option::Some(lifted1299) + } + _ => panic() + } + + array1301.push(@types.NamedFieldType::{name : result1287, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted1289, aliases : array1291, examples : array1294, deprecated : lifted1297, role : lifted1300}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array1301) + } + 15 => { + + let array1318 : Array[@types.VariantCaseType] = []; + for index1319 = 0; index1319 < (mbt_ffi_load32((iter_base) + 12)); index1319 = index1319 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1319 * 72) + + let result1303 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted1304 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1306 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result1305 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result1305) + } + _ => panic() + } + + let array1308 : Array[String] = []; + for index1309 = 0; index1309 < (mbt_ffi_load32((iter_base) + 32)); index1309 = index1309 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1309 * 8) + + let result1307 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1308.push(result1307) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array1311 : Array[String] = []; + for index1312 = 0; index1312 < (mbt_ffi_load32((iter_base) + 40)); index1312 = index1312 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1312 * 8) + + let result1310 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1311.push(result1310) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted1314 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result1313 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result1313) + } + _ => panic() + } + + let lifted1317 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted1316 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result1315 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result1315) + } + _ => panic() + } + + Option::Some(lifted1316) + } + _ => panic() + } + + array1318.push(@types.VariantCaseType::{name : result1303, payload : lifted1304, metadata : @types.MetadataEnvelope::{doc : lifted1306, aliases : array1308, examples : array1311, deprecated : lifted1314, role : lifted1317}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array1318) + } + 16 => { + + let array1321 : Array[String] = []; + for index1322 = 0; index1322 < (mbt_ffi_load32((iter_base) + 12)); index1322 = index1322 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1322 * 8) + + let result1320 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1321.push(result1320) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array1321) + } + 17 => { + + let array1324 : Array[String] = []; + for index1325 = 0; index1325 < (mbt_ffi_load32((iter_base) + 12)); index1325 = index1325 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1325 * 8) + + let result1323 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1324.push(result1323) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array1324) + } + 18 => { + + let array1326 : Array[Int] = []; + for index1327 = 0; index1327 < (mbt_ffi_load32((iter_base) + 12)); index1327 = index1327 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1327 * 4) + + array1326.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array1326) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted1328 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted1329 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted1328, err : lifted1329}) + } + 24 => { + + let lifted1333 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1331 : Array[String] = []; + for index1332 = 0; index1332 < (mbt_ffi_load32((iter_base) + 16)); index1332 = index1332 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1332 * 8) + + let result1330 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1331.push(result1330) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1331) + } + _ => panic() + } + + let lifted1334 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1335 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1337 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result1336 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result1336) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted1333, min_length : lifted1334, max_length : lifted1335, regex : lifted1337}) + } + 25 => { + + let lifted1341 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1339 : Array[String] = []; + for index1340 = 0; index1340 < (mbt_ffi_load32((iter_base) + 16)); index1340 = index1340 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1340 * 8) + + let result1338 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1339.push(result1338) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1339) + } + _ => panic() + } + + let lifted1342 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted1343 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted1341, min_bytes : lifted1342, max_bytes : lifted1343}) + } + 26 => { + + let lifted1347 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array1345 : Array[String] = []; + for index1346 = 0; index1346 < (mbt_ffi_load32((iter_base) + 20)); index1346 = index1346 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1346 * 8) + + let result1344 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1345.push(result1344) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array1345) + } + _ => panic() + } + + let lifted1351 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array1349 : Array[String] = []; + for index1350 = 0; index1350 < (mbt_ffi_load32((iter_base) + 32)); index1350 = index1350 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1350 * 8) + + let result1348 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1349.push(result1348) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array1349) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted1347, allowed_extensions : lifted1351}) + } + 27 => { + + let lifted1355 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array1353 : Array[String] = []; + for index1354 = 0; index1354 < (mbt_ffi_load32((iter_base) + 16)); index1354 = index1354 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1354 * 8) + + let result1352 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array1353.push(result1352) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array1353) + } + _ => panic() + } + + let lifted1359 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - Option::Some(lifted497) - } - _ => panic() - } + let array1357 : Array[String] = []; + for index1358 = 0; index1358 < (mbt_ffi_load32((iter_base) + 28)); index1358 = index1358 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1358 * 8) - let lifted500 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted499 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1356 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted499) - } - _ => panic() - } + array1357.push(result1356) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - let lifted502 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result501 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result501) - } - _ => panic() - } + Option::Some(array1357) + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted498, - max: lifted500, - unit: lifted502, - }) - } - _ => panic() - } + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted1355, allowed_hosts : lifted1359}) + } + 28 => { - @types.SchemaTypeBody::S64Type(lifted503) - } - 6 => { - let lifted510 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted505 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted504 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::DatetimeType + } + 29 => { - Option::Some(lifted504) - } - _ => panic() - } + @types.SchemaTypeBody::DurationType + } + 30 => { - let lifted507 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted506 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1360 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted506) - } - _ => panic() - } + let array1362 : Array[String] = []; + for index1363 = 0; index1363 < (mbt_ffi_load32((iter_base) + 20)); index1363 = index1363 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1363 * 8) - let lifted509 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result508 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result508) - } - _ => panic() - } + let result1361 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(@types.NumericRestrictions::{ - min: lifted505, - max: lifted507, - unit: lifted509, - }) - } - _ => panic() - } + array1362.push(result1361) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - @types.SchemaTypeBody::U8Type(lifted510) - } - 7 => { - let lifted517 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted512 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted511 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1365 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - Option::Some(lifted511) - } - _ => panic() - } + let result1364 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - let lifted514 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted513 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result1364}) + } + _ => panic() + } - Option::Some(lifted513) - } - _ => panic() - } + let lifted1367 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - let lifted516 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result515 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result515) - } - _ => panic() - } + let result1366 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - Option::Some(@types.NumericRestrictions::{ - min: lifted512, - max: lifted514, - unit: lifted516, - }) - } - _ => panic() - } + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result1366}) + } + _ => panic() + } - @types.SchemaTypeBody::U16Type(lifted517) - } - 8 => { - let lifted524 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted519 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted518 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result1360, allowed_suffixes : array1362, min : lifted1365, max : lifted1367}) + } + 31 => { - Option::Some(lifted518) - } - _ => panic() - } + let array1391 : Array[@types.UnionBranch] = []; + for index1392 = 0; index1392 < (mbt_ffi_load32((iter_base) + 12)); index1392 = index1392 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1392 * 92) - let lifted521 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted520 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1368 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted520) - } - _ => panic() - } + let lifted1377 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { - let lifted523 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result522 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result522) - } - _ => panic() - } + let result1369 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(@types.NumericRestrictions::{ - min: lifted519, - max: lifted521, - unit: lifted523, - }) - } - _ => panic() - } + @types.DiscriminatorRule::Prefix(result1369) + } + 1 => { - @types.SchemaTypeBody::U32Type(lifted524) - } - 9 => { - let lifted531 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted526 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted525 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1370 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted525) - } - _ => panic() - } + @types.DiscriminatorRule::Suffix(result1370) + } + 2 => { - let lifted528 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted527 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1371 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted527) - } - _ => panic() - } + @types.DiscriminatorRule::Contains(result1371) + } + 3 => { - let lifted530 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result529 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result529) - } - _ => panic() - } + let result1372 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(@types.NumericRestrictions::{ - min: lifted526, - max: lifted528, - unit: lifted530, - }) - } - _ => panic() - } + @types.DiscriminatorRule::Regex(result1372) + } + 4 => { - @types.SchemaTypeBody::U64Type(lifted531) - } - 10 => { - let lifted538 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted533 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted532 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1373 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted532) - } - _ => panic() - } + let lifted1375 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let lifted535 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted534 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1374 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - Option::Some(lifted534) - } - _ => panic() - } + Option::Some(result1374) + } + _ => panic() + } - let lifted537 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result536 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result536) - } - _ => panic() - } + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result1373, literal : lifted1375}) + } + 5 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted533, - max: lifted535, - unit: lifted537, - }) - } - _ => panic() - } + let result1376 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaTypeBody::F32Type(lifted538) - } - 11 => { - let lifted545 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted540 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted539 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.DiscriminatorRule::FieldAbsent(result1376) + } + _ => panic() + } - Option::Some(lifted539) - } - _ => panic() - } + let lifted1379 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - let lifted542 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted541 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1378 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted541) - } - _ => panic() - } + Option::Some(result1378) + } + _ => panic() + } - let lifted544 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result543 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result543) - } - _ => panic() - } + let array1381 : Array[String] = []; + for index1382 = 0; index1382 < (mbt_ffi_load32((iter_base) + 52)); index1382 = index1382 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1382 * 8) - Option::Some(@types.NumericRestrictions::{ - min: lifted540, - max: lifted542, - unit: lifted544, - }) - } - _ => panic() - } + let result1380 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::F64Type(lifted545) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array560 : Array[@types.NamedFieldType] = [] - for index561 = 0 - index561 < mbt_ffi_load32(iter_base + 12) - index561 = index561 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index561 * 68 - - let result546 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted548 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result547 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result547) - } - _ => panic() - } - - let array550 : Array[String] = [] - for index551 = 0 - index551 < mbt_ffi_load32(iter_base + 28) - index551 = index551 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index551 * 8 - - let result549 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array550.push(result549) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array553 : Array[String] = [] - for index554 = 0 - index554 < mbt_ffi_load32(iter_base + 36) - index554 = index554 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index554 * 8 - - let result552 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array553.push(result552) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted556 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result555 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result555) - } - _ => panic() - } - - let lifted559 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted558 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result557 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result557) - } - _ => panic() - } - - Option::Some(lifted558) - } - _ => panic() - } - - array560.push(@types.NamedFieldType::{ - name: result546, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted548, - aliases: array550, - examples: array553, - deprecated: lifted556, - role: lifted559, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array560) - } - 15 => { - let array577 : Array[@types.VariantCaseType] = [] - for index578 = 0 - index578 < mbt_ffi_load32(iter_base + 12) - index578 = index578 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index578 * 72 - - let result562 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted563 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted565 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result564 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result564) - } - _ => panic() - } - - let array567 : Array[String] = [] - for index568 = 0 - index568 < mbt_ffi_load32(iter_base + 32) - index568 = index568 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index568 * 8 - - let result566 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array567.push(result566) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array570 : Array[String] = [] - for index571 = 0 - index571 < mbt_ffi_load32(iter_base + 40) - index571 = index571 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index571 * 8 - - let result569 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array570.push(result569) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted573 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result572 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result572) - } - _ => panic() - } - - let lifted576 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted575 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result574 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result574) - } - _ => panic() - } - - Option::Some(lifted575) - } - _ => panic() - } - - array577.push(@types.VariantCaseType::{ - name: result562, - payload: lifted563, - metadata: @types.MetadataEnvelope::{ - doc: lifted565, - aliases: array567, - examples: array570, - deprecated: lifted573, - role: lifted576, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array577) - } - 16 => { - let array580 : Array[String] = [] - for index581 = 0 - index581 < mbt_ffi_load32(iter_base + 12) - index581 = index581 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index581 * 8 - - let result579 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array580.push(result579) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array580) - } - 17 => { - let array583 : Array[String] = [] - for index584 = 0 - index584 < mbt_ffi_load32(iter_base + 12) - index584 = index584 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index584 * 8 - - let result582 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array583.push(result582) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array583) - } - 18 => { - let array585 : Array[Int] = [] - for index586 = 0 - index586 < mbt_ffi_load32(iter_base + 12) - index586 = index586 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index586 * 4 - - array585.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array585) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted587 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted588 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted587, - err: lifted588, - }) - } - 24 => { - let lifted592 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array590 : Array[String] = [] - for index591 = 0 - index591 < mbt_ffi_load32(iter_base + 16) - index591 = index591 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index591 * 8 - - let result589 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array590.push(result589) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array590) - } - _ => panic() - } - - let lifted593 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted594 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted596 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result595 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result595) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted592, - min_length: lifted593, - max_length: lifted594, - regex: lifted596, - }) - } - 25 => { - let lifted600 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array598 : Array[String] = [] - for index599 = 0 - index599 < mbt_ffi_load32(iter_base + 16) - index599 = index599 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index599 * 8 - - let result597 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array598.push(result597) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array598) - } - _ => panic() - } - - let lifted601 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted602 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted600, - min_bytes: lifted601, - max_bytes: lifted602, - }) - } - 26 => { - let lifted606 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array604 : Array[String] = [] - for index605 = 0 - index605 < mbt_ffi_load32(iter_base + 20) - index605 = index605 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index605 * 8 - - let result603 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array604.push(result603) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array604) - } - _ => panic() - } - - let lifted610 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array608 : Array[String] = [] - for index609 = 0 - index609 < mbt_ffi_load32(iter_base + 32) - index609 = index609 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index609 * 8 - - let result607 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array608.push(result607) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array608) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted606, - allowed_extensions: lifted610, - }) - } - 27 => { - let lifted614 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array612 : Array[String] = [] - for index613 = 0 - index613 < mbt_ffi_load32(iter_base + 16) - index613 = index613 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index613 * 8 - - let result611 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array612.push(result611) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array612) - } - _ => panic() - } - - let lifted618 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array616 : Array[String] = [] - for index617 = 0 - index617 < mbt_ffi_load32(iter_base + 28) - index617 = index617 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index617 * 8 - - let result615 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array616.push(result615) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + array1381.push(result1380) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - Option::Some(array616) - } - _ => panic() - } + let array1384 : Array[String] = []; + for index1385 = 0; index1385 < (mbt_ffi_load32((iter_base) + 60)); index1385 = index1385 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1385 * 8) - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted614, - allowed_hosts: lifted618, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result619 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array621 : Array[String] = [] - for index622 = 0 - index622 < mbt_ffi_load32(iter_base + 20) - index622 = index622 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index622 * 8 - - let result620 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array621.push(result620) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted624 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result623 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result623, - }) - } - _ => panic() - } - - let lifted626 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result625 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result625, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result619, - allowed_suffixes: array621, - min: lifted624, - max: lifted626, - }) - } - 31 => { - let array650 : Array[@types.UnionBranch] = [] - for index651 = 0 - index651 < mbt_ffi_load32(iter_base + 12) - index651 = index651 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index651 * 92 - - let result627 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted636 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result628 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result628) - } - 1 => { - let result629 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let result1383 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.DiscriminatorRule::Suffix(result629) - } - 2 => { - let result630 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + array1384.push(result1383) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - @types.DiscriminatorRule::Contains(result630) - } - 3 => { - let result631 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let lifted1387 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - @types.DiscriminatorRule::Regex(result631) - } - 4 => { - let result632 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted634 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result633 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result633) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result632, - literal: lifted634, - }) - } - 5 => { - let result635 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let result1386 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - @types.DiscriminatorRule::FieldAbsent(result635) - } - _ => panic() - } - - let lifted638 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result637 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result637) - } - _ => panic() - } - - let array640 : Array[String] = [] - for index641 = 0 - index641 < mbt_ffi_load32(iter_base + 52) - index641 = index641 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index641 * 8 - - let result639 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array640.push(result639) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array643 : Array[String] = [] - for index644 = 0 - index644 < mbt_ffi_load32(iter_base + 60) - index644 = index644 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index644 * 8 - - let result642 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array643.push(result642) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted646 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result645 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result645) - } - _ => panic() - } - - let lifted649 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted648 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result647 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result647) - } - _ => panic() - } - - Option::Some(lifted648) - } - _ => panic() - } - - array650.push(@types.UnionBranch::{ - tag: result627, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted636, - metadata: @types.MetadataEnvelope::{ - doc: lifted638, - aliases: array640, - examples: array643, - deprecated: lifted646, - role: lifted649, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array650, - }) - } - 32 => { - let lifted653 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result652 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result652) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted653, - }) - } - 33 => { - let lifted655 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result654 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result654) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted655, - }) - } - 34 => { - let lifted656 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted656) - } - 35 => { - let lifted657 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted657) - } - _ => panic() - } - - let lifted660 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result659 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result659) - } - _ => panic() - } - - let array662 : Array[String] = [] - for index663 = 0 - index663 < mbt_ffi_load32(iter_base + 104) - index663 = index663 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index663 * 8 - - let result661 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array662.push(result661) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array665 : Array[String] = [] - for index666 = 0 - index666 < mbt_ffi_load32(iter_base + 112) - index666 = index666 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index666 * 8 - - let result664 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array665.push(result664) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted668 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result667 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result667) - } - _ => panic() - } - - let lifted671 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted670 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result669 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result669) - } - _ => panic() - } - - Option::Some(lifted670) - } - _ => panic() - } - - array672.push(@types.SchemaTypeNode::{ - body: lifted658, - metadata: @types.MetadataEnvelope::{ - doc: lifted660, - aliases: array662, - examples: array665, - deprecated: lifted668, - role: lifted671, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - let array677 : Array[@types.SchemaTypeDef] = [] - for index678 = 0 - index678 < mbt_ffi_load32(iter_base + 20) - index678 = index678 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index678 * 24 - - let result674 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted676 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result675 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result675) - } - _ => panic() - } - - array677.push(@types.SchemaTypeDef::{ - id: result674, - name: lifted676, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let array708 : Array[@types.SchemaValueNode] = [] - for index709 = 0 - index709 < mbt_ffi_load32(iter_base + 32) - index709 = index709 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index709 * 32 - - let lifted707 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result679 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result679) - } - 13 => { - let array680 : Array[Int] = [] - for index681 = 0 - index681 < mbt_ffi_load32(iter_base + 12) - index681 = index681 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index681 * 4 - - array680.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array680) - } - 14 => { - let lifted682 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted682, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array683 : Array[Bool] = [] - for index684 = 0 - index684 < mbt_ffi_load32(iter_base + 12) - index684 = index684 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index684 * 1 - - array683.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array683) - } - 17 => { - let array685 : Array[Int] = [] - for index686 = 0 - index686 < mbt_ffi_load32(iter_base + 12) - index686 = index686 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index686 * 4 - - array685.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array685) - } - 18 => { - let array687 : Array[Int] = [] - for index688 = 0 - index688 < mbt_ffi_load32(iter_base + 12) - index688 = index688 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index688 * 4 - - array687.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array687) - } - 19 => { - let array689 : Array[Int] = [] - for index690 = 0 - index690 < mbt_ffi_load32(iter_base + 12) - index690 = index690 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index690 * 4 - - array689.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array689) - } - 20 => { - let array691 : Array[@types.MapEntry] = [] - for index692 = 0 - index692 < mbt_ffi_load32(iter_base + 12) - index692 = index692 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index692 * 8 - - array691.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array691) - } - 21 => { - let lifted693 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted693) - } - 22 => { - let lifted696 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted694 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + Option::Some(result1386) + } + _ => panic() + } - @types.ResultValuePayload::OkValue(lifted694) - } - 1 => { - let lifted695 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let lifted1390 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - @types.ResultValuePayload::ErrValue(lifted695) - } - _ => panic() - } + let lifted1389 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { - @types.SchemaValueNode::ResultValue(lifted696) - } - 23 => { - let result697 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted699 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result698 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result698) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result697, - language: lifted699, - }) - } - 24 => { - let result700 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted702 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result701 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result701) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result700, - mime_type: lifted702, - }) - } - 25 => { - let result703 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + @types.Role::Multimodal + } + 1 => { - @types.SchemaValueNode::PathValue(result703) - } - 26 => { - let result704 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + @types.Role::UnstructuredText + } + 2 => { - @types.SchemaValueNode::UrlValue(result704) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result705 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result705, - }) - } - 30 => { - let result706 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result706, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array708.push(lifted707) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - array710.push(LocalAgentConfigEntry::{ - path: array474, - value: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array672, - defs: array677, - root: mbt_ffi_load32(iter_base + 24), - }, - value: @types.SchemaValueTree::{ - value_nodes: array708, - root: mbt_ffi_load32(iter_base + 36), - }, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 160)) - - let lifted712 : @types.Uuid? = match - mbt_ffi_load8_u(iter_base + 168) { - 0 => Option::None - 1 => - Option::Some(@types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 176).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 184).reinterpret_as_uint64(), - }) - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - PublicOplogEntry::Create(CreateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }, - agent_id: result, - }, - agent_mode: AgentMode::from(mbt_ffi_load8_u(iter_base + 48)), - component_revision: mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - env: array, - created_by: @types.AccountId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 72).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 80).reinterpret_as_uint64(), - }, - }, - environment_id: @host.EnvironmentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 88).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 96).reinterpret_as_uint64(), - }, - }, - parent: lifted, - component_size: mbt_ffi_load64(iter_base + 136).reinterpret_as_uint64(), - initial_total_linear_memory_size: mbt_ffi_load64(iter_base + 144).reinterpret_as_uint64(), - initial_active_plugins: array471, - local_agent_config: array710, - original_phantom_id: lifted712, - instance_id: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 192).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 200).reinterpret_as_uint64(), - }, - }) - } - 1 => { - let lifted713 : UInt64? = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1388 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - let result714 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let lifted949 : @types.TypedSchemaValue? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => { - let array911 : Array[@types.SchemaTypeNode] = [] - for index912 = 0 - index912 < mbt_ffi_load32(iter_base + 56) - index912 = index912 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 52) + - index912 * 144 - - let lifted897 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted721 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted716 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted715 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Other(result1388) + } + _ => panic() + } - Option::Some(lifted715) - } - _ => panic() - } - - let lifted718 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted717 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted1389) + } + _ => panic() + } - Option::Some(lifted717) - } - _ => panic() - } - - let lifted720 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result719 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result719) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted716, - max: lifted718, - unit: lifted720, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted721) - } - 3 => { - let lifted728 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted723 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted722 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array1391.push(@types.UnionBranch::{tag : result1368, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted1377, metadata : @types.MetadataEnvelope::{doc : lifted1379, aliases : array1381, examples : array1384, deprecated : lifted1387, role : lifted1390}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted722) - } - _ => panic() - } - - let lifted725 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted724 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array1391}) + } + 32 => { - Option::Some(lifted724) - } - _ => panic() - } - - let lifted727 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result726 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result726) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted723, - max: lifted725, - unit: lifted727, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted728) - } - 4 => { - let lifted735 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted730 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted729 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1394 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted729) - } - _ => panic() - } - - let lifted732 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted731 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1393 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted731) - } - _ => panic() - } - - let lifted734 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result733 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result733) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted730, - max: lifted732, - unit: lifted734, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted735) - } - 5 => { - let lifted742 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted737 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted736 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1393) + } + _ => panic() + } - Option::Some(lifted736) - } - _ => panic() - } - - let lifted739 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted738 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted1394}) + } + 33 => { - Option::Some(lifted738) - } - _ => panic() - } - - let lifted741 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result740 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result740) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted737, - max: lifted739, - unit: lifted741, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted742) - } - 6 => { - let lifted749 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted744 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted743 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1396 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted743) - } - _ => panic() - } - - let lifted746 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted745 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1395 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - Option::Some(lifted745) - } - _ => panic() - } - - let lifted748 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result747 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result747) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted744, - max: lifted746, - unit: lifted748, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted749) - } - 7 => { - let lifted756 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted751 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted750 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1395) + } + _ => panic() + } - Option::Some(lifted750) - } - _ => panic() - } - - let lifted753 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted752 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted1396}) + } + 34 => { - Option::Some(lifted752) - } - _ => panic() - } - - let lifted755 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result754 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result754) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted751, - max: lifted753, - unit: lifted755, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted756) - } - 8 => { - let lifted763 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted758 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted757 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - Option::Some(lifted757) - } - _ => panic() - } - - let lifted760 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted759 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1397 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted759) - } - _ => panic() - } - - let lifted762 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result761 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result761) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted758, - max: lifted760, - unit: lifted762, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted763) - } - 9 => { - let lifted770 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted765 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted764 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted764) - } - _ => panic() - } - - let lifted767 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted766 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::FutureType(lifted1397) + } + 36 => { - Option::Some(lifted766) - } - _ => panic() - } - - let lifted769 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result768 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result768) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted765, - max: lifted767, - unit: lifted769, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted770) - } - 10 => { - let lifted777 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted772 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted771 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1398 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted771) - } - _ => panic() - } - - let lifted774 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted773 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted773) - } - _ => panic() - } - - let lifted776 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result775 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result775) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted772, - max: lifted774, - unit: lifted776, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted777) - } - 11 => { - let lifted784 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted779 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted778 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::StreamType(lifted1398) + } + _ => panic() + } - Option::Some(lifted778) - } - _ => panic() - } - - let lifted781 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted780 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1401 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { - Option::Some(lifted780) - } - _ => panic() - } - - let lifted783 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result782 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result782) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted779, - max: lifted781, - unit: lifted783, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted784) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array799 : Array[@types.NamedFieldType] = [] - for index800 = 0 - index800 < mbt_ffi_load32(iter_base + 12) - index800 = index800 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index800 * 68 - - let result785 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted787 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result786 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result786) - } - _ => panic() - } + let result1400 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - let array789 : Array[String] = [] - for index790 = 0 - index790 < mbt_ffi_load32(iter_base + 28) - index790 = index790 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index790 * 8 + Option::Some(result1400) + } + _ => panic() + } - let result788 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array1403 : Array[String] = []; + for index1404 = 0; index1404 < (mbt_ffi_load32((iter_base) + 104)); index1404 = index1404 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index1404 * 8) - array789.push(result788) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let result1402 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array792 : Array[String] = [] - for index793 = 0 - index793 < mbt_ffi_load32(iter_base + 36) - index793 = index793 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index793 * 8 + array1403.push(result1402) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - let result791 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array1406 : Array[String] = []; + for index1407 = 0; index1407 < (mbt_ffi_load32((iter_base) + 112)); index1407 = index1407 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index1407 * 8) - array792.push(result791) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted795 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result794 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result794) - } - _ => panic() - } + let result1405 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted798 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted797 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result796 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + array1406.push(result1405) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - @types.Role::Other(result796) - } - _ => panic() - } + let lifted1409 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - Option::Some(lifted797) - } - _ => panic() - } + let result1408 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - array799.push(@types.NamedFieldType::{ - name: result785, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted787, - aliases: array789, - examples: array792, - deprecated: lifted795, - role: lifted798, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array799) - } - 15 => { - let array816 : Array[@types.VariantCaseType] = [] - for index817 = 0 - index817 < mbt_ffi_load32(iter_base + 12) - index817 = index817 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index817 * 72 - - let result801 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted802 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + Option::Some(result1408) + } + _ => panic() + } - let lifted804 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result803 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result803) - } - _ => panic() - } + let lifted1412 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - let array806 : Array[String] = [] - for index807 = 0 - index807 < mbt_ffi_load32(iter_base + 32) - index807 = index807 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index807 * 8 + let lifted1411 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - let result805 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.Role::Multimodal + } + 1 => { - array806.push(result805) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + @types.Role::UnstructuredText + } + 2 => { - let array809 : Array[String] = [] - for index810 = 0 - index810 < mbt_ffi_load32(iter_base + 40) - index810 = index810 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index810 * 8 + @types.Role::UnstructuredBinary + } + 3 => { - let result808 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1410 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - array809.push(result808) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted812 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result811 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result811) - } - _ => panic() - } + @types.Role::Other(result1410) + } + _ => panic() + } - let lifted815 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted814 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result813 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + Option::Some(lifted1411) + } + _ => panic() + } - @types.Role::Other(result813) - } - _ => panic() - } + array1413.push(@types.SchemaTypeNode::{body : lifted1399, metadata : @types.MetadataEnvelope::{doc : lifted1401, aliases : array1403, examples : array1406, deprecated : lifted1409, role : lifted1412}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - Option::Some(lifted814) - } - _ => panic() - } + let array1418 : Array[@types.SchemaTypeDef] = []; + for index1419 = 0; index1419 < (mbt_ffi_load32((iter_base) + 68)); index1419 = index1419 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index1419 * 24) - array816.push(@types.VariantCaseType::{ - name: result801, - payload: lifted802, - metadata: @types.MetadataEnvelope::{ - doc: lifted804, - aliases: array806, - examples: array809, - deprecated: lifted812, - role: lifted815, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array816) - } - 16 => { - let array819 : Array[String] = [] - for index820 = 0 - index820 < mbt_ffi_load32(iter_base + 12) - index820 = index820 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index820 * 8 - - let result818 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array819.push(result818) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array819) - } - 17 => { - let array822 : Array[String] = [] - for index823 = 0 - index823 < mbt_ffi_load32(iter_base + 12) - index823 = index823 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index823 * 8 - - let result821 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array822.push(result821) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array822) - } - 18 => { - let array824 : Array[Int] = [] - for index825 = 0 - index825 < mbt_ffi_load32(iter_base + 12) - index825 = index825 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index825 * 4 - - array824.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array824) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted826 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted827 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted826, - err: lifted827, - }) - } - 24 => { - let lifted831 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array829 : Array[String] = [] - for index830 = 0 - index830 < mbt_ffi_load32(iter_base + 16) - index830 = index830 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index830 * 8 - - let result828 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array829.push(result828) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array829) - } - _ => panic() - } - - let lifted832 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted833 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted835 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result834 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result834) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted831, - min_length: lifted832, - max_length: lifted833, - regex: lifted835, - }) - } - 25 => { - let lifted839 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array837 : Array[String] = [] - for index838 = 0 - index838 < mbt_ffi_load32(iter_base + 16) - index838 = index838 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index838 * 8 - - let result836 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array837.push(result836) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array837) - } - _ => panic() - } - - let lifted840 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted841 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted839, - min_bytes: lifted840, - max_bytes: lifted841, - }) - } - 26 => { - let lifted845 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array843 : Array[String] = [] - for index844 = 0 - index844 < mbt_ffi_load32(iter_base + 20) - index844 = index844 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index844 * 8 - - let result842 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array843.push(result842) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array843) - } - _ => panic() - } - - let lifted849 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array847 : Array[String] = [] - for index848 = 0 - index848 < mbt_ffi_load32(iter_base + 32) - index848 = index848 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index848 * 8 - - let result846 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array847.push(result846) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array847) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted845, - allowed_extensions: lifted849, - }) - } - 27 => { - let lifted853 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array851 : Array[String] = [] - for index852 = 0 - index852 < mbt_ffi_load32(iter_base + 16) - index852 = index852 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index852 * 8 - - let result850 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array851.push(result850) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array851) - } - _ => panic() - } - - let lifted857 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array855 : Array[String] = [] - for index856 = 0 - index856 < mbt_ffi_load32(iter_base + 28) - index856 = index856 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index856 * 8 - - let result854 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array855.push(result854) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array855) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted853, - allowed_hosts: lifted857, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result858 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array860 : Array[String] = [] - for index861 = 0 - index861 < mbt_ffi_load32(iter_base + 20) - index861 = index861 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index861 * 8 - - let result859 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array860.push(result859) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted863 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result862 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result862, - }) - } - _ => panic() - } - - let lifted865 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result864 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result864, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result858, - allowed_suffixes: array860, - min: lifted863, - max: lifted865, - }) - } - 31 => { - let array889 : Array[@types.UnionBranch] = [] - for index890 = 0 - index890 < mbt_ffi_load32(iter_base + 12) - index890 = index890 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index890 * 92 - - let result866 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted875 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result867 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result867) - } - 1 => { - let result868 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result868) - } - 2 => { - let result869 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result869) - } - 3 => { - let result870 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result870) - } - 4 => { - let result871 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted873 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result872 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let result1415 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(result872) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result871, - literal: lifted873, - }) - } - 5 => { - let result874 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result874) - } - _ => panic() - } + let lifted1417 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted877 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result876 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result876) - } - _ => panic() - } + let result1416 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - let array879 : Array[String] = [] - for index880 = 0 - index880 < mbt_ffi_load32(iter_base + 52) - index880 = index880 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index880 * 8 + Option::Some(result1416) + } + _ => panic() + } - let result878 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array1418.push(@types.SchemaTypeDef::{id : result1415, name : lifted1417, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - array879.push(result878) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let array1449 : Array[@types.SchemaValueNode] = []; + for index1450 = 0; index1450 < (mbt_ffi_load32((iter_base) + 80)); index1450 = index1450 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 76)) + (index1450 * 32) - let array882 : Array[String] = [] - for index883 = 0 - index883 < mbt_ffi_load32(iter_base + 60) - index883 = index883 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index883 * 8 + let lifted1448 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let result881 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - array882.push(result881) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted885 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result884 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result884) - } - _ => panic() - } + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - let lifted888 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted887 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result886 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - @types.Role::Other(result886) - } - _ => panic() - } + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - Option::Some(lifted887) - } - _ => panic() - } + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - array889.push(@types.UnionBranch::{ - tag: result866, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted875, - metadata: @types.MetadataEnvelope::{ - doc: lifted877, - aliases: array879, - examples: array882, - deprecated: lifted885, - role: lifted888, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array889, - }) - } - 32 => { - let lifted892 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result891 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result891) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted892, - }) - } - 33 => { - let lifted894 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result893 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result893) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted894, - }) - } - 34 => { - let lifted895 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted895) - } - 35 => { - let lifted896 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted896) - } - _ => panic() - } + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - let lifted899 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result898 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result898) - } - _ => panic() - } + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - let array901 : Array[String] = [] - for index902 = 0 - index902 < mbt_ffi_load32(iter_base + 104) - index902 = index902 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index902 * 8 + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - let result900 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - array901.push(result900) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - let array904 : Array[String] = [] - for index905 = 0 - index905 < mbt_ffi_load32(iter_base + 112) - index905 = index905 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index905 * 8 + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - let result903 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - array904.push(result903) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted907 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result906 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result906) - } - _ => panic() - } + let result1420 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let lifted910 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted909 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result908 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result908) - } - _ => panic() - } + @types.SchemaValueNode::StringValue(result1420) + } + 13 => { - Option::Some(lifted909) - } - _ => panic() - } + let array1421 : Array[Int] = []; + for index1422 = 0; index1422 < (mbt_ffi_load32((iter_base) + 12)); index1422 = index1422 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1422 * 4) - array911.push(@types.SchemaTypeNode::{ - body: lifted897, - metadata: @types.MetadataEnvelope::{ - doc: lifted899, - aliases: array901, - examples: array904, - deprecated: lifted907, - role: lifted910, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - - let array916 : Array[@types.SchemaTypeDef] = [] - for index917 = 0 - index917 < mbt_ffi_load32(iter_base + 64) - index917 = index917 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + index917 * 24 - - let result913 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted915 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result914 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result914) - } - _ => panic() - } + array1421.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - array916.push(@types.SchemaTypeDef::{ - id: result913, - name: lifted915, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - let array947 : Array[@types.SchemaValueNode] = [] - for index948 = 0 - index948 < mbt_ffi_load32(iter_base + 76) - index948 = index948 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 72) + index948 * 32 - - let lifted946 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result918 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result918) - } - 13 => { - let array919 : Array[Int] = [] - for index920 = 0 - index920 < mbt_ffi_load32(iter_base + 12) - index920 = index920 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index920 * 4 - - array919.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array919) - } - 14 => { - let lifted921 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted921, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array922 : Array[Bool] = [] - for index923 = 0 - index923 < mbt_ffi_load32(iter_base + 12) - index923 = index923 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index923 * 1 - - array922.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array922) - } - 17 => { - let array924 : Array[Int] = [] - for index925 = 0 - index925 < mbt_ffi_load32(iter_base + 12) - index925 = index925 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index925 * 4 - - array924.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array924) - } - 18 => { - let array926 : Array[Int] = [] - for index927 = 0 - index927 < mbt_ffi_load32(iter_base + 12) - index927 = index927 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index927 * 4 - - array926.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array926) - } - 19 => { - let array928 : Array[Int] = [] - for index929 = 0 - index929 < mbt_ffi_load32(iter_base + 12) - index929 = index929 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index929 * 4 - - array928.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array928) - } - 20 => { - let array930 : Array[@types.MapEntry] = [] - for index931 = 0 - index931 < mbt_ffi_load32(iter_base + 12) - index931 = index931 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index931 * 8 - - array930.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array930) - } - 21 => { - let lifted932 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted932) - } - 22 => { - let lifted935 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted933 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted933) - } - 1 => { - let lifted934 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted934) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted935) - } - 23 => { - let result936 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted938 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result937 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result937) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result936, - language: lifted938, - }) - } - 24 => { - let result939 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted941 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result940 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result940) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result939, - mime_type: lifted941, - }) - } - 25 => { - let result942 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result942) - } - 26 => { - let result943 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result943) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result944 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result944, - }) - } - 30 => { - let result945 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result945, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @types.SchemaValueNode::RecordValue(array1421) + } + 14 => { - array947.push(lifted946) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 72)) - - Option::Some(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array911, - defs: array916, - root: mbt_ffi_load32(iter_base + 68), - }, - value: @types.SchemaValueTree::{ - value_nodes: array947, - root: mbt_ffi_load32(iter_base + 80), - }, - }) - } - _ => panic() - } + let lifted1423 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let lifted952 = match mbt_ffi_load8_u(iter_base + 88) { - 0 => WrappedFunctionType::ReadLocal - 1 => WrappedFunctionType::WriteLocal - 2 => WrappedFunctionType::ReadRemote - 3 => WrappedFunctionType::WriteRemote - 4 => { - let lifted950 : UInt64? = match - mbt_ffi_load8_u(iter_base + 96) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 104).reinterpret_as_uint64(), - ) - _ => panic() - } - - WrappedFunctionType::WriteRemoteBatched(lifted950) - } - 5 => { - let lifted951 : UInt64? = match - mbt_ffi_load8_u(iter_base + 96) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 104).reinterpret_as_uint64(), - ) - _ => panic() - } - - WrappedFunctionType::WriteRemoteTransaction(lifted951) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - PublicOplogEntry::Start(StartParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - parent_start_index: lifted713, - function_name: result714, - request: lifted949, - durable_function_type: lifted952, - }) - } - 2 => { - let lifted1187 : @types.TypedSchemaValue? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let array1149 : Array[@types.SchemaTypeNode] = [] - for index1150 = 0 - index1150 < mbt_ffi_load32(iter_base + 40) - index1150 = index1150 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1150 * 144 - - let lifted1135 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted959 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted954 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted953 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted1423}) + } + 15 => { - Option::Some(lifted953) - } - _ => panic() - } - - let lifted956 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted955 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - Option::Some(lifted955) - } - _ => panic() - } - - let lifted958 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result957 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result957) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted954, - max: lifted956, - unit: lifted958, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted959) - } - 3 => { - let lifted966 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted961 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted960 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1424 : Array[Bool] = []; + for index1425 = 0; index1425 < (mbt_ffi_load32((iter_base) + 12)); index1425 = index1425 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1425 * 1) - Option::Some(lifted960) - } - _ => panic() - } - - let lifted963 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted962 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1424.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted962) - } - _ => panic() - } - - let lifted965 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result964 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result964) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted961, - max: lifted963, - unit: lifted965, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted966) - } - 4 => { - let lifted973 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted968 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted967 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::FlagsValue(array1424) + } + 17 => { - Option::Some(lifted967) - } - _ => panic() - } - - let lifted970 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted969 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1426 : Array[Int] = []; + for index1427 = 0; index1427 < (mbt_ffi_load32((iter_base) + 12)); index1427 = index1427 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1427 * 4) - Option::Some(lifted969) - } - _ => panic() - } - - let lifted972 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result971 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result971) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted968, - max: lifted970, - unit: lifted972, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted973) - } - 5 => { - let lifted980 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted975 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted974 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array1426.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted974) - } - _ => panic() - } - - let lifted977 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted976 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::TupleValue(array1426) + } + 18 => { - Option::Some(lifted976) - } - _ => panic() - } - - let lifted979 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result978 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result978) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted975, - max: lifted977, - unit: lifted979, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted980) - } - 6 => { - let lifted987 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted982 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted981 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1428 : Array[Int] = []; + for index1429 = 0; index1429 < (mbt_ffi_load32((iter_base) + 12)); index1429 = index1429 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1429 * 4) - Option::Some(lifted981) - } - _ => panic() - } - - let lifted984 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted983 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1428.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted983) - } - _ => panic() - } - - let lifted986 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result985 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result985) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted982, - max: lifted984, - unit: lifted986, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted987) - } - 7 => { - let lifted994 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted989 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted988 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::ListValue(array1428) + } + 19 => { - Option::Some(lifted988) - } - _ => panic() - } - - let lifted991 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted990 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1430 : Array[Int] = []; + for index1431 = 0; index1431 < (mbt_ffi_load32((iter_base) + 12)); index1431 = index1431 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1431 * 4) - Option::Some(lifted990) - } - _ => panic() - } - - let lifted993 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result992 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result992) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted989, - max: lifted991, - unit: lifted993, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted994) - } - 8 => { - let lifted1001 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted996 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted995 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array1430.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted995) - } - _ => panic() - } - - let lifted998 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted997 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::FixedListValue(array1430) + } + 20 => { - Option::Some(lifted997) - } - _ => panic() - } - - let lifted1000 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result999 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result999) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted996, - max: lifted998, - unit: lifted1000, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1001) - } - 9 => { - let lifted1008 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1003 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1002 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1432 : Array[@types.MapEntry] = []; + for index1433 = 0; index1433 < (mbt_ffi_load32((iter_base) + 12)); index1433 = index1433 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1433 * 8) - Option::Some(lifted1002) - } - _ => panic() - } - - let lifted1005 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1004 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1432.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted1004) - } - _ => panic() - } - - let lifted1007 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1006 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1006) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1003, - max: lifted1005, - unit: lifted1007, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1008) - } - 10 => { - let lifted1015 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1010 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1009 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::MapValue(array1432) + } + 21 => { - Option::Some(lifted1009) - } - _ => panic() - } - - let lifted1012 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1011 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1434 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted1011) - } - _ => panic() - } - - let lifted1014 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1013 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1013) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1010, - max: lifted1012, - unit: lifted1014, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1015) - } - 11 => { - let lifted1022 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1017 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1016 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted1016) - } - _ => panic() - } - - let lifted1019 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1018 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::OptionValue(lifted1434) + } + 22 => { - Option::Some(lifted1018) - } - _ => panic() - } - - let lifted1021 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1020 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1020) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1017, - max: lifted1019, - unit: lifted1021, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted1022) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array1037 : Array[@types.NamedFieldType] = [] - for index1038 = 0 - index1038 < mbt_ffi_load32(iter_base + 12) - index1038 = index1038 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1038 * 68 - - let result1023 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1025 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1024 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1024) - } - _ => panic() - } + let lifted1437 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - let array1027 : Array[String] = [] - for index1028 = 0 - index1028 < mbt_ffi_load32(iter_base + 28) - index1028 = index1028 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1028 * 8 + let lifted1435 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let result1026 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - array1027.push(result1026) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @types.ResultValuePayload::OkValue(lifted1435) + } + 1 => { - let array1030 : Array[String] = [] - for index1031 = 0 - index1031 < mbt_ffi_load32(iter_base + 36) - index1031 = index1031 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1031 * 8 + let lifted1436 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let result1029 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - array1030.push(result1029) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted1033 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result1032 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result1032) - } - _ => panic() - } + @types.ResultValuePayload::ErrValue(lifted1436) + } + _ => panic() + } - let lifted1036 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted1035 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1034 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + @types.SchemaValueNode::ResultValue(lifted1437) + } + 23 => { - @types.Role::Other(result1034) - } - _ => panic() - } + let result1438 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1035) - } - _ => panic() - } + let lifted1440 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - array1037.push(@types.NamedFieldType::{ - name: result1023, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted1025, - aliases: array1027, - examples: array1030, - deprecated: lifted1033, - role: lifted1036, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array1037) - } - 15 => { - let array1054 : Array[@types.VariantCaseType] = [] - for index1055 = 0 - index1055 < mbt_ffi_load32(iter_base + 12) - index1055 = index1055 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1055 * 72 - - let result1039 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1040 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result1439 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted1042 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1041 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1041) - } - _ => panic() - } + Option::Some(result1439) + } + _ => panic() + } - let array1044 : Array[String] = [] - for index1045 = 0 - index1045 < mbt_ffi_load32(iter_base + 32) - index1045 = index1045 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1045 * 8 + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result1438, language : lifted1440}) + } + 24 => { - let result1043 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1441 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array1044.push(result1043) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let lifted1443 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let array1047 : Array[String] = [] - for index1048 = 0 - index1048 < mbt_ffi_load32(iter_base + 40) - index1048 = index1048 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1048 * 8 + let result1442 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let result1046 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(result1442) + } + _ => panic() + } - array1047.push(result1046) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted1050 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result1049 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result1049) - } - _ => panic() - } + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result1441, mime_type : lifted1443}) + } + 25 => { - let lifted1053 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted1052 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1051 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let result1444 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.Role::Other(result1051) - } - _ => panic() - } + @types.SchemaValueNode::PathValue(result1444) + } + 26 => { - Option::Some(lifted1052) - } - _ => panic() - } + let result1445 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array1054.push(@types.VariantCaseType::{ - name: result1039, - payload: lifted1040, - metadata: @types.MetadataEnvelope::{ - doc: lifted1042, - aliases: array1044, - examples: array1047, - deprecated: lifted1050, - role: lifted1053, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array1054) - } - 16 => { - let array1057 : Array[String] = [] - for index1058 = 0 - index1058 < mbt_ffi_load32(iter_base + 12) - index1058 = index1058 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1058 * 8 - - let result1056 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1057.push(result1056) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array1057) - } - 17 => { - let array1060 : Array[String] = [] - for index1061 = 0 - index1061 < mbt_ffi_load32(iter_base + 12) - index1061 = index1061 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1061 * 8 - - let result1059 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1060.push(result1059) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array1060) - } - 18 => { - let array1062 : Array[Int] = [] - for index1063 = 0 - index1063 < mbt_ffi_load32(iter_base + 12) - index1063 = index1063 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1063 * 4 - - array1062.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array1062) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted1064 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted1065 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted1064, - err: lifted1065, - }) - } - 24 => { - let lifted1069 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1067 : Array[String] = [] - for index1068 = 0 - index1068 < mbt_ffi_load32(iter_base + 16) - index1068 = index1068 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1068 * 8 - - let result1066 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1067.push(result1066) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1067) - } - _ => panic() - } - - let lifted1070 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1071 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1073 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1072 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1072) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted1069, - min_length: lifted1070, - max_length: lifted1071, - regex: lifted1073, - }) - } - 25 => { - let lifted1077 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1075 : Array[String] = [] - for index1076 = 0 - index1076 < mbt_ffi_load32(iter_base + 16) - index1076 = index1076 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1076 * 8 - - let result1074 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1075.push(result1074) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1075) - } - _ => panic() - } - - let lifted1078 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1079 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted1077, - min_bytes: lifted1078, - max_bytes: lifted1079, - }) - } - 26 => { - let lifted1083 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array1081 : Array[String] = [] - for index1082 = 0 - index1082 < mbt_ffi_load32(iter_base + 20) - index1082 = index1082 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1082 * 8 - - let result1080 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1081.push(result1080) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array1081) - } - _ => panic() - } - - let lifted1087 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array1085 : Array[String] = [] - for index1086 = 0 - index1086 < mbt_ffi_load32(iter_base + 32) - index1086 = index1086 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1086 * 8 - - let result1084 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1085.push(result1084) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array1085) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted1083, - allowed_extensions: lifted1087, - }) - } - 27 => { - let lifted1091 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1089 : Array[String] = [] - for index1090 = 0 - index1090 < mbt_ffi_load32(iter_base + 16) - index1090 = index1090 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1090 * 8 - - let result1088 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1089.push(result1088) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1089) - } - _ => panic() - } - - let lifted1095 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array1093 : Array[String] = [] - for index1094 = 0 - index1094 < mbt_ffi_load32(iter_base + 28) - index1094 = index1094 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1094 * 8 - - let result1092 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1093.push(result1092) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array1093) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted1091, - allowed_hosts: lifted1095, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result1096 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array1098 : Array[String] = [] - for index1099 = 0 - index1099 < mbt_ffi_load32(iter_base + 20) - index1099 = index1099 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1099 * 8 - - let result1097 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1098.push(result1097) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted1101 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1100 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result1100, - }) - } - _ => panic() - } - - let lifted1103 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result1102 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result1102, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result1096, - allowed_suffixes: array1098, - min: lifted1101, - max: lifted1103, - }) - } - 31 => { - let array1127 : Array[@types.UnionBranch] = [] - for index1128 = 0 - index1128 < mbt_ffi_load32(iter_base + 12) - index1128 = index1128 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1128 * 92 - - let result1104 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1113 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result1105 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result1105) - } - 1 => { - let result1106 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result1106) - } - 2 => { - let result1107 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result1107) - } - 3 => { - let result1108 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result1108) - } - 4 => { - let result1109 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted1111 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1110 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + @types.SchemaValueNode::UrlValue(result1445) + } + 27 => { - Option::Some(result1110) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result1109, - literal: lifted1111, - }) - } - 5 => { - let result1112 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result1112) - } - _ => panic() - } + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - let lifted1115 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1114 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1114) - } - _ => panic() - } + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - let array1117 : Array[String] = [] - for index1118 = 0 - index1118 < mbt_ffi_load32(iter_base + 52) - index1118 = index1118 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1118 * 8 + let result1446 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let result1116 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result1446}) + } + 30 => { - array1117.push(result1116) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let result1447 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let array1120 : Array[String] = [] - for index1121 = 0 - index1121 < mbt_ffi_load32(iter_base + 60) - index1121 = index1121 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1121 * 8 + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result1447, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - let result1119 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - array1120.push(result1119) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted1123 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1122 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1122) - } - _ => panic() - } + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - let lifted1126 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted1125 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1124 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } - @types.Role::Other(result1124) - } - _ => panic() - } + array1449.push(lifted1448) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + let result1451 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 88), mbt_ffi_load32((iter_base) + 92)) - Option::Some(lifted1125) - } - _ => panic() - } + let array1453 : Array[String] = []; + for index1454 = 0; index1454 < (mbt_ffi_load32((iter_base) + 100)); index1454 = index1454 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 96)) + (index1454 * 8) - array1127.push(@types.UnionBranch::{ - tag: result1104, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted1113, - metadata: @types.MetadataEnvelope::{ - doc: lifted1115, - aliases: array1117, - examples: array1120, - deprecated: lifted1123, - role: lifted1126, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array1127, - }) - } - 32 => { - let lifted1130 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1129 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1129) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted1130, - }) - } - 33 => { - let lifted1132 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1131 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1131) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted1132, - }) - } - 34 => { - let lifted1133 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted1133) - } - 35 => { - let lifted1134 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted1134) - } - _ => panic() - } + let result1452 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted1137 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result1136 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result1136) - } - _ => panic() - } + array1453.push(result1452) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 96)) - let array1139 : Array[String] = [] - for index1140 = 0 - index1140 < mbt_ffi_load32(iter_base + 104) - index1140 = index1140 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index1140 * 8 + let array1468 : Array[Array[SpanData]] = []; + for index1469 = 0; index1469 < (mbt_ffi_load32((iter_base) + 108)); index1469 = index1469 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 104)) + (index1469 * 8) - let result1138 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array1466 : Array[SpanData] = []; + for index1467 = 0; index1467 < (mbt_ffi_load32((iter_base) + 4)); index1467 = index1467 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index1467 * 80) - array1139.push(result1138) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let lifted1465 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let array1142 : Array[String] = [] - for index1143 = 0 - index1143 < mbt_ffi_load32(iter_base + 112) - index1143 = index1143 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index1143 * 8 + let result1455 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result1141 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1457 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { - array1142.push(result1141) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted1145 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result1144 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result1144) - } - _ => panic() - } + let result1456 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) - let lifted1148 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted1147 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1146 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result1146) - } - _ => panic() - } + Option::Some(result1456) + } + _ => panic() + } - Option::Some(lifted1147) - } - _ => panic() - } + let lifted1458 : UInt64? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { - array1149.push(@types.SchemaTypeNode::{ - body: lifted1135, - metadata: @types.MetadataEnvelope::{ - doc: lifted1137, - aliases: array1139, - examples: array1142, - deprecated: lifted1145, - role: lifted1148, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array1154 : Array[@types.SchemaTypeDef] = [] - for index1155 = 0 - index1155 < mbt_ffi_load32(iter_base + 48) - index1155 = index1155 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + - index1155 * 24 - - let result1151 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1153 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1152 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1152) - } - _ => panic() - } + Option::Some((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - array1154.push(@types.SchemaTypeDef::{ - id: result1151, - name: lifted1153, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - let array1185 : Array[@types.SchemaValueNode] = [] - for index1186 = 0 - index1186 < mbt_ffi_load32(iter_base + 60) - index1186 = index1186 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1186 * 32 - - let lifted1184 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result1156 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result1156) - } - 13 => { - let array1157 : Array[Int] = [] - for index1158 = 0 - index1158 < mbt_ffi_load32(iter_base + 12) - index1158 = index1158 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1158 * 4 - - array1157.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array1157) - } - 14 => { - let lifted1159 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted1159, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1160 : Array[Bool] = [] - for index1161 = 0 - index1161 < mbt_ffi_load32(iter_base + 12) - index1161 = index1161 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1161 * 1 - - array1160.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1160) - } - 17 => { - let array1162 : Array[Int] = [] - for index1163 = 0 - index1163 < mbt_ffi_load32(iter_base + 12) - index1163 = index1163 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1163 * 4 - - array1162.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array1162) - } - 18 => { - let array1164 : Array[Int] = [] - for index1165 = 0 - index1165 < mbt_ffi_load32(iter_base + 12) - index1165 = index1165 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1165 * 4 - - array1164.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array1164) - } - 19 => { - let array1166 : Array[Int] = [] - for index1167 = 0 - index1167 < mbt_ffi_load32(iter_base + 12) - index1167 = index1167 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1167 * 4 - - array1166.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array1166) - } - 20 => { - let array1168 : Array[@types.MapEntry] = [] - for index1169 = 0 - index1169 < mbt_ffi_load32(iter_base + 12) - index1169 = index1169 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1169 * 8 - - array1168.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array1168) - } - 21 => { - let lifted1170 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted1170) - } - 22 => { - let lifted1173 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted1171 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted1171) - } - 1 => { - let lifted1172 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted1172) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted1173) - } - 23 => { - let result1174 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1176 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1175) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result1174, - language: lifted1176, - }) - } - 24 => { - let result1177 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1179 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1178 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1178) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result1177, - mime_type: lifted1179, - }) - } - 25 => { - let result1180 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result1180) - } - 26 => { - let result1181 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result1181) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result1182 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result1182, - }) - } - 30 => { - let result1183 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result1183, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + let array1462 : Array[@context.Attribute] = []; + for index1463 = 0; index1463 < (mbt_ffi_load32((iter_base) + 68)); index1463 = index1463 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index1463 * 20) - array1185.push(lifted1184) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - Option::Some(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array1149, - defs: array1154, - root: mbt_ffi_load32(iter_base + 52), - }, - value: @types.SchemaValueTree::{ - value_nodes: array1185, - root: mbt_ffi_load32(iter_base + 64), - }, - }) - } - _ => panic() - } + let result1459 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - PublicOplogEntry::End(EndParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - start_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - response: lifted1187, - forced_commit: mbt_ffi_load8_u(iter_base + 68) != 0, - }) - } - 3 => { - let lifted1422 : @types.TypedSchemaValue? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let array1384 : Array[@types.SchemaTypeNode] = [] - for index1385 = 0 - index1385 < mbt_ffi_load32(iter_base + 40) - index1385 = index1385 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1385 * 144 - - let lifted1370 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted1194 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1189 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1188 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1461 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - Option::Some(lifted1188) - } - _ => panic() - } - - let lifted1191 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1190 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1460 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - Option::Some(lifted1190) - } - _ => panic() - } - - let lifted1193 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1192 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1192) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1189, - max: lifted1191, - unit: lifted1193, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted1194) - } - 3 => { - let lifted1201 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1196 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1195 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @context.AttributeValue::String(result1460) + } + _ => panic() + } - Option::Some(lifted1195) - } - _ => panic() - } - - let lifted1198 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1197 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1462.push(@context.Attribute::{key : result1459, value : lifted1461}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - Option::Some(lifted1197) - } - _ => panic() - } - - let lifted1200 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1199 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1199) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1196, - max: lifted1198, - unit: lifted1200, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted1201) - } - 4 => { - let lifted1208 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1203 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1202 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + SpanData::LocalSpan(LocalSpanData::{span_id : result1455, start : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent : lifted1457, linked_context : lifted1458, attributes : array1462, inherited : (mbt_ffi_load8_u((iter_base) + 72) != 0)}) + } + 1 => { - Option::Some(lifted1202) - } - _ => panic() - } - - let lifted1205 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1204 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1464 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1204) - } - _ => panic() - } - - let lifted1207 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1206 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1206) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1203, - max: lifted1205, - unit: lifted1207, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted1208) - } - 5 => { - let lifted1215 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1210 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1209 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + SpanData::ExternalSpan(ExternalSpanData::{span_id : result1464}) + } + _ => panic() + } - Option::Some(lifted1209) - } - _ => panic() - } - - let lifted1212 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1211 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1466.push(lifted1465) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - Option::Some(lifted1211) - } - _ => panic() - } - - let lifted1214 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1213 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1213) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1210, - max: lifted1212, - unit: lifted1214, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted1215) - } - 6 => { - let lifted1222 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1217 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1216 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array1468.push(array1466) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 104)) - Option::Some(lifted1216) - } - _ => panic() - } - - let lifted1219 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1218 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocation::AgentMethodInvocation(AgentMethodInvocationParameters::{idempotency_key : result1215, method_name : result1216, function_input : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array1413, defs : array1418, root : mbt_ffi_load32((iter_base) + 72)}, value : @types.SchemaValueTree::{value_nodes : array1449, root : mbt_ffi_load32((iter_base) + 84)}}, trace_id : result1451, trace_states : array1453, invocation_context : array1468}) + } + 2 => { - Option::Some(lifted1218) - } - _ => panic() - } - - let lifted1221 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1220 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1220) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1217, - max: lifted1219, - unit: lifted1221, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted1222) - } - 7 => { - let lifted1229 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1224 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1223 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocation::SaveSnapshot + } + 3 => { - Option::Some(lifted1223) - } - _ => panic() - } - - let lifted1226 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1225 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1470 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted1225) - } - _ => panic() - } - - let lifted1228 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1227 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1227) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1224, - max: lifted1226, - unit: lifted1228, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1229) - } - 8 => { - let lifted1236 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1231 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1230 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1471 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - Option::Some(lifted1230) - } - _ => panic() - } - - let lifted1233 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1232 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocation::LoadSnapshot(LoadSnapshotParameters::{snapshot : SnapshotData::{data : result1470, mime_type : result1471}}) + } + 4 => { - Option::Some(lifted1232) - } - _ => panic() - } - - let lifted1235 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1234 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1234) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1231, - max: lifted1233, - unit: lifted1235, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1236) - } - 9 => { - let lifted1243 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1238 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1237 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1472 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted1237) - } - _ => panic() - } - - let lifted1240 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1239 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocation::ProcessOplogEntries(ProcessOplogEntriesParameters::{idempotency_key : result1472}) + } + 5 => { - Option::Some(lifted1239) - } - _ => panic() - } - - let lifted1242 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1241 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1241) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1238, - max: lifted1240, - unit: lifted1242, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1243) - } - 10 => { - let lifted1250 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1245 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1244 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocation::ManualUpdate(ManualUpdateParameters::{target_revision : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}) + } + _ => panic() + } - Option::Some(lifted1244) - } - _ => panic() - } - - let lifted1247 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1246 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::AgentInvocationStarted(AgentInvocationStartedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, invocation : lifted1473}) } + 5 => { - Option::Some(lifted1246) - } - _ => panic() - } - - let lifted1249 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1248 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1248) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1245, - max: lifted1247, - unit: lifted1249, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1250) - } - 11 => { - let lifted1257 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1252 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1251 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1948 = match (mbt_ffi_load8_u((iter_base) + 32)) { + 0 => { - Option::Some(lifted1251) - } - _ => panic() - } - - let lifted1254 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1253 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1670 : Array[@types.SchemaTypeNode] = []; + for index1671 = 0; index1671 < (mbt_ffi_load32((iter_base) + 40)); index1671 = index1671 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1671 * 144) - Option::Some(lifted1253) - } - _ => panic() - } - - let lifted1256 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1255 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1255) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1252, - max: lifted1254, - unit: lifted1256, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted1257) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array1272 : Array[@types.NamedFieldType] = [] - for index1273 = 0 - index1273 < mbt_ffi_load32(iter_base + 12) - index1273 = index1273 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1273 * 68 - - let result1258 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1260 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1259 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1259) - } - _ => panic() - } + let lifted1656 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let array1262 : Array[String] = [] - for index1263 = 0 - index1263 < mbt_ffi_load32(iter_base + 28) - index1263 = index1263 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1263 * 8 + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { - let result1261 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::BoolType + } + 2 => { - array1262.push(result1261) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let lifted1480 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let array1265 : Array[String] = [] - for index1266 = 0 - index1266 < mbt_ffi_load32(iter_base + 36) - index1266 = index1266 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1266 * 8 + let lifted1475 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let result1264 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1474 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - array1265.push(result1264) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted1268 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result1267 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result1267) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let lifted1271 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted1270 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1269 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - @types.Role::Other(result1269) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - Option::Some(lifted1270) - } - _ => panic() - } + Option::Some(lifted1474) + } + _ => panic() + } - array1272.push(@types.NamedFieldType::{ - name: result1258, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted1260, - aliases: array1262, - examples: array1265, - deprecated: lifted1268, - role: lifted1271, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array1272) - } - 15 => { - let array1289 : Array[@types.VariantCaseType] = [] - for index1290 = 0 - index1290 < mbt_ffi_load32(iter_base + 12) - index1290 = index1290 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1290 * 72 - - let result1274 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1275 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted1477 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - let lifted1277 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1276 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1276) - } - _ => panic() - } + let lifted1476 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let array1279 : Array[String] = [] - for index1280 = 0 - index1280 < mbt_ffi_load32(iter_base + 32) - index1280 = index1280 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1280 * 8 + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - let result1278 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - array1279.push(result1278) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let array1282 : Array[String] = [] - for index1283 = 0 - index1283 < mbt_ffi_load32(iter_base + 40) - index1283 = index1283 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1283 * 8 + Option::Some(lifted1476) + } + _ => panic() + } - let result1281 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1479 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - array1282.push(result1281) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted1285 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result1284 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result1284) - } - _ => panic() - } + let result1478 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let lifted1288 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted1287 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1286 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + Option::Some(result1478) + } + _ => panic() + } - @types.Role::Other(result1286) - } - _ => panic() - } + Option::Some(@types.NumericRestrictions::{min : lifted1475, max : lifted1477, unit : lifted1479}) + } + _ => panic() + } - Option::Some(lifted1287) - } - _ => panic() - } + @types.SchemaTypeBody::S8Type(lifted1480) + } + 3 => { - array1289.push(@types.VariantCaseType::{ - name: result1274, - payload: lifted1275, - metadata: @types.MetadataEnvelope::{ - doc: lifted1277, - aliases: array1279, - examples: array1282, - deprecated: lifted1285, - role: lifted1288, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array1289) - } - 16 => { - let array1292 : Array[String] = [] - for index1293 = 0 - index1293 < mbt_ffi_load32(iter_base + 12) - index1293 = index1293 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1293 * 8 - - let result1291 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1292.push(result1291) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array1292) - } - 17 => { - let array1295 : Array[String] = [] - for index1296 = 0 - index1296 < mbt_ffi_load32(iter_base + 12) - index1296 = index1296 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1296 * 8 - - let result1294 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1295.push(result1294) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array1295) - } - 18 => { - let array1297 : Array[Int] = [] - for index1298 = 0 - index1298 < mbt_ffi_load32(iter_base + 12) - index1298 = index1298 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1298 * 4 - - array1297.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array1297) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted1299 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted1300 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted1299, - err: lifted1300, - }) - } - 24 => { - let lifted1304 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1302 : Array[String] = [] - for index1303 = 0 - index1303 < mbt_ffi_load32(iter_base + 16) - index1303 = index1303 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1303 * 8 - - let result1301 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1302.push(result1301) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1302) - } - _ => panic() - } - - let lifted1305 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1306 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1308 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1307 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1307) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted1304, - min_length: lifted1305, - max_length: lifted1306, - regex: lifted1308, - }) - } - 25 => { - let lifted1312 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1310 : Array[String] = [] - for index1311 = 0 - index1311 < mbt_ffi_load32(iter_base + 16) - index1311 = index1311 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1311 * 8 - - let result1309 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1310.push(result1309) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1310) - } - _ => panic() - } - - let lifted1313 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1314 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted1312, - min_bytes: lifted1313, - max_bytes: lifted1314, - }) - } - 26 => { - let lifted1318 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array1316 : Array[String] = [] - for index1317 = 0 - index1317 < mbt_ffi_load32(iter_base + 20) - index1317 = index1317 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1317 * 8 - - let result1315 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1316.push(result1315) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array1316) - } - _ => panic() - } - - let lifted1322 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array1320 : Array[String] = [] - for index1321 = 0 - index1321 < mbt_ffi_load32(iter_base + 32) - index1321 = index1321 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1321 * 8 - - let result1319 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1320.push(result1319) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array1320) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted1318, - allowed_extensions: lifted1322, - }) - } - 27 => { - let lifted1326 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1324 : Array[String] = [] - for index1325 = 0 - index1325 < mbt_ffi_load32(iter_base + 16) - index1325 = index1325 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1325 * 8 - - let result1323 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1324.push(result1323) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1324) - } - _ => panic() - } - - let lifted1330 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array1328 : Array[String] = [] - for index1329 = 0 - index1329 < mbt_ffi_load32(iter_base + 28) - index1329 = index1329 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1329 * 8 - - let result1327 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1328.push(result1327) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array1328) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted1326, - allowed_hosts: lifted1330, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result1331 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array1333 : Array[String] = [] - for index1334 = 0 - index1334 < mbt_ffi_load32(iter_base + 20) - index1334 = index1334 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1334 * 8 - - let result1332 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1333.push(result1332) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted1336 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1335 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result1335, - }) - } - _ => panic() - } - - let lifted1338 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result1337 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result1337, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result1331, - allowed_suffixes: array1333, - min: lifted1336, - max: lifted1338, - }) - } - 31 => { - let array1362 : Array[@types.UnionBranch] = [] - for index1363 = 0 - index1363 < mbt_ffi_load32(iter_base + 12) - index1363 = index1363 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1363 * 92 - - let result1339 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1348 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result1340 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result1340) - } - 1 => { - let result1341 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result1341) - } - 2 => { - let result1342 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result1342) - } - 3 => { - let result1343 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result1343) - } - 4 => { - let result1344 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted1346 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1345 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let lifted1487 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(result1345) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result1344, - literal: lifted1346, - }) - } - 5 => { - let result1347 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result1347) - } - _ => panic() - } + let lifted1482 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted1350 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1349 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1349) - } - _ => panic() - } + let lifted1481 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let array1352 : Array[String] = [] - for index1353 = 0 - index1353 < mbt_ffi_load32(iter_base + 52) - index1353 = index1353 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1353 * 8 + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let result1351 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1481) + } + _ => panic() + } + + let lifted1484 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1483 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1483) + } + _ => panic() + } + + let lifted1486 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1485 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1485) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1482, max : lifted1484, unit : lifted1486}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted1487) + } + 4 => { + + let lifted1494 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1489 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1488 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1488) + } + _ => panic() + } + + let lifted1491 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1490 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1490) + } + _ => panic() + } + + let lifted1493 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1492 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1492) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1489, max : lifted1491, unit : lifted1493}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted1494) + } + 5 => { + + let lifted1501 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1496 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1495 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1495) + } + _ => panic() + } + + let lifted1498 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1497 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1497) + } + _ => panic() + } + + let lifted1500 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1499 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1499) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1496, max : lifted1498, unit : lifted1500}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted1501) + } + 6 => { + + let lifted1508 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1503 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1502 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1502) + } + _ => panic() + } + + let lifted1505 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1504 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1504) + } + _ => panic() + } + + let lifted1507 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1506 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1506) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1503, max : lifted1505, unit : lifted1507}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted1508) + } + 7 => { + + let lifted1515 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1510 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1509 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1509) + } + _ => panic() + } + + let lifted1512 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1511 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1511) + } + _ => panic() + } + + let lifted1514 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1513 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1513) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1510, max : lifted1512, unit : lifted1514}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1515) + } + 8 => { + + let lifted1522 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1517 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1516 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1516) + } + _ => panic() + } + + let lifted1519 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1518 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1518) + } + _ => panic() + } + + let lifted1521 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1520 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1520) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1517, max : lifted1519, unit : lifted1521}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1522) + } + 9 => { + + let lifted1529 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1524 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1523 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1523) + } + _ => panic() + } + + let lifted1526 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1525 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1525) + } + _ => panic() + } + + let lifted1528 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1527 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1527) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1524, max : lifted1526, unit : lifted1528}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1529) + } + 10 => { + + let lifted1536 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1531 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1530 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1530) + } + _ => panic() + } + + let lifted1533 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1532 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1532) + } + _ => panic() + } + + let lifted1535 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1534 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1534) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1531, max : lifted1533, unit : lifted1535}) + } + _ => panic() + } - array1352.push(result1351) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + @types.SchemaTypeBody::F32Type(lifted1536) + } + 11 => { - let array1355 : Array[String] = [] - for index1356 = 0 - index1356 < mbt_ffi_load32(iter_base + 60) - index1356 = index1356 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1356 * 8 + let lifted1543 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let result1354 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1538 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - array1355.push(result1354) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted1358 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1357 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1357) - } - _ => panic() - } + let lifted1537 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let lifted1361 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted1360 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1359 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - @types.Role::Other(result1359) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(lifted1360) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - array1362.push(@types.UnionBranch::{ - tag: result1339, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted1348, - metadata: @types.MetadataEnvelope::{ - doc: lifted1350, - aliases: array1352, - examples: array1355, - deprecated: lifted1358, - role: lifted1361, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array1362, - }) - } - 32 => { - let lifted1365 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1364 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1364) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted1365, - }) - } - 33 => { - let lifted1367 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1366 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1366) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted1367, - }) - } - 34 => { - let lifted1368 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted1368) - } - 35 => { - let lifted1369 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted1369) - } - _ => panic() - } + Option::Some(lifted1537) + } + _ => panic() + } - let lifted1372 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result1371 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result1371) - } - _ => panic() - } + let lifted1540 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - let array1374 : Array[String] = [] - for index1375 = 0 - index1375 < mbt_ffi_load32(iter_base + 104) - index1375 = index1375 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index1375 * 8 + let lifted1539 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let result1373 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - array1374.push(result1373) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - let array1377 : Array[String] = [] - for index1378 = 0 - index1378 < mbt_ffi_load32(iter_base + 112) - index1378 = index1378 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index1378 * 8 + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let result1376 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(lifted1539) + } + _ => panic() + } - array1377.push(result1376) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted1380 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result1379 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result1379) - } - _ => panic() - } + let lifted1542 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let lifted1383 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted1382 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1381 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result1381) - } - _ => panic() - } + let result1541 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - Option::Some(lifted1382) - } - _ => panic() - } + Option::Some(result1541) + } + _ => panic() + } - array1384.push(@types.SchemaTypeNode::{ - body: lifted1370, - metadata: @types.MetadataEnvelope::{ - doc: lifted1372, - aliases: array1374, - examples: array1377, - deprecated: lifted1380, - role: lifted1383, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array1389 : Array[@types.SchemaTypeDef] = [] - for index1390 = 0 - index1390 < mbt_ffi_load32(iter_base + 48) - index1390 = index1390 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + - index1390 * 24 - - let result1386 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1388 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1387 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1387) - } - _ => panic() - } + Option::Some(@types.NumericRestrictions::{min : lifted1538, max : lifted1540, unit : lifted1542}) + } + _ => panic() + } - array1389.push(@types.SchemaTypeDef::{ - id: result1386, - name: lifted1388, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - let array1420 : Array[@types.SchemaValueNode] = [] - for index1421 = 0 - index1421 < mbt_ffi_load32(iter_base + 60) - index1421 = index1421 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1421 * 32 - - let lifted1419 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result1391 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result1391) - } - 13 => { - let array1392 : Array[Int] = [] - for index1393 = 0 - index1393 < mbt_ffi_load32(iter_base + 12) - index1393 = index1393 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1393 * 4 - - array1392.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array1392) - } - 14 => { - let lifted1394 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted1394, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1395 : Array[Bool] = [] - for index1396 = 0 - index1396 < mbt_ffi_load32(iter_base + 12) - index1396 = index1396 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1396 * 1 - - array1395.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1395) - } - 17 => { - let array1397 : Array[Int] = [] - for index1398 = 0 - index1398 < mbt_ffi_load32(iter_base + 12) - index1398 = index1398 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1398 * 4 - - array1397.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array1397) - } - 18 => { - let array1399 : Array[Int] = [] - for index1400 = 0 - index1400 < mbt_ffi_load32(iter_base + 12) - index1400 = index1400 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1400 * 4 - - array1399.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array1399) - } - 19 => { - let array1401 : Array[Int] = [] - for index1402 = 0 - index1402 < mbt_ffi_load32(iter_base + 12) - index1402 = index1402 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1402 * 4 - - array1401.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array1401) - } - 20 => { - let array1403 : Array[@types.MapEntry] = [] - for index1404 = 0 - index1404 < mbt_ffi_load32(iter_base + 12) - index1404 = index1404 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1404 * 8 - - array1403.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array1403) - } - 21 => { - let lifted1405 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted1405) - } - 22 => { - let lifted1408 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted1406 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted1406) - } - 1 => { - let lifted1407 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted1407) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted1408) - } - 23 => { - let result1409 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1411 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1410 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1410) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result1409, - language: lifted1411, - }) - } - 24 => { - let result1412 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1414 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1413 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1413) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result1412, - mime_type: lifted1414, - }) - } - 25 => { - let result1415 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result1415) - } - 26 => { - let result1416 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result1416) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result1417 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result1417, - }) - } - 30 => { - let result1418 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result1418, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @types.SchemaTypeBody::F64Type(lifted1543) + } + 12 => { - array1420.push(lifted1419) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - Option::Some(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array1384, - defs: array1389, - root: mbt_ffi_load32(iter_base + 52), - }, - value: @types.SchemaValueTree::{ - value_nodes: array1420, - root: mbt_ffi_load32(iter_base + 64), - }, - }) - } - _ => panic() - } + @types.SchemaTypeBody::CharType + } + 13 => { - PublicOplogEntry::Cancelled(CancelledParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - start_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - partial: lifted1422, - }) - } - 4 => { - let lifted1935 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => { - let result1423 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array1620 : Array[@types.SchemaTypeNode] = [] - for index1621 = 0 - index1621 < mbt_ffi_load32(iter_base + 44) - index1621 = index1621 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + - index1621 * 144 - - let lifted1606 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted1430 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1425 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1424 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::StringType + } + 14 => { - Option::Some(lifted1424) - } - _ => panic() - } - - let lifted1427 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1426 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1558 : Array[@types.NamedFieldType] = []; + for index1559 = 0; index1559 < (mbt_ffi_load32((iter_base) + 12)); index1559 = index1559 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1559 * 68) - Option::Some(lifted1426) - } - _ => panic() - } - - let lifted1429 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1428 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1428) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1425, - max: lifted1427, - unit: lifted1429, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted1430) - } - 3 => { - let lifted1437 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1432 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1431 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1544 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1431) - } - _ => panic() - } - - let lifted1434 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1433 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1546 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted1433) - } - _ => panic() - } - - let lifted1436 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1435 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1435) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1432, - max: lifted1434, - unit: lifted1436, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted1437) - } - 4 => { - let lifted1444 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1439 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1438 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1545 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted1438) - } - _ => panic() - } - - let lifted1441 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1440 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1545) + } + _ => panic() + } - Option::Some(lifted1440) - } - _ => panic() - } - - let lifted1443 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1442 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1442) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1439, - max: lifted1441, - unit: lifted1443, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted1444) - } - 5 => { - let lifted1451 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1446 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1445 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1548 : Array[String] = []; + for index1549 = 0; index1549 < (mbt_ffi_load32((iter_base) + 28)); index1549 = index1549 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1549 * 8) - Option::Some(lifted1445) - } - _ => panic() - } - - let lifted1448 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1447 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1547 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1447) - } - _ => panic() - } - - let lifted1450 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1449 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1449) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1446, - max: lifted1448, - unit: lifted1450, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted1451) - } - 6 => { - let lifted1458 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1453 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1452 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array1548.push(result1547) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - Option::Some(lifted1452) - } - _ => panic() - } - - let lifted1455 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1454 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1551 : Array[String] = []; + for index1552 = 0; index1552 < (mbt_ffi_load32((iter_base) + 36)); index1552 = index1552 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1552 * 8) - Option::Some(lifted1454) - } - _ => panic() - } - - let lifted1457 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1456 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1456) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1453, - max: lifted1455, - unit: lifted1457, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted1458) - } - 7 => { - let lifted1465 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1460 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1459 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1550 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1459) - } - _ => panic() - } - - let lifted1462 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1461 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1551.push(result1550) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - Option::Some(lifted1461) - } - _ => panic() - } - - let lifted1464 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1463 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1463) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1460, - max: lifted1462, - unit: lifted1464, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1465) - } - 8 => { - let lifted1472 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1467 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1466 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1554 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - Option::Some(lifted1466) - } - _ => panic() - } - - let lifted1469 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1468 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1553 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - Option::Some(lifted1468) - } - _ => panic() - } - - let lifted1471 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1470 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1470) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1467, - max: lifted1469, - unit: lifted1471, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1472) - } - 9 => { - let lifted1479 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1474 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1473 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1553) + } + _ => panic() + } - Option::Some(lifted1473) - } - _ => panic() - } - - let lifted1476 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1475 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1557 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { - Option::Some(lifted1475) - } - _ => panic() - } - - let lifted1478 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1477 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1477) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1474, - max: lifted1476, - unit: lifted1478, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1479) - } - 10 => { - let lifted1486 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1481 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1480 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1556 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { - Option::Some(lifted1480) - } - _ => panic() - } - - let lifted1483 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1482 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - Option::Some(lifted1482) - } - _ => panic() - } - - let lifted1485 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1484 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1484) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1481, - max: lifted1483, - unit: lifted1485, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1486) - } - 11 => { - let lifted1493 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1488 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1487 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - Option::Some(lifted1487) - } - _ => panic() - } - - let lifted1490 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1489 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - Option::Some(lifted1489) - } - _ => panic() - } - - let lifted1492 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1491 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1491) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1488, - max: lifted1490, - unit: lifted1492, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted1493) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array1508 : Array[@types.NamedFieldType] = [] - for index1509 = 0 - index1509 < mbt_ffi_load32(iter_base + 12) - index1509 = index1509 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1509 * 68 - - let result1494 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1496 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1495 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1495) - } - _ => panic() - } + let result1555 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - let array1498 : Array[String] = [] - for index1499 = 0 - index1499 < mbt_ffi_load32(iter_base + 28) - index1499 = index1499 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1499 * 8 + @types.Role::Other(result1555) + } + _ => panic() + } - let result1497 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(lifted1556) + } + _ => panic() + } - array1498.push(result1497) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + array1558.push(@types.NamedFieldType::{name : result1544, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted1546, aliases : array1548, examples : array1551, deprecated : lifted1554, role : lifted1557}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array1501 : Array[String] = [] - for index1502 = 0 - index1502 < mbt_ffi_load32(iter_base + 36) - index1502 = index1502 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1502 * 8 + @types.SchemaTypeBody::RecordType(array1558) + } + 15 => { - let result1500 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array1575 : Array[@types.VariantCaseType] = []; + for index1576 = 0; index1576 < (mbt_ffi_load32((iter_base) + 12)); index1576 = index1576 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1576 * 72) - array1501.push(result1500) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted1504 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result1503 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result1503) - } - _ => panic() - } + let result1560 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted1507 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted1506 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1505 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + let lifted1561 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.Role::Other(result1505) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted1506) - } - _ => panic() - } + let lifted1563 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - array1508.push(@types.NamedFieldType::{ - name: result1494, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted1496, - aliases: array1498, - examples: array1501, - deprecated: lifted1504, - role: lifted1507, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array1508) - } - 15 => { - let array1525 : Array[@types.VariantCaseType] = [] - for index1526 = 0 - index1526 < mbt_ffi_load32(iter_base + 12) - index1526 = index1526 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1526 * 72 - - let result1510 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1511 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result1562 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted1513 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1512 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1512) - } - _ => panic() - } + Option::Some(result1562) + } + _ => panic() + } - let array1515 : Array[String] = [] - for index1516 = 0 - index1516 < mbt_ffi_load32(iter_base + 32) - index1516 = index1516 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1516 * 8 + let array1565 : Array[String] = []; + for index1566 = 0; index1566 < (mbt_ffi_load32((iter_base) + 32)); index1566 = index1566 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1566 * 8) - let result1514 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1564 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array1515.push(result1514) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + array1565.push(result1564) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let array1518 : Array[String] = [] - for index1519 = 0 - index1519 < mbt_ffi_load32(iter_base + 40) - index1519 = index1519 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1519 * 8 + let array1568 : Array[String] = []; + for index1569 = 0; index1569 < (mbt_ffi_load32((iter_base) + 40)); index1569 = index1569 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1569 * 8) - let result1517 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1567 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array1518.push(result1517) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted1521 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result1520 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result1520) - } - _ => panic() - } + array1568.push(result1567) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - let lifted1524 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted1523 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1522 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let lifted1571 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { - @types.Role::Other(result1522) - } - _ => panic() - } + let result1570 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - Option::Some(lifted1523) - } - _ => panic() - } + Option::Some(result1570) + } + _ => panic() + } - array1525.push(@types.VariantCaseType::{ - name: result1510, - payload: lifted1511, - metadata: @types.MetadataEnvelope::{ - doc: lifted1513, - aliases: array1515, - examples: array1518, - deprecated: lifted1521, - role: lifted1524, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array1525) - } - 16 => { - let array1528 : Array[String] = [] - for index1529 = 0 - index1529 < mbt_ffi_load32(iter_base + 12) - index1529 = index1529 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1529 * 8 - - let result1527 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1528.push(result1527) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array1528) - } - 17 => { - let array1531 : Array[String] = [] - for index1532 = 0 - index1532 < mbt_ffi_load32(iter_base + 12) - index1532 = index1532 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1532 * 8 - - let result1530 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1531.push(result1530) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array1531) - } - 18 => { - let array1533 : Array[Int] = [] - for index1534 = 0 - index1534 < mbt_ffi_load32(iter_base + 12) - index1534 = index1534 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1534 * 4 - - array1533.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array1533) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted1535 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted1536 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted1535, - err: lifted1536, - }) - } - 24 => { - let lifted1540 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1538 : Array[String] = [] - for index1539 = 0 - index1539 < mbt_ffi_load32(iter_base + 16) - index1539 = index1539 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1539 * 8 - - let result1537 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1538.push(result1537) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1538) - } - _ => panic() - } - - let lifted1541 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1542 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1544 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1543 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1543) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted1540, - min_length: lifted1541, - max_length: lifted1542, - regex: lifted1544, - }) - } - 25 => { - let lifted1548 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1546 : Array[String] = [] - for index1547 = 0 - index1547 < mbt_ffi_load32(iter_base + 16) - index1547 = index1547 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1547 * 8 - - let result1545 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1546.push(result1545) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1546) - } - _ => panic() - } - - let lifted1549 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1550 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted1548, - min_bytes: lifted1549, - max_bytes: lifted1550, - }) - } - 26 => { - let lifted1554 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array1552 : Array[String] = [] - for index1553 = 0 - index1553 < mbt_ffi_load32(iter_base + 20) - index1553 = index1553 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1553 * 8 - - let result1551 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1552.push(result1551) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array1552) - } - _ => panic() - } - - let lifted1558 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array1556 : Array[String] = [] - for index1557 = 0 - index1557 < mbt_ffi_load32(iter_base + 32) - index1557 = index1557 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1557 * 8 - - let result1555 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1556.push(result1555) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array1556) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted1554, - allowed_extensions: lifted1558, - }) - } - 27 => { - let lifted1562 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1560 : Array[String] = [] - for index1561 = 0 - index1561 < mbt_ffi_load32(iter_base + 16) - index1561 = index1561 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1561 * 8 - - let result1559 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1560.push(result1559) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1560) - } - _ => panic() - } - - let lifted1566 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array1564 : Array[String] = [] - for index1565 = 0 - index1565 < mbt_ffi_load32(iter_base + 28) - index1565 = index1565 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1565 * 8 - - let result1563 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1564.push(result1563) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array1564) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted1562, - allowed_hosts: lifted1566, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result1567 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array1569 : Array[String] = [] - for index1570 = 0 - index1570 < mbt_ffi_load32(iter_base + 20) - index1570 = index1570 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1570 * 8 - - let result1568 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1569.push(result1568) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted1572 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1571 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result1571, - }) - } - _ => panic() - } - - let lifted1574 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result1573 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result1573, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result1567, - allowed_suffixes: array1569, - min: lifted1572, - max: lifted1574, - }) - } - 31 => { - let array1598 : Array[@types.UnionBranch] = [] - for index1599 = 0 - index1599 < mbt_ffi_load32(iter_base + 12) - index1599 = index1599 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1599 * 92 - - let result1575 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1584 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result1576 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result1576) - } - 1 => { - let result1577 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result1577) - } - 2 => { - let result1578 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result1578) - } - 3 => { - let result1579 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result1579) - } - 4 => { - let result1580 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted1582 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1581 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let lifted1574 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - Option::Some(result1581) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result1580, - literal: lifted1582, - }) - } - 5 => { - let result1583 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result1583) - } - _ => panic() - } + let lifted1573 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { - let lifted1586 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1585 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1585) - } - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - let array1588 : Array[String] = [] - for index1589 = 0 - index1589 < mbt_ffi_load32(iter_base + 52) - index1589 = index1589 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1589 * 8 + @types.Role::UnstructuredText + } + 2 => { - let result1587 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.Role::UnstructuredBinary + } + 3 => { - array1588.push(result1587) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let result1572 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) - let array1591 : Array[String] = [] - for index1592 = 0 - index1592 < mbt_ffi_load32(iter_base + 60) - index1592 = index1592 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1592 * 8 + @types.Role::Other(result1572) + } + _ => panic() + } - let result1590 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(lifted1573) + } + _ => panic() + } - array1591.push(result1590) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted1594 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1593 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1593) - } - _ => panic() - } + array1575.push(@types.VariantCaseType::{name : result1560, payload : lifted1561, metadata : @types.MetadataEnvelope::{doc : lifted1563, aliases : array1565, examples : array1568, deprecated : lifted1571, role : lifted1574}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted1597 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted1596 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1595 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @types.SchemaTypeBody::VariantType(array1575) + } + 16 => { - @types.Role::Other(result1595) - } - _ => panic() - } + let array1578 : Array[String] = []; + for index1579 = 0; index1579 < (mbt_ffi_load32((iter_base) + 12)); index1579 = index1579 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1579 * 8) - Option::Some(lifted1596) - } - _ => panic() - } + let result1577 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array1598.push(@types.UnionBranch::{ - tag: result1575, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted1584, - metadata: @types.MetadataEnvelope::{ - doc: lifted1586, - aliases: array1588, - examples: array1591, - deprecated: lifted1594, - role: lifted1597, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array1598, - }) - } - 32 => { - let lifted1601 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1600 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1600) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted1601, - }) - } - 33 => { - let lifted1603 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1602 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1602) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted1603, - }) - } - 34 => { - let lifted1604 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted1604) - } - 35 => { - let lifted1605 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted1605) - } - _ => panic() - } + array1578.push(result1577) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted1608 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result1607 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result1607) - } - _ => panic() - } + @types.SchemaTypeBody::EnumType(array1578) + } + 17 => { - let array1610 : Array[String] = [] - for index1611 = 0 - index1611 < mbt_ffi_load32(iter_base + 104) - index1611 = index1611 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index1611 * 8 + let array1581 : Array[String] = []; + for index1582 = 0; index1582 < (mbt_ffi_load32((iter_base) + 12)); index1582 = index1582 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1582 * 8) - let result1609 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1580 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array1610.push(result1609) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + array1581.push(result1580) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array1613 : Array[String] = [] - for index1614 = 0 - index1614 < mbt_ffi_load32(iter_base + 112) - index1614 = index1614 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index1614 * 8 + @types.SchemaTypeBody::FlagsType(array1581) + } + 18 => { - let result1612 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array1583 : Array[Int] = []; + for index1584 = 0; index1584 < (mbt_ffi_load32((iter_base) + 12)); index1584 = index1584 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1584 * 4) - array1613.push(result1612) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted1616 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result1615 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result1615) - } - _ => panic() - } + array1583.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted1619 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted1618 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1617 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result1617) - } - _ => panic() - } + @types.SchemaTypeBody::TupleType(array1583) + } + 19 => { - Option::Some(lifted1618) - } - _ => panic() - } + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { - array1620.push(@types.SchemaTypeNode::{ - body: lifted1606, - metadata: @types.MetadataEnvelope::{ - doc: lifted1608, - aliases: array1610, - examples: array1613, - deprecated: lifted1616, - role: lifted1619, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let array1625 : Array[@types.SchemaTypeDef] = [] - for index1626 = 0 - index1626 < mbt_ffi_load32(iter_base + 52) - index1626 = index1626 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1626 * 24 - - let result1622 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1624 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1623 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1623) - } - _ => panic() - } + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { - array1625.push(@types.SchemaTypeDef::{ - id: result1622, - name: lifted1624, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array1656 : Array[@types.SchemaValueNode] = [] - for index1657 = 0 - index1657 < mbt_ffi_load32(iter_base + 64) - index1657 = index1657 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + - index1657 * 32 - - let lifted1655 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result1627 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result1627) - } - 13 => { - let array1628 : Array[Int] = [] - for index1629 = 0 - index1629 < mbt_ffi_load32(iter_base + 12) - index1629 = index1629 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1629 * 4 - - array1628.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array1628) - } - 14 => { - let lifted1630 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted1630, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1631 : Array[Bool] = [] - for index1632 = 0 - index1632 < mbt_ffi_load32(iter_base + 12) - index1632 = index1632 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1632 * 1 - - array1631.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1631) - } - 17 => { - let array1633 : Array[Int] = [] - for index1634 = 0 - index1634 < mbt_ffi_load32(iter_base + 12) - index1634 = index1634 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1634 * 4 - - array1633.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array1633) - } - 18 => { - let array1635 : Array[Int] = [] - for index1636 = 0 - index1636 < mbt_ffi_load32(iter_base + 12) - index1636 = index1636 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1636 * 4 - - array1635.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array1635) - } - 19 => { - let array1637 : Array[Int] = [] - for index1638 = 0 - index1638 < mbt_ffi_load32(iter_base + 12) - index1638 = index1638 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1638 * 4 - - array1637.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array1637) - } - 20 => { - let array1639 : Array[@types.MapEntry] = [] - for index1640 = 0 - index1640 < mbt_ffi_load32(iter_base + 12) - index1640 = index1640 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1640 * 8 - - array1639.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array1639) - } - 21 => { - let lifted1641 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted1641) - } - 22 => { - let lifted1644 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted1642 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted1642) - } - 1 => { - let lifted1643 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted1643) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted1644) - } - 23 => { - let result1645 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1647 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1646 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1646) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result1645, - language: lifted1647, - }) - } - 24 => { - let result1648 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1650 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1649 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1649) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result1648, - mime_type: lifted1650, - }) - } - 25 => { - let result1651 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result1651) - } - 26 => { - let result1652 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result1652) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result1653 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result1653, - }) - } - 30 => { - let result1654 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result1654, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { - array1656.push(lifted1655) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - let result1658 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 72), - mbt_ffi_load32(iter_base + 76), - ) - - let array1660 : Array[String] = [] - for index1661 = 0 - index1661 < mbt_ffi_load32(iter_base + 84) - index1661 = index1661 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 80) + index1661 * 8 - - let result1659 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1660.push(result1659) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 80)) - - let array1675 : Array[Array[SpanData]] = [] - for index1676 = 0 - index1676 < mbt_ffi_load32(iter_base + 92) - index1676 = index1676 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 88) + index1676 * 8 - - let array1673 : Array[SpanData] = [] - for index1674 = 0 - index1674 < mbt_ffi_load32(iter_base + 4) - index1674 = index1674 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index1674 * 80 - - let lifted1672 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result1662 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1664 : String? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result1663 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result1663) - } - _ => panic() - } + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { - let lifted1665 : UInt64? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1585 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let array1669 : Array[@context.Attribute] = [] - for index1670 = 0 - index1670 < mbt_ffi_load32(iter_base + 68) - index1670 = index1670 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index1670 * 20 - - let result1666 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1668 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result1667 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result1667) - } - _ => panic() - } - - array1669.push(@context.Attribute::{ - key: result1666, - value: lifted1668, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - SpanData::LocalSpan(LocalSpanData::{ - span_id: result1662, - start: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent: lifted1664, - linked_context: lifted1665, - attributes: array1669, - inherited: mbt_ffi_load8_u(iter_base + 72) != 0, - }) - } - 1 => { - let result1671 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - SpanData::ExternalSpan(ExternalSpanData::{ - span_id: result1671, - }) - } - _ => panic() - } - - array1673.push(lifted1672) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array1675.push(array1673) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - - AgentInvocation::AgentInitialization(AgentInitializationParameters::{ - idempotency_key: result1423, - constructor_parameters: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array1620, - defs: array1625, - root: mbt_ffi_load32(iter_base + 56), - }, - value: @types.SchemaValueTree::{ - value_nodes: array1656, - root: mbt_ffi_load32(iter_base + 68), - }, - }, - trace_id: result1658, - trace_states: array1660, - invocation_context: array1675, - }) - } - 1 => { - let result1677 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result1678 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let array1875 : Array[@types.SchemaTypeNode] = [] - for index1876 = 0 - index1876 < mbt_ffi_load32(iter_base + 52) - index1876 = index1876 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1876 * 144 - - let lifted1861 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted1685 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1680 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1679 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted1679) - } - _ => panic() - } - - let lifted1682 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1681 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1586 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted1681) - } - _ => panic() - } - - let lifted1684 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1683 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1683) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1680, - max: lifted1682, - unit: lifted1684, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted1685) - } - 3 => { - let lifted1692 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1687 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1686 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } - Option::Some(lifted1686) - } - _ => panic() - } - - let lifted1689 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1688 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted1585, err : lifted1586}) + } + 24 => { - Option::Some(lifted1688) - } - _ => panic() - } - - let lifted1691 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1690 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1690) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1687, - max: lifted1689, - unit: lifted1691, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted1692) - } - 4 => { - let lifted1699 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1694 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1693 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1590 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted1693) - } - _ => panic() - } - - let lifted1696 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1695 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1588 : Array[String] = []; + for index1589 = 0; index1589 < (mbt_ffi_load32((iter_base) + 16)); index1589 = index1589 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1589 * 8) - Option::Some(lifted1695) - } - _ => panic() - } - - let lifted1698 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1697 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1697) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1694, - max: lifted1696, - unit: lifted1698, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted1699) - } - 5 => { - let lifted1706 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1701 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1700 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1587 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1700) - } - _ => panic() - } - - let lifted1703 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1702 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1588.push(result1587) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1702) - } - _ => panic() - } - - let lifted1705 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1704 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1704) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1701, - max: lifted1703, - unit: lifted1705, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted1706) - } - 6 => { - let lifted1713 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1708 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1707 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(array1588) + } + _ => panic() + } - Option::Some(lifted1707) - } - _ => panic() - } - - let lifted1710 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1709 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1591 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - Option::Some(lifted1709) - } - _ => panic() - } - - let lifted1712 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1711 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1711) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1708, - max: lifted1710, - unit: lifted1712, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted1713) - } - 7 => { - let lifted1720 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1715 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1714 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - Option::Some(lifted1714) - } - _ => panic() - } - - let lifted1717 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1716 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1592 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - Option::Some(lifted1716) - } - _ => panic() - } - - let lifted1719 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1718 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1718) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1715, - max: lifted1717, - unit: lifted1719, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1720) - } - 8 => { - let lifted1727 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1722 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1721 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - Option::Some(lifted1721) - } - _ => panic() - } - - let lifted1724 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1723 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1594 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - Option::Some(lifted1723) - } - _ => panic() - } - - let lifted1726 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1725 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1725) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1722, - max: lifted1724, - unit: lifted1726, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1727) - } - 9 => { - let lifted1734 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1729 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1728 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1593 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted1728) - } - _ => panic() - } - - let lifted1731 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1730 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1593) + } + _ => panic() + } - Option::Some(lifted1730) - } - _ => panic() - } - - let lifted1733 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1732 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1732) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1729, - max: lifted1731, - unit: lifted1733, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1734) - } - 10 => { - let lifted1741 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1736 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1735 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted1590, min_length : lifted1591, max_length : lifted1592, regex : lifted1594}) + } + 25 => { - Option::Some(lifted1735) - } - _ => panic() - } - - let lifted1738 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1737 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1598 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted1737) - } - _ => panic() - } - - let lifted1740 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1739 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1739) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1736, - max: lifted1738, - unit: lifted1740, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1741) - } - 11 => { - let lifted1748 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1743 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1742 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1596 : Array[String] = []; + for index1597 = 0; index1597 < (mbt_ffi_load32((iter_base) + 16)); index1597 = index1597 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1597 * 8) - Option::Some(lifted1742) - } - _ => panic() - } - - let lifted1745 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1744 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1595 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1744) - } - _ => panic() - } - - let lifted1747 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1746 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1746) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1743, - max: lifted1745, - unit: lifted1747, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted1748) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array1763 : Array[@types.NamedFieldType] = [] - for index1764 = 0 - index1764 < mbt_ffi_load32(iter_base + 12) - index1764 = index1764 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1764 * 68 - - let result1749 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1751 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1750 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1750) - } - _ => panic() - } + array1596.push(result1595) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let array1753 : Array[String] = [] - for index1754 = 0 - index1754 < mbt_ffi_load32(iter_base + 28) - index1754 = index1754 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1754 * 8 + Option::Some(array1596) + } + _ => panic() + } - let result1752 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1599 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - array1753.push(result1752) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - let array1756 : Array[String] = [] - for index1757 = 0 - index1757 < mbt_ffi_load32(iter_base + 36) - index1757 = index1757 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1757 * 8 + let lifted1600 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - let result1755 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - array1756.push(result1755) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted1759 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result1758 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result1758) - } - _ => panic() - } + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted1598, min_bytes : lifted1599, max_bytes : lifted1600}) + } + 26 => { - let lifted1762 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted1761 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1760 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + let lifted1604 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.Role::Other(result1760) - } - _ => panic() - } + let array1602 : Array[String] = []; + for index1603 = 0; index1603 < (mbt_ffi_load32((iter_base) + 20)); index1603 = index1603 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1603 * 8) - Option::Some(lifted1761) - } - _ => panic() - } + let result1601 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array1763.push(@types.NamedFieldType::{ - name: result1749, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted1751, - aliases: array1753, - examples: array1756, - deprecated: lifted1759, - role: lifted1762, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array1763) - } - 15 => { - let array1780 : Array[@types.VariantCaseType] = [] - for index1781 = 0 - index1781 < mbt_ffi_load32(iter_base + 12) - index1781 = index1781 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1781 * 72 - - let result1765 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1766 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + array1602.push(result1601) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let lifted1768 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1767 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1767) - } - _ => panic() - } + Option::Some(array1602) + } + _ => panic() + } - let array1770 : Array[String] = [] - for index1771 = 0 - index1771 < mbt_ffi_load32(iter_base + 32) - index1771 = index1771 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1771 * 8 + let lifted1608 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let result1769 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array1606 : Array[String] = []; + for index1607 = 0; index1607 < (mbt_ffi_load32((iter_base) + 32)); index1607 = index1607 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1607 * 8) - array1770.push(result1769) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let result1605 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array1773 : Array[String] = [] - for index1774 = 0 - index1774 < mbt_ffi_load32(iter_base + 40) - index1774 = index1774 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1774 * 8 + array1606.push(result1605) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let result1772 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(array1606) + } + _ => panic() + } - array1773.push(result1772) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted1776 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result1775 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result1775) - } - _ => panic() - } + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted1604, allowed_extensions : lifted1608}) + } + 27 => { - let lifted1779 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted1778 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1777 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let lifted1612 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.Role::Other(result1777) - } - _ => panic() - } + let array1610 : Array[String] = []; + for index1611 = 0; index1611 < (mbt_ffi_load32((iter_base) + 16)); index1611 = index1611 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1611 * 8) - Option::Some(lifted1778) - } - _ => panic() - } + let result1609 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array1780.push(@types.VariantCaseType::{ - name: result1765, - payload: lifted1766, - metadata: @types.MetadataEnvelope::{ - doc: lifted1768, - aliases: array1770, - examples: array1773, - deprecated: lifted1776, - role: lifted1779, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array1780) - } - 16 => { - let array1783 : Array[String] = [] - for index1784 = 0 - index1784 < mbt_ffi_load32(iter_base + 12) - index1784 = index1784 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1784 * 8 - - let result1782 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1783.push(result1782) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array1783) - } - 17 => { - let array1786 : Array[String] = [] - for index1787 = 0 - index1787 < mbt_ffi_load32(iter_base + 12) - index1787 = index1787 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1787 * 8 - - let result1785 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1786.push(result1785) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array1786) - } - 18 => { - let array1788 : Array[Int] = [] - for index1789 = 0 - index1789 < mbt_ffi_load32(iter_base + 12) - index1789 = index1789 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1789 * 4 - - array1788.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array1788) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted1790 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted1791 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted1790, - err: lifted1791, - }) - } - 24 => { - let lifted1795 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1793 : Array[String] = [] - for index1794 = 0 - index1794 < mbt_ffi_load32(iter_base + 16) - index1794 = index1794 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1794 * 8 - - let result1792 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1793.push(result1792) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1793) - } - _ => panic() - } - - let lifted1796 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1797 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1799 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1798 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1798) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted1795, - min_length: lifted1796, - max_length: lifted1797, - regex: lifted1799, - }) - } - 25 => { - let lifted1803 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1801 : Array[String] = [] - for index1802 = 0 - index1802 < mbt_ffi_load32(iter_base + 16) - index1802 = index1802 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1802 * 8 - - let result1800 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1801.push(result1800) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1801) - } - _ => panic() - } - - let lifted1804 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1805 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted1803, - min_bytes: lifted1804, - max_bytes: lifted1805, - }) - } - 26 => { - let lifted1809 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array1807 : Array[String] = [] - for index1808 = 0 - index1808 < mbt_ffi_load32(iter_base + 20) - index1808 = index1808 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1808 * 8 - - let result1806 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1807.push(result1806) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array1807) - } - _ => panic() - } - - let lifted1813 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array1811 : Array[String] = [] - for index1812 = 0 - index1812 < mbt_ffi_load32(iter_base + 32) - index1812 = index1812 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1812 * 8 - - let result1810 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1811.push(result1810) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array1811) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted1809, - allowed_extensions: lifted1813, - }) - } - 27 => { - let lifted1817 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1815 : Array[String] = [] - for index1816 = 0 - index1816 < mbt_ffi_load32(iter_base + 16) - index1816 = index1816 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1816 * 8 - - let result1814 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1815.push(result1814) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1815) - } - _ => panic() - } - - let lifted1821 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array1819 : Array[String] = [] - for index1820 = 0 - index1820 < mbt_ffi_load32(iter_base + 28) - index1820 = index1820 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1820 * 8 - - let result1818 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1819.push(result1818) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array1819) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted1817, - allowed_hosts: lifted1821, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result1822 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array1824 : Array[String] = [] - for index1825 = 0 - index1825 < mbt_ffi_load32(iter_base + 20) - index1825 = index1825 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1825 * 8 - - let result1823 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1824.push(result1823) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted1827 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1826 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result1826, - }) - } - _ => panic() - } - - let lifted1829 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result1828 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result1828, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result1822, - allowed_suffixes: array1824, - min: lifted1827, - max: lifted1829, - }) - } - 31 => { - let array1853 : Array[@types.UnionBranch] = [] - for index1854 = 0 - index1854 < mbt_ffi_load32(iter_base + 12) - index1854 = index1854 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1854 * 92 - - let result1830 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1839 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result1831 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result1831) - } - 1 => { - let result1832 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result1832) - } - 2 => { - let result1833 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result1833) - } - 3 => { - let result1834 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result1834) - } - 4 => { - let result1835 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted1837 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1836 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + array1610.push(result1609) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - Option::Some(result1836) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result1835, - literal: lifted1837, - }) - } - 5 => { - let result1838 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result1838) - } - _ => panic() - } + Option::Some(array1610) + } + _ => panic() + } - let lifted1841 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1840 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1840) - } - _ => panic() - } + let lifted1616 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - let array1843 : Array[String] = [] - for index1844 = 0 - index1844 < mbt_ffi_load32(iter_base + 52) - index1844 = index1844 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1844 * 8 + let array1614 : Array[String] = []; + for index1615 = 0; index1615 < (mbt_ffi_load32((iter_base) + 28)); index1615 = index1615 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1615 * 8) - let result1842 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1613 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array1843.push(result1842) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + array1614.push(result1613) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - let array1846 : Array[String] = [] - for index1847 = 0 - index1847 < mbt_ffi_load32(iter_base + 60) - index1847 = index1847 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1847 * 8 + Option::Some(array1614) + } + _ => panic() + } - let result1845 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted1612, allowed_hosts : lifted1616}) + } + 28 => { - array1846.push(result1845) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted1849 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1848 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1848) - } - _ => panic() - } + @types.SchemaTypeBody::DatetimeType + } + 29 => { - let lifted1852 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted1851 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1850 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @types.SchemaTypeBody::DurationType + } + 30 => { - @types.Role::Other(result1850) - } - _ => panic() - } + let result1617 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1851) - } - _ => panic() - } + let array1619 : Array[String] = []; + for index1620 = 0; index1620 < (mbt_ffi_load32((iter_base) + 20)); index1620 = index1620 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1620 * 8) + + let result1618 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array1853.push(@types.UnionBranch::{ - tag: result1830, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted1839, - metadata: @types.MetadataEnvelope::{ - doc: lifted1841, - aliases: array1843, - examples: array1846, - deprecated: lifted1849, - role: lifted1852, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array1853, - }) - } - 32 => { - let lifted1856 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1855 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1855) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted1856, - }) - } - 33 => { - let lifted1858 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1857 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1857) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted1858, - }) - } - 34 => { - let lifted1859 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted1859) - } - 35 => { - let lifted1860 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted1860) - } - _ => panic() - } + array1619.push(result1618) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let lifted1863 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result1862 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result1862) - } - _ => panic() - } + let lifted1622 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let array1865 : Array[String] = [] - for index1866 = 0 - index1866 < mbt_ffi_load32(iter_base + 104) - index1866 = index1866 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index1866 * 8 + let result1621 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - let result1864 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result1621}) + } + _ => panic() + } - array1865.push(result1864) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let lifted1624 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - let array1868 : Array[String] = [] - for index1869 = 0 - index1869 < mbt_ffi_load32(iter_base + 112) - index1869 = index1869 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index1869 * 8 + let result1623 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - let result1867 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result1623}) + } + _ => panic() + } - array1868.push(result1867) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted1871 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result1870 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result1870) - } - _ => panic() - } + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result1617, allowed_suffixes : array1619, min : lifted1622, max : lifted1624}) + } + 31 => { - let lifted1874 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted1873 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1872 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result1872) - } - _ => panic() - } + let array1648 : Array[@types.UnionBranch] = []; + for index1649 = 0; index1649 < (mbt_ffi_load32((iter_base) + 12)); index1649 = index1649 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1649 * 92) - Option::Some(lifted1873) - } - _ => panic() - } + let result1625 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array1875.push(@types.SchemaTypeNode::{ - body: lifted1861, - metadata: @types.MetadataEnvelope::{ - doc: lifted1863, - aliases: array1865, - examples: array1868, - deprecated: lifted1871, - role: lifted1874, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array1880 : Array[@types.SchemaTypeDef] = [] - for index1881 = 0 - index1881 < mbt_ffi_load32(iter_base + 60) - index1881 = index1881 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1881 * 24 - - let result1877 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1879 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1878 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1878) - } - _ => panic() - } + let lifted1634 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { - array1880.push(@types.SchemaTypeDef::{ - id: result1877, - name: lifted1879, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let array1911 : Array[@types.SchemaValueNode] = [] - for index1912 = 0 - index1912 < mbt_ffi_load32(iter_base + 72) - index1912 = index1912 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + - index1912 * 32 - - let lifted1910 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result1882 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result1882) - } - 13 => { - let array1883 : Array[Int] = [] - for index1884 = 0 - index1884 < mbt_ffi_load32(iter_base + 12) - index1884 = index1884 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1884 * 4 - - array1883.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array1883) - } - 14 => { - let lifted1885 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted1885, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1886 : Array[Bool] = [] - for index1887 = 0 - index1887 < mbt_ffi_load32(iter_base + 12) - index1887 = index1887 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1887 * 1 - - array1886.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1886) - } - 17 => { - let array1888 : Array[Int] = [] - for index1889 = 0 - index1889 < mbt_ffi_load32(iter_base + 12) - index1889 = index1889 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1889 * 4 - - array1888.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array1888) - } - 18 => { - let array1890 : Array[Int] = [] - for index1891 = 0 - index1891 < mbt_ffi_load32(iter_base + 12) - index1891 = index1891 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1891 * 4 - - array1890.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array1890) - } - 19 => { - let array1892 : Array[Int] = [] - for index1893 = 0 - index1893 < mbt_ffi_load32(iter_base + 12) - index1893 = index1893 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1893 * 4 - - array1892.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array1892) - } - 20 => { - let array1894 : Array[@types.MapEntry] = [] - for index1895 = 0 - index1895 < mbt_ffi_load32(iter_base + 12) - index1895 = index1895 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1895 * 8 - - array1894.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array1894) - } - 21 => { - let lifted1896 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted1896) - } - 22 => { - let lifted1899 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted1897 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted1897) - } - 1 => { - let lifted1898 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted1898) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted1899) - } - 23 => { - let result1900 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1902 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1901 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1901) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result1900, - language: lifted1902, - }) - } - 24 => { - let result1903 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1905 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1904 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1904) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result1903, - mime_type: lifted1905, - }) - } - 25 => { - let result1906 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result1906) - } - 26 => { - let result1907 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result1907) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result1908 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result1908, - }) - } - 30 => { - let result1909 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result1909, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + let result1626 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - array1911.push(lifted1910) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - let result1913 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 80), - mbt_ffi_load32(iter_base + 84), - ) - - let array1915 : Array[String] = [] - for index1916 = 0 - index1916 < mbt_ffi_load32(iter_base + 92) - index1916 = index1916 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 88) + index1916 * 8 - - let result1914 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1915.push(result1914) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - - let array1930 : Array[Array[SpanData]] = [] - for index1931 = 0 - index1931 < mbt_ffi_load32(iter_base + 100) - index1931 = index1931 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 96) + index1931 * 8 - - let array1928 : Array[SpanData] = [] - for index1929 = 0 - index1929 < mbt_ffi_load32(iter_base + 4) - index1929 = index1929 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index1929 * 80 - - let lifted1927 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result1917 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1919 : String? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result1918 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result1918) - } - _ => panic() - } + @types.DiscriminatorRule::Prefix(result1626) + } + 1 => { - let lifted1920 : UInt64? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1627 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let array1924 : Array[@context.Attribute] = [] - for index1925 = 0 - index1925 < mbt_ffi_load32(iter_base + 68) - index1925 = index1925 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index1925 * 20 - - let result1921 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1923 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result1922 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result1922) - } - _ => panic() - } - - array1924.push(@context.Attribute::{ - key: result1921, - value: lifted1923, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - SpanData::LocalSpan(LocalSpanData::{ - span_id: result1917, - start: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent: lifted1919, - linked_context: lifted1920, - attributes: array1924, - inherited: mbt_ffi_load8_u(iter_base + 72) != 0, - }) - } - 1 => { - let result1926 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - SpanData::ExternalSpan(ExternalSpanData::{ - span_id: result1926, - }) - } - _ => panic() - } - - array1928.push(lifted1927) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array1930.push(array1928) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 96)) - - AgentInvocation::AgentMethodInvocation(AgentMethodInvocationParameters::{ - idempotency_key: result1677, - method_name: result1678, - function_input: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array1875, - defs: array1880, - root: mbt_ffi_load32(iter_base + 64), - }, - value: @types.SchemaValueTree::{ - value_nodes: array1911, - root: mbt_ffi_load32(iter_base + 76), - }, - }, - trace_id: result1913, - trace_states: array1915, - invocation_context: array1930, - }) - } - 2 => AgentInvocation::SaveSnapshot - 3 => { - let result1932 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result1933 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - AgentInvocation::LoadSnapshot(LoadSnapshotParameters::{ - snapshot: SnapshotData::{ - data: result1932, - mime_type: result1933, - }, - }) - } - 4 => { - let result1934 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - AgentInvocation::ProcessOplogEntries(ProcessOplogEntriesParameters::{ - idempotency_key: result1934, - }) - } - 5 => - AgentInvocation::ManualUpdate(ManualUpdateParameters::{ - target_revision: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }) - _ => panic() - } + @types.DiscriminatorRule::Suffix(result1627) + } + 2 => { - PublicOplogEntry::AgentInvocationStarted(AgentInvocationStartedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - invocation: lifted1935, - }) - } - 5 => { - let lifted2410 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => { - let array2132 : Array[@types.SchemaTypeNode] = [] - for index2133 = 0 - index2133 < mbt_ffi_load32(iter_base + 32) - index2133 = index2133 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2133 * 144 - - let lifted2118 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted1942 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1937 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1936 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1628 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted1936) - } - _ => panic() - } - - let lifted1939 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1938 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.DiscriminatorRule::Contains(result1628) + } + 3 => { - Option::Some(lifted1938) - } - _ => panic() - } - - let lifted1941 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1940 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1940) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1937, - max: lifted1939, - unit: lifted1941, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted1942) - } - 3 => { - let lifted1949 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1944 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1943 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1629 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted1943) - } - _ => panic() - } - - let lifted1946 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1945 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.DiscriminatorRule::Regex(result1629) + } + 4 => { - Option::Some(lifted1945) - } - _ => panic() - } - - let lifted1948 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1947 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1947) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1944, - max: lifted1946, - unit: lifted1948, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted1949) - } - 4 => { - let lifted1956 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1951 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1950 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1630 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted1950) - } - _ => panic() - } - - let lifted1953 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1952 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1632 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - Option::Some(lifted1952) - } - _ => panic() - } - - let lifted1955 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1954 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1954) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1951, - max: lifted1953, - unit: lifted1955, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted1956) - } - 5 => { - let lifted1963 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1958 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1957 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1631 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - Option::Some(lifted1957) - } - _ => panic() - } - - let lifted1960 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1959 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1631) + } + _ => panic() + } - Option::Some(lifted1959) - } - _ => panic() - } - - let lifted1962 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1961 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1961) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1958, - max: lifted1960, - unit: lifted1962, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted1963) - } - 6 => { - let lifted1970 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1965 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1964 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result1630, literal : lifted1632}) + } + 5 => { - Option::Some(lifted1964) - } - _ => panic() - } - - let lifted1967 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1966 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1633 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted1966) - } - _ => panic() - } - - let lifted1969 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1968 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1968) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1965, - max: lifted1967, - unit: lifted1969, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted1970) - } - 7 => { - let lifted1977 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1972 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1971 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.DiscriminatorRule::FieldAbsent(result1633) + } + _ => panic() + } - Option::Some(lifted1971) - } - _ => panic() - } - - let lifted1974 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1973 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1636 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - Option::Some(lifted1973) - } - _ => panic() - } - - let lifted1976 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1975 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1975) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1972, - max: lifted1974, - unit: lifted1976, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1977) - } - 8 => { - let lifted1984 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1979 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1978 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1635 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted1978) - } - _ => panic() - } - - let lifted1981 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1980 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1635) + } + _ => panic() + } - Option::Some(lifted1980) - } - _ => panic() - } - - let lifted1983 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1982 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1982) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1979, - max: lifted1981, - unit: lifted1983, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1984) - } - 9 => { - let lifted1991 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1986 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1985 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1638 : Array[String] = []; + for index1639 = 0; index1639 < (mbt_ffi_load32((iter_base) + 52)); index1639 = index1639 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1639 * 8) - Option::Some(lifted1985) - } - _ => panic() - } - - let lifted1988 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1987 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1637 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1987) - } - _ => panic() - } - - let lifted1990 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1989 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1989) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1986, - max: lifted1988, - unit: lifted1990, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1991) - } - 10 => { - let lifted1998 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1993 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1992 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array1638.push(result1637) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - Option::Some(lifted1992) - } - _ => panic() - } - - let lifted1995 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1994 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1641 : Array[String] = []; + for index1642 = 0; index1642 < (mbt_ffi_load32((iter_base) + 60)); index1642 = index1642 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1642 * 8) - Option::Some(lifted1994) - } - _ => panic() - } - - let lifted1997 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1996 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1996) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1993, - max: lifted1995, - unit: lifted1997, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1998) - } - 11 => { - let lifted2005 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2000 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1999 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1640 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1999) - } - _ => panic() - } - - let lifted2002 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2001 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1641.push(result1640) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - Option::Some(lifted2001) - } - _ => panic() - } - - let lifted2004 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2003 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2003) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2000, - max: lifted2002, - unit: lifted2004, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted2005) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array2020 : Array[@types.NamedFieldType] = [] - for index2021 = 0 - index2021 < mbt_ffi_load32(iter_base + 12) - index2021 = index2021 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2021 * 68 - - let result2006 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2008 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2007 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2007) - } - _ => panic() - } + let lifted1644 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let array2010 : Array[String] = [] - for index2011 = 0 - index2011 < mbt_ffi_load32(iter_base + 28) - index2011 = index2011 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2011 * 8 + let result1643 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let result2009 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(result1643) + } + _ => panic() + } - array2010.push(result2009) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let lifted1647 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - let array2013 : Array[String] = [] - for index2014 = 0 - index2014 < mbt_ffi_load32(iter_base + 36) - index2014 = index2014 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index2014 * 8 + let lifted1646 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { - let result2012 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.Role::Multimodal + } + 1 => { - array2013.push(result2012) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted2016 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result2015 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result2015) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - let lifted2019 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted2018 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2017 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + @types.Role::UnstructuredBinary + } + 3 => { - @types.Role::Other(result2017) - } - _ => panic() - } + let result1645 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - Option::Some(lifted2018) - } - _ => panic() - } + @types.Role::Other(result1645) + } + _ => panic() + } - array2020.push(@types.NamedFieldType::{ - name: result2006, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted2008, - aliases: array2010, - examples: array2013, - deprecated: lifted2016, - role: lifted2019, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array2020) - } - 15 => { - let array2037 : Array[@types.VariantCaseType] = [] - for index2038 = 0 - index2038 < mbt_ffi_load32(iter_base + 12) - index2038 = index2038 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2038 * 72 - - let result2022 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2023 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + Option::Some(lifted1646) + } + _ => panic() + } - let lifted2025 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2024 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2024) - } - _ => panic() - } + array1648.push(@types.UnionBranch::{tag : result1625, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted1634, metadata : @types.MetadataEnvelope::{doc : lifted1636, aliases : array1638, examples : array1641, deprecated : lifted1644, role : lifted1647}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array2027 : Array[String] = [] - for index2028 = 0 - index2028 < mbt_ffi_load32(iter_base + 32) - index2028 = index2028 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2028 * 8 + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array1648}) + } + 32 => { - let result2026 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1651 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - array2027.push(result2026) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let result1650 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let array2030 : Array[String] = [] - for index2031 = 0 - index2031 < mbt_ffi_load32(iter_base + 40) - index2031 = index2031 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index2031 * 8 + Option::Some(result1650) + } + _ => panic() + } - let result2029 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted1651}) + } + 33 => { - array2030.push(result2029) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted2033 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result2032 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result2032) - } - _ => panic() - } + let lifted1653 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted2036 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted2035 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2034 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let result1652 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - @types.Role::Other(result2034) - } - _ => panic() - } + Option::Some(result1652) + } + _ => panic() + } - Option::Some(lifted2035) - } - _ => panic() - } + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted1653}) + } + 34 => { - array2037.push(@types.VariantCaseType::{ - name: result2022, - payload: lifted2023, - metadata: @types.MetadataEnvelope::{ - doc: lifted2025, - aliases: array2027, - examples: array2030, - deprecated: lifted2033, - role: lifted2036, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array2037) - } - 16 => { - let array2040 : Array[String] = [] - for index2041 = 0 - index2041 < mbt_ffi_load32(iter_base + 12) - index2041 = index2041 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2041 * 8 - - let result2039 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2040.push(result2039) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array2040) - } - 17 => { - let array2043 : Array[String] = [] - for index2044 = 0 - index2044 < mbt_ffi_load32(iter_base + 12) - index2044 = index2044 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2044 * 8 - - let result2042 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2043.push(result2042) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array2043) - } - 18 => { - let array2045 : Array[Int] = [] - for index2046 = 0 - index2046 < mbt_ffi_load32(iter_base + 12) - index2046 = index2046 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2046 * 4 - - array2045.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array2045) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted2047 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted2048 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted2047, - err: lifted2048, - }) - } - 24 => { - let lifted2052 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2050 : Array[String] = [] - for index2051 = 0 - index2051 < mbt_ffi_load32(iter_base + 16) - index2051 = index2051 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2051 * 8 - - let result2049 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2050.push(result2049) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2050) - } - _ => panic() - } - - let lifted2053 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2054 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2056 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2055 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2055) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted2052, - min_length: lifted2053, - max_length: lifted2054, - regex: lifted2056, - }) - } - 25 => { - let lifted2060 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2058 : Array[String] = [] - for index2059 = 0 - index2059 < mbt_ffi_load32(iter_base + 16) - index2059 = index2059 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2059 * 8 - - let result2057 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2058.push(result2057) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2058) - } - _ => panic() - } - - let lifted2061 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2062 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted2060, - min_bytes: lifted2061, - max_bytes: lifted2062, - }) - } - 26 => { - let lifted2066 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array2064 : Array[String] = [] - for index2065 = 0 - index2065 < mbt_ffi_load32(iter_base + 20) - index2065 = index2065 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2065 * 8 - - let result2063 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2064.push(result2063) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array2064) - } - _ => panic() - } - - let lifted2070 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array2068 : Array[String] = [] - for index2069 = 0 - index2069 < mbt_ffi_load32(iter_base + 32) - index2069 = index2069 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2069 * 8 - - let result2067 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2068.push(result2067) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array2068) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted2066, - allowed_extensions: lifted2070, - }) - } - 27 => { - let lifted2074 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2072 : Array[String] = [] - for index2073 = 0 - index2073 < mbt_ffi_load32(iter_base + 16) - index2073 = index2073 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2073 * 8 - - let result2071 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2072.push(result2071) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2072) - } - _ => panic() - } - - let lifted2078 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array2076 : Array[String] = [] - for index2077 = 0 - index2077 < mbt_ffi_load32(iter_base + 28) - index2077 = index2077 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2077 * 8 - - let result2075 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2076.push(result2075) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array2076) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted2074, - allowed_hosts: lifted2078, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result2079 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2081 : Array[String] = [] - for index2082 = 0 - index2082 < mbt_ffi_load32(iter_base + 20) - index2082 = index2082 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2082 * 8 - - let result2080 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2081.push(result2080) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted2084 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2083 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result2083, - }) - } - _ => panic() - } - - let lifted2086 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result2085 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result2085, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result2079, - allowed_suffixes: array2081, - min: lifted2084, - max: lifted2086, - }) - } - 31 => { - let array2110 : Array[@types.UnionBranch] = [] - for index2111 = 0 - index2111 < mbt_ffi_load32(iter_base + 12) - index2111 = index2111 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2111 * 92 - - let result2087 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2096 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result2088 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result2088) - } - 1 => { - let result2089 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result2089) - } - 2 => { - let result2090 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result2090) - } - 3 => { - let result2091 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result2091) - } - 4 => { - let result2092 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted2094 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2093 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - Option::Some(result2093) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result2092, - literal: lifted2094, - }) - } - 5 => { - let result2095 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result2095) - } - _ => panic() - } + let lifted1654 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted2098 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2097 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2097) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - let array2100 : Array[String] = [] - for index2101 = 0 - index2101 < mbt_ffi_load32(iter_base + 52) - index2101 = index2101 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2101 * 8 + @types.SchemaTypeBody::FutureType(lifted1654) + } + 36 => { - let result2099 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1655 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array2100.push(result2099) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - let array2103 : Array[String] = [] - for index2104 = 0 - index2104 < mbt_ffi_load32(iter_base + 60) - index2104 = index2104 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2104 * 8 + @types.SchemaTypeBody::StreamType(lifted1655) + } + _ => panic() + } - let result2102 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1658 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { - array2103.push(result2102) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted2106 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2105 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2105) - } - _ => panic() - } + let result1657 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - let lifted2109 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted2108 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2107 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + Option::Some(result1657) + } + _ => panic() + } - @types.Role::Other(result2107) - } - _ => panic() - } + let array1660 : Array[String] = []; + for index1661 = 0; index1661 < (mbt_ffi_load32((iter_base) + 104)); index1661 = index1661 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index1661 * 8) - Option::Some(lifted2108) - } - _ => panic() - } + let result1659 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array2110.push(@types.UnionBranch::{ - tag: result2087, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted2096, - metadata: @types.MetadataEnvelope::{ - doc: lifted2098, - aliases: array2100, - examples: array2103, - deprecated: lifted2106, - role: lifted2109, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array2110, - }) - } - 32 => { - let lifted2113 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2112 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2112) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted2113, - }) - } - 33 => { - let lifted2115 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2114 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2114) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted2115, - }) - } - 34 => { - let lifted2116 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted2116) - } - 35 => { - let lifted2117 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted2117) - } - _ => panic() - } + array1660.push(result1659) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - let lifted2120 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result2119 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result2119) - } - _ => panic() - } + let array1663 : Array[String] = []; + for index1664 = 0; index1664 < (mbt_ffi_load32((iter_base) + 112)); index1664 = index1664 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index1664 * 8) - let array2122 : Array[String] = [] - for index2123 = 0 - index2123 < mbt_ffi_load32(iter_base + 104) - index2123 = index2123 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index2123 * 8 + let result1662 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result2121 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array1663.push(result1662) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - array2122.push(result2121) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let lifted1666 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - let array2125 : Array[String] = [] - for index2126 = 0 - index2126 < mbt_ffi_load32(iter_base + 112) - index2126 = index2126 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index2126 * 8 + let result1665 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - let result2124 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(result1665) + } + _ => panic() + } - array2125.push(result2124) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted2128 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result2127 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result2127) - } - _ => panic() - } + let lifted1669 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - let lifted2131 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted2130 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2129 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result2129) - } - _ => panic() - } + let lifted1668 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - Option::Some(lifted2130) - } - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - array2132.push(@types.SchemaTypeNode::{ - body: lifted2118, - metadata: @types.MetadataEnvelope::{ - doc: lifted2120, - aliases: array2122, - examples: array2125, - deprecated: lifted2128, - role: lifted2131, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array2137 : Array[@types.SchemaTypeDef] = [] - for index2138 = 0 - index2138 < mbt_ffi_load32(iter_base + 40) - index2138 = index2138 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index2138 * 24 - - let result2134 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2136 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2135 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2135) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - array2137.push(@types.SchemaTypeDef::{ - id: result2134, - name: lifted2136, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array2168 : Array[@types.SchemaValueNode] = [] - for index2169 = 0 - index2169 < mbt_ffi_load32(iter_base + 52) - index2169 = index2169 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2169 * 32 - - let lifted2167 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result2139 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result2139) - } - 13 => { - let array2140 : Array[Int] = [] - for index2141 = 0 - index2141 < mbt_ffi_load32(iter_base + 12) - index2141 = index2141 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2141 * 4 - - array2140.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array2140) - } - 14 => { - let lifted2142 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted2142, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array2143 : Array[Bool] = [] - for index2144 = 0 - index2144 < mbt_ffi_load32(iter_base + 12) - index2144 = index2144 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2144 * 1 - - array2143.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array2143) - } - 17 => { - let array2145 : Array[Int] = [] - for index2146 = 0 - index2146 < mbt_ffi_load32(iter_base + 12) - index2146 = index2146 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2146 * 4 - - array2145.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array2145) - } - 18 => { - let array2147 : Array[Int] = [] - for index2148 = 0 - index2148 < mbt_ffi_load32(iter_base + 12) - index2148 = index2148 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2148 * 4 - - array2147.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array2147) - } - 19 => { - let array2149 : Array[Int] = [] - for index2150 = 0 - index2150 < mbt_ffi_load32(iter_base + 12) - index2150 = index2150 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2150 * 4 - - array2149.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array2149) - } - 20 => { - let array2151 : Array[@types.MapEntry] = [] - for index2152 = 0 - index2152 < mbt_ffi_load32(iter_base + 12) - index2152 = index2152 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2152 * 8 - - array2151.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array2151) - } - 21 => { - let lifted2153 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted2153) - } - 22 => { - let lifted2156 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted2154 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted2154) - } - 1 => { - let lifted2155 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted2155) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted2156) - } - 23 => { - let result2157 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2159 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2158 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2158) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result2157, - language: lifted2159, - }) - } - 24 => { - let result2160 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2162 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2161 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2161) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result2160, - mime_type: lifted2162, - }) - } - 25 => { - let result2163 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result2163) - } - 26 => { - let result2164 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result2164) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result2165 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result2165, - }) - } - 30 => { - let result2166 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result2166, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - array2168.push(lifted2167) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - AgentInvocationResult::AgentInitialization(AgentInvocationOutputParameters::{ - output: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array2132, - defs: array2137, - root: mbt_ffi_load32(iter_base + 44), - }, - value: @types.SchemaValueTree::{ - value_nodes: array2168, - root: mbt_ffi_load32(iter_base + 56), - }, - }, - }) - } - 1 => { - let array2366 : Array[@types.SchemaTypeNode] = [] - for index2367 = 0 - index2367 < mbt_ffi_load32(iter_base + 32) - index2367 = index2367 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2367 * 144 - - let lifted2352 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted2176 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2171 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2170 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1667 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - Option::Some(lifted2170) - } - _ => panic() - } - - let lifted2173 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2172 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Other(result1667) + } + _ => panic() + } - Option::Some(lifted2172) - } - _ => panic() - } - - let lifted2175 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2174 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2174) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2171, - max: lifted2173, - unit: lifted2175, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted2176) - } - 3 => { - let lifted2183 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2178 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2177 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted1668) + } + _ => panic() + } - Option::Some(lifted2177) - } - _ => panic() - } - - let lifted2180 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2179 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1670.push(@types.SchemaTypeNode::{body : lifted1656, metadata : @types.MetadataEnvelope::{doc : lifted1658, aliases : array1660, examples : array1663, deprecated : lifted1666, role : lifted1669}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - Option::Some(lifted2179) - } - _ => panic() - } - - let lifted2182 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2181 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2181) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2178, - max: lifted2180, - unit: lifted2182, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted2183) - } - 4 => { - let lifted2190 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2185 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2184 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1675 : Array[@types.SchemaTypeDef] = []; + for index1676 = 0; index1676 < (mbt_ffi_load32((iter_base) + 48)); index1676 = index1676 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index1676 * 24) - Option::Some(lifted2184) - } - _ => panic() - } - - let lifted2187 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2186 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1672 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted2186) - } - _ => panic() - } - - let lifted2189 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2188 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2188) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2185, - max: lifted2187, - unit: lifted2189, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted2190) - } - 5 => { - let lifted2197 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2192 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2191 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1674 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted2191) - } - _ => panic() - } - - let lifted2194 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2193 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1673 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - Option::Some(lifted2193) - } - _ => panic() - } - - let lifted2196 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2195 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2195) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2192, - max: lifted2194, - unit: lifted2196, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted2197) - } - 6 => { - let lifted2204 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2199 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2198 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1673) + } + _ => panic() + } - Option::Some(lifted2198) - } - _ => panic() - } - - let lifted2201 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2200 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1675.push(@types.SchemaTypeDef::{id : result1672, name : lifted1674, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted2200) - } - _ => panic() - } - - let lifted2203 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2202 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2202) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2199, - max: lifted2201, - unit: lifted2203, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted2204) - } - 7 => { - let lifted2211 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2206 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2205 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1706 : Array[@types.SchemaValueNode] = []; + for index1707 = 0; index1707 < (mbt_ffi_load32((iter_base) + 60)); index1707 = index1707 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1707 * 32) - Option::Some(lifted2205) - } - _ => panic() - } - - let lifted2208 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2207 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1705 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - Option::Some(lifted2207) - } - _ => panic() - } - - let lifted2210 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2209 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2209) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2206, - max: lifted2208, - unit: lifted2210, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted2211) - } - 8 => { - let lifted2218 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2213 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2212 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - Option::Some(lifted2212) - } - _ => panic() - } - - let lifted2215 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2214 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - Option::Some(lifted2214) - } - _ => panic() - } - - let lifted2217 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2216 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2216) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2213, - max: lifted2215, - unit: lifted2217, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted2218) - } - 9 => { - let lifted2225 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2220 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2219 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - Option::Some(lifted2219) - } - _ => panic() - } - - let lifted2222 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2221 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - Option::Some(lifted2221) - } - _ => panic() - } - - let lifted2224 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2223 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2223) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2220, - max: lifted2222, - unit: lifted2224, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted2225) - } - 10 => { - let lifted2232 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2227 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2226 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - Option::Some(lifted2226) - } - _ => panic() - } - - let lifted2229 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2228 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - Option::Some(lifted2228) - } - _ => panic() - } - - let lifted2231 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2230 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2230) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2227, - max: lifted2229, - unit: lifted2231, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted2232) - } - 11 => { - let lifted2239 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2234 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2233 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - Option::Some(lifted2233) - } - _ => panic() - } - - let lifted2236 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2235 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - Option::Some(lifted2235) - } - _ => panic() - } - - let lifted2238 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2237 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2237) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2234, - max: lifted2236, - unit: lifted2238, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted2239) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array2254 : Array[@types.NamedFieldType] = [] - for index2255 = 0 - index2255 < mbt_ffi_load32(iter_base + 12) - index2255 = index2255 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2255 * 68 - - let result2240 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2242 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2241 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2241) - } - _ => panic() - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - let array2244 : Array[String] = [] - for index2245 = 0 - index2245 < mbt_ffi_load32(iter_base + 28) - index2245 = index2245 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2245 * 8 + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - let result2243 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - array2244.push(result2243) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - let array2247 : Array[String] = [] - for index2248 = 0 - index2248 < mbt_ffi_load32(iter_base + 36) - index2248 = index2248 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index2248 * 8 + let result1677 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result2246 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::StringValue(result1677) + } + 13 => { - array2247.push(result2246) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted2250 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result2249 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result2249) - } - _ => panic() - } + let array1678 : Array[Int] = []; + for index1679 = 0; index1679 < (mbt_ffi_load32((iter_base) + 12)); index1679 = index1679 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1679 * 4) - let lifted2253 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted2252 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2251 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + array1678.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.Role::Other(result2251) - } - _ => panic() - } + @types.SchemaValueNode::RecordValue(array1678) + } + 14 => { - Option::Some(lifted2252) - } - _ => panic() - } + let lifted1680 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - array2254.push(@types.NamedFieldType::{ - name: result2240, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted2242, - aliases: array2244, - examples: array2247, - deprecated: lifted2250, - role: lifted2253, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array2254) - } - 15 => { - let array2271 : Array[@types.VariantCaseType] = [] - for index2272 = 0 - index2272 < mbt_ffi_load32(iter_base + 12) - index2272 = index2272 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2272 * 72 - - let result2256 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2257 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let lifted2259 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2258 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2258) - } - _ => panic() - } + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted1680}) + } + 15 => { - let array2261 : Array[String] = [] - for index2262 = 0 - index2262 < mbt_ffi_load32(iter_base + 32) - index2262 = index2262 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2262 * 8 + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - let result2260 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array1681 : Array[Bool] = []; + for index1682 = 0; index1682 < (mbt_ffi_load32((iter_base) + 12)); index1682 = index1682 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1682 * 1) - array2261.push(result2260) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + array1681.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array2264 : Array[String] = [] - for index2265 = 0 - index2265 < mbt_ffi_load32(iter_base + 40) - index2265 = index2265 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index2265 * 8 + @types.SchemaValueNode::FlagsValue(array1681) + } + 17 => { - let result2263 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array1683 : Array[Int] = []; + for index1684 = 0; index1684 < (mbt_ffi_load32((iter_base) + 12)); index1684 = index1684 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1684 * 4) - array2264.push(result2263) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted2267 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result2266 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result2266) - } - _ => panic() - } + array1683.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted2270 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted2269 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2268 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + @types.SchemaValueNode::TupleValue(array1683) + } + 18 => { - @types.Role::Other(result2268) - } - _ => panic() - } + let array1685 : Array[Int] = []; + for index1686 = 0; index1686 < (mbt_ffi_load32((iter_base) + 12)); index1686 = index1686 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1686 * 4) - Option::Some(lifted2269) - } - _ => panic() - } + array1685.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - array2271.push(@types.VariantCaseType::{ - name: result2256, - payload: lifted2257, - metadata: @types.MetadataEnvelope::{ - doc: lifted2259, - aliases: array2261, - examples: array2264, - deprecated: lifted2267, - role: lifted2270, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array2271) - } - 16 => { - let array2274 : Array[String] = [] - for index2275 = 0 - index2275 < mbt_ffi_load32(iter_base + 12) - index2275 = index2275 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2275 * 8 - - let result2273 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2274.push(result2273) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array2274) - } - 17 => { - let array2277 : Array[String] = [] - for index2278 = 0 - index2278 < mbt_ffi_load32(iter_base + 12) - index2278 = index2278 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2278 * 8 - - let result2276 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2277.push(result2276) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array2277) - } - 18 => { - let array2279 : Array[Int] = [] - for index2280 = 0 - index2280 < mbt_ffi_load32(iter_base + 12) - index2280 = index2280 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2280 * 4 - - array2279.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array2279) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted2281 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted2282 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted2281, - err: lifted2282, - }) - } - 24 => { - let lifted2286 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2284 : Array[String] = [] - for index2285 = 0 - index2285 < mbt_ffi_load32(iter_base + 16) - index2285 = index2285 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2285 * 8 - - let result2283 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2284.push(result2283) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2284) - } - _ => panic() - } - - let lifted2287 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2288 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2290 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2289 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2289) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted2286, - min_length: lifted2287, - max_length: lifted2288, - regex: lifted2290, - }) - } - 25 => { - let lifted2294 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2292 : Array[String] = [] - for index2293 = 0 - index2293 < mbt_ffi_load32(iter_base + 16) - index2293 = index2293 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2293 * 8 - - let result2291 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2292.push(result2291) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2292) - } - _ => panic() - } - - let lifted2295 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2296 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted2294, - min_bytes: lifted2295, - max_bytes: lifted2296, - }) - } - 26 => { - let lifted2300 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array2298 : Array[String] = [] - for index2299 = 0 - index2299 < mbt_ffi_load32(iter_base + 20) - index2299 = index2299 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2299 * 8 - - let result2297 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2298.push(result2297) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array2298) - } - _ => panic() - } - - let lifted2304 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array2302 : Array[String] = [] - for index2303 = 0 - index2303 < mbt_ffi_load32(iter_base + 32) - index2303 = index2303 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2303 * 8 - - let result2301 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2302.push(result2301) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array2302) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted2300, - allowed_extensions: lifted2304, - }) - } - 27 => { - let lifted2308 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2306 : Array[String] = [] - for index2307 = 0 - index2307 < mbt_ffi_load32(iter_base + 16) - index2307 = index2307 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2307 * 8 - - let result2305 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2306.push(result2305) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2306) - } - _ => panic() - } - - let lifted2312 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array2310 : Array[String] = [] - for index2311 = 0 - index2311 < mbt_ffi_load32(iter_base + 28) - index2311 = index2311 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2311 * 8 - - let result2309 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2310.push(result2309) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array2310) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted2308, - allowed_hosts: lifted2312, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result2313 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2315 : Array[String] = [] - for index2316 = 0 - index2316 < mbt_ffi_load32(iter_base + 20) - index2316 = index2316 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2316 * 8 - - let result2314 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2315.push(result2314) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted2318 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2317 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result2317, - }) - } - _ => panic() - } - - let lifted2320 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result2319 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result2319, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result2313, - allowed_suffixes: array2315, - min: lifted2318, - max: lifted2320, - }) - } - 31 => { - let array2344 : Array[@types.UnionBranch] = [] - for index2345 = 0 - index2345 < mbt_ffi_load32(iter_base + 12) - index2345 = index2345 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2345 * 92 - - let result2321 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2330 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result2322 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result2322) - } - 1 => { - let result2323 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result2323) - } - 2 => { - let result2324 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result2324) - } - 3 => { - let result2325 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result2325) - } - 4 => { - let result2326 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted2328 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2327 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + @types.SchemaValueNode::ListValue(array1685) + } + 19 => { - Option::Some(result2327) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result2326, - literal: lifted2328, - }) - } - 5 => { - let result2329 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result2329) - } - _ => panic() - } + let array1687 : Array[Int] = []; + for index1688 = 0; index1688 < (mbt_ffi_load32((iter_base) + 12)); index1688 = index1688 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1688 * 4) - let lifted2332 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2331 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2331) - } - _ => panic() - } + array1687.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array2334 : Array[String] = [] - for index2335 = 0 - index2335 < mbt_ffi_load32(iter_base + 52) - index2335 = index2335 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2335 * 8 + @types.SchemaValueNode::FixedListValue(array1687) + } + 20 => { - let result2333 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array1689 : Array[@types.MapEntry] = []; + for index1690 = 0; index1690 < (mbt_ffi_load32((iter_base) + 12)); index1690 = index1690 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1690 * 8) - array2334.push(result2333) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + array1689.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array2337 : Array[String] = [] - for index2338 = 0 - index2338 < mbt_ffi_load32(iter_base + 60) - index2338 = index2338 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2338 * 8 + @types.SchemaValueNode::MapValue(array1689) + } + 21 => { - let result2336 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1691 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array2337.push(result2336) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted2340 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2339 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2339) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - let lifted2343 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted2342 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2341 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @types.SchemaValueNode::OptionValue(lifted1691) + } + 22 => { - @types.Role::Other(result2341) - } - _ => panic() - } + let lifted1694 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - Option::Some(lifted2342) - } - _ => panic() - } + let lifted1692 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - array2344.push(@types.UnionBranch::{ - tag: result2321, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted2330, - metadata: @types.MetadataEnvelope::{ - doc: lifted2332, - aliases: array2334, - examples: array2337, - deprecated: lifted2340, - role: lifted2343, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array2344, - }) - } - 32 => { - let lifted2347 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2346 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2346) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted2347, - }) - } - 33 => { - let lifted2349 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2348 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2348) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted2349, - }) - } - 34 => { - let lifted2350 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted2350) - } - 35 => { - let lifted2351 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted2351) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let lifted2354 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result2353 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result2353) - } - _ => panic() - } + @types.ResultValuePayload::OkValue(lifted1692) + } + 1 => { - let array2356 : Array[String] = [] - for index2357 = 0 - index2357 < mbt_ffi_load32(iter_base + 104) - index2357 = index2357 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index2357 * 8 + let lifted1693 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let result2355 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - array2356.push(result2355) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + @types.ResultValuePayload::ErrValue(lifted1693) + } + _ => panic() + } - let array2359 : Array[String] = [] - for index2360 = 0 - index2360 < mbt_ffi_load32(iter_base + 112) - index2360 = index2360 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index2360 * 8 + @types.SchemaValueNode::ResultValue(lifted1694) + } + 23 => { - let result2358 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1695 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array2359.push(result2358) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted2362 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result2361 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result2361) - } - _ => panic() - } + let lifted1697 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted2365 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted2364 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2363 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result2363) - } - _ => panic() - } + let result1696 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Option::Some(lifted2364) - } - _ => panic() - } + Option::Some(result1696) + } + _ => panic() + } - array2366.push(@types.SchemaTypeNode::{ - body: lifted2352, - metadata: @types.MetadataEnvelope::{ - doc: lifted2354, - aliases: array2356, - examples: array2359, - deprecated: lifted2362, - role: lifted2365, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array2371 : Array[@types.SchemaTypeDef] = [] - for index2372 = 0 - index2372 < mbt_ffi_load32(iter_base + 40) - index2372 = index2372 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index2372 * 24 - - let result2368 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2370 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2369 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2369) - } - _ => panic() - } + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result1695, language : lifted1697}) + } + 24 => { - array2371.push(@types.SchemaTypeDef::{ - id: result2368, - name: lifted2370, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array2402 : Array[@types.SchemaValueNode] = [] - for index2403 = 0 - index2403 < mbt_ffi_load32(iter_base + 52) - index2403 = index2403 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2403 * 32 - - let lifted2401 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result2373 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result2373) - } - 13 => { - let array2374 : Array[Int] = [] - for index2375 = 0 - index2375 < mbt_ffi_load32(iter_base + 12) - index2375 = index2375 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2375 * 4 - - array2374.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array2374) - } - 14 => { - let lifted2376 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted2376, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array2377 : Array[Bool] = [] - for index2378 = 0 - index2378 < mbt_ffi_load32(iter_base + 12) - index2378 = index2378 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2378 * 1 - - array2377.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array2377) - } - 17 => { - let array2379 : Array[Int] = [] - for index2380 = 0 - index2380 < mbt_ffi_load32(iter_base + 12) - index2380 = index2380 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2380 * 4 - - array2379.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array2379) - } - 18 => { - let array2381 : Array[Int] = [] - for index2382 = 0 - index2382 < mbt_ffi_load32(iter_base + 12) - index2382 = index2382 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2382 * 4 - - array2381.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array2381) - } - 19 => { - let array2383 : Array[Int] = [] - for index2384 = 0 - index2384 < mbt_ffi_load32(iter_base + 12) - index2384 = index2384 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2384 * 4 - - array2383.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array2383) - } - 20 => { - let array2385 : Array[@types.MapEntry] = [] - for index2386 = 0 - index2386 < mbt_ffi_load32(iter_base + 12) - index2386 = index2386 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2386 * 8 - - array2385.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array2385) - } - 21 => { - let lifted2387 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted2387) - } - 22 => { - let lifted2390 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted2388 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted2388) - } - 1 => { - let lifted2389 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted2389) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted2390) - } - 23 => { - let result2391 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2393 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2392 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2392) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result2391, - language: lifted2393, - }) - } - 24 => { - let result2394 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2396 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2395 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2395) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result2394, - mime_type: lifted2396, - }) - } - 25 => { - let result2397 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result2397) - } - 26 => { - let result2398 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result2398) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result2399 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result2399, - }) - } - 30 => { - let result2400 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result2400, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + let result1698 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array2402.push(lifted2401) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - AgentInvocationResult::AgentMethod(AgentInvocationOutputParameters::{ - output: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array2366, - defs: array2371, - root: mbt_ffi_load32(iter_base + 44), - }, - value: @types.SchemaValueTree::{ - value_nodes: array2402, - root: mbt_ffi_load32(iter_base + 56), - }, - }, - }) - } - 2 => AgentInvocationResult::ManualUpdate - 3 => { - let lifted2405 : String? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => { - let result2404 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - Option::Some(result2404) - } - _ => panic() - } - - AgentInvocationResult::LoadSnapshot(FallibleResultParameters::{ - error: lifted2405, - }) - } - 4 => { - let result2406 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - let result2407 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - AgentInvocationResult::SaveSnapshot(SaveSnapshotResultParameters::{ - snapshot: SnapshotData::{ - data: result2406, - mime_type: result2407, - }, - }) - } - 5 => { - let lifted2409 : String? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => { - let result2408 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - Option::Some(result2408) - } - _ => panic() - } - - AgentInvocationResult::ProcessOplogEntries(FallibleResultParameters::{ - error: lifted2409, - }) - } - _ => panic() - } + let lifted1700 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted2412 : String? = match mbt_ffi_load8_u(iter_base + 60) { - 0 => Option::None - 1 => { - let result2411 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - Option::Some(result2411) - } - _ => panic() - } + let result1699 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - PublicOplogEntry::AgentInvocationFinished(AgentInvocationFinishedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - result: lifted2410, - method_name: lifted2412, - consumed_fuel: mbt_ffi_load64(iter_base + 72), - component_revision: mbt_ffi_load64(iter_base + 80).reinterpret_as_uint64(), - }) - } - 6 => - PublicOplogEntry::Suspend(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - }) - 7 => { - let result2413 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let lifted2417 : RetryPolicyState? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let array2415 : Array[StateNode] = [] - for index2416 = 0 - index2416 < mbt_ffi_load32(iter_base + 52) - index2416 = index2416 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2416 * 16 - - let lifted2414 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - StateNode::Counter( - mbt_ffi_load32(iter_base + 4).reinterpret_as_uint(), - ) - 1 => StateNode::Terminal - 2 => StateNode::Wrapper(mbt_ffi_load32(iter_base + 4)) - 3 => - StateNode::CountBox(CountBoxState::{ - attempts: mbt_ffi_load32(iter_base + 4).reinterpret_as_uint(), - inner: mbt_ffi_load32(iter_base + 8), - }) - 4 => - StateNode::AndThen(AndThenState::{ - left: mbt_ffi_load32(iter_base + 4), - right: mbt_ffi_load32(iter_base + 8), - on_right: mbt_ffi_load8_u(iter_base + 12) != 0, - }) - 5 => - StateNode::Pair(PairState::{ - left: mbt_ffi_load32(iter_base + 4), - right: mbt_ffi_load32(iter_base + 8), - }) - _ => panic() - } + Option::Some(result1699) + } + _ => panic() + } - array2415.push(lifted2414) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result1698, mime_type : lifted1700}) + } + 25 => { - Option::Some(RetryPolicyState::{ nodes: array2415 }) - } - _ => panic() - } + let result1701 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - PublicOplogEntry::Error(ErrorParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - error: result2413, - retry_from: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - inside_atomic_region: mbt_ffi_load8_u(iter_base + 40) != 0, - retry_policy_state: lifted2417, - }) - } - 8 => - PublicOplogEntry::NoOp(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - }) - 9 => - PublicOplogEntry::Jump(JumpParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - jump: OplogRegion::{ - start: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - end: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }) - 10 => - PublicOplogEntry::Interrupted(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - }) - 11 => - PublicOplogEntry::Exited(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - }) - 12 => - PublicOplogEntry::BeginAtomicRegion(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - }) - 13 => - PublicOplogEntry::EndAtomicRegion(EndAtomicRegionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - 14 => { - let lifted2930 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => { - let result2418 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array2615 : Array[@types.SchemaTypeNode] = [] - for index2616 = 0 - index2616 < mbt_ffi_load32(iter_base + 44) - index2616 = index2616 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + - index2616 * 144 - - let lifted2601 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted2425 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2420 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2419 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::PathValue(result1701) + } + 26 => { - Option::Some(lifted2419) - } - _ => panic() - } - - let lifted2422 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2421 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1702 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted2421) - } - _ => panic() - } - - let lifted2424 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2423 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2423) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2420, - max: lifted2422, - unit: lifted2424, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted2425) - } - 3 => { - let lifted2432 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2427 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2426 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::UrlValue(result1702) + } + 27 => { - Option::Some(lifted2426) - } - _ => panic() - } - - let lifted2429 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2428 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - Option::Some(lifted2428) - } - _ => panic() - } - - let lifted2431 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2430 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2430) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2427, - max: lifted2429, - unit: lifted2431, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted2432) - } - 4 => { - let lifted2439 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2434 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2433 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - Option::Some(lifted2433) - } - _ => panic() - } - - let lifted2436 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2435 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1703 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Option::Some(lifted2435) - } - _ => panic() - } - - let lifted2438 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2437 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2437) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2434, - max: lifted2436, - unit: lifted2438, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted2439) - } - 5 => { - let lifted2446 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2441 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2440 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result1703}) + } + 30 => { - Option::Some(lifted2440) - } - _ => panic() - } - - let lifted2443 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2442 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1704 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted2442) - } - _ => panic() - } - - let lifted2445 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2444 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2444) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2441, - max: lifted2443, - unit: lifted2445, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted2446) - } - 6 => { - let lifted2453 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2448 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2447 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result1704, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - Option::Some(lifted2447) - } - _ => panic() - } - - let lifted2450 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2449 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - Option::Some(lifted2449) - } - _ => panic() - } - - let lifted2452 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2451 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2451) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2448, - max: lifted2450, - unit: lifted2452, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted2453) - } - 7 => { - let lifted2460 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2455 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2454 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - Option::Some(lifted2454) - } - _ => panic() - } - - let lifted2457 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2456 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } - Option::Some(lifted2456) - } - _ => panic() - } - - let lifted2459 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2458 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2458) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2455, - max: lifted2457, - unit: lifted2459, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted2460) - } - 8 => { - let lifted2467 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2462 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2461 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array1706.push(lifted1705) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - Option::Some(lifted2461) - } - _ => panic() - } - - let lifted2464 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2463 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocationResult::AgentInitialization(AgentInvocationOutputParameters::{output : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array1670, defs : array1675, root : mbt_ffi_load32((iter_base) + 52)}, value : @types.SchemaValueTree::{value_nodes : array1706, root : mbt_ffi_load32((iter_base) + 64)}}}) + } + 1 => { - Option::Some(lifted2463) - } - _ => panic() - } - - let lifted2466 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2465 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2465) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2462, - max: lifted2464, - unit: lifted2466, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted2467) - } - 9 => { - let lifted2474 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2469 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2468 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1904 : Array[@types.SchemaTypeNode] = []; + for index1905 = 0; index1905 < (mbt_ffi_load32((iter_base) + 40)); index1905 = index1905 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1905 * 144) - Option::Some(lifted2468) - } - _ => panic() - } - - let lifted2471 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2470 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1890 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - Option::Some(lifted2470) - } - _ => panic() - } - - let lifted2473 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2472 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2472) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2469, - max: lifted2471, - unit: lifted2473, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted2474) - } - 10 => { - let lifted2481 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2476 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2475 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { - Option::Some(lifted2475) - } - _ => panic() - } - - let lifted2478 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2477 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::BoolType + } + 2 => { - Option::Some(lifted2477) - } - _ => panic() - } - - let lifted2480 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2479 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2479) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2476, - max: lifted2478, - unit: lifted2480, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted2481) - } - 11 => { - let lifted2488 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2483 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2482 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1714 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted2482) - } - _ => panic() - } - - let lifted2485 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2484 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1709 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted2484) - } - _ => panic() - } - - let lifted2487 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2486 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2486) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2483, - max: lifted2485, - unit: lifted2487, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted2488) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array2503 : Array[@types.NamedFieldType] = [] - for index2504 = 0 - index2504 < mbt_ffi_load32(iter_base + 12) - index2504 = index2504 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2504 * 68 - - let result2489 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2491 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2490 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2490) - } - _ => panic() - } + let lifted1708 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let array2493 : Array[String] = [] - for index2494 = 0 - index2494 < mbt_ffi_load32(iter_base + 28) - index2494 = index2494 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2494 * 8 + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let result2492 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - array2493.push(result2492) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - let array2496 : Array[String] = [] - for index2497 = 0 - index2497 < mbt_ffi_load32(iter_base + 36) - index2497 = index2497 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index2497 * 8 + Option::Some(lifted1708) + } + _ => panic() + } - let result2495 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1711 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - array2496.push(result2495) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted2499 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result2498 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result2498) - } - _ => panic() - } + let lifted1710 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let lifted2502 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted2501 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2500 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - @types.Role::Other(result2500) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(lifted2501) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - array2503.push(@types.NamedFieldType::{ - name: result2489, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted2491, - aliases: array2493, - examples: array2496, - deprecated: lifted2499, - role: lifted2502, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array2503) - } - 15 => { - let array2520 : Array[@types.VariantCaseType] = [] - for index2521 = 0 - index2521 < mbt_ffi_load32(iter_base + 12) - index2521 = index2521 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2521 * 72 - - let result2505 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2506 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + Option::Some(lifted1710) + } + _ => panic() + } - let lifted2508 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2507 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2507) - } - _ => panic() - } + let lifted1713 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let array2510 : Array[String] = [] - for index2511 = 0 - index2511 < mbt_ffi_load32(iter_base + 32) - index2511 = index2511 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2511 * 8 + let result1712 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let result2509 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(result1712) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1709, max : lifted1711, unit : lifted1713}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted1714) + } + 3 => { + + let lifted1721 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1716 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1715 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - array2510.push(result2509) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let array2513 : Array[String] = [] - for index2514 = 0 - index2514 < mbt_ffi_load32(iter_base + 40) - index2514 = index2514 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index2514 * 8 + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1715) + } + _ => panic() + } + + let lifted1718 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1717 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1717) + } + _ => panic() + } + + let lifted1720 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1719 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1719) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1716, max : lifted1718, unit : lifted1720}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted1721) + } + 4 => { + + let lifted1728 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1723 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1722 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1722) + } + _ => panic() + } + + let lifted1725 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1724 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1724) + } + _ => panic() + } + + let lifted1727 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1726 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1726) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1723, max : lifted1725, unit : lifted1727}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted1728) + } + 5 => { + + let lifted1735 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1730 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1729 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1729) + } + _ => panic() + } + + let lifted1732 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1731 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1731) + } + _ => panic() + } + + let lifted1734 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1733 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1733) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1730, max : lifted1732, unit : lifted1734}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted1735) + } + 6 => { + + let lifted1742 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1737 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1736 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1736) + } + _ => panic() + } + + let lifted1739 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1738 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1738) + } + _ => panic() + } + + let lifted1741 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1740 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1740) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1737, max : lifted1739, unit : lifted1741}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted1742) + } + 7 => { + + let lifted1749 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1744 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1743 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1743) + } + _ => panic() + } + + let lifted1746 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1745 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1745) + } + _ => panic() + } + + let lifted1748 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1747 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1747) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1744, max : lifted1746, unit : lifted1748}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1749) + } + 8 => { + + let lifted1756 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1751 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1750 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1750) + } + _ => panic() + } + + let lifted1753 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1752 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1752) + } + _ => panic() + } + + let lifted1755 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1754 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1754) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1751, max : lifted1753, unit : lifted1755}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted1756) + } + 9 => { + + let lifted1763 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1758 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1757 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1757) + } + _ => panic() + } + + let lifted1760 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1759 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1759) + } + _ => panic() + } + + let lifted1762 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1761 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1761) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1758, max : lifted1760, unit : lifted1762}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted1763) + } + 10 => { + + let lifted1770 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1765 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1764 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1764) + } + _ => panic() + } + + let lifted1767 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1766 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1766) + } + _ => panic() + } + + let lifted1769 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1768 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1768) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1765, max : lifted1767, unit : lifted1769}) + } + _ => panic() + } - let result2512 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::F32Type(lifted1770) + } + 11 => { - array2513.push(result2512) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted2516 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result2515 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result2515) - } - _ => panic() - } + let lifted1777 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted2519 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted2518 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2517 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let lifted1772 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - @types.Role::Other(result2517) - } - _ => panic() - } + let lifted1771 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - Option::Some(lifted2518) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - array2520.push(@types.VariantCaseType::{ - name: result2505, - payload: lifted2506, - metadata: @types.MetadataEnvelope::{ - doc: lifted2508, - aliases: array2510, - examples: array2513, - deprecated: lifted2516, - role: lifted2519, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array2520) - } - 16 => { - let array2523 : Array[String] = [] - for index2524 = 0 - index2524 < mbt_ffi_load32(iter_base + 12) - index2524 = index2524 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2524 * 8 - - let result2522 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2523.push(result2522) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array2523) - } - 17 => { - let array2526 : Array[String] = [] - for index2527 = 0 - index2527 < mbt_ffi_load32(iter_base + 12) - index2527 = index2527 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2527 * 8 - - let result2525 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2526.push(result2525) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array2526) - } - 18 => { - let array2528 : Array[Int] = [] - for index2529 = 0 - index2529 < mbt_ffi_load32(iter_base + 12) - index2529 = index2529 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2529 * 4 - - array2528.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array2528) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted2530 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted2531 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted2530, - err: lifted2531, - }) - } - 24 => { - let lifted2535 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2533 : Array[String] = [] - for index2534 = 0 - index2534 < mbt_ffi_load32(iter_base + 16) - index2534 = index2534 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2534 * 8 - - let result2532 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2533.push(result2532) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2533) - } - _ => panic() - } - - let lifted2536 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2537 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2539 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2538 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2538) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted2535, - min_length: lifted2536, - max_length: lifted2537, - regex: lifted2539, - }) - } - 25 => { - let lifted2543 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2541 : Array[String] = [] - for index2542 = 0 - index2542 < mbt_ffi_load32(iter_base + 16) - index2542 = index2542 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2542 * 8 - - let result2540 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2541.push(result2540) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2541) - } - _ => panic() - } - - let lifted2544 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2545 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted2543, - min_bytes: lifted2544, - max_bytes: lifted2545, - }) - } - 26 => { - let lifted2549 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array2547 : Array[String] = [] - for index2548 = 0 - index2548 < mbt_ffi_load32(iter_base + 20) - index2548 = index2548 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2548 * 8 - - let result2546 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2547.push(result2546) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array2547) - } - _ => panic() - } - - let lifted2553 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array2551 : Array[String] = [] - for index2552 = 0 - index2552 < mbt_ffi_load32(iter_base + 32) - index2552 = index2552 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2552 * 8 - - let result2550 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2551.push(result2550) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array2551) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted2549, - allowed_extensions: lifted2553, - }) - } - 27 => { - let lifted2557 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2555 : Array[String] = [] - for index2556 = 0 - index2556 < mbt_ffi_load32(iter_base + 16) - index2556 = index2556 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2556 * 8 - - let result2554 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2555.push(result2554) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2555) - } - _ => panic() - } - - let lifted2561 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array2559 : Array[String] = [] - for index2560 = 0 - index2560 < mbt_ffi_load32(iter_base + 28) - index2560 = index2560 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2560 * 8 - - let result2558 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2559.push(result2558) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array2559) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted2557, - allowed_hosts: lifted2561, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result2562 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2564 : Array[String] = [] - for index2565 = 0 - index2565 < mbt_ffi_load32(iter_base + 20) - index2565 = index2565 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2565 * 8 - - let result2563 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2564.push(result2563) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted2567 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2566 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result2566, - }) - } - _ => panic() - } - - let lifted2569 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result2568 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result2568, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result2562, - allowed_suffixes: array2564, - min: lifted2567, - max: lifted2569, - }) - } - 31 => { - let array2593 : Array[@types.UnionBranch] = [] - for index2594 = 0 - index2594 < mbt_ffi_load32(iter_base + 12) - index2594 = index2594 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2594 * 92 - - let result2570 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2579 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result2571 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result2571) - } - 1 => { - let result2572 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result2572) - } - 2 => { - let result2573 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result2573) - } - 3 => { - let result2574 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result2574) - } - 4 => { - let result2575 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted2577 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2576 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(result2576) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result2575, - literal: lifted2577, - }) - } - 5 => { - let result2578 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result2578) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted2581 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2580 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2580) - } - _ => panic() - } + Option::Some(lifted1771) + } + _ => panic() + } - let array2583 : Array[String] = [] - for index2584 = 0 - index2584 < mbt_ffi_load32(iter_base + 52) - index2584 = index2584 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2584 * 8 + let lifted1774 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - let result2582 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1773 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - array2583.push(result2582) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - let array2586 : Array[String] = [] - for index2587 = 0 - index2587 < mbt_ffi_load32(iter_base + 60) - index2587 = index2587 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2587 * 8 + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - let result2585 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - array2586.push(result2585) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted2589 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2588 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2588) - } - _ => panic() - } + Option::Some(lifted1773) + } + _ => panic() + } - let lifted2592 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted2591 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2590 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + let lifted1776 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - @types.Role::Other(result2590) - } - _ => panic() - } + let result1775 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - Option::Some(lifted2591) - } - _ => panic() - } + Option::Some(result1775) + } + _ => panic() + } - array2593.push(@types.UnionBranch::{ - tag: result2570, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted2579, - metadata: @types.MetadataEnvelope::{ - doc: lifted2581, - aliases: array2583, - examples: array2586, - deprecated: lifted2589, - role: lifted2592, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array2593, - }) - } - 32 => { - let lifted2596 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2595 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2595) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted2596, - }) - } - 33 => { - let lifted2598 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2597 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2597) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted2598, - }) - } - 34 => { - let lifted2599 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted2599) - } - 35 => { - let lifted2600 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted2600) - } - _ => panic() - } + Option::Some(@types.NumericRestrictions::{min : lifted1772, max : lifted1774, unit : lifted1776}) + } + _ => panic() + } - let lifted2603 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result2602 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result2602) - } - _ => panic() - } + @types.SchemaTypeBody::F64Type(lifted1777) + } + 12 => { - let array2605 : Array[String] = [] - for index2606 = 0 - index2606 < mbt_ffi_load32(iter_base + 104) - index2606 = index2606 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index2606 * 8 + @types.SchemaTypeBody::CharType + } + 13 => { - let result2604 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::StringType + } + 14 => { - array2605.push(result2604) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let array1792 : Array[@types.NamedFieldType] = []; + for index1793 = 0; index1793 < (mbt_ffi_load32((iter_base) + 12)); index1793 = index1793 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1793 * 68) - let array2608 : Array[String] = [] - for index2609 = 0 - index2609 < mbt_ffi_load32(iter_base + 112) - index2609 = index2609 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index2609 * 8 + let result1778 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result2607 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1780 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - array2608.push(result2607) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted2611 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result2610 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result2610) - } - _ => panic() - } + let result1779 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let lifted2614 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted2613 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2612 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result2612) - } - _ => panic() - } + Option::Some(result1779) + } + _ => panic() + } - Option::Some(lifted2613) - } - _ => panic() - } + let array1782 : Array[String] = []; + for index1783 = 0; index1783 < (mbt_ffi_load32((iter_base) + 28)); index1783 = index1783 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1783 * 8) - array2615.push(@types.SchemaTypeNode::{ - body: lifted2601, - metadata: @types.MetadataEnvelope::{ - doc: lifted2603, - aliases: array2605, - examples: array2608, - deprecated: lifted2611, - role: lifted2614, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let array2620 : Array[@types.SchemaTypeDef] = [] - for index2621 = 0 - index2621 < mbt_ffi_load32(iter_base + 52) - index2621 = index2621 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2621 * 24 - - let result2617 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2619 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2618 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2618) - } - _ => panic() - } + let result1781 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array2620.push(@types.SchemaTypeDef::{ - id: result2617, - name: lifted2619, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array2651 : Array[@types.SchemaValueNode] = [] - for index2652 = 0 - index2652 < mbt_ffi_load32(iter_base + 64) - index2652 = index2652 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + - index2652 * 32 - - let lifted2650 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result2622 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result2622) - } - 13 => { - let array2623 : Array[Int] = [] - for index2624 = 0 - index2624 < mbt_ffi_load32(iter_base + 12) - index2624 = index2624 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2624 * 4 - - array2623.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array2623) - } - 14 => { - let lifted2625 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted2625, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array2626 : Array[Bool] = [] - for index2627 = 0 - index2627 < mbt_ffi_load32(iter_base + 12) - index2627 = index2627 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2627 * 1 - - array2626.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array2626) - } - 17 => { - let array2628 : Array[Int] = [] - for index2629 = 0 - index2629 < mbt_ffi_load32(iter_base + 12) - index2629 = index2629 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2629 * 4 - - array2628.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array2628) - } - 18 => { - let array2630 : Array[Int] = [] - for index2631 = 0 - index2631 < mbt_ffi_load32(iter_base + 12) - index2631 = index2631 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2631 * 4 - - array2630.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array2630) - } - 19 => { - let array2632 : Array[Int] = [] - for index2633 = 0 - index2633 < mbt_ffi_load32(iter_base + 12) - index2633 = index2633 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2633 * 4 - - array2632.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array2632) - } - 20 => { - let array2634 : Array[@types.MapEntry] = [] - for index2635 = 0 - index2635 < mbt_ffi_load32(iter_base + 12) - index2635 = index2635 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2635 * 8 - - array2634.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array2634) - } - 21 => { - let lifted2636 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted2636) - } - 22 => { - let lifted2639 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted2637 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted2637) - } - 1 => { - let lifted2638 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted2638) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted2639) - } - 23 => { - let result2640 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2642 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2641 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2641) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result2640, - language: lifted2642, - }) - } - 24 => { - let result2643 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2645 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2644 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2644) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result2643, - mime_type: lifted2645, - }) - } - 25 => { - let result2646 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result2646) - } - 26 => { - let result2647 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result2647) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result2648 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result2648, - }) - } - 30 => { - let result2649 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result2649, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + array1782.push(result1781) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - array2651.push(lifted2650) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - let result2653 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 72), - mbt_ffi_load32(iter_base + 76), - ) - - let array2655 : Array[String] = [] - for index2656 = 0 - index2656 < mbt_ffi_load32(iter_base + 84) - index2656 = index2656 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 80) + index2656 * 8 - - let result2654 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2655.push(result2654) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 80)) - - let array2670 : Array[Array[SpanData]] = [] - for index2671 = 0 - index2671 < mbt_ffi_load32(iter_base + 92) - index2671 = index2671 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 88) + index2671 * 8 - - let array2668 : Array[SpanData] = [] - for index2669 = 0 - index2669 < mbt_ffi_load32(iter_base + 4) - index2669 = index2669 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index2669 * 80 - - let lifted2667 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2657 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2659 : String? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result2658 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result2658) - } - _ => panic() - } + let array1785 : Array[String] = []; + for index1786 = 0; index1786 < (mbt_ffi_load32((iter_base) + 36)); index1786 = index1786 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1786 * 8) - let lifted2660 : UInt64? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1784 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array2664 : Array[@context.Attribute] = [] - for index2665 = 0 - index2665 < mbt_ffi_load32(iter_base + 68) - index2665 = index2665 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index2665 * 20 - - let result2661 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2663 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result2662 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result2662) - } - _ => panic() - } - - array2664.push(@context.Attribute::{ - key: result2661, - value: lifted2663, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - SpanData::LocalSpan(LocalSpanData::{ - span_id: result2657, - start: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent: lifted2659, - linked_context: lifted2660, - attributes: array2664, - inherited: mbt_ffi_load8_u(iter_base + 72) != 0, - }) - } - 1 => { - let result2666 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - SpanData::ExternalSpan(ExternalSpanData::{ - span_id: result2666, - }) - } - _ => panic() - } - - array2668.push(lifted2667) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array2670.push(array2668) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - - AgentInvocation::AgentInitialization(AgentInitializationParameters::{ - idempotency_key: result2418, - constructor_parameters: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array2615, - defs: array2620, - root: mbt_ffi_load32(iter_base + 56), - }, - value: @types.SchemaValueTree::{ - value_nodes: array2651, - root: mbt_ffi_load32(iter_base + 68), - }, - }, - trace_id: result2653, - trace_states: array2655, - invocation_context: array2670, - }) - } - 1 => { - let result2672 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result2673 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let array2870 : Array[@types.SchemaTypeNode] = [] - for index2871 = 0 - index2871 < mbt_ffi_load32(iter_base + 52) - index2871 = index2871 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2871 * 144 - - let lifted2856 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted2680 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2675 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2674 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array1785.push(result1784) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - Option::Some(lifted2674) - } - _ => panic() - } - - let lifted2677 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2676 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1788 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - Option::Some(lifted2676) - } - _ => panic() - } - - let lifted2679 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2678 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2678) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2675, - max: lifted2677, - unit: lifted2679, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted2680) - } - 3 => { - let lifted2687 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2682 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2681 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1787 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - Option::Some(lifted2681) - } - _ => panic() - } - - let lifted2684 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2683 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1787) + } + _ => panic() + } - Option::Some(lifted2683) - } - _ => panic() - } - - let lifted2686 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2685 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2685) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2682, - max: lifted2684, - unit: lifted2686, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted2687) - } - 4 => { - let lifted2694 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2689 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2688 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1791 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { - Option::Some(lifted2688) - } - _ => panic() - } - - let lifted2691 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2690 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1790 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { - Option::Some(lifted2690) - } - _ => panic() - } - - let lifted2693 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2692 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2692) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2689, - max: lifted2691, - unit: lifted2693, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted2694) - } - 5 => { - let lifted2701 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2696 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2695 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - Option::Some(lifted2695) - } - _ => panic() - } - - let lifted2698 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2697 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - Option::Some(lifted2697) - } - _ => panic() - } - - let lifted2700 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2699 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2699) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2696, - max: lifted2698, - unit: lifted2700, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted2701) - } - 6 => { - let lifted2708 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2703 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2702 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - Option::Some(lifted2702) - } - _ => panic() - } - - let lifted2705 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2704 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1789 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - Option::Some(lifted2704) - } - _ => panic() - } - - let lifted2707 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2706 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2706) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2703, - max: lifted2705, - unit: lifted2707, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted2708) - } - 7 => { - let lifted2715 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2710 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2709 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Other(result1789) + } + _ => panic() + } - Option::Some(lifted2709) - } - _ => panic() - } - - let lifted2712 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2711 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted1790) + } + _ => panic() + } - Option::Some(lifted2711) - } - _ => panic() - } - - let lifted2714 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2713 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2713) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2710, - max: lifted2712, - unit: lifted2714, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted2715) - } - 8 => { - let lifted2722 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2717 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2716 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array1792.push(@types.NamedFieldType::{name : result1778, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted1780, aliases : array1782, examples : array1785, deprecated : lifted1788, role : lifted1791}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted2716) - } - _ => panic() - } - - let lifted2719 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2718 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::RecordType(array1792) + } + 15 => { - Option::Some(lifted2718) - } - _ => panic() - } - - let lifted2721 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2720 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2720) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2717, - max: lifted2719, - unit: lifted2721, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted2722) - } - 9 => { - let lifted2729 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2724 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2723 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1809 : Array[@types.VariantCaseType] = []; + for index1810 = 0; index1810 < (mbt_ffi_load32((iter_base) + 12)); index1810 = index1810 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1810 * 72) - Option::Some(lifted2723) - } - _ => panic() - } - - let lifted2726 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2725 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1794 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted2725) - } - _ => panic() - } - - let lifted2728 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2727 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2727) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2724, - max: lifted2726, - unit: lifted2728, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted2729) - } - 10 => { - let lifted2736 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2731 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2730 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1795 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted2730) - } - _ => panic() - } - - let lifted2733 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2732 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted2732) - } - _ => panic() - } - - let lifted2735 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2734 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2734) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2731, - max: lifted2733, - unit: lifted2735, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted2736) - } - 11 => { - let lifted2743 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2738 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2737 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1797 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted2737) - } - _ => panic() - } - - let lifted2740 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2739 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1796 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Option::Some(lifted2739) - } - _ => panic() - } - - let lifted2742 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2741 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2741) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2738, - max: lifted2740, - unit: lifted2742, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted2743) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array2758 : Array[@types.NamedFieldType] = [] - for index2759 = 0 - index2759 < mbt_ffi_load32(iter_base + 12) - index2759 = index2759 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2759 * 68 - - let result2744 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2746 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2745 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2745) - } - _ => panic() - } + Option::Some(result1796) + } + _ => panic() + } - let array2748 : Array[String] = [] - for index2749 = 0 - index2749 < mbt_ffi_load32(iter_base + 28) - index2749 = index2749 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2749 * 8 + let array1799 : Array[String] = []; + for index1800 = 0; index1800 < (mbt_ffi_load32((iter_base) + 32)); index1800 = index1800 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1800 * 8) - let result2747 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1798 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array2748.push(result2747) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + array1799.push(result1798) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let array2751 : Array[String] = [] - for index2752 = 0 - index2752 < mbt_ffi_load32(iter_base + 36) - index2752 = index2752 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index2752 * 8 + let array1802 : Array[String] = []; + for index1803 = 0; index1803 < (mbt_ffi_load32((iter_base) + 40)); index1803 = index1803 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index1803 * 8) - let result2750 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1801 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array2751.push(result2750) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted2754 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result2753 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result2753) - } - _ => panic() - } + array1802.push(result1801) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - let lifted2757 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted2756 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2755 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + let lifted1805 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { - @types.Role::Other(result2755) - } - _ => panic() - } + let result1804 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - Option::Some(lifted2756) - } - _ => panic() - } + Option::Some(result1804) + } + _ => panic() + } - array2758.push(@types.NamedFieldType::{ - name: result2744, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted2746, - aliases: array2748, - examples: array2751, - deprecated: lifted2754, - role: lifted2757, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array2758) - } - 15 => { - let array2775 : Array[@types.VariantCaseType] = [] - for index2776 = 0 - index2776 < mbt_ffi_load32(iter_base + 12) - index2776 = index2776 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2776 * 72 - - let result2760 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2761 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted1808 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - let lifted2763 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2762 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2762) - } - _ => panic() - } + let lifted1807 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { - let array2765 : Array[String] = [] - for index2766 = 0 - index2766 < mbt_ffi_load32(iter_base + 32) - index2766 = index2766 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2766 * 8 + @types.Role::Multimodal + } + 1 => { - let result2764 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.Role::UnstructuredText + } + 2 => { - array2765.push(result2764) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + @types.Role::UnstructuredBinary + } + 3 => { - let array2768 : Array[String] = [] - for index2769 = 0 - index2769 < mbt_ffi_load32(iter_base + 40) - index2769 = index2769 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index2769 * 8 + let result1806 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) - let result2767 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.Role::Other(result1806) + } + _ => panic() + } - array2768.push(result2767) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted2771 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result2770 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result2770) - } - _ => panic() - } + Option::Some(lifted1807) + } + _ => panic() + } - let lifted2774 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted2773 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2772 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + array1809.push(@types.VariantCaseType::{name : result1794, payload : lifted1795, metadata : @types.MetadataEnvelope::{doc : lifted1797, aliases : array1799, examples : array1802, deprecated : lifted1805, role : lifted1808}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.Role::Other(result2772) - } - _ => panic() - } + @types.SchemaTypeBody::VariantType(array1809) + } + 16 => { - Option::Some(lifted2773) - } - _ => panic() - } + let array1812 : Array[String] = []; + for index1813 = 0; index1813 < (mbt_ffi_load32((iter_base) + 12)); index1813 = index1813 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1813 * 8) - array2775.push(@types.VariantCaseType::{ - name: result2760, - payload: lifted2761, - metadata: @types.MetadataEnvelope::{ - doc: lifted2763, - aliases: array2765, - examples: array2768, - deprecated: lifted2771, - role: lifted2774, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array2775) - } - 16 => { - let array2778 : Array[String] = [] - for index2779 = 0 - index2779 < mbt_ffi_load32(iter_base + 12) - index2779 = index2779 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2779 * 8 - - let result2777 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2778.push(result2777) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array2778) - } - 17 => { - let array2781 : Array[String] = [] - for index2782 = 0 - index2782 < mbt_ffi_load32(iter_base + 12) - index2782 = index2782 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2782 * 8 - - let result2780 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2781.push(result2780) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array2781) - } - 18 => { - let array2783 : Array[Int] = [] - for index2784 = 0 - index2784 < mbt_ffi_load32(iter_base + 12) - index2784 = index2784 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2784 * 4 - - array2783.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array2783) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted2785 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted2786 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted2785, - err: lifted2786, - }) - } - 24 => { - let lifted2790 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2788 : Array[String] = [] - for index2789 = 0 - index2789 < mbt_ffi_load32(iter_base + 16) - index2789 = index2789 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2789 * 8 - - let result2787 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2788.push(result2787) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2788) - } - _ => panic() - } - - let lifted2791 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2792 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2794 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2793 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2793) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted2790, - min_length: lifted2791, - max_length: lifted2792, - regex: lifted2794, - }) - } - 25 => { - let lifted2798 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2796 : Array[String] = [] - for index2797 = 0 - index2797 < mbt_ffi_load32(iter_base + 16) - index2797 = index2797 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2797 * 8 - - let result2795 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2796.push(result2795) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2796) - } - _ => panic() - } - - let lifted2799 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2800 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted2798, - min_bytes: lifted2799, - max_bytes: lifted2800, - }) - } - 26 => { - let lifted2804 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array2802 : Array[String] = [] - for index2803 = 0 - index2803 < mbt_ffi_load32(iter_base + 20) - index2803 = index2803 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2803 * 8 - - let result2801 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2802.push(result2801) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array2802) - } - _ => panic() - } - - let lifted2808 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array2806 : Array[String] = [] - for index2807 = 0 - index2807 < mbt_ffi_load32(iter_base + 32) - index2807 = index2807 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2807 * 8 - - let result2805 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2806.push(result2805) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array2806) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted2804, - allowed_extensions: lifted2808, - }) - } - 27 => { - let lifted2812 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2810 : Array[String] = [] - for index2811 = 0 - index2811 < mbt_ffi_load32(iter_base + 16) - index2811 = index2811 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2811 * 8 - - let result2809 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2810.push(result2809) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2810) - } - _ => panic() - } - - let lifted2816 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array2814 : Array[String] = [] - for index2815 = 0 - index2815 < mbt_ffi_load32(iter_base + 28) - index2815 = index2815 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2815 * 8 - - let result2813 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2814.push(result2813) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array2814) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted2812, - allowed_hosts: lifted2816, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result2817 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2819 : Array[String] = [] - for index2820 = 0 - index2820 < mbt_ffi_load32(iter_base + 20) - index2820 = index2820 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2820 * 8 - - let result2818 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2819.push(result2818) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted2822 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2821 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result2821, - }) - } - _ => panic() - } - - let lifted2824 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result2823 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result2823, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result2817, - allowed_suffixes: array2819, - min: lifted2822, - max: lifted2824, - }) - } - 31 => { - let array2848 : Array[@types.UnionBranch] = [] - for index2849 = 0 - index2849 < mbt_ffi_load32(iter_base + 12) - index2849 = index2849 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2849 * 92 - - let result2825 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2834 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result2826 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result2826) - } - 1 => { - let result2827 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result2827) - } - 2 => { - let result2828 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result2828) - } - 3 => { - let result2829 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result2829) - } - 4 => { - let result2830 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted2832 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2831 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let result1811 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(result2831) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result2830, - literal: lifted2832, - }) - } - 5 => { - let result2833 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result2833) - } - _ => panic() - } + array1812.push(result1811) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted2836 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2835 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2835) - } - _ => panic() - } + @types.SchemaTypeBody::EnumType(array1812) + } + 17 => { - let array2838 : Array[String] = [] - for index2839 = 0 - index2839 < mbt_ffi_load32(iter_base + 52) - index2839 = index2839 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2839 * 8 + let array1815 : Array[String] = []; + for index1816 = 0; index1816 < (mbt_ffi_load32((iter_base) + 12)); index1816 = index1816 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1816 * 8) - let result2837 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1814 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array2838.push(result2837) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + array1815.push(result1814) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array2841 : Array[String] = [] - for index2842 = 0 - index2842 < mbt_ffi_load32(iter_base + 60) - index2842 = index2842 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2842 * 8 + @types.SchemaTypeBody::FlagsType(array1815) + } + 18 => { - let result2840 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array1817 : Array[Int] = []; + for index1818 = 0; index1818 < (mbt_ffi_load32((iter_base) + 12)); index1818 = index1818 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1818 * 4) - array2841.push(result2840) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted2844 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2843 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2843) - } - _ => panic() - } + array1817.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted2847 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted2846 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2845 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @types.SchemaTypeBody::TupleType(array1817) + } + 19 => { - @types.Role::Other(result2845) - } - _ => panic() - } + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { - Option::Some(lifted2846) - } - _ => panic() - } + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { - array2848.push(@types.UnionBranch::{ - tag: result2825, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted2834, - metadata: @types.MetadataEnvelope::{ - doc: lifted2836, - aliases: array2838, - examples: array2841, - deprecated: lifted2844, - role: lifted2847, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array2848, - }) - } - 32 => { - let lifted2851 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2850 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2850) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted2851, - }) - } - 33 => { - let lifted2853 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2852 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2852) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted2853, - }) - } - 34 => { - let lifted2854 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted2854) - } - 35 => { - let lifted2855 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted2855) - } - _ => panic() - } + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { - let lifted2858 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result2857 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result2857) - } - _ => panic() - } + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { - let array2860 : Array[String] = [] - for index2861 = 0 - index2861 < mbt_ffi_load32(iter_base + 104) - index2861 = index2861 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index2861 * 8 + let lifted1819 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let result2859 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - array2860.push(result2859) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let lifted1820 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let array2863 : Array[String] = [] - for index2864 = 0 - index2864 < mbt_ffi_load32(iter_base + 112) - index2864 = index2864 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index2864 * 8 + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } - let result2862 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted1819, err : lifted1820}) + } + 24 => { - array2863.push(result2862) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted2866 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result2865 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result2865) - } - _ => panic() - } + let lifted1824 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted2869 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted2868 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2867 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result2867) - } - _ => panic() - } + let array1822 : Array[String] = []; + for index1823 = 0; index1823 < (mbt_ffi_load32((iter_base) + 16)); index1823 = index1823 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1823 * 8) - Option::Some(lifted2868) - } - _ => panic() - } + let result1821 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array2870.push(@types.SchemaTypeNode::{ - body: lifted2856, - metadata: @types.MetadataEnvelope::{ - doc: lifted2858, - aliases: array2860, - examples: array2863, - deprecated: lifted2866, - role: lifted2869, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array2875 : Array[@types.SchemaTypeDef] = [] - for index2876 = 0 - index2876 < mbt_ffi_load32(iter_base + 60) - index2876 = index2876 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2876 * 24 - - let result2872 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2874 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2873 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2873) - } - _ => panic() - } + array1822.push(result1821) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - array2875.push(@types.SchemaTypeDef::{ - id: result2872, - name: lifted2874, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let array2906 : Array[@types.SchemaValueNode] = [] - for index2907 = 0 - index2907 < mbt_ffi_load32(iter_base + 72) - index2907 = index2907 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + - index2907 * 32 - - let lifted2905 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result2877 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result2877) - } - 13 => { - let array2878 : Array[Int] = [] - for index2879 = 0 - index2879 < mbt_ffi_load32(iter_base + 12) - index2879 = index2879 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2879 * 4 - - array2878.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array2878) - } - 14 => { - let lifted2880 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted2880, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array2881 : Array[Bool] = [] - for index2882 = 0 - index2882 < mbt_ffi_load32(iter_base + 12) - index2882 = index2882 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2882 * 1 - - array2881.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array2881) - } - 17 => { - let array2883 : Array[Int] = [] - for index2884 = 0 - index2884 < mbt_ffi_load32(iter_base + 12) - index2884 = index2884 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2884 * 4 - - array2883.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array2883) - } - 18 => { - let array2885 : Array[Int] = [] - for index2886 = 0 - index2886 < mbt_ffi_load32(iter_base + 12) - index2886 = index2886 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2886 * 4 - - array2885.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array2885) - } - 19 => { - let array2887 : Array[Int] = [] - for index2888 = 0 - index2888 < mbt_ffi_load32(iter_base + 12) - index2888 = index2888 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2888 * 4 - - array2887.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array2887) - } - 20 => { - let array2889 : Array[@types.MapEntry] = [] - for index2890 = 0 - index2890 < mbt_ffi_load32(iter_base + 12) - index2890 = index2890 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2890 * 8 - - array2889.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array2889) - } - 21 => { - let lifted2891 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted2891) - } - 22 => { - let lifted2894 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted2892 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted2892) - } - 1 => { - let lifted2893 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted2893) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted2894) - } - 23 => { - let result2895 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2897 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2896 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2896) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result2895, - language: lifted2897, - }) - } - 24 => { - let result2898 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2900 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2899 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2899) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result2898, - mime_type: lifted2900, - }) - } - 25 => { - let result2901 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result2901) - } - 26 => { - let result2902 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result2902) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result2903 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result2903, - }) - } - 30 => { - let result2904 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result2904, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + Option::Some(array1822) + } + _ => panic() + } - array2906.push(lifted2905) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - let result2908 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 80), - mbt_ffi_load32(iter_base + 84), - ) - - let array2910 : Array[String] = [] - for index2911 = 0 - index2911 < mbt_ffi_load32(iter_base + 92) - index2911 = index2911 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 88) + index2911 * 8 - - let result2909 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2910.push(result2909) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - - let array2925 : Array[Array[SpanData]] = [] - for index2926 = 0 - index2926 < mbt_ffi_load32(iter_base + 100) - index2926 = index2926 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 96) + index2926 * 8 - - let array2923 : Array[SpanData] = [] - for index2924 = 0 - index2924 < mbt_ffi_load32(iter_base + 4) - index2924 = index2924 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index2924 * 80 - - let lifted2922 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2912 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2914 : String? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result2913 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result2913) - } - _ => panic() - } + let lifted1825 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - let lifted2915 : UInt64? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - let array2919 : Array[@context.Attribute] = [] - for index2920 = 0 - index2920 < mbt_ffi_load32(iter_base + 68) - index2920 = index2920 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index2920 * 20 - - let result2916 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2918 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result2917 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result2917) - } - _ => panic() - } - - array2919.push(@context.Attribute::{ - key: result2916, - value: lifted2918, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - SpanData::LocalSpan(LocalSpanData::{ - span_id: result2912, - start: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent: lifted2914, - linked_context: lifted2915, - attributes: array2919, - inherited: mbt_ffi_load8_u(iter_base + 72) != 0, - }) - } - 1 => { - let result2921 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - SpanData::ExternalSpan(ExternalSpanData::{ - span_id: result2921, - }) - } - _ => panic() - } - - array2923.push(lifted2922) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array2925.push(array2923) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 96)) - - AgentInvocation::AgentMethodInvocation(AgentMethodInvocationParameters::{ - idempotency_key: result2672, - method_name: result2673, - function_input: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array2870, - defs: array2875, - root: mbt_ffi_load32(iter_base + 64), - }, - value: @types.SchemaValueTree::{ - value_nodes: array2906, - root: mbt_ffi_load32(iter_base + 76), - }, - }, - trace_id: result2908, - trace_states: array2910, - invocation_context: array2925, - }) - } - 2 => AgentInvocation::SaveSnapshot - 3 => { - let result2927 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result2928 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - AgentInvocation::LoadSnapshot(LoadSnapshotParameters::{ - snapshot: SnapshotData::{ - data: result2927, - mime_type: result2928, - }, - }) - } - 4 => { - let result2929 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - AgentInvocation::ProcessOplogEntries(ProcessOplogEntriesParameters::{ - idempotency_key: result2929, - }) - } - 5 => - AgentInvocation::ManualUpdate(ManualUpdateParameters::{ - target_revision: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }) - _ => panic() - } + let lifted1826 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - PublicOplogEntry::PendingAgentInvocation(PendingAgentInvocationParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - invocation: lifted2930, - }) - } - 15 => { - let lifted2933 = match mbt_ffi_load8_u(iter_base + 32) { - 0 => UpdateDescription::AutoUpdate - 1 => { - let result2931 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - let result2932 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - UpdateDescription::SnapshotBased(@host.Snapshot::{ - payload: result2931, - mime_type: result2932, - }) - } - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - PublicOplogEntry::PendingUpdate(PendingUpdateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - target_revision: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - description: lifted2933, - }) - } - 16 => { - let array2940 : Array[PluginInstallationDescription] = [] - for index2941 = 0 - index2941 < mbt_ffi_load32(iter_base + 44) - index2941 = index2941 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index2941 * 48 - - let result2934 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - let result2935 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - let array2938 : Array[(String, String)] = [] - for index2939 = 0 - index2939 < mbt_ffi_load32(iter_base + 40) - index2939 = index2939 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index2939 * 16 - - let result2936 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2937 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array2938.push((result2936, result2937)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - array2940.push(PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 16), - plugin_name: result2934, - plugin_version: result2935, - parameters: array2938, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - PublicOplogEntry::SuccessfulUpdate(SuccessfulUpdateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - target_revision: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - new_component_size: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - new_active_plugins: array2940, - }) - } - 17 => { - let lifted2943 : String? = match mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result2942 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result2942) - } - _ => panic() - } + let lifted1828 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - PublicOplogEntry::FailedUpdate(FailedUpdateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - target_revision: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - details: lifted2943, - }) - } - 18 => - PublicOplogEntry::GrowMemory(GrowMemoryParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - delta: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - 19 => - PublicOplogEntry::FilesystemStorageUsageUpdate(FilesystemStorageUsageUpdateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - delta: mbt_ffi_load64(iter_base + 24), - }) - 20 => { - let result2944 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result2945 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - PublicOplogEntry::CreateResource(CreateResourceParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - id: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - name: result2944, - owner: result2945, - }) - } - 21 => { - let result2946 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result2947 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - PublicOplogEntry::DropResource(DropResourceParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - id: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - name: result2946, - owner: result2947, - }) - } - 22 => { - let result2948 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - let result2949 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - PublicOplogEntry::Log(LogParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - level: LogLevel::from(mbt_ffi_load8_u(iter_base + 24)), - context: result2948, - message: result2949, - }) - } - 23 => - PublicOplogEntry::Restart(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - }) - 24 => { - let result2950 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - let result2951 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - let array2954 : Array[(String, String)] = [] - for index2955 = 0 - index2955 < mbt_ffi_load32(iter_base + 64) - index2955 = index2955 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + index2955 * 16 - - let result2952 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2953 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array2954.push((result2952, result2953)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - PublicOplogEntry::ActivatePlugin(ActivatePluginParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - plugin: PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 40), - plugin_name: result2950, - plugin_version: result2951, - parameters: array2954, - }, - }) - } - 25 => { - let result2956 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - let result2957 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - let array2960 : Array[(String, String)] = [] - for index2961 = 0 - index2961 < mbt_ffi_load32(iter_base + 64) - index2961 = index2961 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + index2961 * 16 - - let result2958 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2959 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array2960.push((result2958, result2959)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - PublicOplogEntry::DeactivatePlugin(DeactivatePluginParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - plugin: PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 40), - plugin_name: result2956, - plugin_version: result2957, - parameters: array2960, - }, - }) - } - 26 => - PublicOplogEntry::Revert(RevertParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - dropped_region: OplogRegion::{ - start: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - end: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }) - 27 => { - let result2962 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PublicOplogEntry::CancelPendingInvocation(CancelPendingInvocationParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - idempotency_key: result2962, - }) - } - 28 => { - let result2963 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let lifted2965 : String? = match mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result2964 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result2964) - } - _ => panic() - } + let result1827 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - let lifted2967 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result2966 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result2966) - } - _ => panic() - } + Option::Some(result1827) + } + _ => panic() + } - let array2971 : Array[@context.Attribute] = [] - for index2972 = 0 - index2972 < mbt_ffi_load32(iter_base + 60) - index2972 = index2972 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index2972 * 20 - - let result2968 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2970 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result2969 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result2969) - } - _ => panic() - } - - array2971.push(@context.Attribute::{ - key: result2968, - value: lifted2970, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - PublicOplogEntry::StartSpan(StartSpanParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - span_id: result2963, - parent: lifted2965, - linked_context_id: lifted2967, - attributes: array2971, - }) - } - 29 => { - let result2973 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PublicOplogEntry::FinishSpan(FinishSpanParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - span_id: result2973, - }) - } - 30 => { - let result2974 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let result2975 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let lifted2977 = match mbt_ffi_load8_u(iter_base + 40) { - 0 => { - let result2976 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - @context.AttributeValue::String(result2976) - } - _ => panic() - } + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted1824, min_length : lifted1825, max_length : lifted1826, regex : lifted1828}) + } + 25 => { - PublicOplogEntry::SetSpanAttribute(SetSpanAttributeParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - span_id: result2974, - key: result2975, - value: lifted2977, - }) - } - 31 => { - let lifted2978 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => @host.PersistenceLevel::PersistNothing - 1 => @host.PersistenceLevel::PersistRemoteSideEffects - 2 => @host.PersistenceLevel::Smart - _ => panic() - } + let lifted1832 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - PublicOplogEntry::ChangePersistenceLevel(ChangePersistenceLevelParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - persistence_level: lifted2978, - }) - } - 32 => { - let result2979 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PublicOplogEntry::BeginRemoteTransaction(BeginRemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - transaction_id: result2979, - }) - } - 33 => - PublicOplogEntry::PreCommitRemoteTransaction(RemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - 34 => - PublicOplogEntry::PreRollbackRemoteTransaction(RemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - 35 => - PublicOplogEntry::CommittedRemoteTransaction(RemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - 36 => - PublicOplogEntry::RolledBackRemoteTransaction(RemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - 37 => { - let result2980 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let result2981 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - PublicOplogEntry::Snapshot(SnapshotParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - data: SnapshotData::{ data: result2980, mime_type: result2981 }, - }) - } - 38 => { - let result2982 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - let result2983 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - let array2986 : Array[(String, String)] = [] - for index2987 = 0 - index2987 < mbt_ffi_load32(iter_base + 64) - index2987 = index2987 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + index2987 * 16 - - let result2984 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2985 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array2986.push((result2984, result2985)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - let result2988 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 88), - mbt_ffi_load32(iter_base + 92), - ) - - PublicOplogEntry::OplogProcessorCheckpoint(OplogProcessorCheckpointParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - plugin: PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 40), - plugin_name: result2982, - plugin_version: result2983, - parameters: array2986, - }, - target_agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 72).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 80).reinterpret_as_uint64(), - }, - }, - agent_id: result2988, - }, - confirmed_up_to: mbt_ffi_load64(iter_base + 96).reinterpret_as_uint64(), - sending_up_to: mbt_ffi_load64(iter_base + 104).reinterpret_as_uint64(), - last_batch_start: mbt_ffi_load64(iter_base + 112).reinterpret_as_uint64(), - }) - } - 39 => { - let result2989 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let array3021 : Array[@retry.PredicateNode] = [] - for index3022 = 0 - index3022 < mbt_ffi_load32(iter_base + 40) - index3022 = index3022 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index3022 * 32 - - let lifted3020 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2990 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2992 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2991 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2991) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let array1830 : Array[String] = []; + for index1831 = 0; index1831 < (mbt_ffi_load32((iter_base) + 16)); index1831 = index1831 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1831 * 8) - @retry.PredicateNode::PropEq(@retry.PropertyComparison::{ - property_name: result2990, - value: lifted2992, - }) - } - 1 => { - let result2993 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2995 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2994 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2994) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let result1829 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @retry.PredicateNode::PropNeq(@retry.PropertyComparison::{ - property_name: result2993, - value: lifted2995, - }) - } - 2 => { - let result2996 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2998 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2997 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2997) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + array1830.push(result1829) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - @retry.PredicateNode::PropGt(@retry.PropertyComparison::{ - property_name: result2996, - value: lifted2998, - }) - } - 3 => { - let result2999 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted3001 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result3000 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result3000) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + Option::Some(array1830) + } + _ => panic() + } - @retry.PredicateNode::PropGte(@retry.PropertyComparison::{ - property_name: result2999, - value: lifted3001, - }) - } - 4 => { - let result3002 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted3004 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result3003 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result3003) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let lifted1833 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - @retry.PredicateNode::PropLt(@retry.PropertyComparison::{ - property_name: result3002, - value: lifted3004, - }) - } - 5 => { - let result3005 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted3007 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result3006 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result3006) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - @retry.PredicateNode::PropLte(@retry.PropertyComparison::{ - property_name: result3005, - value: lifted3007, - }) - } - 6 => { - let result3008 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @retry.PredicateNode::PropExists(result3008) - } - 7 => { - let result3009 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array3012 : Array[@retry.PredicateValue] = [] - for index3013 = 0 - index3013 < mbt_ffi_load32(iter_base + 20) - index3013 = index3013 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index3013 * 16 - - let lifted3011 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result3010 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @retry.PredicateValue::Text(result3010) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 8), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - _ => panic() - } - - array3012.push(lifted3011) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - @retry.PredicateNode::PropIn(@retry.PropertySetCheck::{ - property_name: result3009, - values: array3012, - }) - } - 8 => { - let result3014 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result3015 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropMatches(@retry.PropertyPattern::{ - property_name: result3014, - pattern: result3015, - }) - } - 9 => { - let result3016 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result3017 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropStartsWith(@retry.PropertyPattern::{ - property_name: result3016, - pattern: result3017, - }) - } - 10 => { - let result3018 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result3019 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropContains(@retry.PropertyPattern::{ - property_name: result3018, - pattern: result3019, - }) - } - 11 => - @retry.PredicateNode::PredAnd( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 12 => - @retry.PredicateNode::PredOr( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 13 => - @retry.PredicateNode::PredNot(mbt_ffi_load32(iter_base + 8)) - 14 => @retry.PredicateNode::PredTrue - 15 => @retry.PredicateNode::PredFalse - _ => panic() - } - - array3021.push(lifted3020) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array3057 : Array[@retry.PolicyNode] = [] - for index3058 = 0 - index3058 < mbt_ffi_load32(iter_base + 48) - index3058 = index3058 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + index3058 * 32 - - let lifted3056 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @retry.PolicyNode::Periodic( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 1 => - @retry.PolicyNode::Exponential(@retry.ExponentialConfig::{ - base_delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - factor: mbt_ffi_loadf64(iter_base + 16), - }) - 2 => - @retry.PolicyNode::Fibonacci(@retry.FibonacciConfig::{ - first: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - second: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - }) - 3 => @retry.PolicyNode::Immediate - 4 => @retry.PolicyNode::Never - 5 => - @retry.PolicyNode::CountBox(@retry.CountBoxConfig::{ - max_retries: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - inner: mbt_ffi_load32(iter_base + 12), - }) - 6 => - @retry.PolicyNode::TimeBox(@retry.TimeBoxConfig::{ - limit: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 16), - }) - 7 => - @retry.PolicyNode::ClampDelay(@retry.ClampConfig::{ - min_delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - max_delay: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 24), - }) - 8 => - @retry.PolicyNode::AddDelay(@retry.AddDelayConfig::{ - delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 16), - }) - 9 => - @retry.PolicyNode::Jitter(@retry.JitterConfig::{ - factor: mbt_ffi_loadf64(iter_base + 8), - inner: mbt_ffi_load32(iter_base + 16), - }) - 10 => { - let array3054 : Array[@retry.PredicateNode] = [] - for index3055 = 0 - index3055 < mbt_ffi_load32(iter_base + 12) - index3055 = index3055 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3055 * 32 - - let lifted3053 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result3023 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted3025 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result3024 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result3024) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let lifted1834 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - @retry.PredicateNode::PropEq(@retry.PropertyComparison::{ - property_name: result3023, - value: lifted3025, - }) - } - 1 => { - let result3026 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted3028 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result3027 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result3027) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - @retry.PredicateNode::PropNeq(@retry.PropertyComparison::{ - property_name: result3026, - value: lifted3028, - }) - } - 2 => { - let result3029 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted3031 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result3030 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result3030) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted1832, min_bytes : lifted1833, max_bytes : lifted1834}) + } + 26 => { - @retry.PredicateNode::PropGt(@retry.PropertyComparison::{ - property_name: result3029, - value: lifted3031, - }) - } - 3 => { - let result3032 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted3034 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result3033 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result3033) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let lifted1838 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @retry.PredicateNode::PropGte(@retry.PropertyComparison::{ - property_name: result3032, - value: lifted3034, - }) - } - 4 => { - let result3035 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted3037 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result3036 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result3036) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let array1836 : Array[String] = []; + for index1837 = 0; index1837 < (mbt_ffi_load32((iter_base) + 20)); index1837 = index1837 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1837 * 8) - @retry.PredicateNode::PropLt(@retry.PropertyComparison::{ - property_name: result3035, - value: lifted3037, - }) - } - 5 => { - let result3038 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted3040 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result3039 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result3039) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let result1835 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @retry.PredicateNode::PropLte(@retry.PropertyComparison::{ - property_name: result3038, - value: lifted3040, - }) - } - 6 => { - let result3041 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @retry.PredicateNode::PropExists(result3041) - } - 7 => { - let result3042 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array3045 : Array[@retry.PredicateValue] = [] - for index3046 = 0 - index3046 < mbt_ffi_load32(iter_base + 20) - index3046 = index3046 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index3046 * 16 - - let lifted3044 = match - mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result3043 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @retry.PredicateValue::Text(result3043) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 8), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - _ => panic() - } - - array3045.push(lifted3044) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - @retry.PredicateNode::PropIn(@retry.PropertySetCheck::{ - property_name: result3042, - values: array3045, - }) - } - 8 => { - let result3047 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result3048 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropMatches(@retry.PropertyPattern::{ - property_name: result3047, - pattern: result3048, - }) - } - 9 => { - let result3049 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result3050 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropStartsWith(@retry.PropertyPattern::{ - property_name: result3049, - pattern: result3050, - }) - } - 10 => { - let result3051 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result3052 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropContains(@retry.PropertyPattern::{ - property_name: result3051, - pattern: result3052, - }) - } - 11 => - @retry.PredicateNode::PredAnd( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 12 => - @retry.PredicateNode::PredOr( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 13 => - @retry.PredicateNode::PredNot( - mbt_ffi_load32(iter_base + 8), - ) - 14 => @retry.PredicateNode::PredTrue - 15 => @retry.PredicateNode::PredFalse - _ => panic() - } - - array3054.push(lifted3053) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @retry.PolicyNode::FilteredOn(@retry.FilteredConfig::{ - predicate: @retry.RetryPredicate::{ nodes: array3054 }, - inner: mbt_ffi_load32(iter_base + 16), - }) - } - 11 => - @retry.PolicyNode::AndThen( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 12 => - @retry.PolicyNode::PolicyUnion( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 13 => - @retry.PolicyNode::PolicyIntersect( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - _ => panic() - } - - array3057.push(lifted3056) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - PublicOplogEntry::SetRetryPolicy(SetRetryPolicyParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - policy: @retry.NamedRetryPolicy::{ - name: result2989, - priority: mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - predicate: @retry.RetryPredicate::{ nodes: array3021 }, - policy: @retry.RetryPolicy::{ nodes: array3057 }, - }, - }) - } - 40 => { - let result3059 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PublicOplogEntry::RemoveRetryPolicy(RemoveRetryPolicyParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - name: result3059, - }) - } - 41 => { - let lifted3060 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - QueuedCardEvent::Install(QueuedCardEventInstall::{ - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - }) - 1 => - QueuedCardEvent::Revoke(QueuedCardEventRevoke::{ - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - }) - _ => panic() - } + array1836.push(result1835) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - PublicOplogEntry::CardEventQueued(CardEventQueuedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - event: lifted3060, - }) - } - 42 => { - let lifted3061 : UInt64? = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(array1836) + } + _ => panic() + } - PublicOplogEntry::CardInstalled(CardInstalledParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - queued_event_index: lifted3061, - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 48).reinterpret_as_uint64(), - }, - }, - }) - } - 43 => - PublicOplogEntry::CardInstallFailed(CardInstallFailedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - queued_event_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - reason: CardInstallFailure::from(mbt_ffi_load8_u(iter_base + 48)), - }) - 44 => - PublicOplogEntry::CardRevoked(CardRevokedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - queued_event_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - }) - 45 => - PublicOplogEntry::CardExpired(CardExpiredParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }, - }) - 46 => { - let array3258 : Array[@types.SchemaTypeNode] = [] - for index3259 = 0 - index3259 < mbt_ffi_load32(iter_base + 40) - index3259 = index3259 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index3259 * 144 - - let lifted3244 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted3068 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted3063 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted3062 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3062) - } - _ => panic() - } - - let lifted3065 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted3064 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3064) - } - _ => panic() - } - - let lifted3067 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3066 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result3066) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted3063, - max: lifted3065, - unit: lifted3067, - }) - } - _ => panic() - } + let lifted1842 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::S8Type(lifted3068) - } - 3 => { - let lifted3075 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted3070 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted3069 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3069) - } - _ => panic() - } - - let lifted3072 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted3071 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3071) - } - _ => panic() - } - - let lifted3074 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3073 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result3073) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted3070, - max: lifted3072, - unit: lifted3074, - }) - } - _ => panic() - } + let array1840 : Array[String] = []; + for index1841 = 0; index1841 < (mbt_ffi_load32((iter_base) + 32)); index1841 = index1841 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index1841 * 8) - @types.SchemaTypeBody::S16Type(lifted3075) - } - 4 => { - let lifted3082 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted3077 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted3076 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3076) - } - _ => panic() - } - - let lifted3079 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted3078 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3078) - } - _ => panic() - } - - let lifted3081 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3080 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result3080) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted3077, - max: lifted3079, - unit: lifted3081, - }) - } - _ => panic() - } + let result1839 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::S32Type(lifted3082) - } - 5 => { - let lifted3089 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted3084 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted3083 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3083) - } - _ => panic() - } - - let lifted3086 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted3085 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3085) - } - _ => panic() - } - - let lifted3088 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3087 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result3087) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted3084, - max: lifted3086, - unit: lifted3088, - }) - } - _ => panic() - } + array1840.push(result1839) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - @types.SchemaTypeBody::S64Type(lifted3089) - } - 6 => { - let lifted3096 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted3091 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted3090 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3090) - } - _ => panic() - } - - let lifted3093 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted3092 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3092) - } - _ => panic() - } - - let lifted3095 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3094 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result3094) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted3091, - max: lifted3093, - unit: lifted3095, - }) - } - _ => panic() - } + Option::Some(array1840) + } + _ => panic() + } - @types.SchemaTypeBody::U8Type(lifted3096) - } - 7 => { - let lifted3103 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted3098 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted3097 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3097) - } - _ => panic() - } - - let lifted3100 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted3099 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3099) - } - _ => panic() - } - - let lifted3102 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3101 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result3101) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted3098, - max: lifted3100, - unit: lifted3102, - }) - } - _ => panic() - } + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted1838, allowed_extensions : lifted1842}) + } + 27 => { - @types.SchemaTypeBody::U16Type(lifted3103) - } - 8 => { - let lifted3110 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted3105 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted3104 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3104) - } - _ => panic() - } - - let lifted3107 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted3106 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3106) - } - _ => panic() - } - - let lifted3109 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3108 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result3108) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted3105, - max: lifted3107, - unit: lifted3109, - }) - } - _ => panic() - } + let lifted1846 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::U32Type(lifted3110) - } - 9 => { - let lifted3117 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted3112 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted3111 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3111) - } - _ => panic() - } - - let lifted3114 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted3113 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3113) - } - _ => panic() - } - - let lifted3116 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3115 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result3115) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted3112, - max: lifted3114, - unit: lifted3116, - }) - } - _ => panic() - } + let array1844 : Array[String] = []; + for index1845 = 0; index1845 < (mbt_ffi_load32((iter_base) + 16)); index1845 = index1845 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index1845 * 8) - @types.SchemaTypeBody::U64Type(lifted3117) - } - 10 => { - let lifted3124 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted3119 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted3118 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3118) - } - _ => panic() - } - - let lifted3121 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted3120 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3120) - } - _ => panic() - } - - let lifted3123 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3122 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result3122) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted3119, - max: lifted3121, - unit: lifted3123, - }) - } - _ => panic() - } + let result1843 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::F32Type(lifted3124) - } - 11 => { - let lifted3131 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted3126 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted3125 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3125) - } - _ => panic() - } - - let lifted3128 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted3127 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted3127) - } - _ => panic() - } - - let lifted3130 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3129 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result3129) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted3126, - max: lifted3128, - unit: lifted3130, - }) - } - _ => panic() - } + array1844.push(result1843) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::F64Type(lifted3131) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array3146 : Array[@types.NamedFieldType] = [] - for index3147 = 0 - index3147 < mbt_ffi_load32(iter_base + 12) - index3147 = index3147 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3147 * 68 - - let result3132 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted3134 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result3133 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result3133) - } - _ => panic() - } - - let array3136 : Array[String] = [] - for index3137 = 0 - index3137 < mbt_ffi_load32(iter_base + 28) - index3137 = index3137 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index3137 * 8 - - let result3135 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3136.push(result3135) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array3139 : Array[String] = [] - for index3140 = 0 - index3140 < mbt_ffi_load32(iter_base + 36) - index3140 = index3140 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index3140 * 8 - - let result3138 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3139.push(result3138) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted3142 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result3141 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result3141) - } - _ => panic() - } - - let lifted3145 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted3144 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result3143 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result3143) - } - _ => panic() - } + Option::Some(array1844) + } + _ => panic() + } - Option::Some(lifted3144) - } - _ => panic() - } - - array3146.push(@types.NamedFieldType::{ - name: result3132, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted3134, - aliases: array3136, - examples: array3139, - deprecated: lifted3142, - role: lifted3145, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array3146) - } - 15 => { - let array3163 : Array[@types.VariantCaseType] = [] - for index3164 = 0 - index3164 < mbt_ffi_load32(iter_base + 12) - index3164 = index3164 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3164 * 72 - - let result3148 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted3149 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted3151 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result3150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result3150) - } - _ => panic() - } - - let array3153 : Array[String] = [] - for index3154 = 0 - index3154 < mbt_ffi_load32(iter_base + 32) - index3154 = index3154 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index3154 * 8 - - let result3152 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3153.push(result3152) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array3156 : Array[String] = [] - for index3157 = 0 - index3157 < mbt_ffi_load32(iter_base + 40) - index3157 = index3157 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index3157 * 8 - - let result3155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3156.push(result3155) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted3159 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result3158 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result3158) - } - _ => panic() - } - - let lifted3162 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted3161 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result3160 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result3160) - } - _ => panic() - } + let lifted1850 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - Option::Some(lifted3161) - } - _ => panic() - } - - array3163.push(@types.VariantCaseType::{ - name: result3148, - payload: lifted3149, - metadata: @types.MetadataEnvelope::{ - doc: lifted3151, - aliases: array3153, - examples: array3156, - deprecated: lifted3159, - role: lifted3162, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array3163) - } - 16 => { - let array3166 : Array[String] = [] - for index3167 = 0 - index3167 < mbt_ffi_load32(iter_base + 12) - index3167 = index3167 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3167 * 8 - - let result3165 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3166.push(result3165) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array3166) - } - 17 => { - let array3169 : Array[String] = [] - for index3170 = 0 - index3170 < mbt_ffi_load32(iter_base + 12) - index3170 = index3170 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3170 * 8 - - let result3168 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3169.push(result3168) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array3169) - } - 18 => { - let array3171 : Array[Int] = [] - for index3172 = 0 - index3172 < mbt_ffi_load32(iter_base + 12) - index3172 = index3172 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3172 * 4 - - array3171.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array3171) - } - 19 => - @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted3173 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let array1848 : Array[String] = []; + for index1849 = 0; index1849 < (mbt_ffi_load32((iter_base) + 28)); index1849 = index1849 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index1849 * 8) - let lifted3174 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + let result1847 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted3173, - err: lifted3174, - }) - } - 24 => { - let lifted3178 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array3176 : Array[String] = [] - for index3177 = 0 - index3177 < mbt_ffi_load32(iter_base + 16) - index3177 = index3177 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index3177 * 8 - - let result3175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3176.push(result3175) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array3176) - } - _ => panic() - } + array1848.push(result1847) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - let lifted3179 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + Option::Some(array1848) + } + _ => panic() + } - let lifted3180 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted1846, allowed_hosts : lifted1850}) + } + 28 => { - let lifted3182 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result3181 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result3181) - } - _ => panic() - } + @types.SchemaTypeBody::DatetimeType + } + 29 => { - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted3178, - min_length: lifted3179, - max_length: lifted3180, - regex: lifted3182, - }) - } - 25 => { - let lifted3186 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array3184 : Array[String] = [] - for index3185 = 0 - index3185 < mbt_ffi_load32(iter_base + 16) - index3185 = index3185 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index3185 * 8 - - let result3183 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3184.push(result3183) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array3184) - } - _ => panic() - } + @types.SchemaTypeBody::DurationType + } + 30 => { - let lifted3187 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + let result1851 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let lifted3188 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + let array1853 : Array[String] = []; + for index1854 = 0; index1854 < (mbt_ffi_load32((iter_base) + 20)); index1854 = index1854 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index1854 * 8) - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted3186, - min_bytes: lifted3187, - max_bytes: lifted3188, - }) - } - 26 => { - let lifted3192 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array3190 : Array[String] = [] - for index3191 = 0 - index3191 < mbt_ffi_load32(iter_base + 20) - index3191 = index3191 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index3191 * 8 - - let result3189 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3190.push(result3189) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array3190) - } - _ => panic() - } + let result1852 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted3196 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array3194 : Array[String] = [] - for index3195 = 0 - index3195 < mbt_ffi_load32(iter_base + 32) - index3195 = index3195 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index3195 * 8 - - let result3193 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3194.push(result3193) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array3194) - } - _ => panic() - } + array1853.push(result1852) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted3192, - allowed_extensions: lifted3196, - }) - } - 27 => { - let lifted3200 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array3198 : Array[String] = [] - for index3199 = 0 - index3199 < mbt_ffi_load32(iter_base + 16) - index3199 = index3199 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index3199 * 8 - - let result3197 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3198.push(result3197) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array3198) - } - _ => panic() - } + let lifted1856 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let lifted3204 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array3202 : Array[String] = [] - for index3203 = 0 - index3203 < mbt_ffi_load32(iter_base + 28) - index3203 = index3203 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index3203 * 8 - - let result3201 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3202.push(result3201) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array3202) - } - _ => panic() - } + let result1855 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted3200, - allowed_hosts: lifted3204, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result3205 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array3207 : Array[String] = [] - for index3208 = 0 - index3208 < mbt_ffi_load32(iter_base + 20) - index3208 = index3208 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index3208 * 8 - - let result3206 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3207.push(result3206) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted3210 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result3209 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result3209, - }) - } - _ => panic() - } + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result1855}) + } + _ => panic() + } - let lifted3212 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result3211 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result3211, - }) - } - _ => panic() - } + let lifted1858 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result3205, - allowed_suffixes: array3207, - min: lifted3210, - max: lifted3212, - }) - } - 31 => { - let array3236 : Array[@types.UnionBranch] = [] - for index3237 = 0 - index3237 < mbt_ffi_load32(iter_base + 12) - index3237 = index3237 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3237 * 92 - - let result3213 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted3222 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result3214 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result3214) - } - 1 => { - let result3215 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result3215) - } - 2 => { - let result3216 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result3216) - } - 3 => { - let result3217 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result3217) - } - 4 => { - let result3218 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted3220 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result3219 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result3219) - } - _ => panic() - } + let result1857 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result3218, - literal: lifted3220, - }) - } - 5 => { - let result3221 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result3221) - } - _ => panic() - } - - let lifted3224 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result3223 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result3223) - } - _ => panic() - } - - let array3226 : Array[String] = [] - for index3227 = 0 - index3227 < mbt_ffi_load32(iter_base + 52) - index3227 = index3227 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index3227 * 8 - - let result3225 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3226.push(result3225) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array3229 : Array[String] = [] - for index3230 = 0 - index3230 < mbt_ffi_load32(iter_base + 60) - index3230 = index3230 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index3230 * 8 - - let result3228 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3229.push(result3228) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted3232 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3231 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result3231) - } - _ => panic() - } - - let lifted3235 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted3234 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result3233 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result3233) - } - _ => panic() - } + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result1857}) + } + _ => panic() + } - Option::Some(lifted3234) - } - _ => panic() - } - - array3236.push(@types.UnionBranch::{ - tag: result3213, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted3222, - metadata: @types.MetadataEnvelope::{ - doc: lifted3224, - aliases: array3226, - examples: array3229, - deprecated: lifted3232, - role: lifted3235, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array3236, - }) - } - 32 => { - let lifted3239 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result3238 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result3238) - } - _ => panic() - } + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result1851, allowed_suffixes : array1853, min : lifted1856, max : lifted1858}) + } + 31 => { - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted3239, - }) - } - 33 => { - let lifted3241 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result3240 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result3240) - } - _ => panic() - } + let array1882 : Array[@types.UnionBranch] = []; + for index1883 = 0; index1883 < (mbt_ffi_load32((iter_base) + 12)); index1883 = index1883 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1883 * 92) - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted3241, - }) - } - 34 => { - let lifted3242 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result1859 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::FutureType(lifted3242) - } - 35 => { - let lifted3243 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted1868 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { - @types.SchemaTypeBody::StreamType(lifted3243) - } - _ => panic() - } - - let lifted3246 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result3245 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result3245) - } - _ => panic() - } - - let array3248 : Array[String] = [] - for index3249 = 0 - index3249 < mbt_ffi_load32(iter_base + 104) - index3249 = index3249 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index3249 * 8 - - let result3247 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3248.push(result3247) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array3251 : Array[String] = [] - for index3252 = 0 - index3252 < mbt_ffi_load32(iter_base + 112) - index3252 = index3252 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index3252 * 8 - - let result3250 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array3251.push(result3250) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted3254 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result3253 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result3253) - } - _ => panic() - } - - let lifted3257 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted3256 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result3255 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result3255) - } - _ => panic() - } + let result1860 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted3256) - } - _ => panic() - } - - array3258.push(@types.SchemaTypeNode::{ - body: lifted3244, - metadata: @types.MetadataEnvelope::{ - doc: lifted3246, - aliases: array3248, - examples: array3251, - deprecated: lifted3254, - role: lifted3257, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array3263 : Array[@types.SchemaTypeDef] = [] - for index3264 = 0 - index3264 < mbt_ffi_load32(iter_base + 48) - index3264 = index3264 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + index3264 * 24 - - let result3260 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted3262 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result3261 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result3261) - } - _ => panic() - } - - array3263.push(@types.SchemaTypeDef::{ - id: result3260, - name: lifted3262, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - let array3294 : Array[@types.SchemaValueNode] = [] - for index3295 = 0 - index3295 < mbt_ffi_load32(iter_base + 60) - index3295 = index3295 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index3295 * 32 - - let lifted3293 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result3265 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result3265) - } - 13 => { - let array3266 : Array[Int] = [] - for index3267 = 0 - index3267 < mbt_ffi_load32(iter_base + 12) - index3267 = index3267 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3267 * 4 - - array3266.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array3266) - } - 14 => { - let lifted3268 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.DiscriminatorRule::Prefix(result1860) + } + 1 => { - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted3268, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array3269 : Array[Bool] = [] - for index3270 = 0 - index3270 < mbt_ffi_load32(iter_base + 12) - index3270 = index3270 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3270 * 1 - - array3269.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array3269) - } - 17 => { - let array3271 : Array[Int] = [] - for index3272 = 0 - index3272 < mbt_ffi_load32(iter_base + 12) - index3272 = index3272 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3272 * 4 - - array3271.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array3271) - } - 18 => { - let array3273 : Array[Int] = [] - for index3274 = 0 - index3274 < mbt_ffi_load32(iter_base + 12) - index3274 = index3274 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3274 * 4 - - array3273.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array3273) - } - 19 => { - let array3275 : Array[Int] = [] - for index3276 = 0 - index3276 < mbt_ffi_load32(iter_base + 12) - index3276 = index3276 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3276 * 4 - - array3275.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array3275) - } - 20 => { - let array3277 : Array[@types.MapEntry] = [] - for index3278 = 0 - index3278 < mbt_ffi_load32(iter_base + 12) - index3278 = index3278 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index3278 * 8 - - array3277.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array3277) - } - 21 => { - let lifted3279 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result1861 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaValueNode::OptionValue(lifted3279) - } - 22 => { - let lifted3282 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted3280 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted3280) - } - 1 => { - let lifted3281 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted3281) - } - _ => panic() - } + @types.DiscriminatorRule::Suffix(result1861) + } + 2 => { - @types.SchemaValueNode::ResultValue(lifted3282) - } - 23 => { - let result3283 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted3285 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result3284 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result3284) - } - _ => panic() - } + let result1862 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result3283, - language: lifted3285, - }) - } - 24 => { - let result3286 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted3288 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result3287 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result3287) - } - _ => panic() - } + @types.DiscriminatorRule::Contains(result1862) + } + 3 => { - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result3286, - mime_type: lifted3288, - }) - } - 25 => { - let result3289 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result3289) - } - 26 => { - let result3290 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result3290) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result3291 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result3291, - }) - } - 30 => { - let result3292 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result3292, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } - - array3294.push(lifted3293) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - PublicOplogEntry::HostStreamFrame(HostStreamFrameParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - parent_start_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - kind: HostStreamKind::from(mbt_ffi_load8_u(iter_base + 32)), - payload: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array3258, - defs: array3263, - root: mbt_ffi_load32(iter_base + 52), - }, - value: @types.SchemaValueTree::{ - value_nodes: array3294, - root: mbt_ffi_load32(iter_base + 64), - }, - }, - }) - } - 47 => - PublicOplogEntry::CompletionDiscarded(CompletionDiscardedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - start_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - _ => panic() - } - - array3297.push(lifted3296) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Result::Ok(array3297) - } - 1 => { - let result3299 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result3299) - } - _ => panic() - } - let ret = lifted3300 - mbt_ffi_free(ptr) - mbt_ffi_free(address459) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let result1863 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) -///| -pub fn GetOplog::get_oplog( - agent_id : @types.AgentId, - start : UInt64, -) -> GetOplog { - let ptr = mbt_ffi_str2ptr(agent_id.agent_id) - let result : Int = wasmImportConstructorGetOplog( - agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ptr, - agent_id.agent_id.length(), - start.reinterpret_as_int64(), - ) - let ret = GetOplog::GetOplog(result) - mbt_ffi_free(ptr) - return ret -} + @types.DiscriminatorRule::Regex(result1863) + } + 4 => { -///| -pub fn GetOplog::get_next(self : GetOplog) -> Array[PublicOplogEntry]? { - let GetOplog(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodGetOplogGetNext(handle, return_area) - - let lifted2837 : Array[PublicOplogEntry]? = match - mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let array2835 : Array[PublicOplogEntry] = [] - for index2836 = 0 - index2836 < mbt_ffi_load32(return_area + 8) - index2836 = index2836 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index2836 * 208 - - let lifted2834 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let array : Array[(String, String)] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 68) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + index * 16 - - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array.push((result0, result1)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - let lifted : @types.AgentId? = match - mbt_ffi_load8_u(iter_base + 104) { - 0 => Option::None - 1 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 128), - mbt_ffi_load32(iter_base + 132), - ) - - Option::Some(@types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 112).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 120).reinterpret_as_uint64(), - }, - }, - agent_id: result2, - }) - } - _ => panic() - } + let result1864 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let array9 : Array[PluginInstallationDescription] = [] - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 156) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 152) + index10 * 48 - - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - let array7 : Array[(String, String)] = [] - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 40) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index8 * 16 - - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array7.push((result5, result6)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - array9.push(PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 16), - plugin_name: result3, - plugin_version: result4, - parameters: array7, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 152)) - - let array248 : Array[LocalAgentConfigEntry] = [] - for index249 = 0 - index249 < mbt_ffi_load32(iter_base + 164) - index249 = index249 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 160) + index249 * 40 - - let array12 : Array[String] = [] - for index13 = 0 - index13 < mbt_ffi_load32(iter_base + 4) - index13 = index13 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + index13 * 8 - - let result11 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array12.push(result11) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - let array210 : Array[@types.SchemaTypeNode] = [] - for index211 = 0 - index211 < mbt_ffi_load32(iter_base + 12) - index211 = index211 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index211 * 144 - - let lifted196 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted20 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted15 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted14 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1866 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - Option::Some(lifted14) - } - _ => panic() - } + let result1865 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - let lifted17 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted16 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1865) + } + _ => panic() + } - Option::Some(lifted16) - } - _ => panic() - } + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result1864, literal : lifted1866}) + } + 5 => { - let lifted19 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result18) - } - _ => panic() - } + let result1867 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(@types.NumericRestrictions::{ - min: lifted15, - max: lifted17, - unit: lifted19, - }) - } - _ => panic() - } + @types.DiscriminatorRule::FieldAbsent(result1867) + } + _ => panic() + } - @types.SchemaTypeBody::S8Type(lifted20) - } - 3 => { - let lifted27 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted22 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted21 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1870 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - Option::Some(lifted21) - } - _ => panic() - } + let result1869 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - let lifted24 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted23 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1869) + } + _ => panic() + } - Option::Some(lifted23) - } - _ => panic() - } + let array1872 : Array[String] = []; + for index1873 = 0; index1873 < (mbt_ffi_load32((iter_base) + 52)); index1873 = index1873 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index1873 * 8) - let lifted26 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result25 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result25) - } - _ => panic() - } + let result1871 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(@types.NumericRestrictions::{ - min: lifted22, - max: lifted24, - unit: lifted26, - }) - } - _ => panic() - } + array1872.push(result1871) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - @types.SchemaTypeBody::S16Type(lifted27) - } - 4 => { - let lifted34 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted29 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted28 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1875 : Array[String] = []; + for index1876 = 0; index1876 < (mbt_ffi_load32((iter_base) + 60)); index1876 = index1876 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1876 * 8) - Option::Some(lifted28) - } - _ => panic() - } + let result1874 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted31 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted30 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1875.push(result1874) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - Option::Some(lifted30) - } - _ => panic() - } + let lifted1878 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let lifted33 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result32 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result32) - } - _ => panic() - } + let result1877 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - Option::Some(@types.NumericRestrictions::{ - min: lifted29, - max: lifted31, - unit: lifted33, - }) - } - _ => panic() - } + Option::Some(result1877) + } + _ => panic() + } - @types.SchemaTypeBody::S32Type(lifted34) - } - 5 => { - let lifted41 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted36 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted35 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1881 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - Option::Some(lifted35) - } - _ => panic() - } + let lifted1880 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { - let lifted38 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted37 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - Option::Some(lifted37) - } - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - let lifted40 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result39 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result39) - } - _ => panic() - } + let result1879 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - Option::Some(@types.NumericRestrictions::{ - min: lifted36, - max: lifted38, - unit: lifted40, - }) - } - _ => panic() - } + @types.Role::Other(result1879) + } + _ => panic() + } - @types.SchemaTypeBody::S64Type(lifted41) - } - 6 => { - let lifted48 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted43 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted42 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted1880) + } + _ => panic() + } - Option::Some(lifted42) - } - _ => panic() - } + array1882.push(@types.UnionBranch::{tag : result1859, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted1868, metadata : @types.MetadataEnvelope::{doc : lifted1870, aliases : array1872, examples : array1875, deprecated : lifted1878, role : lifted1881}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted45 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted44 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array1882}) + } + 32 => { - Option::Some(lifted44) - } - _ => panic() - } + let lifted1885 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let lifted47 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result46 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result46) - } - _ => panic() - } + let result1884 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(@types.NumericRestrictions::{ - min: lifted43, - max: lifted45, - unit: lifted47, - }) - } - _ => panic() - } + Option::Some(result1884) + } + _ => panic() + } - @types.SchemaTypeBody::U8Type(lifted48) - } - 7 => { - let lifted55 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted50 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted49 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted1885}) + } + 33 => { - Option::Some(lifted49) - } - _ => panic() - } + let lifted1887 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted52 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted51 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1886 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - Option::Some(lifted51) - } - _ => panic() - } + Option::Some(result1886) + } + _ => panic() + } - let lifted54 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result53 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result53) - } - _ => panic() - } + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted1887}) + } + 34 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted50, - max: lifted52, - unit: lifted54, - }) - } - _ => panic() - } + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - @types.SchemaTypeBody::U16Type(lifted55) - } - 8 => { - let lifted62 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted57 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted56 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1888 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted56) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - let lifted59 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted58 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::FutureType(lifted1888) + } + 36 => { - Option::Some(lifted58) - } - _ => panic() - } + let lifted1889 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted61 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result60 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result60) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted57, - max: lifted59, - unit: lifted61, - }) - } - _ => panic() - } + @types.SchemaTypeBody::StreamType(lifted1889) + } + _ => panic() + } - @types.SchemaTypeBody::U32Type(lifted62) - } - 9 => { - let lifted69 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted64 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted63 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1892 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { - Option::Some(lifted63) - } - _ => panic() - } + let result1891 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - let lifted66 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted65 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1891) + } + _ => panic() + } - Option::Some(lifted65) - } - _ => panic() - } + let array1894 : Array[String] = []; + for index1895 = 0; index1895 < (mbt_ffi_load32((iter_base) + 104)); index1895 = index1895 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index1895 * 8) - let lifted68 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result67 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result67) - } - _ => panic() - } + let result1893 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(@types.NumericRestrictions::{ - min: lifted64, - max: lifted66, - unit: lifted68, - }) - } - _ => panic() - } + array1894.push(result1893) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - @types.SchemaTypeBody::U64Type(lifted69) - } - 10 => { - let lifted76 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted71 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted70 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1897 : Array[String] = []; + for index1898 = 0; index1898 < (mbt_ffi_load32((iter_base) + 112)); index1898 = index1898 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index1898 * 8) - Option::Some(lifted70) - } - _ => panic() - } + let result1896 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted73 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted72 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1897.push(result1896) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - Option::Some(lifted72) - } - _ => panic() - } + let lifted1900 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - let lifted75 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result74 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result74) - } - _ => panic() - } + let result1899 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - Option::Some(@types.NumericRestrictions::{ - min: lifted71, - max: lifted73, - unit: lifted75, - }) - } - _ => panic() - } + Option::Some(result1899) + } + _ => panic() + } - @types.SchemaTypeBody::F32Type(lifted76) - } - 11 => { - let lifted83 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted78 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted77 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1903 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - Option::Some(lifted77) - } - _ => panic() - } + let lifted1902 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - let lifted80 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted79 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - Option::Some(lifted79) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - let lifted82 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result81 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result81) - } - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted78, - max: lifted80, - unit: lifted82, - }) - } - _ => panic() - } + let result1901 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - @types.SchemaTypeBody::F64Type(lifted83) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array98 : Array[@types.NamedFieldType] = [] - for index99 = 0 - index99 < mbt_ffi_load32(iter_base + 12) - index99 = index99 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index99 * 68 - - let result84 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted86 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result85 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result85) - } - _ => panic() - } - - let array88 : Array[String] = [] - for index89 = 0 - index89 < mbt_ffi_load32(iter_base + 28) - index89 = index89 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index89 * 8 - - let result87 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array88.push(result87) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array91 : Array[String] = [] - for index92 = 0 - index92 < mbt_ffi_load32(iter_base + 36) - index92 = index92 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index92 * 8 - - let result90 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array91.push(result90) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted94 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result93 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result93) - } - _ => panic() - } - - let lifted97 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted96 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result95 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result95) - } - _ => panic() - } - - Option::Some(lifted96) - } - _ => panic() - } - - array98.push(@types.NamedFieldType::{ - name: result84, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted86, - aliases: array88, - examples: array91, - deprecated: lifted94, - role: lifted97, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array98) - } - 15 => { - let array115 : Array[@types.VariantCaseType] = [] - for index116 = 0 - index116 < mbt_ffi_load32(iter_base + 12) - index116 = index116 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index116 * 72 - - let result100 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted101 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted103 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result102 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result102) - } - _ => panic() - } - - let array105 : Array[String] = [] - for index106 = 0 - index106 < mbt_ffi_load32(iter_base + 32) - index106 = index106 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index106 * 8 - - let result104 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array105.push(result104) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array108 : Array[String] = [] - for index109 = 0 - index109 < mbt_ffi_load32(iter_base + 40) - index109 = index109 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index109 * 8 - - let result107 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array108.push(result107) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted111 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result110 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result110) - } - _ => panic() - } - - let lifted114 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted113 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result112 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result112) - } - _ => panic() - } - - Option::Some(lifted113) - } - _ => panic() - } - - array115.push(@types.VariantCaseType::{ - name: result100, - payload: lifted101, - metadata: @types.MetadataEnvelope::{ - doc: lifted103, - aliases: array105, - examples: array108, - deprecated: lifted111, - role: lifted114, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array115) - } - 16 => { - let array118 : Array[String] = [] - for index119 = 0 - index119 < mbt_ffi_load32(iter_base + 12) - index119 = index119 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index119 * 8 - - let result117 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array118.push(result117) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array118) - } - 17 => { - let array121 : Array[String] = [] - for index122 = 0 - index122 < mbt_ffi_load32(iter_base + 12) - index122 = index122 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index122 * 8 - - let result120 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array121.push(result120) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array121) - } - 18 => { - let array123 : Array[Int] = [] - for index124 = 0 - index124 < mbt_ffi_load32(iter_base + 12) - index124 = index124 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index124 * 4 - - array123.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array123) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted125 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted126 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted125, - err: lifted126, - }) - } - 24 => { - let lifted130 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array128 : Array[String] = [] - for index129 = 0 - index129 < mbt_ffi_load32(iter_base + 16) - index129 = index129 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index129 * 8 - - let result127 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array128.push(result127) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array128) - } - _ => panic() - } - - let lifted131 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted132 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted134 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result133 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result133) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted130, - min_length: lifted131, - max_length: lifted132, - regex: lifted134, - }) - } - 25 => { - let lifted138 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array136 : Array[String] = [] - for index137 = 0 - index137 < mbt_ffi_load32(iter_base + 16) - index137 = index137 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index137 * 8 - - let result135 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array136.push(result135) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array136) - } - _ => panic() - } - - let lifted139 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted140 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted138, - min_bytes: lifted139, - max_bytes: lifted140, - }) - } - 26 => { - let lifted144 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array142 : Array[String] = [] - for index143 = 0 - index143 < mbt_ffi_load32(iter_base + 20) - index143 = index143 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index143 * 8 - - let result141 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array142.push(result141) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array142) - } - _ => panic() - } - - let lifted148 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array146 : Array[String] = [] - for index147 = 0 - index147 < mbt_ffi_load32(iter_base + 32) - index147 = index147 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index147 * 8 - - let result145 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array146.push(result145) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array146) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted144, - allowed_extensions: lifted148, - }) - } - 27 => { - let lifted152 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array150 : Array[String] = [] - for index151 = 0 - index151 < mbt_ffi_load32(iter_base + 16) - index151 = index151 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index151 * 8 - - let result149 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array150.push(result149) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array150) - } - _ => panic() - } - - let lifted156 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array154 : Array[String] = [] - for index155 = 0 - index155 < mbt_ffi_load32(iter_base + 28) - index155 = index155 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index155 * 8 - - let result153 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array154.push(result153) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @types.Role::Other(result1901) + } + _ => panic() + } - Option::Some(array154) - } - _ => panic() - } + Option::Some(lifted1902) + } + _ => panic() + } - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted152, - allowed_hosts: lifted156, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result157 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array159 : Array[String] = [] - for index160 = 0 - index160 < mbt_ffi_load32(iter_base + 20) - index160 = index160 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index160 * 8 - - let result158 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array159.push(result158) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted162 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result161 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result161, - }) - } - _ => panic() - } - - let lifted164 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result163 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result163, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result157, - allowed_suffixes: array159, - min: lifted162, - max: lifted164, - }) - } - 31 => { - let array188 : Array[@types.UnionBranch] = [] - for index189 = 0 - index189 < mbt_ffi_load32(iter_base + 12) - index189 = index189 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index189 * 92 - - let result165 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted174 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result166 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result166) - } - 1 => { - let result167 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + array1904.push(@types.SchemaTypeNode::{body : lifted1890, metadata : @types.MetadataEnvelope::{doc : lifted1892, aliases : array1894, examples : array1897, deprecated : lifted1900, role : lifted1903}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - @types.DiscriminatorRule::Suffix(result167) - } - 2 => { - let result168 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let array1909 : Array[@types.SchemaTypeDef] = []; + for index1910 = 0; index1910 < (mbt_ffi_load32((iter_base) + 48)); index1910 = index1910 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index1910 * 24) - @types.DiscriminatorRule::Contains(result168) - } - 3 => { - let result169 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let result1906 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.DiscriminatorRule::Regex(result169) - } - 4 => { - let result170 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted172 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result171 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result171) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result170, - literal: lifted172, - }) - } - 5 => { - let result173 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let lifted1908 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.DiscriminatorRule::FieldAbsent(result173) - } - _ => panic() - } - - let lifted176 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result175) - } - _ => panic() - } - - let array178 : Array[String] = [] - for index179 = 0 - index179 < mbt_ffi_load32(iter_base + 52) - index179 = index179 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index179 * 8 - - let result177 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array178.push(result177) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array181 : Array[String] = [] - for index182 = 0 - index182 < mbt_ffi_load32(iter_base + 60) - index182 = index182 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index182 * 8 - - let result180 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array181.push(result180) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted184 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result183 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result183) - } - _ => panic() - } - - let lifted187 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted186 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result185 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result185) - } - _ => panic() - } - - Option::Some(lifted186) - } - _ => panic() - } - - array188.push(@types.UnionBranch::{ - tag: result165, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted174, - metadata: @types.MetadataEnvelope::{ - doc: lifted176, - aliases: array178, - examples: array181, - deprecated: lifted184, - role: lifted187, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array188, - }) - } - 32 => { - let lifted191 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result190 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result190) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted191, - }) - } - 33 => { - let lifted193 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result192 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result192) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted193, - }) - } - 34 => { - let lifted194 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted194) - } - 35 => { - let lifted195 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted195) - } - _ => panic() - } - - let lifted198 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result197 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result197) - } - _ => panic() - } - - let array200 : Array[String] = [] - for index201 = 0 - index201 < mbt_ffi_load32(iter_base + 104) - index201 = index201 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index201 * 8 - - let result199 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array200.push(result199) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array203 : Array[String] = [] - for index204 = 0 - index204 < mbt_ffi_load32(iter_base + 112) - index204 = index204 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index204 * 8 - - let result202 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array203.push(result202) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted206 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result205 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result205) - } - _ => panic() - } - - let lifted209 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted208 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result207 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result207) - } - _ => panic() - } - - Option::Some(lifted208) - } - _ => panic() - } - - array210.push(@types.SchemaTypeNode::{ - body: lifted196, - metadata: @types.MetadataEnvelope::{ - doc: lifted198, - aliases: array200, - examples: array203, - deprecated: lifted206, - role: lifted209, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - let array215 : Array[@types.SchemaTypeDef] = [] - for index216 = 0 - index216 < mbt_ffi_load32(iter_base + 20) - index216 = index216 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index216 * 24 - - let result212 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted214 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result213 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result213) - } - _ => panic() - } - - array215.push(@types.SchemaTypeDef::{ - id: result212, - name: lifted214, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let array246 : Array[@types.SchemaValueNode] = [] - for index247 = 0 - index247 < mbt_ffi_load32(iter_base + 32) - index247 = index247 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index247 * 32 - - let lifted245 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result217 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result217) - } - 13 => { - let array218 : Array[Int] = [] - for index219 = 0 - index219 < mbt_ffi_load32(iter_base + 12) - index219 = index219 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index219 * 4 - - array218.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array218) - } - 14 => { - let lifted220 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted220, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array221 : Array[Bool] = [] - for index222 = 0 - index222 < mbt_ffi_load32(iter_base + 12) - index222 = index222 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index222 * 1 - - array221.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array221) - } - 17 => { - let array223 : Array[Int] = [] - for index224 = 0 - index224 < mbt_ffi_load32(iter_base + 12) - index224 = index224 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index224 * 4 - - array223.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array223) - } - 18 => { - let array225 : Array[Int] = [] - for index226 = 0 - index226 < mbt_ffi_load32(iter_base + 12) - index226 = index226 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index226 * 4 - - array225.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array225) - } - 19 => { - let array227 : Array[Int] = [] - for index228 = 0 - index228 < mbt_ffi_load32(iter_base + 12) - index228 = index228 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index228 * 4 - - array227.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array227) - } - 20 => { - let array229 : Array[@types.MapEntry] = [] - for index230 = 0 - index230 < mbt_ffi_load32(iter_base + 12) - index230 = index230 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index230 * 8 - - array229.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array229) - } - 21 => { - let lifted231 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted231) - } - 22 => { - let lifted234 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted232 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let result1907 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - @types.ResultValuePayload::OkValue(lifted232) - } - 1 => { - let lifted233 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + Option::Some(result1907) + } + _ => panic() + } - @types.ResultValuePayload::ErrValue(lifted233) - } - _ => panic() - } + array1909.push(@types.SchemaTypeDef::{id : result1906, name : lifted1908, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - @types.SchemaValueNode::ResultValue(lifted234) - } - 23 => { - let result235 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted237 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result236 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result236) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result235, - language: lifted237, - }) - } - 24 => { - let result238 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted240 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result239 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result239) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result238, - mime_type: lifted240, - }) - } - 25 => { - let result241 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let array1940 : Array[@types.SchemaValueNode] = []; + for index1941 = 0; index1941 < (mbt_ffi_load32((iter_base) + 60)); index1941 = index1941 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1941 * 32) - @types.SchemaValueNode::PathValue(result241) - } - 26 => { - let result242 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let lifted1939 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - @types.SchemaValueNode::UrlValue(result242) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result243 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result243, - }) - } - 30 => { - let result244 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result244, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array246.push(lifted245) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - array248.push(LocalAgentConfigEntry::{ - path: array12, - value: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array210, - defs: array215, - root: mbt_ffi_load32(iter_base + 24), - }, - value: @types.SchemaValueTree::{ - value_nodes: array246, - root: mbt_ffi_load32(iter_base + 36), - }, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 160)) - - let lifted250 : @types.Uuid? = match - mbt_ffi_load8_u(iter_base + 168) { - 0 => Option::None - 1 => - Option::Some(@types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 176).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 184).reinterpret_as_uint64(), - }) - _ => panic() - } + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - PublicOplogEntry::Create(CreateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }, - agent_id: result, - }, - agent_mode: AgentMode::from(mbt_ffi_load8_u(iter_base + 48)), - component_revision: mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - env: array, - created_by: @types.AccountId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 72).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 80).reinterpret_as_uint64(), - }, - }, - environment_id: @host.EnvironmentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 88).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 96).reinterpret_as_uint64(), - }, - }, - parent: lifted, - component_size: mbt_ffi_load64(iter_base + 136).reinterpret_as_uint64(), - initial_total_linear_memory_size: mbt_ffi_load64(iter_base + 144).reinterpret_as_uint64(), - initial_active_plugins: array9, - local_agent_config: array248, - original_phantom_id: lifted250, - instance_id: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 192).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 200).reinterpret_as_uint64(), - }, - }) - } - 1 => { - let lifted251 : UInt64? = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - let result252 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let lifted487 : @types.TypedSchemaValue? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => { - let array449 : Array[@types.SchemaTypeNode] = [] - for index450 = 0 - index450 < mbt_ffi_load32(iter_base + 56) - index450 = index450 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 52) + - index450 * 144 - - let lifted435 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted259 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted254 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted253 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - Option::Some(lifted253) - } - _ => panic() - } - - let lifted256 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted255 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - Option::Some(lifted255) - } - _ => panic() - } - - let lifted258 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result257 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result257) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted254, - max: lifted256, - unit: lifted258, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted259) - } - 3 => { - let lifted266 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted261 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted260 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - Option::Some(lifted260) - } - _ => panic() - } - - let lifted263 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted262 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - Option::Some(lifted262) - } - _ => panic() - } - - let lifted265 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result264 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result264) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted261, - max: lifted263, - unit: lifted265, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted266) - } - 4 => { - let lifted273 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted268 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted267 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - Option::Some(lifted267) - } - _ => panic() - } - - let lifted270 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted269 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - Option::Some(lifted269) - } - _ => panic() - } - - let lifted272 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result271 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result271) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted268, - max: lifted270, - unit: lifted272, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted273) - } - 5 => { - let lifted280 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted275 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted274 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - Option::Some(lifted274) - } - _ => panic() - } - - let lifted277 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted276 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - Option::Some(lifted276) - } - _ => panic() - } - - let lifted279 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result278 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result278) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted275, - max: lifted277, - unit: lifted279, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted280) - } - 6 => { - let lifted287 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted282 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted281 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - Option::Some(lifted281) - } - _ => panic() - } - - let lifted284 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted283 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - Option::Some(lifted283) - } - _ => panic() - } - - let lifted286 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result285 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result285) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted282, - max: lifted284, - unit: lifted286, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted287) - } - 7 => { - let lifted294 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted289 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted288 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1911 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted288) - } - _ => panic() - } - - let lifted291 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted290 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::StringValue(result1911) + } + 13 => { - Option::Some(lifted290) - } - _ => panic() - } - - let lifted293 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result292 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result292) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted289, - max: lifted291, - unit: lifted293, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted294) - } - 8 => { - let lifted301 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted296 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted295 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1912 : Array[Int] = []; + for index1913 = 0; index1913 < (mbt_ffi_load32((iter_base) + 12)); index1913 = index1913 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1913 * 4) - Option::Some(lifted295) - } - _ => panic() - } - - let lifted298 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted297 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1912.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted297) - } - _ => panic() - } - - let lifted300 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result299 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result299) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted296, - max: lifted298, - unit: lifted300, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted301) - } - 9 => { - let lifted308 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted303 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted302 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::RecordValue(array1912) + } + 14 => { - Option::Some(lifted302) - } - _ => panic() - } - - let lifted305 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted304 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1914 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted304) - } - _ => panic() - } - - let lifted307 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result306 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result306) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted303, - max: lifted305, - unit: lifted307, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted308) - } - 10 => { - let lifted315 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted310 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted309 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - Option::Some(lifted309) - } - _ => panic() - } - - let lifted312 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted311 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted1914}) + } + 15 => { - Option::Some(lifted311) - } - _ => panic() - } - - let lifted314 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result313 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result313) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted310, - max: lifted312, - unit: lifted314, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted315) - } - 11 => { - let lifted322 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted317 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted316 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - Option::Some(lifted316) - } - _ => panic() - } - - let lifted319 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted318 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array1915 : Array[Bool] = []; + for index1916 = 0; index1916 < (mbt_ffi_load32((iter_base) + 12)); index1916 = index1916 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1916 * 1) - Option::Some(lifted318) - } - _ => panic() - } - - let lifted321 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result320 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result320) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted317, - max: lifted319, - unit: lifted321, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted322) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array337 : Array[@types.NamedFieldType] = [] - for index338 = 0 - index338 < mbt_ffi_load32(iter_base + 12) - index338 = index338 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index338 * 68 - - let result323 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted325 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result324 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result324) - } - _ => panic() - } + array1915.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array327 : Array[String] = [] - for index328 = 0 - index328 < mbt_ffi_load32(iter_base + 28) - index328 = index328 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index328 * 8 + @types.SchemaValueNode::FlagsValue(array1915) + } + 17 => { - let result326 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array1917 : Array[Int] = []; + for index1918 = 0; index1918 < (mbt_ffi_load32((iter_base) + 12)); index1918 = index1918 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1918 * 4) - array327.push(result326) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + array1917.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array330 : Array[String] = [] - for index331 = 0 - index331 < mbt_ffi_load32(iter_base + 36) - index331 = index331 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index331 * 8 + @types.SchemaValueNode::TupleValue(array1917) + } + 18 => { - let result329 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array1919 : Array[Int] = []; + for index1920 = 0; index1920 < (mbt_ffi_load32((iter_base) + 12)); index1920 = index1920 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1920 * 4) - array330.push(result329) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted333 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result332 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result332) - } - _ => panic() - } + array1919.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted336 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted335 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result334 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + @types.SchemaValueNode::ListValue(array1919) + } + 19 => { - @types.Role::Other(result334) - } - _ => panic() - } + let array1921 : Array[Int] = []; + for index1922 = 0; index1922 < (mbt_ffi_load32((iter_base) + 12)); index1922 = index1922 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1922 * 4) - Option::Some(lifted335) - } - _ => panic() - } + array1921.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - array337.push(@types.NamedFieldType::{ - name: result323, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted325, - aliases: array327, - examples: array330, - deprecated: lifted333, - role: lifted336, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array337) - } - 15 => { - let array354 : Array[@types.VariantCaseType] = [] - for index355 = 0 - index355 < mbt_ffi_load32(iter_base + 12) - index355 = index355 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index355 * 72 - - let result339 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted340 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaValueNode::FixedListValue(array1921) + } + 20 => { - let lifted342 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result341 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result341) - } - _ => panic() - } + let array1923 : Array[@types.MapEntry] = []; + for index1924 = 0; index1924 < (mbt_ffi_load32((iter_base) + 12)); index1924 = index1924 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1924 * 8) - let array344 : Array[String] = [] - for index345 = 0 - index345 < mbt_ffi_load32(iter_base + 32) - index345 = index345 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index345 * 8 + array1923.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let result343 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::MapValue(array1923) + } + 21 => { - array344.push(result343) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let lifted1925 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let array347 : Array[String] = [] - for index348 = 0 - index348 < mbt_ffi_load32(iter_base + 40) - index348 = index348 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index348 * 8 + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - let result346 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::OptionValue(lifted1925) + } + 22 => { - array347.push(result346) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted350 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result349 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result349) - } - _ => panic() - } + let lifted1928 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - let lifted353 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted352 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result351 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let lifted1926 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.Role::Other(result351) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - Option::Some(lifted352) - } - _ => panic() - } + @types.ResultValuePayload::OkValue(lifted1926) + } + 1 => { - array354.push(@types.VariantCaseType::{ - name: result339, - payload: lifted340, - metadata: @types.MetadataEnvelope::{ - doc: lifted342, - aliases: array344, - examples: array347, - deprecated: lifted350, - role: lifted353, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array354) - } - 16 => { - let array357 : Array[String] = [] - for index358 = 0 - index358 < mbt_ffi_load32(iter_base + 12) - index358 = index358 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index358 * 8 - - let result356 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array357.push(result356) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array357) - } - 17 => { - let array360 : Array[String] = [] - for index361 = 0 - index361 < mbt_ffi_load32(iter_base + 12) - index361 = index361 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index361 * 8 - - let result359 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array360.push(result359) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array360) - } - 18 => { - let array362 : Array[Int] = [] - for index363 = 0 - index363 < mbt_ffi_load32(iter_base + 12) - index363 = index363 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index363 * 4 - - array362.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array362) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted364 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted365 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted364, - err: lifted365, - }) - } - 24 => { - let lifted369 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array367 : Array[String] = [] - for index368 = 0 - index368 < mbt_ffi_load32(iter_base + 16) - index368 = index368 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index368 * 8 - - let result366 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array367.push(result366) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array367) - } - _ => panic() - } - - let lifted370 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted371 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted373 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result372 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result372) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted369, - min_length: lifted370, - max_length: lifted371, - regex: lifted373, - }) - } - 25 => { - let lifted377 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array375 : Array[String] = [] - for index376 = 0 - index376 < mbt_ffi_load32(iter_base + 16) - index376 = index376 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index376 * 8 - - let result374 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array375.push(result374) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array375) - } - _ => panic() - } - - let lifted378 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted379 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted377, - min_bytes: lifted378, - max_bytes: lifted379, - }) - } - 26 => { - let lifted383 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array381 : Array[String] = [] - for index382 = 0 - index382 < mbt_ffi_load32(iter_base + 20) - index382 = index382 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index382 * 8 - - let result380 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array381.push(result380) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array381) - } - _ => panic() - } - - let lifted387 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array385 : Array[String] = [] - for index386 = 0 - index386 < mbt_ffi_load32(iter_base + 32) - index386 = index386 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index386 * 8 - - let result384 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array385.push(result384) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array385) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted383, - allowed_extensions: lifted387, - }) - } - 27 => { - let lifted391 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array389 : Array[String] = [] - for index390 = 0 - index390 < mbt_ffi_load32(iter_base + 16) - index390 = index390 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index390 * 8 - - let result388 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array389.push(result388) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array389) - } - _ => panic() - } - - let lifted395 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array393 : Array[String] = [] - for index394 = 0 - index394 < mbt_ffi_load32(iter_base + 28) - index394 = index394 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index394 * 8 - - let result392 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array393.push(result392) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array393) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted391, - allowed_hosts: lifted395, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result396 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array398 : Array[String] = [] - for index399 = 0 - index399 < mbt_ffi_load32(iter_base + 20) - index399 = index399 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index399 * 8 - - let result397 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array398.push(result397) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted401 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result400 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result400, - }) - } - _ => panic() - } - - let lifted403 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result402 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result402, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result396, - allowed_suffixes: array398, - min: lifted401, - max: lifted403, - }) - } - 31 => { - let array427 : Array[@types.UnionBranch] = [] - for index428 = 0 - index428 < mbt_ffi_load32(iter_base + 12) - index428 = index428 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index428 * 92 - - let result404 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted413 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result405 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result405) - } - 1 => { - let result406 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result406) - } - 2 => { - let result407 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result407) - } - 3 => { - let result408 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result408) - } - 4 => { - let result409 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted411 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result410 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let lifted1927 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(result410) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result409, - literal: lifted411, - }) - } - 5 => { - let result412 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result412) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let lifted415 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result414 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result414) - } - _ => panic() - } + @types.ResultValuePayload::ErrValue(lifted1927) + } + _ => panic() + } - let array417 : Array[String] = [] - for index418 = 0 - index418 < mbt_ffi_load32(iter_base + 52) - index418 = index418 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index418 * 8 + @types.SchemaValueNode::ResultValue(lifted1928) + } + 23 => { - let result416 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1929 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array417.push(result416) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let lifted1931 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let array420 : Array[String] = [] - for index421 = 0 - index421 < mbt_ffi_load32(iter_base + 60) - index421 = index421 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index421 * 8 + let result1930 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let result419 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(result1930) + } + _ => panic() + } - array420.push(result419) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted423 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result422 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result422) - } - _ => panic() - } + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result1929, language : lifted1931}) + } + 24 => { - let lifted426 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted425 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result424 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + let result1932 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.Role::Other(result424) - } - _ => panic() - } + let lifted1934 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted425) - } - _ => panic() - } + let result1933 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - array427.push(@types.UnionBranch::{ - tag: result404, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted413, - metadata: @types.MetadataEnvelope::{ - doc: lifted415, - aliases: array417, - examples: array420, - deprecated: lifted423, - role: lifted426, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array427, - }) - } - 32 => { - let lifted430 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result429 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result429) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted430, - }) - } - 33 => { - let lifted432 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result431 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result431) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted432, - }) - } - 34 => { - let lifted433 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted433) - } - 35 => { - let lifted434 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted434) - } - _ => panic() - } + Option::Some(result1933) + } + _ => panic() + } - let lifted437 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result436 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result436) - } - _ => panic() - } + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result1932, mime_type : lifted1934}) + } + 25 => { - let array439 : Array[String] = [] - for index440 = 0 - index440 < mbt_ffi_load32(iter_base + 104) - index440 = index440 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index440 * 8 + let result1935 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result438 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::PathValue(result1935) + } + 26 => { - array439.push(result438) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let result1936 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let array442 : Array[String] = [] - for index443 = 0 - index443 < mbt_ffi_load32(iter_base + 112) - index443 = index443 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index443 * 8 + @types.SchemaValueNode::UrlValue(result1936) + } + 27 => { - let result441 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - array442.push(result441) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted445 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result444 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result444) - } - _ => panic() - } + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - let lifted448 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted447 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result446 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result446) - } - _ => panic() - } + let result1937 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Option::Some(lifted447) - } - _ => panic() - } + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result1937}) + } + 30 => { - array449.push(@types.SchemaTypeNode::{ - body: lifted435, - metadata: @types.MetadataEnvelope::{ - doc: lifted437, - aliases: array439, - examples: array442, - deprecated: lifted445, - role: lifted448, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - - let array454 : Array[@types.SchemaTypeDef] = [] - for index455 = 0 - index455 < mbt_ffi_load32(iter_base + 64) - index455 = index455 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + index455 * 24 - - let result451 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted453 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result452 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result452) - } - _ => panic() - } + let result1938 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array454.push(@types.SchemaTypeDef::{ - id: result451, - name: lifted453, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - let array485 : Array[@types.SchemaValueNode] = [] - for index486 = 0 - index486 < mbt_ffi_load32(iter_base + 76) - index486 = index486 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 72) + index486 * 32 - - let lifted484 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result456 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result456) - } - 13 => { - let array457 : Array[Int] = [] - for index458 = 0 - index458 < mbt_ffi_load32(iter_base + 12) - index458 = index458 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index458 * 4 - - array457.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array457) - } - 14 => { - let lifted459 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted459, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array460 : Array[Bool] = [] - for index461 = 0 - index461 < mbt_ffi_load32(iter_base + 12) - index461 = index461 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index461 * 1 - - array460.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array460) - } - 17 => { - let array462 : Array[Int] = [] - for index463 = 0 - index463 < mbt_ffi_load32(iter_base + 12) - index463 = index463 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index463 * 4 - - array462.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array462) - } - 18 => { - let array464 : Array[Int] = [] - for index465 = 0 - index465 < mbt_ffi_load32(iter_base + 12) - index465 = index465 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index465 * 4 - - array464.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array464) - } - 19 => { - let array466 : Array[Int] = [] - for index467 = 0 - index467 < mbt_ffi_load32(iter_base + 12) - index467 = index467 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index467 * 4 - - array466.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array466) - } - 20 => { - let array468 : Array[@types.MapEntry] = [] - for index469 = 0 - index469 < mbt_ffi_load32(iter_base + 12) - index469 = index469 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index469 * 8 - - array468.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array468) - } - 21 => { - let lifted470 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted470) - } - 22 => { - let lifted473 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted471 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted471) - } - 1 => { - let lifted472 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted472) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted473) - } - 23 => { - let result474 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted476 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result475 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result475) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result474, - language: lifted476, - }) - } - 24 => { - let result477 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted479 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result478 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result478) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result477, - mime_type: lifted479, - }) - } - 25 => { - let result480 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result480) - } - 26 => { - let result481 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result481) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result482 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result482, - }) - } - 30 => { - let result483 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result483, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result1938, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - array485.push(lifted484) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 72)) - - Option::Some(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array449, - defs: array454, - root: mbt_ffi_load32(iter_base + 68), - }, - value: @types.SchemaValueTree::{ - value_nodes: array485, - root: mbt_ffi_load32(iter_base + 80), - }, - }) - } - _ => panic() - } + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - let lifted490 = match mbt_ffi_load8_u(iter_base + 88) { - 0 => WrappedFunctionType::ReadLocal - 1 => WrappedFunctionType::WriteLocal - 2 => WrappedFunctionType::ReadRemote - 3 => WrappedFunctionType::WriteRemote - 4 => { - let lifted488 : UInt64? = match - mbt_ffi_load8_u(iter_base + 96) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 104).reinterpret_as_uint64(), - ) - _ => panic() - } - - WrappedFunctionType::WriteRemoteBatched(lifted488) - } - 5 => { - let lifted489 : UInt64? = match - mbt_ffi_load8_u(iter_base + 96) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 104).reinterpret_as_uint64(), - ) - _ => panic() - } - - WrappedFunctionType::WriteRemoteTransaction(lifted489) - } - _ => panic() - } + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - PublicOplogEntry::Start(StartParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - parent_start_index: lifted251, - function_name: result252, - request: lifted487, - durable_function_type: lifted490, - }) - } - 2 => { - let lifted725 : @types.TypedSchemaValue? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let array687 : Array[@types.SchemaTypeNode] = [] - for index688 = 0 - index688 < mbt_ffi_load32(iter_base + 40) - index688 = index688 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index688 * 144 - - let lifted673 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted497 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted492 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted491 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } - Option::Some(lifted491) - } - _ => panic() - } - - let lifted494 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted493 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array1940.push(lifted1939) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - Option::Some(lifted493) - } - _ => panic() - } - - let lifted496 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result495 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result495) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted492, - max: lifted494, - unit: lifted496, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted497) - } - 3 => { - let lifted504 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted499 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted498 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocationResult::AgentMethod(AgentInvocationOutputParameters::{output : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array1904, defs : array1909, root : mbt_ffi_load32((iter_base) + 52)}, value : @types.SchemaValueTree::{value_nodes : array1940, root : mbt_ffi_load32((iter_base) + 64)}}}) + } + 2 => { - Option::Some(lifted498) - } - _ => panic() - } - - let lifted501 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted500 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocationResult::ManualUpdate + } + 3 => { - Option::Some(lifted500) - } - _ => panic() - } - - let lifted503 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result502 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result502) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted499, - max: lifted501, - unit: lifted503, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted504) - } - 4 => { - let lifted511 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted506 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted505 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1943 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - Option::Some(lifted505) - } - _ => panic() - } - - let lifted508 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted507 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1942 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted507) - } - _ => panic() - } - - let lifted510 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result509 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result509) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted506, - max: lifted508, - unit: lifted510, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted511) - } - 5 => { - let lifted518 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted513 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted512 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1942) + } + _ => panic() + } - Option::Some(lifted512) - } - _ => panic() - } - - let lifted515 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted514 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocationResult::LoadSnapshot(FallibleResultParameters::{error : lifted1943}) + } + 4 => { - Option::Some(lifted514) - } - _ => panic() - } - - let lifted517 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result516 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result516) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted513, - max: lifted515, - unit: lifted517, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted518) - } - 6 => { - let lifted525 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted520 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted519 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1944 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) - Option::Some(lifted519) - } - _ => panic() - } - - let lifted522 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted521 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1945 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - Option::Some(lifted521) - } - _ => panic() - } - - let lifted524 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result523 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result523) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted520, - max: lifted522, - unit: lifted524, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted525) - } - 7 => { - let lifted532 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted527 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted526 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocationResult::SaveSnapshot(SaveSnapshotResultParameters::{snapshot : SnapshotData::{data : result1944, mime_type : result1945}}) + } + 5 => { - Option::Some(lifted526) - } - _ => panic() - } - - let lifted529 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted528 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1947 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - Option::Some(lifted528) - } - _ => panic() - } - - let lifted531 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result530 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result530) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted527, - max: lifted529, - unit: lifted531, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted532) - } - 8 => { - let lifted539 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted534 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted533 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1946 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted533) - } - _ => panic() - } - - let lifted536 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted535 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1946) + } + _ => panic() + } - Option::Some(lifted535) - } - _ => panic() - } - - let lifted538 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result537 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result537) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted534, - max: lifted536, - unit: lifted538, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted539) - } - 9 => { - let lifted546 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted541 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted540 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocationResult::ProcessOplogEntries(FallibleResultParameters::{error : lifted1947}) + } + _ => panic() + } - Option::Some(lifted540) - } - _ => panic() - } - - let lifted543 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted542 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1950 : String? = match mbt_ffi_load8_u((iter_base) + 68) { + 0 => Option::None + 1 => { - Option::Some(lifted542) - } - _ => panic() - } - - let lifted545 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result544 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result544) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted541, - max: lifted543, - unit: lifted545, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted546) - } - 10 => { - let lifted553 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted548 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted547 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result1949 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 72), mbt_ffi_load32((iter_base) + 76)) - Option::Some(lifted547) - } - _ => panic() - } - - let lifted550 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted549 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result1949) + } + _ => panic() + } - Option::Some(lifted549) - } - _ => panic() - } - - let lifted552 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result551 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result551) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted548, - max: lifted550, - unit: lifted552, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted553) - } - 11 => { - let lifted560 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted555 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted554 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::AgentInvocationFinished(AgentInvocationFinishedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, result : lifted1948, method_name : lifted1950, consumed_fuel : mbt_ffi_load64((iter_base) + 80), component_revision : (mbt_ffi_load64((iter_base) + 88)).reinterpret_as_uint64()}) } + 6 => { - Option::Some(lifted554) - } - _ => panic() - } - - let lifted557 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted556 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::Suspend(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}) } + 7 => { - Option::Some(lifted556) - } - _ => panic() - } - - let lifted559 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result558 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result558) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted555, - max: lifted557, - unit: lifted559, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted560) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array575 : Array[@types.NamedFieldType] = [] - for index576 = 0 - index576 < mbt_ffi_load32(iter_base + 12) - index576 = index576 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index576 * 68 - - let result561 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted563 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result562 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result562) - } - _ => panic() - } - - let array565 : Array[String] = [] - for index566 = 0 - index566 < mbt_ffi_load32(iter_base + 28) - index566 = index566 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index566 * 8 - - let result564 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1951 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) - array565.push(result564) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let lifted1955 : RetryPolicyState? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { - let array568 : Array[String] = [] - for index569 = 0 - index569 < mbt_ffi_load32(iter_base + 36) - index569 = index569 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index569 * 8 + let array1953 : Array[StateNode] = []; + for index1954 = 0; index1954 < (mbt_ffi_load32((iter_base) + 60)); index1954 = index1954 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index1954 * 16) - let result567 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1952 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - array568.push(result567) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted571 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result570 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result570) - } - _ => panic() - } + StateNode::Counter((mbt_ffi_load32((iter_base) + 4)).reinterpret_as_uint()) + } + 1 => { - let lifted574 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted573 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result572 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + StateNode::Terminal + } + 2 => { - @types.Role::Other(result572) - } - _ => panic() - } + StateNode::Wrapper(mbt_ffi_load32((iter_base) + 4)) + } + 3 => { - Option::Some(lifted573) - } - _ => panic() - } + StateNode::CountBox(CountBoxState::{attempts : (mbt_ffi_load32((iter_base) + 4)).reinterpret_as_uint(), inner : mbt_ffi_load32((iter_base) + 8)}) + } + 4 => { - array575.push(@types.NamedFieldType::{ - name: result561, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted563, - aliases: array565, - examples: array568, - deprecated: lifted571, - role: lifted574, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array575) - } - 15 => { - let array592 : Array[@types.VariantCaseType] = [] - for index593 = 0 - index593 < mbt_ffi_load32(iter_base + 12) - index593 = index593 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index593 * 72 - - let result577 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted578 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + StateNode::AndThen(AndThenState::{left : mbt_ffi_load32((iter_base) + 4), right : mbt_ffi_load32((iter_base) + 8), on_right : (mbt_ffi_load8_u((iter_base) + 12) != 0)}) + } + 5 => { - let lifted580 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result579 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result579) - } - _ => panic() - } + StateNode::Pair(PairState::{left : mbt_ffi_load32((iter_base) + 4), right : mbt_ffi_load32((iter_base) + 8)}) + } + _ => panic() + } - let array582 : Array[String] = [] - for index583 = 0 - index583 < mbt_ffi_load32(iter_base + 32) - index583 = index583 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index583 * 8 + array1953.push(lifted1952) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - let result581 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(RetryPolicyState::{nodes : array1953}) + } + _ => panic() + } - array582.push(result581) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + PublicOplogEntry::Error(ErrorParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, error : result1951, retry_from : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64(), inside_atomic_region : (mbt_ffi_load8_u((iter_base) + 48) != 0), retry_policy_state : lifted1955}) + } + 8 => { - let array585 : Array[String] = [] - for index586 = 0 - index586 < mbt_ffi_load32(iter_base + 40) - index586 = index586 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index586 * 8 + PublicOplogEntry::NoOp(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}) + } + 9 => { - let result584 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + PublicOplogEntry::Jump(JumpParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, jump : OplogRegion::{start : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), end : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}) + } + 10 => { - array585.push(result584) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted588 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result587 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result587) - } - _ => panic() - } + PublicOplogEntry::Interrupted(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}) + } + 11 => { - let lifted591 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted590 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result589 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + PublicOplogEntry::Exited(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}) + } + 12 => { - @types.Role::Other(result589) + PublicOplogEntry::BeginAtomicRegion(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}) } - _ => panic() - } + 13 => { - Option::Some(lifted590) - } - _ => panic() - } + PublicOplogEntry::EndAtomicRegion(EndAtomicRegionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}) + } + 14 => { - array592.push(@types.VariantCaseType::{ - name: result577, - payload: lifted578, - metadata: @types.MetadataEnvelope::{ - doc: lifted580, - aliases: array582, - examples: array585, - deprecated: lifted588, - role: lifted591, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array592) - } - 16 => { - let array595 : Array[String] = [] - for index596 = 0 - index596 < mbt_ffi_load32(iter_base + 12) - index596 = index596 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index596 * 8 - - let result594 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array595.push(result594) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array595) - } - 17 => { - let array598 : Array[String] = [] - for index599 = 0 - index599 < mbt_ffi_load32(iter_base + 12) - index599 = index599 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index599 * 8 - - let result597 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array598.push(result597) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array598) - } - 18 => { - let array600 : Array[Int] = [] - for index601 = 0 - index601 < mbt_ffi_load32(iter_base + 12) - index601 = index601 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index601 * 4 - - array600.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array600) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted602 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted603 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted602, - err: lifted603, - }) - } - 24 => { - let lifted607 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array605 : Array[String] = [] - for index606 = 0 - index606 < mbt_ffi_load32(iter_base + 16) - index606 = index606 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index606 * 8 - - let result604 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array605.push(result604) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array605) - } - _ => panic() - } - - let lifted608 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted609 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted611 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result610 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result610) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted607, - min_length: lifted608, - max_length: lifted609, - regex: lifted611, - }) - } - 25 => { - let lifted615 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array613 : Array[String] = [] - for index614 = 0 - index614 < mbt_ffi_load32(iter_base + 16) - index614 = index614 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index614 * 8 - - let result612 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array613.push(result612) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array613) - } - _ => panic() - } - - let lifted616 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted617 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted615, - min_bytes: lifted616, - max_bytes: lifted617, - }) - } - 26 => { - let lifted621 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array619 : Array[String] = [] - for index620 = 0 - index620 < mbt_ffi_load32(iter_base + 20) - index620 = index620 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index620 * 8 - - let result618 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array619.push(result618) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array619) - } - _ => panic() - } - - let lifted625 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array623 : Array[String] = [] - for index624 = 0 - index624 < mbt_ffi_load32(iter_base + 32) - index624 = index624 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index624 * 8 - - let result622 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array623.push(result622) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array623) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted621, - allowed_extensions: lifted625, - }) - } - 27 => { - let lifted629 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array627 : Array[String] = [] - for index628 = 0 - index628 < mbt_ffi_load32(iter_base + 16) - index628 = index628 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index628 * 8 - - let result626 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array627.push(result626) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array627) - } - _ => panic() - } - - let lifted633 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array631 : Array[String] = [] - for index632 = 0 - index632 < mbt_ffi_load32(iter_base + 28) - index632 = index632 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index632 * 8 - - let result630 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array631.push(result630) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array631) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted629, - allowed_hosts: lifted633, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result634 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array636 : Array[String] = [] - for index637 = 0 - index637 < mbt_ffi_load32(iter_base + 20) - index637 = index637 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index637 * 8 - - let result635 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array636.push(result635) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted639 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result638 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result638, - }) - } - _ => panic() - } - - let lifted641 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result640 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result640, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result634, - allowed_suffixes: array636, - min: lifted639, - max: lifted641, - }) - } - 31 => { - let array665 : Array[@types.UnionBranch] = [] - for index666 = 0 - index666 < mbt_ffi_load32(iter_base + 12) - index666 = index666 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index666 * 92 - - let result642 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted651 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result643 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result643) - } - 1 => { - let result644 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result644) - } - 2 => { - let result645 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result645) - } - 3 => { - let result646 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result646) - } - 4 => { - let result647 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted649 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result648 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let lifted2468 = match (mbt_ffi_load8_u((iter_base) + 32)) { + 0 => { - Option::Some(result648) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result647, - literal: lifted649, - }) - } - 5 => { - let result650 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result650) - } - _ => panic() - } + let result1956 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - let lifted653 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result652 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result652) - } - _ => panic() - } + let array2153 : Array[@types.SchemaTypeNode] = []; + for index2154 = 0; index2154 < (mbt_ffi_load32((iter_base) + 52)); index2154 = index2154 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2154 * 144) - let array655 : Array[String] = [] - for index656 = 0 - index656 < mbt_ffi_load32(iter_base + 52) - index656 = index656 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index656 * 8 + let lifted2139 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let result654 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { - array655.push(result654) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + @types.SchemaTypeBody::BoolType + } + 2 => { - let array658 : Array[String] = [] - for index659 = 0 - index659 < mbt_ffi_load32(iter_base + 60) - index659 = index659 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index659 * 8 + let lifted1963 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let result657 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted1958 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - array658.push(result657) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted661 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result660 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result660) - } - _ => panic() - } + let lifted1957 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let lifted664 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted663 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result662 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - @types.Role::Other(result662) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(lifted663) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - array665.push(@types.UnionBranch::{ - tag: result642, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted651, - metadata: @types.MetadataEnvelope::{ - doc: lifted653, - aliases: array655, - examples: array658, - deprecated: lifted661, - role: lifted664, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array665, - }) - } - 32 => { - let lifted668 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result667 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result667) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted668, - }) - } - 33 => { - let lifted670 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result669 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result669) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted670, - }) - } - 34 => { - let lifted671 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted671) - } - 35 => { - let lifted672 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted672) - } - _ => panic() - } + Option::Some(lifted1957) + } + _ => panic() + } - let lifted675 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result674 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result674) - } - _ => panic() - } + let lifted1960 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - let array677 : Array[String] = [] - for index678 = 0 - index678 < mbt_ffi_load32(iter_base + 104) - index678 = index678 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index678 * 8 + let lifted1959 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let result676 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - array677.push(result676) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - let array680 : Array[String] = [] - for index681 = 0 - index681 < mbt_ffi_load32(iter_base + 112) - index681 = index681 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index681 * 8 + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let result679 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(lifted1959) + } + _ => panic() + } - array680.push(result679) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted683 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result682 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result682) - } - _ => panic() - } + let lifted1962 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let lifted686 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted685 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result684 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result684) - } - _ => panic() - } + let result1961 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - Option::Some(lifted685) - } - _ => panic() - } + Option::Some(result1961) + } + _ => panic() + } - array687.push(@types.SchemaTypeNode::{ - body: lifted673, - metadata: @types.MetadataEnvelope::{ - doc: lifted675, - aliases: array677, - examples: array680, - deprecated: lifted683, - role: lifted686, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array692 : Array[@types.SchemaTypeDef] = [] - for index693 = 0 - index693 < mbt_ffi_load32(iter_base + 48) - index693 = index693 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + index693 * 24 - - let result689 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted691 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result690 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result690) - } - _ => panic() - } + Option::Some(@types.NumericRestrictions::{min : lifted1958, max : lifted1960, unit : lifted1962}) + } + _ => panic() + } - array692.push(@types.SchemaTypeDef::{ - id: result689, - name: lifted691, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - let array723 : Array[@types.SchemaValueNode] = [] - for index724 = 0 - index724 < mbt_ffi_load32(iter_base + 60) - index724 = index724 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index724 * 32 - - let lifted722 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result694 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result694) - } - 13 => { - let array695 : Array[Int] = [] - for index696 = 0 - index696 < mbt_ffi_load32(iter_base + 12) - index696 = index696 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index696 * 4 - - array695.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array695) - } - 14 => { - let lifted697 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted697, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array698 : Array[Bool] = [] - for index699 = 0 - index699 < mbt_ffi_load32(iter_base + 12) - index699 = index699 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index699 * 1 - - array698.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array698) - } - 17 => { - let array700 : Array[Int] = [] - for index701 = 0 - index701 < mbt_ffi_load32(iter_base + 12) - index701 = index701 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index701 * 4 - - array700.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array700) - } - 18 => { - let array702 : Array[Int] = [] - for index703 = 0 - index703 < mbt_ffi_load32(iter_base + 12) - index703 = index703 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index703 * 4 - - array702.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array702) - } - 19 => { - let array704 : Array[Int] = [] - for index705 = 0 - index705 < mbt_ffi_load32(iter_base + 12) - index705 = index705 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index705 * 4 - - array704.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array704) - } - 20 => { - let array706 : Array[@types.MapEntry] = [] - for index707 = 0 - index707 < mbt_ffi_load32(iter_base + 12) - index707 = index707 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index707 * 8 - - array706.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array706) - } - 21 => { - let lifted708 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted708) - } - 22 => { - let lifted711 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted709 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted709) - } - 1 => { - let lifted710 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted710) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted711) - } - 23 => { - let result712 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted714 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result713 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result713) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result712, - language: lifted714, - }) - } - 24 => { - let result715 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted717 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result716 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result716) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result715, - mime_type: lifted717, - }) - } - 25 => { - let result718 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result718) - } - 26 => { - let result719 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result719) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result720 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result720, - }) - } - 30 => { - let result721 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result721, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @types.SchemaTypeBody::S8Type(lifted1963) + } + 3 => { - array723.push(lifted722) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - Option::Some(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array687, - defs: array692, - root: mbt_ffi_load32(iter_base + 52), - }, - value: @types.SchemaValueTree::{ - value_nodes: array723, - root: mbt_ffi_load32(iter_base + 64), - }, - }) - } - _ => panic() - } + let lifted1970 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - PublicOplogEntry::End(EndParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - start_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - response: lifted725, - forced_commit: mbt_ffi_load8_u(iter_base + 68) != 0, - }) - } - 3 => { - let lifted960 : @types.TypedSchemaValue? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let array922 : Array[@types.SchemaTypeNode] = [] - for index923 = 0 - index923 < mbt_ffi_load32(iter_base + 40) - index923 = index923 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index923 * 144 - - let lifted908 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted732 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted727 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted726 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1965 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted726) - } - _ => panic() - } - - let lifted729 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted728 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted1964 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - Option::Some(lifted728) - } - _ => panic() - } - - let lifted731 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result730 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result730) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted727, - max: lifted729, - unit: lifted731, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted732) - } - 3 => { - let lifted739 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted734 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted733 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - Option::Some(lifted733) - } - _ => panic() - } - - let lifted736 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted735 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1964) + } + _ => panic() + } + + let lifted1967 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1966 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1966) + } + _ => panic() + } + + let lifted1969 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1968 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1968) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1965, max : lifted1967, unit : lifted1969}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted1970) + } + 4 => { + + let lifted1977 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1972 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1971 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1971) + } + _ => panic() + } + + let lifted1974 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1973 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1973) + } + _ => panic() + } + + let lifted1976 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1975 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1975) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1972, max : lifted1974, unit : lifted1976}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted1977) + } + 5 => { + + let lifted1984 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1979 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1978 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1978) + } + _ => panic() + } + + let lifted1981 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1980 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1980) + } + _ => panic() + } + + let lifted1983 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1982 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1982) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1979, max : lifted1981, unit : lifted1983}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted1984) + } + 6 => { + + let lifted1991 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1986 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1985 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1985) + } + _ => panic() + } + + let lifted1988 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1987 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1987) + } + _ => panic() + } + + let lifted1990 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1989 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1989) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1986, max : lifted1988, unit : lifted1990}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted1991) + } + 7 => { + + let lifted1998 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted1993 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1992 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1992) + } + _ => panic() + } + + let lifted1995 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1994 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1994) + } + _ => panic() + } + + let lifted1997 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result1996 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result1996) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted1993, max : lifted1995, unit : lifted1997}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted1998) + } + 8 => { + + let lifted2005 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2000 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted1999 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1999) + } + _ => panic() + } + + let lifted2002 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2001 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2001) + } + _ => panic() + } + + let lifted2004 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2003 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2003) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2000, max : lifted2002, unit : lifted2004}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted2005) + } + 9 => { + + let lifted2012 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2007 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2006 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2006) + } + _ => panic() + } + + let lifted2009 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2008 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2008) + } + _ => panic() + } + + let lifted2011 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2010 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2010) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2007, max : lifted2009, unit : lifted2011}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted2012) + } + 10 => { + + let lifted2019 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2014 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2013 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2013) + } + _ => panic() + } + + let lifted2016 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2015 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2015) + } + _ => panic() + } + + let lifted2018 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2017 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2017) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2014, max : lifted2016, unit : lifted2018}) + } + _ => panic() + } - Option::Some(lifted735) - } - _ => panic() - } - - let lifted738 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result737 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result737) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted734, - max: lifted736, - unit: lifted738, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted739) - } - 4 => { - let lifted746 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted741 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted740 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::F32Type(lifted2019) + } + 11 => { - Option::Some(lifted740) - } - _ => panic() - } - - let lifted743 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted742 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2026 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted742) - } - _ => panic() - } - - let lifted745 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result744 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result744) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted741, - max: lifted743, - unit: lifted745, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted746) - } - 5 => { - let lifted753 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted748 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted747 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2021 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted747) - } - _ => panic() - } - - let lifted750 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted749 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2020 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - Option::Some(lifted749) - } - _ => panic() - } - - let lifted752 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result751 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result751) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted748, - max: lifted750, - unit: lifted752, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted753) - } - 6 => { - let lifted760 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted755 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted754 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - Option::Some(lifted754) - } - _ => panic() - } - - let lifted757 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted756 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(lifted756) - } - _ => panic() - } - - let lifted759 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result758 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result758) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted755, - max: lifted757, - unit: lifted759, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted760) - } - 7 => { - let lifted767 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted762 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted761 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - Option::Some(lifted761) - } - _ => panic() - } - - let lifted764 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted763 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted2020) + } + _ => panic() + } - Option::Some(lifted763) - } - _ => panic() - } - - let lifted766 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result765 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result765) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted762, - max: lifted764, - unit: lifted766, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted767) - } - 8 => { - let lifted774 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted769 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted768 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2023 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - Option::Some(lifted768) - } - _ => panic() - } - - let lifted771 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted770 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2022 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - Option::Some(lifted770) - } - _ => panic() - } - - let lifted773 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result772 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result772) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted769, - max: lifted771, - unit: lifted773, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted774) - } - 9 => { - let lifted781 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted776 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted775 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - Option::Some(lifted775) - } - _ => panic() - } - - let lifted778 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted777 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(lifted777) - } - _ => panic() - } - - let lifted780 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result779 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result779) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted776, - max: lifted778, - unit: lifted780, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted781) - } - 10 => { - let lifted788 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted783 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted782 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - Option::Some(lifted782) - } - _ => panic() - } - - let lifted785 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted784 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted2022) + } + _ => panic() + } - Option::Some(lifted784) - } - _ => panic() - } - - let lifted787 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result786 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result786) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted783, - max: lifted785, - unit: lifted787, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted788) - } - 11 => { - let lifted795 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted790 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted789 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2025 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - Option::Some(lifted789) - } - _ => panic() - } - - let lifted792 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted791 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2024 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - Option::Some(lifted791) - } - _ => panic() - } - - let lifted794 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result793 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result793) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted790, - max: lifted792, - unit: lifted794, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted795) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array810 : Array[@types.NamedFieldType] = [] - for index811 = 0 - index811 < mbt_ffi_load32(iter_base + 12) - index811 = index811 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index811 * 68 - - let result796 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted798 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result797 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result797) - } - _ => panic() - } + Option::Some(result2024) + } + _ => panic() + } - let array800 : Array[String] = [] - for index801 = 0 - index801 < mbt_ffi_load32(iter_base + 28) - index801 = index801 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index801 * 8 + Option::Some(@types.NumericRestrictions::{min : lifted2021, max : lifted2023, unit : lifted2025}) + } + _ => panic() + } - let result799 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::F64Type(lifted2026) + } + 12 => { - array800.push(result799) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @types.SchemaTypeBody::CharType + } + 13 => { - let array803 : Array[String] = [] - for index804 = 0 - index804 < mbt_ffi_load32(iter_base + 36) - index804 = index804 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index804 * 8 + @types.SchemaTypeBody::StringType + } + 14 => { - let result802 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array2041 : Array[@types.NamedFieldType] = []; + for index2042 = 0; index2042 < (mbt_ffi_load32((iter_base) + 12)); index2042 = index2042 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2042 * 68) - array803.push(result802) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted806 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result805 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result805) - } - _ => panic() - } + let result2027 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted809 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted808 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result807 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + let lifted2029 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.Role::Other(result807) - } - _ => panic() - } + let result2028 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted808) - } - _ => panic() - } + Option::Some(result2028) + } + _ => panic() + } - array810.push(@types.NamedFieldType::{ - name: result796, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted798, - aliases: array800, - examples: array803, - deprecated: lifted806, - role: lifted809, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array810) - } - 15 => { - let array827 : Array[@types.VariantCaseType] = [] - for index828 = 0 - index828 < mbt_ffi_load32(iter_base + 12) - index828 = index828 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index828 * 72 - - let result812 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted813 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let array2031 : Array[String] = []; + for index2032 = 0; index2032 < (mbt_ffi_load32((iter_base) + 28)); index2032 = index2032 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2032 * 8) - let lifted815 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result814 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result814) - } - _ => panic() - } + let result2030 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array817 : Array[String] = [] - for index818 = 0 - index818 < mbt_ffi_load32(iter_base + 32) - index818 = index818 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index818 * 8 + array2031.push(result2030) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - let result816 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array2034 : Array[String] = []; + for index2035 = 0; index2035 < (mbt_ffi_load32((iter_base) + 36)); index2035 = index2035 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index2035 * 8) - array817.push(result816) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let result2033 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array820 : Array[String] = [] - for index821 = 0 - index821 < mbt_ffi_load32(iter_base + 40) - index821 = index821 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index821 * 8 + array2034.push(result2033) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - let result819 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2037 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - array820.push(result819) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted823 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result822 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result822) - } - _ => panic() - } + let result2036 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - let lifted826 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted825 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result824 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + Option::Some(result2036) + } + _ => panic() + } - @types.Role::Other(result824) - } - _ => panic() - } + let lifted2040 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { - Option::Some(lifted825) - } - _ => panic() - } + let lifted2039 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { - array827.push(@types.VariantCaseType::{ - name: result812, - payload: lifted813, - metadata: @types.MetadataEnvelope::{ - doc: lifted815, - aliases: array817, - examples: array820, - deprecated: lifted823, - role: lifted826, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array827) - } - 16 => { - let array830 : Array[String] = [] - for index831 = 0 - index831 < mbt_ffi_load32(iter_base + 12) - index831 = index831 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index831 * 8 - - let result829 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array830.push(result829) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array830) - } - 17 => { - let array833 : Array[String] = [] - for index834 = 0 - index834 < mbt_ffi_load32(iter_base + 12) - index834 = index834 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index834 * 8 - - let result832 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array833.push(result832) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array833) - } - 18 => { - let array835 : Array[Int] = [] - for index836 = 0 - index836 < mbt_ffi_load32(iter_base + 12) - index836 = index836 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index836 * 4 - - array835.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array835) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted837 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted838 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted837, - err: lifted838, - }) - } - 24 => { - let lifted842 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array840 : Array[String] = [] - for index841 = 0 - index841 < mbt_ffi_load32(iter_base + 16) - index841 = index841 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index841 * 8 - - let result839 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array840.push(result839) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array840) - } - _ => panic() - } - - let lifted843 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted844 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted846 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result845 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result845) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted842, - min_length: lifted843, - max_length: lifted844, - regex: lifted846, - }) - } - 25 => { - let lifted850 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array848 : Array[String] = [] - for index849 = 0 - index849 < mbt_ffi_load32(iter_base + 16) - index849 = index849 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index849 * 8 - - let result847 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array848.push(result847) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array848) - } - _ => panic() - } - - let lifted851 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted852 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted850, - min_bytes: lifted851, - max_bytes: lifted852, - }) - } - 26 => { - let lifted856 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array854 : Array[String] = [] - for index855 = 0 - index855 < mbt_ffi_load32(iter_base + 20) - index855 = index855 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index855 * 8 - - let result853 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array854.push(result853) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array854) - } - _ => panic() - } - - let lifted860 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array858 : Array[String] = [] - for index859 = 0 - index859 < mbt_ffi_load32(iter_base + 32) - index859 = index859 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index859 * 8 - - let result857 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array858.push(result857) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array858) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted856, - allowed_extensions: lifted860, - }) - } - 27 => { - let lifted864 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array862 : Array[String] = [] - for index863 = 0 - index863 < mbt_ffi_load32(iter_base + 16) - index863 = index863 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index863 * 8 - - let result861 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array862.push(result861) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array862) - } - _ => panic() - } - - let lifted868 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array866 : Array[String] = [] - for index867 = 0 - index867 < mbt_ffi_load32(iter_base + 28) - index867 = index867 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index867 * 8 - - let result865 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array866.push(result865) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array866) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted864, - allowed_hosts: lifted868, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result869 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array871 : Array[String] = [] - for index872 = 0 - index872 < mbt_ffi_load32(iter_base + 20) - index872 = index872 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index872 * 8 - - let result870 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array871.push(result870) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted874 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result873 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result873, - }) - } - _ => panic() - } - - let lifted876 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result875 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result875, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result869, - allowed_suffixes: array871, - min: lifted874, - max: lifted876, - }) - } - 31 => { - let array900 : Array[@types.UnionBranch] = [] - for index901 = 0 - index901 < mbt_ffi_load32(iter_base + 12) - index901 = index901 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index901 * 92 - - let result877 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted886 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result878 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result878) - } - 1 => { - let result879 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result879) - } - 2 => { - let result880 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result880) - } - 3 => { - let result881 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result881) - } - 4 => { - let result882 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted884 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result883 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + @types.Role::Multimodal + } + 1 => { - Option::Some(result883) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result882, - literal: lifted884, - }) - } - 5 => { - let result885 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result885) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - let lifted888 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result887 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result887) - } - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - let array890 : Array[String] = [] - for index891 = 0 - index891 < mbt_ffi_load32(iter_base + 52) - index891 = index891 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index891 * 8 + let result2038 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - let result889 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.Role::Other(result2038) + } + _ => panic() + } - array890.push(result889) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + Option::Some(lifted2039) + } + _ => panic() + } - let array893 : Array[String] = [] - for index894 = 0 - index894 < mbt_ffi_load32(iter_base + 60) - index894 = index894 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index894 * 8 + array2041.push(@types.NamedFieldType::{name : result2027, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted2029, aliases : array2031, examples : array2034, deprecated : lifted2037, role : lifted2040}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let result892 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::RecordType(array2041) + } + 15 => { - array893.push(result892) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted896 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result895 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result895) - } - _ => panic() - } + let array2058 : Array[@types.VariantCaseType] = []; + for index2059 = 0; index2059 < (mbt_ffi_load32((iter_base) + 12)); index2059 = index2059 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2059 * 72) - let lifted899 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted898 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result897 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + let result2043 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.Role::Other(result897) - } - _ => panic() - } + let lifted2044 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted898) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - array900.push(@types.UnionBranch::{ - tag: result877, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted886, - metadata: @types.MetadataEnvelope::{ - doc: lifted888, - aliases: array890, - examples: array893, - deprecated: lifted896, - role: lifted899, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array900, - }) - } - 32 => { - let lifted903 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result902 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result902) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted903, - }) - } - 33 => { - let lifted905 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result904 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result904) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted905, - }) - } - 34 => { - let lifted906 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted906) - } - 35 => { - let lifted907 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted907) - } - _ => panic() - } + let lifted2046 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted910 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result909 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result909) - } - _ => panic() - } + let result2045 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let array912 : Array[String] = [] - for index913 = 0 - index913 < mbt_ffi_load32(iter_base + 104) - index913 = index913 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index913 * 8 + Option::Some(result2045) + } + _ => panic() + } - let result911 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array2048 : Array[String] = []; + for index2049 = 0; index2049 < (mbt_ffi_load32((iter_base) + 32)); index2049 = index2049 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2049 * 8) - array912.push(result911) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let result2047 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array915 : Array[String] = [] - for index916 = 0 - index916 < mbt_ffi_load32(iter_base + 112) - index916 = index916 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index916 * 8 + array2048.push(result2047) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let result914 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array2051 : Array[String] = []; + for index2052 = 0; index2052 < (mbt_ffi_load32((iter_base) + 40)); index2052 = index2052 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2052 * 8) - array915.push(result914) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted918 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result917 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result917) - } - _ => panic() - } + let result2050 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted921 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted920 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result919 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result919) - } - _ => panic() - } + array2051.push(result2050) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - Option::Some(lifted920) - } - _ => panic() - } + let lifted2054 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { - array922.push(@types.SchemaTypeNode::{ - body: lifted908, - metadata: @types.MetadataEnvelope::{ - doc: lifted910, - aliases: array912, - examples: array915, - deprecated: lifted918, - role: lifted921, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array927 : Array[@types.SchemaTypeDef] = [] - for index928 = 0 - index928 < mbt_ffi_load32(iter_base + 48) - index928 = index928 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + index928 * 24 - - let result924 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted926 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result925 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result925) - } - _ => panic() - } + let result2053 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - array927.push(@types.SchemaTypeDef::{ - id: result924, - name: lifted926, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - let array958 : Array[@types.SchemaValueNode] = [] - for index959 = 0 - index959 < mbt_ffi_load32(iter_base + 60) - index959 = index959 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index959 * 32 - - let lifted957 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result929 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result929) - } - 13 => { - let array930 : Array[Int] = [] - for index931 = 0 - index931 < mbt_ffi_load32(iter_base + 12) - index931 = index931 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index931 * 4 - - array930.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array930) - } - 14 => { - let lifted932 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted932, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array933 : Array[Bool] = [] - for index934 = 0 - index934 < mbt_ffi_load32(iter_base + 12) - index934 = index934 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index934 * 1 - - array933.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array933) - } - 17 => { - let array935 : Array[Int] = [] - for index936 = 0 - index936 < mbt_ffi_load32(iter_base + 12) - index936 = index936 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index936 * 4 - - array935.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array935) - } - 18 => { - let array937 : Array[Int] = [] - for index938 = 0 - index938 < mbt_ffi_load32(iter_base + 12) - index938 = index938 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index938 * 4 - - array937.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array937) - } - 19 => { - let array939 : Array[Int] = [] - for index940 = 0 - index940 < mbt_ffi_load32(iter_base + 12) - index940 = index940 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index940 * 4 - - array939.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array939) - } - 20 => { - let array941 : Array[@types.MapEntry] = [] - for index942 = 0 - index942 < mbt_ffi_load32(iter_base + 12) - index942 = index942 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index942 * 8 - - array941.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array941) - } - 21 => { - let lifted943 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted943) - } - 22 => { - let lifted946 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted944 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted944) - } - 1 => { - let lifted945 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted945) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted946) - } - 23 => { - let result947 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted949 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result948 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result948) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result947, - language: lifted949, - }) - } - 24 => { - let result950 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted952 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result951 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result951) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result950, - mime_type: lifted952, - }) - } - 25 => { - let result953 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result953) - } - 26 => { - let result954 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result954) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result955 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result955, - }) - } - 30 => { - let result956 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result956, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + Option::Some(result2053) + } + _ => panic() + } - array958.push(lifted957) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - Option::Some(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array922, - defs: array927, - root: mbt_ffi_load32(iter_base + 52), - }, - value: @types.SchemaValueTree::{ - value_nodes: array958, - root: mbt_ffi_load32(iter_base + 64), - }, - }) - } - _ => panic() - } + let lifted2057 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - PublicOplogEntry::Cancelled(CancelledParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - start_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - partial: lifted960, - }) - } - 4 => { - let lifted1473 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => { - let result961 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array1158 : Array[@types.SchemaTypeNode] = [] - for index1159 = 0 - index1159 < mbt_ffi_load32(iter_base + 44) - index1159 = index1159 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + - index1159 * 144 - - let lifted1144 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted968 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted963 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted962 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2056 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { - Option::Some(lifted962) - } - _ => panic() - } - - let lifted965 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted964 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - Option::Some(lifted964) - } - _ => panic() - } - - let lifted967 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result966 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result966) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted963, - max: lifted965, - unit: lifted967, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted968) - } - 3 => { - let lifted975 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted970 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted969 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - Option::Some(lifted969) - } - _ => panic() - } - - let lifted972 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted971 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - Option::Some(lifted971) - } - _ => panic() - } - - let lifted974 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result973 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result973) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted970, - max: lifted972, - unit: lifted974, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted975) - } - 4 => { - let lifted982 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted977 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted976 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2055 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) - Option::Some(lifted976) - } - _ => panic() - } - - let lifted979 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted978 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Other(result2055) + } + _ => panic() + } - Option::Some(lifted978) - } - _ => panic() - } - - let lifted981 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result980 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result980) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted977, - max: lifted979, - unit: lifted981, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted982) - } - 5 => { - let lifted989 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted984 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted983 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted2056) + } + _ => panic() + } - Option::Some(lifted983) - } - _ => panic() - } - - let lifted986 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted985 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2058.push(@types.VariantCaseType::{name : result2043, payload : lifted2044, metadata : @types.MetadataEnvelope::{doc : lifted2046, aliases : array2048, examples : array2051, deprecated : lifted2054, role : lifted2057}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted985) - } - _ => panic() - } - - let lifted988 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result987 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result987) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted984, - max: lifted986, - unit: lifted988, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted989) - } - 6 => { - let lifted996 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted991 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted990 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::VariantType(array2058) + } + 16 => { - Option::Some(lifted990) - } - _ => panic() - } - - let lifted993 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted992 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2061 : Array[String] = []; + for index2062 = 0; index2062 < (mbt_ffi_load32((iter_base) + 12)); index2062 = index2062 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2062 * 8) - Option::Some(lifted992) - } - _ => panic() - } - - let lifted995 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result994 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result994) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted991, - max: lifted993, - unit: lifted995, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted996) - } - 7 => { - let lifted1003 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted998 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted997 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2060 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted997) - } - _ => panic() - } - - let lifted1000 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted999 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2061.push(result2060) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted999) - } - _ => panic() - } - - let lifted1002 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1001 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1001) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted998, - max: lifted1000, - unit: lifted1002, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1003) - } - 8 => { - let lifted1010 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1005 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1004 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::EnumType(array2061) + } + 17 => { - Option::Some(lifted1004) - } - _ => panic() - } - - let lifted1007 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1006 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2064 : Array[String] = []; + for index2065 = 0; index2065 < (mbt_ffi_load32((iter_base) + 12)); index2065 = index2065 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2065 * 8) - Option::Some(lifted1006) - } - _ => panic() - } - - let lifted1009 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1008 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1008) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1005, - max: lifted1007, - unit: lifted1009, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1010) - } - 9 => { - let lifted1017 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1012 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1011 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2063 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1011) - } - _ => panic() - } - - let lifted1014 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1013 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2064.push(result2063) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted1013) - } - _ => panic() - } - - let lifted1016 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1015 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1015) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1012, - max: lifted1014, - unit: lifted1016, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1017) - } - 10 => { - let lifted1024 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1019 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1018 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::FlagsType(array2064) + } + 18 => { - Option::Some(lifted1018) - } - _ => panic() - } - - let lifted1021 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1020 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2066 : Array[Int] = []; + for index2067 = 0; index2067 < (mbt_ffi_load32((iter_base) + 12)); index2067 = index2067 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2067 * 4) - Option::Some(lifted1020) - } - _ => panic() - } - - let lifted1023 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1022 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1022) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1019, - max: lifted1021, - unit: lifted1023, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1024) - } - 11 => { - let lifted1031 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1026 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1025 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2066.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted1025) - } - _ => panic() - } - - let lifted1028 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1027 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::TupleType(array2066) + } + 19 => { - Option::Some(lifted1027) - } - _ => panic() - } - - let lifted1030 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1029 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1029) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1026, - max: lifted1028, - unit: lifted1030, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted1031) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array1046 : Array[@types.NamedFieldType] = [] - for index1047 = 0 - index1047 < mbt_ffi_load32(iter_base + 12) - index1047 = index1047 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1047 * 68 - - let result1032 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1034 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1033 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1033) - } - _ => panic() - } + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { - let array1036 : Array[String] = [] - for index1037 = 0 - index1037 < mbt_ffi_load32(iter_base + 28) - index1037 = index1037 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1037 * 8 + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { - let result1035 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { - array1036.push(result1035) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { - let array1039 : Array[String] = [] - for index1040 = 0 - index1040 < mbt_ffi_load32(iter_base + 36) - index1040 = index1040 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1040 * 8 + let lifted2068 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let result1038 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - array1039.push(result1038) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted1042 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result1041 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result1041) - } - _ => panic() - } + let lifted2069 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted1045 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted1044 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1043 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } - @types.Role::Other(result1043) - } - _ => panic() - } + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted2068, err : lifted2069}) + } + 24 => { - Option::Some(lifted1044) - } - _ => panic() - } + let lifted2073 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array1046.push(@types.NamedFieldType::{ - name: result1032, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted1034, - aliases: array1036, - examples: array1039, - deprecated: lifted1042, - role: lifted1045, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array1046) - } - 15 => { - let array1063 : Array[@types.VariantCaseType] = [] - for index1064 = 0 - index1064 < mbt_ffi_load32(iter_base + 12) - index1064 = index1064 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1064 * 72 - - let result1048 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1049 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let array2071 : Array[String] = []; + for index2072 = 0; index2072 < (mbt_ffi_load32((iter_base) + 16)); index2072 = index2072 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2072 * 8) - let lifted1051 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1050 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1050) - } - _ => panic() - } + let result2070 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array1053 : Array[String] = [] - for index1054 = 0 - index1054 < mbt_ffi_load32(iter_base + 32) - index1054 = index1054 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1054 * 8 + array2071.push(result2070) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let result1052 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(array2071) + } + _ => panic() + } - array1053.push(result1052) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let lifted2074 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - let array1056 : Array[String] = [] - for index1057 = 0 - index1057 < mbt_ffi_load32(iter_base + 40) - index1057 = index1057 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1057 * 8 + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - let result1055 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2075 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - array1056.push(result1055) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted1059 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result1058 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result1058) - } - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - let lifted1062 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted1061 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1060 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let lifted2077 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - @types.Role::Other(result1060) - } - _ => panic() - } + let result2076 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted1061) - } - _ => panic() - } + Option::Some(result2076) + } + _ => panic() + } - array1063.push(@types.VariantCaseType::{ - name: result1048, - payload: lifted1049, - metadata: @types.MetadataEnvelope::{ - doc: lifted1051, - aliases: array1053, - examples: array1056, - deprecated: lifted1059, - role: lifted1062, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array1063) - } - 16 => { - let array1066 : Array[String] = [] - for index1067 = 0 - index1067 < mbt_ffi_load32(iter_base + 12) - index1067 = index1067 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1067 * 8 - - let result1065 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1066.push(result1065) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array1066) - } - 17 => { - let array1069 : Array[String] = [] - for index1070 = 0 - index1070 < mbt_ffi_load32(iter_base + 12) - index1070 = index1070 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1070 * 8 - - let result1068 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1069.push(result1068) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array1069) - } - 18 => { - let array1071 : Array[Int] = [] - for index1072 = 0 - index1072 < mbt_ffi_load32(iter_base + 12) - index1072 = index1072 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1072 * 4 - - array1071.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array1071) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted1073 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted1074 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted1073, - err: lifted1074, - }) - } - 24 => { - let lifted1078 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1076 : Array[String] = [] - for index1077 = 0 - index1077 < mbt_ffi_load32(iter_base + 16) - index1077 = index1077 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1077 * 8 - - let result1075 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1076.push(result1075) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1076) - } - _ => panic() - } - - let lifted1079 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1080 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1082 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1081 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1081) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted1078, - min_length: lifted1079, - max_length: lifted1080, - regex: lifted1082, - }) - } - 25 => { - let lifted1086 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1084 : Array[String] = [] - for index1085 = 0 - index1085 < mbt_ffi_load32(iter_base + 16) - index1085 = index1085 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1085 * 8 - - let result1083 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1084.push(result1083) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1084) - } - _ => panic() - } - - let lifted1087 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1088 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted1086, - min_bytes: lifted1087, - max_bytes: lifted1088, - }) - } - 26 => { - let lifted1092 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array1090 : Array[String] = [] - for index1091 = 0 - index1091 < mbt_ffi_load32(iter_base + 20) - index1091 = index1091 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1091 * 8 - - let result1089 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1090.push(result1089) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array1090) - } - _ => panic() - } - - let lifted1096 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array1094 : Array[String] = [] - for index1095 = 0 - index1095 < mbt_ffi_load32(iter_base + 32) - index1095 = index1095 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1095 * 8 - - let result1093 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1094.push(result1093) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array1094) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted1092, - allowed_extensions: lifted1096, - }) - } - 27 => { - let lifted1100 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1098 : Array[String] = [] - for index1099 = 0 - index1099 < mbt_ffi_load32(iter_base + 16) - index1099 = index1099 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1099 * 8 - - let result1097 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1098.push(result1097) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1098) - } - _ => panic() - } - - let lifted1104 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array1102 : Array[String] = [] - for index1103 = 0 - index1103 < mbt_ffi_load32(iter_base + 28) - index1103 = index1103 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1103 * 8 - - let result1101 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1102.push(result1101) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array1102) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted1100, - allowed_hosts: lifted1104, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result1105 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array1107 : Array[String] = [] - for index1108 = 0 - index1108 < mbt_ffi_load32(iter_base + 20) - index1108 = index1108 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1108 * 8 - - let result1106 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1107.push(result1106) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted1110 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1109 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result1109, - }) - } - _ => panic() - } - - let lifted1112 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result1111 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result1111, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result1105, - allowed_suffixes: array1107, - min: lifted1110, - max: lifted1112, - }) - } - 31 => { - let array1136 : Array[@types.UnionBranch] = [] - for index1137 = 0 - index1137 < mbt_ffi_load32(iter_base + 12) - index1137 = index1137 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1137 * 92 - - let result1113 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1122 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result1114 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result1114) - } - 1 => { - let result1115 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result1115) - } - 2 => { - let result1116 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result1116) - } - 3 => { - let result1117 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result1117) - } - 4 => { - let result1118 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted1120 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1119 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted2073, min_length : lifted2074, max_length : lifted2075, regex : lifted2077}) + } + 25 => { - Option::Some(result1119) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result1118, - literal: lifted1120, - }) - } - 5 => { - let result1121 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result1121) - } - _ => panic() - } + let lifted2081 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted1124 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1123 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1123) - } - _ => panic() - } + let array2079 : Array[String] = []; + for index2080 = 0; index2080 < (mbt_ffi_load32((iter_base) + 16)); index2080 = index2080 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2080 * 8) - let array1126 : Array[String] = [] - for index1127 = 0 - index1127 < mbt_ffi_load32(iter_base + 52) - index1127 = index1127 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1127 * 8 + let result2078 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result1125 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2079.push(result2078) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - array1126.push(result1125) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + Option::Some(array2079) + } + _ => panic() + } - let array1129 : Array[String] = [] - for index1130 = 0 - index1130 < mbt_ffi_load32(iter_base + 60) - index1130 = index1130 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1130 * 8 + let lifted2082 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - let result1128 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - array1129.push(result1128) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted1132 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1131 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1131) - } - _ => panic() - } + let lifted2083 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - let lifted1135 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted1134 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1133 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - @types.Role::Other(result1133) - } - _ => panic() - } + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted2081, min_bytes : lifted2082, max_bytes : lifted2083}) + } + 26 => { - Option::Some(lifted1134) - } - _ => panic() - } + let lifted2087 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - array1136.push(@types.UnionBranch::{ - tag: result1113, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted1122, - metadata: @types.MetadataEnvelope::{ - doc: lifted1124, - aliases: array1126, - examples: array1129, - deprecated: lifted1132, - role: lifted1135, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array1136, - }) - } - 32 => { - let lifted1139 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1138 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1138) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted1139, - }) - } - 33 => { - let lifted1141 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1140 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1140) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted1141, - }) - } - 34 => { - let lifted1142 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted1142) - } - 35 => { - let lifted1143 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted1143) - } - _ => panic() - } + let array2085 : Array[String] = []; + for index2086 = 0; index2086 < (mbt_ffi_load32((iter_base) + 20)); index2086 = index2086 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2086 * 8) - let lifted1146 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result1145 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result1145) - } - _ => panic() - } + let result2084 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array1148 : Array[String] = [] - for index1149 = 0 - index1149 < mbt_ffi_load32(iter_base + 104) - index1149 = index1149 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index1149 * 8 + array2085.push(result2084) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let result1147 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(array2085) + } + _ => panic() + } - array1148.push(result1147) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let lifted2091 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let array1151 : Array[String] = [] - for index1152 = 0 - index1152 < mbt_ffi_load32(iter_base + 112) - index1152 = index1152 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index1152 * 8 + let array2089 : Array[String] = []; + for index2090 = 0; index2090 < (mbt_ffi_load32((iter_base) + 32)); index2090 = index2090 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2090 * 8) - let result1150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2088 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array1151.push(result1150) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted1154 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result1153 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result1153) - } - _ => panic() - } + array2089.push(result2088) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let lifted1157 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted1156 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result1155) - } - _ => panic() - } + Option::Some(array2089) + } + _ => panic() + } - Option::Some(lifted1156) - } - _ => panic() - } + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted2087, allowed_extensions : lifted2091}) + } + 27 => { - array1158.push(@types.SchemaTypeNode::{ - body: lifted1144, - metadata: @types.MetadataEnvelope::{ - doc: lifted1146, - aliases: array1148, - examples: array1151, - deprecated: lifted1154, - role: lifted1157, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let array1163 : Array[@types.SchemaTypeDef] = [] - for index1164 = 0 - index1164 < mbt_ffi_load32(iter_base + 52) - index1164 = index1164 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1164 * 24 - - let result1160 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1162 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1161 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1161) - } - _ => panic() - } + let lifted2095 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array1163.push(@types.SchemaTypeDef::{ - id: result1160, - name: lifted1162, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array1194 : Array[@types.SchemaValueNode] = [] - for index1195 = 0 - index1195 < mbt_ffi_load32(iter_base + 64) - index1195 = index1195 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + - index1195 * 32 - - let lifted1193 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result1165 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result1165) - } - 13 => { - let array1166 : Array[Int] = [] - for index1167 = 0 - index1167 < mbt_ffi_load32(iter_base + 12) - index1167 = index1167 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1167 * 4 - - array1166.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array1166) - } - 14 => { - let lifted1168 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted1168, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1169 : Array[Bool] = [] - for index1170 = 0 - index1170 < mbt_ffi_load32(iter_base + 12) - index1170 = index1170 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1170 * 1 - - array1169.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1169) - } - 17 => { - let array1171 : Array[Int] = [] - for index1172 = 0 - index1172 < mbt_ffi_load32(iter_base + 12) - index1172 = index1172 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1172 * 4 - - array1171.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array1171) - } - 18 => { - let array1173 : Array[Int] = [] - for index1174 = 0 - index1174 < mbt_ffi_load32(iter_base + 12) - index1174 = index1174 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1174 * 4 - - array1173.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array1173) - } - 19 => { - let array1175 : Array[Int] = [] - for index1176 = 0 - index1176 < mbt_ffi_load32(iter_base + 12) - index1176 = index1176 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1176 * 4 - - array1175.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array1175) - } - 20 => { - let array1177 : Array[@types.MapEntry] = [] - for index1178 = 0 - index1178 < mbt_ffi_load32(iter_base + 12) - index1178 = index1178 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1178 * 8 - - array1177.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array1177) - } - 21 => { - let lifted1179 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted1179) - } - 22 => { - let lifted1182 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted1180 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted1180) - } - 1 => { - let lifted1181 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted1181) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted1182) - } - 23 => { - let result1183 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1185 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1184 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1184) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result1183, - language: lifted1185, - }) - } - 24 => { - let result1186 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1188 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1187 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1187) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result1186, - mime_type: lifted1188, - }) - } - 25 => { - let result1189 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result1189) - } - 26 => { - let result1190 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result1190) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result1191 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result1191, - }) - } - 30 => { - let result1192 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result1192, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + let array2093 : Array[String] = []; + for index2094 = 0; index2094 < (mbt_ffi_load32((iter_base) + 16)); index2094 = index2094 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2094 * 8) - array1194.push(lifted1193) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - let result1196 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 72), - mbt_ffi_load32(iter_base + 76), - ) - - let array1198 : Array[String] = [] - for index1199 = 0 - index1199 < mbt_ffi_load32(iter_base + 84) - index1199 = index1199 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 80) + index1199 * 8 - - let result1197 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1198.push(result1197) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 80)) - - let array1213 : Array[Array[SpanData]] = [] - for index1214 = 0 - index1214 < mbt_ffi_load32(iter_base + 92) - index1214 = index1214 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 88) + index1214 * 8 - - let array1211 : Array[SpanData] = [] - for index1212 = 0 - index1212 < mbt_ffi_load32(iter_base + 4) - index1212 = index1212 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index1212 * 80 - - let lifted1210 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result1200 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1202 : String? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result1201 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result1201) - } - _ => panic() - } + let result2092 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted1203 : UInt64? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2093.push(result2092) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let array1207 : Array[@context.Attribute] = [] - for index1208 = 0 - index1208 < mbt_ffi_load32(iter_base + 68) - index1208 = index1208 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index1208 * 20 - - let result1204 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1206 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result1205 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result1205) - } - _ => panic() - } - - array1207.push(@context.Attribute::{ - key: result1204, - value: lifted1206, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - SpanData::LocalSpan(LocalSpanData::{ - span_id: result1200, - start: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent: lifted1202, - linked_context: lifted1203, - attributes: array1207, - inherited: mbt_ffi_load8_u(iter_base + 72) != 0, - }) - } - 1 => { - let result1209 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - SpanData::ExternalSpan(ExternalSpanData::{ - span_id: result1209, - }) - } - _ => panic() - } - - array1211.push(lifted1210) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array1213.push(array1211) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - - AgentInvocation::AgentInitialization(AgentInitializationParameters::{ - idempotency_key: result961, - constructor_parameters: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array1158, - defs: array1163, - root: mbt_ffi_load32(iter_base + 56), - }, - value: @types.SchemaValueTree::{ - value_nodes: array1194, - root: mbt_ffi_load32(iter_base + 68), - }, - }, - trace_id: result1196, - trace_states: array1198, - invocation_context: array1213, - }) - } - 1 => { - let result1215 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result1216 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let array1413 : Array[@types.SchemaTypeNode] = [] - for index1414 = 0 - index1414 < mbt_ffi_load32(iter_base + 52) - index1414 = index1414 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1414 * 144 - - let lifted1399 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted1223 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1218 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1217 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(array2093) + } + _ => panic() + } - Option::Some(lifted1217) - } - _ => panic() - } - - let lifted1220 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1219 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2099 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - Option::Some(lifted1219) - } - _ => panic() - } - - let lifted1222 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1221 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1221) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1218, - max: lifted1220, - unit: lifted1222, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted1223) - } - 3 => { - let lifted1230 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1225 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1224 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2097 : Array[String] = []; + for index2098 = 0; index2098 < (mbt_ffi_load32((iter_base) + 28)); index2098 = index2098 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2098 * 8) - Option::Some(lifted1224) - } - _ => panic() - } - - let lifted1227 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1226 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2096 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1226) - } - _ => panic() - } - - let lifted1229 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1228 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1228) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1225, - max: lifted1227, - unit: lifted1229, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted1230) - } - 4 => { - let lifted1237 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1232 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1231 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2097.push(result2096) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - Option::Some(lifted1231) - } - _ => panic() - } - - let lifted1234 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1233 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(array2097) + } + _ => panic() + } - Option::Some(lifted1233) - } - _ => panic() - } - - let lifted1236 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1235 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1235) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1232, - max: lifted1234, - unit: lifted1236, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted1237) - } - 5 => { - let lifted1244 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1239 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1238 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted2095, allowed_hosts : lifted2099}) + } + 28 => { - Option::Some(lifted1238) - } - _ => panic() - } - - let lifted1241 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1240 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::DatetimeType + } + 29 => { - Option::Some(lifted1240) - } - _ => panic() - } - - let lifted1243 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1242 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1242) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1239, - max: lifted1241, - unit: lifted1243, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted1244) - } - 6 => { - let lifted1251 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1246 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1245 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::DurationType + } + 30 => { - Option::Some(lifted1245) - } - _ => panic() - } - - let lifted1248 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1247 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2100 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1247) - } - _ => panic() - } - - let lifted1250 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1249 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1249) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1246, - max: lifted1248, - unit: lifted1250, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted1251) - } - 7 => { - let lifted1258 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1253 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1252 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2102 : Array[String] = []; + for index2103 = 0; index2103 < (mbt_ffi_load32((iter_base) + 20)); index2103 = index2103 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2103 * 8) - Option::Some(lifted1252) - } - _ => panic() - } - - let lifted1255 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1254 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2101 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1254) - } - _ => panic() - } - - let lifted1257 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1256 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1256) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1253, - max: lifted1255, - unit: lifted1257, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1258) - } - 8 => { - let lifted1265 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1260 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1259 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2102.push(result2101) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - Option::Some(lifted1259) - } - _ => panic() - } - - let lifted1262 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1261 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2105 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - Option::Some(lifted1261) - } - _ => panic() - } - - let lifted1264 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1263 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1263) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1260, - max: lifted1262, - unit: lifted1264, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1265) - } - 9 => { - let lifted1272 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1267 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1266 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2104 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - Option::Some(lifted1266) - } - _ => panic() - } - - let lifted1269 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1268 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result2104}) + } + _ => panic() + } - Option::Some(lifted1268) - } - _ => panic() - } - - let lifted1271 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1270 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1270) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1267, - max: lifted1269, - unit: lifted1271, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1272) - } - 10 => { - let lifted1279 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1274 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1273 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2107 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - Option::Some(lifted1273) - } - _ => panic() - } - - let lifted1276 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1275 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2106 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - Option::Some(lifted1275) - } - _ => panic() - } - - let lifted1278 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1277 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1277) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1274, - max: lifted1276, - unit: lifted1278, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1279) - } - 11 => { - let lifted1286 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1281 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1280 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result2106}) + } + _ => panic() + } - Option::Some(lifted1280) - } - _ => panic() - } - - let lifted1283 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1282 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result2100, allowed_suffixes : array2102, min : lifted2105, max : lifted2107}) + } + 31 => { - Option::Some(lifted1282) - } - _ => panic() - } - - let lifted1285 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1284 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1284) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1281, - max: lifted1283, - unit: lifted1285, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted1286) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array1301 : Array[@types.NamedFieldType] = [] - for index1302 = 0 - index1302 < mbt_ffi_load32(iter_base + 12) - index1302 = index1302 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1302 * 68 - - let result1287 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1289 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1288 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1288) - } - _ => panic() - } + let array2131 : Array[@types.UnionBranch] = []; + for index2132 = 0; index2132 < (mbt_ffi_load32((iter_base) + 12)); index2132 = index2132 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2132 * 92) - let array1291 : Array[String] = [] - for index1292 = 0 - index1292 < mbt_ffi_load32(iter_base + 28) - index1292 = index1292 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1292 * 8 + let result2108 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result1290 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2117 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { - array1291.push(result1290) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let result2109 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let array1294 : Array[String] = [] - for index1295 = 0 - index1295 < mbt_ffi_load32(iter_base + 36) - index1295 = index1295 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1295 * 8 + @types.DiscriminatorRule::Prefix(result2109) + } + 1 => { - let result1293 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2110 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - array1294.push(result1293) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted1297 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result1296 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result1296) - } - _ => panic() - } + @types.DiscriminatorRule::Suffix(result2110) + } + 2 => { - let lifted1300 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted1299 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1298 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + let result2111 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.Role::Other(result1298) - } - _ => panic() - } + @types.DiscriminatorRule::Contains(result2111) + } + 3 => { - Option::Some(lifted1299) - } - _ => panic() - } + let result2112 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - array1301.push(@types.NamedFieldType::{ - name: result1287, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted1289, - aliases: array1291, - examples: array1294, - deprecated: lifted1297, - role: lifted1300, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array1301) - } - 15 => { - let array1318 : Array[@types.VariantCaseType] = [] - for index1319 = 0 - index1319 < mbt_ffi_load32(iter_base + 12) - index1319 = index1319 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1319 * 72 - - let result1303 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1304 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.DiscriminatorRule::Regex(result2112) + } + 4 => { - let lifted1306 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1305 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1305) - } - _ => panic() - } + let result2113 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let array1308 : Array[String] = [] - for index1309 = 0 - index1309 < mbt_ffi_load32(iter_base + 32) - index1309 = index1309 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1309 * 8 + let lifted2115 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let result1307 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2114 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - array1308.push(result1307) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + Option::Some(result2114) + } + _ => panic() + } - let array1311 : Array[String] = [] - for index1312 = 0 - index1312 < mbt_ffi_load32(iter_base + 40) - index1312 = index1312 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1312 * 8 + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result2113, literal : lifted2115}) + } + 5 => { - let result1310 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2116 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - array1311.push(result1310) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted1314 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result1313 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result1313) - } - _ => panic() - } + @types.DiscriminatorRule::FieldAbsent(result2116) + } + _ => panic() + } - let lifted1317 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted1316 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1315 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let lifted2119 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - @types.Role::Other(result1315) - } - _ => panic() - } + let result2118 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted1316) - } - _ => panic() - } + Option::Some(result2118) + } + _ => panic() + } - array1318.push(@types.VariantCaseType::{ - name: result1303, - payload: lifted1304, - metadata: @types.MetadataEnvelope::{ - doc: lifted1306, - aliases: array1308, - examples: array1311, - deprecated: lifted1314, - role: lifted1317, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array1318) - } - 16 => { - let array1321 : Array[String] = [] - for index1322 = 0 - index1322 < mbt_ffi_load32(iter_base + 12) - index1322 = index1322 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1322 * 8 - - let result1320 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1321.push(result1320) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array1321) - } - 17 => { - let array1324 : Array[String] = [] - for index1325 = 0 - index1325 < mbt_ffi_load32(iter_base + 12) - index1325 = index1325 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1325 * 8 - - let result1323 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1324.push(result1323) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array1324) - } - 18 => { - let array1326 : Array[Int] = [] - for index1327 = 0 - index1327 < mbt_ffi_load32(iter_base + 12) - index1327 = index1327 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1327 * 4 - - array1326.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array1326) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted1328 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted1329 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted1328, - err: lifted1329, - }) - } - 24 => { - let lifted1333 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1331 : Array[String] = [] - for index1332 = 0 - index1332 < mbt_ffi_load32(iter_base + 16) - index1332 = index1332 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1332 * 8 - - let result1330 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1331.push(result1330) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1331) - } - _ => panic() - } - - let lifted1334 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1335 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1337 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1336 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1336) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted1333, - min_length: lifted1334, - max_length: lifted1335, - regex: lifted1337, - }) - } - 25 => { - let lifted1341 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1339 : Array[String] = [] - for index1340 = 0 - index1340 < mbt_ffi_load32(iter_base + 16) - index1340 = index1340 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1340 * 8 - - let result1338 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1339.push(result1338) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1339) - } - _ => panic() - } - - let lifted1342 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1343 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted1341, - min_bytes: lifted1342, - max_bytes: lifted1343, - }) - } - 26 => { - let lifted1347 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array1345 : Array[String] = [] - for index1346 = 0 - index1346 < mbt_ffi_load32(iter_base + 20) - index1346 = index1346 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1346 * 8 - - let result1344 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1345.push(result1344) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array1345) - } - _ => panic() - } - - let lifted1351 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array1349 : Array[String] = [] - for index1350 = 0 - index1350 < mbt_ffi_load32(iter_base + 32) - index1350 = index1350 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1350 * 8 - - let result1348 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1349.push(result1348) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array1349) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted1347, - allowed_extensions: lifted1351, - }) - } - 27 => { - let lifted1355 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1353 : Array[String] = [] - for index1354 = 0 - index1354 < mbt_ffi_load32(iter_base + 16) - index1354 = index1354 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1354 * 8 - - let result1352 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1353.push(result1352) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1353) - } - _ => panic() - } - - let lifted1359 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array1357 : Array[String] = [] - for index1358 = 0 - index1358 < mbt_ffi_load32(iter_base + 28) - index1358 = index1358 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1358 * 8 - - let result1356 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1357.push(result1356) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array1357) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted1355, - allowed_hosts: lifted1359, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result1360 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array1362 : Array[String] = [] - for index1363 = 0 - index1363 < mbt_ffi_load32(iter_base + 20) - index1363 = index1363 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1363 * 8 - - let result1361 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1362.push(result1361) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted1365 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1364 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result1364, - }) - } - _ => panic() - } - - let lifted1367 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result1366 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result1366, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result1360, - allowed_suffixes: array1362, - min: lifted1365, - max: lifted1367, - }) - } - 31 => { - let array1391 : Array[@types.UnionBranch] = [] - for index1392 = 0 - index1392 < mbt_ffi_load32(iter_base + 12) - index1392 = index1392 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1392 * 92 - - let result1368 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1377 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result1369 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result1369) - } - 1 => { - let result1370 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result1370) - } - 2 => { - let result1371 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result1371) - } - 3 => { - let result1372 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result1372) - } - 4 => { - let result1373 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted1375 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1374 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let array2121 : Array[String] = []; + for index2122 = 0; index2122 < (mbt_ffi_load32((iter_base) + 52)); index2122 = index2122 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2122 * 8) - Option::Some(result1374) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result1373, - literal: lifted1375, - }) - } - 5 => { - let result1376 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result1376) - } - _ => panic() - } + let result2120 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted1379 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1378 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1378) - } - _ => panic() - } + array2121.push(result2120) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - let array1381 : Array[String] = [] - for index1382 = 0 - index1382 < mbt_ffi_load32(iter_base + 52) - index1382 = index1382 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1382 * 8 + let array2124 : Array[String] = []; + for index2125 = 0; index2125 < (mbt_ffi_load32((iter_base) + 60)); index2125 = index2125 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2125 * 8) - let result1380 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2123 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array1381.push(result1380) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + array2124.push(result2123) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - let array1384 : Array[String] = [] - for index1385 = 0 - index1385 < mbt_ffi_load32(iter_base + 60) - index1385 = index1385 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1385 * 8 + let lifted2127 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let result1383 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2126 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - array1384.push(result1383) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted1387 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1386 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1386) - } - _ => panic() - } + Option::Some(result2126) + } + _ => panic() + } + + let lifted2130 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - let lifted1390 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted1389 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1388 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + let lifted2129 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { - @types.Role::Other(result1388) - } - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - Option::Some(lifted1389) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - array1391.push(@types.UnionBranch::{ - tag: result1368, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted1377, - metadata: @types.MetadataEnvelope::{ - doc: lifted1379, - aliases: array1381, - examples: array1384, - deprecated: lifted1387, - role: lifted1390, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array1391, - }) - } - 32 => { - let lifted1394 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1393 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1393) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted1394, - }) - } - 33 => { - let lifted1396 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1395 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1395) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted1396, - }) - } - 34 => { - let lifted1397 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted1397) - } - 35 => { - let lifted1398 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted1398) - } - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - let lifted1401 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result1400 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result1400) - } - _ => panic() - } + let result2128 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - let array1403 : Array[String] = [] - for index1404 = 0 - index1404 < mbt_ffi_load32(iter_base + 104) - index1404 = index1404 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index1404 * 8 + @types.Role::Other(result2128) + } + _ => panic() + } - let result1402 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(lifted2129) + } + _ => panic() + } - array1403.push(result1402) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + array2131.push(@types.UnionBranch::{tag : result2108, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted2117, metadata : @types.MetadataEnvelope::{doc : lifted2119, aliases : array2121, examples : array2124, deprecated : lifted2127, role : lifted2130}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array1406 : Array[String] = [] - for index1407 = 0 - index1407 < mbt_ffi_load32(iter_base + 112) - index1407 = index1407 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index1407 * 8 + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array2131}) + } + 32 => { - let result1405 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2134 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - array1406.push(result1405) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted1409 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result1408 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result1408) - } - _ => panic() - } + let result2133 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let lifted1412 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted1411 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1410 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result1410) - } - _ => panic() - } + Option::Some(result2133) + } + _ => panic() + } - Option::Some(lifted1411) - } - _ => panic() - } + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted2134}) + } + 33 => { - array1413.push(@types.SchemaTypeNode::{ - body: lifted1399, - metadata: @types.MetadataEnvelope::{ - doc: lifted1401, - aliases: array1403, - examples: array1406, - deprecated: lifted1409, - role: lifted1412, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array1418 : Array[@types.SchemaTypeDef] = [] - for index1419 = 0 - index1419 < mbt_ffi_load32(iter_base + 60) - index1419 = index1419 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1419 * 24 - - let result1415 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1417 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1416 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1416) - } - _ => panic() - } + let lifted2136 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array1418.push(@types.SchemaTypeDef::{ - id: result1415, - name: lifted1417, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let array1449 : Array[@types.SchemaValueNode] = [] - for index1450 = 0 - index1450 < mbt_ffi_load32(iter_base + 72) - index1450 = index1450 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + - index1450 * 32 - - let lifted1448 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result1420 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result1420) - } - 13 => { - let array1421 : Array[Int] = [] - for index1422 = 0 - index1422 < mbt_ffi_load32(iter_base + 12) - index1422 = index1422 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1422 * 4 - - array1421.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array1421) - } - 14 => { - let lifted1423 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted1423, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1424 : Array[Bool] = [] - for index1425 = 0 - index1425 < mbt_ffi_load32(iter_base + 12) - index1425 = index1425 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1425 * 1 - - array1424.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1424) - } - 17 => { - let array1426 : Array[Int] = [] - for index1427 = 0 - index1427 < mbt_ffi_load32(iter_base + 12) - index1427 = index1427 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1427 * 4 - - array1426.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array1426) - } - 18 => { - let array1428 : Array[Int] = [] - for index1429 = 0 - index1429 < mbt_ffi_load32(iter_base + 12) - index1429 = index1429 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1429 * 4 - - array1428.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array1428) - } - 19 => { - let array1430 : Array[Int] = [] - for index1431 = 0 - index1431 < mbt_ffi_load32(iter_base + 12) - index1431 = index1431 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1431 * 4 - - array1430.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array1430) - } - 20 => { - let array1432 : Array[@types.MapEntry] = [] - for index1433 = 0 - index1433 < mbt_ffi_load32(iter_base + 12) - index1433 = index1433 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1433 * 8 - - array1432.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array1432) - } - 21 => { - let lifted1434 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted1434) - } - 22 => { - let lifted1437 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted1435 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted1435) - } - 1 => { - let lifted1436 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted1436) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted1437) - } - 23 => { - let result1438 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1440 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1439 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1439) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result1438, - language: lifted1440, - }) - } - 24 => { - let result1441 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1443 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1442 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1442) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result1441, - mime_type: lifted1443, - }) - } - 25 => { - let result1444 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result1444) - } - 26 => { - let result1445 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result1445) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result1446 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result1446, - }) - } - 30 => { - let result1447 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result1447, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + let result2135 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - array1449.push(lifted1448) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - let result1451 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 80), - mbt_ffi_load32(iter_base + 84), - ) - - let array1453 : Array[String] = [] - for index1454 = 0 - index1454 < mbt_ffi_load32(iter_base + 92) - index1454 = index1454 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 88) + index1454 * 8 - - let result1452 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1453.push(result1452) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - - let array1468 : Array[Array[SpanData]] = [] - for index1469 = 0 - index1469 < mbt_ffi_load32(iter_base + 100) - index1469 = index1469 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 96) + index1469 * 8 - - let array1466 : Array[SpanData] = [] - for index1467 = 0 - index1467 < mbt_ffi_load32(iter_base + 4) - index1467 = index1467 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index1467 * 80 - - let lifted1465 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result1455 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1457 : String? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result1456 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result1456) - } - _ => panic() - } + Option::Some(result2135) + } + _ => panic() + } - let lifted1458 : UInt64? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted2136}) + } + 34 => { - let array1462 : Array[@context.Attribute] = [] - for index1463 = 0 - index1463 < mbt_ffi_load32(iter_base + 68) - index1463 = index1463 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index1463 * 20 - - let result1459 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1461 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result1460 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result1460) - } - _ => panic() - } - - array1462.push(@context.Attribute::{ - key: result1459, - value: lifted1461, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - SpanData::LocalSpan(LocalSpanData::{ - span_id: result1455, - start: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent: lifted1457, - linked_context: lifted1458, - attributes: array1462, - inherited: mbt_ffi_load8_u(iter_base + 72) != 0, - }) - } - 1 => { - let result1464 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - SpanData::ExternalSpan(ExternalSpanData::{ - span_id: result1464, - }) - } - _ => panic() - } - - array1466.push(lifted1465) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array1468.push(array1466) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 96)) - - AgentInvocation::AgentMethodInvocation(AgentMethodInvocationParameters::{ - idempotency_key: result1215, - method_name: result1216, - function_input: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array1413, - defs: array1418, - root: mbt_ffi_load32(iter_base + 64), - }, - value: @types.SchemaValueTree::{ - value_nodes: array1449, - root: mbt_ffi_load32(iter_base + 76), - }, - }, - trace_id: result1451, - trace_states: array1453, - invocation_context: array1468, - }) - } - 2 => AgentInvocation::SaveSnapshot - 3 => { - let result1470 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result1471 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - AgentInvocation::LoadSnapshot(LoadSnapshotParameters::{ - snapshot: SnapshotData::{ - data: result1470, - mime_type: result1471, - }, - }) - } - 4 => { - let result1472 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - AgentInvocation::ProcessOplogEntries(ProcessOplogEntriesParameters::{ - idempotency_key: result1472, - }) - } - 5 => - AgentInvocation::ManualUpdate(ManualUpdateParameters::{ - target_revision: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }) - _ => panic() - } + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - PublicOplogEntry::AgentInvocationStarted(AgentInvocationStartedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - invocation: lifted1473, - }) - } - 5 => { - let lifted1948 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => { - let array1670 : Array[@types.SchemaTypeNode] = [] - for index1671 = 0 - index1671 < mbt_ffi_load32(iter_base + 32) - index1671 = index1671 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1671 * 144 - - let lifted1656 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted1480 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1475 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1474 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2137 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted1474) - } - _ => panic() - } - - let lifted1477 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1476 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted1476) - } - _ => panic() - } - - let lifted1479 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1478 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1478) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1475, - max: lifted1477, - unit: lifted1479, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted1480) - } - 3 => { - let lifted1487 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1482 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1481 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::FutureType(lifted2137) + } + 36 => { - Option::Some(lifted1481) - } - _ => panic() - } - - let lifted1484 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1483 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2138 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted1483) - } - _ => panic() - } - - let lifted1486 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1485 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1485) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1482, - max: lifted1484, - unit: lifted1486, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted1487) - } - 4 => { - let lifted1494 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1489 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1488 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted1488) - } - _ => panic() - } - - let lifted1491 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1490 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::StreamType(lifted2138) + } + _ => panic() + } - Option::Some(lifted1490) - } - _ => panic() - } - - let lifted1493 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1492 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1492) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1489, - max: lifted1491, - unit: lifted1493, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted1494) - } - 5 => { - let lifted1501 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1496 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1495 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2141 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { - Option::Some(lifted1495) - } - _ => panic() - } - - let lifted1498 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1497 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2140 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - Option::Some(lifted1497) - } - _ => panic() - } - - let lifted1500 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1499 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1499) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1496, - max: lifted1498, - unit: lifted1500, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted1501) - } - 6 => { - let lifted1508 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1503 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1502 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2140) + } + _ => panic() + } - Option::Some(lifted1502) - } - _ => panic() - } - - let lifted1505 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1504 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2143 : Array[String] = []; + for index2144 = 0; index2144 < (mbt_ffi_load32((iter_base) + 104)); index2144 = index2144 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index2144 * 8) - Option::Some(lifted1504) - } - _ => panic() - } - - let lifted1507 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1506 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1506) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1503, - max: lifted1505, - unit: lifted1507, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted1508) - } - 7 => { - let lifted1515 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1510 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1509 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2142 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1509) - } - _ => panic() - } - - let lifted1512 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1511 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2143.push(result2142) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - Option::Some(lifted1511) - } - _ => panic() - } - - let lifted1514 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1513 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1513) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1510, - max: lifted1512, - unit: lifted1514, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1515) - } - 8 => { - let lifted1522 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1517 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1516 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2146 : Array[String] = []; + for index2147 = 0; index2147 < (mbt_ffi_load32((iter_base) + 112)); index2147 = index2147 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index2147 * 8) - Option::Some(lifted1516) - } - _ => panic() - } - - let lifted1519 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1518 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2145 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1518) - } - _ => panic() - } - - let lifted1521 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1520 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1520) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1517, - max: lifted1519, - unit: lifted1521, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1522) - } - 9 => { - let lifted1529 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1524 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1523 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2146.push(result2145) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - Option::Some(lifted1523) - } - _ => panic() - } - - let lifted1526 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1525 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2149 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - Option::Some(lifted1525) - } - _ => panic() - } - - let lifted1528 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1527 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1527) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1524, - max: lifted1526, - unit: lifted1528, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1529) - } - 10 => { - let lifted1536 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1531 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1530 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2148 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - Option::Some(lifted1530) - } - _ => panic() - } - - let lifted1533 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1532 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2148) + } + _ => panic() + } - Option::Some(lifted1532) - } - _ => panic() - } - - let lifted1535 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1534 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1534) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1531, - max: lifted1533, - unit: lifted1535, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1536) - } - 11 => { - let lifted1543 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1538 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1537 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2152 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - Option::Some(lifted1537) - } - _ => panic() - } - - let lifted1540 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1539 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2151 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - Option::Some(lifted1539) - } - _ => panic() - } - - let lifted1542 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1541 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1541) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1538, - max: lifted1540, - unit: lifted1542, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted1543) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array1558 : Array[@types.NamedFieldType] = [] - for index1559 = 0 - index1559 < mbt_ffi_load32(iter_base + 12) - index1559 = index1559 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1559 * 68 - - let result1544 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1546 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1545 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1545) - } - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - let array1548 : Array[String] = [] - for index1549 = 0 - index1549 < mbt_ffi_load32(iter_base + 28) - index1549 = index1549 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1549 * 8 + @types.Role::UnstructuredText + } + 2 => { - let result1547 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.Role::UnstructuredBinary + } + 3 => { - array1548.push(result1547) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let result2150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - let array1551 : Array[String] = [] - for index1552 = 0 - index1552 < mbt_ffi_load32(iter_base + 36) - index1552 = index1552 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1552 * 8 + @types.Role::Other(result2150) + } + _ => panic() + } - let result1550 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(lifted2151) + } + _ => panic() + } - array1551.push(result1550) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted1554 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result1553 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result1553) - } - _ => panic() - } + array2153.push(@types.SchemaTypeNode::{body : lifted2139, metadata : @types.MetadataEnvelope::{doc : lifted2141, aliases : array2143, examples : array2146, deprecated : lifted2149, role : lifted2152}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - let lifted1557 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted1556 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1555 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + let array2158 : Array[@types.SchemaTypeDef] = []; + for index2159 = 0; index2159 < (mbt_ffi_load32((iter_base) + 60)); index2159 = index2159 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2159 * 24) - @types.Role::Other(result1555) - } - _ => panic() - } + let result2155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1556) - } - _ => panic() - } + let lifted2157 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array1558.push(@types.NamedFieldType::{ - name: result1544, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted1546, - aliases: array1548, - examples: array1551, - deprecated: lifted1554, - role: lifted1557, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array1558) - } - 15 => { - let array1575 : Array[@types.VariantCaseType] = [] - for index1576 = 0 - index1576 < mbt_ffi_load32(iter_base + 12) - index1576 = index1576 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1576 * 72 - - let result1560 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1561 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result2156 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - let lifted1563 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1562 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1562) - } - _ => panic() - } + Option::Some(result2156) + } + _ => panic() + } - let array1565 : Array[String] = [] - for index1566 = 0 - index1566 < mbt_ffi_load32(iter_base + 32) - index1566 = index1566 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1566 * 8 + array2158.push(@types.SchemaTypeDef::{id : result2155, name : lifted2157, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - let result1564 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array2189 : Array[@types.SchemaValueNode] = []; + for index2190 = 0; index2190 < (mbt_ffi_load32((iter_base) + 72)); index2190 = index2190 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index2190 * 32) - array1565.push(result1564) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let lifted2188 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let array1568 : Array[String] = [] - for index1569 = 0 - index1569 < mbt_ffi_load32(iter_base + 40) - index1569 = index1569 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1569 * 8 + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - let result1567 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - array1568.push(result1567) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted1571 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result1570 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result1570) - } - _ => panic() - } + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - let lifted1574 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted1573 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1572 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - @types.Role::Other(result1572) - } - _ => panic() - } + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - Option::Some(lifted1573) - } - _ => panic() - } + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - array1575.push(@types.VariantCaseType::{ - name: result1560, - payload: lifted1561, - metadata: @types.MetadataEnvelope::{ - doc: lifted1563, - aliases: array1565, - examples: array1568, - deprecated: lifted1571, - role: lifted1574, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array1575) - } - 16 => { - let array1578 : Array[String] = [] - for index1579 = 0 - index1579 < mbt_ffi_load32(iter_base + 12) - index1579 = index1579 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1579 * 8 - - let result1577 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1578.push(result1577) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array1578) - } - 17 => { - let array1581 : Array[String] = [] - for index1582 = 0 - index1582 < mbt_ffi_load32(iter_base + 12) - index1582 = index1582 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1582 * 8 - - let result1580 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1581.push(result1580) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array1581) - } - 18 => { - let array1583 : Array[Int] = [] - for index1584 = 0 - index1584 < mbt_ffi_load32(iter_base + 12) - index1584 = index1584 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1584 * 4 - - array1583.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array1583) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted1585 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted1586 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted1585, - err: lifted1586, - }) - } - 24 => { - let lifted1590 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1588 : Array[String] = [] - for index1589 = 0 - index1589 < mbt_ffi_load32(iter_base + 16) - index1589 = index1589 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1589 * 8 - - let result1587 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1588.push(result1587) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1588) - } - _ => panic() - } - - let lifted1591 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1592 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1594 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1593 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1593) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted1590, - min_length: lifted1591, - max_length: lifted1592, - regex: lifted1594, - }) - } - 25 => { - let lifted1598 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1596 : Array[String] = [] - for index1597 = 0 - index1597 < mbt_ffi_load32(iter_base + 16) - index1597 = index1597 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1597 * 8 - - let result1595 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1596.push(result1595) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1596) - } - _ => panic() - } - - let lifted1599 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1600 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted1598, - min_bytes: lifted1599, - max_bytes: lifted1600, - }) - } - 26 => { - let lifted1604 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array1602 : Array[String] = [] - for index1603 = 0 - index1603 < mbt_ffi_load32(iter_base + 20) - index1603 = index1603 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1603 * 8 - - let result1601 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1602.push(result1601) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array1602) - } - _ => panic() - } - - let lifted1608 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array1606 : Array[String] = [] - for index1607 = 0 - index1607 < mbt_ffi_load32(iter_base + 32) - index1607 = index1607 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1607 * 8 - - let result1605 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1606.push(result1605) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array1606) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted1604, - allowed_extensions: lifted1608, - }) - } - 27 => { - let lifted1612 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1610 : Array[String] = [] - for index1611 = 0 - index1611 < mbt_ffi_load32(iter_base + 16) - index1611 = index1611 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1611 * 8 - - let result1609 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1610.push(result1609) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1610) - } - _ => panic() - } - - let lifted1616 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array1614 : Array[String] = [] - for index1615 = 0 - index1615 < mbt_ffi_load32(iter_base + 28) - index1615 = index1615 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1615 * 8 - - let result1613 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1614.push(result1613) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array1614) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted1612, - allowed_hosts: lifted1616, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result1617 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array1619 : Array[String] = [] - for index1620 = 0 - index1620 < mbt_ffi_load32(iter_base + 20) - index1620 = index1620 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1620 * 8 - - let result1618 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1619.push(result1618) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted1622 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1621 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result1621, - }) - } - _ => panic() - } - - let lifted1624 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result1623 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result1623, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result1617, - allowed_suffixes: array1619, - min: lifted1622, - max: lifted1624, - }) - } - 31 => { - let array1648 : Array[@types.UnionBranch] = [] - for index1649 = 0 - index1649 < mbt_ffi_load32(iter_base + 12) - index1649 = index1649 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1649 * 92 - - let result1625 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1634 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result1626 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result1626) - } - 1 => { - let result1627 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result1627) - } - 2 => { - let result1628 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result1628) - } - 3 => { - let result1629 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result1629) - } - 4 => { - let result1630 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted1632 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1631 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - Option::Some(result1631) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result1630, - literal: lifted1632, - }) - } - 5 => { - let result1633 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result1633) - } - _ => panic() - } + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - let lifted1636 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1635 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1635) - } - _ => panic() - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - let array1638 : Array[String] = [] - for index1639 = 0 - index1639 < mbt_ffi_load32(iter_base + 52) - index1639 = index1639 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1639 * 8 + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - let result1637 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - array1638.push(result1637) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - let array1641 : Array[String] = [] - for index1642 = 0 - index1642 < mbt_ffi_load32(iter_base + 60) - index1642 = index1642 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1642 * 8 + let result2160 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result1640 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::StringValue(result2160) + } + 13 => { - array1641.push(result1640) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted1644 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1643 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1643) - } - _ => panic() - } + let array2161 : Array[Int] = []; + for index2162 = 0; index2162 < (mbt_ffi_load32((iter_base) + 12)); index2162 = index2162 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2162 * 4) - let lifted1647 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted1646 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1645 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + array2161.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.Role::Other(result1645) - } - _ => panic() - } + @types.SchemaValueNode::RecordValue(array2161) + } + 14 => { - Option::Some(lifted1646) - } - _ => panic() - } + let lifted2163 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - array1648.push(@types.UnionBranch::{ - tag: result1625, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted1634, - metadata: @types.MetadataEnvelope::{ - doc: lifted1636, - aliases: array1638, - examples: array1641, - deprecated: lifted1644, - role: lifted1647, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array1648, - }) - } - 32 => { - let lifted1651 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1650 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1650) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted1651, - }) - } - 33 => { - let lifted1653 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1652 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1652) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted1653, - }) - } - 34 => { - let lifted1654 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted1654) - } - 35 => { - let lifted1655 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted1655) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let lifted1658 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result1657 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result1657) - } - _ => panic() - } + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted2163}) + } + 15 => { - let array1660 : Array[String] = [] - for index1661 = 0 - index1661 < mbt_ffi_load32(iter_base + 104) - index1661 = index1661 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index1661 * 8 + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - let result1659 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array2164 : Array[Bool] = []; + for index2165 = 0; index2165 < (mbt_ffi_load32((iter_base) + 12)); index2165 = index2165 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2165 * 1) - array1660.push(result1659) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + array2164.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array1663 : Array[String] = [] - for index1664 = 0 - index1664 < mbt_ffi_load32(iter_base + 112) - index1664 = index1664 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index1664 * 8 + @types.SchemaValueNode::FlagsValue(array2164) + } + 17 => { - let result1662 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array2166 : Array[Int] = []; + for index2167 = 0; index2167 < (mbt_ffi_load32((iter_base) + 12)); index2167 = index2167 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2167 * 4) - array1663.push(result1662) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted1666 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result1665 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result1665) - } - _ => panic() - } + array2166.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted1669 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted1668 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1667 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result1667) - } - _ => panic() - } + @types.SchemaValueNode::TupleValue(array2166) + } + 18 => { - Option::Some(lifted1668) - } - _ => panic() - } + let array2168 : Array[Int] = []; + for index2169 = 0; index2169 < (mbt_ffi_load32((iter_base) + 12)); index2169 = index2169 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2169 * 4) - array1670.push(@types.SchemaTypeNode::{ - body: lifted1656, - metadata: @types.MetadataEnvelope::{ - doc: lifted1658, - aliases: array1660, - examples: array1663, - deprecated: lifted1666, - role: lifted1669, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array1675 : Array[@types.SchemaTypeDef] = [] - for index1676 = 0 - index1676 < mbt_ffi_load32(iter_base + 40) - index1676 = index1676 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1676 * 24 - - let result1672 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1674 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1673 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1673) - } - _ => panic() - } + array2168.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - array1675.push(@types.SchemaTypeDef::{ - id: result1672, - name: lifted1674, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array1706 : Array[@types.SchemaValueNode] = [] - for index1707 = 0 - index1707 < mbt_ffi_load32(iter_base + 52) - index1707 = index1707 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1707 * 32 - - let lifted1705 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result1677 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result1677) - } - 13 => { - let array1678 : Array[Int] = [] - for index1679 = 0 - index1679 < mbt_ffi_load32(iter_base + 12) - index1679 = index1679 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1679 * 4 - - array1678.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array1678) - } - 14 => { - let lifted1680 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted1680, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1681 : Array[Bool] = [] - for index1682 = 0 - index1682 < mbt_ffi_load32(iter_base + 12) - index1682 = index1682 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1682 * 1 - - array1681.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1681) - } - 17 => { - let array1683 : Array[Int] = [] - for index1684 = 0 - index1684 < mbt_ffi_load32(iter_base + 12) - index1684 = index1684 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1684 * 4 - - array1683.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array1683) - } - 18 => { - let array1685 : Array[Int] = [] - for index1686 = 0 - index1686 < mbt_ffi_load32(iter_base + 12) - index1686 = index1686 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1686 * 4 - - array1685.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array1685) - } - 19 => { - let array1687 : Array[Int] = [] - for index1688 = 0 - index1688 < mbt_ffi_load32(iter_base + 12) - index1688 = index1688 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1688 * 4 - - array1687.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array1687) - } - 20 => { - let array1689 : Array[@types.MapEntry] = [] - for index1690 = 0 - index1690 < mbt_ffi_load32(iter_base + 12) - index1690 = index1690 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1690 * 8 - - array1689.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array1689) - } - 21 => { - let lifted1691 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted1691) - } - 22 => { - let lifted1694 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted1692 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted1692) - } - 1 => { - let lifted1693 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted1693) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted1694) - } - 23 => { - let result1695 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1697 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1696 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1696) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result1695, - language: lifted1697, - }) - } - 24 => { - let result1698 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1700 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1699 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1699) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result1698, - mime_type: lifted1700, - }) - } - 25 => { - let result1701 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result1701) - } - 26 => { - let result1702 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result1702) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result1703 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result1703, - }) - } - 30 => { - let result1704 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result1704, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @types.SchemaValueNode::ListValue(array2168) + } + 19 => { - array1706.push(lifted1705) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - AgentInvocationResult::AgentInitialization(AgentInvocationOutputParameters::{ - output: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array1670, - defs: array1675, - root: mbt_ffi_load32(iter_base + 44), - }, - value: @types.SchemaValueTree::{ - value_nodes: array1706, - root: mbt_ffi_load32(iter_base + 56), - }, - }, - }) - } - 1 => { - let array1904 : Array[@types.SchemaTypeNode] = [] - for index1905 = 0 - index1905 < mbt_ffi_load32(iter_base + 32) - index1905 = index1905 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1905 * 144 - - let lifted1890 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted1714 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1709 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1708 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2170 : Array[Int] = []; + for index2171 = 0; index2171 < (mbt_ffi_load32((iter_base) + 12)); index2171 = index2171 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2171 * 4) - Option::Some(lifted1708) - } - _ => panic() - } - - let lifted1711 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1710 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2170.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted1710) - } - _ => panic() - } - - let lifted1713 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1712 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1712) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1709, - max: lifted1711, - unit: lifted1713, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted1714) - } - 3 => { - let lifted1721 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1716 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1715 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::FixedListValue(array2170) + } + 20 => { - Option::Some(lifted1715) - } - _ => panic() - } - - let lifted1718 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1717 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2172 : Array[@types.MapEntry] = []; + for index2173 = 0; index2173 < (mbt_ffi_load32((iter_base) + 12)); index2173 = index2173 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2173 * 8) - Option::Some(lifted1717) - } - _ => panic() - } - - let lifted1720 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1719 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1719) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1716, - max: lifted1718, - unit: lifted1720, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted1721) - } - 4 => { - let lifted1728 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1723 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1722 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2172.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted1722) - } - _ => panic() - } - - let lifted1725 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1724 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::MapValue(array2172) + } + 21 => { - Option::Some(lifted1724) - } - _ => panic() - } - - let lifted1727 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1726 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1726) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1723, - max: lifted1725, - unit: lifted1727, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted1728) - } - 5 => { - let lifted1735 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1730 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1729 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2174 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted1729) - } - _ => panic() - } - - let lifted1732 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1731 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted1731) - } - _ => panic() - } - - let lifted1734 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1733 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1733) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1730, - max: lifted1732, - unit: lifted1734, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted1735) - } - 6 => { - let lifted1742 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1737 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1736 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::OptionValue(lifted2174) + } + 22 => { - Option::Some(lifted1736) - } - _ => panic() - } - - let lifted1739 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1738 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2177 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - Option::Some(lifted1738) - } - _ => panic() - } - - let lifted1741 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1740 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1740) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1737, - max: lifted1739, - unit: lifted1741, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted1742) - } - 7 => { - let lifted1749 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1744 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1743 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2175 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted1743) - } - _ => panic() - } - - let lifted1746 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1745 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - Option::Some(lifted1745) - } - _ => panic() - } - - let lifted1748 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1747 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1747) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1744, - max: lifted1746, - unit: lifted1748, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1749) - } - 8 => { - let lifted1756 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1751 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1750 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.ResultValuePayload::OkValue(lifted2175) + } + 1 => { - Option::Some(lifted1750) - } - _ => panic() - } - - let lifted1753 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1752 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2176 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted1752) - } - _ => panic() - } - - let lifted1755 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1754 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1754) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1751, - max: lifted1753, - unit: lifted1755, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1756) - } - 9 => { - let lifted1763 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1758 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1757 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - Option::Some(lifted1757) - } - _ => panic() - } - - let lifted1760 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1759 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.ResultValuePayload::ErrValue(lifted2176) + } + _ => panic() + } - Option::Some(lifted1759) - } - _ => panic() - } - - let lifted1762 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1761 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1761) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1758, - max: lifted1760, - unit: lifted1762, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1763) - } - 10 => { - let lifted1770 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1765 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1764 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::ResultValue(lifted2177) + } + 23 => { - Option::Some(lifted1764) - } - _ => panic() - } - - let lifted1767 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1766 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2178 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1766) - } - _ => panic() - } - - let lifted1769 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1768 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1768) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1765, - max: lifted1767, - unit: lifted1769, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1770) - } - 11 => { - let lifted1777 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1772 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1771 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2180 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted1771) - } - _ => panic() - } - - let lifted1774 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1773 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2179 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Option::Some(lifted1773) - } - _ => panic() - } - - let lifted1776 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1775 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1775) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1772, - max: lifted1774, - unit: lifted1776, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted1777) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array1792 : Array[@types.NamedFieldType] = [] - for index1793 = 0 - index1793 < mbt_ffi_load32(iter_base + 12) - index1793 = index1793 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1793 * 68 - - let result1778 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1780 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1779 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1779) - } - _ => panic() - } + Option::Some(result2179) + } + _ => panic() + } - let array1782 : Array[String] = [] - for index1783 = 0 - index1783 < mbt_ffi_load32(iter_base + 28) - index1783 = index1783 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1783 * 8 + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result2178, language : lifted2180}) + } + 24 => { - let result1781 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2181 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array1782.push(result1781) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let lifted2183 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let array1785 : Array[String] = [] - for index1786 = 0 - index1786 < mbt_ffi_load32(iter_base + 36) - index1786 = index1786 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1786 * 8 + let result2182 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let result1784 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(result2182) + } + _ => panic() + } - array1785.push(result1784) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted1788 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result1787 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result1787) - } - _ => panic() - } + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result2181, mime_type : lifted2183}) + } + 25 => { - let lifted1791 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted1790 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1789 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + let result2184 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.Role::Other(result1789) - } - _ => panic() - } + @types.SchemaValueNode::PathValue(result2184) + } + 26 => { - Option::Some(lifted1790) - } - _ => panic() - } + let result2185 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array1792.push(@types.NamedFieldType::{ - name: result1778, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted1780, - aliases: array1782, - examples: array1785, - deprecated: lifted1788, - role: lifted1791, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array1792) - } - 15 => { - let array1809 : Array[@types.VariantCaseType] = [] - for index1810 = 0 - index1810 < mbt_ffi_load32(iter_base + 12) - index1810 = index1810 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1810 * 72 - - let result1794 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1795 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaValueNode::UrlValue(result2185) + } + 27 => { - let lifted1797 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1796 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1796) - } - _ => panic() - } + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - let array1799 : Array[String] = [] - for index1800 = 0 - index1800 < mbt_ffi_load32(iter_base + 32) - index1800 = index1800 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1800 * 8 + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - let result1798 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2186 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - array1799.push(result1798) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result2186}) + } + 30 => { - let array1802 : Array[String] = [] - for index1803 = 0 - index1803 < mbt_ffi_load32(iter_base + 40) - index1803 = index1803 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1803 * 8 + let result2187 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result1801 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result2187, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - array1802.push(result1801) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted1805 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result1804 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result1804) - } - _ => panic() - } + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - let lifted1808 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted1807 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1806 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - @types.Role::Other(result1806) - } - _ => panic() - } + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } - Option::Some(lifted1807) - } - _ => panic() - } + array2189.push(lifted2188) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - array1809.push(@types.VariantCaseType::{ - name: result1794, - payload: lifted1795, - metadata: @types.MetadataEnvelope::{ - doc: lifted1797, - aliases: array1799, - examples: array1802, - deprecated: lifted1805, - role: lifted1808, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array1809) - } - 16 => { - let array1812 : Array[String] = [] - for index1813 = 0 - index1813 < mbt_ffi_load32(iter_base + 12) - index1813 = index1813 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1813 * 8 - - let result1811 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1812.push(result1811) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array1812) - } - 17 => { - let array1815 : Array[String] = [] - for index1816 = 0 - index1816 < mbt_ffi_load32(iter_base + 12) - index1816 = index1816 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1816 * 8 - - let result1814 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1815.push(result1814) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array1815) - } - 18 => { - let array1817 : Array[Int] = [] - for index1818 = 0 - index1818 < mbt_ffi_load32(iter_base + 12) - index1818 = index1818 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1818 * 4 - - array1817.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array1817) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted1819 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted1820 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted1819, - err: lifted1820, - }) - } - 24 => { - let lifted1824 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1822 : Array[String] = [] - for index1823 = 0 - index1823 < mbt_ffi_load32(iter_base + 16) - index1823 = index1823 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1823 * 8 - - let result1821 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1822.push(result1821) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1822) - } - _ => panic() - } - - let lifted1825 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1826 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1828 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1827 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1827) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted1824, - min_length: lifted1825, - max_length: lifted1826, - regex: lifted1828, - }) - } - 25 => { - let lifted1832 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1830 : Array[String] = [] - for index1831 = 0 - index1831 < mbt_ffi_load32(iter_base + 16) - index1831 = index1831 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1831 * 8 - - let result1829 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1830.push(result1829) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1830) - } - _ => panic() - } - - let lifted1833 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1834 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted1832, - min_bytes: lifted1833, - max_bytes: lifted1834, - }) - } - 26 => { - let lifted1838 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array1836 : Array[String] = [] - for index1837 = 0 - index1837 < mbt_ffi_load32(iter_base + 20) - index1837 = index1837 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1837 * 8 - - let result1835 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1836.push(result1835) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array1836) - } - _ => panic() - } - - let lifted1842 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array1840 : Array[String] = [] - for index1841 = 0 - index1841 < mbt_ffi_load32(iter_base + 32) - index1841 = index1841 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1841 * 8 - - let result1839 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1840.push(result1839) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array1840) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted1838, - allowed_extensions: lifted1842, - }) - } - 27 => { - let lifted1846 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1844 : Array[String] = [] - for index1845 = 0 - index1845 < mbt_ffi_load32(iter_base + 16) - index1845 = index1845 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1845 * 8 - - let result1843 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1844.push(result1843) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1844) - } - _ => panic() - } - - let lifted1850 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array1848 : Array[String] = [] - for index1849 = 0 - index1849 < mbt_ffi_load32(iter_base + 28) - index1849 = index1849 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1849 * 8 - - let result1847 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1848.push(result1847) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array1848) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted1846, - allowed_hosts: lifted1850, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result1851 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array1853 : Array[String] = [] - for index1854 = 0 - index1854 < mbt_ffi_load32(iter_base + 20) - index1854 = index1854 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1854 * 8 - - let result1852 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1853.push(result1852) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted1856 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1855 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result1855, - }) - } - _ => panic() - } - - let lifted1858 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result1857 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result1857, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result1851, - allowed_suffixes: array1853, - min: lifted1856, - max: lifted1858, - }) - } - 31 => { - let array1882 : Array[@types.UnionBranch] = [] - for index1883 = 0 - index1883 < mbt_ffi_load32(iter_base + 12) - index1883 = index1883 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1883 * 92 - - let result1859 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1868 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result1860 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result1860) - } - 1 => { - let result1861 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result1861) - } - 2 => { - let result1862 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result1862) - } - 3 => { - let result1863 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result1863) - } - 4 => { - let result1864 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted1866 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1865 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let result2191 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 80), mbt_ffi_load32((iter_base) + 84)) - Option::Some(result1865) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result1864, - literal: lifted1866, - }) - } - 5 => { - let result1867 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result1867) - } - _ => panic() - } + let array2193 : Array[String] = []; + for index2194 = 0; index2194 < (mbt_ffi_load32((iter_base) + 92)); index2194 = index2194 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 88)) + (index2194 * 8) - let lifted1870 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1869 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1869) - } - _ => panic() - } + let result2192 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array1872 : Array[String] = [] - for index1873 = 0 - index1873 < mbt_ffi_load32(iter_base + 52) - index1873 = index1873 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1873 * 8 + array2193.push(result2192) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 88)) - let result1871 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array2208 : Array[Array[SpanData]] = []; + for index2209 = 0; index2209 < (mbt_ffi_load32((iter_base) + 100)); index2209 = index2209 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 96)) + (index2209 * 8) - array1872.push(result1871) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let array2206 : Array[SpanData] = []; + for index2207 = 0; index2207 < (mbt_ffi_load32((iter_base) + 4)); index2207 = index2207 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index2207 * 80) - let array1875 : Array[String] = [] - for index1876 = 0 - index1876 < mbt_ffi_load32(iter_base + 60) - index1876 = index1876 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1876 * 8 + let lifted2205 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let result1874 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2195 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array1875.push(result1874) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted1878 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1877 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1877) - } - _ => panic() - } + let lifted2197 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { - let lifted1881 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted1880 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1879 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + let result2196 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) - @types.Role::Other(result1879) - } - _ => panic() - } + Option::Some(result2196) + } + _ => panic() + } - Option::Some(lifted1880) - } - _ => panic() - } + let lifted2198 : UInt64? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { - array1882.push(@types.UnionBranch::{ - tag: result1859, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted1868, - metadata: @types.MetadataEnvelope::{ - doc: lifted1870, - aliases: array1872, - examples: array1875, - deprecated: lifted1878, - role: lifted1881, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array1882, - }) - } - 32 => { - let lifted1885 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1884 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1884) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted1885, - }) - } - 33 => { - let lifted1887 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1886 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1886) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted1887, - }) - } - 34 => { - let lifted1888 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted1888) - } - 35 => { - let lifted1889 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted1889) - } - _ => panic() - } + Option::Some((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted1892 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result1891 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result1891) - } - _ => panic() - } + let array2202 : Array[@context.Attribute] = []; + for index2203 = 0; index2203 < (mbt_ffi_load32((iter_base) + 68)); index2203 = index2203 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index2203 * 20) - let array1894 : Array[String] = [] - for index1895 = 0 - index1895 < mbt_ffi_load32(iter_base + 104) - index1895 = index1895 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index1895 * 8 + let result2199 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result1893 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2201 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - array1894.push(result1893) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let result2200 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - let array1897 : Array[String] = [] - for index1898 = 0 - index1898 < mbt_ffi_load32(iter_base + 112) - index1898 = index1898 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index1898 * 8 + @context.AttributeValue::String(result2200) + } + _ => panic() + } - let result1896 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2202.push(@context.Attribute::{key : result2199, value : lifted2201}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - array1897.push(result1896) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted1900 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result1899 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result1899) - } - _ => panic() - } + SpanData::LocalSpan(LocalSpanData::{span_id : result2195, start : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent : lifted2197, linked_context : lifted2198, attributes : array2202, inherited : (mbt_ffi_load8_u((iter_base) + 72) != 0)}) + } + 1 => { - let lifted1903 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted1902 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1901 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result1901) - } - _ => panic() - } + let result2204 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1902) - } - _ => panic() - } + SpanData::ExternalSpan(ExternalSpanData::{span_id : result2204}) + } + _ => panic() + } - array1904.push(@types.SchemaTypeNode::{ - body: lifted1890, - metadata: @types.MetadataEnvelope::{ - doc: lifted1892, - aliases: array1894, - examples: array1897, - deprecated: lifted1900, - role: lifted1903, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array1909 : Array[@types.SchemaTypeDef] = [] - for index1910 = 0 - index1910 < mbt_ffi_load32(iter_base + 40) - index1910 = index1910 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1910 * 24 - - let result1906 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1908 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1907 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1907) - } - _ => panic() - } + array2206.push(lifted2205) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - array1909.push(@types.SchemaTypeDef::{ - id: result1906, - name: lifted1908, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array1940 : Array[@types.SchemaValueNode] = [] - for index1941 = 0 - index1941 < mbt_ffi_load32(iter_base + 52) - index1941 = index1941 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1941 * 32 - - let lifted1939 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result1911 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result1911) - } - 13 => { - let array1912 : Array[Int] = [] - for index1913 = 0 - index1913 < mbt_ffi_load32(iter_base + 12) - index1913 = index1913 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1913 * 4 - - array1912.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array1912) - } - 14 => { - let lifted1914 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted1914, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1915 : Array[Bool] = [] - for index1916 = 0 - index1916 < mbt_ffi_load32(iter_base + 12) - index1916 = index1916 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1916 * 1 - - array1915.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1915) - } - 17 => { - let array1917 : Array[Int] = [] - for index1918 = 0 - index1918 < mbt_ffi_load32(iter_base + 12) - index1918 = index1918 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1918 * 4 - - array1917.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array1917) - } - 18 => { - let array1919 : Array[Int] = [] - for index1920 = 0 - index1920 < mbt_ffi_load32(iter_base + 12) - index1920 = index1920 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1920 * 4 - - array1919.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array1919) - } - 19 => { - let array1921 : Array[Int] = [] - for index1922 = 0 - index1922 < mbt_ffi_load32(iter_base + 12) - index1922 = index1922 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1922 * 4 - - array1921.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array1921) - } - 20 => { - let array1923 : Array[@types.MapEntry] = [] - for index1924 = 0 - index1924 < mbt_ffi_load32(iter_base + 12) - index1924 = index1924 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1924 * 8 - - array1923.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array1923) - } - 21 => { - let lifted1925 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted1925) - } - 22 => { - let lifted1928 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted1926 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted1926) - } - 1 => { - let lifted1927 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted1927) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted1928) - } - 23 => { - let result1929 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1931 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1930 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1930) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result1929, - language: lifted1931, - }) - } - 24 => { - let result1932 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1934 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1933 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1933) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result1932, - mime_type: lifted1934, - }) - } - 25 => { - let result1935 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result1935) - } - 26 => { - let result1936 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result1936) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result1937 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result1937, - }) - } - 30 => { - let result1938 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result1938, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + array2208.push(array2206) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 96)) - array1940.push(lifted1939) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - AgentInvocationResult::AgentMethod(AgentInvocationOutputParameters::{ - output: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array1904, - defs: array1909, - root: mbt_ffi_load32(iter_base + 44), - }, - value: @types.SchemaValueTree::{ - value_nodes: array1940, - root: mbt_ffi_load32(iter_base + 56), - }, - }, - }) - } - 2 => AgentInvocationResult::ManualUpdate - 3 => { - let lifted1943 : String? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => { - let result1942 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - Option::Some(result1942) - } - _ => panic() - } - - AgentInvocationResult::LoadSnapshot(FallibleResultParameters::{ - error: lifted1943, - }) - } - 4 => { - let result1944 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - let result1945 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - AgentInvocationResult::SaveSnapshot(SaveSnapshotResultParameters::{ - snapshot: SnapshotData::{ - data: result1944, - mime_type: result1945, - }, - }) - } - 5 => { - let lifted1947 : String? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => { - let result1946 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - Option::Some(result1946) - } - _ => panic() - } - - AgentInvocationResult::ProcessOplogEntries(FallibleResultParameters::{ - error: lifted1947, - }) - } - _ => panic() - } + AgentInvocation::AgentInitialization(AgentInitializationParameters::{idempotency_key : result1956, constructor_parameters : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array2153, defs : array2158, root : mbt_ffi_load32((iter_base) + 64)}, value : @types.SchemaValueTree::{value_nodes : array2189, root : mbt_ffi_load32((iter_base) + 76)}}, trace_id : result2191, trace_states : array2193, invocation_context : array2208}) + } + 1 => { - let lifted1950 : String? = match mbt_ffi_load8_u(iter_base + 60) { - 0 => Option::None - 1 => { - let result1949 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - Option::Some(result1949) - } - _ => panic() - } + let result2210 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - PublicOplogEntry::AgentInvocationFinished(AgentInvocationFinishedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - result: lifted1948, - method_name: lifted1950, - consumed_fuel: mbt_ffi_load64(iter_base + 72), - component_revision: mbt_ffi_load64(iter_base + 80).reinterpret_as_uint64(), - }) - } - 6 => - PublicOplogEntry::Suspend(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - }) - 7 => { - let result1951 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let lifted1955 : RetryPolicyState? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let array1953 : Array[StateNode] = [] - for index1954 = 0 - index1954 < mbt_ffi_load32(iter_base + 52) - index1954 = index1954 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1954 * 16 - - let lifted1952 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - StateNode::Counter( - mbt_ffi_load32(iter_base + 4).reinterpret_as_uint(), - ) - 1 => StateNode::Terminal - 2 => StateNode::Wrapper(mbt_ffi_load32(iter_base + 4)) - 3 => - StateNode::CountBox(CountBoxState::{ - attempts: mbt_ffi_load32(iter_base + 4).reinterpret_as_uint(), - inner: mbt_ffi_load32(iter_base + 8), - }) - 4 => - StateNode::AndThen(AndThenState::{ - left: mbt_ffi_load32(iter_base + 4), - right: mbt_ffi_load32(iter_base + 8), - on_right: mbt_ffi_load8_u(iter_base + 12) != 0, - }) - 5 => - StateNode::Pair(PairState::{ - left: mbt_ffi_load32(iter_base + 4), - right: mbt_ffi_load32(iter_base + 8), - }) - _ => panic() - } + let result2211 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - array1953.push(lifted1952) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let array2408 : Array[@types.SchemaTypeNode] = []; + for index2409 = 0; index2409 < (mbt_ffi_load32((iter_base) + 60)); index2409 = index2409 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2409 * 144) - Option::Some(RetryPolicyState::{ nodes: array1953 }) - } - _ => panic() - } + let lifted2394 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - PublicOplogEntry::Error(ErrorParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - error: result1951, - retry_from: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - inside_atomic_region: mbt_ffi_load8_u(iter_base + 40) != 0, - retry_policy_state: lifted1955, - }) - } - 8 => - PublicOplogEntry::NoOp(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - }) - 9 => - PublicOplogEntry::Jump(JumpParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - jump: OplogRegion::{ - start: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - end: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }) - 10 => - PublicOplogEntry::Interrupted(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - }) - 11 => - PublicOplogEntry::Exited(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - }) - 12 => - PublicOplogEntry::BeginAtomicRegion(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - }) - 13 => - PublicOplogEntry::EndAtomicRegion(EndAtomicRegionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - 14 => { - let lifted2468 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => { - let result1956 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array2153 : Array[@types.SchemaTypeNode] = [] - for index2154 = 0 - index2154 < mbt_ffi_load32(iter_base + 44) - index2154 = index2154 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + - index2154 * 144 - - let lifted2139 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted1963 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1958 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1957 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { - Option::Some(lifted1957) - } - _ => panic() - } - - let lifted1960 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1959 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::BoolType + } + 2 => { - Option::Some(lifted1959) - } - _ => panic() - } - - let lifted1962 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1961 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1961) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1958, - max: lifted1960, - unit: lifted1962, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted1963) - } - 3 => { - let lifted1970 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1965 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1964 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2218 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted1964) - } - _ => panic() - } - - let lifted1967 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1966 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2213 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted1966) - } - _ => panic() - } - - let lifted1969 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1968 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1968) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1965, - max: lifted1967, - unit: lifted1969, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted1970) - } - 4 => { - let lifted1977 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1972 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1971 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2212 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - Option::Some(lifted1971) - } - _ => panic() - } - - let lifted1974 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1973 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - Option::Some(lifted1973) - } - _ => panic() - } - - let lifted1976 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1975 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1975) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1972, - max: lifted1974, - unit: lifted1976, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted1977) - } - 5 => { - let lifted1984 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1979 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1978 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(lifted1978) - } - _ => panic() - } - - let lifted1981 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1980 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - Option::Some(lifted1980) - } - _ => panic() - } - - let lifted1983 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1982 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1982) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1979, - max: lifted1981, - unit: lifted1983, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted1984) - } - 6 => { - let lifted1991 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1986 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1985 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted2212) + } + _ => panic() + } - Option::Some(lifted1985) - } - _ => panic() - } - - let lifted1988 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1987 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2215 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - Option::Some(lifted1987) - } - _ => panic() - } - - let lifted1990 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1989 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1989) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1986, - max: lifted1988, - unit: lifted1990, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted1991) - } - 7 => { - let lifted1998 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1993 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1992 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2214 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - Option::Some(lifted1992) - } - _ => panic() - } - - let lifted1995 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1994 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - Option::Some(lifted1994) - } - _ => panic() - } - - let lifted1997 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1996 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1996) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1993, - max: lifted1995, - unit: lifted1997, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1998) - } - 8 => { - let lifted2005 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2000 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1999 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(lifted1999) - } - _ => panic() - } - - let lifted2002 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2001 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - Option::Some(lifted2001) - } - _ => panic() - } - - let lifted2004 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2003 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2003) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2000, - max: lifted2002, - unit: lifted2004, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted2005) - } - 9 => { - let lifted2012 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2007 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2006 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted2214) + } + _ => panic() + } - Option::Some(lifted2006) - } - _ => panic() - } - - let lifted2009 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2008 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2217 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - Option::Some(lifted2008) - } - _ => panic() - } - - let lifted2011 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2010 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2010) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2007, - max: lifted2009, - unit: lifted2011, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted2012) - } - 10 => { - let lifted2019 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2014 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2013 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2216 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - Option::Some(lifted2013) - } - _ => panic() - } - - let lifted2016 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2015 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2216) + } + _ => panic() + } - Option::Some(lifted2015) - } - _ => panic() - } - - let lifted2018 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2017 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2017) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2014, - max: lifted2016, - unit: lifted2018, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted2019) - } - 11 => { - let lifted2026 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2021 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2020 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(@types.NumericRestrictions::{min : lifted2213, max : lifted2215, unit : lifted2217}) + } + _ => panic() + } - Option::Some(lifted2020) - } - _ => panic() - } - - let lifted2023 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2022 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::S8Type(lifted2218) + } + 3 => { - Option::Some(lifted2022) - } - _ => panic() - } - - let lifted2025 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2024 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2024) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2021, - max: lifted2023, - unit: lifted2025, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted2026) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array2041 : Array[@types.NamedFieldType] = [] - for index2042 = 0 - index2042 < mbt_ffi_load32(iter_base + 12) - index2042 = index2042 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2042 * 68 - - let result2027 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2029 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2028 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2028) - } - _ => panic() - } + let lifted2225 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let array2031 : Array[String] = [] - for index2032 = 0 - index2032 < mbt_ffi_load32(iter_base + 28) - index2032 = index2032 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2032 * 8 + let lifted2220 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let result2030 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2219 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - array2031.push(result2030) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let array2034 : Array[String] = [] - for index2035 = 0 - index2035 < mbt_ffi_load32(iter_base + 36) - index2035 = index2035 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index2035 * 8 + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2219) + } + _ => panic() + } + + let lifted2222 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2221 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2221) + } + _ => panic() + } + + let lifted2224 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2223 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2223) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2220, max : lifted2222, unit : lifted2224}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted2225) + } + 4 => { + + let lifted2232 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2227 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2226 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2226) + } + _ => panic() + } + + let lifted2229 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2228 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2228) + } + _ => panic() + } + + let lifted2231 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2230 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2230) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2227, max : lifted2229, unit : lifted2231}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted2232) + } + 5 => { + + let lifted2239 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2234 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2233 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2233) + } + _ => panic() + } + + let lifted2236 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2235 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2235) + } + _ => panic() + } + + let lifted2238 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2237 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2237) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2234, max : lifted2236, unit : lifted2238}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted2239) + } + 6 => { + + let lifted2246 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2241 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2240 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2240) + } + _ => panic() + } + + let lifted2243 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2242 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2242) + } + _ => panic() + } + + let lifted2245 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2244 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2244) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2241, max : lifted2243, unit : lifted2245}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted2246) + } + 7 => { + + let lifted2253 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2248 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2247 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2247) + } + _ => panic() + } + + let lifted2250 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2249 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2249) + } + _ => panic() + } + + let lifted2252 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2251 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2251) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2248, max : lifted2250, unit : lifted2252}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted2253) + } + 8 => { + + let lifted2260 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2255 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2254 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2254) + } + _ => panic() + } + + let lifted2257 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2256 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2256) + } + _ => panic() + } + + let lifted2259 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2258 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2258) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2255, max : lifted2257, unit : lifted2259}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted2260) + } + 9 => { + + let lifted2267 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2262 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2261 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2261) + } + _ => panic() + } + + let lifted2264 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2263 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2263) + } + _ => panic() + } + + let lifted2266 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2265 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2265) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2262, max : lifted2264, unit : lifted2266}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted2267) + } + 10 => { + + let lifted2274 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2269 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2268 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2268) + } + _ => panic() + } + + let lifted2271 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2270 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2270) + } + _ => panic() + } + + let lifted2273 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2272 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2272) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2269, max : lifted2271, unit : lifted2273}) + } + _ => panic() + } - let result2033 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::F32Type(lifted2274) + } + 11 => { - array2034.push(result2033) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted2037 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result2036 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result2036) - } - _ => panic() - } + let lifted2281 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted2040 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted2039 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2038 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + let lifted2276 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - @types.Role::Other(result2038) - } - _ => panic() - } + let lifted2275 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - Option::Some(lifted2039) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - array2041.push(@types.NamedFieldType::{ - name: result2027, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted2029, - aliases: array2031, - examples: array2034, - deprecated: lifted2037, - role: lifted2040, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array2041) - } - 15 => { - let array2058 : Array[@types.VariantCaseType] = [] - for index2059 = 0 - index2059 < mbt_ffi_load32(iter_base + 12) - index2059 = index2059 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2059 * 72 - - let result2043 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2044 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - let lifted2046 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2045 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2045) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - let array2048 : Array[String] = [] - for index2049 = 0 - index2049 < mbt_ffi_load32(iter_base + 32) - index2049 = index2049 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2049 * 8 + Option::Some(lifted2275) + } + _ => panic() + } - let result2047 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2278 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - array2048.push(result2047) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let lifted2277 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let array2051 : Array[String] = [] - for index2052 = 0 - index2052 < mbt_ffi_load32(iter_base + 40) - index2052 = index2052 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index2052 * 8 + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - let result2050 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - array2051.push(result2050) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted2054 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result2053 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result2053) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted2057 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted2056 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2055 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + Option::Some(lifted2277) + } + _ => panic() + } - @types.Role::Other(result2055) - } - _ => panic() - } + let lifted2280 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - Option::Some(lifted2056) - } - _ => panic() - } + let result2279 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - array2058.push(@types.VariantCaseType::{ - name: result2043, - payload: lifted2044, - metadata: @types.MetadataEnvelope::{ - doc: lifted2046, - aliases: array2048, - examples: array2051, - deprecated: lifted2054, - role: lifted2057, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array2058) - } - 16 => { - let array2061 : Array[String] = [] - for index2062 = 0 - index2062 < mbt_ffi_load32(iter_base + 12) - index2062 = index2062 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2062 * 8 - - let result2060 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2061.push(result2060) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array2061) - } - 17 => { - let array2064 : Array[String] = [] - for index2065 = 0 - index2065 < mbt_ffi_load32(iter_base + 12) - index2065 = index2065 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2065 * 8 - - let result2063 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2064.push(result2063) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array2064) - } - 18 => { - let array2066 : Array[Int] = [] - for index2067 = 0 - index2067 < mbt_ffi_load32(iter_base + 12) - index2067 = index2067 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2067 * 4 - - array2066.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array2066) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted2068 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted2069 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted2068, - err: lifted2069, - }) - } - 24 => { - let lifted2073 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2071 : Array[String] = [] - for index2072 = 0 - index2072 < mbt_ffi_load32(iter_base + 16) - index2072 = index2072 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2072 * 8 - - let result2070 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2071.push(result2070) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2071) - } - _ => panic() - } - - let lifted2074 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2075 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2077 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2076 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2076) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted2073, - min_length: lifted2074, - max_length: lifted2075, - regex: lifted2077, - }) - } - 25 => { - let lifted2081 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2079 : Array[String] = [] - for index2080 = 0 - index2080 < mbt_ffi_load32(iter_base + 16) - index2080 = index2080 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2080 * 8 - - let result2078 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2079.push(result2078) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2079) - } - _ => panic() - } - - let lifted2082 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2083 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted2081, - min_bytes: lifted2082, - max_bytes: lifted2083, - }) - } - 26 => { - let lifted2087 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array2085 : Array[String] = [] - for index2086 = 0 - index2086 < mbt_ffi_load32(iter_base + 20) - index2086 = index2086 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2086 * 8 - - let result2084 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2085.push(result2084) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array2085) - } - _ => panic() - } - - let lifted2091 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array2089 : Array[String] = [] - for index2090 = 0 - index2090 < mbt_ffi_load32(iter_base + 32) - index2090 = index2090 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2090 * 8 - - let result2088 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2089.push(result2088) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array2089) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted2087, - allowed_extensions: lifted2091, - }) - } - 27 => { - let lifted2095 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2093 : Array[String] = [] - for index2094 = 0 - index2094 < mbt_ffi_load32(iter_base + 16) - index2094 = index2094 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2094 * 8 - - let result2092 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2093.push(result2092) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2093) - } - _ => panic() - } - - let lifted2099 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array2097 : Array[String] = [] - for index2098 = 0 - index2098 < mbt_ffi_load32(iter_base + 28) - index2098 = index2098 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2098 * 8 - - let result2096 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2097.push(result2096) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array2097) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted2095, - allowed_hosts: lifted2099, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result2100 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2102 : Array[String] = [] - for index2103 = 0 - index2103 < mbt_ffi_load32(iter_base + 20) - index2103 = index2103 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2103 * 8 - - let result2101 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2102.push(result2101) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted2105 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2104 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result2104, - }) - } - _ => panic() - } - - let lifted2107 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result2106 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result2106, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result2100, - allowed_suffixes: array2102, - min: lifted2105, - max: lifted2107, - }) - } - 31 => { - let array2131 : Array[@types.UnionBranch] = [] - for index2132 = 0 - index2132 < mbt_ffi_load32(iter_base + 12) - index2132 = index2132 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2132 * 92 - - let result2108 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2117 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result2109 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result2109) - } - 1 => { - let result2110 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result2110) - } - 2 => { - let result2111 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result2111) - } - 3 => { - let result2112 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result2112) - } - 4 => { - let result2113 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted2115 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2114 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + Option::Some(result2279) + } + _ => panic() + } - Option::Some(result2114) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result2113, - literal: lifted2115, - }) - } - 5 => { - let result2116 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result2116) - } - _ => panic() - } + Option::Some(@types.NumericRestrictions::{min : lifted2276, max : lifted2278, unit : lifted2280}) + } + _ => panic() + } - let lifted2119 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2118 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2118) - } - _ => panic() - } + @types.SchemaTypeBody::F64Type(lifted2281) + } + 12 => { - let array2121 : Array[String] = [] - for index2122 = 0 - index2122 < mbt_ffi_load32(iter_base + 52) - index2122 = index2122 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2122 * 8 + @types.SchemaTypeBody::CharType + } + 13 => { - let result2120 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::StringType + } + 14 => { - array2121.push(result2120) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let array2296 : Array[@types.NamedFieldType] = []; + for index2297 = 0; index2297 < (mbt_ffi_load32((iter_base) + 12)); index2297 = index2297 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2297 * 68) - let array2124 : Array[String] = [] - for index2125 = 0 - index2125 < mbt_ffi_load32(iter_base + 60) - index2125 = index2125 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2125 * 8 + let result2282 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result2123 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2284 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - array2124.push(result2123) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted2127 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2126 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2126) - } - _ => panic() - } + let result2283 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let lifted2130 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted2129 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2128 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + Option::Some(result2283) + } + _ => panic() + } - @types.Role::Other(result2128) - } - _ => panic() - } + let array2286 : Array[String] = []; + for index2287 = 0; index2287 < (mbt_ffi_load32((iter_base) + 28)); index2287 = index2287 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2287 * 8) - Option::Some(lifted2129) - } - _ => panic() - } + let result2285 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array2131.push(@types.UnionBranch::{ - tag: result2108, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted2117, - metadata: @types.MetadataEnvelope::{ - doc: lifted2119, - aliases: array2121, - examples: array2124, - deprecated: lifted2127, - role: lifted2130, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array2131, - }) - } - 32 => { - let lifted2134 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2133 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2133) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted2134, - }) - } - 33 => { - let lifted2136 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2135 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2135) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted2136, - }) - } - 34 => { - let lifted2137 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted2137) - } - 35 => { - let lifted2138 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted2138) - } - _ => panic() - } + array2286.push(result2285) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - let lifted2141 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result2140 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result2140) - } - _ => panic() - } + let array2289 : Array[String] = []; + for index2290 = 0; index2290 < (mbt_ffi_load32((iter_base) + 36)); index2290 = index2290 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index2290 * 8) - let array2143 : Array[String] = [] - for index2144 = 0 - index2144 < mbt_ffi_load32(iter_base + 104) - index2144 = index2144 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index2144 * 8 + let result2288 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result2142 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2289.push(result2288) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - array2143.push(result2142) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let lifted2292 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - let array2146 : Array[String] = [] - for index2147 = 0 - index2147 < mbt_ffi_load32(iter_base + 112) - index2147 = index2147 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index2147 * 8 + let result2291 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - let result2145 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(result2291) + } + _ => panic() + } - array2146.push(result2145) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted2149 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result2148 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result2148) - } - _ => panic() - } + let lifted2295 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { - let lifted2152 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted2151 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result2150) - } - _ => panic() - } + let lifted2294 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { - Option::Some(lifted2151) - } - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - array2153.push(@types.SchemaTypeNode::{ - body: lifted2139, - metadata: @types.MetadataEnvelope::{ - doc: lifted2141, - aliases: array2143, - examples: array2146, - deprecated: lifted2149, - role: lifted2152, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let array2158 : Array[@types.SchemaTypeDef] = [] - for index2159 = 0 - index2159 < mbt_ffi_load32(iter_base + 52) - index2159 = index2159 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2159 * 24 - - let result2155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2157 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2156 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2156) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - array2158.push(@types.SchemaTypeDef::{ - id: result2155, - name: lifted2157, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array2189 : Array[@types.SchemaValueNode] = [] - for index2190 = 0 - index2190 < mbt_ffi_load32(iter_base + 64) - index2190 = index2190 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + - index2190 * 32 - - let lifted2188 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result2160 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result2160) - } - 13 => { - let array2161 : Array[Int] = [] - for index2162 = 0 - index2162 < mbt_ffi_load32(iter_base + 12) - index2162 = index2162 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2162 * 4 - - array2161.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array2161) - } - 14 => { - let lifted2163 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted2163, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array2164 : Array[Bool] = [] - for index2165 = 0 - index2165 < mbt_ffi_load32(iter_base + 12) - index2165 = index2165 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2165 * 1 - - array2164.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array2164) - } - 17 => { - let array2166 : Array[Int] = [] - for index2167 = 0 - index2167 < mbt_ffi_load32(iter_base + 12) - index2167 = index2167 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2167 * 4 - - array2166.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array2166) - } - 18 => { - let array2168 : Array[Int] = [] - for index2169 = 0 - index2169 < mbt_ffi_load32(iter_base + 12) - index2169 = index2169 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2169 * 4 - - array2168.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array2168) - } - 19 => { - let array2170 : Array[Int] = [] - for index2171 = 0 - index2171 < mbt_ffi_load32(iter_base + 12) - index2171 = index2171 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2171 * 4 - - array2170.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array2170) - } - 20 => { - let array2172 : Array[@types.MapEntry] = [] - for index2173 = 0 - index2173 < mbt_ffi_load32(iter_base + 12) - index2173 = index2173 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2173 * 8 - - array2172.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array2172) - } - 21 => { - let lifted2174 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted2174) - } - 22 => { - let lifted2177 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted2175 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted2175) - } - 1 => { - let lifted2176 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted2176) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted2177) - } - 23 => { - let result2178 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2180 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2179 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2179) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result2178, - language: lifted2180, - }) - } - 24 => { - let result2181 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2183 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2182 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2182) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result2181, - mime_type: lifted2183, - }) - } - 25 => { - let result2184 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result2184) - } - 26 => { - let result2185 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result2185) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result2186 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result2186, - }) - } - 30 => { - let result2187 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result2187, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - array2189.push(lifted2188) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - let result2191 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 72), - mbt_ffi_load32(iter_base + 76), - ) - - let array2193 : Array[String] = [] - for index2194 = 0 - index2194 < mbt_ffi_load32(iter_base + 84) - index2194 = index2194 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 80) + index2194 * 8 - - let result2192 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2193.push(result2192) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 80)) - - let array2208 : Array[Array[SpanData]] = [] - for index2209 = 0 - index2209 < mbt_ffi_load32(iter_base + 92) - index2209 = index2209 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 88) + index2209 * 8 - - let array2206 : Array[SpanData] = [] - for index2207 = 0 - index2207 < mbt_ffi_load32(iter_base + 4) - index2207 = index2207 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index2207 * 80 - - let lifted2205 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2195 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2197 : String? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result2196 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result2196) - } - _ => panic() - } + let result2293 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - let lifted2198 : UInt64? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Other(result2293) + } + _ => panic() + } - let array2202 : Array[@context.Attribute] = [] - for index2203 = 0 - index2203 < mbt_ffi_load32(iter_base + 68) - index2203 = index2203 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index2203 * 20 - - let result2199 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2201 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result2200 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result2200) - } - _ => panic() - } - - array2202.push(@context.Attribute::{ - key: result2199, - value: lifted2201, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - SpanData::LocalSpan(LocalSpanData::{ - span_id: result2195, - start: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent: lifted2197, - linked_context: lifted2198, - attributes: array2202, - inherited: mbt_ffi_load8_u(iter_base + 72) != 0, - }) - } - 1 => { - let result2204 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - SpanData::ExternalSpan(ExternalSpanData::{ - span_id: result2204, - }) - } - _ => panic() - } - - array2206.push(lifted2205) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array2208.push(array2206) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - - AgentInvocation::AgentInitialization(AgentInitializationParameters::{ - idempotency_key: result1956, - constructor_parameters: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array2153, - defs: array2158, - root: mbt_ffi_load32(iter_base + 56), - }, - value: @types.SchemaValueTree::{ - value_nodes: array2189, - root: mbt_ffi_load32(iter_base + 68), - }, - }, - trace_id: result2191, - trace_states: array2193, - invocation_context: array2208, - }) - } - 1 => { - let result2210 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result2211 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let array2408 : Array[@types.SchemaTypeNode] = [] - for index2409 = 0 - index2409 < mbt_ffi_load32(iter_base + 52) - index2409 = index2409 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2409 * 144 - - let lifted2394 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted2218 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2213 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2212 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted2294) + } + _ => panic() + } - Option::Some(lifted2212) - } - _ => panic() - } - - let lifted2215 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2214 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2296.push(@types.NamedFieldType::{name : result2282, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted2284, aliases : array2286, examples : array2289, deprecated : lifted2292, role : lifted2295}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted2214) - } - _ => panic() - } - - let lifted2217 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2216 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2216) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2213, - max: lifted2215, - unit: lifted2217, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted2218) - } - 3 => { - let lifted2225 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2220 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2219 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::RecordType(array2296) + } + 15 => { - Option::Some(lifted2219) - } - _ => panic() - } - - let lifted2222 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2221 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2313 : Array[@types.VariantCaseType] = []; + for index2314 = 0; index2314 < (mbt_ffi_load32((iter_base) + 12)); index2314 = index2314 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2314 * 72) - Option::Some(lifted2221) - } - _ => panic() - } - - let lifted2224 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2223 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2223) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2220, - max: lifted2222, - unit: lifted2224, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted2225) - } - 4 => { - let lifted2232 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2227 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2226 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2298 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted2226) - } - _ => panic() - } - - let lifted2229 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2228 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2299 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted2228) - } - _ => panic() - } - - let lifted2231 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2230 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2230) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2227, - max: lifted2229, - unit: lifted2231, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted2232) - } - 5 => { - let lifted2239 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2234 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2233 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted2233) - } - _ => panic() - } - - let lifted2236 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2235 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2301 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted2235) - } - _ => panic() - } - - let lifted2238 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2237 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2237) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2234, - max: lifted2236, - unit: lifted2238, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted2239) - } - 6 => { - let lifted2246 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2241 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2240 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2300 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Option::Some(lifted2240) - } - _ => panic() - } - - let lifted2243 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2242 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2300) + } + _ => panic() + } - Option::Some(lifted2242) - } - _ => panic() - } - - let lifted2245 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2244 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2244) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2241, - max: lifted2243, - unit: lifted2245, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted2246) - } - 7 => { - let lifted2253 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2248 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2247 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2303 : Array[String] = []; + for index2304 = 0; index2304 < (mbt_ffi_load32((iter_base) + 32)); index2304 = index2304 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2304 * 8) - Option::Some(lifted2247) - } - _ => panic() - } - - let lifted2250 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2249 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2302 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted2249) - } - _ => panic() - } - - let lifted2252 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2251 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2251) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2248, - max: lifted2250, - unit: lifted2252, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted2253) - } - 8 => { - let lifted2260 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2255 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2254 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2303.push(result2302) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - Option::Some(lifted2254) - } - _ => panic() - } - - let lifted2257 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2256 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2306 : Array[String] = []; + for index2307 = 0; index2307 < (mbt_ffi_load32((iter_base) + 40)); index2307 = index2307 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2307 * 8) - Option::Some(lifted2256) - } - _ => panic() - } - - let lifted2259 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2258 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2258) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2255, - max: lifted2257, - unit: lifted2259, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted2260) - } - 9 => { - let lifted2267 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2262 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2261 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2305 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted2261) - } - _ => panic() - } - - let lifted2264 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2263 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2306.push(result2305) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - Option::Some(lifted2263) - } - _ => panic() - } - - let lifted2266 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2265 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2265) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2262, - max: lifted2264, - unit: lifted2266, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted2267) - } - 10 => { - let lifted2274 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2269 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2268 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2309 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { - Option::Some(lifted2268) - } - _ => panic() - } - - let lifted2271 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2270 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2308 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - Option::Some(lifted2270) - } - _ => panic() - } - - let lifted2273 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2272 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2272) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2269, - max: lifted2271, - unit: lifted2273, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted2274) - } - 11 => { - let lifted2281 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2276 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2275 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2308) + } + _ => panic() + } - Option::Some(lifted2275) - } - _ => panic() - } - - let lifted2278 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2277 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2312 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - Option::Some(lifted2277) - } - _ => panic() - } - - let lifted2280 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2279 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2279) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2276, - max: lifted2278, - unit: lifted2280, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted2281) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array2296 : Array[@types.NamedFieldType] = [] - for index2297 = 0 - index2297 < mbt_ffi_load32(iter_base + 12) - index2297 = index2297 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2297 * 68 - - let result2282 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2284 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2283 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2283) - } - _ => panic() - } + let lifted2311 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { - let array2286 : Array[String] = [] - for index2287 = 0 - index2287 < mbt_ffi_load32(iter_base + 28) - index2287 = index2287 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2287 * 8 + @types.Role::Multimodal + } + 1 => { - let result2285 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.Role::UnstructuredText + } + 2 => { - array2286.push(result2285) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @types.Role::UnstructuredBinary + } + 3 => { - let array2289 : Array[String] = [] - for index2290 = 0 - index2290 < mbt_ffi_load32(iter_base + 36) - index2290 = index2290 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index2290 * 8 + let result2310 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) - let result2288 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.Role::Other(result2310) + } + _ => panic() + } - array2289.push(result2288) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted2292 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result2291 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result2291) - } - _ => panic() - } + Option::Some(lifted2311) + } + _ => panic() + } - let lifted2295 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted2294 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2293 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + array2313.push(@types.VariantCaseType::{name : result2298, payload : lifted2299, metadata : @types.MetadataEnvelope::{doc : lifted2301, aliases : array2303, examples : array2306, deprecated : lifted2309, role : lifted2312}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.Role::Other(result2293) - } - _ => panic() - } + @types.SchemaTypeBody::VariantType(array2313) + } + 16 => { - Option::Some(lifted2294) - } - _ => panic() - } + let array2316 : Array[String] = []; + for index2317 = 0; index2317 < (mbt_ffi_load32((iter_base) + 12)); index2317 = index2317 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2317 * 8) - array2296.push(@types.NamedFieldType::{ - name: result2282, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted2284, - aliases: array2286, - examples: array2289, - deprecated: lifted2292, - role: lifted2295, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array2296) - } - 15 => { - let array2313 : Array[@types.VariantCaseType] = [] - for index2314 = 0 - index2314 < mbt_ffi_load32(iter_base + 12) - index2314 = index2314 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2314 * 72 - - let result2298 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2299 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result2315 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted2301 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2300 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2300) - } - _ => panic() - } + array2316.push(result2315) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array2303 : Array[String] = [] - for index2304 = 0 - index2304 < mbt_ffi_load32(iter_base + 32) - index2304 = index2304 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2304 * 8 + @types.SchemaTypeBody::EnumType(array2316) + } + 17 => { - let result2302 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array2319 : Array[String] = []; + for index2320 = 0; index2320 < (mbt_ffi_load32((iter_base) + 12)); index2320 = index2320 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2320 * 8) - array2303.push(result2302) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let result2318 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array2306 : Array[String] = [] - for index2307 = 0 - index2307 < mbt_ffi_load32(iter_base + 40) - index2307 = index2307 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index2307 * 8 + array2319.push(result2318) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let result2305 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::FlagsType(array2319) + } + 18 => { - array2306.push(result2305) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted2309 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result2308 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result2308) - } - _ => panic() - } + let array2321 : Array[Int] = []; + for index2322 = 0; index2322 < (mbt_ffi_load32((iter_base) + 12)); index2322 = index2322 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2322 * 4) - let lifted2312 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted2311 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2310 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + array2321.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.Role::Other(result2310) - } - _ => panic() - } + @types.SchemaTypeBody::TupleType(array2321) + } + 19 => { - Option::Some(lifted2311) - } - _ => panic() - } + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { - array2313.push(@types.VariantCaseType::{ - name: result2298, - payload: lifted2299, - metadata: @types.MetadataEnvelope::{ - doc: lifted2301, - aliases: array2303, - examples: array2306, - deprecated: lifted2309, - role: lifted2312, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array2313) - } - 16 => { - let array2316 : Array[String] = [] - for index2317 = 0 - index2317 < mbt_ffi_load32(iter_base + 12) - index2317 = index2317 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2317 * 8 - - let result2315 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2316.push(result2315) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array2316) - } - 17 => { - let array2319 : Array[String] = [] - for index2320 = 0 - index2320 < mbt_ffi_load32(iter_base + 12) - index2320 = index2320 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2320 * 8 - - let result2318 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2319.push(result2318) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array2319) - } - 18 => { - let array2321 : Array[Int] = [] - for index2322 = 0 - index2322 < mbt_ffi_load32(iter_base + 12) - index2322 = index2322 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2322 * 4 - - array2321.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array2321) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted2323 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted2324 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted2323, - err: lifted2324, - }) - } - 24 => { - let lifted2328 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2326 : Array[String] = [] - for index2327 = 0 - index2327 < mbt_ffi_load32(iter_base + 16) - index2327 = index2327 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2327 * 8 - - let result2325 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2326.push(result2325) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2326) - } - _ => panic() - } - - let lifted2329 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2330 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2332 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2331 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2331) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted2328, - min_length: lifted2329, - max_length: lifted2330, - regex: lifted2332, - }) - } - 25 => { - let lifted2336 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2334 : Array[String] = [] - for index2335 = 0 - index2335 < mbt_ffi_load32(iter_base + 16) - index2335 = index2335 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2335 * 8 - - let result2333 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2334.push(result2333) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2334) - } - _ => panic() - } - - let lifted2337 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2338 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted2336, - min_bytes: lifted2337, - max_bytes: lifted2338, - }) - } - 26 => { - let lifted2342 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array2340 : Array[String] = [] - for index2341 = 0 - index2341 < mbt_ffi_load32(iter_base + 20) - index2341 = index2341 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2341 * 8 - - let result2339 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2340.push(result2339) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array2340) - } - _ => panic() - } - - let lifted2346 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array2344 : Array[String] = [] - for index2345 = 0 - index2345 < mbt_ffi_load32(iter_base + 32) - index2345 = index2345 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2345 * 8 - - let result2343 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2344.push(result2343) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array2344) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted2342, - allowed_extensions: lifted2346, - }) - } - 27 => { - let lifted2350 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2348 : Array[String] = [] - for index2349 = 0 - index2349 < mbt_ffi_load32(iter_base + 16) - index2349 = index2349 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2349 * 8 - - let result2347 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2348.push(result2347) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2348) - } - _ => panic() - } - - let lifted2354 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array2352 : Array[String] = [] - for index2353 = 0 - index2353 < mbt_ffi_load32(iter_base + 28) - index2353 = index2353 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2353 * 8 - - let result2351 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2352.push(result2351) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array2352) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted2350, - allowed_hosts: lifted2354, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result2355 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2357 : Array[String] = [] - for index2358 = 0 - index2358 < mbt_ffi_load32(iter_base + 20) - index2358 = index2358 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2358 * 8 - - let result2356 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2357.push(result2356) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted2360 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2359 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result2359, - }) - } - _ => panic() - } - - let lifted2362 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result2361 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result2361, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result2355, - allowed_suffixes: array2357, - min: lifted2360, - max: lifted2362, - }) - } - 31 => { - let array2386 : Array[@types.UnionBranch] = [] - for index2387 = 0 - index2387 < mbt_ffi_load32(iter_base + 12) - index2387 = index2387 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2387 * 92 - - let result2363 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2372 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result2364 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result2364) - } - 1 => { - let result2365 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result2365) - } - 2 => { - let result2366 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result2366) - } - 3 => { - let result2367 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result2367) - } - 4 => { - let result2368 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted2370 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2369 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { - Option::Some(result2369) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result2368, - literal: lifted2370, - }) - } - 5 => { - let result2371 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result2371) - } - _ => panic() - } + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { - let lifted2374 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2373 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2373) - } - _ => panic() - } + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { - let array2376 : Array[String] = [] - for index2377 = 0 - index2377 < mbt_ffi_load32(iter_base + 52) - index2377 = index2377 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2377 * 8 + let lifted2323 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let result2375 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - array2376.push(result2375) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let lifted2324 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let array2379 : Array[String] = [] - for index2380 = 0 - index2380 < mbt_ffi_load32(iter_base + 60) - index2380 = index2380 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2380 * 8 + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } - let result2378 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted2323, err : lifted2324}) + } + 24 => { - array2379.push(result2378) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted2382 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2381 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2381) - } - _ => panic() - } + let lifted2328 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted2385 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted2384 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2383 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + let array2326 : Array[String] = []; + for index2327 = 0; index2327 < (mbt_ffi_load32((iter_base) + 16)); index2327 = index2327 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2327 * 8) - @types.Role::Other(result2383) - } - _ => panic() - } + let result2325 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted2384) - } - _ => panic() - } + array2326.push(result2325) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - array2386.push(@types.UnionBranch::{ - tag: result2363, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted2372, - metadata: @types.MetadataEnvelope::{ - doc: lifted2374, - aliases: array2376, - examples: array2379, - deprecated: lifted2382, - role: lifted2385, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array2386, - }) - } - 32 => { - let lifted2389 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2388 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2388) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted2389, - }) - } - 33 => { - let lifted2391 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2390 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2390) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted2391, - }) - } - 34 => { - let lifted2392 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted2392) - } - 35 => { - let lifted2393 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted2393) - } - _ => panic() - } + Option::Some(array2326) + } + _ => panic() + } - let lifted2396 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result2395 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result2395) - } - _ => panic() - } + let lifted2329 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - let array2398 : Array[String] = [] - for index2399 = 0 - index2399 < mbt_ffi_load32(iter_base + 104) - index2399 = index2399 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index2399 * 8 + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - let result2397 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2330 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - array2398.push(result2397) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - let array2401 : Array[String] = [] - for index2402 = 0 - index2402 < mbt_ffi_load32(iter_base + 112) - index2402 = index2402 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index2402 * 8 + let lifted2332 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - let result2400 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2331 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - array2401.push(result2400) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted2404 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result2403 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result2403) - } - _ => panic() - } + Option::Some(result2331) + } + _ => panic() + } - let lifted2407 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted2406 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2405 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result2405) - } - _ => panic() - } + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted2328, min_length : lifted2329, max_length : lifted2330, regex : lifted2332}) + } + 25 => { - Option::Some(lifted2406) - } - _ => panic() - } + let lifted2336 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array2408.push(@types.SchemaTypeNode::{ - body: lifted2394, - metadata: @types.MetadataEnvelope::{ - doc: lifted2396, - aliases: array2398, - examples: array2401, - deprecated: lifted2404, - role: lifted2407, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array2413 : Array[@types.SchemaTypeDef] = [] - for index2414 = 0 - index2414 < mbt_ffi_load32(iter_base + 60) - index2414 = index2414 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2414 * 24 - - let result2410 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2412 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2411 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2411) - } - _ => panic() - } + let array2334 : Array[String] = []; + for index2335 = 0; index2335 < (mbt_ffi_load32((iter_base) + 16)); index2335 = index2335 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2335 * 8) - array2413.push(@types.SchemaTypeDef::{ - id: result2410, - name: lifted2412, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let array2444 : Array[@types.SchemaValueNode] = [] - for index2445 = 0 - index2445 < mbt_ffi_load32(iter_base + 72) - index2445 = index2445 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + - index2445 * 32 - - let lifted2443 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result2415 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result2415) - } - 13 => { - let array2416 : Array[Int] = [] - for index2417 = 0 - index2417 < mbt_ffi_load32(iter_base + 12) - index2417 = index2417 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2417 * 4 - - array2416.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array2416) - } - 14 => { - let lifted2418 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted2418, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array2419 : Array[Bool] = [] - for index2420 = 0 - index2420 < mbt_ffi_load32(iter_base + 12) - index2420 = index2420 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2420 * 1 - - array2419.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array2419) - } - 17 => { - let array2421 : Array[Int] = [] - for index2422 = 0 - index2422 < mbt_ffi_load32(iter_base + 12) - index2422 = index2422 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2422 * 4 - - array2421.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array2421) - } - 18 => { - let array2423 : Array[Int] = [] - for index2424 = 0 - index2424 < mbt_ffi_load32(iter_base + 12) - index2424 = index2424 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2424 * 4 - - array2423.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array2423) - } - 19 => { - let array2425 : Array[Int] = [] - for index2426 = 0 - index2426 < mbt_ffi_load32(iter_base + 12) - index2426 = index2426 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2426 * 4 - - array2425.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array2425) - } - 20 => { - let array2427 : Array[@types.MapEntry] = [] - for index2428 = 0 - index2428 < mbt_ffi_load32(iter_base + 12) - index2428 = index2428 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2428 * 8 - - array2427.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array2427) - } - 21 => { - let lifted2429 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted2429) - } - 22 => { - let lifted2432 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted2430 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted2430) - } - 1 => { - let lifted2431 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted2431) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted2432) - } - 23 => { - let result2433 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2435 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2434 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2434) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result2433, - language: lifted2435, - }) - } - 24 => { - let result2436 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2438 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2437 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2437) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result2436, - mime_type: lifted2438, - }) - } - 25 => { - let result2439 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result2439) - } - 26 => { - let result2440 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result2440) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result2441 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result2441, - }) - } - 30 => { - let result2442 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result2442, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + let result2333 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array2444.push(lifted2443) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - let result2446 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 80), - mbt_ffi_load32(iter_base + 84), - ) - - let array2448 : Array[String] = [] - for index2449 = 0 - index2449 < mbt_ffi_load32(iter_base + 92) - index2449 = index2449 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 88) + index2449 * 8 - - let result2447 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2448.push(result2447) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - - let array2463 : Array[Array[SpanData]] = [] - for index2464 = 0 - index2464 < mbt_ffi_load32(iter_base + 100) - index2464 = index2464 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 96) + index2464 * 8 - - let array2461 : Array[SpanData] = [] - for index2462 = 0 - index2462 < mbt_ffi_load32(iter_base + 4) - index2462 = index2462 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index2462 * 80 - - let lifted2460 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2450 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2452 : String? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result2451 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result2451) - } - _ => panic() - } + array2334.push(result2333) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let lifted2453 : UInt64? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(array2334) + } + _ => panic() + } - let array2457 : Array[@context.Attribute] = [] - for index2458 = 0 - index2458 < mbt_ffi_load32(iter_base + 68) - index2458 = index2458 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index2458 * 20 - - let result2454 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2456 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result2455 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result2455) - } - _ => panic() - } - - array2457.push(@context.Attribute::{ - key: result2454, - value: lifted2456, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - SpanData::LocalSpan(LocalSpanData::{ - span_id: result2450, - start: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent: lifted2452, - linked_context: lifted2453, - attributes: array2457, - inherited: mbt_ffi_load8_u(iter_base + 72) != 0, - }) - } - 1 => { - let result2459 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - SpanData::ExternalSpan(ExternalSpanData::{ - span_id: result2459, - }) - } - _ => panic() - } - - array2461.push(lifted2460) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array2463.push(array2461) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 96)) - - AgentInvocation::AgentMethodInvocation(AgentMethodInvocationParameters::{ - idempotency_key: result2210, - method_name: result2211, - function_input: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array2408, - defs: array2413, - root: mbt_ffi_load32(iter_base + 64), - }, - value: @types.SchemaValueTree::{ - value_nodes: array2444, - root: mbt_ffi_load32(iter_base + 76), - }, - }, - trace_id: result2446, - trace_states: array2448, - invocation_context: array2463, - }) - } - 2 => AgentInvocation::SaveSnapshot - 3 => { - let result2465 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result2466 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - AgentInvocation::LoadSnapshot(LoadSnapshotParameters::{ - snapshot: SnapshotData::{ - data: result2465, - mime_type: result2466, - }, - }) - } - 4 => { - let result2467 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - AgentInvocation::ProcessOplogEntries(ProcessOplogEntriesParameters::{ - idempotency_key: result2467, - }) - } - 5 => - AgentInvocation::ManualUpdate(ManualUpdateParameters::{ - target_revision: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }) - _ => panic() - } + let lifted2337 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - PublicOplogEntry::PendingAgentInvocation(PendingAgentInvocationParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - invocation: lifted2468, - }) - } - 15 => { - let lifted2471 = match mbt_ffi_load8_u(iter_base + 32) { - 0 => UpdateDescription::AutoUpdate - 1 => { - let result2469 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - let result2470 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - UpdateDescription::SnapshotBased(@host.Snapshot::{ - payload: result2469, - mime_type: result2470, - }) - } - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - PublicOplogEntry::PendingUpdate(PendingUpdateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - target_revision: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - description: lifted2471, - }) - } - 16 => { - let array2478 : Array[PluginInstallationDescription] = [] - for index2479 = 0 - index2479 < mbt_ffi_load32(iter_base + 44) - index2479 = index2479 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index2479 * 48 - - let result2472 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - let result2473 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - let array2476 : Array[(String, String)] = [] - for index2477 = 0 - index2477 < mbt_ffi_load32(iter_base + 40) - index2477 = index2477 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index2477 * 16 - - let result2474 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2475 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array2476.push((result2474, result2475)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - array2478.push(PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 16), - plugin_name: result2472, - plugin_version: result2473, - parameters: array2476, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - PublicOplogEntry::SuccessfulUpdate(SuccessfulUpdateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - target_revision: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - new_component_size: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - new_active_plugins: array2478, - }) - } - 17 => { - let lifted2481 : String? = match mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result2480 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result2480) - } - _ => panic() - } + let lifted2338 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - PublicOplogEntry::FailedUpdate(FailedUpdateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - target_revision: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - details: lifted2481, - }) - } - 18 => - PublicOplogEntry::GrowMemory(GrowMemoryParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - delta: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - 19 => - PublicOplogEntry::FilesystemStorageUsageUpdate(FilesystemStorageUsageUpdateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - delta: mbt_ffi_load64(iter_base + 24), - }) - 20 => { - let result2482 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result2483 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - PublicOplogEntry::CreateResource(CreateResourceParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - id: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - name: result2482, - owner: result2483, - }) - } - 21 => { - let result2484 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result2485 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - PublicOplogEntry::DropResource(DropResourceParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - id: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - name: result2484, - owner: result2485, - }) - } - 22 => { - let result2486 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - let result2487 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - PublicOplogEntry::Log(LogParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - level: LogLevel::from(mbt_ffi_load8_u(iter_base + 24)), - context: result2486, - message: result2487, - }) - } - 23 => - PublicOplogEntry::Restart(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - }) - 24 => { - let result2488 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - let result2489 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - let array2492 : Array[(String, String)] = [] - for index2493 = 0 - index2493 < mbt_ffi_load32(iter_base + 64) - index2493 = index2493 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + index2493 * 16 - - let result2490 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2491 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array2492.push((result2490, result2491)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - PublicOplogEntry::ActivatePlugin(ActivatePluginParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - plugin: PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 40), - plugin_name: result2488, - plugin_version: result2489, - parameters: array2492, - }, - }) - } - 25 => { - let result2494 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - let result2495 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - let array2498 : Array[(String, String)] = [] - for index2499 = 0 - index2499 < mbt_ffi_load32(iter_base + 64) - index2499 = index2499 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + index2499 * 16 - - let result2496 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2497 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array2498.push((result2496, result2497)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - PublicOplogEntry::DeactivatePlugin(DeactivatePluginParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - plugin: PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 40), - plugin_name: result2494, - plugin_version: result2495, - parameters: array2498, - }, - }) - } - 26 => - PublicOplogEntry::Revert(RevertParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - dropped_region: OplogRegion::{ - start: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - end: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }) - 27 => { - let result2500 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PublicOplogEntry::CancelPendingInvocation(CancelPendingInvocationParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - idempotency_key: result2500, - }) - } - 28 => { - let result2501 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let lifted2503 : String? = match mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result2502 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result2502) - } - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - let lifted2505 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result2504 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result2504) - } - _ => panic() - } + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted2336, min_bytes : lifted2337, max_bytes : lifted2338}) + } + 26 => { - let array2509 : Array[@context.Attribute] = [] - for index2510 = 0 - index2510 < mbt_ffi_load32(iter_base + 60) - index2510 = index2510 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index2510 * 20 - - let result2506 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2508 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result2507 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result2507) - } - _ => panic() - } - - array2509.push(@context.Attribute::{ - key: result2506, - value: lifted2508, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - PublicOplogEntry::StartSpan(StartSpanParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - span_id: result2501, - parent: lifted2503, - linked_context_id: lifted2505, - attributes: array2509, - }) - } - 29 => { - let result2511 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PublicOplogEntry::FinishSpan(FinishSpanParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - span_id: result2511, - }) - } - 30 => { - let result2512 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let result2513 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let lifted2515 = match mbt_ffi_load8_u(iter_base + 40) { - 0 => { - let result2514 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - @context.AttributeValue::String(result2514) - } - _ => panic() - } + let lifted2342 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - PublicOplogEntry::SetSpanAttribute(SetSpanAttributeParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - span_id: result2512, - key: result2513, - value: lifted2515, - }) - } - 31 => { - let lifted2516 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => @host.PersistenceLevel::PersistNothing - 1 => @host.PersistenceLevel::PersistRemoteSideEffects - 2 => @host.PersistenceLevel::Smart - _ => panic() - } + let array2340 : Array[String] = []; + for index2341 = 0; index2341 < (mbt_ffi_load32((iter_base) + 20)); index2341 = index2341 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2341 * 8) - PublicOplogEntry::ChangePersistenceLevel(ChangePersistenceLevelParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - persistence_level: lifted2516, - }) - } - 32 => { - let result2517 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PublicOplogEntry::BeginRemoteTransaction(BeginRemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - transaction_id: result2517, - }) - } - 33 => - PublicOplogEntry::PreCommitRemoteTransaction(RemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - 34 => - PublicOplogEntry::PreRollbackRemoteTransaction(RemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - 35 => - PublicOplogEntry::CommittedRemoteTransaction(RemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - 36 => - PublicOplogEntry::RolledBackRemoteTransaction(RemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - 37 => { - let result2518 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let result2519 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - PublicOplogEntry::Snapshot(SnapshotParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - data: SnapshotData::{ data: result2518, mime_type: result2519 }, - }) - } - 38 => { - let result2520 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - let result2521 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - let array2524 : Array[(String, String)] = [] - for index2525 = 0 - index2525 < mbt_ffi_load32(iter_base + 64) - index2525 = index2525 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + index2525 * 16 - - let result2522 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2523 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array2524.push((result2522, result2523)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - let result2526 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 88), - mbt_ffi_load32(iter_base + 92), - ) - - PublicOplogEntry::OplogProcessorCheckpoint(OplogProcessorCheckpointParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - plugin: PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 40), - plugin_name: result2520, - plugin_version: result2521, - parameters: array2524, - }, - target_agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 72).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 80).reinterpret_as_uint64(), - }, - }, - agent_id: result2526, - }, - confirmed_up_to: mbt_ffi_load64(iter_base + 96).reinterpret_as_uint64(), - sending_up_to: mbt_ffi_load64(iter_base + 104).reinterpret_as_uint64(), - last_batch_start: mbt_ffi_load64(iter_base + 112).reinterpret_as_uint64(), - }) - } - 39 => { - let result2527 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let array2559 : Array[@retry.PredicateNode] = [] - for index2560 = 0 - index2560 < mbt_ffi_load32(iter_base + 40) - index2560 = index2560 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index2560 * 32 - - let lifted2558 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2528 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2530 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2529 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2529) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let result2339 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @retry.PredicateNode::PropEq(@retry.PropertyComparison::{ - property_name: result2528, - value: lifted2530, - }) - } - 1 => { - let result2531 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2533 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2532 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2532) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + array2340.push(result2339) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - @retry.PredicateNode::PropNeq(@retry.PropertyComparison::{ - property_name: result2531, - value: lifted2533, - }) - } - 2 => { - let result2534 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2536 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2535 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2535) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + Option::Some(array2340) + } + _ => panic() + } - @retry.PredicateNode::PropGt(@retry.PropertyComparison::{ - property_name: result2534, - value: lifted2536, - }) - } - 3 => { - let result2537 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2539 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2538 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2538) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let lifted2346 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - @retry.PredicateNode::PropGte(@retry.PropertyComparison::{ - property_name: result2537, - value: lifted2539, - }) - } - 4 => { - let result2540 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2542 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2541 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2541) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let array2344 : Array[String] = []; + for index2345 = 0; index2345 < (mbt_ffi_load32((iter_base) + 32)); index2345 = index2345 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2345 * 8) - @retry.PredicateNode::PropLt(@retry.PropertyComparison::{ - property_name: result2540, - value: lifted2542, - }) - } - 5 => { - let result2543 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2545 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2544 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2544) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let result2343 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @retry.PredicateNode::PropLte(@retry.PropertyComparison::{ - property_name: result2543, - value: lifted2545, - }) - } - 6 => { - let result2546 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @retry.PredicateNode::PropExists(result2546) - } - 7 => { - let result2547 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2550 : Array[@retry.PredicateValue] = [] - for index2551 = 0 - index2551 < mbt_ffi_load32(iter_base + 20) - index2551 = index2551 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2551 * 16 - - let lifted2549 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2548 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @retry.PredicateValue::Text(result2548) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 8), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - _ => panic() - } - - array2550.push(lifted2549) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - @retry.PredicateNode::PropIn(@retry.PropertySetCheck::{ - property_name: result2547, - values: array2550, - }) - } - 8 => { - let result2552 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result2553 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropMatches(@retry.PropertyPattern::{ - property_name: result2552, - pattern: result2553, - }) - } - 9 => { - let result2554 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result2555 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropStartsWith(@retry.PropertyPattern::{ - property_name: result2554, - pattern: result2555, - }) - } - 10 => { - let result2556 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result2557 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropContains(@retry.PropertyPattern::{ - property_name: result2556, - pattern: result2557, - }) - } - 11 => - @retry.PredicateNode::PredAnd( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 12 => - @retry.PredicateNode::PredOr( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 13 => - @retry.PredicateNode::PredNot(mbt_ffi_load32(iter_base + 8)) - 14 => @retry.PredicateNode::PredTrue - 15 => @retry.PredicateNode::PredFalse - _ => panic() - } - - array2559.push(lifted2558) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array2595 : Array[@retry.PolicyNode] = [] - for index2596 = 0 - index2596 < mbt_ffi_load32(iter_base + 48) - index2596 = index2596 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + index2596 * 32 - - let lifted2594 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @retry.PolicyNode::Periodic( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 1 => - @retry.PolicyNode::Exponential(@retry.ExponentialConfig::{ - base_delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - factor: mbt_ffi_loadf64(iter_base + 16), - }) - 2 => - @retry.PolicyNode::Fibonacci(@retry.FibonacciConfig::{ - first: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - second: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - }) - 3 => @retry.PolicyNode::Immediate - 4 => @retry.PolicyNode::Never - 5 => - @retry.PolicyNode::CountBox(@retry.CountBoxConfig::{ - max_retries: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - inner: mbt_ffi_load32(iter_base + 12), - }) - 6 => - @retry.PolicyNode::TimeBox(@retry.TimeBoxConfig::{ - limit: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 16), - }) - 7 => - @retry.PolicyNode::ClampDelay(@retry.ClampConfig::{ - min_delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - max_delay: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 24), - }) - 8 => - @retry.PolicyNode::AddDelay(@retry.AddDelayConfig::{ - delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 16), - }) - 9 => - @retry.PolicyNode::Jitter(@retry.JitterConfig::{ - factor: mbt_ffi_loadf64(iter_base + 8), - inner: mbt_ffi_load32(iter_base + 16), - }) - 10 => { - let array2592 : Array[@retry.PredicateNode] = [] - for index2593 = 0 - index2593 < mbt_ffi_load32(iter_base + 12) - index2593 = index2593 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2593 * 32 - - let lifted2591 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2561 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2563 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2562 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2562) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + array2344.push(result2343) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - @retry.PredicateNode::PropEq(@retry.PropertyComparison::{ - property_name: result2561, - value: lifted2563, - }) - } - 1 => { - let result2564 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2566 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2565 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2565) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + Option::Some(array2344) + } + _ => panic() + } - @retry.PredicateNode::PropNeq(@retry.PropertyComparison::{ - property_name: result2564, - value: lifted2566, - }) - } - 2 => { - let result2567 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2569 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2568 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2568) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted2342, allowed_extensions : lifted2346}) + } + 27 => { - @retry.PredicateNode::PropGt(@retry.PropertyComparison::{ - property_name: result2567, - value: lifted2569, - }) - } - 3 => { - let result2570 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2572 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2571 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2571) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let lifted2350 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @retry.PredicateNode::PropGte(@retry.PropertyComparison::{ - property_name: result2570, - value: lifted2572, - }) - } - 4 => { - let result2573 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2575 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2574 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2574) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let array2348 : Array[String] = []; + for index2349 = 0; index2349 < (mbt_ffi_load32((iter_base) + 16)); index2349 = index2349 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2349 * 8) - @retry.PredicateNode::PropLt(@retry.PropertyComparison::{ - property_name: result2573, - value: lifted2575, - }) - } - 5 => { - let result2576 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2578 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2577 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2577) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let result2347 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @retry.PredicateNode::PropLte(@retry.PropertyComparison::{ - property_name: result2576, - value: lifted2578, - }) - } - 6 => { - let result2579 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @retry.PredicateNode::PropExists(result2579) - } - 7 => { - let result2580 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2583 : Array[@retry.PredicateValue] = [] - for index2584 = 0 - index2584 < mbt_ffi_load32(iter_base + 20) - index2584 = index2584 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2584 * 16 - - let lifted2582 = match - mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2581 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @retry.PredicateValue::Text(result2581) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 8), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - _ => panic() - } - - array2583.push(lifted2582) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - @retry.PredicateNode::PropIn(@retry.PropertySetCheck::{ - property_name: result2580, - values: array2583, - }) - } - 8 => { - let result2585 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result2586 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropMatches(@retry.PropertyPattern::{ - property_name: result2585, - pattern: result2586, - }) - } - 9 => { - let result2587 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result2588 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropStartsWith(@retry.PropertyPattern::{ - property_name: result2587, - pattern: result2588, - }) - } - 10 => { - let result2589 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result2590 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropContains(@retry.PropertyPattern::{ - property_name: result2589, - pattern: result2590, - }) - } - 11 => - @retry.PredicateNode::PredAnd( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 12 => - @retry.PredicateNode::PredOr( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 13 => - @retry.PredicateNode::PredNot( - mbt_ffi_load32(iter_base + 8), - ) - 14 => @retry.PredicateNode::PredTrue - 15 => @retry.PredicateNode::PredFalse - _ => panic() - } - - array2592.push(lifted2591) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @retry.PolicyNode::FilteredOn(@retry.FilteredConfig::{ - predicate: @retry.RetryPredicate::{ nodes: array2592 }, - inner: mbt_ffi_load32(iter_base + 16), - }) - } - 11 => - @retry.PolicyNode::AndThen( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 12 => - @retry.PolicyNode::PolicyUnion( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 13 => - @retry.PolicyNode::PolicyIntersect( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - _ => panic() - } - - array2595.push(lifted2594) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - PublicOplogEntry::SetRetryPolicy(SetRetryPolicyParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - policy: @retry.NamedRetryPolicy::{ - name: result2527, - priority: mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - predicate: @retry.RetryPredicate::{ nodes: array2559 }, - policy: @retry.RetryPolicy::{ nodes: array2595 }, - }, - }) - } - 40 => { - let result2597 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PublicOplogEntry::RemoveRetryPolicy(RemoveRetryPolicyParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - name: result2597, - }) - } - 41 => { - let lifted2598 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - QueuedCardEvent::Install(QueuedCardEventInstall::{ - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - }) - 1 => - QueuedCardEvent::Revoke(QueuedCardEventRevoke::{ - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - }) - _ => panic() - } + array2348.push(result2347) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - PublicOplogEntry::CardEventQueued(CardEventQueuedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - event: lifted2598, - }) - } - 42 => { - let lifted2599 : UInt64? = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(array2348) + } + _ => panic() + } - PublicOplogEntry::CardInstalled(CardInstalledParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - queued_event_index: lifted2599, - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 48).reinterpret_as_uint64(), - }, - }, - }) - } - 43 => - PublicOplogEntry::CardInstallFailed(CardInstallFailedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - queued_event_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - reason: CardInstallFailure::from(mbt_ffi_load8_u(iter_base + 48)), - }) - 44 => - PublicOplogEntry::CardRevoked(CardRevokedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - queued_event_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - }) - 45 => - PublicOplogEntry::CardExpired(CardExpiredParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }, - }, - }) - 46 => { - let array2796 : Array[@types.SchemaTypeNode] = [] - for index2797 = 0 - index2797 < mbt_ffi_load32(iter_base + 40) - index2797 = index2797 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index2797 * 144 - - let lifted2782 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted2606 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2601 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2600 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2600) - } - _ => panic() - } - - let lifted2603 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2602 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2602) - } - _ => panic() - } - - let lifted2605 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2604 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2604) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2601, - max: lifted2603, - unit: lifted2605, - }) - } - _ => panic() - } + let lifted2354 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::S8Type(lifted2606) - } - 3 => { - let lifted2613 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2608 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2607 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2607) - } - _ => panic() - } - - let lifted2610 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2609 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2609) - } - _ => panic() - } - - let lifted2612 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2611 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2611) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2608, - max: lifted2610, - unit: lifted2612, - }) - } - _ => panic() - } + let array2352 : Array[String] = []; + for index2353 = 0; index2353 < (mbt_ffi_load32((iter_base) + 28)); index2353 = index2353 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2353 * 8) - @types.SchemaTypeBody::S16Type(lifted2613) - } - 4 => { - let lifted2620 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2615 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2614 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2614) - } - _ => panic() - } - - let lifted2617 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2616 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2616) - } - _ => panic() - } - - let lifted2619 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2618 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2618) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2615, - max: lifted2617, - unit: lifted2619, - }) - } - _ => panic() - } + let result2351 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::S32Type(lifted2620) - } - 5 => { - let lifted2627 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2622 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2621 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2621) - } - _ => panic() - } - - let lifted2624 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2623 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2623) - } - _ => panic() - } - - let lifted2626 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2625 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2625) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2622, - max: lifted2624, - unit: lifted2626, - }) - } - _ => panic() - } + array2352.push(result2351) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - @types.SchemaTypeBody::S64Type(lifted2627) - } - 6 => { - let lifted2634 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2629 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2628 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2628) - } - _ => panic() - } - - let lifted2631 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2630 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2630) - } - _ => panic() - } - - let lifted2633 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2632 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2632) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2629, - max: lifted2631, - unit: lifted2633, - }) - } - _ => panic() - } + Option::Some(array2352) + } + _ => panic() + } - @types.SchemaTypeBody::U8Type(lifted2634) - } - 7 => { - let lifted2641 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2636 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2635 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2635) - } - _ => panic() - } - - let lifted2638 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2637 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2637) - } - _ => panic() - } - - let lifted2640 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2639 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2639) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2636, - max: lifted2638, - unit: lifted2640, - }) - } - _ => panic() - } + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted2350, allowed_hosts : lifted2354}) + } + 28 => { - @types.SchemaTypeBody::U16Type(lifted2641) - } - 8 => { - let lifted2648 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2643 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2642 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2642) - } - _ => panic() - } - - let lifted2645 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2644 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2644) - } - _ => panic() - } - - let lifted2647 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2646 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2646) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2643, - max: lifted2645, - unit: lifted2647, - }) - } - _ => panic() - } + @types.SchemaTypeBody::DatetimeType + } + 29 => { - @types.SchemaTypeBody::U32Type(lifted2648) - } - 9 => { - let lifted2655 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2650 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2649 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2649) - } - _ => panic() - } - - let lifted2652 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2651 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2651) - } - _ => panic() - } - - let lifted2654 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2653 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2653) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2650, - max: lifted2652, - unit: lifted2654, - }) - } - _ => panic() - } + @types.SchemaTypeBody::DurationType + } + 30 => { - @types.SchemaTypeBody::U64Type(lifted2655) - } - 10 => { - let lifted2662 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2657 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2656 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2656) - } - _ => panic() - } - - let lifted2659 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2658 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2658) - } - _ => panic() - } - - let lifted2661 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2660 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2660) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2657, - max: lifted2659, - unit: lifted2661, - }) - } - _ => panic() - } + let result2355 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::F32Type(lifted2662) - } - 11 => { - let lifted2669 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2664 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2663 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2663) - } - _ => panic() - } - - let lifted2666 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2665 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2665) - } - _ => panic() - } - - let lifted2668 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2667 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2667) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2664, - max: lifted2666, - unit: lifted2668, - }) - } - _ => panic() - } + let array2357 : Array[String] = []; + for index2358 = 0; index2358 < (mbt_ffi_load32((iter_base) + 20)); index2358 = index2358 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2358 * 8) - @types.SchemaTypeBody::F64Type(lifted2669) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array2684 : Array[@types.NamedFieldType] = [] - for index2685 = 0 - index2685 < mbt_ffi_load32(iter_base + 12) - index2685 = index2685 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2685 * 68 - - let result2670 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2672 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2671 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2671) - } - _ => panic() - } - - let array2674 : Array[String] = [] - for index2675 = 0 - index2675 < mbt_ffi_load32(iter_base + 28) - index2675 = index2675 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2675 * 8 - - let result2673 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2674.push(result2673) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array2677 : Array[String] = [] - for index2678 = 0 - index2678 < mbt_ffi_load32(iter_base + 36) - index2678 = index2678 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index2678 * 8 - - let result2676 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2677.push(result2676) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted2680 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result2679 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result2679) - } - _ => panic() - } - - let lifted2683 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted2682 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2681 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result2681) - } - _ => panic() - } + let result2356 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted2682) - } - _ => panic() - } - - array2684.push(@types.NamedFieldType::{ - name: result2670, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted2672, - aliases: array2674, - examples: array2677, - deprecated: lifted2680, - role: lifted2683, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array2684) - } - 15 => { - let array2701 : Array[@types.VariantCaseType] = [] - for index2702 = 0 - index2702 < mbt_ffi_load32(iter_base + 12) - index2702 = index2702 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2702 * 72 - - let result2686 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2687 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted2689 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2688 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2688) - } - _ => panic() - } - - let array2691 : Array[String] = [] - for index2692 = 0 - index2692 < mbt_ffi_load32(iter_base + 32) - index2692 = index2692 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2692 * 8 - - let result2690 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2691.push(result2690) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array2694 : Array[String] = [] - for index2695 = 0 - index2695 < mbt_ffi_load32(iter_base + 40) - index2695 = index2695 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index2695 * 8 - - let result2693 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2694.push(result2693) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted2697 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result2696 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result2696) - } - _ => panic() - } - - let lifted2700 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted2699 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2698 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result2698) - } - _ => panic() - } + array2357.push(result2356) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - Option::Some(lifted2699) - } - _ => panic() - } - - array2701.push(@types.VariantCaseType::{ - name: result2686, - payload: lifted2687, - metadata: @types.MetadataEnvelope::{ - doc: lifted2689, - aliases: array2691, - examples: array2694, - deprecated: lifted2697, - role: lifted2700, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array2701) - } - 16 => { - let array2704 : Array[String] = [] - for index2705 = 0 - index2705 < mbt_ffi_load32(iter_base + 12) - index2705 = index2705 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2705 * 8 - - let result2703 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2704.push(result2703) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array2704) - } - 17 => { - let array2707 : Array[String] = [] - for index2708 = 0 - index2708 < mbt_ffi_load32(iter_base + 12) - index2708 = index2708 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2708 * 8 - - let result2706 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2707.push(result2706) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array2707) - } - 18 => { - let array2709 : Array[Int] = [] - for index2710 = 0 - index2710 < mbt_ffi_load32(iter_base + 12) - index2710 = index2710 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2710 * 4 - - array2709.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array2709) - } - 19 => - @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted2711 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted2360 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let lifted2712 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + let result2359 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted2711, - err: lifted2712, - }) - } - 24 => { - let lifted2716 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2714 : Array[String] = [] - for index2715 = 0 - index2715 < mbt_ffi_load32(iter_base + 16) - index2715 = index2715 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2715 * 8 - - let result2713 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2714.push(result2713) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2714) - } - _ => panic() - } + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result2359}) + } + _ => panic() + } - let lifted2717 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + let lifted2362 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - let lifted2718 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + let result2361 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - let lifted2720 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2719 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2719) - } - _ => panic() - } + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result2361}) + } + _ => panic() + } - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted2716, - min_length: lifted2717, - max_length: lifted2718, - regex: lifted2720, - }) - } - 25 => { - let lifted2724 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2722 : Array[String] = [] - for index2723 = 0 - index2723 < mbt_ffi_load32(iter_base + 16) - index2723 = index2723 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2723 * 8 - - let result2721 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2722.push(result2721) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2722) - } - _ => panic() - } + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result2355, allowed_suffixes : array2357, min : lifted2360, max : lifted2362}) + } + 31 => { - let lifted2725 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + let array2386 : Array[@types.UnionBranch] = []; + for index2387 = 0; index2387 < (mbt_ffi_load32((iter_base) + 12)); index2387 = index2387 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2387 * 92) - let lifted2726 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + let result2363 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted2724, - min_bytes: lifted2725, - max_bytes: lifted2726, - }) - } - 26 => { - let lifted2730 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array2728 : Array[String] = [] - for index2729 = 0 - index2729 < mbt_ffi_load32(iter_base + 20) - index2729 = index2729 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2729 * 8 - - let result2727 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2728.push(result2727) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array2728) - } - _ => panic() - } + let lifted2372 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { - let lifted2734 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array2732 : Array[String] = [] - for index2733 = 0 - index2733 < mbt_ffi_load32(iter_base + 32) - index2733 = index2733 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2733 * 8 - - let result2731 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2732.push(result2731) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array2732) - } - _ => panic() - } + let result2364 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted2730, - allowed_extensions: lifted2734, - }) - } - 27 => { - let lifted2738 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2736 : Array[String] = [] - for index2737 = 0 - index2737 < mbt_ffi_load32(iter_base + 16) - index2737 = index2737 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2737 * 8 - - let result2735 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2736.push(result2735) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2736) - } - _ => panic() - } + @types.DiscriminatorRule::Prefix(result2364) + } + 1 => { - let lifted2742 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array2740 : Array[String] = [] - for index2741 = 0 - index2741 < mbt_ffi_load32(iter_base + 28) - index2741 = index2741 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2741 * 8 - - let result2739 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2740.push(result2739) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array2740) - } - _ => panic() - } + let result2365 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted2738, - allowed_hosts: lifted2742, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result2743 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2745 : Array[String] = [] - for index2746 = 0 - index2746 < mbt_ffi_load32(iter_base + 20) - index2746 = index2746 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2746 * 8 - - let result2744 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2745.push(result2744) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted2748 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2747 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result2747, - }) - } - _ => panic() - } + @types.DiscriminatorRule::Suffix(result2365) + } + 2 => { - let lifted2750 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result2749 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result2749, - }) - } - _ => panic() - } + let result2366 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result2743, - allowed_suffixes: array2745, - min: lifted2748, - max: lifted2750, - }) - } - 31 => { - let array2774 : Array[@types.UnionBranch] = [] - for index2775 = 0 - index2775 < mbt_ffi_load32(iter_base + 12) - index2775 = index2775 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2775 * 92 - - let result2751 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2760 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result2752 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result2752) - } - 1 => { - let result2753 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result2753) - } - 2 => { - let result2754 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result2754) - } - 3 => { - let result2755 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result2755) - } - 4 => { - let result2756 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted2758 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2757 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result2757) - } - _ => panic() - } + @types.DiscriminatorRule::Contains(result2366) + } + 3 => { - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result2756, - literal: lifted2758, - }) - } - 5 => { - let result2759 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result2759) - } - _ => panic() - } - - let lifted2762 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2761 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2761) - } - _ => panic() - } - - let array2764 : Array[String] = [] - for index2765 = 0 - index2765 < mbt_ffi_load32(iter_base + 52) - index2765 = index2765 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2765 * 8 - - let result2763 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2764.push(result2763) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array2767 : Array[String] = [] - for index2768 = 0 - index2768 < mbt_ffi_load32(iter_base + 60) - index2768 = index2768 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2768 * 8 - - let result2766 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2767.push(result2766) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted2770 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2769 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2769) - } - _ => panic() - } - - let lifted2773 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted2772 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2771 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result2771) - } - _ => panic() - } + let result2367 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted2772) - } - _ => panic() - } - - array2774.push(@types.UnionBranch::{ - tag: result2751, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted2760, - metadata: @types.MetadataEnvelope::{ - doc: lifted2762, - aliases: array2764, - examples: array2767, - deprecated: lifted2770, - role: lifted2773, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array2774, - }) - } - 32 => { - let lifted2777 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2776 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2776) - } - _ => panic() - } + @types.DiscriminatorRule::Regex(result2367) + } + 4 => { - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted2777, - }) - } - 33 => { - let lifted2779 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2778 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2778) - } - _ => panic() - } + let result2368 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted2779, - }) - } - 34 => { - let lifted2780 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted2370 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::FutureType(lifted2780) - } - 35 => { - let lifted2781 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result2369 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - @types.SchemaTypeBody::StreamType(lifted2781) - } - _ => panic() - } - - let lifted2784 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result2783 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result2783) - } - _ => panic() - } - - let array2786 : Array[String] = [] - for index2787 = 0 - index2787 < mbt_ffi_load32(iter_base + 104) - index2787 = index2787 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index2787 * 8 - - let result2785 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2786.push(result2785) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array2789 : Array[String] = [] - for index2790 = 0 - index2790 < mbt_ffi_load32(iter_base + 112) - index2790 = index2790 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index2790 * 8 - - let result2788 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2789.push(result2788) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted2792 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result2791 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result2791) - } - _ => panic() - } - - let lifted2795 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted2794 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2793 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result2793) - } - _ => panic() - } + Option::Some(result2369) + } + _ => panic() + } - Option::Some(lifted2794) - } - _ => panic() - } - - array2796.push(@types.SchemaTypeNode::{ - body: lifted2782, - metadata: @types.MetadataEnvelope::{ - doc: lifted2784, - aliases: array2786, - examples: array2789, - deprecated: lifted2792, - role: lifted2795, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array2801 : Array[@types.SchemaTypeDef] = [] - for index2802 = 0 - index2802 < mbt_ffi_load32(iter_base + 48) - index2802 = index2802 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + index2802 * 24 - - let result2798 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2800 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2799 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2799) - } - _ => panic() - } - - array2801.push(@types.SchemaTypeDef::{ - id: result2798, - name: lifted2800, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - let array2832 : Array[@types.SchemaValueNode] = [] - for index2833 = 0 - index2833 < mbt_ffi_load32(iter_base + 60) - index2833 = index2833 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index2833 * 32 - - let lifted2831 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result2803 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result2803) - } - 13 => { - let array2804 : Array[Int] = [] - for index2805 = 0 - index2805 < mbt_ffi_load32(iter_base + 12) - index2805 = index2805 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2805 * 4 - - array2804.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array2804) - } - 14 => { - let lifted2806 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result2368, literal : lifted2370}) + } + 5 => { - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted2806, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array2807 : Array[Bool] = [] - for index2808 = 0 - index2808 < mbt_ffi_load32(iter_base + 12) - index2808 = index2808 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2808 * 1 - - array2807.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array2807) - } - 17 => { - let array2809 : Array[Int] = [] - for index2810 = 0 - index2810 < mbt_ffi_load32(iter_base + 12) - index2810 = index2810 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2810 * 4 - - array2809.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array2809) - } - 18 => { - let array2811 : Array[Int] = [] - for index2812 = 0 - index2812 < mbt_ffi_load32(iter_base + 12) - index2812 = index2812 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2812 * 4 - - array2811.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array2811) - } - 19 => { - let array2813 : Array[Int] = [] - for index2814 = 0 - index2814 < mbt_ffi_load32(iter_base + 12) - index2814 = index2814 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2814 * 4 - - array2813.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array2813) - } - 20 => { - let array2815 : Array[@types.MapEntry] = [] - for index2816 = 0 - index2816 < mbt_ffi_load32(iter_base + 12) - index2816 = index2816 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2816 * 8 - - array2815.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array2815) - } - 21 => { - let lifted2817 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result2371 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @types.SchemaValueNode::OptionValue(lifted2817) - } - 22 => { - let lifted2820 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted2818 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted2818) - } - 1 => { - let lifted2819 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted2819) - } - _ => panic() - } + @types.DiscriminatorRule::FieldAbsent(result2371) + } + _ => panic() + } - @types.SchemaValueNode::ResultValue(lifted2820) - } - 23 => { - let result2821 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2823 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2822 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2822) - } - _ => panic() - } + let lifted2374 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result2821, - language: lifted2823, - }) - } - 24 => { - let result2824 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2826 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2825 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2825) - } - _ => panic() - } + let result2373 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result2824, - mime_type: lifted2826, - }) - } - 25 => { - let result2827 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result2827) - } - 26 => { - let result2828 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result2828) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result2829 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result2829, - }) - } - 30 => { - let result2830 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result2830, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } - - array2832.push(lifted2831) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - PublicOplogEntry::HostStreamFrame(HostStreamFrameParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - parent_start_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - kind: HostStreamKind::from(mbt_ffi_load8_u(iter_base + 32)), - payload: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array2796, - defs: array2801, - root: mbt_ffi_load32(iter_base + 52), - }, - value: @types.SchemaValueTree::{ - value_nodes: array2832, - root: mbt_ffi_load32(iter_base + 64), - }, - }, - }) - } - 47 => - PublicOplogEntry::CompletionDiscarded(CompletionDiscardedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }, - start_index: mbt_ffi_load64(iter_base + 24).reinterpret_as_uint64(), - }) - _ => panic() - } - - array2835.push(lifted2834) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Option::Some(array2835) - } - _ => panic() - } - let ret = lifted2837 - mbt_ffi_free(return_area) - return ret -} + Option::Some(result2373) + } + _ => panic() + } -///| -pub fn SearchOplog::search_oplog( - agent_id : @types.AgentId, - text : String, -) -> SearchOplog { - let ptr = mbt_ffi_str2ptr(agent_id.agent_id) - - let ptr0 = mbt_ffi_str2ptr(text) - let result : Int = wasmImportConstructorSearchOplog( - agent_id.component_id.uuid.high_bits.reinterpret_as_int64(), - agent_id.component_id.uuid.low_bits.reinterpret_as_int64(), - ptr, - agent_id.agent_id.length(), - ptr0, - text.length(), - ) - let ret = SearchOplog::SearchOplog(result) - mbt_ffi_free(ptr) - mbt_ffi_free(ptr0) - return ret -} + let array2376 : Array[String] = []; + for index2377 = 0; index2377 < (mbt_ffi_load32((iter_base) + 52)); index2377 = index2377 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2377 * 8) -///| -pub fn SearchOplog::get_next( - self : SearchOplog, -) -> Array[(UInt64, PublicOplogEntry)]? { - let SearchOplog(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodSearchOplogGetNext(handle, return_area) - - let lifted2837 : Array[(UInt64, PublicOplogEntry)]? = match - mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let array2835 : Array[(UInt64, PublicOplogEntry)] = [] - for index2836 = 0 - index2836 < mbt_ffi_load32(return_area + 8) - index2836 = index2836 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index2836 * 216 - - let lifted2834 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - let array : Array[(String, String)] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 76) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 72) + index * 16 - - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array.push((result0, result1)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 72)) - - let lifted : @types.AgentId? = match - mbt_ffi_load8_u(iter_base + 112) { - 0 => Option::None - 1 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - Option::Some(@types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 120).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 128).reinterpret_as_uint64(), - }, - }, - agent_id: result2, - }) - } - _ => panic() - } + let result2375 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array9 : Array[PluginInstallationDescription] = [] - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 164) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 160) + index10 * 48 - - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - let array7 : Array[(String, String)] = [] - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 40) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index8 * 16 - - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array7.push((result5, result6)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - array9.push(PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 16), - plugin_name: result3, - plugin_version: result4, - parameters: array7, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 160)) - - let array248 : Array[LocalAgentConfigEntry] = [] - for index249 = 0 - index249 < mbt_ffi_load32(iter_base + 172) - index249 = index249 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 168) + index249 * 40 - - let array12 : Array[String] = [] - for index13 = 0 - index13 < mbt_ffi_load32(iter_base + 4) - index13 = index13 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + index13 * 8 - - let result11 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array12.push(result11) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - let array210 : Array[@types.SchemaTypeNode] = [] - for index211 = 0 - index211 < mbt_ffi_load32(iter_base + 12) - index211 = index211 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index211 * 144 - - let lifted196 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted20 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted15 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted14 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2376.push(result2375) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - Option::Some(lifted14) - } - _ => panic() - } + let array2379 : Array[String] = []; + for index2380 = 0; index2380 < (mbt_ffi_load32((iter_base) + 60)); index2380 = index2380 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2380 * 8) - let lifted17 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted16 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2378 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted16) - } - _ => panic() - } + array2379.push(result2378) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - let lifted19 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result18) - } - _ => panic() - } + let lifted2382 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted15, - max: lifted17, - unit: lifted19, - }) - } - _ => panic() - } + let result2381 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - @types.SchemaTypeBody::S8Type(lifted20) - } - 3 => { - let lifted27 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted22 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted21 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2381) + } + _ => panic() + } - Option::Some(lifted21) - } - _ => panic() - } + let lifted2385 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - let lifted24 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted23 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2384 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { - Option::Some(lifted23) - } - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - let lifted26 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result25 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result25) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted22, - max: lifted24, - unit: lifted26, - }) - } - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - @types.SchemaTypeBody::S16Type(lifted27) - } - 4 => { - let lifted34 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted29 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted28 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2383 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - Option::Some(lifted28) - } - _ => panic() - } + @types.Role::Other(result2383) + } + _ => panic() + } - let lifted31 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted30 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted2384) + } + _ => panic() + } - Option::Some(lifted30) - } - _ => panic() - } + array2386.push(@types.UnionBranch::{tag : result2363, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted2372, metadata : @types.MetadataEnvelope::{doc : lifted2374, aliases : array2376, examples : array2379, deprecated : lifted2382, role : lifted2385}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array2386}) + } + 32 => { + + let lifted2389 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let lifted33 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result32 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result32) - } - _ => panic() - } + let result2388 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(@types.NumericRestrictions::{ - min: lifted29, - max: lifted31, - unit: lifted33, - }) - } - _ => panic() - } + Option::Some(result2388) + } + _ => panic() + } - @types.SchemaTypeBody::S32Type(lifted34) - } - 5 => { - let lifted41 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted36 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted35 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted2389}) + } + 33 => { - Option::Some(lifted35) - } - _ => panic() - } + let lifted2391 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted38 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted37 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2390 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - Option::Some(lifted37) - } - _ => panic() - } + Option::Some(result2390) + } + _ => panic() + } - let lifted40 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result39 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result39) - } - _ => panic() - } + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted2391}) + } + 34 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted36, - max: lifted38, - unit: lifted40, - }) - } - _ => panic() - } + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - @types.SchemaTypeBody::S64Type(lifted41) - } - 6 => { - let lifted48 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted43 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted42 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2392 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted42) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - let lifted45 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted44 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::FutureType(lifted2392) + } + 36 => { - Option::Some(lifted44) - } - _ => panic() - } + let lifted2393 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted47 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result46 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result46) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted43, - max: lifted45, - unit: lifted47, - }) - } - _ => panic() - } + @types.SchemaTypeBody::StreamType(lifted2393) + } + _ => panic() + } - @types.SchemaTypeBody::U8Type(lifted48) - } - 7 => { - let lifted55 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted50 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted49 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2396 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { - Option::Some(lifted49) - } - _ => panic() - } + let result2395 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - let lifted52 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted51 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2395) + } + _ => panic() + } - Option::Some(lifted51) - } - _ => panic() - } + let array2398 : Array[String] = []; + for index2399 = 0; index2399 < (mbt_ffi_load32((iter_base) + 104)); index2399 = index2399 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index2399 * 8) - let lifted54 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result53 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result53) - } - _ => panic() - } + let result2397 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(@types.NumericRestrictions::{ - min: lifted50, - max: lifted52, - unit: lifted54, - }) - } - _ => panic() - } + array2398.push(result2397) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - @types.SchemaTypeBody::U16Type(lifted55) - } - 8 => { - let lifted62 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted57 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted56 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2401 : Array[String] = []; + for index2402 = 0; index2402 < (mbt_ffi_load32((iter_base) + 112)); index2402 = index2402 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index2402 * 8) - Option::Some(lifted56) - } - _ => panic() - } + let result2400 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted59 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted58 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2401.push(result2400) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - Option::Some(lifted58) - } - _ => panic() - } + let lifted2404 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - let lifted61 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result60 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result60) - } - _ => panic() - } + let result2403 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - Option::Some(@types.NumericRestrictions::{ - min: lifted57, - max: lifted59, - unit: lifted61, - }) - } - _ => panic() - } + Option::Some(result2403) + } + _ => panic() + } - @types.SchemaTypeBody::U32Type(lifted62) - } - 9 => { - let lifted69 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted64 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted63 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2407 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - Option::Some(lifted63) - } - _ => panic() - } + let lifted2406 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - let lifted66 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted65 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - Option::Some(lifted65) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - let lifted68 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result67 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result67) - } - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted64, - max: lifted66, - unit: lifted68, - }) - } - _ => panic() - } + let result2405 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - @types.SchemaTypeBody::U64Type(lifted69) - } - 10 => { - let lifted76 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted71 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted70 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Other(result2405) + } + _ => panic() + } - Option::Some(lifted70) - } - _ => panic() - } + Option::Some(lifted2406) + } + _ => panic() + } - let lifted73 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted72 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2408.push(@types.SchemaTypeNode::{body : lifted2394, metadata : @types.MetadataEnvelope::{doc : lifted2396, aliases : array2398, examples : array2401, deprecated : lifted2404, role : lifted2407}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - Option::Some(lifted72) - } - _ => panic() - } + let array2413 : Array[@types.SchemaTypeDef] = []; + for index2414 = 0; index2414 < (mbt_ffi_load32((iter_base) + 68)); index2414 = index2414 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index2414 * 24) - let lifted75 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result74 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result74) - } - _ => panic() - } + let result2410 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(@types.NumericRestrictions::{ - min: lifted71, - max: lifted73, - unit: lifted75, - }) - } - _ => panic() - } + let lifted2412 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::F32Type(lifted76) - } - 11 => { - let lifted83 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted78 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted77 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2411 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - Option::Some(lifted77) - } - _ => panic() - } + Option::Some(result2411) + } + _ => panic() + } - let lifted80 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted79 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2413.push(@types.SchemaTypeDef::{id : result2410, name : lifted2412, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - Option::Some(lifted79) - } - _ => panic() - } + let array2444 : Array[@types.SchemaValueNode] = []; + for index2445 = 0; index2445 < (mbt_ffi_load32((iter_base) + 80)); index2445 = index2445 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 76)) + (index2445 * 32) - let lifted82 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result81 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result81) - } - _ => panic() - } + let lifted2443 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted78, - max: lifted80, - unit: lifted82, - }) - } - _ => panic() - } + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - @types.SchemaTypeBody::F64Type(lifted83) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array98 : Array[@types.NamedFieldType] = [] - for index99 = 0 - index99 < mbt_ffi_load32(iter_base + 12) - index99 = index99 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index99 * 68 - - let result84 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted86 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result85 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result85) - } - _ => panic() - } - - let array88 : Array[String] = [] - for index89 = 0 - index89 < mbt_ffi_load32(iter_base + 28) - index89 = index89 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index89 * 8 - - let result87 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array88.push(result87) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array91 : Array[String] = [] - for index92 = 0 - index92 < mbt_ffi_load32(iter_base + 36) - index92 = index92 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index92 * 8 - - let result90 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array91.push(result90) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted94 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result93 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result93) - } - _ => panic() - } - - let lifted97 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted96 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result95 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result95) - } - _ => panic() - } - - Option::Some(lifted96) - } - _ => panic() - } - - array98.push(@types.NamedFieldType::{ - name: result84, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted86, - aliases: array88, - examples: array91, - deprecated: lifted94, - role: lifted97, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array98) - } - 15 => { - let array115 : Array[@types.VariantCaseType] = [] - for index116 = 0 - index116 < mbt_ffi_load32(iter_base + 12) - index116 = index116 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index116 * 72 - - let result100 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted101 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted103 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result102 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result102) - } - _ => panic() - } - - let array105 : Array[String] = [] - for index106 = 0 - index106 < mbt_ffi_load32(iter_base + 32) - index106 = index106 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index106 * 8 - - let result104 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array105.push(result104) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array108 : Array[String] = [] - for index109 = 0 - index109 < mbt_ffi_load32(iter_base + 40) - index109 = index109 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index109 * 8 - - let result107 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array108.push(result107) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted111 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result110 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result110) - } - _ => panic() - } - - let lifted114 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted113 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result112 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result112) - } - _ => panic() - } - - Option::Some(lifted113) - } - _ => panic() - } - - array115.push(@types.VariantCaseType::{ - name: result100, - payload: lifted101, - metadata: @types.MetadataEnvelope::{ - doc: lifted103, - aliases: array105, - examples: array108, - deprecated: lifted111, - role: lifted114, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array115) - } - 16 => { - let array118 : Array[String] = [] - for index119 = 0 - index119 < mbt_ffi_load32(iter_base + 12) - index119 = index119 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index119 * 8 - - let result117 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array118.push(result117) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array118) - } - 17 => { - let array121 : Array[String] = [] - for index122 = 0 - index122 < mbt_ffi_load32(iter_base + 12) - index122 = index122 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index122 * 8 - - let result120 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array121.push(result120) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array121) - } - 18 => { - let array123 : Array[Int] = [] - for index124 = 0 - index124 < mbt_ffi_load32(iter_base + 12) - index124 = index124 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index124 * 4 - - array123.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array123) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted125 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted126 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted125, - err: lifted126, - }) - } - 24 => { - let lifted130 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array128 : Array[String] = [] - for index129 = 0 - index129 < mbt_ffi_load32(iter_base + 16) - index129 = index129 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index129 * 8 - - let result127 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array128.push(result127) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array128) - } - _ => panic() - } - - let lifted131 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted132 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted134 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result133 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result133) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted130, - min_length: lifted131, - max_length: lifted132, - regex: lifted134, - }) - } - 25 => { - let lifted138 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array136 : Array[String] = [] - for index137 = 0 - index137 < mbt_ffi_load32(iter_base + 16) - index137 = index137 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index137 * 8 - - let result135 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array136.push(result135) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array136) - } - _ => panic() - } - - let lifted139 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted140 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted138, - min_bytes: lifted139, - max_bytes: lifted140, - }) - } - 26 => { - let lifted144 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array142 : Array[String] = [] - for index143 = 0 - index143 < mbt_ffi_load32(iter_base + 20) - index143 = index143 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index143 * 8 - - let result141 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array142.push(result141) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array142) - } - _ => panic() - } - - let lifted148 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array146 : Array[String] = [] - for index147 = 0 - index147 < mbt_ffi_load32(iter_base + 32) - index147 = index147 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index147 * 8 - - let result145 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array146.push(result145) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array146) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted144, - allowed_extensions: lifted148, - }) - } - 27 => { - let lifted152 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array150 : Array[String] = [] - for index151 = 0 - index151 < mbt_ffi_load32(iter_base + 16) - index151 = index151 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index151 * 8 - - let result149 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array150.push(result149) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array150) - } - _ => panic() - } - - let lifted156 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array154 : Array[String] = [] - for index155 = 0 - index155 < mbt_ffi_load32(iter_base + 28) - index155 = index155 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index155 * 8 - - let result153 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array154.push(result153) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - Option::Some(array154) - } - _ => panic() - } + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted152, - allowed_hosts: lifted156, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result157 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array159 : Array[String] = [] - for index160 = 0 - index160 < mbt_ffi_load32(iter_base + 20) - index160 = index160 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index160 * 8 - - let result158 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array159.push(result158) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted162 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result161 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result161, - }) - } - _ => panic() - } - - let lifted164 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result163 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result163, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result157, - allowed_suffixes: array159, - min: lifted162, - max: lifted164, - }) - } - 31 => { - let array188 : Array[@types.UnionBranch] = [] - for index189 = 0 - index189 < mbt_ffi_load32(iter_base + 12) - index189 = index189 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index189 * 92 - - let result165 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted174 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result166 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result166) - } - 1 => { - let result167 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - @types.DiscriminatorRule::Suffix(result167) - } - 2 => { - let result168 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - @types.DiscriminatorRule::Contains(result168) - } - 3 => { - let result169 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - @types.DiscriminatorRule::Regex(result169) - } - 4 => { - let result170 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted172 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result171 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result171) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result170, - literal: lifted172, - }) - } - 5 => { - let result173 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - @types.DiscriminatorRule::FieldAbsent(result173) - } - _ => panic() - } - - let lifted176 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result175) - } - _ => panic() - } - - let array178 : Array[String] = [] - for index179 = 0 - index179 < mbt_ffi_load32(iter_base + 52) - index179 = index179 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index179 * 8 - - let result177 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array178.push(result177) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array181 : Array[String] = [] - for index182 = 0 - index182 < mbt_ffi_load32(iter_base + 60) - index182 = index182 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index182 * 8 - - let result180 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array181.push(result180) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted184 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result183 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result183) - } - _ => panic() - } - - let lifted187 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted186 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result185 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result185) - } - _ => panic() - } - - Option::Some(lifted186) - } - _ => panic() - } - - array188.push(@types.UnionBranch::{ - tag: result165, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted174, - metadata: @types.MetadataEnvelope::{ - doc: lifted176, - aliases: array178, - examples: array181, - deprecated: lifted184, - role: lifted187, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array188, - }) - } - 32 => { - let lifted191 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result190 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result190) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted191, - }) - } - 33 => { - let lifted193 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result192 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result192) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted193, - }) - } - 34 => { - let lifted194 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted194) - } - 35 => { - let lifted195 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted195) - } - _ => panic() - } - - let lifted198 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result197 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result197) - } - _ => panic() - } - - let array200 : Array[String] = [] - for index201 = 0 - index201 < mbt_ffi_load32(iter_base + 104) - index201 = index201 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index201 * 8 - - let result199 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array200.push(result199) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array203 : Array[String] = [] - for index204 = 0 - index204 < mbt_ffi_load32(iter_base + 112) - index204 = index204 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index204 * 8 - - let result202 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array203.push(result202) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted206 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result205 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result205) - } - _ => panic() - } - - let lifted209 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted208 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result207 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result207) - } - _ => panic() - } - - Option::Some(lifted208) - } - _ => panic() - } - - array210.push(@types.SchemaTypeNode::{ - body: lifted196, - metadata: @types.MetadataEnvelope::{ - doc: lifted198, - aliases: array200, - examples: array203, - deprecated: lifted206, - role: lifted209, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - let array215 : Array[@types.SchemaTypeDef] = [] - for index216 = 0 - index216 < mbt_ffi_load32(iter_base + 20) - index216 = index216 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index216 * 24 - - let result212 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted214 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result213 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result213) - } - _ => panic() - } - - array215.push(@types.SchemaTypeDef::{ - id: result212, - name: lifted214, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let array246 : Array[@types.SchemaValueNode] = [] - for index247 = 0 - index247 < mbt_ffi_load32(iter_base + 32) - index247 = index247 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index247 * 32 - - let lifted245 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result217 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result217) - } - 13 => { - let array218 : Array[Int] = [] - for index219 = 0 - index219 < mbt_ffi_load32(iter_base + 12) - index219 = index219 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index219 * 4 - - array218.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array218) - } - 14 => { - let lifted220 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted220, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array221 : Array[Bool] = [] - for index222 = 0 - index222 < mbt_ffi_load32(iter_base + 12) - index222 = index222 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index222 * 1 - - array221.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array221) - } - 17 => { - let array223 : Array[Int] = [] - for index224 = 0 - index224 < mbt_ffi_load32(iter_base + 12) - index224 = index224 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index224 * 4 - - array223.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array223) - } - 18 => { - let array225 : Array[Int] = [] - for index226 = 0 - index226 < mbt_ffi_load32(iter_base + 12) - index226 = index226 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index226 * 4 - - array225.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array225) - } - 19 => { - let array227 : Array[Int] = [] - for index228 = 0 - index228 < mbt_ffi_load32(iter_base + 12) - index228 = index228 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index228 * 4 - - array227.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array227) - } - 20 => { - let array229 : Array[@types.MapEntry] = [] - for index230 = 0 - index230 < mbt_ffi_load32(iter_base + 12) - index230 = index230 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index230 * 8 - - array229.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array229) - } - 21 => { - let lifted231 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted231) - } - 22 => { - let lifted234 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted232 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - @types.ResultValuePayload::OkValue(lifted232) - } - 1 => { - let lifted233 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - @types.ResultValuePayload::ErrValue(lifted233) - } - _ => panic() - } + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - @types.SchemaValueNode::ResultValue(lifted234) - } - 23 => { - let result235 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted237 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result236 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result236) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result235, - language: lifted237, - }) - } - 24 => { - let result238 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted240 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result239 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result239) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result238, - mime_type: lifted240, - }) - } - 25 => { - let result241 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - @types.SchemaValueNode::PathValue(result241) - } - 26 => { - let result242 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - @types.SchemaValueNode::UrlValue(result242) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result243 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result243, - }) - } - 30 => { - let result244 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result244, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array246.push(lifted245) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - array248.push(LocalAgentConfigEntry::{ - path: array12, - value: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array210, - defs: array215, - root: mbt_ffi_load32(iter_base + 24), - }, - value: @types.SchemaValueTree::{ - value_nodes: array246, - root: mbt_ffi_load32(iter_base + 36), - }, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 168)) - - let lifted250 : @types.Uuid? = match - mbt_ffi_load8_u(iter_base + 176) { - 0 => Option::None - 1 => - Option::Some(@types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 184).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 192).reinterpret_as_uint64(), - }) - _ => panic() - } + let result2415 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - PublicOplogEntry::Create(CreateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - agent_id: result, - }, - agent_mode: AgentMode::from(mbt_ffi_load8_u(iter_base + 56)), - component_revision: mbt_ffi_load64(iter_base + 64).reinterpret_as_uint64(), - env: array, - created_by: @types.AccountId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 80).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 88).reinterpret_as_uint64(), - }, - }, - environment_id: @host.EnvironmentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 96).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 104).reinterpret_as_uint64(), - }, - }, - parent: lifted, - component_size: mbt_ffi_load64(iter_base + 144).reinterpret_as_uint64(), - initial_total_linear_memory_size: mbt_ffi_load64(iter_base + 152).reinterpret_as_uint64(), - initial_active_plugins: array9, - local_agent_config: array248, - original_phantom_id: lifted250, - instance_id: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 200).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 208).reinterpret_as_uint64(), - }, - }) - } - 1 => { - let lifted251 : UInt64? = match mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::StringValue(result2415) + } + 13 => { - let result252 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - let lifted487 : @types.TypedSchemaValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let array449 : Array[@types.SchemaTypeNode] = [] - for index450 = 0 - index450 < mbt_ffi_load32(iter_base + 64) - index450 = index450 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 60) + - index450 * 144 - - let lifted435 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted259 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted254 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted253 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2416 : Array[Int] = []; + for index2417 = 0; index2417 < (mbt_ffi_load32((iter_base) + 12)); index2417 = index2417 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2417 * 4) - Option::Some(lifted253) - } - _ => panic() - } - - let lifted256 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted255 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2416.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted255) - } - _ => panic() - } - - let lifted258 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result257 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result257) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted254, - max: lifted256, - unit: lifted258, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted259) - } - 3 => { - let lifted266 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted261 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted260 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::RecordValue(array2416) + } + 14 => { - Option::Some(lifted260) - } - _ => panic() - } - - let lifted263 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted262 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2418 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted262) - } - _ => panic() - } - - let lifted265 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result264 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result264) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted261, - max: lifted263, - unit: lifted265, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted266) - } - 4 => { - let lifted273 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted268 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted267 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - Option::Some(lifted267) - } - _ => panic() - } - - let lifted270 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted269 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted2418}) + } + 15 => { - Option::Some(lifted269) - } - _ => panic() - } - - let lifted272 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result271 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result271) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted268, - max: lifted270, - unit: lifted272, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted273) - } - 5 => { - let lifted280 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted275 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted274 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - Option::Some(lifted274) - } - _ => panic() - } - - let lifted277 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted276 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2419 : Array[Bool] = []; + for index2420 = 0; index2420 < (mbt_ffi_load32((iter_base) + 12)); index2420 = index2420 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2420 * 1) - Option::Some(lifted276) - } - _ => panic() - } - - let lifted279 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result278 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result278) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted275, - max: lifted277, - unit: lifted279, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted280) - } - 6 => { - let lifted287 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted282 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted281 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2419.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted281) - } - _ => panic() - } - - let lifted284 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted283 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::FlagsValue(array2419) + } + 17 => { - Option::Some(lifted283) - } - _ => panic() - } - - let lifted286 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result285 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result285) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted282, - max: lifted284, - unit: lifted286, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted287) - } - 7 => { - let lifted294 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted289 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted288 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2421 : Array[Int] = []; + for index2422 = 0; index2422 < (mbt_ffi_load32((iter_base) + 12)); index2422 = index2422 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2422 * 4) - Option::Some(lifted288) - } - _ => panic() - } - - let lifted291 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted290 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2421.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted290) - } - _ => panic() - } - - let lifted293 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result292 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result292) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted289, - max: lifted291, - unit: lifted293, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted294) - } - 8 => { - let lifted301 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted296 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted295 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::TupleValue(array2421) + } + 18 => { - Option::Some(lifted295) - } - _ => panic() - } - - let lifted298 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted297 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2423 : Array[Int] = []; + for index2424 = 0; index2424 < (mbt_ffi_load32((iter_base) + 12)); index2424 = index2424 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2424 * 4) - Option::Some(lifted297) - } - _ => panic() - } - - let lifted300 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result299 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result299) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted296, - max: lifted298, - unit: lifted300, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted301) - } - 9 => { - let lifted308 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted303 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted302 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2423.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted302) - } - _ => panic() - } - - let lifted305 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted304 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::ListValue(array2423) + } + 19 => { - Option::Some(lifted304) - } - _ => panic() - } - - let lifted307 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result306 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result306) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted303, - max: lifted305, - unit: lifted307, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted308) - } - 10 => { - let lifted315 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted310 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted309 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2425 : Array[Int] = []; + for index2426 = 0; index2426 < (mbt_ffi_load32((iter_base) + 12)); index2426 = index2426 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2426 * 4) - Option::Some(lifted309) - } - _ => panic() - } - - let lifted312 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted311 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2425.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted311) - } - _ => panic() - } - - let lifted314 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result313 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result313) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted310, - max: lifted312, - unit: lifted314, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted315) - } - 11 => { - let lifted322 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted317 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted316 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::FixedListValue(array2425) + } + 20 => { - Option::Some(lifted316) - } - _ => panic() - } - - let lifted319 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted318 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2427 : Array[@types.MapEntry] = []; + for index2428 = 0; index2428 < (mbt_ffi_load32((iter_base) + 12)); index2428 = index2428 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2428 * 8) - Option::Some(lifted318) - } - _ => panic() - } - - let lifted321 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result320 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result320) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted317, - max: lifted319, - unit: lifted321, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted322) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array337 : Array[@types.NamedFieldType] = [] - for index338 = 0 - index338 < mbt_ffi_load32(iter_base + 12) - index338 = index338 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index338 * 68 - - let result323 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted325 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result324 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result324) - } - _ => panic() - } + array2427.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array327 : Array[String] = [] - for index328 = 0 - index328 < mbt_ffi_load32(iter_base + 28) - index328 = index328 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index328 * 8 + @types.SchemaValueNode::MapValue(array2427) + } + 21 => { - let result326 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2429 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array327.push(result326) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - let array330 : Array[String] = [] - for index331 = 0 - index331 < mbt_ffi_load32(iter_base + 36) - index331 = index331 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index331 * 8 + @types.SchemaValueNode::OptionValue(lifted2429) + } + 22 => { - let result329 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2432 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - array330.push(result329) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted333 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result332 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result332) - } - _ => panic() - } + let lifted2430 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let lifted336 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted335 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result334 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - @types.Role::Other(result334) - } - _ => panic() - } + @types.ResultValuePayload::OkValue(lifted2430) + } + 1 => { - Option::Some(lifted335) - } - _ => panic() - } + let lifted2431 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - array337.push(@types.NamedFieldType::{ - name: result323, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted325, - aliases: array327, - examples: array330, - deprecated: lifted333, - role: lifted336, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array337) - } - 15 => { - let array354 : Array[@types.VariantCaseType] = [] - for index355 = 0 - index355 < mbt_ffi_load32(iter_base + 12) - index355 = index355 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index355 * 72 - - let result339 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted340 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let lifted342 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result341 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result341) - } - _ => panic() - } + @types.ResultValuePayload::ErrValue(lifted2431) + } + _ => panic() + } - let array344 : Array[String] = [] - for index345 = 0 - index345 < mbt_ffi_load32(iter_base + 32) - index345 = index345 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index345 * 8 + @types.SchemaValueNode::ResultValue(lifted2432) + } + 23 => { - let result343 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2433 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array344.push(result343) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let lifted2435 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let array347 : Array[String] = [] - for index348 = 0 - index348 < mbt_ffi_load32(iter_base + 40) - index348 = index348 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index348 * 8 + let result2434 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let result346 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(result2434) + } + _ => panic() + } - array347.push(result346) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted350 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result349 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result349) - } - _ => panic() - } + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result2433, language : lifted2435}) + } + 24 => { - let lifted353 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted352 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result351 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let result2436 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.Role::Other(result351) - } - _ => panic() - } + let lifted2438 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted352) - } - _ => panic() - } + let result2437 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - array354.push(@types.VariantCaseType::{ - name: result339, - payload: lifted340, - metadata: @types.MetadataEnvelope::{ - doc: lifted342, - aliases: array344, - examples: array347, - deprecated: lifted350, - role: lifted353, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array354) - } - 16 => { - let array357 : Array[String] = [] - for index358 = 0 - index358 < mbt_ffi_load32(iter_base + 12) - index358 = index358 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index358 * 8 - - let result356 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array357.push(result356) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array357) - } - 17 => { - let array360 : Array[String] = [] - for index361 = 0 - index361 < mbt_ffi_load32(iter_base + 12) - index361 = index361 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index361 * 8 - - let result359 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array360.push(result359) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array360) - } - 18 => { - let array362 : Array[Int] = [] - for index363 = 0 - index363 < mbt_ffi_load32(iter_base + 12) - index363 = index363 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index363 * 4 - - array362.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array362) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted364 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted365 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted364, - err: lifted365, - }) - } - 24 => { - let lifted369 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array367 : Array[String] = [] - for index368 = 0 - index368 < mbt_ffi_load32(iter_base + 16) - index368 = index368 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index368 * 8 - - let result366 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array367.push(result366) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array367) - } - _ => panic() - } - - let lifted370 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted371 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted373 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result372 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result372) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted369, - min_length: lifted370, - max_length: lifted371, - regex: lifted373, - }) - } - 25 => { - let lifted377 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array375 : Array[String] = [] - for index376 = 0 - index376 < mbt_ffi_load32(iter_base + 16) - index376 = index376 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index376 * 8 - - let result374 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array375.push(result374) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array375) - } - _ => panic() - } - - let lifted378 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted379 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted377, - min_bytes: lifted378, - max_bytes: lifted379, - }) - } - 26 => { - let lifted383 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array381 : Array[String] = [] - for index382 = 0 - index382 < mbt_ffi_load32(iter_base + 20) - index382 = index382 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index382 * 8 - - let result380 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array381.push(result380) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array381) - } - _ => panic() - } - - let lifted387 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array385 : Array[String] = [] - for index386 = 0 - index386 < mbt_ffi_load32(iter_base + 32) - index386 = index386 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index386 * 8 - - let result384 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array385.push(result384) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array385) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted383, - allowed_extensions: lifted387, - }) - } - 27 => { - let lifted391 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array389 : Array[String] = [] - for index390 = 0 - index390 < mbt_ffi_load32(iter_base + 16) - index390 = index390 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index390 * 8 - - let result388 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array389.push(result388) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array389) - } - _ => panic() - } - - let lifted395 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array393 : Array[String] = [] - for index394 = 0 - index394 < mbt_ffi_load32(iter_base + 28) - index394 = index394 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index394 * 8 - - let result392 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array393.push(result392) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array393) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted391, - allowed_hosts: lifted395, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result396 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array398 : Array[String] = [] - for index399 = 0 - index399 < mbt_ffi_load32(iter_base + 20) - index399 = index399 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index399 * 8 - - let result397 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array398.push(result397) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted401 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result400 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result400, - }) - } - _ => panic() - } - - let lifted403 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result402 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result402, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result396, - allowed_suffixes: array398, - min: lifted401, - max: lifted403, - }) - } - 31 => { - let array427 : Array[@types.UnionBranch] = [] - for index428 = 0 - index428 < mbt_ffi_load32(iter_base + 12) - index428 = index428 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index428 * 92 - - let result404 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted413 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result405 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result405) - } - 1 => { - let result406 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result406) - } - 2 => { - let result407 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result407) - } - 3 => { - let result408 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result408) - } - 4 => { - let result409 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted411 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result410 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + Option::Some(result2437) + } + _ => panic() + } - Option::Some(result410) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result409, - literal: lifted411, - }) - } - 5 => { - let result412 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result412) - } - _ => panic() - } + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result2436, mime_type : lifted2438}) + } + 25 => { - let lifted415 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result414 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result414) - } - _ => panic() - } + let result2439 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let array417 : Array[String] = [] - for index418 = 0 - index418 < mbt_ffi_load32(iter_base + 52) - index418 = index418 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index418 * 8 + @types.SchemaValueNode::PathValue(result2439) + } + 26 => { - let result416 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2440 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array417.push(result416) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + @types.SchemaValueNode::UrlValue(result2440) + } + 27 => { - let array420 : Array[String] = [] - for index421 = 0 - index421 < mbt_ffi_load32(iter_base + 60) - index421 = index421 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index421 * 8 + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - let result419 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - array420.push(result419) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted423 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result422 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result422) - } - _ => panic() - } + let result2441 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted426 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted425 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result424 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result2441}) + } + 30 => { - @types.Role::Other(result424) - } - _ => panic() - } + let result2442 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted425) - } - _ => panic() - } + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result2442, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - array427.push(@types.UnionBranch::{ - tag: result404, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted413, - metadata: @types.MetadataEnvelope::{ - doc: lifted415, - aliases: array417, - examples: array420, - deprecated: lifted423, - role: lifted426, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array427, - }) - } - 32 => { - let lifted430 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result429 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result429) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted430, - }) - } - 33 => { - let lifted432 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result431 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result431) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted432, - }) - } - 34 => { - let lifted433 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted433) - } - 35 => { - let lifted434 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted434) - } - _ => panic() - } + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - let lifted437 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result436 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result436) - } - _ => panic() - } + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - let array439 : Array[String] = [] - for index440 = 0 - index440 < mbt_ffi_load32(iter_base + 104) - index440 = index440 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index440 * 8 + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } - let result438 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2444.push(lifted2443) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) - array439.push(result438) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let result2446 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 88), mbt_ffi_load32((iter_base) + 92)) - let array442 : Array[String] = [] - for index443 = 0 - index443 < mbt_ffi_load32(iter_base + 112) - index443 = index443 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index443 * 8 + let array2448 : Array[String] = []; + for index2449 = 0; index2449 < (mbt_ffi_load32((iter_base) + 100)); index2449 = index2449 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 96)) + (index2449 * 8) - let result441 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2447 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array442.push(result441) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted445 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result444 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result444) - } - _ => panic() - } + array2448.push(result2447) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 96)) - let lifted448 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted447 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result446 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result446) - } - _ => panic() - } + let array2463 : Array[Array[SpanData]] = []; + for index2464 = 0; index2464 < (mbt_ffi_load32((iter_base) + 108)); index2464 = index2464 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 104)) + (index2464 * 8) - Option::Some(lifted447) - } - _ => panic() - } + let array2461 : Array[SpanData] = []; + for index2462 = 0; index2462 < (mbt_ffi_load32((iter_base) + 4)); index2462 = index2462 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index2462 * 80) - array449.push(@types.SchemaTypeNode::{ - body: lifted435, - metadata: @types.MetadataEnvelope::{ - doc: lifted437, - aliases: array439, - examples: array442, - deprecated: lifted445, - role: lifted448, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - - let array454 : Array[@types.SchemaTypeDef] = [] - for index455 = 0 - index455 < mbt_ffi_load32(iter_base + 72) - index455 = index455 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + index455 * 24 - - let result451 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted453 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result452 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result452) - } - _ => panic() - } + let lifted2460 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - array454.push(@types.SchemaTypeDef::{ - id: result451, - name: lifted453, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - let array485 : Array[@types.SchemaValueNode] = [] - for index486 = 0 - index486 < mbt_ffi_load32(iter_base + 84) - index486 = index486 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 80) + index486 * 32 - - let lifted484 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result456 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result456) - } - 13 => { - let array457 : Array[Int] = [] - for index458 = 0 - index458 < mbt_ffi_load32(iter_base + 12) - index458 = index458 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index458 * 4 - - array457.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array457) - } - 14 => { - let lifted459 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted459, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array460 : Array[Bool] = [] - for index461 = 0 - index461 < mbt_ffi_load32(iter_base + 12) - index461 = index461 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index461 * 1 - - array460.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array460) - } - 17 => { - let array462 : Array[Int] = [] - for index463 = 0 - index463 < mbt_ffi_load32(iter_base + 12) - index463 = index463 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index463 * 4 - - array462.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array462) - } - 18 => { - let array464 : Array[Int] = [] - for index465 = 0 - index465 < mbt_ffi_load32(iter_base + 12) - index465 = index465 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index465 * 4 - - array464.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array464) - } - 19 => { - let array466 : Array[Int] = [] - for index467 = 0 - index467 < mbt_ffi_load32(iter_base + 12) - index467 = index467 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index467 * 4 - - array466.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array466) - } - 20 => { - let array468 : Array[@types.MapEntry] = [] - for index469 = 0 - index469 < mbt_ffi_load32(iter_base + 12) - index469 = index469 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index469 * 8 - - array468.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array468) - } - 21 => { - let lifted470 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted470) - } - 22 => { - let lifted473 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted471 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted471) - } - 1 => { - let lifted472 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted472) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted473) - } - 23 => { - let result474 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted476 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result475 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result475) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result474, - language: lifted476, - }) - } - 24 => { - let result477 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted479 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result478 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result478) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result477, - mime_type: lifted479, - }) - } - 25 => { - let result480 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result480) - } - 26 => { - let result481 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result481) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result482 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result482, - }) - } - 30 => { - let result483 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result483, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + let result2450 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array485.push(lifted484) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 80)) - - Option::Some(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array449, - defs: array454, - root: mbt_ffi_load32(iter_base + 76), - }, - value: @types.SchemaValueTree::{ - value_nodes: array485, - root: mbt_ffi_load32(iter_base + 88), - }, - }) - } - _ => panic() - } + let lifted2452 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { - let lifted490 = match mbt_ffi_load8_u(iter_base + 96) { - 0 => WrappedFunctionType::ReadLocal - 1 => WrappedFunctionType::WriteLocal - 2 => WrappedFunctionType::ReadRemote - 3 => WrappedFunctionType::WriteRemote - 4 => { - let lifted488 : UInt64? = match - mbt_ffi_load8_u(iter_base + 104) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 112).reinterpret_as_uint64(), - ) - _ => panic() - } - - WrappedFunctionType::WriteRemoteBatched(lifted488) - } - 5 => { - let lifted489 : UInt64? = match - mbt_ffi_load8_u(iter_base + 104) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 112).reinterpret_as_uint64(), - ) - _ => panic() - } - - WrappedFunctionType::WriteRemoteTransaction(lifted489) - } - _ => panic() - } + let result2451 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) - PublicOplogEntry::Start(StartParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent_start_index: lifted251, - function_name: result252, - request: lifted487, - durable_function_type: lifted490, - }) - } - 2 => { - let lifted725 : @types.TypedSchemaValue? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let array687 : Array[@types.SchemaTypeNode] = [] - for index688 = 0 - index688 < mbt_ffi_load32(iter_base + 48) - index688 = index688 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + - index688 * 144 - - let lifted673 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted497 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted492 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted491 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2451) + } + _ => panic() + } - Option::Some(lifted491) - } - _ => panic() - } - - let lifted494 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted493 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2453 : UInt64? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { - Option::Some(lifted493) - } - _ => panic() - } - - let lifted496 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result495 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result495) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted492, - max: lifted494, - unit: lifted496, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted497) - } - 3 => { - let lifted504 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted499 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted498 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - Option::Some(lifted498) - } - _ => panic() - } - - let lifted501 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted500 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2457 : Array[@context.Attribute] = []; + for index2458 = 0; index2458 < (mbt_ffi_load32((iter_base) + 68)); index2458 = index2458 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index2458 * 20) - Option::Some(lifted500) - } - _ => panic() - } - - let lifted503 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result502 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result502) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted499, - max: lifted501, - unit: lifted503, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted504) - } - 4 => { - let lifted511 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted506 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted505 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2454 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted505) - } - _ => panic() - } - - let lifted508 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted507 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2456 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - Option::Some(lifted507) - } - _ => panic() - } - - let lifted510 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result509 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result509) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted506, - max: lifted508, - unit: lifted510, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted511) - } - 5 => { - let lifted518 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted513 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted512 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2455 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - Option::Some(lifted512) - } - _ => panic() - } - - let lifted515 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted514 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @context.AttributeValue::String(result2455) + } + _ => panic() + } - Option::Some(lifted514) - } - _ => panic() - } - - let lifted517 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result516 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result516) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted513, - max: lifted515, - unit: lifted517, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted518) - } - 6 => { - let lifted525 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted520 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted519 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2457.push(@context.Attribute::{key : result2454, value : lifted2456}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - Option::Some(lifted519) - } - _ => panic() - } - - let lifted522 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted521 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + SpanData::LocalSpan(LocalSpanData::{span_id : result2450, start : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent : lifted2452, linked_context : lifted2453, attributes : array2457, inherited : (mbt_ffi_load8_u((iter_base) + 72) != 0)}) + } + 1 => { - Option::Some(lifted521) - } - _ => panic() - } - - let lifted524 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result523 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result523) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted520, - max: lifted522, - unit: lifted524, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted525) - } - 7 => { - let lifted532 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted527 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted526 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2459 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted526) - } - _ => panic() - } - - let lifted529 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted528 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + SpanData::ExternalSpan(ExternalSpanData::{span_id : result2459}) + } + _ => panic() + } - Option::Some(lifted528) - } - _ => panic() - } - - let lifted531 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result530 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result530) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted527, - max: lifted529, - unit: lifted531, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted532) - } - 8 => { - let lifted539 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted534 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted533 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2461.push(lifted2460) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - Option::Some(lifted533) - } - _ => panic() - } - - let lifted536 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted535 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2463.push(array2461) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 104)) - Option::Some(lifted535) - } - _ => panic() - } - - let lifted538 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result537 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result537) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted534, - max: lifted536, - unit: lifted538, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted539) - } - 9 => { - let lifted546 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted541 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted540 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocation::AgentMethodInvocation(AgentMethodInvocationParameters::{idempotency_key : result2210, method_name : result2211, function_input : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array2408, defs : array2413, root : mbt_ffi_load32((iter_base) + 72)}, value : @types.SchemaValueTree::{value_nodes : array2444, root : mbt_ffi_load32((iter_base) + 84)}}, trace_id : result2446, trace_states : array2448, invocation_context : array2463}) + } + 2 => { - Option::Some(lifted540) - } - _ => panic() - } - - let lifted543 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted542 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocation::SaveSnapshot + } + 3 => { - Option::Some(lifted542) - } - _ => panic() - } - - let lifted545 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result544 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result544) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted541, - max: lifted543, - unit: lifted545, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted546) - } - 10 => { - let lifted553 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted548 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted547 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2465 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted547) - } - _ => panic() - } - - let lifted550 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted549 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2466 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - Option::Some(lifted549) - } - _ => panic() - } - - let lifted552 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result551 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result551) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted548, - max: lifted550, - unit: lifted552, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted553) - } - 11 => { - let lifted560 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted555 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted554 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + AgentInvocation::LoadSnapshot(LoadSnapshotParameters::{snapshot : SnapshotData::{data : result2465, mime_type : result2466}}) + } + 4 => { - Option::Some(lifted554) - } - _ => panic() - } - - let lifted557 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted556 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2467 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted556) - } - _ => panic() - } - - let lifted559 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result558 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result558) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted555, - max: lifted557, - unit: lifted559, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted560) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array575 : Array[@types.NamedFieldType] = [] - for index576 = 0 - index576 < mbt_ffi_load32(iter_base + 12) - index576 = index576 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index576 * 68 - - let result561 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted563 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result562 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result562) - } - _ => panic() - } + AgentInvocation::ProcessOplogEntries(ProcessOplogEntriesParameters::{idempotency_key : result2467}) + } + 5 => { - let array565 : Array[String] = [] - for index566 = 0 - index566 < mbt_ffi_load32(iter_base + 28) - index566 = index566 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index566 * 8 + AgentInvocation::ManualUpdate(ManualUpdateParameters::{target_revision : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}) + } + _ => panic() + } - let result564 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + PublicOplogEntry::PendingAgentInvocation(PendingAgentInvocationParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, invocation : lifted2468}) + } + 15 => { - array565.push(result564) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let lifted2471 = match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => { - let array568 : Array[String] = [] - for index569 = 0 - index569 < mbt_ffi_load32(iter_base + 36) - index569 = index569 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index569 * 8 + UpdateDescription::AutoUpdate + } + 1 => { - let result567 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2469 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - array568.push(result567) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted571 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result570 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result570) - } - _ => panic() - } + let result2470 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) - let lifted574 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted573 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result572 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + UpdateDescription::SnapshotBased(@host.Snapshot::{payload : result2469, mime_type : result2470}) + } + _ => panic() + } - @types.Role::Other(result572) + PublicOplogEntry::PendingUpdate(PendingUpdateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, target_revision : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), description : lifted2471}) } - _ => panic() - } + 16 => { - Option::Some(lifted573) - } - _ => panic() - } + let array2478 : Array[PluginInstallationDescription] = []; + for index2479 = 0; index2479 < (mbt_ffi_load32((iter_base) + 52)); index2479 = index2479 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2479 * 48) - array575.push(@types.NamedFieldType::{ - name: result561, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted563, - aliases: array565, - examples: array568, - deprecated: lifted571, - role: lifted574, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array575) - } - 15 => { - let array592 : Array[@types.VariantCaseType] = [] - for index593 = 0 - index593 < mbt_ffi_load32(iter_base + 12) - index593 = index593 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index593 * 72 - - let result577 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted578 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result2472 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted580 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result579 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result579) - } - _ => panic() - } + let result2473 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - let array582 : Array[String] = [] - for index583 = 0 - index583 < mbt_ffi_load32(iter_base + 32) - index583 = index583 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index583 * 8 + let array2476 : Array[(String, String)] = []; + for index2477 = 0; index2477 < (mbt_ffi_load32((iter_base) + 40)); index2477 = index2477 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2477 * 16) - let result581 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2474 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array582.push(result581) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let result2475 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let array585 : Array[String] = [] - for index586 = 0 - index586 < mbt_ffi_load32(iter_base + 40) - index586 = index586 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index586 * 8 + array2476.push((result2474, result2475)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - let result584 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2478.push(PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 16), plugin_name : result2472, plugin_version : result2473, parameters : array2476}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - array585.push(result584) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted588 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result587 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result587) - } - _ => panic() - } + PublicOplogEntry::SuccessfulUpdate(SuccessfulUpdateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, target_revision : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), new_component_size : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64(), new_active_plugins : array2478}) + } + 17 => { - let lifted591 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted590 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result589 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let lifted2481 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - @types.Role::Other(result589) - } - _ => panic() - } + let result2480 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - Option::Some(lifted590) - } - _ => panic() - } + Option::Some(result2480) + } + _ => panic() + } - array592.push(@types.VariantCaseType::{ - name: result577, - payload: lifted578, - metadata: @types.MetadataEnvelope::{ - doc: lifted580, - aliases: array582, - examples: array585, - deprecated: lifted588, - role: lifted591, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array592) - } - 16 => { - let array595 : Array[String] = [] - for index596 = 0 - index596 < mbt_ffi_load32(iter_base + 12) - index596 = index596 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index596 * 8 - - let result594 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array595.push(result594) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array595) - } - 17 => { - let array598 : Array[String] = [] - for index599 = 0 - index599 < mbt_ffi_load32(iter_base + 12) - index599 = index599 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index599 * 8 - - let result597 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array598.push(result597) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array598) - } - 18 => { - let array600 : Array[Int] = [] - for index601 = 0 - index601 < mbt_ffi_load32(iter_base + 12) - index601 = index601 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index601 * 4 - - array600.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array600) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted602 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted603 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted602, - err: lifted603, - }) - } - 24 => { - let lifted607 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array605 : Array[String] = [] - for index606 = 0 - index606 < mbt_ffi_load32(iter_base + 16) - index606 = index606 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index606 * 8 - - let result604 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array605.push(result604) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array605) - } - _ => panic() - } - - let lifted608 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted609 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted611 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result610 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result610) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted607, - min_length: lifted608, - max_length: lifted609, - regex: lifted611, - }) - } - 25 => { - let lifted615 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array613 : Array[String] = [] - for index614 = 0 - index614 < mbt_ffi_load32(iter_base + 16) - index614 = index614 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index614 * 8 - - let result612 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array613.push(result612) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array613) - } - _ => panic() - } - - let lifted616 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted617 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted615, - min_bytes: lifted616, - max_bytes: lifted617, - }) - } - 26 => { - let lifted621 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array619 : Array[String] = [] - for index620 = 0 - index620 < mbt_ffi_load32(iter_base + 20) - index620 = index620 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index620 * 8 - - let result618 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array619.push(result618) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array619) - } - _ => panic() - } - - let lifted625 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array623 : Array[String] = [] - for index624 = 0 - index624 < mbt_ffi_load32(iter_base + 32) - index624 = index624 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index624 * 8 - - let result622 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array623.push(result622) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array623) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted621, - allowed_extensions: lifted625, - }) - } - 27 => { - let lifted629 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array627 : Array[String] = [] - for index628 = 0 - index628 < mbt_ffi_load32(iter_base + 16) - index628 = index628 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index628 * 8 - - let result626 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array627.push(result626) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array627) - } - _ => panic() - } - - let lifted633 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array631 : Array[String] = [] - for index632 = 0 - index632 < mbt_ffi_load32(iter_base + 28) - index632 = index632 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index632 * 8 - - let result630 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array631.push(result630) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array631) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted629, - allowed_hosts: lifted633, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result634 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array636 : Array[String] = [] - for index637 = 0 - index637 < mbt_ffi_load32(iter_base + 20) - index637 = index637 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index637 * 8 - - let result635 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array636.push(result635) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted639 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result638 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result638, - }) - } - _ => panic() - } - - let lifted641 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result640 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result640, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result634, - allowed_suffixes: array636, - min: lifted639, - max: lifted641, - }) - } - 31 => { - let array665 : Array[@types.UnionBranch] = [] - for index666 = 0 - index666 < mbt_ffi_load32(iter_base + 12) - index666 = index666 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index666 * 92 - - let result642 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted651 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result643 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result643) - } - 1 => { - let result644 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result644) - } - 2 => { - let result645 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result645) - } - 3 => { - let result646 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result646) - } - 4 => { - let result647 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted649 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result648 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + PublicOplogEntry::FailedUpdate(FailedUpdateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, target_revision : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), details : lifted2481}) + } + 18 => { - Option::Some(result648) + PublicOplogEntry::GrowMemory(GrowMemoryParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, delta : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}) } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result647, - literal: lifted649, - }) - } - 5 => { - let result650 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result650) - } - _ => panic() - } + 19 => { - let lifted653 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result652 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result652) - } - _ => panic() - } + PublicOplogEntry::FilesystemStorageUsageUpdate(FilesystemStorageUsageUpdateParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, delta : mbt_ffi_load64((iter_base) + 32)}) + } + 20 => { - let array655 : Array[String] = [] - for index656 = 0 - index656 < mbt_ffi_load32(iter_base + 52) - index656 = index656 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index656 * 8 + let result2482 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - let result654 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2483 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + PublicOplogEntry::CreateResource(CreateResourceParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, id : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), name : result2482, owner : result2483}) + } + 21 => { - array655.push(result654) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let result2484 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - let array658 : Array[String] = [] - for index659 = 0 - index659 < mbt_ffi_load32(iter_base + 60) - index659 = index659 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index659 * 8 + let result2485 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - let result657 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + PublicOplogEntry::DropResource(DropResourceParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, id : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), name : result2484, owner : result2485}) + } + 22 => { - array658.push(result657) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted661 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result660 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result660) - } - _ => panic() - } + let result2486 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) - let lifted664 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted663 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result662 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + let result2487 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - @types.Role::Other(result662) + PublicOplogEntry::Log(LogParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, level : LogLevel::from(mbt_ffi_load8_u((iter_base) + 32)), context : result2486, message : result2487}) } - _ => panic() - } + 23 => { - Option::Some(lifted663) - } - _ => panic() - } + PublicOplogEntry::Restart(Timestamp::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}) + } + 24 => { - array665.push(@types.UnionBranch::{ - tag: result642, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted651, - metadata: @types.MetadataEnvelope::{ - doc: lifted653, - aliases: array655, - examples: array658, - deprecated: lifted661, - role: lifted664, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array665, - }) - } - 32 => { - let lifted668 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result667 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result667) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted668, - }) - } - 33 => { - let lifted670 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result669 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result669) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted670, - }) - } - 34 => { - let lifted671 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted671) - } - 35 => { - let lifted672 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted672) - } - _ => panic() - } + let result2488 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) - let lifted675 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result674 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result674) - } - _ => panic() - } + let result2489 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - let array677 : Array[String] = [] - for index678 = 0 - index678 < mbt_ffi_load32(iter_base + 104) - index678 = index678 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index678 * 8 + let array2492 : Array[(String, String)] = []; + for index2493 = 0; index2493 < (mbt_ffi_load32((iter_base) + 72)); index2493 = index2493 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index2493 * 16) - let result676 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2490 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array677.push(result676) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let result2491 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let array680 : Array[String] = [] - for index681 = 0 - index681 < mbt_ffi_load32(iter_base + 112) - index681 = index681 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index681 * 8 + array2492.push((result2490, result2491)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let result679 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + PublicOplogEntry::ActivatePlugin(ActivatePluginParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, plugin : PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 48), plugin_name : result2488, plugin_version : result2489, parameters : array2492}}) + } + 25 => { - array680.push(result679) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted683 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result682 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result682) - } - _ => panic() - } + let result2494 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) - let lifted686 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted685 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result684 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result684) - } - _ => panic() - } + let result2495 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - Option::Some(lifted685) - } - _ => panic() - } + let array2498 : Array[(String, String)] = []; + for index2499 = 0; index2499 < (mbt_ffi_load32((iter_base) + 72)); index2499 = index2499 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index2499 * 16) - array687.push(@types.SchemaTypeNode::{ - body: lifted673, - metadata: @types.MetadataEnvelope::{ - doc: lifted675, - aliases: array677, - examples: array680, - deprecated: lifted683, - role: lifted686, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - let array692 : Array[@types.SchemaTypeDef] = [] - for index693 = 0 - index693 < mbt_ffi_load32(iter_base + 56) - index693 = index693 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 52) + index693 * 24 - - let result689 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted691 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result690 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result690) - } - _ => panic() - } + let result2496 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array692.push(@types.SchemaTypeDef::{ - id: result689, - name: lifted691, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - - let array723 : Array[@types.SchemaValueNode] = [] - for index724 = 0 - index724 < mbt_ffi_load32(iter_base + 68) - index724 = index724 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + index724 * 32 - - let lifted722 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result694 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result694) - } - 13 => { - let array695 : Array[Int] = [] - for index696 = 0 - index696 < mbt_ffi_load32(iter_base + 12) - index696 = index696 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index696 * 4 - - array695.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array695) - } - 14 => { - let lifted697 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted697, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array698 : Array[Bool] = [] - for index699 = 0 - index699 < mbt_ffi_load32(iter_base + 12) - index699 = index699 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index699 * 1 - - array698.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array698) - } - 17 => { - let array700 : Array[Int] = [] - for index701 = 0 - index701 < mbt_ffi_load32(iter_base + 12) - index701 = index701 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index701 * 4 - - array700.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array700) - } - 18 => { - let array702 : Array[Int] = [] - for index703 = 0 - index703 < mbt_ffi_load32(iter_base + 12) - index703 = index703 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index703 * 4 - - array702.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array702) - } - 19 => { - let array704 : Array[Int] = [] - for index705 = 0 - index705 < mbt_ffi_load32(iter_base + 12) - index705 = index705 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index705 * 4 - - array704.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array704) - } - 20 => { - let array706 : Array[@types.MapEntry] = [] - for index707 = 0 - index707 < mbt_ffi_load32(iter_base + 12) - index707 = index707 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index707 * 8 - - array706.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array706) - } - 21 => { - let lifted708 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted708) - } - 22 => { - let lifted711 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted709 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted709) - } - 1 => { - let lifted710 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted710) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted711) - } - 23 => { - let result712 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted714 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result713 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result713) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result712, - language: lifted714, - }) - } - 24 => { - let result715 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted717 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result716 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result716) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result715, - mime_type: lifted717, - }) - } - 25 => { - let result718 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result718) - } - 26 => { - let result719 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result719) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result720 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result720, - }) - } - 30 => { - let result721 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result721, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + let result2497 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array723.push(lifted722) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - Option::Some(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array687, - defs: array692, - root: mbt_ffi_load32(iter_base + 60), - }, - value: @types.SchemaValueTree::{ - value_nodes: array723, - root: mbt_ffi_load32(iter_base + 72), - }, - }) - } - _ => panic() - } + array2498.push((result2496, result2497)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - PublicOplogEntry::End(EndParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - start_index: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - response: lifted725, - forced_commit: mbt_ffi_load8_u(iter_base + 76) != 0, - }) - } - 3 => { - let lifted960 : @types.TypedSchemaValue? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let array922 : Array[@types.SchemaTypeNode] = [] - for index923 = 0 - index923 < mbt_ffi_load32(iter_base + 48) - index923 = index923 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + - index923 * 144 - - let lifted908 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted732 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted727 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted726 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::DeactivatePlugin(DeactivatePluginParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, plugin : PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 48), plugin_name : result2494, plugin_version : result2495, parameters : array2498}}) } + 26 => { - Option::Some(lifted726) - } - _ => panic() - } - - let lifted729 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted728 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::Revert(RevertParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, dropped_region : OplogRegion::{start : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), end : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}) } + 27 => { - Option::Some(lifted728) - } - _ => panic() - } - - let lifted731 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result730 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result730) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted727, - max: lifted729, - unit: lifted731, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted732) - } - 3 => { - let lifted739 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted734 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted733 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2500 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) - Option::Some(lifted733) - } - _ => panic() - } - - let lifted736 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted735 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::CancelPendingInvocation(CancelPendingInvocationParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, idempotency_key : result2500}) } + 28 => { - Option::Some(lifted735) - } - _ => panic() - } - - let lifted738 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result737 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result737) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted734, - max: lifted736, - unit: lifted738, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted739) - } - 4 => { - let lifted746 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted741 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted740 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2501 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) - Option::Some(lifted740) - } - _ => panic() - } - - let lifted743 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted742 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2503 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - Option::Some(lifted742) - } - _ => panic() - } - - let lifted745 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result744 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result744) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted741, - max: lifted743, - unit: lifted745, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted746) - } - 5 => { - let lifted753 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted748 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted747 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2502 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - Option::Some(lifted747) - } - _ => panic() - } - - let lifted750 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted749 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2502) + } + _ => panic() + } - Option::Some(lifted749) - } - _ => panic() - } - - let lifted752 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result751 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result751) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted748, - max: lifted750, - unit: lifted752, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted753) - } - 6 => { - let lifted760 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted755 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted754 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2505 : String? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { - Option::Some(lifted754) - } - _ => panic() - } - - let lifted757 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted756 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2504 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 56), mbt_ffi_load32((iter_base) + 60)) - Option::Some(lifted756) - } - _ => panic() - } - - let lifted759 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result758 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result758) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted755, - max: lifted757, - unit: lifted759, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted760) - } - 7 => { - let lifted767 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted762 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted761 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2504) + } + _ => panic() + } - Option::Some(lifted761) - } - _ => panic() - } - - let lifted764 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted763 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2509 : Array[@context.Attribute] = []; + for index2510 = 0; index2510 < (mbt_ffi_load32((iter_base) + 68)); index2510 = index2510 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index2510 * 20) - Option::Some(lifted763) - } - _ => panic() - } - - let lifted766 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result765 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result765) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted762, - max: lifted764, - unit: lifted766, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted767) - } - 8 => { - let lifted774 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted769 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted768 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2506 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted768) - } - _ => panic() - } - - let lifted771 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted770 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2508 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - Option::Some(lifted770) - } - _ => panic() - } - - let lifted773 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result772 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result772) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted769, - max: lifted771, - unit: lifted773, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted774) - } - 9 => { - let lifted781 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted776 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted775 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2507 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - Option::Some(lifted775) - } - _ => panic() - } - - let lifted778 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted777 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @context.AttributeValue::String(result2507) + } + _ => panic() + } - Option::Some(lifted777) - } - _ => panic() - } - - let lifted780 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result779 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result779) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted776, - max: lifted778, - unit: lifted780, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted781) - } - 10 => { - let lifted788 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted783 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted782 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2509.push(@context.Attribute::{key : result2506, value : lifted2508}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - Option::Some(lifted782) - } - _ => panic() - } - - let lifted785 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted784 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::StartSpan(StartSpanParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, span_id : result2501, parent : lifted2503, linked_context_id : lifted2505, attributes : array2509}) } + 29 => { - Option::Some(lifted784) - } - _ => panic() - } - - let lifted787 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result786 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result786) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted783, - max: lifted785, - unit: lifted787, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted788) - } - 11 => { - let lifted795 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted790 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted789 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2511 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) - Option::Some(lifted789) - } - _ => panic() - } - - let lifted792 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted791 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::FinishSpan(FinishSpanParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, span_id : result2511}) } + 30 => { - Option::Some(lifted791) - } - _ => panic() - } - - let lifted794 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result793 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result793) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted790, - max: lifted792, - unit: lifted794, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted795) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array810 : Array[@types.NamedFieldType] = [] - for index811 = 0 - index811 < mbt_ffi_load32(iter_base + 12) - index811 = index811 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index811 * 68 - - let result796 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted798 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result797 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result797) - } - _ => panic() - } + let result2512 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) - let array800 : Array[String] = [] - for index801 = 0 - index801 < mbt_ffi_load32(iter_base + 28) - index801 = index801 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index801 * 8 + let result2513 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - let result799 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2515 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - array800.push(result799) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let result2514 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) - let array803 : Array[String] = [] - for index804 = 0 - index804 < mbt_ffi_load32(iter_base + 36) - index804 = index804 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index804 * 8 + @context.AttributeValue::String(result2514) + } + _ => panic() + } - let result802 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + PublicOplogEntry::SetSpanAttribute(SetSpanAttributeParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, span_id : result2512, key : result2513, value : lifted2515}) + } + 31 => { - array803.push(result802) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted806 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result805 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result805) - } - _ => panic() - } + let lifted2516 = match (mbt_ffi_load8_u((iter_base) + 32)) { + 0 => { - let lifted809 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted808 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result807 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + @host.PersistenceLevel::PersistNothing + } + 1 => { - @types.Role::Other(result807) - } - _ => panic() - } + @host.PersistenceLevel::PersistRemoteSideEffects + } + 2 => { - Option::Some(lifted808) - } - _ => panic() - } + @host.PersistenceLevel::Smart + } + _ => panic() + } - array810.push(@types.NamedFieldType::{ - name: result796, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted798, - aliases: array800, - examples: array803, - deprecated: lifted806, - role: lifted809, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array810) - } - 15 => { - let array827 : Array[@types.VariantCaseType] = [] - for index828 = 0 - index828 < mbt_ffi_load32(iter_base + 12) - index828 = index828 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index828 * 72 - - let result812 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted813 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + PublicOplogEntry::ChangePersistenceLevel(ChangePersistenceLevelParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, persistence_level : lifted2516}) + } + 32 => { - let lifted815 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result814 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result814) - } - _ => panic() - } + let result2517 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) - let array817 : Array[String] = [] - for index818 = 0 - index818 < mbt_ffi_load32(iter_base + 32) - index818 = index818 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index818 * 8 + PublicOplogEntry::BeginRemoteTransaction(BeginRemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, transaction_id : result2517}) + } + 33 => { - let result816 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + PublicOplogEntry::PreCommitRemoteTransaction(RemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}) + } + 34 => { - array817.push(result816) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + PublicOplogEntry::PreRollbackRemoteTransaction(RemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}) + } + 35 => { - let array820 : Array[String] = [] - for index821 = 0 - index821 < mbt_ffi_load32(iter_base + 40) - index821 = index821 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index821 * 8 + PublicOplogEntry::CommittedRemoteTransaction(RemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}) + } + 36 => { - let result819 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + PublicOplogEntry::RolledBackRemoteTransaction(RemoteTransactionParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, begin_index : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}) + } + 37 => { - array820.push(result819) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted823 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result822 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result822) - } - _ => panic() - } + let result2518 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) - let lifted826 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted825 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result824 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let result2519 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - @types.Role::Other(result824) + PublicOplogEntry::Snapshot(SnapshotParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, data : SnapshotData::{data : result2518, mime_type : result2519}}) } - _ => panic() - } + 38 => { - Option::Some(lifted825) - } - _ => panic() - } + let result2520 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) - array827.push(@types.VariantCaseType::{ - name: result812, - payload: lifted813, - metadata: @types.MetadataEnvelope::{ - doc: lifted815, - aliases: array817, - examples: array820, - deprecated: lifted823, - role: lifted826, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array827) - } - 16 => { - let array830 : Array[String] = [] - for index831 = 0 - index831 < mbt_ffi_load32(iter_base + 12) - index831 = index831 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index831 * 8 - - let result829 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array830.push(result829) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array830) - } - 17 => { - let array833 : Array[String] = [] - for index834 = 0 - index834 < mbt_ffi_load32(iter_base + 12) - index834 = index834 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index834 * 8 - - let result832 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array833.push(result832) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array833) - } - 18 => { - let array835 : Array[Int] = [] - for index836 = 0 - index836 < mbt_ffi_load32(iter_base + 12) - index836 = index836 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index836 * 4 - - array835.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array835) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted837 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted838 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted837, - err: lifted838, - }) - } - 24 => { - let lifted842 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array840 : Array[String] = [] - for index841 = 0 - index841 < mbt_ffi_load32(iter_base + 16) - index841 = index841 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index841 * 8 - - let result839 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array840.push(result839) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array840) - } - _ => panic() - } - - let lifted843 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted844 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted846 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result845 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result845) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted842, - min_length: lifted843, - max_length: lifted844, - regex: lifted846, - }) - } - 25 => { - let lifted850 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array848 : Array[String] = [] - for index849 = 0 - index849 < mbt_ffi_load32(iter_base + 16) - index849 = index849 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index849 * 8 - - let result847 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array848.push(result847) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array848) - } - _ => panic() - } - - let lifted851 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted852 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted850, - min_bytes: lifted851, - max_bytes: lifted852, - }) - } - 26 => { - let lifted856 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array854 : Array[String] = [] - for index855 = 0 - index855 < mbt_ffi_load32(iter_base + 20) - index855 = index855 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index855 * 8 - - let result853 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array854.push(result853) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array854) - } - _ => panic() - } - - let lifted860 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array858 : Array[String] = [] - for index859 = 0 - index859 < mbt_ffi_load32(iter_base + 32) - index859 = index859 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index859 * 8 - - let result857 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array858.push(result857) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array858) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted856, - allowed_extensions: lifted860, - }) - } - 27 => { - let lifted864 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array862 : Array[String] = [] - for index863 = 0 - index863 < mbt_ffi_load32(iter_base + 16) - index863 = index863 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index863 * 8 - - let result861 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array862.push(result861) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array862) - } - _ => panic() - } - - let lifted868 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array866 : Array[String] = [] - for index867 = 0 - index867 < mbt_ffi_load32(iter_base + 28) - index867 = index867 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index867 * 8 - - let result865 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array866.push(result865) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array866) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted864, - allowed_hosts: lifted868, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result869 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array871 : Array[String] = [] - for index872 = 0 - index872 < mbt_ffi_load32(iter_base + 20) - index872 = index872 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index872 * 8 - - let result870 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array871.push(result870) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted874 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result873 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result873, - }) - } - _ => panic() - } - - let lifted876 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result875 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result875, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result869, - allowed_suffixes: array871, - min: lifted874, - max: lifted876, - }) - } - 31 => { - let array900 : Array[@types.UnionBranch] = [] - for index901 = 0 - index901 < mbt_ffi_load32(iter_base + 12) - index901 = index901 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index901 * 92 - - let result877 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted886 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result878 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result878) - } - 1 => { - let result879 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result879) - } - 2 => { - let result880 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result880) - } - 3 => { - let result881 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result881) - } - 4 => { - let result882 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted884 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result883 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let result2521 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - Option::Some(result883) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result882, - literal: lifted884, - }) - } - 5 => { - let result885 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result885) - } - _ => panic() - } + let array2524 : Array[(String, String)] = []; + for index2525 = 0; index2525 < (mbt_ffi_load32((iter_base) + 72)); index2525 = index2525 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index2525 * 16) - let lifted888 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result887 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result887) - } - _ => panic() - } + let result2522 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array890 : Array[String] = [] - for index891 = 0 - index891 < mbt_ffi_load32(iter_base + 52) - index891 = index891 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index891 * 8 + let result2523 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result889 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2524.push((result2522, result2523)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - array890.push(result889) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let result2526 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 96), mbt_ffi_load32((iter_base) + 100)) - let array893 : Array[String] = [] - for index894 = 0 - index894 < mbt_ffi_load32(iter_base + 60) - index894 = index894 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index894 * 8 + PublicOplogEntry::OplogProcessorCheckpoint(OplogProcessorCheckpointParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, plugin : PluginInstallationDescription::{environment_plugin_grant_id : EnvironmentPluginGrantId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}, plugin_priority : mbt_ffi_load32((iter_base) + 48), plugin_name : result2520, plugin_version : result2521, parameters : array2524}, target_agent_id : @types.AgentId::{component_id : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 80)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 88)).reinterpret_as_uint64()}}, agent_id : result2526}, confirmed_up_to : (mbt_ffi_load64((iter_base) + 104)).reinterpret_as_uint64(), sending_up_to : (mbt_ffi_load64((iter_base) + 112)).reinterpret_as_uint64(), last_batch_start : (mbt_ffi_load64((iter_base) + 120)).reinterpret_as_uint64()}) + } + 39 => { - let result892 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2527 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) - array893.push(result892) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted896 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result895 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result895) - } - _ => panic() - } + let array2559 : Array[@retry.PredicateNode] = []; + for index2560 = 0; index2560 < (mbt_ffi_load32((iter_base) + 48)); index2560 = index2560 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index2560 * 32) - let lifted899 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted898 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result897 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + let lifted2558 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - @types.Role::Other(result897) - } - _ => panic() - } + let result2528 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted898) - } - _ => panic() - } + let lifted2530 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - array900.push(@types.UnionBranch::{ - tag: result877, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted886, - metadata: @types.MetadataEnvelope::{ - doc: lifted888, - aliases: array890, - examples: array893, - deprecated: lifted896, - role: lifted899, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array900, - }) - } - 32 => { - let lifted903 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result902 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result902) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted903, - }) - } - 33 => { - let lifted905 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result904 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result904) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted905, - }) - } - 34 => { - let lifted906 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted906) - } - 35 => { - let lifted907 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted907) - } - _ => panic() - } + let result2529 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - let lifted910 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result909 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result909) - } - _ => panic() - } + @retry.PredicateValue::Text(result2529) + } + 1 => { - let array912 : Array[String] = [] - for index913 = 0 - index913 < mbt_ffi_load32(iter_base + 104) - index913 = index913 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index913 * 8 + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - let result911 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - array912.push(result911) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + @retry.PredicateNode::PropEq(@retry.PropertyComparison::{property_name : result2528, value : lifted2530}) + } + 1 => { - let array915 : Array[String] = [] - for index916 = 0 - index916 < mbt_ffi_load32(iter_base + 112) - index916 = index916 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index916 * 8 + let result2531 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result914 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2533 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - array915.push(result914) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted918 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result917 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result917) - } - _ => panic() - } + let result2532 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - let lifted921 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted920 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result919 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result919) - } - _ => panic() - } + @retry.PredicateValue::Text(result2532) + } + 1 => { - Option::Some(lifted920) - } - _ => panic() - } + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - array922.push(@types.SchemaTypeNode::{ - body: lifted908, - metadata: @types.MetadataEnvelope::{ - doc: lifted910, - aliases: array912, - examples: array915, - deprecated: lifted918, - role: lifted921, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - let array927 : Array[@types.SchemaTypeDef] = [] - for index928 = 0 - index928 < mbt_ffi_load32(iter_base + 56) - index928 = index928 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 52) + index928 * 24 - - let result924 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted926 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result925 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result925) - } - _ => panic() - } + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - array927.push(@types.SchemaTypeDef::{ - id: result924, - name: lifted926, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - - let array958 : Array[@types.SchemaValueNode] = [] - for index959 = 0 - index959 < mbt_ffi_load32(iter_base + 68) - index959 = index959 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + index959 * 32 - - let lifted957 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result929 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result929) - } - 13 => { - let array930 : Array[Int] = [] - for index931 = 0 - index931 < mbt_ffi_load32(iter_base + 12) - index931 = index931 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index931 * 4 - - array930.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array930) - } - 14 => { - let lifted932 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted932, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array933 : Array[Bool] = [] - for index934 = 0 - index934 < mbt_ffi_load32(iter_base + 12) - index934 = index934 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index934 * 1 - - array933.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array933) - } - 17 => { - let array935 : Array[Int] = [] - for index936 = 0 - index936 < mbt_ffi_load32(iter_base + 12) - index936 = index936 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index936 * 4 - - array935.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array935) - } - 18 => { - let array937 : Array[Int] = [] - for index938 = 0 - index938 < mbt_ffi_load32(iter_base + 12) - index938 = index938 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index938 * 4 - - array937.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array937) - } - 19 => { - let array939 : Array[Int] = [] - for index940 = 0 - index940 < mbt_ffi_load32(iter_base + 12) - index940 = index940 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index940 * 4 - - array939.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array939) - } - 20 => { - let array941 : Array[@types.MapEntry] = [] - for index942 = 0 - index942 < mbt_ffi_load32(iter_base + 12) - index942 = index942 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index942 * 8 - - array941.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array941) - } - 21 => { - let lifted943 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted943) - } - 22 => { - let lifted946 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted944 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted944) - } - 1 => { - let lifted945 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted945) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted946) - } - 23 => { - let result947 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted949 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result948 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result948) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result947, - language: lifted949, - }) - } - 24 => { - let result950 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted952 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result951 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result951) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result950, - mime_type: lifted952, - }) - } - 25 => { - let result953 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result953) - } - 26 => { - let result954 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result954) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result955 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result955, - }) - } - 30 => { - let result956 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result956, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @retry.PredicateNode::PropNeq(@retry.PropertyComparison::{property_name : result2531, value : lifted2533}) + } + 2 => { - array958.push(lifted957) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - Option::Some(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array922, - defs: array927, - root: mbt_ffi_load32(iter_base + 60), - }, - value: @types.SchemaValueTree::{ - value_nodes: array958, - root: mbt_ffi_load32(iter_base + 72), - }, - }) - } - _ => panic() - } + let result2534 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - PublicOplogEntry::Cancelled(CancelledParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - start_index: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - partial: lifted960, - }) - } - 4 => { - let lifted1473 = match mbt_ffi_load8_u(iter_base + 32) { - 0 => { - let result961 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let array1158 : Array[@types.SchemaTypeNode] = [] - for index1159 = 0 - index1159 < mbt_ffi_load32(iter_base + 52) - index1159 = index1159 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1159 * 144 - - let lifted1144 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted968 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted963 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted962 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2536 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - Option::Some(lifted962) - } - _ => panic() - } - - let lifted965 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted964 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2535 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - Option::Some(lifted964) - } - _ => panic() - } - - let lifted967 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result966 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result966) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted963, - max: lifted965, - unit: lifted967, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted968) - } - 3 => { - let lifted975 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted970 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted969 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Text(result2535) + } + 1 => { - Option::Some(lifted969) - } - _ => panic() - } - - let lifted972 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted971 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - Option::Some(lifted971) - } - _ => panic() - } - - let lifted974 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result973 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result973) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted970, - max: lifted972, - unit: lifted974, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted975) - } - 4 => { - let lifted982 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted977 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted976 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - Option::Some(lifted976) - } - _ => panic() - } - - let lifted979 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted978 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateNode::PropGt(@retry.PropertyComparison::{property_name : result2534, value : lifted2536}) + } + 3 => { - Option::Some(lifted978) - } - _ => panic() - } - - let lifted981 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result980 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result980) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted977, - max: lifted979, - unit: lifted981, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted982) - } - 5 => { - let lifted989 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted984 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted983 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2537 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted983) - } - _ => panic() - } - - let lifted986 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted985 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2539 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - Option::Some(lifted985) - } - _ => panic() - } - - let lifted988 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result987 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result987) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted984, - max: lifted986, - unit: lifted988, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted989) - } - 6 => { - let lifted996 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted991 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted990 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2538 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - Option::Some(lifted990) - } - _ => panic() - } - - let lifted993 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted992 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Text(result2538) + } + 1 => { - Option::Some(lifted992) - } - _ => panic() - } - - let lifted995 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result994 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result994) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted991, - max: lifted993, - unit: lifted995, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted996) - } - 7 => { - let lifted1003 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted998 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted997 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - Option::Some(lifted997) - } - _ => panic() - } - - let lifted1000 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted999 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - Option::Some(lifted999) - } - _ => panic() - } - - let lifted1002 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1001 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1001) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted998, - max: lifted1000, - unit: lifted1002, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1003) - } - 8 => { - let lifted1010 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1005 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1004 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateNode::PropGte(@retry.PropertyComparison::{property_name : result2537, value : lifted2539}) + } + 4 => { - Option::Some(lifted1004) - } - _ => panic() - } - - let lifted1007 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1006 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2540 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1006) - } - _ => panic() - } - - let lifted1009 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1008 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1008) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1005, - max: lifted1007, - unit: lifted1009, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1010) - } - 9 => { - let lifted1017 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1012 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1011 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2542 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - Option::Some(lifted1011) - } - _ => panic() - } - - let lifted1014 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1013 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2541 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - Option::Some(lifted1013) - } - _ => panic() - } - - let lifted1016 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1015 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1015) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1012, - max: lifted1014, - unit: lifted1016, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1017) - } - 10 => { - let lifted1024 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1019 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1018 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Text(result2541) + } + 1 => { - Option::Some(lifted1018) - } - _ => panic() - } - - let lifted1021 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1020 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - Option::Some(lifted1020) - } - _ => panic() - } - - let lifted1023 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1022 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1022) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1019, - max: lifted1021, - unit: lifted1023, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1024) - } - 11 => { - let lifted1031 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1026 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1025 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - Option::Some(lifted1025) - } - _ => panic() - } - - let lifted1028 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1027 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateNode::PropLt(@retry.PropertyComparison::{property_name : result2540, value : lifted2542}) + } + 5 => { - Option::Some(lifted1027) - } - _ => panic() - } - - let lifted1030 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1029 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1029) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1026, - max: lifted1028, - unit: lifted1030, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted1031) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array1046 : Array[@types.NamedFieldType] = [] - for index1047 = 0 - index1047 < mbt_ffi_load32(iter_base + 12) - index1047 = index1047 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1047 * 68 - - let result1032 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1034 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1033 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1033) - } - _ => panic() - } + let result2543 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let array1036 : Array[String] = [] - for index1037 = 0 - index1037 < mbt_ffi_load32(iter_base + 28) - index1037 = index1037 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1037 * 8 + let lifted2545 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - let result1035 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2544 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - array1036.push(result1035) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @retry.PredicateValue::Text(result2544) + } + 1 => { - let array1039 : Array[String] = [] - for index1040 = 0 - index1040 < mbt_ffi_load32(iter_base + 36) - index1040 = index1040 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1040 * 8 + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - let result1038 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - array1039.push(result1038) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted1042 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result1041 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result1041) - } - _ => panic() - } + @retry.PredicateNode::PropLte(@retry.PropertyComparison::{property_name : result2543, value : lifted2545}) + } + 6 => { - let lifted1045 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted1044 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1043 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + let result2546 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.Role::Other(result1043) - } - _ => panic() - } + @retry.PredicateNode::PropExists(result2546) + } + 7 => { - Option::Some(lifted1044) - } - _ => panic() - } + let result2547 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array1046.push(@types.NamedFieldType::{ - name: result1032, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted1034, - aliases: array1036, - examples: array1039, - deprecated: lifted1042, - role: lifted1045, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array1046) - } - 15 => { - let array1063 : Array[@types.VariantCaseType] = [] - for index1064 = 0 - index1064 < mbt_ffi_load32(iter_base + 12) - index1064 = index1064 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1064 * 72 - - let result1048 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1049 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let array2550 : Array[@retry.PredicateValue] = []; + for index2551 = 0; index2551 < (mbt_ffi_load32((iter_base) + 20)); index2551 = index2551 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2551 * 16) - let lifted1051 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1050 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1050) - } - _ => panic() - } + let lifted2549 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let array1053 : Array[String] = [] - for index1054 = 0 - index1054 < mbt_ffi_load32(iter_base + 32) - index1054 = index1054 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1054 * 8 + let result2548 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result1052 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @retry.PredicateValue::Text(result2548) + } + 1 => { - array1053.push(result1052) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 8)) + } + 2 => { - let array1056 : Array[String] = [] - for index1057 = 0 - index1057 < mbt_ffi_load32(iter_base + 40) - index1057 = index1057 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1057 * 8 + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + _ => panic() + } - let result1055 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2550.push(lifted2549) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - array1056.push(result1055) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted1059 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result1058 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result1058) - } - _ => panic() - } + @retry.PredicateNode::PropIn(@retry.PropertySetCheck::{property_name : result2547, values : array2550}) + } + 8 => { - let lifted1062 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted1061 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1060 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let result2552 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.Role::Other(result1060) - } - _ => panic() - } + let result2553 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted1061) - } - _ => panic() - } + @retry.PredicateNode::PropMatches(@retry.PropertyPattern::{property_name : result2552, pattern : result2553}) + } + 9 => { - array1063.push(@types.VariantCaseType::{ - name: result1048, - payload: lifted1049, - metadata: @types.MetadataEnvelope::{ - doc: lifted1051, - aliases: array1053, - examples: array1056, - deprecated: lifted1059, - role: lifted1062, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array1063) - } - 16 => { - let array1066 : Array[String] = [] - for index1067 = 0 - index1067 < mbt_ffi_load32(iter_base + 12) - index1067 = index1067 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1067 * 8 - - let result1065 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1066.push(result1065) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array1066) - } - 17 => { - let array1069 : Array[String] = [] - for index1070 = 0 - index1070 < mbt_ffi_load32(iter_base + 12) - index1070 = index1070 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1070 * 8 - - let result1068 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1069.push(result1068) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array1069) - } - 18 => { - let array1071 : Array[Int] = [] - for index1072 = 0 - index1072 < mbt_ffi_load32(iter_base + 12) - index1072 = index1072 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1072 * 4 - - array1071.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array1071) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted1073 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted1074 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted1073, - err: lifted1074, - }) - } - 24 => { - let lifted1078 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1076 : Array[String] = [] - for index1077 = 0 - index1077 < mbt_ffi_load32(iter_base + 16) - index1077 = index1077 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1077 * 8 - - let result1075 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1076.push(result1075) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1076) - } - _ => panic() - } - - let lifted1079 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1080 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1082 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1081 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1081) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted1078, - min_length: lifted1079, - max_length: lifted1080, - regex: lifted1082, - }) - } - 25 => { - let lifted1086 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1084 : Array[String] = [] - for index1085 = 0 - index1085 < mbt_ffi_load32(iter_base + 16) - index1085 = index1085 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1085 * 8 - - let result1083 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1084.push(result1083) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1084) - } - _ => panic() - } - - let lifted1087 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1088 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted1086, - min_bytes: lifted1087, - max_bytes: lifted1088, - }) - } - 26 => { - let lifted1092 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array1090 : Array[String] = [] - for index1091 = 0 - index1091 < mbt_ffi_load32(iter_base + 20) - index1091 = index1091 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1091 * 8 - - let result1089 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1090.push(result1089) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array1090) - } - _ => panic() - } - - let lifted1096 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array1094 : Array[String] = [] - for index1095 = 0 - index1095 < mbt_ffi_load32(iter_base + 32) - index1095 = index1095 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1095 * 8 - - let result1093 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1094.push(result1093) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array1094) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted1092, - allowed_extensions: lifted1096, - }) - } - 27 => { - let lifted1100 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1098 : Array[String] = [] - for index1099 = 0 - index1099 < mbt_ffi_load32(iter_base + 16) - index1099 = index1099 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1099 * 8 - - let result1097 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1098.push(result1097) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1098) - } - _ => panic() - } - - let lifted1104 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array1102 : Array[String] = [] - for index1103 = 0 - index1103 < mbt_ffi_load32(iter_base + 28) - index1103 = index1103 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1103 * 8 - - let result1101 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1102.push(result1101) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array1102) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted1100, - allowed_hosts: lifted1104, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result1105 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array1107 : Array[String] = [] - for index1108 = 0 - index1108 < mbt_ffi_load32(iter_base + 20) - index1108 = index1108 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1108 * 8 - - let result1106 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1107.push(result1106) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted1110 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1109 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result1109, - }) - } - _ => panic() - } - - let lifted1112 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result1111 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result1111, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result1105, - allowed_suffixes: array1107, - min: lifted1110, - max: lifted1112, - }) - } - 31 => { - let array1136 : Array[@types.UnionBranch] = [] - for index1137 = 0 - index1137 < mbt_ffi_load32(iter_base + 12) - index1137 = index1137 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1137 * 92 - - let result1113 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1122 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result1114 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result1114) - } - 1 => { - let result1115 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result1115) - } - 2 => { - let result1116 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result1116) - } - 3 => { - let result1117 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result1117) - } - 4 => { - let result1118 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted1120 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1119 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let result2554 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(result1119) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result1118, - literal: lifted1120, - }) - } - 5 => { - let result1121 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result1121) - } - _ => panic() - } + let result2555 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let lifted1124 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1123 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1123) - } - _ => panic() - } + @retry.PredicateNode::PropStartsWith(@retry.PropertyPattern::{property_name : result2554, pattern : result2555}) + } + 10 => { - let array1126 : Array[String] = [] - for index1127 = 0 - index1127 < mbt_ffi_load32(iter_base + 52) - index1127 = index1127 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1127 * 8 + let result2556 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result1125 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2557 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - array1126.push(result1125) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + @retry.PredicateNode::PropContains(@retry.PropertyPattern::{property_name : result2556, pattern : result2557}) + } + 11 => { - let array1129 : Array[String] = [] - for index1130 = 0 - index1130 < mbt_ffi_load32(iter_base + 60) - index1130 = index1130 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1130 * 8 + @retry.PredicateNode::PredAnd((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { - let result1128 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @retry.PredicateNode::PredOr((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { - array1129.push(result1128) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted1132 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1131 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1131) - } - _ => panic() - } + @retry.PredicateNode::PredNot(mbt_ffi_load32((iter_base) + 8)) + } + 14 => { - let lifted1135 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted1134 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1133 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @retry.PredicateNode::PredTrue + } + 15 => { - @types.Role::Other(result1133) - } - _ => panic() - } + @retry.PredicateNode::PredFalse + } + _ => panic() + } - Option::Some(lifted1134) - } - _ => panic() - } + array2559.push(lifted2558) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - array1136.push(@types.UnionBranch::{ - tag: result1113, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted1122, - metadata: @types.MetadataEnvelope::{ - doc: lifted1124, - aliases: array1126, - examples: array1129, - deprecated: lifted1132, - role: lifted1135, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array1136, - }) - } - 32 => { - let lifted1139 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1138 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1138) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted1139, - }) - } - 33 => { - let lifted1141 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1140 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1140) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted1141, - }) - } - 34 => { - let lifted1142 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted1142) - } - 35 => { - let lifted1143 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted1143) - } - _ => panic() - } + let array2595 : Array[@retry.PolicyNode] = []; + for index2596 = 0; index2596 < (mbt_ffi_load32((iter_base) + 56)); index2596 = index2596 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 52)) + (index2596 * 32) - let lifted1146 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result1145 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result1145) - } - _ => panic() - } + let lifted2594 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let array1148 : Array[String] = [] - for index1149 = 0 - index1149 < mbt_ffi_load32(iter_base + 104) - index1149 = index1149 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index1149 * 8 + @retry.PolicyNode::Periodic((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 1 => { - let result1147 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @retry.PolicyNode::Exponential(@retry.ExponentialConfig::{base_delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), factor : mbt_ffi_loadf64((iter_base) + 16)}) + } + 2 => { - array1148.push(result1147) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + @retry.PolicyNode::Fibonacci(@retry.FibonacciConfig::{first : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), second : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64()}) + } + 3 => { - let array1151 : Array[String] = [] - for index1152 = 0 - index1152 < mbt_ffi_load32(iter_base + 112) - index1152 = index1152 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index1152 * 8 + @retry.PolicyNode::Immediate + } + 4 => { - let result1150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @retry.PolicyNode::Never + } + 5 => { - array1151.push(result1150) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted1154 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result1153 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result1153) - } - _ => panic() - } + @retry.PolicyNode::CountBox(@retry.CountBoxConfig::{max_retries : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), inner : mbt_ffi_load32((iter_base) + 12)}) + } + 6 => { - let lifted1157 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted1156 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result1155) - } - _ => panic() - } + @retry.PolicyNode::TimeBox(@retry.TimeBoxConfig::{limit : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 7 => { - Option::Some(lifted1156) - } - _ => panic() - } + @retry.PolicyNode::ClampDelay(@retry.ClampConfig::{min_delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), max_delay : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 24)}) + } + 8 => { - array1158.push(@types.SchemaTypeNode::{ - body: lifted1144, - metadata: @types.MetadataEnvelope::{ - doc: lifted1146, - aliases: array1148, - examples: array1151, - deprecated: lifted1154, - role: lifted1157, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array1163 : Array[@types.SchemaTypeDef] = [] - for index1164 = 0 - index1164 < mbt_ffi_load32(iter_base + 60) - index1164 = index1164 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1164 * 24 - - let result1160 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1162 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1161 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1161) - } - _ => panic() - } + @retry.PolicyNode::AddDelay(@retry.AddDelayConfig::{delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 9 => { - array1163.push(@types.SchemaTypeDef::{ - id: result1160, - name: lifted1162, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let array1194 : Array[@types.SchemaValueNode] = [] - for index1195 = 0 - index1195 < mbt_ffi_load32(iter_base + 72) - index1195 = index1195 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + - index1195 * 32 - - let lifted1193 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result1165 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result1165) - } - 13 => { - let array1166 : Array[Int] = [] - for index1167 = 0 - index1167 < mbt_ffi_load32(iter_base + 12) - index1167 = index1167 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1167 * 4 - - array1166.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array1166) - } - 14 => { - let lifted1168 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted1168, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1169 : Array[Bool] = [] - for index1170 = 0 - index1170 < mbt_ffi_load32(iter_base + 12) - index1170 = index1170 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1170 * 1 - - array1169.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1169) - } - 17 => { - let array1171 : Array[Int] = [] - for index1172 = 0 - index1172 < mbt_ffi_load32(iter_base + 12) - index1172 = index1172 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1172 * 4 - - array1171.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array1171) - } - 18 => { - let array1173 : Array[Int] = [] - for index1174 = 0 - index1174 < mbt_ffi_load32(iter_base + 12) - index1174 = index1174 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1174 * 4 - - array1173.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array1173) - } - 19 => { - let array1175 : Array[Int] = [] - for index1176 = 0 - index1176 < mbt_ffi_load32(iter_base + 12) - index1176 = index1176 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1176 * 4 - - array1175.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array1175) - } - 20 => { - let array1177 : Array[@types.MapEntry] = [] - for index1178 = 0 - index1178 < mbt_ffi_load32(iter_base + 12) - index1178 = index1178 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1178 * 8 - - array1177.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array1177) - } - 21 => { - let lifted1179 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted1179) - } - 22 => { - let lifted1182 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted1180 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted1180) - } - 1 => { - let lifted1181 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted1181) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted1182) - } - 23 => { - let result1183 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1185 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1184 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1184) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result1183, - language: lifted1185, - }) - } - 24 => { - let result1186 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1188 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1187 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1187) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result1186, - mime_type: lifted1188, - }) - } - 25 => { - let result1189 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result1189) - } - 26 => { - let result1190 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result1190) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result1191 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result1191, - }) - } - 30 => { - let result1192 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result1192, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @retry.PolicyNode::Jitter(@retry.JitterConfig::{factor : mbt_ffi_loadf64((iter_base) + 8), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 10 => { - array1194.push(lifted1193) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - let result1196 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 80), - mbt_ffi_load32(iter_base + 84), - ) - - let array1198 : Array[String] = [] - for index1199 = 0 - index1199 < mbt_ffi_load32(iter_base + 92) - index1199 = index1199 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 88) + index1199 * 8 - - let result1197 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1198.push(result1197) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - - let array1213 : Array[Array[SpanData]] = [] - for index1214 = 0 - index1214 < mbt_ffi_load32(iter_base + 100) - index1214 = index1214 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 96) + index1214 * 8 - - let array1211 : Array[SpanData] = [] - for index1212 = 0 - index1212 < mbt_ffi_load32(iter_base + 4) - index1212 = index1212 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index1212 * 80 - - let lifted1210 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result1200 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1202 : String? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result1201 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result1201) - } - _ => panic() - } + let array2592 : Array[@retry.PredicateNode] = []; + for index2593 = 0; index2593 < (mbt_ffi_load32((iter_base) + 12)); index2593 = index2593 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2593 * 32) - let lifted1203 : UInt64? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2591 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let array1207 : Array[@context.Attribute] = [] - for index1208 = 0 - index1208 < mbt_ffi_load32(iter_base + 68) - index1208 = index1208 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index1208 * 20 - - let result1204 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1206 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result1205 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result1205) - } - _ => panic() - } - - array1207.push(@context.Attribute::{ - key: result1204, - value: lifted1206, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - SpanData::LocalSpan(LocalSpanData::{ - span_id: result1200, - start: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent: lifted1202, - linked_context: lifted1203, - attributes: array1207, - inherited: mbt_ffi_load8_u(iter_base + 72) != 0, - }) - } - 1 => { - let result1209 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - SpanData::ExternalSpan(ExternalSpanData::{ - span_id: result1209, - }) - } - _ => panic() - } - - array1211.push(lifted1210) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array1213.push(array1211) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 96)) - - AgentInvocation::AgentInitialization(AgentInitializationParameters::{ - idempotency_key: result961, - constructor_parameters: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array1158, - defs: array1163, - root: mbt_ffi_load32(iter_base + 64), - }, - value: @types.SchemaValueTree::{ - value_nodes: array1194, - root: mbt_ffi_load32(iter_base + 76), - }, - }, - trace_id: result1196, - trace_states: array1198, - invocation_context: array1213, - }) - } - 1 => { - let result1215 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let result1216 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - let array1413 : Array[@types.SchemaTypeNode] = [] - for index1414 = 0 - index1414 < mbt_ffi_load32(iter_base + 60) - index1414 = index1414 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1414 * 144 - - let lifted1399 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted1223 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1218 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1217 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2561 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1217) - } - _ => panic() - } - - let lifted1220 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1219 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2563 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - Option::Some(lifted1219) - } - _ => panic() - } - - let lifted1222 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1221 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1221) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1218, - max: lifted1220, - unit: lifted1222, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted1223) - } - 3 => { - let lifted1230 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1225 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1224 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2562 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - Option::Some(lifted1224) - } - _ => panic() - } - - let lifted1227 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1226 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Text(result2562) + } + 1 => { - Option::Some(lifted1226) - } - _ => panic() - } - - let lifted1229 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1228 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1228) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1225, - max: lifted1227, - unit: lifted1229, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted1230) - } - 4 => { - let lifted1237 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1232 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1231 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - Option::Some(lifted1231) - } - _ => panic() - } - - let lifted1234 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1233 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - Option::Some(lifted1233) - } - _ => panic() - } - - let lifted1236 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1235 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1235) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1232, - max: lifted1234, - unit: lifted1236, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted1237) - } - 5 => { - let lifted1244 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1239 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1238 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateNode::PropEq(@retry.PropertyComparison::{property_name : result2561, value : lifted2563}) + } + 1 => { - Option::Some(lifted1238) - } - _ => panic() - } - - let lifted1241 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1240 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2564 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1240) - } - _ => panic() - } - - let lifted1243 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1242 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1242) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1239, - max: lifted1241, - unit: lifted1243, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted1244) - } - 6 => { - let lifted1251 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1246 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1245 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2566 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - Option::Some(lifted1245) - } - _ => panic() - } - - let lifted1248 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1247 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2565 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - Option::Some(lifted1247) - } - _ => panic() - } - - let lifted1250 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1249 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1249) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1246, - max: lifted1248, - unit: lifted1250, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted1251) - } - 7 => { - let lifted1258 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1253 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1252 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Text(result2565) + } + 1 => { - Option::Some(lifted1252) - } - _ => panic() - } - - let lifted1255 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1254 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - Option::Some(lifted1254) - } - _ => panic() - } - - let lifted1257 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1256 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1256) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1253, - max: lifted1255, - unit: lifted1257, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1258) - } - 8 => { - let lifted1265 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1260 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1259 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - Option::Some(lifted1259) - } - _ => panic() - } - - let lifted1262 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1261 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateNode::PropNeq(@retry.PropertyComparison::{property_name : result2564, value : lifted2566}) + } + 2 => { - Option::Some(lifted1261) - } - _ => panic() - } - - let lifted1264 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1263 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1263) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1260, - max: lifted1262, - unit: lifted1264, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1265) - } - 9 => { - let lifted1272 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1267 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1266 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2567 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1266) - } - _ => panic() - } - - let lifted1269 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1268 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2569 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - Option::Some(lifted1268) - } - _ => panic() - } - - let lifted1271 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1270 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1270) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1267, - max: lifted1269, - unit: lifted1271, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1272) - } - 10 => { - let lifted1279 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1274 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1273 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2568 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - Option::Some(lifted1273) - } - _ => panic() - } - - let lifted1276 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1275 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Text(result2568) + } + 1 => { - Option::Some(lifted1275) - } - _ => panic() - } - - let lifted1278 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1277 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1277) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1274, - max: lifted1276, - unit: lifted1278, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1279) - } - 11 => { - let lifted1286 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1281 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1280 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - Option::Some(lifted1280) - } - _ => panic() - } - - let lifted1283 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1282 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - Option::Some(lifted1282) - } - _ => panic() - } - - let lifted1285 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1284 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1284) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1281, - max: lifted1283, - unit: lifted1285, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted1286) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array1301 : Array[@types.NamedFieldType] = [] - for index1302 = 0 - index1302 < mbt_ffi_load32(iter_base + 12) - index1302 = index1302 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1302 * 68 - - let result1287 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1289 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1288 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1288) - } - _ => panic() - } + @retry.PredicateNode::PropGt(@retry.PropertyComparison::{property_name : result2567, value : lifted2569}) + } + 3 => { - let array1291 : Array[String] = [] - for index1292 = 0 - index1292 < mbt_ffi_load32(iter_base + 28) - index1292 = index1292 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1292 * 8 + let result2570 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result1290 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2572 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - array1291.push(result1290) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let result2571 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - let array1294 : Array[String] = [] - for index1295 = 0 - index1295 < mbt_ffi_load32(iter_base + 36) - index1295 = index1295 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1295 * 8 + @retry.PredicateValue::Text(result2571) + } + 1 => { - let result1293 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - array1294.push(result1293) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted1297 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result1296 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result1296) - } - _ => panic() - } + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - let lifted1300 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted1299 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1298 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + @retry.PredicateNode::PropGte(@retry.PropertyComparison::{property_name : result2570, value : lifted2572}) + } + 4 => { - @types.Role::Other(result1298) - } - _ => panic() - } + let result2573 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1299) - } - _ => panic() - } + let lifted2575 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - array1301.push(@types.NamedFieldType::{ - name: result1287, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted1289, - aliases: array1291, - examples: array1294, - deprecated: lifted1297, - role: lifted1300, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array1301) - } - 15 => { - let array1318 : Array[@types.VariantCaseType] = [] - for index1319 = 0 - index1319 < mbt_ffi_load32(iter_base + 12) - index1319 = index1319 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1319 * 72 - - let result1303 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1304 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result2574 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - let lifted1306 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1305 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1305) - } - _ => panic() - } + @retry.PredicateValue::Text(result2574) + } + 1 => { - let array1308 : Array[String] = [] - for index1309 = 0 - index1309 < mbt_ffi_load32(iter_base + 32) - index1309 = index1309 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1309 * 8 + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - let result1307 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - array1308.push(result1307) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + @retry.PredicateNode::PropLt(@retry.PropertyComparison::{property_name : result2573, value : lifted2575}) + } + 5 => { - let array1311 : Array[String] = [] - for index1312 = 0 - index1312 < mbt_ffi_load32(iter_base + 40) - index1312 = index1312 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1312 * 8 + let result2576 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result1310 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2578 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - array1311.push(result1310) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted1314 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result1313 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result1313) - } - _ => panic() - } + let result2577 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - let lifted1317 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted1316 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1315 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + @retry.PredicateValue::Text(result2577) + } + 1 => { - @types.Role::Other(result1315) - } - _ => panic() - } + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - Option::Some(lifted1316) - } - _ => panic() - } + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - array1318.push(@types.VariantCaseType::{ - name: result1303, - payload: lifted1304, - metadata: @types.MetadataEnvelope::{ - doc: lifted1306, - aliases: array1308, - examples: array1311, - deprecated: lifted1314, - role: lifted1317, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array1318) - } - 16 => { - let array1321 : Array[String] = [] - for index1322 = 0 - index1322 < mbt_ffi_load32(iter_base + 12) - index1322 = index1322 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1322 * 8 - - let result1320 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1321.push(result1320) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array1321) - } - 17 => { - let array1324 : Array[String] = [] - for index1325 = 0 - index1325 < mbt_ffi_load32(iter_base + 12) - index1325 = index1325 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1325 * 8 - - let result1323 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1324.push(result1323) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array1324) - } - 18 => { - let array1326 : Array[Int] = [] - for index1327 = 0 - index1327 < mbt_ffi_load32(iter_base + 12) - index1327 = index1327 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1327 * 4 - - array1326.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array1326) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted1328 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted1329 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted1328, - err: lifted1329, - }) - } - 24 => { - let lifted1333 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1331 : Array[String] = [] - for index1332 = 0 - index1332 < mbt_ffi_load32(iter_base + 16) - index1332 = index1332 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1332 * 8 - - let result1330 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1331.push(result1330) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1331) - } - _ => panic() - } - - let lifted1334 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1335 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1337 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1336 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1336) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted1333, - min_length: lifted1334, - max_length: lifted1335, - regex: lifted1337, - }) - } - 25 => { - let lifted1341 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1339 : Array[String] = [] - for index1340 = 0 - index1340 < mbt_ffi_load32(iter_base + 16) - index1340 = index1340 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1340 * 8 - - let result1338 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1339.push(result1338) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1339) - } - _ => panic() - } - - let lifted1342 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1343 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted1341, - min_bytes: lifted1342, - max_bytes: lifted1343, - }) - } - 26 => { - let lifted1347 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array1345 : Array[String] = [] - for index1346 = 0 - index1346 < mbt_ffi_load32(iter_base + 20) - index1346 = index1346 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1346 * 8 - - let result1344 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1345.push(result1344) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array1345) - } - _ => panic() - } - - let lifted1351 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array1349 : Array[String] = [] - for index1350 = 0 - index1350 < mbt_ffi_load32(iter_base + 32) - index1350 = index1350 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1350 * 8 - - let result1348 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1349.push(result1348) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array1349) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted1347, - allowed_extensions: lifted1351, - }) - } - 27 => { - let lifted1355 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1353 : Array[String] = [] - for index1354 = 0 - index1354 < mbt_ffi_load32(iter_base + 16) - index1354 = index1354 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1354 * 8 - - let result1352 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1353.push(result1352) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1353) - } - _ => panic() - } - - let lifted1359 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array1357 : Array[String] = [] - for index1358 = 0 - index1358 < mbt_ffi_load32(iter_base + 28) - index1358 = index1358 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1358 * 8 - - let result1356 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1357.push(result1356) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array1357) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted1355, - allowed_hosts: lifted1359, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result1360 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array1362 : Array[String] = [] - for index1363 = 0 - index1363 < mbt_ffi_load32(iter_base + 20) - index1363 = index1363 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1363 * 8 - - let result1361 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1362.push(result1361) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted1365 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1364 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result1364, - }) - } - _ => panic() - } - - let lifted1367 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result1366 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result1366, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result1360, - allowed_suffixes: array1362, - min: lifted1365, - max: lifted1367, - }) - } - 31 => { - let array1391 : Array[@types.UnionBranch] = [] - for index1392 = 0 - index1392 < mbt_ffi_load32(iter_base + 12) - index1392 = index1392 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1392 * 92 - - let result1368 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1377 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result1369 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result1369) - } - 1 => { - let result1370 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result1370) - } - 2 => { - let result1371 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result1371) - } - 3 => { - let result1372 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result1372) - } - 4 => { - let result1373 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted1375 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1374 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + @retry.PredicateNode::PropLte(@retry.PropertyComparison::{property_name : result2576, value : lifted2578}) + } + 6 => { + + let result2579 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(result1374) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result1373, - literal: lifted1375, - }) - } - 5 => { - let result1376 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result1376) - } - _ => panic() - } + @retry.PredicateNode::PropExists(result2579) + } + 7 => { - let lifted1379 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1378 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1378) - } - _ => panic() - } + let result2580 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let array1381 : Array[String] = [] - for index1382 = 0 - index1382 < mbt_ffi_load32(iter_base + 52) - index1382 = index1382 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1382 * 8 + let array2583 : Array[@retry.PredicateValue] = []; + for index2584 = 0; index2584 < (mbt_ffi_load32((iter_base) + 20)); index2584 = index2584 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2584 * 16) - let result1380 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2582 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - array1381.push(result1380) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let result2581 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let array1384 : Array[String] = [] - for index1385 = 0 - index1385 < mbt_ffi_load32(iter_base + 60) - index1385 = index1385 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1385 * 8 + @retry.PredicateValue::Text(result2581) + } + 1 => { - let result1383 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @retry.PredicateValue::Integer(mbt_ffi_load64((iter_base) + 8)) + } + 2 => { - array1384.push(result1383) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted1387 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1386 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1386) - } - _ => panic() - } + @retry.PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + _ => panic() + } - let lifted1390 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted1389 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1388 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + array2583.push(lifted2582) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - @types.Role::Other(result1388) - } - _ => panic() - } + @retry.PredicateNode::PropIn(@retry.PropertySetCheck::{property_name : result2580, values : array2583}) + } + 8 => { - Option::Some(lifted1389) - } - _ => panic() - } + let result2585 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array1391.push(@types.UnionBranch::{ - tag: result1368, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted1377, - metadata: @types.MetadataEnvelope::{ - doc: lifted1379, - aliases: array1381, - examples: array1384, - deprecated: lifted1387, - role: lifted1390, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array1391, - }) - } - 32 => { - let lifted1394 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1393 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1393) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted1394, - }) - } - 33 => { - let lifted1396 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1395 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1395) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted1396, - }) - } - 34 => { - let lifted1397 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted1397) - } - 35 => { - let lifted1398 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted1398) - } - _ => panic() - } + let result2586 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let lifted1401 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result1400 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result1400) - } - _ => panic() - } + @retry.PredicateNode::PropMatches(@retry.PropertyPattern::{property_name : result2585, pattern : result2586}) + } + 9 => { - let array1403 : Array[String] = [] - for index1404 = 0 - index1404 < mbt_ffi_load32(iter_base + 104) - index1404 = index1404 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index1404 * 8 + let result2587 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result1402 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2588 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - array1403.push(result1402) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + @retry.PredicateNode::PropStartsWith(@retry.PropertyPattern::{property_name : result2587, pattern : result2588}) + } + 10 => { - let array1406 : Array[String] = [] - for index1407 = 0 - index1407 < mbt_ffi_load32(iter_base + 112) - index1407 = index1407 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index1407 * 8 + let result2589 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let result1405 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2590 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - array1406.push(result1405) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted1409 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result1408 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result1408) - } - _ => panic() - } + @retry.PredicateNode::PropContains(@retry.PropertyPattern::{property_name : result2589, pattern : result2590}) + } + 11 => { - let lifted1412 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted1411 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1410 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result1410) - } - _ => panic() - } + @retry.PredicateNode::PredAnd((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { - Option::Some(lifted1411) - } - _ => panic() - } + @retry.PredicateNode::PredOr((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { - array1413.push(@types.SchemaTypeNode::{ - body: lifted1399, - metadata: @types.MetadataEnvelope::{ - doc: lifted1401, - aliases: array1403, - examples: array1406, - deprecated: lifted1409, - role: lifted1412, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let array1418 : Array[@types.SchemaTypeDef] = [] - for index1419 = 0 - index1419 < mbt_ffi_load32(iter_base + 68) - index1419 = index1419 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index1419 * 24 - - let result1415 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1417 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1416 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1416) - } - _ => panic() - } + @retry.PredicateNode::PredNot(mbt_ffi_load32((iter_base) + 8)) + } + 14 => { - array1418.push(@types.SchemaTypeDef::{ - id: result1415, - name: lifted1417, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - let array1449 : Array[@types.SchemaValueNode] = [] - for index1450 = 0 - index1450 < mbt_ffi_load32(iter_base + 80) - index1450 = index1450 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 76) + - index1450 * 32 - - let lifted1448 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result1420 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result1420) - } - 13 => { - let array1421 : Array[Int] = [] - for index1422 = 0 - index1422 < mbt_ffi_load32(iter_base + 12) - index1422 = index1422 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1422 * 4 - - array1421.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array1421) - } - 14 => { - let lifted1423 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted1423, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1424 : Array[Bool] = [] - for index1425 = 0 - index1425 < mbt_ffi_load32(iter_base + 12) - index1425 = index1425 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1425 * 1 - - array1424.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1424) - } - 17 => { - let array1426 : Array[Int] = [] - for index1427 = 0 - index1427 < mbt_ffi_load32(iter_base + 12) - index1427 = index1427 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1427 * 4 - - array1426.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array1426) - } - 18 => { - let array1428 : Array[Int] = [] - for index1429 = 0 - index1429 < mbt_ffi_load32(iter_base + 12) - index1429 = index1429 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1429 * 4 - - array1428.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array1428) - } - 19 => { - let array1430 : Array[Int] = [] - for index1431 = 0 - index1431 < mbt_ffi_load32(iter_base + 12) - index1431 = index1431 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1431 * 4 - - array1430.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array1430) - } - 20 => { - let array1432 : Array[@types.MapEntry] = [] - for index1433 = 0 - index1433 < mbt_ffi_load32(iter_base + 12) - index1433 = index1433 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1433 * 8 - - array1432.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array1432) - } - 21 => { - let lifted1434 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted1434) - } - 22 => { - let lifted1437 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted1435 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted1435) - } - 1 => { - let lifted1436 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted1436) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted1437) - } - 23 => { - let result1438 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1440 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1439 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1439) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result1438, - language: lifted1440, - }) - } - 24 => { - let result1441 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1443 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1442 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1442) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result1441, - mime_type: lifted1443, - }) - } - 25 => { - let result1444 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result1444) - } - 26 => { - let result1445 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result1445) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result1446 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result1446, - }) - } - 30 => { - let result1447 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result1447, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @retry.PredicateNode::PredTrue + } + 15 => { - array1449.push(lifted1448) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - - let result1451 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 88), - mbt_ffi_load32(iter_base + 92), - ) - - let array1453 : Array[String] = [] - for index1454 = 0 - index1454 < mbt_ffi_load32(iter_base + 100) - index1454 = index1454 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 96) + index1454 * 8 - - let result1452 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1453.push(result1452) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 96)) - - let array1468 : Array[Array[SpanData]] = [] - for index1469 = 0 - index1469 < mbt_ffi_load32(iter_base + 108) - index1469 = index1469 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 104) + - index1469 * 8 - - let array1466 : Array[SpanData] = [] - for index1467 = 0 - index1467 < mbt_ffi_load32(iter_base + 4) - index1467 = index1467 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index1467 * 80 - - let lifted1465 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result1455 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1457 : String? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result1456 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result1456) - } - _ => panic() - } + @retry.PredicateNode::PredFalse + } + _ => panic() + } - let lifted1458 : UInt64? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2592.push(lifted2591) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let array1462 : Array[@context.Attribute] = [] - for index1463 = 0 - index1463 < mbt_ffi_load32(iter_base + 68) - index1463 = index1463 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index1463 * 20 - - let result1459 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1461 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result1460 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result1460) - } - _ => panic() - } - - array1462.push(@context.Attribute::{ - key: result1459, - value: lifted1461, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - SpanData::LocalSpan(LocalSpanData::{ - span_id: result1455, - start: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent: lifted1457, - linked_context: lifted1458, - attributes: array1462, - inherited: mbt_ffi_load8_u(iter_base + 72) != 0, - }) - } - 1 => { - let result1464 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - SpanData::ExternalSpan(ExternalSpanData::{ - span_id: result1464, - }) - } - _ => panic() - } - - array1466.push(lifted1465) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array1468.push(array1466) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 104)) - - AgentInvocation::AgentMethodInvocation(AgentMethodInvocationParameters::{ - idempotency_key: result1215, - method_name: result1216, - function_input: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array1413, - defs: array1418, - root: mbt_ffi_load32(iter_base + 72), - }, - value: @types.SchemaValueTree::{ - value_nodes: array1449, - root: mbt_ffi_load32(iter_base + 84), - }, - }, - trace_id: result1451, - trace_states: array1453, - invocation_context: array1468, - }) - } - 2 => AgentInvocation::SaveSnapshot - 3 => { - let result1470 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let result1471 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - AgentInvocation::LoadSnapshot(LoadSnapshotParameters::{ - snapshot: SnapshotData::{ - data: result1470, - mime_type: result1471, - }, - }) - } - 4 => { - let result1472 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - AgentInvocation::ProcessOplogEntries(ProcessOplogEntriesParameters::{ - idempotency_key: result1472, - }) - } - 5 => - AgentInvocation::ManualUpdate(ManualUpdateParameters::{ - target_revision: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }) - _ => panic() - } + @retry.PolicyNode::FilteredOn(@retry.FilteredConfig::{predicate : @retry.RetryPredicate::{nodes : array2592}, inner : mbt_ffi_load32((iter_base) + 16)}) + } + 11 => { - PublicOplogEntry::AgentInvocationStarted(AgentInvocationStartedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - invocation: lifted1473, - }) - } - 5 => { - let lifted1948 = match mbt_ffi_load8_u(iter_base + 32) { - 0 => { - let array1670 : Array[@types.SchemaTypeNode] = [] - for index1671 = 0 - index1671 < mbt_ffi_load32(iter_base + 40) - index1671 = index1671 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1671 * 144 - - let lifted1656 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted1480 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1475 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1474 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PolicyNode::AndThen((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { - Option::Some(lifted1474) - } - _ => panic() - } - - let lifted1477 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1476 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PolicyNode::PolicyUnion((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { - Option::Some(lifted1476) - } - _ => panic() - } - - let lifted1479 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1478 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1478) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1475, - max: lifted1477, - unit: lifted1479, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted1480) - } - 3 => { - let lifted1487 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1482 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1481 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @retry.PolicyNode::PolicyIntersect((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } - Option::Some(lifted1481) - } - _ => panic() - } - - let lifted1484 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1483 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2595.push(lifted2594) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) - Option::Some(lifted1483) - } - _ => panic() - } - - let lifted1486 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1485 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1485) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1482, - max: lifted1484, - unit: lifted1486, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted1487) - } - 4 => { - let lifted1494 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1489 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1488 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::SetRetryPolicy(SetRetryPolicyParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, policy : @retry.NamedRetryPolicy::{name : result2527, priority : (mbt_ffi_load32((iter_base) + 40)).reinterpret_as_uint(), predicate : @retry.RetryPredicate::{nodes : array2559}, policy : @retry.RetryPolicy::{nodes : array2595}}}) } + 40 => { - Option::Some(lifted1488) - } - _ => panic() - } - - let lifted1491 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1490 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2597 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) - Option::Some(lifted1490) - } - _ => panic() - } - - let lifted1493 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1492 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1492) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1489, - max: lifted1491, - unit: lifted1493, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted1494) - } - 5 => { - let lifted1501 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1496 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1495 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::RemoveRetryPolicy(RemoveRetryPolicyParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, name : result2597}) } + 41 => { - Option::Some(lifted1495) - } - _ => panic() - } - - let lifted1498 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1497 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2598 = match (mbt_ffi_load8_u((iter_base) + 32)) { + 0 => { - Option::Some(lifted1497) - } - _ => panic() - } - - let lifted1500 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1499 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1499) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1496, - max: lifted1498, - unit: lifted1500, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted1501) - } - 6 => { - let lifted1508 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1503 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1502 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + QueuedCardEvent::Install(QueuedCardEventInstall::{card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 48)).reinterpret_as_uint64()}}}) + } + 1 => { - Option::Some(lifted1502) - } - _ => panic() - } - - let lifted1505 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1504 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + QueuedCardEvent::Revoke(QueuedCardEventRevoke::{card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 48)).reinterpret_as_uint64()}}}) + } + _ => panic() + } - Option::Some(lifted1504) - } - _ => panic() - } - - let lifted1507 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1506 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1506) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1503, - max: lifted1505, - unit: lifted1507, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted1508) - } - 7 => { - let lifted1515 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1510 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1509 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::CardEventQueued(CardEventQueuedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, event : lifted2598}) } + 42 => { - Option::Some(lifted1509) - } - _ => panic() - } - - let lifted1512 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1511 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2599 : UInt64? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { - Option::Some(lifted1511) - } - _ => panic() - } - - let lifted1514 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1513 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1513) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1510, - max: lifted1512, - unit: lifted1514, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1515) - } - 8 => { - let lifted1522 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1517 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1516 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some((mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()) + } + _ => panic() + } - Option::Some(lifted1516) - } - _ => panic() - } - - let lifted1519 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1518 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::CardInstalled(CardInstalledParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, queued_event_index : lifted2599, card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 48)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()}}}) } + 43 => { - Option::Some(lifted1518) - } - _ => panic() - } - - let lifted1521 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1520 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1520) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1517, - max: lifted1519, - unit: lifted1521, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1522) - } - 9 => { - let lifted1529 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1524 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1523 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::CardInstallFailed(CardInstallFailedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, queued_event_index : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 48)).reinterpret_as_uint64()}}, reason : CardInstallFailure::from(mbt_ffi_load8_u((iter_base) + 56))}) } + 44 => { - Option::Some(lifted1523) - } - _ => panic() - } - - let lifted1526 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1525 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::CardRevoked(CardRevokedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, queued_event_index : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 48)).reinterpret_as_uint64()}}}) } + 45 => { - Option::Some(lifted1525) - } - _ => panic() - } - - let lifted1528 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1527 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1527) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1524, - max: lifted1526, - unit: lifted1528, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1529) - } - 10 => { - let lifted1536 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1531 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1530 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() + PublicOplogEntry::CardExpired(CardExpiredParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, card_id : @types.CardId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64()}}}) } + 46 => { - Option::Some(lifted1530) - } - _ => panic() - } - - let lifted1533 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1532 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2796 : Array[@types.SchemaTypeNode] = []; + for index2797 = 0; index2797 < (mbt_ffi_load32((iter_base) + 48)); index2797 = index2797 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 44)) + (index2797 * 144) - Option::Some(lifted1532) - } - _ => panic() - } - - let lifted1535 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1534 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1534) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1531, - max: lifted1533, - unit: lifted1535, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1536) - } - 11 => { - let lifted1543 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1538 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1537 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2782 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - Option::Some(lifted1537) - } - _ => panic() - } - - let lifted1540 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1539 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { - Option::Some(lifted1539) - } - _ => panic() - } - - let lifted1542 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1541 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1541) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1538, - max: lifted1540, - unit: lifted1542, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted1543) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array1558 : Array[@types.NamedFieldType] = [] - for index1559 = 0 - index1559 < mbt_ffi_load32(iter_base + 12) - index1559 = index1559 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1559 * 68 - - let result1544 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1546 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1545 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1545) - } - _ => panic() - } + @types.SchemaTypeBody::BoolType + } + 2 => { - let array1548 : Array[String] = [] - for index1549 = 0 - index1549 < mbt_ffi_load32(iter_base + 28) - index1549 = index1549 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1549 * 8 + let lifted2606 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let result1547 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2601 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - array1548.push(result1547) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let lifted2600 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let array1551 : Array[String] = [] - for index1552 = 0 - index1552 < mbt_ffi_load32(iter_base + 36) - index1552 = index1552 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1552 * 8 + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let result1550 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - array1551.push(result1550) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted1554 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result1553 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result1553) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted1557 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted1556 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1555 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + Option::Some(lifted2600) + } + _ => panic() + } - @types.Role::Other(result1555) - } - _ => panic() - } + let lifted2603 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - Option::Some(lifted1556) - } - _ => panic() - } + let lifted2602 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - array1558.push(@types.NamedFieldType::{ - name: result1544, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted1546, - aliases: array1548, - examples: array1551, - deprecated: lifted1554, - role: lifted1557, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array1558) - } - 15 => { - let array1575 : Array[@types.VariantCaseType] = [] - for index1576 = 0 - index1576 < mbt_ffi_load32(iter_base + 12) - index1576 = index1576 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1576 * 72 - - let result1560 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1561 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - let lifted1563 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1562 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1562) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - let array1565 : Array[String] = [] - for index1566 = 0 - index1566 < mbt_ffi_load32(iter_base + 32) - index1566 = index1566 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1566 * 8 + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let result1564 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(lifted2602) + } + _ => panic() + } - array1565.push(result1564) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let lifted2605 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let array1568 : Array[String] = [] - for index1569 = 0 - index1569 < mbt_ffi_load32(iter_base + 40) - index1569 = index1569 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1569 * 8 + let result2604 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let result1567 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(result2604) + } + _ => panic() + } - array1568.push(result1567) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted1571 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result1570 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result1570) - } - _ => panic() - } + Option::Some(@types.NumericRestrictions::{min : lifted2601, max : lifted2603, unit : lifted2605}) + } + _ => panic() + } - let lifted1574 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted1573 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1572 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + @types.SchemaTypeBody::S8Type(lifted2606) + } + 3 => { - @types.Role::Other(result1572) - } - _ => panic() - } + let lifted2613 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted1573) - } - _ => panic() - } + let lifted2608 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - array1575.push(@types.VariantCaseType::{ - name: result1560, - payload: lifted1561, - metadata: @types.MetadataEnvelope::{ - doc: lifted1563, - aliases: array1565, - examples: array1568, - deprecated: lifted1571, - role: lifted1574, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array1575) - } - 16 => { - let array1578 : Array[String] = [] - for index1579 = 0 - index1579 < mbt_ffi_load32(iter_base + 12) - index1579 = index1579 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1579 * 8 - - let result1577 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1578.push(result1577) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array1578) - } - 17 => { - let array1581 : Array[String] = [] - for index1582 = 0 - index1582 < mbt_ffi_load32(iter_base + 12) - index1582 = index1582 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1582 * 8 - - let result1580 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1581.push(result1580) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array1581) - } - 18 => { - let array1583 : Array[Int] = [] - for index1584 = 0 - index1584 < mbt_ffi_load32(iter_base + 12) - index1584 = index1584 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1584 * 4 - - array1583.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array1583) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted1585 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted1586 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted1585, - err: lifted1586, - }) - } - 24 => { - let lifted1590 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1588 : Array[String] = [] - for index1589 = 0 - index1589 < mbt_ffi_load32(iter_base + 16) - index1589 = index1589 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1589 * 8 - - let result1587 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1588.push(result1587) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1588) - } - _ => panic() - } - - let lifted1591 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1592 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1594 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1593 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1593) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted1590, - min_length: lifted1591, - max_length: lifted1592, - regex: lifted1594, - }) - } - 25 => { - let lifted1598 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1596 : Array[String] = [] - for index1597 = 0 - index1597 < mbt_ffi_load32(iter_base + 16) - index1597 = index1597 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1597 * 8 - - let result1595 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1596.push(result1595) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1596) - } - _ => panic() - } - - let lifted1599 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1600 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted1598, - min_bytes: lifted1599, - max_bytes: lifted1600, - }) - } - 26 => { - let lifted1604 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array1602 : Array[String] = [] - for index1603 = 0 - index1603 < mbt_ffi_load32(iter_base + 20) - index1603 = index1603 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1603 * 8 - - let result1601 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1602.push(result1601) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array1602) - } - _ => panic() - } - - let lifted1608 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array1606 : Array[String] = [] - for index1607 = 0 - index1607 < mbt_ffi_load32(iter_base + 32) - index1607 = index1607 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1607 * 8 - - let result1605 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1606.push(result1605) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array1606) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted1604, - allowed_extensions: lifted1608, - }) - } - 27 => { - let lifted1612 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1610 : Array[String] = [] - for index1611 = 0 - index1611 < mbt_ffi_load32(iter_base + 16) - index1611 = index1611 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1611 * 8 - - let result1609 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1610.push(result1609) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1610) - } - _ => panic() - } - - let lifted1616 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array1614 : Array[String] = [] - for index1615 = 0 - index1615 < mbt_ffi_load32(iter_base + 28) - index1615 = index1615 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1615 * 8 - - let result1613 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1614.push(result1613) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array1614) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted1612, - allowed_hosts: lifted1616, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result1617 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array1619 : Array[String] = [] - for index1620 = 0 - index1620 < mbt_ffi_load32(iter_base + 20) - index1620 = index1620 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1620 * 8 - - let result1618 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1619.push(result1618) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted1622 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1621 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result1621, - }) - } - _ => panic() - } - - let lifted1624 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result1623 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result1623, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result1617, - allowed_suffixes: array1619, - min: lifted1622, - max: lifted1624, - }) - } - 31 => { - let array1648 : Array[@types.UnionBranch] = [] - for index1649 = 0 - index1649 < mbt_ffi_load32(iter_base + 12) - index1649 = index1649 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1649 * 92 - - let result1625 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1634 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result1626 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result1626) - } - 1 => { - let result1627 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result1627) - } - 2 => { - let result1628 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result1628) - } - 3 => { - let result1629 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result1629) - } - 4 => { - let result1630 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted1632 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1631 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let lifted2607 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - Option::Some(result1631) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result1630, - literal: lifted1632, - }) - } - 5 => { - let result1633 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result1633) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let lifted1636 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1635 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1635) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2607) + } + _ => panic() + } + + let lifted2610 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2609 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2609) + } + _ => panic() + } + + let lifted2612 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2611 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2611) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2608, max : lifted2610, unit : lifted2612}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted2613) + } + 4 => { + + let lifted2620 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2615 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2614 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2614) + } + _ => panic() + } + + let lifted2617 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2616 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2616) + } + _ => panic() + } + + let lifted2619 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2618 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2618) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2615, max : lifted2617, unit : lifted2619}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted2620) + } + 5 => { + + let lifted2627 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2622 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2621 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2621) + } + _ => panic() + } + + let lifted2624 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2623 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2623) + } + _ => panic() + } + + let lifted2626 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2625 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2625) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2622, max : lifted2624, unit : lifted2626}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted2627) + } + 6 => { + + let lifted2634 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2629 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2628 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2628) + } + _ => panic() + } + + let lifted2631 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2630 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2630) + } + _ => panic() + } + + let lifted2633 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2632 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2632) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2629, max : lifted2631, unit : lifted2633}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted2634) + } + 7 => { + + let lifted2641 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2636 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2635 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2635) + } + _ => panic() + } + + let lifted2638 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2637 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2637) + } + _ => panic() + } + + let lifted2640 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2639 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2639) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2636, max : lifted2638, unit : lifted2640}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted2641) + } + 8 => { + + let lifted2648 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2643 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2642 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2642) + } + _ => panic() + } + + let lifted2645 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2644 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2644) + } + _ => panic() + } + + let lifted2647 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2646 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2646) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2643, max : lifted2645, unit : lifted2647}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted2648) + } + 9 => { + + let lifted2655 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2650 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2649 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2649) + } + _ => panic() + } + + let lifted2652 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2651 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2651) + } + _ => panic() + } + + let lifted2654 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2653 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2653) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2650, max : lifted2652, unit : lifted2654}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted2655) + } + 10 => { + + let lifted2662 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted2657 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted2656 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2656) + } + _ => panic() + } + + let lifted2659 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted2658 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted2658) + } + _ => panic() + } + + let lifted2661 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result2660 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result2660) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted2657, max : lifted2659, unit : lifted2661}) + } + _ => panic() + } - let array1638 : Array[String] = [] - for index1639 = 0 - index1639 < mbt_ffi_load32(iter_base + 52) - index1639 = index1639 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1639 * 8 + @types.SchemaTypeBody::F32Type(lifted2662) + } + 11 => { - let result1637 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2669 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - array1638.push(result1637) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let lifted2664 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let array1641 : Array[String] = [] - for index1642 = 0 - index1642 < mbt_ffi_load32(iter_base + 60) - index1642 = index1642 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1642 * 8 + let lifted2663 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let result1640 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - array1641.push(result1640) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted1644 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1643 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1643) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - let lifted1647 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted1646 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1645 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - @types.Role::Other(result1645) - } - _ => panic() - } + Option::Some(lifted2663) + } + _ => panic() + } - Option::Some(lifted1646) - } - _ => panic() - } + let lifted2666 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - array1648.push(@types.UnionBranch::{ - tag: result1625, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted1634, - metadata: @types.MetadataEnvelope::{ - doc: lifted1636, - aliases: array1638, - examples: array1641, - deprecated: lifted1644, - role: lifted1647, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array1648, - }) - } - 32 => { - let lifted1651 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1650 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1650) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted1651, - }) - } - 33 => { - let lifted1653 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1652 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1652) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted1653, - }) - } - 34 => { - let lifted1654 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted1654) - } - 35 => { - let lifted1655 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted1655) - } - _ => panic() - } + let lifted2665 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let lifted1658 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result1657 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result1657) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - let array1660 : Array[String] = [] - for index1661 = 0 - index1661 < mbt_ffi_load32(iter_base + 104) - index1661 = index1661 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index1661 * 8 + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - let result1659 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - array1660.push(result1659) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + Option::Some(lifted2665) + } + _ => panic() + } - let array1663 : Array[String] = [] - for index1664 = 0 - index1664 < mbt_ffi_load32(iter_base + 112) - index1664 = index1664 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index1664 * 8 + let lifted2668 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let result1662 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2667 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - array1663.push(result1662) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted1666 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result1665 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result1665) - } - _ => panic() - } + Option::Some(result2667) + } + _ => panic() + } - let lifted1669 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted1668 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1667 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result1667) - } - _ => panic() - } + Option::Some(@types.NumericRestrictions::{min : lifted2664, max : lifted2666, unit : lifted2668}) + } + _ => panic() + } - Option::Some(lifted1668) - } - _ => panic() - } + @types.SchemaTypeBody::F64Type(lifted2669) + } + 12 => { - array1670.push(@types.SchemaTypeNode::{ - body: lifted1656, - metadata: @types.MetadataEnvelope::{ - doc: lifted1658, - aliases: array1660, - examples: array1663, - deprecated: lifted1666, - role: lifted1669, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array1675 : Array[@types.SchemaTypeDef] = [] - for index1676 = 0 - index1676 < mbt_ffi_load32(iter_base + 48) - index1676 = index1676 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + - index1676 * 24 - - let result1672 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1674 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1673 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1673) - } - _ => panic() - } + @types.SchemaTypeBody::CharType + } + 13 => { - array1675.push(@types.SchemaTypeDef::{ - id: result1672, - name: lifted1674, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - let array1706 : Array[@types.SchemaValueNode] = [] - for index1707 = 0 - index1707 < mbt_ffi_load32(iter_base + 60) - index1707 = index1707 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1707 * 32 - - let lifted1705 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result1677 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result1677) - } - 13 => { - let array1678 : Array[Int] = [] - for index1679 = 0 - index1679 < mbt_ffi_load32(iter_base + 12) - index1679 = index1679 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1679 * 4 - - array1678.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array1678) - } - 14 => { - let lifted1680 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted1680, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1681 : Array[Bool] = [] - for index1682 = 0 - index1682 < mbt_ffi_load32(iter_base + 12) - index1682 = index1682 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1682 * 1 - - array1681.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1681) - } - 17 => { - let array1683 : Array[Int] = [] - for index1684 = 0 - index1684 < mbt_ffi_load32(iter_base + 12) - index1684 = index1684 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1684 * 4 - - array1683.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array1683) - } - 18 => { - let array1685 : Array[Int] = [] - for index1686 = 0 - index1686 < mbt_ffi_load32(iter_base + 12) - index1686 = index1686 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1686 * 4 - - array1685.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array1685) - } - 19 => { - let array1687 : Array[Int] = [] - for index1688 = 0 - index1688 < mbt_ffi_load32(iter_base + 12) - index1688 = index1688 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1688 * 4 - - array1687.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array1687) - } - 20 => { - let array1689 : Array[@types.MapEntry] = [] - for index1690 = 0 - index1690 < mbt_ffi_load32(iter_base + 12) - index1690 = index1690 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1690 * 8 - - array1689.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array1689) - } - 21 => { - let lifted1691 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted1691) - } - 22 => { - let lifted1694 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted1692 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted1692) - } - 1 => { - let lifted1693 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted1693) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted1694) - } - 23 => { - let result1695 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1697 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1696 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1696) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result1695, - language: lifted1697, - }) - } - 24 => { - let result1698 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1700 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1699 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1699) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result1698, - mime_type: lifted1700, - }) - } - 25 => { - let result1701 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result1701) - } - 26 => { - let result1702 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result1702) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result1703 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result1703, - }) - } - 30 => { - let result1704 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result1704, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @types.SchemaTypeBody::StringType + } + 14 => { - array1706.push(lifted1705) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - AgentInvocationResult::AgentInitialization(AgentInvocationOutputParameters::{ - output: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array1670, - defs: array1675, - root: mbt_ffi_load32(iter_base + 52), - }, - value: @types.SchemaValueTree::{ - value_nodes: array1706, - root: mbt_ffi_load32(iter_base + 64), - }, - }, - }) - } - 1 => { - let array1904 : Array[@types.SchemaTypeNode] = [] - for index1905 = 0 - index1905 < mbt_ffi_load32(iter_base + 40) - index1905 = index1905 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1905 * 144 - - let lifted1890 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted1714 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1709 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1708 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2684 : Array[@types.NamedFieldType] = []; + for index2685 = 0; index2685 < (mbt_ffi_load32((iter_base) + 12)); index2685 = index2685 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2685 * 68) - Option::Some(lifted1708) - } - _ => panic() - } - - let lifted1711 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1710 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2670 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1710) - } - _ => panic() - } - - let lifted1713 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1712 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1712) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1709, - max: lifted1711, - unit: lifted1713, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted1714) - } - 3 => { - let lifted1721 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1716 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1715 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2672 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted1715) - } - _ => panic() - } - - let lifted1718 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1717 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2671 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted1717) - } - _ => panic() - } - - let lifted1720 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1719 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1719) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1716, - max: lifted1718, - unit: lifted1720, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted1721) - } - 4 => { - let lifted1728 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1723 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1722 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2671) + } + _ => panic() + } - Option::Some(lifted1722) - } - _ => panic() - } - - let lifted1725 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1724 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2674 : Array[String] = []; + for index2675 = 0; index2675 < (mbt_ffi_load32((iter_base) + 28)); index2675 = index2675 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2675 * 8) - Option::Some(lifted1724) - } - _ => panic() - } - - let lifted1727 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1726 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1726) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1723, - max: lifted1725, - unit: lifted1727, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted1728) - } - 5 => { - let lifted1735 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1730 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1729 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2673 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1729) - } - _ => panic() - } - - let lifted1732 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1731 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2674.push(result2673) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - Option::Some(lifted1731) - } - _ => panic() - } - - let lifted1734 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1733 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1733) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1730, - max: lifted1732, - unit: lifted1734, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted1735) - } - 6 => { - let lifted1742 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1737 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1736 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2677 : Array[String] = []; + for index2678 = 0; index2678 < (mbt_ffi_load32((iter_base) + 36)); index2678 = index2678 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index2678 * 8) - Option::Some(lifted1736) - } - _ => panic() - } - - let lifted1739 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1738 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2676 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1738) - } - _ => panic() - } - - let lifted1741 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1740 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1740) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1737, - max: lifted1739, - unit: lifted1741, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted1742) - } - 7 => { - let lifted1749 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1744 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1743 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2677.push(result2676) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - Option::Some(lifted1743) - } - _ => panic() - } - - let lifted1746 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1745 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2680 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - Option::Some(lifted1745) - } - _ => panic() - } - - let lifted1748 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1747 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1747) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1744, - max: lifted1746, - unit: lifted1748, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1749) - } - 8 => { - let lifted1756 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1751 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1750 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2679 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - Option::Some(lifted1750) - } - _ => panic() - } - - let lifted1753 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1752 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2679) + } + _ => panic() + } - Option::Some(lifted1752) - } - _ => panic() - } - - let lifted1755 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1754 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1754) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1751, - max: lifted1753, - unit: lifted1755, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted1756) - } - 9 => { - let lifted1763 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1758 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1757 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2683 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { - Option::Some(lifted1757) - } - _ => panic() - } - - let lifted1760 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1759 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2682 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { - Option::Some(lifted1759) - } - _ => panic() - } - - let lifted1762 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1761 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1761) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1758, - max: lifted1760, - unit: lifted1762, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted1763) - } - 10 => { - let lifted1770 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1765 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1764 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - Option::Some(lifted1764) - } - _ => panic() - } - - let lifted1767 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1766 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - Option::Some(lifted1766) - } - _ => panic() - } - - let lifted1769 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1768 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1768) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1765, - max: lifted1767, - unit: lifted1769, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted1770) - } - 11 => { - let lifted1777 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1772 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1771 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - Option::Some(lifted1771) - } - _ => panic() - } - - let lifted1774 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1773 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2681 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - Option::Some(lifted1773) - } - _ => panic() - } - - let lifted1776 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1775 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1775) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1772, - max: lifted1774, - unit: lifted1776, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted1777) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array1792 : Array[@types.NamedFieldType] = [] - for index1793 = 0 - index1793 < mbt_ffi_load32(iter_base + 12) - index1793 = index1793 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1793 * 68 - - let result1778 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1780 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1779 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1779) - } - _ => panic() - } + @types.Role::Other(result2681) + } + _ => panic() + } - let array1782 : Array[String] = [] - for index1783 = 0 - index1783 < mbt_ffi_load32(iter_base + 28) - index1783 = index1783 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1783 * 8 + Option::Some(lifted2682) + } + _ => panic() + } - let result1781 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2684.push(@types.NamedFieldType::{name : result2670, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted2672, aliases : array2674, examples : array2677, deprecated : lifted2680, role : lifted2683}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - array1782.push(result1781) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @types.SchemaTypeBody::RecordType(array2684) + } + 15 => { - let array1785 : Array[String] = [] - for index1786 = 0 - index1786 < mbt_ffi_load32(iter_base + 36) - index1786 = index1786 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index1786 * 8 + let array2701 : Array[@types.VariantCaseType] = []; + for index2702 = 0; index2702 < (mbt_ffi_load32((iter_base) + 12)); index2702 = index2702 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2702 * 72) - let result1784 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2686 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array1785.push(result1784) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted1788 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result1787 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result1787) - } - _ => panic() - } + let lifted2687 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted1791 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted1790 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1789 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - @types.Role::Other(result1789) - } - _ => panic() - } + let lifted2689 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted1790) - } - _ => panic() - } + let result2688 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - array1792.push(@types.NamedFieldType::{ - name: result1778, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted1780, - aliases: array1782, - examples: array1785, - deprecated: lifted1788, - role: lifted1791, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array1792) - } - 15 => { - let array1809 : Array[@types.VariantCaseType] = [] - for index1810 = 0 - index1810 < mbt_ffi_load32(iter_base + 12) - index1810 = index1810 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1810 * 72 - - let result1794 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1795 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + Option::Some(result2688) + } + _ => panic() + } - let lifted1797 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1796 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1796) - } - _ => panic() - } + let array2691 : Array[String] = []; + for index2692 = 0; index2692 < (mbt_ffi_load32((iter_base) + 32)); index2692 = index2692 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2692 * 8) - let array1799 : Array[String] = [] - for index1800 = 0 - index1800 < mbt_ffi_load32(iter_base + 32) - index1800 = index1800 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1800 * 8 + let result2690 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result1798 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2691.push(result2690) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - array1799.push(result1798) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let array2694 : Array[String] = []; + for index2695 = 0; index2695 < (mbt_ffi_load32((iter_base) + 40)); index2695 = index2695 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index2695 * 8) - let array1802 : Array[String] = [] - for index1803 = 0 - index1803 < mbt_ffi_load32(iter_base + 40) - index1803 = index1803 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index1803 * 8 + let result2693 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result1801 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2694.push(result2693) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - array1802.push(result1801) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted1805 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result1804 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result1804) - } - _ => panic() - } + let lifted2697 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { - let lifted1808 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted1807 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1806 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let result2696 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - @types.Role::Other(result1806) - } - _ => panic() - } + Option::Some(result2696) + } + _ => panic() + } - Option::Some(lifted1807) - } - _ => panic() - } + let lifted2700 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - array1809.push(@types.VariantCaseType::{ - name: result1794, - payload: lifted1795, - metadata: @types.MetadataEnvelope::{ - doc: lifted1797, - aliases: array1799, - examples: array1802, - deprecated: lifted1805, - role: lifted1808, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array1809) - } - 16 => { - let array1812 : Array[String] = [] - for index1813 = 0 - index1813 < mbt_ffi_load32(iter_base + 12) - index1813 = index1813 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1813 * 8 - - let result1811 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1812.push(result1811) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array1812) - } - 17 => { - let array1815 : Array[String] = [] - for index1816 = 0 - index1816 < mbt_ffi_load32(iter_base + 12) - index1816 = index1816 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1816 * 8 - - let result1814 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1815.push(result1814) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array1815) - } - 18 => { - let array1817 : Array[Int] = [] - for index1818 = 0 - index1818 < mbt_ffi_load32(iter_base + 12) - index1818 = index1818 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1818 * 4 - - array1817.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array1817) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted1819 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted1820 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted1819, - err: lifted1820, - }) - } - 24 => { - let lifted1824 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1822 : Array[String] = [] - for index1823 = 0 - index1823 < mbt_ffi_load32(iter_base + 16) - index1823 = index1823 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1823 * 8 - - let result1821 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1822.push(result1821) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1822) - } - _ => panic() - } - - let lifted1825 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1826 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1828 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1827 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1827) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted1824, - min_length: lifted1825, - max_length: lifted1826, - regex: lifted1828, - }) - } - 25 => { - let lifted1832 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1830 : Array[String] = [] - for index1831 = 0 - index1831 < mbt_ffi_load32(iter_base + 16) - index1831 = index1831 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1831 * 8 - - let result1829 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1830.push(result1829) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1830) - } - _ => panic() - } - - let lifted1833 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted1834 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted1832, - min_bytes: lifted1833, - max_bytes: lifted1834, - }) - } - 26 => { - let lifted1838 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array1836 : Array[String] = [] - for index1837 = 0 - index1837 < mbt_ffi_load32(iter_base + 20) - index1837 = index1837 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1837 * 8 - - let result1835 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1836.push(result1835) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array1836) - } - _ => panic() - } - - let lifted1842 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array1840 : Array[String] = [] - for index1841 = 0 - index1841 < mbt_ffi_load32(iter_base + 32) - index1841 = index1841 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index1841 * 8 - - let result1839 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1840.push(result1839) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array1840) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted1838, - allowed_extensions: lifted1842, - }) - } - 27 => { - let lifted1846 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array1844 : Array[String] = [] - for index1845 = 0 - index1845 < mbt_ffi_load32(iter_base + 16) - index1845 = index1845 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index1845 * 8 - - let result1843 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1844.push(result1843) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array1844) - } - _ => panic() - } - - let lifted1850 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array1848 : Array[String] = [] - for index1849 = 0 - index1849 < mbt_ffi_load32(iter_base + 28) - index1849 = index1849 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index1849 * 8 - - let result1847 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1848.push(result1847) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array1848) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted1846, - allowed_hosts: lifted1850, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result1851 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array1853 : Array[String] = [] - for index1854 = 0 - index1854 < mbt_ffi_load32(iter_base + 20) - index1854 = index1854 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index1854 * 8 - - let result1852 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array1853.push(result1852) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted1856 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1855 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result1855, - }) - } - _ => panic() - } - - let lifted1858 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result1857 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result1857, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result1851, - allowed_suffixes: array1853, - min: lifted1856, - max: lifted1858, - }) - } - 31 => { - let array1882 : Array[@types.UnionBranch] = [] - for index1883 = 0 - index1883 < mbt_ffi_load32(iter_base + 12) - index1883 = index1883 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1883 * 92 - - let result1859 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1868 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result1860 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result1860) - } - 1 => { - let result1861 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result1861) - } - 2 => { - let result1862 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result1862) - } - 3 => { - let result1863 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result1863) - } - 4 => { - let result1864 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted1866 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result1865 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let lifted2699 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { - Option::Some(result1865) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result1864, - literal: lifted1866, - }) - } - 5 => { - let result1867 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result1867) - } - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - let lifted1870 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1869 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1869) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - let array1872 : Array[String] = [] - for index1873 = 0 - index1873 < mbt_ffi_load32(iter_base + 52) - index1873 = index1873 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index1873 * 8 + @types.Role::UnstructuredBinary + } + 3 => { - let result1871 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2698 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) - array1872.push(result1871) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + @types.Role::Other(result2698) + } + _ => panic() + } - let array1875 : Array[String] = [] - for index1876 = 0 - index1876 < mbt_ffi_load32(iter_base + 60) - index1876 = index1876 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1876 * 8 + Option::Some(lifted2699) + } + _ => panic() + } - let result1874 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2701.push(@types.VariantCaseType::{name : result2686, payload : lifted2687, metadata : @types.MetadataEnvelope::{doc : lifted2689, aliases : array2691, examples : array2694, deprecated : lifted2697, role : lifted2700}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - array1875.push(result1874) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted1878 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1877 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1877) - } - _ => panic() - } + @types.SchemaTypeBody::VariantType(array2701) + } + 16 => { - let lifted1881 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted1880 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1879 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + let array2704 : Array[String] = []; + for index2705 = 0; index2705 < (mbt_ffi_load32((iter_base) + 12)); index2705 = index2705 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2705 * 8) - @types.Role::Other(result1879) - } - _ => panic() - } + let result2703 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1880) - } - _ => panic() - } + array2704.push(result2703) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - array1882.push(@types.UnionBranch::{ - tag: result1859, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted1868, - metadata: @types.MetadataEnvelope::{ - doc: lifted1870, - aliases: array1872, - examples: array1875, - deprecated: lifted1878, - role: lifted1881, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array1882, - }) - } - 32 => { - let lifted1885 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result1884 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result1884) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted1885, - }) - } - 33 => { - let lifted1887 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1886 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1886) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted1887, - }) - } - 34 => { - let lifted1888 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted1888) - } - 35 => { - let lifted1889 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted1889) - } - _ => panic() - } + @types.SchemaTypeBody::EnumType(array2704) + } + 17 => { - let lifted1892 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result1891 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result1891) - } - _ => panic() - } + let array2707 : Array[String] = []; + for index2708 = 0; index2708 < (mbt_ffi_load32((iter_base) + 12)); index2708 = index2708 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2708 * 8) - let array1894 : Array[String] = [] - for index1895 = 0 - index1895 < mbt_ffi_load32(iter_base + 104) - index1895 = index1895 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index1895 * 8 + let result2706 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result1893 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2707.push(result2706) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - array1894.push(result1893) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + @types.SchemaTypeBody::FlagsType(array2707) + } + 18 => { - let array1897 : Array[String] = [] - for index1898 = 0 - index1898 < mbt_ffi_load32(iter_base + 112) - index1898 = index1898 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index1898 * 8 + let array2709 : Array[Int] = []; + for index2710 = 0; index2710 < (mbt_ffi_load32((iter_base) + 12)); index2710 = index2710 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2710 * 4) - let result1896 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2709.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - array1897.push(result1896) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted1900 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result1899 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result1899) - } - _ => panic() - } + @types.SchemaTypeBody::TupleType(array2709) + } + 19 => { - let lifted1903 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted1902 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result1901 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result1901) - } - _ => panic() - } + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { - Option::Some(lifted1902) - } - _ => panic() - } + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { - array1904.push(@types.SchemaTypeNode::{ - body: lifted1890, - metadata: @types.MetadataEnvelope::{ - doc: lifted1892, - aliases: array1894, - examples: array1897, - deprecated: lifted1900, - role: lifted1903, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let array1909 : Array[@types.SchemaTypeDef] = [] - for index1910 = 0 - index1910 < mbt_ffi_load32(iter_base + 48) - index1910 = index1910 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + - index1910 * 24 - - let result1906 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted1908 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result1907 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result1907) - } - _ => panic() - } + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { - array1909.push(@types.SchemaTypeDef::{ - id: result1906, - name: lifted1908, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - let array1940 : Array[@types.SchemaValueNode] = [] - for index1941 = 0 - index1941 < mbt_ffi_load32(iter_base + 60) - index1941 = index1941 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1941 * 32 - - let lifted1939 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result1911 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result1911) - } - 13 => { - let array1912 : Array[Int] = [] - for index1913 = 0 - index1913 < mbt_ffi_load32(iter_base + 12) - index1913 = index1913 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1913 * 4 - - array1912.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array1912) - } - 14 => { - let lifted1914 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted1914, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array1915 : Array[Bool] = [] - for index1916 = 0 - index1916 < mbt_ffi_load32(iter_base + 12) - index1916 = index1916 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1916 * 1 - - array1915.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array1915) - } - 17 => { - let array1917 : Array[Int] = [] - for index1918 = 0 - index1918 < mbt_ffi_load32(iter_base + 12) - index1918 = index1918 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1918 * 4 - - array1917.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array1917) - } - 18 => { - let array1919 : Array[Int] = [] - for index1920 = 0 - index1920 < mbt_ffi_load32(iter_base + 12) - index1920 = index1920 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1920 * 4 - - array1919.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array1919) - } - 19 => { - let array1921 : Array[Int] = [] - for index1922 = 0 - index1922 < mbt_ffi_load32(iter_base + 12) - index1922 = index1922 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1922 * 4 - - array1921.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array1921) - } - 20 => { - let array1923 : Array[@types.MapEntry] = [] - for index1924 = 0 - index1924 < mbt_ffi_load32(iter_base + 12) - index1924 = index1924 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1924 * 8 - - array1923.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array1923) - } - 21 => { - let lifted1925 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted1925) - } - 22 => { - let lifted1928 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted1926 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted1926) - } - 1 => { - let lifted1927 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted1927) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted1928) - } - 23 => { - let result1929 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1931 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1930 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1930) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result1929, - language: lifted1931, - }) - } - 24 => { - let result1932 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted1934 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result1933 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result1933) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result1932, - mime_type: lifted1934, - }) - } - 25 => { - let result1935 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result1935) - } - 26 => { - let result1936 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result1936) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result1937 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result1937, - }) - } - 30 => { - let result1938 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result1938, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { - array1940.push(lifted1939) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - AgentInvocationResult::AgentMethod(AgentInvocationOutputParameters::{ - output: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array1904, - defs: array1909, - root: mbt_ffi_load32(iter_base + 52), - }, - value: @types.SchemaValueTree::{ - value_nodes: array1940, - root: mbt_ffi_load32(iter_base + 64), - }, - }, - }) - } - 2 => AgentInvocationResult::ManualUpdate - 3 => { - let lifted1943 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1942 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1942) - } - _ => panic() - } - - AgentInvocationResult::LoadSnapshot(FallibleResultParameters::{ - error: lifted1943, - }) - } - 4 => { - let result1944 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - let result1945 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - AgentInvocationResult::SaveSnapshot(SaveSnapshotResultParameters::{ - snapshot: SnapshotData::{ - data: result1944, - mime_type: result1945, - }, - }) - } - 5 => { - let lifted1947 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result1946 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result1946) - } - _ => panic() - } - - AgentInvocationResult::ProcessOplogEntries(FallibleResultParameters::{ - error: lifted1947, - }) - } - _ => panic() - } + let lifted2711 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted1950 : String? = match mbt_ffi_load8_u(iter_base + 68) { - 0 => Option::None - 1 => { - let result1949 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 72), - mbt_ffi_load32(iter_base + 76), - ) - - Option::Some(result1949) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - PublicOplogEntry::AgentInvocationFinished(AgentInvocationFinishedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - result: lifted1948, - method_name: lifted1950, - consumed_fuel: mbt_ffi_load64(iter_base + 80), - component_revision: mbt_ffi_load64(iter_base + 88).reinterpret_as_uint64(), - }) - } - 6 => - PublicOplogEntry::Suspend(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }) - 7 => { - let result1951 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let lifted1955 : RetryPolicyState? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let array1953 : Array[StateNode] = [] - for index1954 = 0 - index1954 < mbt_ffi_load32(iter_base + 60) - index1954 = index1954 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index1954 * 16 - - let lifted1952 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - StateNode::Counter( - mbt_ffi_load32(iter_base + 4).reinterpret_as_uint(), - ) - 1 => StateNode::Terminal - 2 => StateNode::Wrapper(mbt_ffi_load32(iter_base + 4)) - 3 => - StateNode::CountBox(CountBoxState::{ - attempts: mbt_ffi_load32(iter_base + 4).reinterpret_as_uint(), - inner: mbt_ffi_load32(iter_base + 8), - }) - 4 => - StateNode::AndThen(AndThenState::{ - left: mbt_ffi_load32(iter_base + 4), - right: mbt_ffi_load32(iter_base + 8), - on_right: mbt_ffi_load8_u(iter_base + 12) != 0, - }) - 5 => - StateNode::Pair(PairState::{ - left: mbt_ffi_load32(iter_base + 4), - right: mbt_ffi_load32(iter_base + 8), - }) - _ => panic() - } + let lifted2712 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - array1953.push(lifted1952) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } - Option::Some(RetryPolicyState::{ nodes: array1953 }) - } - _ => panic() - } + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted2711, err : lifted2712}) + } + 24 => { - PublicOplogEntry::Error(ErrorParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - error: result1951, - retry_from: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - inside_atomic_region: mbt_ffi_load8_u(iter_base + 48) != 0, - retry_policy_state: lifted1955, - }) - } - 8 => - PublicOplogEntry::NoOp(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }) - 9 => - PublicOplogEntry::Jump(JumpParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - jump: OplogRegion::{ - start: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - end: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }) - 10 => - PublicOplogEntry::Interrupted(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }) - 11 => - PublicOplogEntry::Exited(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }) - 12 => - PublicOplogEntry::BeginAtomicRegion(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }) - 13 => - PublicOplogEntry::EndAtomicRegion(EndAtomicRegionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }) - 14 => { - let lifted2468 = match mbt_ffi_load8_u(iter_base + 32) { - 0 => { - let result1956 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let array2153 : Array[@types.SchemaTypeNode] = [] - for index2154 = 0 - index2154 < mbt_ffi_load32(iter_base + 52) - index2154 = index2154 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2154 * 144 - - let lifted2139 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted1963 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1958 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1957 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2716 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted1957) - } - _ => panic() - } - - let lifted1960 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1959 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2714 : Array[String] = []; + for index2715 = 0; index2715 < (mbt_ffi_load32((iter_base) + 16)); index2715 = index2715 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2715 * 8) - Option::Some(lifted1959) - } - _ => panic() - } - - let lifted1962 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1961 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1961) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1958, - max: lifted1960, - unit: lifted1962, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted1963) - } - 3 => { - let lifted1970 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1965 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1964 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2713 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted1964) - } - _ => panic() - } - - let lifted1967 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1966 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2714.push(result2713) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted1966) - } - _ => panic() - } - - let lifted1969 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1968 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1968) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1965, - max: lifted1967, - unit: lifted1969, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted1970) - } - 4 => { - let lifted1977 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1972 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1971 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(array2714) + } + _ => panic() + } - Option::Some(lifted1971) - } - _ => panic() - } - - let lifted1974 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1973 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2717 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - Option::Some(lifted1973) - } - _ => panic() - } - - let lifted1976 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1975 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1975) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1972, - max: lifted1974, - unit: lifted1976, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted1977) - } - 5 => { - let lifted1984 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1979 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1978 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - Option::Some(lifted1978) - } - _ => panic() - } - - let lifted1981 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1980 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2718 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - Option::Some(lifted1980) - } - _ => panic() - } - - let lifted1983 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1982 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1982) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1979, - max: lifted1981, - unit: lifted1983, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted1984) - } - 6 => { - let lifted1991 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1986 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1985 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - Option::Some(lifted1985) - } - _ => panic() - } - - let lifted1988 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1987 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2720 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - Option::Some(lifted1987) - } - _ => panic() - } - - let lifted1990 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1989 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1989) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1986, - max: lifted1988, - unit: lifted1990, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted1991) - } - 7 => { - let lifted1998 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted1993 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1992 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2719 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(lifted1992) - } - _ => panic() - } - - let lifted1995 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1994 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2719) + } + _ => panic() + } - Option::Some(lifted1994) - } - _ => panic() - } - - let lifted1997 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result1996 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result1996) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted1993, - max: lifted1995, - unit: lifted1997, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted1998) - } - 8 => { - let lifted2005 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2000 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted1999 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted2716, min_length : lifted2717, max_length : lifted2718, regex : lifted2720}) + } + 25 => { - Option::Some(lifted1999) - } - _ => panic() - } - - let lifted2002 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2001 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2724 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted2001) - } - _ => panic() - } - - let lifted2004 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2003 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2003) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2000, - max: lifted2002, - unit: lifted2004, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted2005) - } - 9 => { - let lifted2012 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2007 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2006 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array2722 : Array[String] = []; + for index2723 = 0; index2723 < (mbt_ffi_load32((iter_base) + 16)); index2723 = index2723 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2723 * 8) - Option::Some(lifted2006) - } - _ => panic() - } - - let lifted2009 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2008 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2721 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted2008) - } - _ => panic() - } - - let lifted2011 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2010 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2010) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2007, - max: lifted2009, - unit: lifted2011, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted2012) - } - 10 => { - let lifted2019 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2014 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2013 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array2722.push(result2721) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted2013) - } - _ => panic() - } - - let lifted2016 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2015 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(array2722) + } + _ => panic() + } - Option::Some(lifted2015) - } - _ => panic() - } - - let lifted2018 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2017 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2017) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2014, - max: lifted2016, - unit: lifted2018, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted2019) - } - 11 => { - let lifted2026 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2021 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2020 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2725 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - Option::Some(lifted2020) - } - _ => panic() - } - - let lifted2023 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2022 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - Option::Some(lifted2022) - } - _ => panic() - } - - let lifted2025 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2024 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2024) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2021, - max: lifted2023, - unit: lifted2025, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted2026) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array2041 : Array[@types.NamedFieldType] = [] - for index2042 = 0 - index2042 < mbt_ffi_load32(iter_base + 12) - index2042 = index2042 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2042 * 68 - - let result2027 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2029 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2028 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2028) - } - _ => panic() - } + let lifted2726 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - let array2031 : Array[String] = [] - for index2032 = 0 - index2032 < mbt_ffi_load32(iter_base + 28) - index2032 = index2032 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2032 * 8 + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - let result2030 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted2724, min_bytes : lifted2725, max_bytes : lifted2726}) + } + 26 => { - array2031.push(result2030) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let lifted2730 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let array2034 : Array[String] = [] - for index2035 = 0 - index2035 < mbt_ffi_load32(iter_base + 36) - index2035 = index2035 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index2035 * 8 + let array2728 : Array[String] = []; + for index2729 = 0; index2729 < (mbt_ffi_load32((iter_base) + 20)); index2729 = index2729 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2729 * 8) - let result2033 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2727 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array2034.push(result2033) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted2037 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result2036 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result2036) - } - _ => panic() - } + array2728.push(result2727) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let lifted2040 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted2039 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2038 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + Option::Some(array2728) + } + _ => panic() + } - @types.Role::Other(result2038) - } - _ => panic() - } + let lifted2734 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - Option::Some(lifted2039) - } - _ => panic() - } + let array2732 : Array[String] = []; + for index2733 = 0; index2733 < (mbt_ffi_load32((iter_base) + 32)); index2733 = index2733 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2733 * 8) + + let result2731 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2732.push(result2731) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array2732) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted2730, allowed_extensions : lifted2734}) + } + 27 => { + + let lifted2738 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array2736 : Array[String] = []; + for index2737 = 0; index2737 < (mbt_ffi_load32((iter_base) + 16)); index2737 = index2737 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index2737 * 8) + + let result2735 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2736.push(result2735) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array2736) + } + _ => panic() + } + + let lifted2742 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array2740 : Array[String] = []; + for index2741 = 0; index2741 < (mbt_ffi_load32((iter_base) + 28)); index2741 = index2741 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index2741 * 8) + + let result2739 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2740.push(result2739) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array2740) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted2738, allowed_hosts : lifted2742}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result2743 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array2745 : Array[String] = []; + for index2746 = 0; index2746 < (mbt_ffi_load32((iter_base) + 20)); index2746 = index2746 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index2746 * 8) + + let result2744 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array2745.push(result2744) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted2748 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - array2041.push(@types.NamedFieldType::{ - name: result2027, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted2029, - aliases: array2031, - examples: array2034, - deprecated: lifted2037, - role: lifted2040, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array2041) - } - 15 => { - let array2058 : Array[@types.VariantCaseType] = [] - for index2059 = 0 - index2059 < mbt_ffi_load32(iter_base + 12) - index2059 = index2059 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2059 * 72 - - let result2043 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2044 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result2747 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - let lifted2046 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2045 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2045) - } - _ => panic() - } + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result2747}) + } + _ => panic() + } - let array2048 : Array[String] = [] - for index2049 = 0 - index2049 < mbt_ffi_load32(iter_base + 32) - index2049 = index2049 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2049 * 8 + let lifted2750 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - let result2047 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2749 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - array2048.push(result2047) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result2749}) + } + _ => panic() + } - let array2051 : Array[String] = [] - for index2052 = 0 - index2052 < mbt_ffi_load32(iter_base + 40) - index2052 = index2052 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index2052 * 8 + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result2743, allowed_suffixes : array2745, min : lifted2748, max : lifted2750}) + } + 31 => { - let result2050 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array2774 : Array[@types.UnionBranch] = []; + for index2775 = 0; index2775 < (mbt_ffi_load32((iter_base) + 12)); index2775 = index2775 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2775 * 92) - array2051.push(result2050) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted2054 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result2053 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result2053) - } - _ => panic() - } + let result2751 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted2057 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted2056 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2055 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let lifted2760 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { - @types.Role::Other(result2055) - } - _ => panic() - } + let result2752 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted2056) - } - _ => panic() - } + @types.DiscriminatorRule::Prefix(result2752) + } + 1 => { - array2058.push(@types.VariantCaseType::{ - name: result2043, - payload: lifted2044, - metadata: @types.MetadataEnvelope::{ - doc: lifted2046, - aliases: array2048, - examples: array2051, - deprecated: lifted2054, - role: lifted2057, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array2058) - } - 16 => { - let array2061 : Array[String] = [] - for index2062 = 0 - index2062 < mbt_ffi_load32(iter_base + 12) - index2062 = index2062 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2062 * 8 - - let result2060 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2061.push(result2060) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array2061) - } - 17 => { - let array2064 : Array[String] = [] - for index2065 = 0 - index2065 < mbt_ffi_load32(iter_base + 12) - index2065 = index2065 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2065 * 8 - - let result2063 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2064.push(result2063) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array2064) - } - 18 => { - let array2066 : Array[Int] = [] - for index2067 = 0 - index2067 < mbt_ffi_load32(iter_base + 12) - index2067 = index2067 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2067 * 4 - - array2066.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array2066) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted2068 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted2069 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted2068, - err: lifted2069, - }) - } - 24 => { - let lifted2073 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2071 : Array[String] = [] - for index2072 = 0 - index2072 < mbt_ffi_load32(iter_base + 16) - index2072 = index2072 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2072 * 8 - - let result2070 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2071.push(result2070) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2071) - } - _ => panic() - } - - let lifted2074 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2075 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2077 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2076 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2076) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted2073, - min_length: lifted2074, - max_length: lifted2075, - regex: lifted2077, - }) - } - 25 => { - let lifted2081 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2079 : Array[String] = [] - for index2080 = 0 - index2080 < mbt_ffi_load32(iter_base + 16) - index2080 = index2080 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2080 * 8 - - let result2078 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2079.push(result2078) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2079) - } - _ => panic() - } - - let lifted2082 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2083 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted2081, - min_bytes: lifted2082, - max_bytes: lifted2083, - }) - } - 26 => { - let lifted2087 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array2085 : Array[String] = [] - for index2086 = 0 - index2086 < mbt_ffi_load32(iter_base + 20) - index2086 = index2086 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2086 * 8 - - let result2084 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2085.push(result2084) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array2085) - } - _ => panic() - } - - let lifted2091 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array2089 : Array[String] = [] - for index2090 = 0 - index2090 < mbt_ffi_load32(iter_base + 32) - index2090 = index2090 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2090 * 8 - - let result2088 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2089.push(result2088) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array2089) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted2087, - allowed_extensions: lifted2091, - }) - } - 27 => { - let lifted2095 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2093 : Array[String] = [] - for index2094 = 0 - index2094 < mbt_ffi_load32(iter_base + 16) - index2094 = index2094 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2094 * 8 - - let result2092 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2093.push(result2092) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2093) - } - _ => panic() - } - - let lifted2099 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array2097 : Array[String] = [] - for index2098 = 0 - index2098 < mbt_ffi_load32(iter_base + 28) - index2098 = index2098 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2098 * 8 - - let result2096 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2097.push(result2096) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array2097) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted2095, - allowed_hosts: lifted2099, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result2100 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2102 : Array[String] = [] - for index2103 = 0 - index2103 < mbt_ffi_load32(iter_base + 20) - index2103 = index2103 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2103 * 8 - - let result2101 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2102.push(result2101) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted2105 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2104 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result2104, - }) - } - _ => panic() - } - - let lifted2107 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result2106 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result2106, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result2100, - allowed_suffixes: array2102, - min: lifted2105, - max: lifted2107, - }) - } - 31 => { - let array2131 : Array[@types.UnionBranch] = [] - for index2132 = 0 - index2132 < mbt_ffi_load32(iter_base + 12) - index2132 = index2132 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2132 * 92 - - let result2108 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2117 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result2109 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result2109) - } - 1 => { - let result2110 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result2110) - } - 2 => { - let result2111 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result2111) - } - 3 => { - let result2112 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result2112) - } - 4 => { - let result2113 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted2115 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2114 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let result2753 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(result2114) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result2113, - literal: lifted2115, - }) - } - 5 => { - let result2116 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result2116) - } - _ => panic() - } + @types.DiscriminatorRule::Suffix(result2753) + } + 2 => { - let lifted2119 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2118 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2118) - } - _ => panic() - } + let result2754 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let array2121 : Array[String] = [] - for index2122 = 0 - index2122 < mbt_ffi_load32(iter_base + 52) - index2122 = index2122 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2122 * 8 + @types.DiscriminatorRule::Contains(result2754) + } + 3 => { - let result2120 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2755 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - array2121.push(result2120) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + @types.DiscriminatorRule::Regex(result2755) + } + 4 => { - let array2124 : Array[String] = [] - for index2125 = 0 - index2125 < mbt_ffi_load32(iter_base + 60) - index2125 = index2125 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2125 * 8 + let result2756 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let result2123 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2758 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - array2124.push(result2123) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted2127 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2126 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2126) - } - _ => panic() - } + let result2757 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - let lifted2130 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted2129 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2128 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + Option::Some(result2757) + } + _ => panic() + } - @types.Role::Other(result2128) - } - _ => panic() - } + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result2756, literal : lifted2758}) + } + 5 => { - Option::Some(lifted2129) - } - _ => panic() - } + let result2759 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - array2131.push(@types.UnionBranch::{ - tag: result2108, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted2117, - metadata: @types.MetadataEnvelope::{ - doc: lifted2119, - aliases: array2121, - examples: array2124, - deprecated: lifted2127, - role: lifted2130, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array2131, - }) - } - 32 => { - let lifted2134 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2133 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2133) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted2134, - }) - } - 33 => { - let lifted2136 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2135 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2135) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted2136, - }) - } - 34 => { - let lifted2137 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted2137) - } - 35 => { - let lifted2138 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted2138) - } - _ => panic() - } + @types.DiscriminatorRule::FieldAbsent(result2759) + } + _ => panic() + } - let lifted2141 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result2140 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result2140) - } - _ => panic() - } + let lifted2762 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - let array2143 : Array[String] = [] - for index2144 = 0 - index2144 < mbt_ffi_load32(iter_base + 104) - index2144 = index2144 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index2144 * 8 + let result2761 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - let result2142 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(result2761) + } + _ => panic() + } - array2143.push(result2142) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let array2764 : Array[String] = []; + for index2765 = 0; index2765 < (mbt_ffi_load32((iter_base) + 52)); index2765 = index2765 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index2765 * 8) - let array2146 : Array[String] = [] - for index2147 = 0 - index2147 < mbt_ffi_load32(iter_base + 112) - index2147 = index2147 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index2147 * 8 + let result2763 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result2145 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array2764.push(result2763) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - array2146.push(result2145) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted2149 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result2148 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result2148) - } - _ => panic() - } + let array2767 : Array[String] = []; + for index2768 = 0; index2768 < (mbt_ffi_load32((iter_base) + 60)); index2768 = index2768 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index2768 * 8) - let lifted2152 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted2151 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result2150) - } - _ => panic() - } + let result2766 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted2151) - } - _ => panic() - } + array2767.push(result2766) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - array2153.push(@types.SchemaTypeNode::{ - body: lifted2139, - metadata: @types.MetadataEnvelope::{ - doc: lifted2141, - aliases: array2143, - examples: array2146, - deprecated: lifted2149, - role: lifted2152, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array2158 : Array[@types.SchemaTypeDef] = [] - for index2159 = 0 - index2159 < mbt_ffi_load32(iter_base + 60) - index2159 = index2159 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2159 * 24 - - let result2155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2157 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2156 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2156) - } - _ => panic() - } + let lifted2770 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - array2158.push(@types.SchemaTypeDef::{ - id: result2155, - name: lifted2157, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let array2189 : Array[@types.SchemaValueNode] = [] - for index2190 = 0 - index2190 < mbt_ffi_load32(iter_base + 72) - index2190 = index2190 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + - index2190 * 32 - - let lifted2188 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result2160 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result2160) - } - 13 => { - let array2161 : Array[Int] = [] - for index2162 = 0 - index2162 < mbt_ffi_load32(iter_base + 12) - index2162 = index2162 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2162 * 4 - - array2161.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array2161) - } - 14 => { - let lifted2163 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted2163, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array2164 : Array[Bool] = [] - for index2165 = 0 - index2165 < mbt_ffi_load32(iter_base + 12) - index2165 = index2165 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2165 * 1 - - array2164.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array2164) - } - 17 => { - let array2166 : Array[Int] = [] - for index2167 = 0 - index2167 < mbt_ffi_load32(iter_base + 12) - index2167 = index2167 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2167 * 4 - - array2166.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array2166) - } - 18 => { - let array2168 : Array[Int] = [] - for index2169 = 0 - index2169 < mbt_ffi_load32(iter_base + 12) - index2169 = index2169 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2169 * 4 - - array2168.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array2168) - } - 19 => { - let array2170 : Array[Int] = [] - for index2171 = 0 - index2171 < mbt_ffi_load32(iter_base + 12) - index2171 = index2171 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2171 * 4 - - array2170.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array2170) - } - 20 => { - let array2172 : Array[@types.MapEntry] = [] - for index2173 = 0 - index2173 < mbt_ffi_load32(iter_base + 12) - index2173 = index2173 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2173 * 8 - - array2172.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array2172) - } - 21 => { - let lifted2174 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted2174) - } - 22 => { - let lifted2177 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted2175 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted2175) - } - 1 => { - let lifted2176 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted2176) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted2177) - } - 23 => { - let result2178 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2180 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2179 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2179) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result2178, - language: lifted2180, - }) - } - 24 => { - let result2181 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2183 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2182 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2182) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result2181, - mime_type: lifted2183, - }) - } - 25 => { - let result2184 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result2184) - } - 26 => { - let result2185 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result2185) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result2186 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result2186, - }) - } - 30 => { - let result2187 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result2187, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + let result2769 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - array2189.push(lifted2188) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - let result2191 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 80), - mbt_ffi_load32(iter_base + 84), - ) - - let array2193 : Array[String] = [] - for index2194 = 0 - index2194 < mbt_ffi_load32(iter_base + 92) - index2194 = index2194 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 88) + index2194 * 8 - - let result2192 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2193.push(result2192) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 88)) - - let array2208 : Array[Array[SpanData]] = [] - for index2209 = 0 - index2209 < mbt_ffi_load32(iter_base + 100) - index2209 = index2209 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 96) + index2209 * 8 - - let array2206 : Array[SpanData] = [] - for index2207 = 0 - index2207 < mbt_ffi_load32(iter_base + 4) - index2207 = index2207 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index2207 * 80 - - let lifted2205 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2195 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2197 : String? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result2196 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result2196) - } - _ => panic() - } + Option::Some(result2769) + } + _ => panic() + } - let lifted2198 : UInt64? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2773 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - let array2202 : Array[@context.Attribute] = [] - for index2203 = 0 - index2203 < mbt_ffi_load32(iter_base + 68) - index2203 = index2203 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index2203 * 20 - - let result2199 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2201 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result2200 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result2200) - } - _ => panic() - } - - array2202.push(@context.Attribute::{ - key: result2199, - value: lifted2201, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - SpanData::LocalSpan(LocalSpanData::{ - span_id: result2195, - start: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent: lifted2197, - linked_context: lifted2198, - attributes: array2202, - inherited: mbt_ffi_load8_u(iter_base + 72) != 0, - }) - } - 1 => { - let result2204 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - SpanData::ExternalSpan(ExternalSpanData::{ - span_id: result2204, - }) - } - _ => panic() - } - - array2206.push(lifted2205) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array2208.push(array2206) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 96)) - - AgentInvocation::AgentInitialization(AgentInitializationParameters::{ - idempotency_key: result1956, - constructor_parameters: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array2153, - defs: array2158, - root: mbt_ffi_load32(iter_base + 64), - }, - value: @types.SchemaValueTree::{ - value_nodes: array2189, - root: mbt_ffi_load32(iter_base + 76), - }, - }, - trace_id: result2191, - trace_states: array2193, - invocation_context: array2208, - }) - } - 1 => { - let result2210 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let result2211 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - let array2408 : Array[@types.SchemaTypeNode] = [] - for index2409 = 0 - index2409 < mbt_ffi_load32(iter_base + 60) - index2409 = index2409 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2409 * 144 - - let lifted2394 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted2218 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2213 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2212 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2772 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { - Option::Some(lifted2212) - } - _ => panic() - } - - let lifted2215 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2214 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - Option::Some(lifted2214) - } - _ => panic() - } - - let lifted2217 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2216 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2216) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2213, - max: lifted2215, - unit: lifted2217, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted2218) - } - 3 => { - let lifted2225 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2220 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2219 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - Option::Some(lifted2219) - } - _ => panic() - } - - let lifted2222 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2221 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - Option::Some(lifted2221) - } - _ => panic() - } - - let lifted2224 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2223 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2223) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2220, - max: lifted2222, - unit: lifted2224, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted2225) - } - 4 => { - let lifted2232 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2227 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2226 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2771 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - Option::Some(lifted2226) - } - _ => panic() - } - - let lifted2229 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2228 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Other(result2771) + } + _ => panic() + } - Option::Some(lifted2228) - } - _ => panic() - } - - let lifted2231 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2230 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2230) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2227, - max: lifted2229, - unit: lifted2231, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted2232) - } - 5 => { - let lifted2239 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2234 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2233 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted2772) + } + _ => panic() + } - Option::Some(lifted2233) - } - _ => panic() - } - - let lifted2236 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2235 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array2774.push(@types.UnionBranch::{tag : result2751, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted2760, metadata : @types.MetadataEnvelope::{doc : lifted2762, aliases : array2764, examples : array2767, deprecated : lifted2770, role : lifted2773}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted2235) - } - _ => panic() - } - - let lifted2238 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2237 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2237) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2234, - max: lifted2236, - unit: lifted2238, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted2239) - } - 6 => { - let lifted2246 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2241 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2240 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array2774}) + } + 32 => { - Option::Some(lifted2240) - } - _ => panic() - } - - let lifted2243 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2242 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2777 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted2242) - } - _ => panic() - } - - let lifted2245 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2244 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2244) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2241, - max: lifted2243, - unit: lifted2245, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted2246) - } - 7 => { - let lifted2253 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2248 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2247 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2776 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(lifted2247) - } - _ => panic() - } - - let lifted2250 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2249 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2776) + } + _ => panic() + } - Option::Some(lifted2249) - } - _ => panic() - } - - let lifted2252 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2251 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2251) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2248, - max: lifted2250, - unit: lifted2252, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted2253) - } - 8 => { - let lifted2260 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2255 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2254 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted2777}) + } + 33 => { - Option::Some(lifted2254) - } - _ => panic() - } - - let lifted2257 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2256 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2779 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted2256) - } - _ => panic() - } - - let lifted2259 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2258 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2258) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2255, - max: lifted2257, - unit: lifted2259, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted2260) - } - 9 => { - let lifted2267 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2262 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2261 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result2778 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - Option::Some(lifted2261) - } - _ => panic() - } - - let lifted2264 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2263 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(result2778) + } + _ => panic() + } - Option::Some(lifted2263) - } - _ => panic() - } - - let lifted2266 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2265 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2265) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2262, - max: lifted2264, - unit: lifted2266, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted2267) - } - 10 => { - let lifted2274 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2269 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2268 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted2779}) + } + 34 => { - Option::Some(lifted2268) - } - _ => panic() - } - - let lifted2271 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2270 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - Option::Some(lifted2270) - } - _ => panic() - } - - let lifted2273 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2272 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2272) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2269, - max: lifted2271, - unit: lifted2273, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted2274) - } - 11 => { - let lifted2281 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2276 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2275 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted2780 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(lifted2275) - } - _ => panic() - } - - let lifted2278 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2277 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted2277) - } - _ => panic() - } - - let lifted2280 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2279 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2279) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2276, - max: lifted2278, - unit: lifted2280, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted2281) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array2296 : Array[@types.NamedFieldType] = [] - for index2297 = 0 - index2297 < mbt_ffi_load32(iter_base + 12) - index2297 = index2297 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2297 * 68 - - let result2282 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2284 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2283 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2283) - } - _ => panic() - } + @types.SchemaTypeBody::FutureType(lifted2780) + } + 36 => { - let array2286 : Array[String] = [] - for index2287 = 0 - index2287 < mbt_ffi_load32(iter_base + 28) - index2287 = index2287 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2287 * 8 + let lifted2781 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let result2285 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - array2286.push(result2285) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @types.SchemaTypeBody::StreamType(lifted2781) + } + _ => panic() + } - let array2289 : Array[String] = [] - for index2290 = 0 - index2290 < mbt_ffi_load32(iter_base + 36) - index2290 = index2290 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index2290 * 8 + let lifted2784 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { - let result2288 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2783 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - array2289.push(result2288) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted2292 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result2291 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result2291) - } - _ => panic() - } + Option::Some(result2783) + } + _ => panic() + } - let lifted2295 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted2294 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2293 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + let array2786 : Array[String] = []; + for index2787 = 0; index2787 < (mbt_ffi_load32((iter_base) + 104)); index2787 = index2787 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index2787 * 8) - @types.Role::Other(result2293) - } - _ => panic() - } + let result2785 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted2294) - } - _ => panic() - } + array2786.push(result2785) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - array2296.push(@types.NamedFieldType::{ - name: result2282, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted2284, - aliases: array2286, - examples: array2289, - deprecated: lifted2292, - role: lifted2295, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array2296) - } - 15 => { - let array2313 : Array[@types.VariantCaseType] = [] - for index2314 = 0 - index2314 < mbt_ffi_load32(iter_base + 12) - index2314 = index2314 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2314 * 72 - - let result2298 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2299 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let array2789 : Array[String] = []; + for index2790 = 0; index2790 < (mbt_ffi_load32((iter_base) + 112)); index2790 = index2790 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index2790 * 8) - let lifted2301 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2300 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2300) - } - _ => panic() - } + let result2788 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array2303 : Array[String] = [] - for index2304 = 0 - index2304 < mbt_ffi_load32(iter_base + 32) - index2304 = index2304 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2304 * 8 + array2789.push(result2788) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - let result2302 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2792 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - array2303.push(result2302) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let result2791 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - let array2306 : Array[String] = [] - for index2307 = 0 - index2307 < mbt_ffi_load32(iter_base + 40) - index2307 = index2307 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index2307 * 8 + Option::Some(result2791) + } + _ => panic() + } - let result2305 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted2795 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - array2306.push(result2305) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted2309 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result2308 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result2308) - } - _ => panic() - } + let lifted2794 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - let lifted2312 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted2311 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2310 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + @types.Role::Multimodal + } + 1 => { - @types.Role::Other(result2310) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - Option::Some(lifted2311) - } - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - array2313.push(@types.VariantCaseType::{ - name: result2298, - payload: lifted2299, - metadata: @types.MetadataEnvelope::{ - doc: lifted2301, - aliases: array2303, - examples: array2306, - deprecated: lifted2309, - role: lifted2312, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array2313) - } - 16 => { - let array2316 : Array[String] = [] - for index2317 = 0 - index2317 < mbt_ffi_load32(iter_base + 12) - index2317 = index2317 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2317 * 8 - - let result2315 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2316.push(result2315) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array2316) - } - 17 => { - let array2319 : Array[String] = [] - for index2320 = 0 - index2320 < mbt_ffi_load32(iter_base + 12) - index2320 = index2320 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2320 * 8 - - let result2318 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2319.push(result2318) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array2319) - } - 18 => { - let array2321 : Array[Int] = [] - for index2322 = 0 - index2322 < mbt_ffi_load32(iter_base + 12) - index2322 = index2322 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2322 * 4 - - array2321.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array2321) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted2323 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted2324 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted2323, - err: lifted2324, - }) - } - 24 => { - let lifted2328 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2326 : Array[String] = [] - for index2327 = 0 - index2327 < mbt_ffi_load32(iter_base + 16) - index2327 = index2327 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2327 * 8 - - let result2325 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2326.push(result2325) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2326) - } - _ => panic() - } - - let lifted2329 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2330 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2332 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2331 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2331) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted2328, - min_length: lifted2329, - max_length: lifted2330, - regex: lifted2332, - }) - } - 25 => { - let lifted2336 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2334 : Array[String] = [] - for index2335 = 0 - index2335 < mbt_ffi_load32(iter_base + 16) - index2335 = index2335 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2335 * 8 - - let result2333 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2334.push(result2333) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2334) - } - _ => panic() - } - - let lifted2337 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted2338 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted2336, - min_bytes: lifted2337, - max_bytes: lifted2338, - }) - } - 26 => { - let lifted2342 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array2340 : Array[String] = [] - for index2341 = 0 - index2341 < mbt_ffi_load32(iter_base + 20) - index2341 = index2341 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2341 * 8 - - let result2339 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2340.push(result2339) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array2340) - } - _ => panic() - } - - let lifted2346 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array2344 : Array[String] = [] - for index2345 = 0 - index2345 < mbt_ffi_load32(iter_base + 32) - index2345 = index2345 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2345 * 8 - - let result2343 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2344.push(result2343) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array2344) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted2342, - allowed_extensions: lifted2346, - }) - } - 27 => { - let lifted2350 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2348 : Array[String] = [] - for index2349 = 0 - index2349 < mbt_ffi_load32(iter_base + 16) - index2349 = index2349 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2349 * 8 - - let result2347 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2348.push(result2347) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2348) - } - _ => panic() - } - - let lifted2354 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array2352 : Array[String] = [] - for index2353 = 0 - index2353 < mbt_ffi_load32(iter_base + 28) - index2353 = index2353 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2353 * 8 - - let result2351 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2352.push(result2351) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array2352) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted2350, - allowed_hosts: lifted2354, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result2355 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2357 : Array[String] = [] - for index2358 = 0 - index2358 < mbt_ffi_load32(iter_base + 20) - index2358 = index2358 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2358 * 8 - - let result2356 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2357.push(result2356) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted2360 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2359 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result2359, - }) - } - _ => panic() - } - - let lifted2362 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result2361 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result2361, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result2355, - allowed_suffixes: array2357, - min: lifted2360, - max: lifted2362, - }) - } - 31 => { - let array2386 : Array[@types.UnionBranch] = [] - for index2387 = 0 - index2387 < mbt_ffi_load32(iter_base + 12) - index2387 = index2387 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2387 * 92 - - let result2363 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2372 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result2364 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result2364) - } - 1 => { - let result2365 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result2365) - } - 2 => { - let result2366 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result2366) - } - 3 => { - let result2367 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result2367) - } - 4 => { - let result2368 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted2370 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2369 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let result2793 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - Option::Some(result2369) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result2368, - literal: lifted2370, - }) - } - 5 => { - let result2371 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result2371) - } - _ => panic() - } + @types.Role::Other(result2793) + } + _ => panic() + } - let lifted2374 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2373 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2373) - } - _ => panic() - } + Option::Some(lifted2794) + } + _ => panic() + } - let array2376 : Array[String] = [] - for index2377 = 0 - index2377 < mbt_ffi_load32(iter_base + 52) - index2377 = index2377 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2377 * 8 + array2796.push(@types.SchemaTypeNode::{body : lifted2782, metadata : @types.MetadataEnvelope::{doc : lifted2784, aliases : array2786, examples : array2789, deprecated : lifted2792, role : lifted2795}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - let result2375 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array2801 : Array[@types.SchemaTypeDef] = []; + for index2802 = 0; index2802 < (mbt_ffi_load32((iter_base) + 56)); index2802 = index2802 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 52)) + (index2802 * 24) - array2376.push(result2375) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let result2798 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array2379 : Array[String] = [] - for index2380 = 0 - index2380 < mbt_ffi_load32(iter_base + 60) - index2380 = index2380 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2380 * 8 + let lifted2800 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let result2378 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result2799 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - array2379.push(result2378) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted2382 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2381 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2381) - } - _ => panic() - } + Option::Some(result2799) + } + _ => panic() + } - let lifted2385 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted2384 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2383 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + array2801.push(@types.SchemaTypeDef::{id : result2798, name : lifted2800, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) - @types.Role::Other(result2383) - } - _ => panic() - } + let array2832 : Array[@types.SchemaValueNode] = []; + for index2833 = 0; index2833 < (mbt_ffi_load32((iter_base) + 68)); index2833 = index2833 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 64)) + (index2833 * 32) - Option::Some(lifted2384) - } - _ => panic() - } + let lifted2831 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - array2386.push(@types.UnionBranch::{ - tag: result2363, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted2372, - metadata: @types.MetadataEnvelope::{ - doc: lifted2374, - aliases: array2376, - examples: array2379, - deprecated: lifted2382, - role: lifted2385, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array2386, - }) - } - 32 => { - let lifted2389 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2388 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2388) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted2389, - }) - } - 33 => { - let lifted2391 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2390 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2390) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted2391, - }) - } - 34 => { - let lifted2392 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted2392) - } - 35 => { - let lifted2393 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted2393) - } - _ => panic() - } + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - let lifted2396 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result2395 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result2395) - } - _ => panic() - } + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - let array2398 : Array[String] = [] - for index2399 = 0 - index2399 < mbt_ffi_load32(iter_base + 104) - index2399 = index2399 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index2399 * 8 + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - let result2397 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - array2398.push(result2397) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - let array2401 : Array[String] = [] - for index2402 = 0 - index2402 < mbt_ffi_load32(iter_base + 112) - index2402 = index2402 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index2402 * 8 + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - let result2400 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - array2401.push(result2400) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted2404 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result2403 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result2403) - } - _ => panic() - } + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - let lifted2407 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted2406 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2405 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result2405) - } - _ => panic() - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - Option::Some(lifted2406) - } - _ => panic() - } + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - array2408.push(@types.SchemaTypeNode::{ - body: lifted2394, - metadata: @types.MetadataEnvelope::{ - doc: lifted2396, - aliases: array2398, - examples: array2401, - deprecated: lifted2404, - role: lifted2407, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let array2413 : Array[@types.SchemaTypeDef] = [] - for index2414 = 0 - index2414 < mbt_ffi_load32(iter_base + 68) - index2414 = index2414 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index2414 * 24 - - let result2410 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2412 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2411 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2411) - } - _ => panic() - } + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - array2413.push(@types.SchemaTypeDef::{ - id: result2410, - name: lifted2412, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - let array2444 : Array[@types.SchemaValueNode] = [] - for index2445 = 0 - index2445 < mbt_ffi_load32(iter_base + 80) - index2445 = index2445 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 76) + - index2445 * 32 - - let lifted2443 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result2415 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result2415) - } - 13 => { - let array2416 : Array[Int] = [] - for index2417 = 0 - index2417 < mbt_ffi_load32(iter_base + 12) - index2417 = index2417 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2417 * 4 - - array2416.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array2416) - } - 14 => { - let lifted2418 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted2418, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array2419 : Array[Bool] = [] - for index2420 = 0 - index2420 < mbt_ffi_load32(iter_base + 12) - index2420 = index2420 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2420 * 1 - - array2419.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array2419) - } - 17 => { - let array2421 : Array[Int] = [] - for index2422 = 0 - index2422 < mbt_ffi_load32(iter_base + 12) - index2422 = index2422 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2422 * 4 - - array2421.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array2421) - } - 18 => { - let array2423 : Array[Int] = [] - for index2424 = 0 - index2424 < mbt_ffi_load32(iter_base + 12) - index2424 = index2424 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2424 * 4 - - array2423.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array2423) - } - 19 => { - let array2425 : Array[Int] = [] - for index2426 = 0 - index2426 < mbt_ffi_load32(iter_base + 12) - index2426 = index2426 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2426 * 4 - - array2425.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array2425) - } - 20 => { - let array2427 : Array[@types.MapEntry] = [] - for index2428 = 0 - index2428 < mbt_ffi_load32(iter_base + 12) - index2428 = index2428 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2428 * 8 - - array2427.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array2427) - } - 21 => { - let lifted2429 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted2429) - } - 22 => { - let lifted2432 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted2430 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted2430) - } - 1 => { - let lifted2431 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted2431) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted2432) - } - 23 => { - let result2433 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2435 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2434 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2434) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result2433, - language: lifted2435, - }) - } - 24 => { - let result2436 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2438 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2437 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2437) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result2436, - mime_type: lifted2438, - }) - } - 25 => { - let result2439 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result2439) - } - 26 => { - let result2440 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result2440) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result2441 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result2441, - }) - } - 30 => { - let result2442 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result2442, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - array2444.push(lifted2443) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - - let result2446 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 88), - mbt_ffi_load32(iter_base + 92), - ) - - let array2448 : Array[String] = [] - for index2449 = 0 - index2449 < mbt_ffi_load32(iter_base + 100) - index2449 = index2449 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 96) + index2449 * 8 - - let result2447 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2448.push(result2447) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 96)) - - let array2463 : Array[Array[SpanData]] = [] - for index2464 = 0 - index2464 < mbt_ffi_load32(iter_base + 108) - index2464 = index2464 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 104) + - index2464 * 8 - - let array2461 : Array[SpanData] = [] - for index2462 = 0 - index2462 < mbt_ffi_load32(iter_base + 4) - index2462 = index2462 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index2462 * 80 - - let lifted2460 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2450 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2452 : String? = match - mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result2451 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result2451) - } - _ => panic() - } + let result2803 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let lifted2453 : UInt64? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::StringValue(result2803) + } + 13 => { - let array2457 : Array[@context.Attribute] = [] - for index2458 = 0 - index2458 < mbt_ffi_load32(iter_base + 68) - index2458 = index2458 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + - index2458 * 20 - - let result2454 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2456 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result2455 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result2455) - } - _ => panic() - } - - array2457.push(@context.Attribute::{ - key: result2454, - value: lifted2456, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - SpanData::LocalSpan(LocalSpanData::{ - span_id: result2450, - start: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent: lifted2452, - linked_context: lifted2453, - attributes: array2457, - inherited: mbt_ffi_load8_u(iter_base + 72) != 0, - }) - } - 1 => { - let result2459 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - SpanData::ExternalSpan(ExternalSpanData::{ - span_id: result2459, - }) - } - _ => panic() - } - - array2461.push(lifted2460) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array2463.push(array2461) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 104)) - - AgentInvocation::AgentMethodInvocation(AgentMethodInvocationParameters::{ - idempotency_key: result2210, - method_name: result2211, - function_input: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array2408, - defs: array2413, - root: mbt_ffi_load32(iter_base + 72), - }, - value: @types.SchemaValueTree::{ - value_nodes: array2444, - root: mbt_ffi_load32(iter_base + 84), - }, - }, - trace_id: result2446, - trace_states: array2448, - invocation_context: array2463, - }) - } - 2 => AgentInvocation::SaveSnapshot - 3 => { - let result2465 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let result2466 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - AgentInvocation::LoadSnapshot(LoadSnapshotParameters::{ - snapshot: SnapshotData::{ - data: result2465, - mime_type: result2466, - }, - }) - } - 4 => { - let result2467 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - AgentInvocation::ProcessOplogEntries(ProcessOplogEntriesParameters::{ - idempotency_key: result2467, - }) - } - 5 => - AgentInvocation::ManualUpdate(ManualUpdateParameters::{ - target_revision: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }) - _ => panic() - } + let array2804 : Array[Int] = []; + for index2805 = 0; index2805 < (mbt_ffi_load32((iter_base) + 12)); index2805 = index2805 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2805 * 4) - PublicOplogEntry::PendingAgentInvocation(PendingAgentInvocationParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - invocation: lifted2468, - }) - } - 15 => { - let lifted2471 = match mbt_ffi_load8_u(iter_base + 40) { - 0 => UpdateDescription::AutoUpdate - 1 => { - let result2469 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - let result2470 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - UpdateDescription::SnapshotBased(@host.Snapshot::{ - payload: result2469, - mime_type: result2470, - }) - } - _ => panic() - } + array2804.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - PublicOplogEntry::PendingUpdate(PendingUpdateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - target_revision: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - description: lifted2471, - }) - } - 16 => { - let array2478 : Array[PluginInstallationDescription] = [] - for index2479 = 0 - index2479 < mbt_ffi_load32(iter_base + 52) - index2479 = index2479 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index2479 * 48 - - let result2472 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - let result2473 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - let array2476 : Array[(String, String)] = [] - for index2477 = 0 - index2477 < mbt_ffi_load32(iter_base + 40) - index2477 = index2477 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index2477 * 16 - - let result2474 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2475 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array2476.push((result2474, result2475)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - array2478.push(PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 16), - plugin_name: result2472, - plugin_version: result2473, - parameters: array2476, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - PublicOplogEntry::SuccessfulUpdate(SuccessfulUpdateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - target_revision: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - new_component_size: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - new_active_plugins: array2478, - }) - } - 17 => { - let lifted2481 : String? = match mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result2480 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result2480) - } - _ => panic() - } + @types.SchemaValueNode::RecordValue(array2804) + } + 14 => { - PublicOplogEntry::FailedUpdate(FailedUpdateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - target_revision: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - details: lifted2481, - }) - } - 18 => - PublicOplogEntry::GrowMemory(GrowMemoryParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - delta: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }) - 19 => - PublicOplogEntry::FilesystemStorageUsageUpdate(FilesystemStorageUsageUpdateParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - delta: mbt_ffi_load64(iter_base + 32), - }) - 20 => { - let result2482 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let result2483 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - PublicOplogEntry::CreateResource(CreateResourceParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - id: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - name: result2482, - owner: result2483, - }) - } - 21 => { - let result2484 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let result2485 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - PublicOplogEntry::DropResource(DropResourceParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - id: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - name: result2484, - owner: result2485, - }) - } - 22 => { - let result2486 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - let result2487 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - PublicOplogEntry::Log(LogParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - level: LogLevel::from(mbt_ffi_load8_u(iter_base + 32)), - context: result2486, - message: result2487, - }) - } - 23 => - PublicOplogEntry::Restart(Timestamp::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }) - 24 => { - let result2488 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - let result2489 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - let array2492 : Array[(String, String)] = [] - for index2493 = 0 - index2493 < mbt_ffi_load32(iter_base + 72) - index2493 = index2493 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + index2493 * 16 - - let result2490 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2491 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array2492.push((result2490, result2491)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - PublicOplogEntry::ActivatePlugin(ActivatePluginParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - plugin: PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 48), - plugin_name: result2488, - plugin_version: result2489, - parameters: array2492, - }, - }) - } - 25 => { - let result2494 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - let result2495 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - let array2498 : Array[(String, String)] = [] - for index2499 = 0 - index2499 < mbt_ffi_load32(iter_base + 72) - index2499 = index2499 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + index2499 * 16 - - let result2496 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2497 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array2498.push((result2496, result2497)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - PublicOplogEntry::DeactivatePlugin(DeactivatePluginParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - plugin: PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 48), - plugin_name: result2494, - plugin_version: result2495, - parameters: array2498, - }, - }) - } - 26 => - PublicOplogEntry::Revert(RevertParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - dropped_region: OplogRegion::{ - start: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - end: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }) - 27 => { - let result2500 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - PublicOplogEntry::CancelPendingInvocation(CancelPendingInvocationParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - idempotency_key: result2500, - }) - } - 28 => { - let result2501 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let lifted2503 : String? = match mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result2502 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result2502) - } - _ => panic() - } + let lifted2806 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let lifted2505 : String? = match mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let result2504 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 56), - mbt_ffi_load32(iter_base + 60), - ) - - Option::Some(result2504) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let array2509 : Array[@context.Attribute] = [] - for index2510 = 0 - index2510 < mbt_ffi_load32(iter_base + 68) - index2510 = index2510 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + index2510 * 20 - - let result2506 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2508 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result2507 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - @context.AttributeValue::String(result2507) - } - _ => panic() - } - - array2509.push(@context.Attribute::{ - key: result2506, - value: lifted2508, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - PublicOplogEntry::StartSpan(StartSpanParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - span_id: result2501, - parent: lifted2503, - linked_context_id: lifted2505, - attributes: array2509, - }) - } - 29 => { - let result2511 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - PublicOplogEntry::FinishSpan(FinishSpanParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - span_id: result2511, - }) - } - 30 => { - let result2512 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result2513 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - let lifted2515 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => { - let result2514 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - @context.AttributeValue::String(result2514) - } - _ => panic() - } + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted2806}) + } + 15 => { - PublicOplogEntry::SetSpanAttribute(SetSpanAttributeParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - span_id: result2512, - key: result2513, - value: lifted2515, - }) - } - 31 => { - let lifted2516 = match mbt_ffi_load8_u(iter_base + 32) { - 0 => @host.PersistenceLevel::PersistNothing - 1 => @host.PersistenceLevel::PersistRemoteSideEffects - 2 => @host.PersistenceLevel::Smart - _ => panic() - } + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - PublicOplogEntry::ChangePersistenceLevel(ChangePersistenceLevelParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - persistence_level: lifted2516, - }) - } - 32 => { - let result2517 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - PublicOplogEntry::BeginRemoteTransaction(BeginRemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - transaction_id: result2517, - }) - } - 33 => - PublicOplogEntry::PreCommitRemoteTransaction(RemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }) - 34 => - PublicOplogEntry::PreRollbackRemoteTransaction(RemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }) - 35 => - PublicOplogEntry::CommittedRemoteTransaction(RemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }) - 36 => - PublicOplogEntry::RolledBackRemoteTransaction(RemoteTransactionParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - begin_index: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }) - 37 => { - let result2518 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let result2519 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - PublicOplogEntry::Snapshot(SnapshotParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - data: SnapshotData::{ data: result2518, mime_type: result2519 }, - }) - } - 38 => { - let result2520 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - let result2521 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - let array2524 : Array[(String, String)] = [] - for index2525 = 0 - index2525 < mbt_ffi_load32(iter_base + 72) - index2525 = index2525 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + index2525 * 16 - - let result2522 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result2523 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array2524.push((result2522, result2523)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - let result2526 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 96), - mbt_ffi_load32(iter_base + 100), - ) - - PublicOplogEntry::OplogProcessorCheckpoint(OplogProcessorCheckpointParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - plugin: PluginInstallationDescription::{ - environment_plugin_grant_id: EnvironmentPluginGrantId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - plugin_priority: mbt_ffi_load32(iter_base + 48), - plugin_name: result2520, - plugin_version: result2521, - parameters: array2524, - }, - target_agent_id: @types.AgentId::{ - component_id: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 80).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 88).reinterpret_as_uint64(), - }, - }, - agent_id: result2526, - }, - confirmed_up_to: mbt_ffi_load64(iter_base + 104).reinterpret_as_uint64(), - sending_up_to: mbt_ffi_load64(iter_base + 112).reinterpret_as_uint64(), - last_batch_start: mbt_ffi_load64(iter_base + 120).reinterpret_as_uint64(), - }) - } - 39 => { - let result2527 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array2559 : Array[@retry.PredicateNode] = [] - for index2560 = 0 - index2560 < mbt_ffi_load32(iter_base + 48) - index2560 = index2560 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + index2560 * 32 - - let lifted2558 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2528 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2530 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2529 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2529) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let array2807 : Array[Bool] = []; + for index2808 = 0; index2808 < (mbt_ffi_load32((iter_base) + 12)); index2808 = index2808 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2808 * 1) - @retry.PredicateNode::PropEq(@retry.PropertyComparison::{ - property_name: result2528, - value: lifted2530, - }) - } - 1 => { - let result2531 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2533 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2532 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2532) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + array2807.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @retry.PredicateNode::PropNeq(@retry.PropertyComparison::{ - property_name: result2531, - value: lifted2533, - }) - } - 2 => { - let result2534 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2536 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2535 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2535) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + @types.SchemaValueNode::FlagsValue(array2807) + } + 17 => { - @retry.PredicateNode::PropGt(@retry.PropertyComparison::{ - property_name: result2534, - value: lifted2536, - }) - } - 3 => { - let result2537 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2539 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2538 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2538) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let array2809 : Array[Int] = []; + for index2810 = 0; index2810 < (mbt_ffi_load32((iter_base) + 12)); index2810 = index2810 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2810 * 4) - @retry.PredicateNode::PropGte(@retry.PropertyComparison::{ - property_name: result2537, - value: lifted2539, - }) - } - 4 => { - let result2540 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2542 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2541 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2541) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + array2809.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @retry.PredicateNode::PropLt(@retry.PropertyComparison::{ - property_name: result2540, - value: lifted2542, - }) - } - 5 => { - let result2543 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2545 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2544 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2544) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + @types.SchemaValueNode::TupleValue(array2809) + } + 18 => { - @retry.PredicateNode::PropLte(@retry.PropertyComparison::{ - property_name: result2543, - value: lifted2545, - }) - } - 6 => { - let result2546 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @retry.PredicateNode::PropExists(result2546) - } - 7 => { - let result2547 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2550 : Array[@retry.PredicateValue] = [] - for index2551 = 0 - index2551 < mbt_ffi_load32(iter_base + 20) - index2551 = index2551 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2551 * 16 - - let lifted2549 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2548 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @retry.PredicateValue::Text(result2548) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 8), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - _ => panic() - } - - array2550.push(lifted2549) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - @retry.PredicateNode::PropIn(@retry.PropertySetCheck::{ - property_name: result2547, - values: array2550, - }) - } - 8 => { - let result2552 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result2553 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropMatches(@retry.PropertyPattern::{ - property_name: result2552, - pattern: result2553, - }) - } - 9 => { - let result2554 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result2555 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropStartsWith(@retry.PropertyPattern::{ - property_name: result2554, - pattern: result2555, - }) - } - 10 => { - let result2556 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result2557 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropContains(@retry.PropertyPattern::{ - property_name: result2556, - pattern: result2557, - }) - } - 11 => - @retry.PredicateNode::PredAnd( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 12 => - @retry.PredicateNode::PredOr( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 13 => - @retry.PredicateNode::PredNot(mbt_ffi_load32(iter_base + 8)) - 14 => @retry.PredicateNode::PredTrue - 15 => @retry.PredicateNode::PredFalse - _ => panic() - } - - array2559.push(lifted2558) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - let array2595 : Array[@retry.PolicyNode] = [] - for index2596 = 0 - index2596 < mbt_ffi_load32(iter_base + 56) - index2596 = index2596 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 52) + index2596 * 32 - - let lifted2594 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @retry.PolicyNode::Periodic( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 1 => - @retry.PolicyNode::Exponential(@retry.ExponentialConfig::{ - base_delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - factor: mbt_ffi_loadf64(iter_base + 16), - }) - 2 => - @retry.PolicyNode::Fibonacci(@retry.FibonacciConfig::{ - first: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - second: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - }) - 3 => @retry.PolicyNode::Immediate - 4 => @retry.PolicyNode::Never - 5 => - @retry.PolicyNode::CountBox(@retry.CountBoxConfig::{ - max_retries: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - inner: mbt_ffi_load32(iter_base + 12), - }) - 6 => - @retry.PolicyNode::TimeBox(@retry.TimeBoxConfig::{ - limit: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 16), - }) - 7 => - @retry.PolicyNode::ClampDelay(@retry.ClampConfig::{ - min_delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - max_delay: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 24), - }) - 8 => - @retry.PolicyNode::AddDelay(@retry.AddDelayConfig::{ - delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 16), - }) - 9 => - @retry.PolicyNode::Jitter(@retry.JitterConfig::{ - factor: mbt_ffi_loadf64(iter_base + 8), - inner: mbt_ffi_load32(iter_base + 16), - }) - 10 => { - let array2592 : Array[@retry.PredicateNode] = [] - for index2593 = 0 - index2593 < mbt_ffi_load32(iter_base + 12) - index2593 = index2593 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2593 * 32 - - let lifted2591 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2561 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2563 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2562 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2562) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let array2811 : Array[Int] = []; + for index2812 = 0; index2812 < (mbt_ffi_load32((iter_base) + 12)); index2812 = index2812 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2812 * 4) - @retry.PredicateNode::PropEq(@retry.PropertyComparison::{ - property_name: result2561, - value: lifted2563, - }) - } - 1 => { - let result2564 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2566 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2565 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2565) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + array2811.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @retry.PredicateNode::PropNeq(@retry.PropertyComparison::{ - property_name: result2564, - value: lifted2566, - }) - } - 2 => { - let result2567 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2569 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2568 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2568) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + @types.SchemaValueNode::ListValue(array2811) + } + 19 => { - @retry.PredicateNode::PropGt(@retry.PropertyComparison::{ - property_name: result2567, - value: lifted2569, - }) - } - 3 => { - let result2570 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2572 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2571 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2571) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let array2813 : Array[Int] = []; + for index2814 = 0; index2814 < (mbt_ffi_load32((iter_base) + 12)); index2814 = index2814 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2814 * 4) - @retry.PredicateNode::PropGte(@retry.PropertyComparison::{ - property_name: result2570, - value: lifted2572, - }) - } - 4 => { - let result2573 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2575 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2574 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2574) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + array2813.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @retry.PredicateNode::PropLt(@retry.PropertyComparison::{ - property_name: result2573, - value: lifted2575, - }) - } - 5 => { - let result2576 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2578 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result2577 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - @retry.PredicateValue::Text(result2577) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 24), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + @types.SchemaValueNode::FixedListValue(array2813) + } + 20 => { - @retry.PredicateNode::PropLte(@retry.PropertyComparison::{ - property_name: result2576, - value: lifted2578, - }) - } - 6 => { - let result2579 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @retry.PredicateNode::PropExists(result2579) - } - 7 => { - let result2580 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2583 : Array[@retry.PredicateValue] = [] - for index2584 = 0 - index2584 < mbt_ffi_load32(iter_base + 20) - index2584 = index2584 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2584 * 16 - - let lifted2582 = match - mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result2581 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @retry.PredicateValue::Text(result2581) - } - 1 => - @retry.PredicateValue::Integer( - mbt_ffi_load64(iter_base + 8), - ) - 2 => - @retry.PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - _ => panic() - } - - array2583.push(lifted2582) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - @retry.PredicateNode::PropIn(@retry.PropertySetCheck::{ - property_name: result2580, - values: array2583, - }) - } - 8 => { - let result2585 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result2586 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropMatches(@retry.PropertyPattern::{ - property_name: result2585, - pattern: result2586, - }) - } - 9 => { - let result2587 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result2588 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropStartsWith(@retry.PropertyPattern::{ - property_name: result2587, - pattern: result2588, - }) - } - 10 => { - let result2589 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result2590 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @retry.PredicateNode::PropContains(@retry.PropertyPattern::{ - property_name: result2589, - pattern: result2590, - }) - } - 11 => - @retry.PredicateNode::PredAnd( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 12 => - @retry.PredicateNode::PredOr( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 13 => - @retry.PredicateNode::PredNot( - mbt_ffi_load32(iter_base + 8), - ) - 14 => @retry.PredicateNode::PredTrue - 15 => @retry.PredicateNode::PredFalse - _ => panic() - } - - array2592.push(lifted2591) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @retry.PolicyNode::FilteredOn(@retry.FilteredConfig::{ - predicate: @retry.RetryPredicate::{ nodes: array2592 }, - inner: mbt_ffi_load32(iter_base + 16), - }) - } - 11 => - @retry.PolicyNode::AndThen( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 12 => - @retry.PolicyNode::PolicyUnion( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 13 => - @retry.PolicyNode::PolicyIntersect( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - _ => panic() - } - - array2595.push(lifted2594) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - - PublicOplogEntry::SetRetryPolicy(SetRetryPolicyParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - policy: @retry.NamedRetryPolicy::{ - name: result2527, - priority: mbt_ffi_load32(iter_base + 40).reinterpret_as_uint(), - predicate: @retry.RetryPredicate::{ nodes: array2559 }, - policy: @retry.RetryPolicy::{ nodes: array2595 }, - }, - }) - } - 40 => { - let result2597 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - PublicOplogEntry::RemoveRetryPolicy(RemoveRetryPolicyParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - name: result2597, - }) - } - 41 => { - let lifted2598 = match mbt_ffi_load8_u(iter_base + 32) { - 0 => - QueuedCardEvent::Install(QueuedCardEventInstall::{ - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 48).reinterpret_as_uint64(), - }, - }, - }) - 1 => - QueuedCardEvent::Revoke(QueuedCardEventRevoke::{ - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 48).reinterpret_as_uint64(), - }, - }, - }) - _ => panic() - } + let array2815 : Array[@types.MapEntry] = []; + for index2816 = 0; index2816 < (mbt_ffi_load32((iter_base) + 12)); index2816 = index2816 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2816 * 8) - PublicOplogEntry::CardEventQueued(CardEventQueuedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - event: lifted2598, - }) - } - 42 => { - let lifted2599 : UInt64? = match mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - ) - _ => panic() - } + array2815.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - PublicOplogEntry::CardInstalled(CardInstalledParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - queued_event_index: lifted2599, - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 48).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - }, - }, - }) - } - 43 => - PublicOplogEntry::CardInstallFailed(CardInstallFailedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - queued_event_index: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 48).reinterpret_as_uint64(), - }, - }, - reason: CardInstallFailure::from(mbt_ffi_load8_u(iter_base + 56)), - }) - 44 => - PublicOplogEntry::CardRevoked(CardRevokedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - queued_event_index: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 48).reinterpret_as_uint64(), - }, - }, - }) - 45 => - PublicOplogEntry::CardExpired(CardExpiredParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - card_id: @types.CardId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - }, - }, - }) - 46 => { - let array2796 : Array[@types.SchemaTypeNode] = [] - for index2797 = 0 - index2797 < mbt_ffi_load32(iter_base + 48) - index2797 = index2797 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 44) + index2797 * 144 - - let lifted2782 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted2606 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2601 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2600 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2600) - } - _ => panic() - } - - let lifted2603 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2602 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2602) - } - _ => panic() - } - - let lifted2605 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2604 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2604) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2601, - max: lifted2603, - unit: lifted2605, - }) - } - _ => panic() - } + @types.SchemaValueNode::MapValue(array2815) + } + 21 => { - @types.SchemaTypeBody::S8Type(lifted2606) - } - 3 => { - let lifted2613 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2608 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2607 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2607) - } - _ => panic() - } - - let lifted2610 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2609 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2609) - } - _ => panic() - } - - let lifted2612 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2611 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2611) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2608, - max: lifted2610, - unit: lifted2612, - }) - } - _ => panic() - } + let lifted2817 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::S16Type(lifted2613) - } - 4 => { - let lifted2620 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2615 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2614 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2614) - } - _ => panic() - } - - let lifted2617 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2616 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2616) - } - _ => panic() - } - - let lifted2619 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2618 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2618) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2615, - max: lifted2617, - unit: lifted2619, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - @types.SchemaTypeBody::S32Type(lifted2620) - } - 5 => { - let lifted2627 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2622 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2621 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2621) - } - _ => panic() - } - - let lifted2624 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2623 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2623) - } - _ => panic() - } - - let lifted2626 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2625 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2625) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2622, - max: lifted2624, - unit: lifted2626, - }) - } - _ => panic() - } + @types.SchemaValueNode::OptionValue(lifted2817) + } + 22 => { - @types.SchemaTypeBody::S64Type(lifted2627) - } - 6 => { - let lifted2634 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2629 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2628 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2628) - } - _ => panic() - } - - let lifted2631 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2630 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2630) - } - _ => panic() - } - - let lifted2633 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2632 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2632) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2629, - max: lifted2631, - unit: lifted2633, - }) - } - _ => panic() - } + let lifted2820 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - @types.SchemaTypeBody::U8Type(lifted2634) - } - 7 => { - let lifted2641 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2636 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2635 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2635) - } - _ => panic() - } - - let lifted2638 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2637 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2637) - } - _ => panic() - } - - let lifted2640 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2639 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2639) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2636, - max: lifted2638, - unit: lifted2640, - }) - } - _ => panic() - } + let lifted2818 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::U16Type(lifted2641) - } - 8 => { - let lifted2648 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2643 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2642 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2642) - } - _ => panic() - } - - let lifted2645 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2644 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2644) - } - _ => panic() - } - - let lifted2647 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2646 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2646) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2643, - max: lifted2645, - unit: lifted2647, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - @types.SchemaTypeBody::U32Type(lifted2648) - } - 9 => { - let lifted2655 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2650 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2649 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2649) - } - _ => panic() - } - - let lifted2652 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2651 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2651) - } - _ => panic() - } - - let lifted2654 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2653 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2653) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2650, - max: lifted2652, - unit: lifted2654, - }) - } - _ => panic() - } + @types.ResultValuePayload::OkValue(lifted2818) + } + 1 => { - @types.SchemaTypeBody::U64Type(lifted2655) - } - 10 => { - let lifted2662 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2657 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2656 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2656) - } - _ => panic() - } - - let lifted2659 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2658 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2658) - } - _ => panic() - } - - let lifted2661 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2660 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2660) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2657, - max: lifted2659, - unit: lifted2661, - }) - } - _ => panic() - } + let lifted2819 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::F32Type(lifted2662) - } - 11 => { - let lifted2669 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted2664 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted2663 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2663) - } - _ => panic() - } - - let lifted2666 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted2665 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted2665) - } - _ => panic() - } - - let lifted2668 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2667 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2667) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted2664, - max: lifted2666, - unit: lifted2668, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - @types.SchemaTypeBody::F64Type(lifted2669) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array2684 : Array[@types.NamedFieldType] = [] - for index2685 = 0 - index2685 < mbt_ffi_load32(iter_base + 12) - index2685 = index2685 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2685 * 68 - - let result2670 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2672 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2671 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2671) - } - _ => panic() - } - - let array2674 : Array[String] = [] - for index2675 = 0 - index2675 < mbt_ffi_load32(iter_base + 28) - index2675 = index2675 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2675 * 8 - - let result2673 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2674.push(result2673) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array2677 : Array[String] = [] - for index2678 = 0 - index2678 < mbt_ffi_load32(iter_base + 36) - index2678 = index2678 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index2678 * 8 - - let result2676 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2677.push(result2676) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted2680 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result2679 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result2679) - } - _ => panic() - } - - let lifted2683 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted2682 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2681 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result2681) - } - _ => panic() - } + @types.ResultValuePayload::ErrValue(lifted2819) + } + _ => panic() + } - Option::Some(lifted2682) - } - _ => panic() - } - - array2684.push(@types.NamedFieldType::{ - name: result2670, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted2672, - aliases: array2674, - examples: array2677, - deprecated: lifted2680, - role: lifted2683, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array2684) - } - 15 => { - let array2701 : Array[@types.VariantCaseType] = [] - for index2702 = 0 - index2702 < mbt_ffi_load32(iter_base + 12) - index2702 = index2702 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2702 * 72 - - let result2686 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2687 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted2689 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2688 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2688) - } - _ => panic() - } - - let array2691 : Array[String] = [] - for index2692 = 0 - index2692 < mbt_ffi_load32(iter_base + 32) - index2692 = index2692 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2692 * 8 - - let result2690 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2691.push(result2690) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array2694 : Array[String] = [] - for index2695 = 0 - index2695 < mbt_ffi_load32(iter_base + 40) - index2695 = index2695 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index2695 * 8 - - let result2693 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2694.push(result2693) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted2697 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result2696 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result2696) - } - _ => panic() - } - - let lifted2700 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted2699 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2698 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result2698) - } - _ => panic() - } + @types.SchemaValueNode::ResultValue(lifted2820) + } + 23 => { - Option::Some(lifted2699) - } - _ => panic() - } - - array2701.push(@types.VariantCaseType::{ - name: result2686, - payload: lifted2687, - metadata: @types.MetadataEnvelope::{ - doc: lifted2689, - aliases: array2691, - examples: array2694, - deprecated: lifted2697, - role: lifted2700, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array2701) - } - 16 => { - let array2704 : Array[String] = [] - for index2705 = 0 - index2705 < mbt_ffi_load32(iter_base + 12) - index2705 = index2705 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2705 * 8 - - let result2703 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2704.push(result2703) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array2704) - } - 17 => { - let array2707 : Array[String] = [] - for index2708 = 0 - index2708 < mbt_ffi_load32(iter_base + 12) - index2708 = index2708 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2708 * 8 - - let result2706 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2707.push(result2706) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array2707) - } - 18 => { - let array2709 : Array[Int] = [] - for index2710 = 0 - index2710 < mbt_ffi_load32(iter_base + 12) - index2710 = index2710 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2710 * 4 - - array2709.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array2709) - } - 19 => - @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted2711 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result2821 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let lifted2712 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + let lifted2823 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted2711, - err: lifted2712, - }) - } - 24 => { - let lifted2716 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2714 : Array[String] = [] - for index2715 = 0 - index2715 < mbt_ffi_load32(iter_base + 16) - index2715 = index2715 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2715 * 8 - - let result2713 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2714.push(result2713) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2714) - } - _ => panic() - } + let result2822 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted2717 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + Option::Some(result2822) + } + _ => panic() + } - let lifted2718 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result2821, language : lifted2823}) + } + 24 => { - let lifted2720 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2719 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2719) - } - _ => panic() - } + let result2824 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted2716, - min_length: lifted2717, - max_length: lifted2718, - regex: lifted2720, - }) - } - 25 => { - let lifted2724 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2722 : Array[String] = [] - for index2723 = 0 - index2723 < mbt_ffi_load32(iter_base + 16) - index2723 = index2723 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2723 * 8 - - let result2721 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2722.push(result2721) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2722) - } - _ => panic() - } + let lifted2826 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted2725 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + let result2825 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted2726 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + Option::Some(result2825) + } + _ => panic() + } - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted2724, - min_bytes: lifted2725, - max_bytes: lifted2726, - }) - } - 26 => { - let lifted2730 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array2728 : Array[String] = [] - for index2729 = 0 - index2729 < mbt_ffi_load32(iter_base + 20) - index2729 = index2729 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2729 * 8 - - let result2727 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2728.push(result2727) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array2728) - } - _ => panic() - } + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result2824, mime_type : lifted2826}) + } + 25 => { - let lifted2734 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array2732 : Array[String] = [] - for index2733 = 0 - index2733 < mbt_ffi_load32(iter_base + 32) - index2733 = index2733 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2733 * 8 - - let result2731 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2732.push(result2731) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array2732) - } - _ => panic() - } + let result2827 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted2730, - allowed_extensions: lifted2734, - }) - } - 27 => { - let lifted2738 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array2736 : Array[String] = [] - for index2737 = 0 - index2737 < mbt_ffi_load32(iter_base + 16) - index2737 = index2737 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index2737 * 8 - - let result2735 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2736.push(result2735) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array2736) - } - _ => panic() - } + @types.SchemaValueNode::PathValue(result2827) + } + 26 => { - let lifted2742 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array2740 : Array[String] = [] - for index2741 = 0 - index2741 < mbt_ffi_load32(iter_base + 28) - index2741 = index2741 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index2741 * 8 - - let result2739 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2740.push(result2739) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array2740) - } - _ => panic() - } + let result2828 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted2738, - allowed_hosts: lifted2742, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result2743 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array2745 : Array[String] = [] - for index2746 = 0 - index2746 < mbt_ffi_load32(iter_base + 20) - index2746 = index2746 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index2746 * 8 - - let result2744 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2745.push(result2744) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted2748 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2747 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result2747, - }) - } - _ => panic() - } + @types.SchemaValueNode::UrlValue(result2828) + } + 27 => { - let lifted2750 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result2749 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result2749, - }) - } - _ => panic() - } + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result2743, - allowed_suffixes: array2745, - min: lifted2748, - max: lifted2750, - }) - } - 31 => { - let array2774 : Array[@types.UnionBranch] = [] - for index2775 = 0 - index2775 < mbt_ffi_load32(iter_base + 12) - index2775 = index2775 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2775 * 92 - - let result2751 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2760 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result2752 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result2752) - } - 1 => { - let result2753 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result2753) - } - 2 => { - let result2754 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result2754) - } - 3 => { - let result2755 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result2755) - } - 4 => { - let result2756 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted2758 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result2757 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result2757) - } - _ => panic() - } + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result2756, - literal: lifted2758, - }) - } - 5 => { - let result2759 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result2759) - } - _ => panic() - } - - let lifted2762 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result2761 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result2761) - } - _ => panic() - } - - let array2764 : Array[String] = [] - for index2765 = 0 - index2765 < mbt_ffi_load32(iter_base + 52) - index2765 = index2765 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index2765 * 8 - - let result2763 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2764.push(result2763) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array2767 : Array[String] = [] - for index2768 = 0 - index2768 < mbt_ffi_load32(iter_base + 60) - index2768 = index2768 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index2768 * 8 - - let result2766 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2767.push(result2766) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted2770 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result2769 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result2769) - } - _ => panic() - } - - let lifted2773 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted2772 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2771 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result2771) - } - _ => panic() - } + let result2829 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Option::Some(lifted2772) - } - _ => panic() - } - - array2774.push(@types.UnionBranch::{ - tag: result2751, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted2760, - metadata: @types.MetadataEnvelope::{ - doc: lifted2762, - aliases: array2764, - examples: array2767, - deprecated: lifted2770, - role: lifted2773, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array2774, - }) - } - 32 => { - let lifted2777 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result2776 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result2776) - } - _ => panic() - } + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result2829}) + } + 30 => { - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted2777, - }) - } - 33 => { - let lifted2779 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2778 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2778) - } - _ => panic() - } + let result2830 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted2779, - }) - } - 34 => { - let lifted2780 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result2830, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - @types.SchemaTypeBody::FutureType(lifted2780) - } - 35 => { - let lifted2781 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - @types.SchemaTypeBody::StreamType(lifted2781) - } - _ => panic() - } - - let lifted2784 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result2783 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result2783) - } - _ => panic() - } - - let array2786 : Array[String] = [] - for index2787 = 0 - index2787 < mbt_ffi_load32(iter_base + 104) - index2787 = index2787 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index2787 * 8 - - let result2785 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2786.push(result2785) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array2789 : Array[String] = [] - for index2790 = 0 - index2790 < mbt_ffi_load32(iter_base + 112) - index2790 = index2790 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index2790 * 8 - - let result2788 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array2789.push(result2788) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted2792 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result2791 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result2791) - } - _ => panic() - } - - let lifted2795 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted2794 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result2793 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result2793) - } - _ => panic() - } + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - Option::Some(lifted2794) - } - _ => panic() - } - - array2796.push(@types.SchemaTypeNode::{ - body: lifted2782, - metadata: @types.MetadataEnvelope::{ - doc: lifted2784, - aliases: array2786, - examples: array2789, - deprecated: lifted2792, - role: lifted2795, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - - let array2801 : Array[@types.SchemaTypeDef] = [] - for index2802 = 0 - index2802 < mbt_ffi_load32(iter_base + 56) - index2802 = index2802 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 52) + index2802 * 24 - - let result2798 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted2800 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result2799 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result2799) - } - _ => panic() - } - - array2801.push(@types.SchemaTypeDef::{ - id: result2798, - name: lifted2800, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - - let array2832 : Array[@types.SchemaValueNode] = [] - for index2833 = 0 - index2833 < mbt_ffi_load32(iter_base + 68) - index2833 = index2833 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 64) + index2833 * 32 - - let lifted2831 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result2803 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result2803) - } - 13 => { - let array2804 : Array[Int] = [] - for index2805 = 0 - index2805 < mbt_ffi_load32(iter_base + 12) - index2805 = index2805 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2805 * 4 - - array2804.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array2804) - } - 14 => { - let lifted2806 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted2806, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array2807 : Array[Bool] = [] - for index2808 = 0 - index2808 < mbt_ffi_load32(iter_base + 12) - index2808 = index2808 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2808 * 1 - - array2807.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array2807) - } - 17 => { - let array2809 : Array[Int] = [] - for index2810 = 0 - index2810 < mbt_ffi_load32(iter_base + 12) - index2810 = index2810 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2810 * 4 - - array2809.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array2809) - } - 18 => { - let array2811 : Array[Int] = [] - for index2812 = 0 - index2812 < mbt_ffi_load32(iter_base + 12) - index2812 = index2812 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2812 * 4 - - array2811.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array2811) - } - 19 => { - let array2813 : Array[Int] = [] - for index2814 = 0 - index2814 < mbt_ffi_load32(iter_base + 12) - index2814 = index2814 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2814 * 4 - - array2813.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array2813) - } - 20 => { - let array2815 : Array[@types.MapEntry] = [] - for index2816 = 0 - index2816 < mbt_ffi_load32(iter_base + 12) - index2816 = index2816 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index2816 * 8 - - array2815.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array2815) - } - 21 => { - let lifted2817 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + array2832.push(lifted2831) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - @types.SchemaValueNode::OptionValue(lifted2817) - } - 22 => { - let lifted2820 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted2818 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted2818) - } - 1 => { - let lifted2819 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted2819) - } - _ => panic() - } + PublicOplogEntry::HostStreamFrame(HostStreamFrameParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, parent_start_index : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64(), kind : HostStreamKind::from(mbt_ffi_load8_u((iter_base) + 40)), payload : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array2796, defs : array2801, root : mbt_ffi_load32((iter_base) + 60)}, value : @types.SchemaValueTree::{value_nodes : array2832, root : mbt_ffi_load32((iter_base) + 72)}}}) + } + 47 => { - @types.SchemaValueNode::ResultValue(lifted2820) - } - 23 => { - let result2821 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2823 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2822 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2822) - } - _ => panic() - } + PublicOplogEntry::CompletionDiscarded(CompletionDiscardedParameters::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((iter_base) + 16), nanoseconds : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}, start_index : (mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()}) + } + _ => panic() + } - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result2821, - language: lifted2823, - }) - } - 24 => { - let result2824 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted2826 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result2825 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result2825) - } - _ => panic() + array2835.push(((mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), lifted2834)) } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result2824, - mime_type: lifted2826, - }) - } - 25 => { - let result2827 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result2827) - } - 26 => { - let result2828 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result2828) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result2829 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result2829, - }) - } - 30 => { - let result2830 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result2830, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } - - array2832.push(lifted2831) + Option::Some(array2835) } - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - - PublicOplogEntry::HostStreamFrame(HostStreamFrameParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - parent_start_index: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - kind: HostStreamKind::from(mbt_ffi_load8_u(iter_base + 40)), - payload: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array2796, - defs: array2801, - root: mbt_ffi_load32(iter_base + 60), - }, - value: @types.SchemaValueTree::{ - value_nodes: array2832, - root: mbt_ffi_load32(iter_base + 72), - }, - }, - }) - } - 47 => - PublicOplogEntry::CompletionDiscarded(CompletionDiscardedParameters::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(iter_base + 16), - nanoseconds: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - start_index: mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - }) - _ => panic() - } - - array2835.push( - (mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), lifted2834), - ) + _ => panic() } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Option::Some(array2835) - } - _ => panic() - } - let ret = lifted2837 - mbt_ffi_free(return_area) - return ret + let ret = lifted2837 + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/api/retry/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/api/retry/ffi.mbt index 2c1a0ca033..e65dd7be2c 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/api/retry/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/api/retry/ffi.mbt @@ -1,87 +1,67 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| -fn wasmImportGetRetryPolicies(p0 : Int) = "golem:api/retry@1.5.0" "get-retry-policies" +fn wasmImportGetRetryPolicies(p0 : Int) = "golem:api/retry@1.5.0" "get-retry-policies" -///| -fn wasmImportGetRetryPolicyByName(p0 : Int, p1 : Int, p2 : Int) = "golem:api/retry@1.5.0" "get-retry-policy-by-name" +fn wasmImportGetRetryPolicyByName(p0 : Int, p1 : Int, p2 : Int) = "golem:api/retry@1.5.0" "get-retry-policy-by-name" -///| -fn wasmImportResolveRetryPolicy( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, -) = "golem:api/retry@1.5.0" "resolve-retry-policy" +fn wasmImportResolveRetryPolicy(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int) = "golem:api/retry@1.5.0" "resolve-retry-policy" -///| -fn wasmImportSetRetryPolicy( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, -) = "golem:api/retry@1.5.0" "set-retry-policy" +fn wasmImportSetRetryPolicy(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int) = "golem:api/retry@1.5.0" "set-retry-policy" -///| -fn wasmImportRemoveRetryPolicy(p0 : Int, p1 : Int) = "golem:api/retry@1.5.0" "remove-retry-policy" +fn wasmImportRemoveRetryPolicy(p0 : Int, p1 : Int) = "golem:api/retry@1.5.0" "remove-retry-policy" ///| -extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = - #|(func (param i32) (result f64) local.get 0 f64.load) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = +#|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = +#|(func (param i32) (result f64) local.get 0 f64.load) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = - #|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/api/retry/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/api/retry/top.mbt index 3fa97f6e2a..bd5de0cea4 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/api/retry/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/api/retry/top.mbt @@ -1,2778 +1,2449 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// ── Predicate value ────────────────────────────────────────────── /// Dynamic value for property comparisons in retry predicates pub(all) enum PredicateValue { - Text(String) - Integer(Int64) - Boolean(Bool) + Text(String) + Integer(Int64) + Boolean(Bool) } derive(Show, Eq) - ///| pub(all) struct PropertyComparison { - property_name : String - value : PredicateValue + property_name : String; value : PredicateValue } derive(Show, Eq) - ///| pub(all) struct PropertySetCheck { - property_name : String - values : Array[PredicateValue] + property_name : String; values : Array[PredicateValue] } derive(Show, Eq) - ///| pub(all) struct PropertyPattern { - property_name : String - pattern : String + property_name : String; pattern : String } derive(Show, Eq) - ///| pub(all) enum PredicateNode { - PropEq(PropertyComparison) - PropNeq(PropertyComparison) - PropGt(PropertyComparison) - PropGte(PropertyComparison) - PropLt(PropertyComparison) - PropLte(PropertyComparison) - PropExists(String) - PropIn(PropertySetCheck) - PropMatches(PropertyPattern) - PropStartsWith(PropertyPattern) - PropContains(PropertyPattern) - PredAnd((Int, Int)) - PredOr((Int, Int)) - PredNot(Int) - PredTrue - PredFalse + PropEq(PropertyComparison) + PropNeq(PropertyComparison) + PropGt(PropertyComparison) + PropGte(PropertyComparison) + PropLt(PropertyComparison) + PropLte(PropertyComparison) + PropExists(String) + PropIn(PropertySetCheck) + PropMatches(PropertyPattern) + PropStartsWith(PropertyPattern) + PropContains(PropertyPattern) + PredAnd((Int, Int)) + PredOr((Int, Int)) + PredNot(Int) + PredTrue + PredFalse } derive(Show, Eq) - ///| /// A composable predicate tree for matching retry contexts. /// Root is nodes[0]. Children referenced by predicate-node-index. pub(all) struct RetryPredicate { - nodes : Array[PredicateNode] + nodes : Array[PredicateNode] } derive(Show, Eq) - ///| pub(all) struct ExponentialConfig { - base_delay : UInt64 - factor : Double + base_delay : UInt64; factor : Double } derive(Show, Eq) - ///| pub(all) struct FibonacciConfig { - first : UInt64 - second : UInt64 + first : UInt64; second : UInt64 } derive(Show, Eq) - ///| pub(all) struct CountBoxConfig { - max_retries : UInt - inner : Int + max_retries : UInt; inner : Int } derive(Show, Eq) - ///| pub(all) struct TimeBoxConfig { - limit : UInt64 - inner : Int + limit : UInt64; inner : Int } derive(Show, Eq) - ///| pub(all) struct ClampConfig { - min_delay : UInt64 - max_delay : UInt64 - inner : Int + min_delay : UInt64; max_delay : UInt64; inner : Int } derive(Show, Eq) - ///| pub(all) struct AddDelayConfig { - delay : UInt64 - inner : Int + delay : UInt64; inner : Int } derive(Show, Eq) - ///| pub(all) struct JitterConfig { - factor : Double - inner : Int + factor : Double; inner : Int } derive(Show, Eq) - ///| /// filtered-config embeds a full retry-predicate inline (self-contained) pub(all) struct FilteredConfig { - predicate : RetryPredicate - inner : Int + predicate : RetryPredicate; inner : Int } derive(Show, Eq) - ///| pub(all) enum PolicyNode { - Periodic(UInt64) - Exponential(ExponentialConfig) - Fibonacci(FibonacciConfig) - Immediate - Never - CountBox(CountBoxConfig) - TimeBox(TimeBoxConfig) - ClampDelay(ClampConfig) - AddDelay(AddDelayConfig) - Jitter(JitterConfig) - FilteredOn(FilteredConfig) - AndThen((Int, Int)) - PolicyUnion((Int, Int)) - PolicyIntersect((Int, Int)) + Periodic(UInt64) + Exponential(ExponentialConfig) + Fibonacci(FibonacciConfig) + Immediate + Never + CountBox(CountBoxConfig) + TimeBox(TimeBoxConfig) + ClampDelay(ClampConfig) + AddDelay(AddDelayConfig) + Jitter(JitterConfig) + FilteredOn(FilteredConfig) + AndThen((Int, Int)) + PolicyUnion((Int, Int)) + PolicyIntersect((Int, Int)) } derive(Show, Eq) - ///| /// A composable retry policy tree. /// Root is nodes[0]. Children referenced by policy-node-index. pub(all) struct RetryPolicy { - nodes : Array[PolicyNode] + nodes : Array[PolicyNode] } derive(Show, Eq) - ///| /// ── Named policy rule ──────────────────────────────────────────── /// A named retry policy rule: predicate selects when it applies, /// policy defines the retry strategy, priority controls evaluation order /// (higher = checked first). pub(all) struct NamedRetryPolicy { - name : String - priority : UInt - predicate : RetryPredicate - policy : RetryPolicy + name : String; priority : UInt; predicate : RetryPredicate; policy : RetryPolicy } derive(Show, Eq) - ///| /// ── Host functions ─────────────────────────────────────────────── /// Get all retry policies active for this agent pub fn get_retry_policies() -> Array[NamedRetryPolicy] { - let return_area = mbt_ffi_malloc(8) - wasmImportGetRetryPolicies(return_area) - - let array66 : Array[NamedRetryPolicy] = [] - for index67 = 0 - index67 < mbt_ffi_load32(return_area + 4) - index67 = index67 + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index67 * 28 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let array28 : Array[PredicateNode] = [] - for index29 = 0 - index29 < mbt_ffi_load32(iter_base + 16) - index29 = index29 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index29 * 32 - - let lifted27 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result1) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 24) != 0) - _ => panic() - } - - PredicateNode::PropEq(PropertyComparison::{ - property_name: result0, - value: lifted, - }) - } - 1 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted4 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result3) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 24) != 0) - _ => panic() - } - - PredicateNode::PropNeq(PropertyComparison::{ - property_name: result2, - value: lifted4, - }) - } - 2 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted7 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result6) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 24) != 0) - _ => panic() - } - - PredicateNode::PropGt(PropertyComparison::{ - property_name: result5, - value: lifted7, - }) - } - 3 => { - let result8 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted10 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result9 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result9) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 24) != 0) - _ => panic() - } - - PredicateNode::PropGte(PropertyComparison::{ - property_name: result8, - value: lifted10, - }) - } - 4 => { - let result11 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted13 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result12 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result12) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 24) != 0) - _ => panic() - } - - PredicateNode::PropLt(PropertyComparison::{ - property_name: result11, - value: lifted13, - }) - } - 5 => { - let result14 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted16 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result15) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 24) != 0) - _ => panic() - } - - PredicateNode::PropLte(PropertyComparison::{ - property_name: result14, - value: lifted16, - }) - } - 6 => { - let result17 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - PredicateNode::PropExists(result17) - } - 7 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array : Array[PredicateValue] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 20) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index * 16 - - let lifted20 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - PredicateValue::Text(result19) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 8)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 8) != 0) - _ => panic() - } - array.push(lifted20) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - PredicateNode::PropIn(PropertySetCheck::{ - property_name: result18, - values: array, - }) - } - 8 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result22 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropMatches(PropertyPattern::{ - property_name: result21, - pattern: result22, - }) - } - 9 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result24 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropStartsWith(PropertyPattern::{ - property_name: result23, - pattern: result24, - }) - } - 10 => { - let result25 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result26 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropContains(PropertyPattern::{ - property_name: result25, - pattern: result26, - }) - } - 11 => - PredicateNode::PredAnd( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - 12 => - PredicateNode::PredOr( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - 13 => PredicateNode::PredNot(mbt_ffi_load32(iter_base + 8)) - 14 => PredicateNode::PredTrue - 15 => PredicateNode::PredFalse - _ => panic() - } + let return_area = mbt_ffi_malloc(8) + wasmImportGetRetryPolicies(return_area); - array28.push(lifted27) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - let array64 : Array[PolicyNode] = [] - for index65 = 0 - index65 < mbt_ffi_load32(iter_base + 24) - index65 = index65 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index65 * 32 - - let lifted63 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - PolicyNode::Periodic( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 1 => - PolicyNode::Exponential(ExponentialConfig::{ - base_delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - factor: mbt_ffi_loadf64(iter_base + 16), - }) - 2 => - PolicyNode::Fibonacci(FibonacciConfig::{ - first: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - second: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - }) - 3 => PolicyNode::Immediate - 4 => PolicyNode::Never - 5 => - PolicyNode::CountBox(CountBoxConfig::{ - max_retries: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - inner: mbt_ffi_load32(iter_base + 12), - }) - 6 => - PolicyNode::TimeBox(TimeBoxConfig::{ - limit: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 16), - }) - 7 => - PolicyNode::ClampDelay(ClampConfig::{ - min_delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - max_delay: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 24), - }) - 8 => - PolicyNode::AddDelay(AddDelayConfig::{ - delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 16), - }) - 9 => - PolicyNode::Jitter(JitterConfig::{ - factor: mbt_ffi_loadf64(iter_base + 8), - inner: mbt_ffi_load32(iter_base + 16), - }) - 10 => { - let array61 : Array[PredicateNode] = [] - for index62 = 0 - index62 < mbt_ffi_load32(iter_base + 12) - index62 = index62 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index62 * 32 - - let lifted60 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result30 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted32 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result31 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result31) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } - - PredicateNode::PropEq(PropertyComparison::{ - property_name: result30, - value: lifted32, - }) - } - 1 => { - let result33 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted35 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result34 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result34) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } - - PredicateNode::PropNeq(PropertyComparison::{ - property_name: result33, - value: lifted35, - }) - } - 2 => { - let result36 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted38 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result37 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result37) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } - - PredicateNode::PropGt(PropertyComparison::{ - property_name: result36, - value: lifted38, - }) - } - 3 => { - let result39 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted41 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result40 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result40) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } - - PredicateNode::PropGte(PropertyComparison::{ - property_name: result39, - value: lifted41, - }) - } - 4 => { - let result42 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted44 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result43 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result43) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } - - PredicateNode::PropLt(PropertyComparison::{ - property_name: result42, - value: lifted44, - }) - } - 5 => { - let result45 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted47 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result46 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result46) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } - - PredicateNode::PropLte(PropertyComparison::{ - property_name: result45, - value: lifted47, - }) - } - 6 => { - let result48 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - PredicateNode::PropExists(result48) - } - 7 => { - let result49 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array52 : Array[PredicateValue] = [] - for index53 = 0 - index53 < mbt_ffi_load32(iter_base + 20) - index53 = index53 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index53 * 16 - - let lifted51 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result50 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - PredicateValue::Text(result50) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 8)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - _ => panic() - } + let array66 : Array[NamedRetryPolicy] = []; + for index67 = 0; index67 < (mbt_ffi_load32((return_area) + 4)); index67 = index67 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index67 * 28) - array52.push(lifted51) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - PredicateNode::PropIn(PropertySetCheck::{ - property_name: result49, - values: array52, - }) - } - 8 => { - let result54 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result55 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropMatches(PropertyPattern::{ - property_name: result54, - pattern: result55, - }) - } - 9 => { - let result56 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result57 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropStartsWith(PropertyPattern::{ - property_name: result56, - pattern: result57, - }) - } - 10 => { - let result58 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result59 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropContains(PropertyPattern::{ - property_name: result58, - pattern: result59, - }) - } - 11 => - PredicateNode::PredAnd( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 12 => - PredicateNode::PredOr( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 13 => PredicateNode::PredNot(mbt_ffi_load32(iter_base + 8)) - 14 => PredicateNode::PredTrue - 15 => PredicateNode::PredFalse - _ => panic() - } + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array61.push(lifted60) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - PolicyNode::FilteredOn(FilteredConfig::{ - predicate: RetryPredicate::{ nodes: array61 }, - inner: mbt_ffi_load32(iter_base + 16), - }) - } - 11 => - PolicyNode::AndThen( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - 12 => - PolicyNode::PolicyUnion( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - 13 => - PolicyNode::PolicyIntersect( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - _ => panic() - } + let array28 : Array[PredicateNode] = []; + for index29 = 0; index29 < (mbt_ffi_load32((iter_base) + 16)); index29 = index29 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index29 * 32) - array64.push(lifted63) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - array66.push(NamedRetryPolicy::{ - name: result, - priority: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - predicate: RetryPredicate::{ nodes: array28 }, - policy: RetryPolicy::{ nodes: array64 }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array66 - mbt_ffi_free(return_area) - return ret -} + let lifted27 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { -///| -/// Get a specific retry policy by name -pub fn get_retry_policy_by_name(name : String) -> NamedRetryPolicy? { - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(32) - wasmImportGetRetryPolicyByName(ptr, name.length(), return_area) - - let lifted66 : NamedRetryPolicy? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - let array28 : Array[PredicateNode] = [] - for index29 = 0 - index29 < mbt_ffi_load32(return_area + 20) - index29 = index29 + 1 { - let iter_base = mbt_ffi_load32(return_area + 16) + index29 * 32 - - let lifted27 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result1) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 24) != 0) - _ => panic() - } + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - PredicateNode::PropEq(PropertyComparison::{ - property_name: result0, - value: lifted, - }) - } - 1 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted4 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result3) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 24) != 0) - _ => panic() - } + let lifted = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - PredicateNode::PropNeq(PropertyComparison::{ - property_name: result2, - value: lifted4, - }) - } - 2 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted7 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result6) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 24) != 0) - _ => panic() - } + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - PredicateNode::PropGt(PropertyComparison::{ - property_name: result5, - value: lifted7, - }) - } - 3 => { - let result8 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted10 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result9 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result9) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 24) != 0) - _ => panic() - } + PredicateValue::Text(result1) + } + 1 => { - PredicateNode::PropGte(PropertyComparison::{ - property_name: result8, - value: lifted10, - }) - } - 4 => { - let result11 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted13 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result12 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result12) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 24) != 0) - _ => panic() - } + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - PredicateNode::PropLt(PropertyComparison::{ - property_name: result11, - value: lifted13, - }) - } - 5 => { - let result14 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted16 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result15) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 24) != 0) - _ => panic() - } + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - PredicateNode::PropLte(PropertyComparison::{ - property_name: result14, - value: lifted16, - }) - } - 6 => { - let result17 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - PredicateNode::PropExists(result17) - } - 7 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array : Array[PredicateValue] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 20) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index * 16 - - let lifted20 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - PredicateValue::Text(result19) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 8)) - 2 => - PredicateValue::Boolean(mbt_ffi_load8_u(iter_base + 8) != 0) - _ => panic() - } - - array.push(lifted20) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - PredicateNode::PropIn(PropertySetCheck::{ - property_name: result18, - values: array, - }) - } - 8 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result22 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropMatches(PropertyPattern::{ - property_name: result21, - pattern: result22, - }) - } - 9 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result24 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropStartsWith(PropertyPattern::{ - property_name: result23, - pattern: result24, - }) - } - 10 => { - let result25 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result26 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropContains(PropertyPattern::{ - property_name: result25, - pattern: result26, - }) - } - 11 => - PredicateNode::PredAnd( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - 12 => - PredicateNode::PredOr( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - 13 => PredicateNode::PredNot(mbt_ffi_load32(iter_base + 8)) - 14 => PredicateNode::PredTrue - 15 => PredicateNode::PredFalse - _ => panic() - } - - array28.push(lifted27) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 16)) - - let array64 : Array[PolicyNode] = [] - for index65 = 0 - index65 < mbt_ffi_load32(return_area + 28) - index65 = index65 + 1 { - let iter_base = mbt_ffi_load32(return_area + 24) + index65 * 32 - - let lifted63 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - PolicyNode::Periodic( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 1 => - PolicyNode::Exponential(ExponentialConfig::{ - base_delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - factor: mbt_ffi_loadf64(iter_base + 16), - }) - 2 => - PolicyNode::Fibonacci(FibonacciConfig::{ - first: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - second: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - }) - 3 => PolicyNode::Immediate - 4 => PolicyNode::Never - 5 => - PolicyNode::CountBox(CountBoxConfig::{ - max_retries: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - inner: mbt_ffi_load32(iter_base + 12), - }) - 6 => - PolicyNode::TimeBox(TimeBoxConfig::{ - limit: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 16), - }) - 7 => - PolicyNode::ClampDelay(ClampConfig::{ - min_delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - max_delay: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 24), - }) - 8 => - PolicyNode::AddDelay(AddDelayConfig::{ - delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 16), - }) - 9 => - PolicyNode::Jitter(JitterConfig::{ - factor: mbt_ffi_loadf64(iter_base + 8), - inner: mbt_ffi_load32(iter_base + 16), - }) - 10 => { - let array61 : Array[PredicateNode] = [] - for index62 = 0 - index62 < mbt_ffi_load32(iter_base + 12) - index62 = index62 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index62 * 32 - - let lifted60 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result30 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted32 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result31 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result31) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + PredicateNode::PropEq(PropertyComparison::{property_name : result0, value : lifted}) + } + 1 => { - PredicateNode::PropEq(PropertyComparison::{ - property_name: result30, - value: lifted32, - }) - } - 1 => { - let result33 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted35 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result34 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result34) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - PredicateNode::PropNeq(PropertyComparison::{ - property_name: result33, - value: lifted35, - }) - } - 2 => { - let result36 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted38 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result37 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result37) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let lifted4 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - PredicateNode::PropGt(PropertyComparison::{ - property_name: result36, - value: lifted38, - }) - } - 3 => { - let result39 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted41 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result40 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result40) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - PredicateNode::PropGte(PropertyComparison::{ - property_name: result39, - value: lifted41, - }) - } - 4 => { - let result42 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted44 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result43 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result43) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + PredicateValue::Text(result3) + } + 1 => { - PredicateNode::PropLt(PropertyComparison::{ - property_name: result42, - value: lifted44, - }) - } - 5 => { - let result45 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted47 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result46 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result46) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - PredicateNode::PropLte(PropertyComparison::{ - property_name: result45, - value: lifted47, - }) - } - 6 => { - let result48 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - PredicateNode::PropExists(result48) - } - 7 => { - let result49 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array52 : Array[PredicateValue] = [] - for index53 = 0 - index53 < mbt_ffi_load32(iter_base + 20) - index53 = index53 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index53 * 16 - - let lifted51 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result50 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - PredicateValue::Text(result50) - } - 1 => - PredicateValue::Integer(mbt_ffi_load64(iter_base + 8)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - _ => panic() - } - - array52.push(lifted51) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - PredicateNode::PropIn(PropertySetCheck::{ - property_name: result49, - values: array52, - }) - } - 8 => { - let result54 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result55 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropMatches(PropertyPattern::{ - property_name: result54, - pattern: result55, - }) - } - 9 => { - let result56 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result57 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropStartsWith(PropertyPattern::{ - property_name: result56, - pattern: result57, - }) - } - 10 => { - let result58 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result59 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropContains(PropertyPattern::{ - property_name: result58, - pattern: result59, - }) - } - 11 => - PredicateNode::PredAnd( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 12 => - PredicateNode::PredOr( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 13 => PredicateNode::PredNot(mbt_ffi_load32(iter_base + 8)) - 14 => PredicateNode::PredTrue - 15 => PredicateNode::PredFalse - _ => panic() - } - - array61.push(lifted60) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - PolicyNode::FilteredOn(FilteredConfig::{ - predicate: RetryPredicate::{ nodes: array61 }, - inner: mbt_ffi_load32(iter_base + 16), - }) - } - 11 => - PolicyNode::AndThen( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - 12 => - PolicyNode::PolicyUnion( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - 13 => - PolicyNode::PolicyIntersect( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - _ => panic() - } - - array64.push(lifted63) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 24)) - - Option::Some(NamedRetryPolicy::{ - name: result, - priority: mbt_ffi_load32(return_area + 12).reinterpret_as_uint(), - predicate: RetryPredicate::{ nodes: array28 }, - policy: RetryPolicy::{ nodes: array64 }, - }) - } - _ => panic() - } - let ret = lifted66 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } -///| -/// Resolve the matching retry policy for a given operation context. -/// Evaluates named policies in descending priority order; returns the -/// policy from the first rule whose predicate matches, or none. -pub fn resolve_retry_policy( - verb : String, - noun_uri : String, - properties : Array[(String, PredicateValue)], -) -> RetryPolicy? { - let cleanup_list : Array[Int] = [] + PredicateNode::PropNeq(PropertyComparison::{property_name : result2, value : lifted4}) + } + 2 => { - let ptr = mbt_ffi_str2ptr(verb) + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr0 = mbt_ffi_str2ptr(noun_uri) + let lifted7 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - let address = mbt_ffi_malloc(properties.length() * 24) - for index = 0; index < properties.length(); index = index + 1 { - let iter_elem : (String, PredicateValue) = properties[index] - let iter_base = address + index * 24 + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - let ptr1 = mbt_ffi_str2ptr(iter_elem.0) - mbt_ffi_store32(iter_base + 4, iter_elem.0.length()) - mbt_ffi_store32(iter_base + 0, ptr1) + PredicateValue::Text(result6) + } + 1 => { - match iter_elem.1 { - Text(payload) => { - mbt_ffi_store8(iter_base + 8, 0) + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - let ptr2 = mbt_ffi_str2ptr(payload) - mbt_ffi_store32(iter_base + 20, payload.length()) - mbt_ffi_store32(iter_base + 16, ptr2) - cleanup_list.push(ptr2) + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - () - } - Integer(payload3) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store64(iter_base + 16, payload3) + PredicateNode::PropGt(PropertyComparison::{property_name : result5, value : lifted7}) + } + 3 => { - () - } - Boolean(payload4) => { - mbt_ffi_store8(iter_base + 8, 2) - mbt_ffi_store8(iter_base + 16, if payload4 { 1 } else { 0 }) + let result8 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } - cleanup_list.push(ptr1) - } - let return_area = mbt_ffi_malloc(12) - wasmImportResolveRetryPolicy( - ptr, - verb.length(), - ptr0, - noun_uri.length(), - address, - properties.length(), - return_area, - ) - - let lifted38 : RetryPolicy? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let array36 : Array[PolicyNode] = [] - for index37 = 0 - index37 < mbt_ffi_load32(return_area + 8) - index37 = index37 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index37 * 32 - - let lifted35 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - PolicyNode::Periodic( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 1 => - PolicyNode::Exponential(ExponentialConfig::{ - base_delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - factor: mbt_ffi_loadf64(iter_base + 16), - }) - 2 => - PolicyNode::Fibonacci(FibonacciConfig::{ - first: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - second: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - }) - 3 => PolicyNode::Immediate - 4 => PolicyNode::Never - 5 => - PolicyNode::CountBox(CountBoxConfig::{ - max_retries: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - inner: mbt_ffi_load32(iter_base + 12), - }) - 6 => - PolicyNode::TimeBox(TimeBoxConfig::{ - limit: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 16), - }) - 7 => - PolicyNode::ClampDelay(ClampConfig::{ - min_delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - max_delay: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 24), - }) - 8 => - PolicyNode::AddDelay(AddDelayConfig::{ - delay: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - inner: mbt_ffi_load32(iter_base + 16), - }) - 9 => - PolicyNode::Jitter(JitterConfig::{ - factor: mbt_ffi_loadf64(iter_base + 8), - inner: mbt_ffi_load32(iter_base + 16), - }) - 10 => { - let array33 : Array[PredicateNode] = [] - for index34 = 0 - index34 < mbt_ffi_load32(iter_base + 12) - index34 = index34 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index34 * 32 - - let lifted32 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result5) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let lifted10 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - PredicateNode::PropEq(PropertyComparison::{ - property_name: result, - value: lifted, - }) - } - 1 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted8 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result7 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result7) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + let result9 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - PredicateNode::PropNeq(PropertyComparison::{ - property_name: result6, - value: lifted8, - }) - } - 2 => { - let result9 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted11 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result10 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result10) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + PredicateValue::Text(result9) + } + 1 => { - PredicateNode::PropGt(PropertyComparison::{ - property_name: result9, - value: lifted11, - }) - } - 3 => { - let result12 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted14 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result13 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result13) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - PredicateNode::PropGte(PropertyComparison::{ - property_name: result12, - value: lifted14, - }) - } - 4 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted17 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result16 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result16) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - PredicateNode::PropLt(PropertyComparison::{ - property_name: result15, - value: lifted17, - }) - } - 5 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted20 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - PredicateValue::Text(result19) - } - 1 => PredicateValue::Integer(mbt_ffi_load64(iter_base + 24)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 24) != 0, - ) - _ => panic() - } + PredicateNode::PropGte(PropertyComparison::{property_name : result8, value : lifted10}) + } + 4 => { - PredicateNode::PropLte(PropertyComparison::{ - property_name: result18, - value: lifted20, - }) - } - 6 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - PredicateNode::PropExists(result21) - } - 7 => { - let result22 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array : Array[PredicateValue] = [] - for index25 = 0 - index25 < mbt_ffi_load32(iter_base + 20) - index25 = index25 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index25 * 16 - - let lifted24 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - PredicateValue::Text(result23) - } - 1 => - PredicateValue::Integer(mbt_ffi_load64(iter_base + 8)) - 2 => - PredicateValue::Boolean( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - _ => panic() - } - - array.push(lifted24) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - PredicateNode::PropIn(PropertySetCheck::{ - property_name: result22, - values: array, - }) - } - 8 => { - let result26 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result27 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropMatches(PropertyPattern::{ - property_name: result26, - pattern: result27, - }) - } - 9 => { - let result28 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result29 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropStartsWith(PropertyPattern::{ - property_name: result28, - pattern: result29, - }) - } - 10 => { - let result30 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result31 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - PredicateNode::PropContains(PropertyPattern::{ - property_name: result30, - pattern: result31, - }) - } - 11 => - PredicateNode::PredAnd( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 12 => - PredicateNode::PredOr( - ( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ), - ) - 13 => PredicateNode::PredNot(mbt_ffi_load32(iter_base + 8)) - 14 => PredicateNode::PredTrue - 15 => PredicateNode::PredFalse - _ => panic() - } - - array33.push(lifted32) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - PolicyNode::FilteredOn(FilteredConfig::{ - predicate: RetryPredicate::{ nodes: array33 }, - inner: mbt_ffi_load32(iter_base + 16), - }) - } - 11 => - PolicyNode::AndThen( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - 12 => - PolicyNode::PolicyUnion( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - 13 => - PolicyNode::PolicyIntersect( - (mbt_ffi_load32(iter_base + 8), mbt_ffi_load32(iter_base + 12)), - ) - _ => panic() - } - - array36.push(lifted35) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Option::Some(RetryPolicy::{ nodes: array36 }) - } - _ => panic() - } - let ret = lifted38 - mbt_ffi_free(ptr) - mbt_ffi_free(ptr0) - mbt_ffi_free(address) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let result11 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) -///| -/// Add or overwrite a named retry policy (persisted to oplog). -/// If a policy with the same name exists, it is replaced. -pub fn set_retry_policy(policy : NamedRetryPolicy) -> Unit { - let cleanup_list : Array[Int] = [] - - let ptr = mbt_ffi_str2ptr(policy.name) - - let address57 = mbt_ffi_malloc(policy.predicate.nodes.length() * 32) - for index58 = 0 - index58 < policy.predicate.nodes.length() - index58 = index58 + 1 { - let iter_elem : PredicateNode = policy.predicate.nodes[index58] - let iter_base = address57 + index58 * 32 - - match iter_elem { - PropEq(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - - let ptr0 = mbt_ffi_str2ptr(payload.property_name) - mbt_ffi_store32(iter_base + 12, payload.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr0) - - match payload.value { - Text(payload1) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr2 = mbt_ffi_str2ptr(payload1) - mbt_ffi_store32(iter_base + 28, payload1.length()) - mbt_ffi_store32(iter_base + 24, ptr2) - cleanup_list.push(ptr2) - - () - } - Integer(payload3) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload3) - - () - } - Boolean(payload4) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload4 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr0) - - () - } - PropNeq(payload5) => { - mbt_ffi_store8(iter_base + 0, 1) - - let ptr6 = mbt_ffi_str2ptr(payload5.property_name) - mbt_ffi_store32(iter_base + 12, payload5.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr6) - - match payload5.value { - Text(payload7) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr8 = mbt_ffi_str2ptr(payload7) - mbt_ffi_store32(iter_base + 28, payload7.length()) - mbt_ffi_store32(iter_base + 24, ptr8) - cleanup_list.push(ptr8) - - () - } - Integer(payload9) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload9) - - () - } - Boolean(payload10) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload10 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr6) - - () - } - PropGt(payload11) => { - mbt_ffi_store8(iter_base + 0, 2) - - let ptr12 = mbt_ffi_str2ptr(payload11.property_name) - mbt_ffi_store32(iter_base + 12, payload11.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr12) - - match payload11.value { - Text(payload13) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr14 = mbt_ffi_str2ptr(payload13) - mbt_ffi_store32(iter_base + 28, payload13.length()) - mbt_ffi_store32(iter_base + 24, ptr14) - cleanup_list.push(ptr14) - - () - } - Integer(payload15) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload15) - - () - } - Boolean(payload16) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload16 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr12) - - () - } - PropGte(payload17) => { - mbt_ffi_store8(iter_base + 0, 3) - - let ptr18 = mbt_ffi_str2ptr(payload17.property_name) - mbt_ffi_store32(iter_base + 12, payload17.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr18) - - match payload17.value { - Text(payload19) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr20 = mbt_ffi_str2ptr(payload19) - mbt_ffi_store32(iter_base + 28, payload19.length()) - mbt_ffi_store32(iter_base + 24, ptr20) - cleanup_list.push(ptr20) - - () - } - Integer(payload21) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload21) - - () - } - Boolean(payload22) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload22 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr18) - - () - } - PropLt(payload23) => { - mbt_ffi_store8(iter_base + 0, 4) - - let ptr24 = mbt_ffi_str2ptr(payload23.property_name) - mbt_ffi_store32(iter_base + 12, payload23.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr24) - - match payload23.value { - Text(payload25) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr26 = mbt_ffi_str2ptr(payload25) - mbt_ffi_store32(iter_base + 28, payload25.length()) - mbt_ffi_store32(iter_base + 24, ptr26) - cleanup_list.push(ptr26) - - () - } - Integer(payload27) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload27) - - () - } - Boolean(payload28) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload28 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr24) - - () - } - PropLte(payload29) => { - mbt_ffi_store8(iter_base + 0, 5) - - let ptr30 = mbt_ffi_str2ptr(payload29.property_name) - mbt_ffi_store32(iter_base + 12, payload29.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr30) - - match payload29.value { - Text(payload31) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr32 = mbt_ffi_str2ptr(payload31) - mbt_ffi_store32(iter_base + 28, payload31.length()) - mbt_ffi_store32(iter_base + 24, ptr32) - cleanup_list.push(ptr32) - - () - } - Integer(payload33) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload33) - - () - } - Boolean(payload34) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload34 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr30) - - () - } - PropExists(payload35) => { - mbt_ffi_store8(iter_base + 0, 6) + let lifted13 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - let ptr36 = mbt_ffi_str2ptr(payload35) - mbt_ffi_store32(iter_base + 12, payload35.length()) - mbt_ffi_store32(iter_base + 8, ptr36) - cleanup_list.push(ptr36) + let result12 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - () - } - PropIn(payload37) => { - mbt_ffi_store8(iter_base + 0, 7) + PredicateValue::Text(result12) + } + 1 => { - let ptr38 = mbt_ffi_str2ptr(payload37.property_name) - mbt_ffi_store32(iter_base + 12, payload37.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr38) + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - let address = mbt_ffi_malloc(payload37.values.length() * 16) - for index = 0; index < payload37.values.length(); index = index + 1 { - let iter_elem : PredicateValue = payload37.values[index] - let iter_base = address + index * 16 + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - match iter_elem { - Text(payload39) => { - mbt_ffi_store8(iter_base + 0, 0) + PredicateNode::PropLt(PropertyComparison::{property_name : result11, value : lifted13}) + } + 5 => { - let ptr40 = mbt_ffi_str2ptr(payload39) - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, ptr40) - cleanup_list.push(ptr40) + let result14 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Integer(payload41) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store64(iter_base + 8, payload41) + let lifted16 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - () - } - Boolean(payload42) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store8(iter_base + 8, if payload42 { 1 } else { 0 }) + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - () - } - } - } - mbt_ffi_store32(iter_base + 20, payload37.values.length()) - mbt_ffi_store32(iter_base + 16, address) - cleanup_list.push(ptr38) - cleanup_list.push(address) - - () - } - PropMatches(payload43) => { - mbt_ffi_store8(iter_base + 0, 8) + PredicateValue::Text(result15) + } + 1 => { - let ptr44 = mbt_ffi_str2ptr(payload43.property_name) - mbt_ffi_store32(iter_base + 12, payload43.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr44) + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { - let ptr45 = mbt_ffi_str2ptr(payload43.pattern) - mbt_ffi_store32(iter_base + 20, payload43.pattern.length()) - mbt_ffi_store32(iter_base + 16, ptr45) - cleanup_list.push(ptr44) - cleanup_list.push(ptr45) + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } - () - } - PropStartsWith(payload46) => { - mbt_ffi_store8(iter_base + 0, 9) + PredicateNode::PropLte(PropertyComparison::{property_name : result14, value : lifted16}) + } + 6 => { - let ptr47 = mbt_ffi_str2ptr(payload46.property_name) - mbt_ffi_store32(iter_base + 12, payload46.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr47) + let result17 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr48 = mbt_ffi_str2ptr(payload46.pattern) - mbt_ffi_store32(iter_base + 20, payload46.pattern.length()) - mbt_ffi_store32(iter_base + 16, ptr48) - cleanup_list.push(ptr47) - cleanup_list.push(ptr48) + PredicateNode::PropExists(result17) + } + 7 => { - () - } - PropContains(payload49) => { - mbt_ffi_store8(iter_base + 0, 10) + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr50 = mbt_ffi_str2ptr(payload49.property_name) - mbt_ffi_store32(iter_base + 12, payload49.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr50) + let array : Array[PredicateValue] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 20)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index * 16) - let ptr51 = mbt_ffi_str2ptr(payload49.pattern) - mbt_ffi_store32(iter_base + 20, payload49.pattern.length()) - mbt_ffi_store32(iter_base + 16, ptr51) - cleanup_list.push(ptr50) - cleanup_list.push(ptr51) + let lifted20 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - PredAnd(payload52) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload52.0) - mbt_ffi_store32(iter_base + 12, payload52.1) + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - PredOr(payload53) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store32(iter_base + 8, payload53.0) - mbt_ffi_store32(iter_base + 12, payload53.1) + PredicateValue::Text(result19) + } + 1 => { - () - } - PredNot(payload54) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store32(iter_base + 8, payload54) + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 8)) + } + 2 => { - () - } - PredTrue => { - mbt_ffi_store8(iter_base + 0, 14) + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + _ => panic() + } - () - } - PredFalse => { - mbt_ffi_store8(iter_base + 0, 15) + array.push(lifted20) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - } - } - - let address135 = mbt_ffi_malloc(policy.policy.nodes.length() * 32) - for index136 = 0 - index136 < policy.policy.nodes.length() - index136 = index136 + 1 { - let iter_elem : PolicyNode = policy.policy.nodes[index136] - let iter_base = address135 + index136 * 32 - - match iter_elem { - Periodic(payload59) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store64(iter_base + 8, payload59.reinterpret_as_int64()) - - () - } - Exponential(payload60) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store64( - iter_base + 8, - payload60.base_delay.reinterpret_as_int64(), - ) - mbt_ffi_storef64(iter_base + 16, payload60.factor) - - () - } - Fibonacci(payload61) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store64(iter_base + 8, payload61.first.reinterpret_as_int64()) - mbt_ffi_store64(iter_base + 16, payload61.second.reinterpret_as_int64()) + PredicateNode::PropIn(PropertySetCheck::{property_name : result18, values : array}) + } + 8 => { - () - } - Immediate => { - mbt_ffi_store8(iter_base + 0, 3) + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Never => { - mbt_ffi_store8(iter_base + 0, 4) + let result22 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - CountBox(payload64) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store32( - iter_base + 8, - payload64.max_retries.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 12, payload64.inner) - - () - } - TimeBox(payload65) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store64(iter_base + 8, payload65.limit.reinterpret_as_int64()) - mbt_ffi_store32(iter_base + 16, payload65.inner) + PredicateNode::PropMatches(PropertyPattern::{property_name : result21, pattern : result22}) + } + 9 => { - () - } - ClampDelay(payload66) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store64( - iter_base + 8, - payload66.min_delay.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 16, - payload66.max_delay.reinterpret_as_int64(), - ) - mbt_ffi_store32(iter_base + 24, payload66.inner) - - () - } - AddDelay(payload67) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload67.delay.reinterpret_as_int64()) - mbt_ffi_store32(iter_base + 16, payload67.inner) + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Jitter(payload68) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef64(iter_base + 8, payload68.factor) - mbt_ffi_store32(iter_base + 16, payload68.inner) + let result24 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - FilteredOn(payload69) => { - mbt_ffi_store8(iter_base + 0, 10) - - let address130 = mbt_ffi_malloc(payload69.predicate.nodes.length() * 32) - for index131 = 0 - index131 < payload69.predicate.nodes.length() - index131 = index131 + 1 { - let iter_elem : PredicateNode = payload69.predicate.nodes[index131] - let iter_base = address130 + index131 * 32 - - match iter_elem { - PropEq(payload70) => { - mbt_ffi_store8(iter_base + 0, 0) - - let ptr71 = mbt_ffi_str2ptr(payload70.property_name) - mbt_ffi_store32(iter_base + 12, payload70.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr71) - - match payload70.value { - Text(payload72) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr73 = mbt_ffi_str2ptr(payload72) - mbt_ffi_store32(iter_base + 28, payload72.length()) - mbt_ffi_store32(iter_base + 24, ptr73) - cleanup_list.push(ptr73) - - () - } - Integer(payload74) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload74) - - () - } - Boolean(payload75) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload75 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr71) - - () - } - PropNeq(payload76) => { - mbt_ffi_store8(iter_base + 0, 1) - - let ptr77 = mbt_ffi_str2ptr(payload76.property_name) - mbt_ffi_store32(iter_base + 12, payload76.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr77) - - match payload76.value { - Text(payload78) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr79 = mbt_ffi_str2ptr(payload78) - mbt_ffi_store32(iter_base + 28, payload78.length()) - mbt_ffi_store32(iter_base + 24, ptr79) - cleanup_list.push(ptr79) - - () - } - Integer(payload80) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload80) - - () - } - Boolean(payload81) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload81 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr77) - - () - } - PropGt(payload82) => { - mbt_ffi_store8(iter_base + 0, 2) - - let ptr83 = mbt_ffi_str2ptr(payload82.property_name) - mbt_ffi_store32(iter_base + 12, payload82.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr83) - - match payload82.value { - Text(payload84) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr85 = mbt_ffi_str2ptr(payload84) - mbt_ffi_store32(iter_base + 28, payload84.length()) - mbt_ffi_store32(iter_base + 24, ptr85) - cleanup_list.push(ptr85) - - () - } - Integer(payload86) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload86) - - () - } - Boolean(payload87) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload87 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr83) - - () - } - PropGte(payload88) => { - mbt_ffi_store8(iter_base + 0, 3) - - let ptr89 = mbt_ffi_str2ptr(payload88.property_name) - mbt_ffi_store32(iter_base + 12, payload88.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr89) - - match payload88.value { - Text(payload90) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr91 = mbt_ffi_str2ptr(payload90) - mbt_ffi_store32(iter_base + 28, payload90.length()) - mbt_ffi_store32(iter_base + 24, ptr91) - cleanup_list.push(ptr91) - - () - } - Integer(payload92) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload92) - - () - } - Boolean(payload93) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload93 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr89) - - () - } - PropLt(payload94) => { - mbt_ffi_store8(iter_base + 0, 4) - - let ptr95 = mbt_ffi_str2ptr(payload94.property_name) - mbt_ffi_store32(iter_base + 12, payload94.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr95) - - match payload94.value { - Text(payload96) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr97 = mbt_ffi_str2ptr(payload96) - mbt_ffi_store32(iter_base + 28, payload96.length()) - mbt_ffi_store32(iter_base + 24, ptr97) - cleanup_list.push(ptr97) - - () - } - Integer(payload98) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload98) - - () - } - Boolean(payload99) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload99 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr95) - - () - } - PropLte(payload100) => { - mbt_ffi_store8(iter_base + 0, 5) - - let ptr101 = mbt_ffi_str2ptr(payload100.property_name) - mbt_ffi_store32(iter_base + 12, payload100.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr101) - - match payload100.value { - Text(payload102) => { - mbt_ffi_store8(iter_base + 16, 0) - - let ptr103 = mbt_ffi_str2ptr(payload102) - mbt_ffi_store32(iter_base + 28, payload102.length()) - mbt_ffi_store32(iter_base + 24, ptr103) - cleanup_list.push(ptr103) - - () - } - Integer(payload104) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store64(iter_base + 24, payload104) - - () - } - Boolean(payload105) => { - mbt_ffi_store8(iter_base + 16, 2) - mbt_ffi_store8(iter_base + 24, if payload105 { 1 } else { 0 }) - - () - } - } - cleanup_list.push(ptr101) - - () - } - PropExists(payload106) => { - mbt_ffi_store8(iter_base + 0, 6) + PredicateNode::PropStartsWith(PropertyPattern::{property_name : result23, pattern : result24}) + } + 10 => { - let ptr107 = mbt_ffi_str2ptr(payload106) - mbt_ffi_store32(iter_base + 12, payload106.length()) - mbt_ffi_store32(iter_base + 8, ptr107) - cleanup_list.push(ptr107) + let result25 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - PropIn(payload108) => { - mbt_ffi_store8(iter_base + 0, 7) - - let ptr109 = mbt_ffi_str2ptr(payload108.property_name) - mbt_ffi_store32(iter_base + 12, payload108.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr109) - - let address114 = mbt_ffi_malloc(payload108.values.length() * 16) - for index115 = 0 - index115 < payload108.values.length() - index115 = index115 + 1 { - let iter_elem : PredicateValue = payload108.values[index115] - let iter_base = address114 + index115 * 16 - - match iter_elem { - Text(payload110) => { - mbt_ffi_store8(iter_base + 0, 0) - - let ptr111 = mbt_ffi_str2ptr(payload110) - mbt_ffi_store32(iter_base + 12, payload110.length()) - mbt_ffi_store32(iter_base + 8, ptr111) - cleanup_list.push(ptr111) - - () - } - Integer(payload112) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store64(iter_base + 8, payload112) + let result26 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - Boolean(payload113) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store8( - iter_base + 8, - if payload113 { - 1 - } else { - 0 - }, - ) - - () + PredicateNode::PropContains(PropertyPattern::{property_name : result25, pattern : result26}) + } + 11 => { + + PredicateNode::PredAnd((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + PredicateNode::PredOr((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + PredicateNode::PredNot(mbt_ffi_load32((iter_base) + 8)) + } + 14 => { + + PredicateNode::PredTrue + } + 15 => { + + PredicateNode::PredFalse + } + _ => panic() } - } - } - mbt_ffi_store32(iter_base + 20, payload108.values.length()) - mbt_ffi_store32(iter_base + 16, address114) - cleanup_list.push(ptr109) - cleanup_list.push(address114) - - () + + array28.push(lifted27) } - PropMatches(payload116) => { - mbt_ffi_store8(iter_base + 0, 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let ptr117 = mbt_ffi_str2ptr(payload116.property_name) - mbt_ffi_store32(iter_base + 12, payload116.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr117) + let array64 : Array[PolicyNode] = []; + for index65 = 0; index65 < (mbt_ffi_load32((iter_base) + 24)); index65 = index65 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index65 * 32) - let ptr118 = mbt_ffi_str2ptr(payload116.pattern) - mbt_ffi_store32(iter_base + 20, payload116.pattern.length()) - mbt_ffi_store32(iter_base + 16, ptr118) - cleanup_list.push(ptr117) - cleanup_list.push(ptr118) + let lifted63 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - PropStartsWith(payload119) => { - mbt_ffi_store8(iter_base + 0, 9) + PolicyNode::Periodic((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 1 => { - let ptr120 = mbt_ffi_str2ptr(payload119.property_name) - mbt_ffi_store32(iter_base + 12, payload119.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr120) + PolicyNode::Exponential(ExponentialConfig::{base_delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), factor : mbt_ffi_loadf64((iter_base) + 16)}) + } + 2 => { - let ptr121 = mbt_ffi_str2ptr(payload119.pattern) - mbt_ffi_store32(iter_base + 20, payload119.pattern.length()) - mbt_ffi_store32(iter_base + 16, ptr121) - cleanup_list.push(ptr120) - cleanup_list.push(ptr121) + PolicyNode::Fibonacci(FibonacciConfig::{first : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), second : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64()}) + } + 3 => { - () - } - PropContains(payload122) => { - mbt_ffi_store8(iter_base + 0, 10) + PolicyNode::Immediate + } + 4 => { - let ptr123 = mbt_ffi_str2ptr(payload122.property_name) - mbt_ffi_store32(iter_base + 12, payload122.property_name.length()) - mbt_ffi_store32(iter_base + 8, ptr123) + PolicyNode::Never + } + 5 => { - let ptr124 = mbt_ffi_str2ptr(payload122.pattern) - mbt_ffi_store32(iter_base + 20, payload122.pattern.length()) - mbt_ffi_store32(iter_base + 16, ptr124) - cleanup_list.push(ptr123) - cleanup_list.push(ptr124) + PolicyNode::CountBox(CountBoxConfig::{max_retries : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), inner : mbt_ffi_load32((iter_base) + 12)}) + } + 6 => { - () - } - PredAnd(payload125) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload125.0) - mbt_ffi_store32(iter_base + 12, payload125.1) + PolicyNode::TimeBox(TimeBoxConfig::{limit : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 7 => { - () - } - PredOr(payload126) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store32(iter_base + 8, payload126.0) - mbt_ffi_store32(iter_base + 12, payload126.1) + PolicyNode::ClampDelay(ClampConfig::{min_delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), max_delay : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 24)}) + } + 8 => { - () - } - PredNot(payload127) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store32(iter_base + 8, payload127) + PolicyNode::AddDelay(AddDelayConfig::{delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 9 => { - () - } - PredTrue => { - mbt_ffi_store8(iter_base + 0, 14) + PolicyNode::Jitter(JitterConfig::{factor : mbt_ffi_loadf64((iter_base) + 8), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 10 => { - () - } - PredFalse => { - mbt_ffi_store8(iter_base + 0, 15) + let array61 : Array[PredicateNode] = []; + for index62 = 0; index62 < (mbt_ffi_load32((iter_base) + 12)); index62 = index62 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index62 * 32) - () - } - } - } - mbt_ffi_store32(iter_base + 12, payload69.predicate.nodes.length()) - mbt_ffi_store32(iter_base + 8, address130) - mbt_ffi_store32(iter_base + 16, payload69.inner) - cleanup_list.push(address130) - - () - } - AndThen(payload132) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload132.0) - mbt_ffi_store32(iter_base + 12, payload132.1) + let lifted60 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - PolicyUnion(payload133) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store32(iter_base + 8, payload133.0) - mbt_ffi_store32(iter_base + 12, payload133.1) + let result30 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - PolicyIntersect(payload134) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store32(iter_base + 8, payload134.0) - mbt_ffi_store32(iter_base + 12, payload134.1) + let lifted32 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result31 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result31) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropEq(PropertyComparison::{property_name : result30, value : lifted32}) + } + 1 => { + + let result33 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted35 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result34 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result34) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropNeq(PropertyComparison::{property_name : result33, value : lifted35}) + } + 2 => { + + let result36 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted38 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result37 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result37) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropGt(PropertyComparison::{property_name : result36, value : lifted38}) + } + 3 => { + + let result39 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted41 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result40 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result40) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropGte(PropertyComparison::{property_name : result39, value : lifted41}) + } + 4 => { + + let result42 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted44 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result43 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result43) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropLt(PropertyComparison::{property_name : result42, value : lifted44}) + } + 5 => { + + let result45 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted47 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result46 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result46) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropLte(PropertyComparison::{property_name : result45, value : lifted47}) + } + 6 => { + + let result48 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + PredicateNode::PropExists(result48) + } + 7 => { + + let result49 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array52 : Array[PredicateValue] = []; + for index53 = 0; index53 < (mbt_ffi_load32((iter_base) + 20)); index53 = index53 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index53 * 16) + + let lifted51 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result50 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + PredicateValue::Text(result50) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 8)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + _ => panic() + } + + array52.push(lifted51) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + PredicateNode::PropIn(PropertySetCheck::{property_name : result49, values : array52}) + } + 8 => { + + let result54 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result55 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () + PredicateNode::PropMatches(PropertyPattern::{property_name : result54, pattern : result55}) + } + 9 => { + + let result56 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result57 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + PredicateNode::PropStartsWith(PropertyPattern::{property_name : result56, pattern : result57}) + } + 10 => { + + let result58 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result59 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + PredicateNode::PropContains(PropertyPattern::{property_name : result58, pattern : result59}) + } + 11 => { + + PredicateNode::PredAnd((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + PredicateNode::PredOr((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + PredicateNode::PredNot(mbt_ffi_load32((iter_base) + 8)) + } + 14 => { + + PredicateNode::PredTrue + } + 15 => { + + PredicateNode::PredFalse + } + _ => panic() + } + + array61.push(lifted60) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + PolicyNode::FilteredOn(FilteredConfig::{predicate : RetryPredicate::{nodes : array61}, inner : mbt_ffi_load32((iter_base) + 16)}) + } + 11 => { + + PolicyNode::AndThen((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + PolicyNode::PolicyUnion((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + PolicyNode::PolicyIntersect((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } + + array64.push(lifted63) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + array66.push(NamedRetryPolicy::{name : result, priority : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), predicate : RetryPredicate::{nodes : array28}, policy : RetryPolicy::{nodes : array64}}) } - } - } - wasmImportSetRetryPolicy( - ptr, - policy.name.length(), - policy.priority.reinterpret_as_int(), - address57, - policy.predicate.nodes.length(), - address135, - policy.policy.nodes.length(), - ) - mbt_ffi_free(ptr) - mbt_ffi_free(address57) - mbt_ffi_free(address135) - - cleanup_list.each(mbt_ffi_free) -} + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array66 + mbt_ffi_free(return_area) + return ret -///| -/// Remove a named retry policy by name (persisted to oplog). -pub fn remove_retry_policy(name : String) -> Unit { - let ptr = mbt_ffi_str2ptr(name) - wasmImportRemoveRetryPolicy(ptr, name.length()) - mbt_ffi_free(ptr) } +///| +/// Get a specific retry policy by name +pub fn get_retry_policy_by_name(name : String) -> NamedRetryPolicy? { + + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(32) + wasmImportGetRetryPolicyByName(ptr, name.length(), return_area); + + let lifted66 : NamedRetryPolicy? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + let array28 : Array[PredicateNode] = []; + for index29 = 0; index29 < (mbt_ffi_load32((return_area) + 20)); index29 = index29 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 16)) + (index29 * 32) + + let lifted27 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result1) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropEq(PropertyComparison::{property_name : result0, value : lifted}) + } + 1 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted4 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result3) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropNeq(PropertyComparison::{property_name : result2, value : lifted4}) + } + 2 => { + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted7 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result6) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropGt(PropertyComparison::{property_name : result5, value : lifted7}) + } + 3 => { + + let result8 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted10 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result9 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result9) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropGte(PropertyComparison::{property_name : result8, value : lifted10}) + } + 4 => { + + let result11 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted13 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result12 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result12) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropLt(PropertyComparison::{property_name : result11, value : lifted13}) + } + 5 => { + + let result14 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted16 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result15) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropLte(PropertyComparison::{property_name : result14, value : lifted16}) + } + 6 => { + + let result17 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + PredicateNode::PropExists(result17) + } + 7 => { + + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array : Array[PredicateValue] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 20)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index * 16) + + let lifted20 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + PredicateValue::Text(result19) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 8)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + _ => panic() + } + + array.push(lifted20) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + PredicateNode::PropIn(PropertySetCheck::{property_name : result18, values : array}) + } + 8 => { + + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result22 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + PredicateNode::PropMatches(PropertyPattern::{property_name : result21, pattern : result22}) + } + 9 => { + + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result24 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + PredicateNode::PropStartsWith(PropertyPattern::{property_name : result23, pattern : result24}) + } + 10 => { + + let result25 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result26 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + PredicateNode::PropContains(PropertyPattern::{property_name : result25, pattern : result26}) + } + 11 => { + + PredicateNode::PredAnd((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + PredicateNode::PredOr((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + PredicateNode::PredNot(mbt_ffi_load32((iter_base) + 8)) + } + 14 => { + + PredicateNode::PredTrue + } + 15 => { + + PredicateNode::PredFalse + } + _ => panic() + } + + array28.push(lifted27) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 16)) + + let array64 : Array[PolicyNode] = []; + for index65 = 0; index65 < (mbt_ffi_load32((return_area) + 28)); index65 = index65 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 24)) + (index65 * 32) + + let lifted63 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + PolicyNode::Periodic((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 1 => { + + PolicyNode::Exponential(ExponentialConfig::{base_delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), factor : mbt_ffi_loadf64((iter_base) + 16)}) + } + 2 => { + + PolicyNode::Fibonacci(FibonacciConfig::{first : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), second : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64()}) + } + 3 => { + + PolicyNode::Immediate + } + 4 => { + + PolicyNode::Never + } + 5 => { + + PolicyNode::CountBox(CountBoxConfig::{max_retries : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), inner : mbt_ffi_load32((iter_base) + 12)}) + } + 6 => { + + PolicyNode::TimeBox(TimeBoxConfig::{limit : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 7 => { + + PolicyNode::ClampDelay(ClampConfig::{min_delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), max_delay : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 24)}) + } + 8 => { + + PolicyNode::AddDelay(AddDelayConfig::{delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 9 => { + + PolicyNode::Jitter(JitterConfig::{factor : mbt_ffi_loadf64((iter_base) + 8), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 10 => { + + let array61 : Array[PredicateNode] = []; + for index62 = 0; index62 < (mbt_ffi_load32((iter_base) + 12)); index62 = index62 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index62 * 32) + + let lifted60 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result30 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted32 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result31 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result31) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropEq(PropertyComparison::{property_name : result30, value : lifted32}) + } + 1 => { + + let result33 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted35 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result34 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result34) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropNeq(PropertyComparison::{property_name : result33, value : lifted35}) + } + 2 => { + + let result36 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted38 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result37 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result37) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropGt(PropertyComparison::{property_name : result36, value : lifted38}) + } + 3 => { + + let result39 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted41 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result40 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result40) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropGte(PropertyComparison::{property_name : result39, value : lifted41}) + } + 4 => { + + let result42 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted44 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result43 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result43) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropLt(PropertyComparison::{property_name : result42, value : lifted44}) + } + 5 => { + + let result45 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted47 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result46 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result46) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropLte(PropertyComparison::{property_name : result45, value : lifted47}) + } + 6 => { + + let result48 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + PredicateNode::PropExists(result48) + } + 7 => { + + let result49 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array52 : Array[PredicateValue] = []; + for index53 = 0; index53 < (mbt_ffi_load32((iter_base) + 20)); index53 = index53 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index53 * 16) + + let lifted51 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result50 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + PredicateValue::Text(result50) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 8)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + _ => panic() + } + + array52.push(lifted51) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + PredicateNode::PropIn(PropertySetCheck::{property_name : result49, values : array52}) + } + 8 => { + + let result54 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result55 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + PredicateNode::PropMatches(PropertyPattern::{property_name : result54, pattern : result55}) + } + 9 => { + + let result56 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result57 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + PredicateNode::PropStartsWith(PropertyPattern::{property_name : result56, pattern : result57}) + } + 10 => { + + let result58 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result59 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + PredicateNode::PropContains(PropertyPattern::{property_name : result58, pattern : result59}) + } + 11 => { + + PredicateNode::PredAnd((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + PredicateNode::PredOr((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + PredicateNode::PredNot(mbt_ffi_load32((iter_base) + 8)) + } + 14 => { + + PredicateNode::PredTrue + } + 15 => { + + PredicateNode::PredFalse + } + _ => panic() + } + + array61.push(lifted60) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + PolicyNode::FilteredOn(FilteredConfig::{predicate : RetryPredicate::{nodes : array61}, inner : mbt_ffi_load32((iter_base) + 16)}) + } + 11 => { + + PolicyNode::AndThen((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + PolicyNode::PolicyUnion((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + PolicyNode::PolicyIntersect((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } + + array64.push(lifted63) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 24)) + + Option::Some(NamedRetryPolicy::{name : result, priority : (mbt_ffi_load32((return_area) + 12)).reinterpret_as_uint(), predicate : RetryPredicate::{nodes : array28}, policy : RetryPolicy::{nodes : array64}}) + } + _ => panic() + } + let ret = lifted66 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} +///| +/// Resolve the matching retry policy for a given operation context. +/// Evaluates named policies in descending priority order; returns the +/// policy from the first rule whose predicate matches, or none. +pub fn resolve_retry_policy(verb : String, noun_uri : String, properties : Array[(String, PredicateValue)]) -> RetryPolicy? { + let cleanup_list : Array[Int] = [] + + let ptr = mbt_ffi_str2ptr(verb) + + let ptr0 = mbt_ffi_str2ptr(noun_uri) + + let address = mbt_ffi_malloc((properties).length() * 24); + for index = 0; index < (properties).length(); index = index + 1 { + let iter_elem : (String, PredicateValue) = (properties)[(index)] + let iter_base = address + (index * 24); + + let ptr1 = mbt_ffi_str2ptr((iter_elem).0) + mbt_ffi_store32((iter_base) + 4, (iter_elem).0.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + match (iter_elem).1 { + Text(payload) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + let ptr2 = mbt_ffi_str2ptr(payload) + mbt_ffi_store32((iter_base) + 20, payload.length()) + mbt_ffi_store32((iter_base) + 16, ptr2) + cleanup_list.push(ptr2) + + () + } + Integer(payload3) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store64((iter_base) + 16, payload3) + + () + } + Boolean(payload4) => { + mbt_ffi_store8((iter_base) + 8, (2)) + mbt_ffi_store8((iter_base) + 16, (if payload4 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr1) + + } + let return_area = mbt_ffi_malloc(12) + wasmImportResolveRetryPolicy(ptr, verb.length(), ptr0, noun_uri.length(), address, (properties).length(), return_area); + + let lifted38 : RetryPolicy? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let array36 : Array[PolicyNode] = []; + for index37 = 0; index37 < (mbt_ffi_load32((return_area) + 8)); index37 = index37 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index37 * 32) + + let lifted35 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + PolicyNode::Periodic((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 1 => { + + PolicyNode::Exponential(ExponentialConfig::{base_delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), factor : mbt_ffi_loadf64((iter_base) + 16)}) + } + 2 => { + + PolicyNode::Fibonacci(FibonacciConfig::{first : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), second : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64()}) + } + 3 => { + + PolicyNode::Immediate + } + 4 => { + + PolicyNode::Never + } + 5 => { + + PolicyNode::CountBox(CountBoxConfig::{max_retries : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), inner : mbt_ffi_load32((iter_base) + 12)}) + } + 6 => { + + PolicyNode::TimeBox(TimeBoxConfig::{limit : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 7 => { + + PolicyNode::ClampDelay(ClampConfig::{min_delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), max_delay : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 24)}) + } + 8 => { + + PolicyNode::AddDelay(AddDelayConfig::{delay : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 9 => { + + PolicyNode::Jitter(JitterConfig::{factor : mbt_ffi_loadf64((iter_base) + 8), inner : mbt_ffi_load32((iter_base) + 16)}) + } + 10 => { + + let array33 : Array[PredicateNode] = []; + for index34 = 0; index34 < (mbt_ffi_load32((iter_base) + 12)); index34 = index34 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index34 * 32) + + let lifted32 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result5) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropEq(PropertyComparison::{property_name : result, value : lifted}) + } + 1 => { + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted8 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result7 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result7) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropNeq(PropertyComparison::{property_name : result6, value : lifted8}) + } + 2 => { + + let result9 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted11 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result10 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result10) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropGt(PropertyComparison::{property_name : result9, value : lifted11}) + } + 3 => { + + let result12 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted14 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result13 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result13) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropGte(PropertyComparison::{property_name : result12, value : lifted14}) + } + 4 => { + + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted17 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result16 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result16) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropLt(PropertyComparison::{property_name : result15, value : lifted17}) + } + 5 => { + + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted20 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + PredicateValue::Text(result19) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 24)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 24) != 0)) + } + _ => panic() + } + + PredicateNode::PropLte(PropertyComparison::{property_name : result18, value : lifted20}) + } + 6 => { + + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + PredicateNode::PropExists(result21) + } + 7 => { + + let result22 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array : Array[PredicateValue] = []; + for index25 = 0; index25 < (mbt_ffi_load32((iter_base) + 20)); index25 = index25 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index25 * 16) + + let lifted24 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + PredicateValue::Text(result23) + } + 1 => { + + PredicateValue::Integer(mbt_ffi_load64((iter_base) + 8)) + } + 2 => { + + PredicateValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + _ => panic() + } + + array.push(lifted24) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + PredicateNode::PropIn(PropertySetCheck::{property_name : result22, values : array}) + } + 8 => { + + let result26 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result27 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + PredicateNode::PropMatches(PropertyPattern::{property_name : result26, pattern : result27}) + } + 9 => { + + let result28 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result29 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + PredicateNode::PropStartsWith(PropertyPattern::{property_name : result28, pattern : result29}) + } + 10 => { + + let result30 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result31 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + PredicateNode::PropContains(PropertyPattern::{property_name : result30, pattern : result31}) + } + 11 => { + + PredicateNode::PredAnd((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + PredicateNode::PredOr((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + PredicateNode::PredNot(mbt_ffi_load32((iter_base) + 8)) + } + 14 => { + + PredicateNode::PredTrue + } + 15 => { + + PredicateNode::PredFalse + } + _ => panic() + } + + array33.push(lifted32) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + PolicyNode::FilteredOn(FilteredConfig::{predicate : RetryPredicate::{nodes : array33}, inner : mbt_ffi_load32((iter_base) + 16)}) + } + 11 => { + + PolicyNode::AndThen((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 12 => { + + PolicyNode::PolicyUnion((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + 13 => { + + PolicyNode::PolicyIntersect((mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } + + array36.push(lifted35) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) + + Option::Some(RetryPolicy::{nodes : array36}) + } + _ => panic() + } + let ret = lifted38 + mbt_ffi_free(ptr) + mbt_ffi_free(ptr0) + mbt_ffi_free(address) + mbt_ffi_free(return_area) + + cleanup_list.each(mbt_ffi_free) + return ret + +} +///| +/// Add or overwrite a named retry policy (persisted to oplog). +/// If a policy with the same name exists, it is replaced. +pub fn set_retry_policy(policy : NamedRetryPolicy) -> Unit { + let cleanup_list : Array[Int] = [] + + let ptr = mbt_ffi_str2ptr((policy).name) + + let address57 = mbt_ffi_malloc((((policy).predicate).nodes).length() * 32); + for index58 = 0; index58 < (((policy).predicate).nodes).length(); index58 = index58 + 1 { + let iter_elem : PredicateNode = (((policy).predicate).nodes)[(index58)] + let iter_base = address57 + (index58 * 32); + + match iter_elem { + PropEq(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + + let ptr0 = mbt_ffi_str2ptr((payload).property_name) + mbt_ffi_store32((iter_base) + 12, (payload).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr0) + + match (payload).value { + Text(payload1) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr2 = mbt_ffi_str2ptr(payload1) + mbt_ffi_store32((iter_base) + 28, payload1.length()) + mbt_ffi_store32((iter_base) + 24, ptr2) + cleanup_list.push(ptr2) + + () + } + Integer(payload3) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload3) + + () + } + Boolean(payload4) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload4 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr0) + + () + } + PropNeq(payload5) => { + mbt_ffi_store8((iter_base) + 0, (1)) + + let ptr6 = mbt_ffi_str2ptr((payload5).property_name) + mbt_ffi_store32((iter_base) + 12, (payload5).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr6) + + match (payload5).value { + Text(payload7) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr8 = mbt_ffi_str2ptr(payload7) + mbt_ffi_store32((iter_base) + 28, payload7.length()) + mbt_ffi_store32((iter_base) + 24, ptr8) + cleanup_list.push(ptr8) + + () + } + Integer(payload9) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload9) + + () + } + Boolean(payload10) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload10 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr6) + + () + } + PropGt(payload11) => { + mbt_ffi_store8((iter_base) + 0, (2)) + + let ptr12 = mbt_ffi_str2ptr((payload11).property_name) + mbt_ffi_store32((iter_base) + 12, (payload11).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr12) + + match (payload11).value { + Text(payload13) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr14 = mbt_ffi_str2ptr(payload13) + mbt_ffi_store32((iter_base) + 28, payload13.length()) + mbt_ffi_store32((iter_base) + 24, ptr14) + cleanup_list.push(ptr14) + + () + } + Integer(payload15) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload15) + + () + } + Boolean(payload16) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload16 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr12) + + () + } + PropGte(payload17) => { + mbt_ffi_store8((iter_base) + 0, (3)) + + let ptr18 = mbt_ffi_str2ptr((payload17).property_name) + mbt_ffi_store32((iter_base) + 12, (payload17).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr18) + + match (payload17).value { + Text(payload19) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr20 = mbt_ffi_str2ptr(payload19) + mbt_ffi_store32((iter_base) + 28, payload19.length()) + mbt_ffi_store32((iter_base) + 24, ptr20) + cleanup_list.push(ptr20) + + () + } + Integer(payload21) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload21) + + () + } + Boolean(payload22) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload22 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr18) + + () + } + PropLt(payload23) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + let ptr24 = mbt_ffi_str2ptr((payload23).property_name) + mbt_ffi_store32((iter_base) + 12, (payload23).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr24) + + match (payload23).value { + Text(payload25) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr26 = mbt_ffi_str2ptr(payload25) + mbt_ffi_store32((iter_base) + 28, payload25.length()) + mbt_ffi_store32((iter_base) + 24, ptr26) + cleanup_list.push(ptr26) + + () + } + Integer(payload27) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload27) + + () + } + Boolean(payload28) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload28 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr24) + + () + } + PropLte(payload29) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + let ptr30 = mbt_ffi_str2ptr((payload29).property_name) + mbt_ffi_store32((iter_base) + 12, (payload29).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr30) + + match (payload29).value { + Text(payload31) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr32 = mbt_ffi_str2ptr(payload31) + mbt_ffi_store32((iter_base) + 28, payload31.length()) + mbt_ffi_store32((iter_base) + 24, ptr32) + cleanup_list.push(ptr32) + + () + } + Integer(payload33) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload33) + + () + } + Boolean(payload34) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload34 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr30) + + () + } + PropExists(payload35) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + let ptr36 = mbt_ffi_str2ptr(payload35) + mbt_ffi_store32((iter_base) + 12, payload35.length()) + mbt_ffi_store32((iter_base) + 8, ptr36) + cleanup_list.push(ptr36) + + () + } + PropIn(payload37) => { + mbt_ffi_store8((iter_base) + 0, (7)) + + let ptr38 = mbt_ffi_str2ptr((payload37).property_name) + mbt_ffi_store32((iter_base) + 12, (payload37).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr38) + + let address = mbt_ffi_malloc(((payload37).values).length() * 16); + for index = 0; index < ((payload37).values).length(); index = index + 1 { + let iter_elem : PredicateValue = ((payload37).values)[(index)] + let iter_base = address + (index * 16); + + match iter_elem { + Text(payload39) => { + mbt_ffi_store8((iter_base) + 0, (0)) + + let ptr40 = mbt_ffi_str2ptr(payload39) + mbt_ffi_store32((iter_base) + 12, payload39.length()) + mbt_ffi_store32((iter_base) + 8, ptr40) + cleanup_list.push(ptr40) + + () + } + Integer(payload41) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store64((iter_base) + 8, payload41) + + () + } + Boolean(payload42) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store8((iter_base) + 8, (if payload42 { 1 } else { 0 })) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 20, ((payload37).values).length()) + mbt_ffi_store32((iter_base) + 16, address) + cleanup_list.push(ptr38) + cleanup_list.push(address) + + () + } + PropMatches(payload43) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + let ptr44 = mbt_ffi_str2ptr((payload43).property_name) + mbt_ffi_store32((iter_base) + 12, (payload43).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) + + let ptr45 = mbt_ffi_str2ptr((payload43).pattern) + mbt_ffi_store32((iter_base) + 20, (payload43).pattern.length()) + mbt_ffi_store32((iter_base) + 16, ptr45) + cleanup_list.push(ptr44) + cleanup_list.push(ptr45) + + () + } + PropStartsWith(payload46) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr47 = mbt_ffi_str2ptr((payload46).property_name) + mbt_ffi_store32((iter_base) + 12, (payload46).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr47) + + let ptr48 = mbt_ffi_str2ptr((payload46).pattern) + mbt_ffi_store32((iter_base) + 20, (payload46).pattern.length()) + mbt_ffi_store32((iter_base) + 16, ptr48) + cleanup_list.push(ptr47) + cleanup_list.push(ptr48) + + () + } + PropContains(payload49) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + let ptr50 = mbt_ffi_str2ptr((payload49).property_name) + mbt_ffi_store32((iter_base) + 12, (payload49).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr50) + + let ptr51 = mbt_ffi_str2ptr((payload49).pattern) + mbt_ffi_store32((iter_base) + 20, (payload49).pattern.length()) + mbt_ffi_store32((iter_base) + 16, ptr51) + cleanup_list.push(ptr50) + cleanup_list.push(ptr51) + + () + } + PredAnd(payload52) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload52).0) + mbt_ffi_store32((iter_base) + 12, (payload52).1) + + () + } + PredOr(payload53) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store32((iter_base) + 8, (payload53).0) + mbt_ffi_store32((iter_base) + 12, (payload53).1) + + () + } + PredNot(payload54) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store32((iter_base) + 8, payload54) + + () + } + PredTrue => { + mbt_ffi_store8((iter_base) + 0, (14)) + + () + } + PredFalse => { + mbt_ffi_store8((iter_base) + 0, (15)) + + () + } + } + + } + + let address135 = mbt_ffi_malloc((((policy).policy).nodes).length() * 32); + for index136 = 0; index136 < (((policy).policy).nodes).length(); index136 = index136 + 1 { + let iter_elem : PolicyNode = (((policy).policy).nodes)[(index136)] + let iter_base = address135 + (index136 * 32); + + match iter_elem { + Periodic(payload59) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store64((iter_base) + 8, (payload59).reinterpret_as_int64()) + + () + } + Exponential(payload60) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store64((iter_base) + 8, ((payload60).base_delay).reinterpret_as_int64()) + mbt_ffi_storef64((iter_base) + 16, (payload60).factor) + + () + } + Fibonacci(payload61) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store64((iter_base) + 8, ((payload61).first).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload61).second).reinterpret_as_int64()) + + () + } + Immediate => { + mbt_ffi_store8((iter_base) + 0, (3)) + + () + } + Never => { + mbt_ffi_store8((iter_base) + 0, (4)) + + () + } + CountBox(payload64) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store32((iter_base) + 8, ((payload64).max_retries).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 12, (payload64).inner) + + () + } + TimeBox(payload65) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store64((iter_base) + 8, ((payload65).limit).reinterpret_as_int64()) + mbt_ffi_store32((iter_base) + 16, (payload65).inner) + + () + } + ClampDelay(payload66) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store64((iter_base) + 8, ((payload66).min_delay).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload66).max_delay).reinterpret_as_int64()) + mbt_ffi_store32((iter_base) + 24, (payload66).inner) + + () + } + AddDelay(payload67) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, ((payload67).delay).reinterpret_as_int64()) + mbt_ffi_store32((iter_base) + 16, (payload67).inner) + + () + } + Jitter(payload68) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef64((iter_base) + 8, (payload68).factor) + mbt_ffi_store32((iter_base) + 16, (payload68).inner) + + () + } + FilteredOn(payload69) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + let address130 = mbt_ffi_malloc((((payload69).predicate).nodes).length() * 32); + for index131 = 0; index131 < (((payload69).predicate).nodes).length(); index131 = index131 + 1 { + let iter_elem : PredicateNode = (((payload69).predicate).nodes)[(index131)] + let iter_base = address130 + (index131 * 32); + + match iter_elem { + PropEq(payload70) => { + mbt_ffi_store8((iter_base) + 0, (0)) + + let ptr71 = mbt_ffi_str2ptr((payload70).property_name) + mbt_ffi_store32((iter_base) + 12, (payload70).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr71) + + match (payload70).value { + Text(payload72) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr73 = mbt_ffi_str2ptr(payload72) + mbt_ffi_store32((iter_base) + 28, payload72.length()) + mbt_ffi_store32((iter_base) + 24, ptr73) + cleanup_list.push(ptr73) + + () + } + Integer(payload74) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload74) + + () + } + Boolean(payload75) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload75 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr71) + + () + } + PropNeq(payload76) => { + mbt_ffi_store8((iter_base) + 0, (1)) + + let ptr77 = mbt_ffi_str2ptr((payload76).property_name) + mbt_ffi_store32((iter_base) + 12, (payload76).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr77) + + match (payload76).value { + Text(payload78) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr79 = mbt_ffi_str2ptr(payload78) + mbt_ffi_store32((iter_base) + 28, payload78.length()) + mbt_ffi_store32((iter_base) + 24, ptr79) + cleanup_list.push(ptr79) + + () + } + Integer(payload80) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload80) + + () + } + Boolean(payload81) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload81 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr77) + + () + } + PropGt(payload82) => { + mbt_ffi_store8((iter_base) + 0, (2)) + + let ptr83 = mbt_ffi_str2ptr((payload82).property_name) + mbt_ffi_store32((iter_base) + 12, (payload82).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr83) + + match (payload82).value { + Text(payload84) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr85 = mbt_ffi_str2ptr(payload84) + mbt_ffi_store32((iter_base) + 28, payload84.length()) + mbt_ffi_store32((iter_base) + 24, ptr85) + cleanup_list.push(ptr85) + + () + } + Integer(payload86) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload86) + + () + } + Boolean(payload87) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload87 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr83) + + () + } + PropGte(payload88) => { + mbt_ffi_store8((iter_base) + 0, (3)) + + let ptr89 = mbt_ffi_str2ptr((payload88).property_name) + mbt_ffi_store32((iter_base) + 12, (payload88).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr89) + + match (payload88).value { + Text(payload90) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr91 = mbt_ffi_str2ptr(payload90) + mbt_ffi_store32((iter_base) + 28, payload90.length()) + mbt_ffi_store32((iter_base) + 24, ptr91) + cleanup_list.push(ptr91) + + () + } + Integer(payload92) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload92) + + () + } + Boolean(payload93) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload93 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr89) + + () + } + PropLt(payload94) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + let ptr95 = mbt_ffi_str2ptr((payload94).property_name) + mbt_ffi_store32((iter_base) + 12, (payload94).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr95) + + match (payload94).value { + Text(payload96) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr97 = mbt_ffi_str2ptr(payload96) + mbt_ffi_store32((iter_base) + 28, payload96.length()) + mbt_ffi_store32((iter_base) + 24, ptr97) + cleanup_list.push(ptr97) + + () + } + Integer(payload98) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload98) + + () + } + Boolean(payload99) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload99 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr95) + + () + } + PropLte(payload100) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + let ptr101 = mbt_ffi_str2ptr((payload100).property_name) + mbt_ffi_store32((iter_base) + 12, (payload100).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr101) + + match (payload100).value { + Text(payload102) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let ptr103 = mbt_ffi_str2ptr(payload102) + mbt_ffi_store32((iter_base) + 28, payload102.length()) + mbt_ffi_store32((iter_base) + 24, ptr103) + cleanup_list.push(ptr103) + + () + } + Integer(payload104) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store64((iter_base) + 24, payload104) + + () + } + Boolean(payload105) => { + mbt_ffi_store8((iter_base) + 16, (2)) + mbt_ffi_store8((iter_base) + 24, (if payload105 { 1 } else { 0 })) + + () + } + } + cleanup_list.push(ptr101) + + () + } + PropExists(payload106) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + let ptr107 = mbt_ffi_str2ptr(payload106) + mbt_ffi_store32((iter_base) + 12, payload106.length()) + mbt_ffi_store32((iter_base) + 8, ptr107) + cleanup_list.push(ptr107) + + () + } + PropIn(payload108) => { + mbt_ffi_store8((iter_base) + 0, (7)) + + let ptr109 = mbt_ffi_str2ptr((payload108).property_name) + mbt_ffi_store32((iter_base) + 12, (payload108).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr109) + + let address114 = mbt_ffi_malloc(((payload108).values).length() * 16); + for index115 = 0; index115 < ((payload108).values).length(); index115 = index115 + 1 { + let iter_elem : PredicateValue = ((payload108).values)[(index115)] + let iter_base = address114 + (index115 * 16); + + match iter_elem { + Text(payload110) => { + mbt_ffi_store8((iter_base) + 0, (0)) + + let ptr111 = mbt_ffi_str2ptr(payload110) + mbt_ffi_store32((iter_base) + 12, payload110.length()) + mbt_ffi_store32((iter_base) + 8, ptr111) + cleanup_list.push(ptr111) + + () + } + Integer(payload112) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store64((iter_base) + 8, payload112) + + () + } + Boolean(payload113) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store8((iter_base) + 8, (if payload113 { 1 } else { 0 })) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 20, ((payload108).values).length()) + mbt_ffi_store32((iter_base) + 16, address114) + cleanup_list.push(ptr109) + cleanup_list.push(address114) + + () + } + PropMatches(payload116) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + let ptr117 = mbt_ffi_str2ptr((payload116).property_name) + mbt_ffi_store32((iter_base) + 12, (payload116).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr117) + + let ptr118 = mbt_ffi_str2ptr((payload116).pattern) + mbt_ffi_store32((iter_base) + 20, (payload116).pattern.length()) + mbt_ffi_store32((iter_base) + 16, ptr118) + cleanup_list.push(ptr117) + cleanup_list.push(ptr118) + + () + } + PropStartsWith(payload119) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr120 = mbt_ffi_str2ptr((payload119).property_name) + mbt_ffi_store32((iter_base) + 12, (payload119).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr120) + + let ptr121 = mbt_ffi_str2ptr((payload119).pattern) + mbt_ffi_store32((iter_base) + 20, (payload119).pattern.length()) + mbt_ffi_store32((iter_base) + 16, ptr121) + cleanup_list.push(ptr120) + cleanup_list.push(ptr121) + + () + } + PropContains(payload122) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + let ptr123 = mbt_ffi_str2ptr((payload122).property_name) + mbt_ffi_store32((iter_base) + 12, (payload122).property_name.length()) + mbt_ffi_store32((iter_base) + 8, ptr123) + + let ptr124 = mbt_ffi_str2ptr((payload122).pattern) + mbt_ffi_store32((iter_base) + 20, (payload122).pattern.length()) + mbt_ffi_store32((iter_base) + 16, ptr124) + cleanup_list.push(ptr123) + cleanup_list.push(ptr124) + + () + } + PredAnd(payload125) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload125).0) + mbt_ffi_store32((iter_base) + 12, (payload125).1) + + () + } + PredOr(payload126) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store32((iter_base) + 8, (payload126).0) + mbt_ffi_store32((iter_base) + 12, (payload126).1) + + () + } + PredNot(payload127) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store32((iter_base) + 8, payload127) + + () + } + PredTrue => { + mbt_ffi_store8((iter_base) + 0, (14)) + + () + } + PredFalse => { + mbt_ffi_store8((iter_base) + 0, (15)) + + () + } + } + + } + mbt_ffi_store32((iter_base) + 12, (((payload69).predicate).nodes).length()) + mbt_ffi_store32((iter_base) + 8, address130) + mbt_ffi_store32((iter_base) + 16, (payload69).inner) + cleanup_list.push(address130) + + () + } + AndThen(payload132) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload132).0) + mbt_ffi_store32((iter_base) + 12, (payload132).1) + + () + } + PolicyUnion(payload133) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store32((iter_base) + 8, (payload133).0) + mbt_ffi_store32((iter_base) + 12, (payload133).1) + + () + } + PolicyIntersect(payload134) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store32((iter_base) + 8, (payload134).0) + mbt_ffi_store32((iter_base) + 12, (payload134).1) + + () + } + } + + } + wasmImportSetRetryPolicy(ptr, (policy).name.length(), ((policy).priority).reinterpret_as_int(), address57, (((policy).predicate).nodes).length(), address135, (((policy).policy).nodes).length()); + mbt_ffi_free(ptr) + mbt_ffi_free(address57) + mbt_ffi_free(address135) + + cleanup_list.each(mbt_ffi_free) + +} +///| +/// Remove a named retry policy by name (persisted to oplog). +pub fn remove_retry_policy(name : String) -> Unit { + + let ptr = mbt_ffi_str2ptr(name) + wasmImportRemoveRetryPolicy(ptr, name.length()); + mbt_ffi_free(ptr) + +} + diff --git a/sdks/moonbit/golem_sdk/interface/golem/core/types/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/core/types/ffi.mbt index 02956c85ba..8cf7042e3f 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/core/types/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/core/types/ffi.mbt @@ -1,48 +1,47 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropQuotaToken(resource : Int) = "golem:core/types@2.0.0" "[resource-drop]quota-token" -///| fn wasmImportResourceDropSecret(resource : Int) = "golem:core/types@2.0.0" "[resource-drop]secret" -///| -fn wasmImportParseUuid(p0 : Int, p1 : Int, p2 : Int) = "golem:core/types@2.0.0" "parse-uuid" +fn wasmImportResourceDropPermissionCard(resource : Int) = "golem:core/types@2.0.0" "[resource-drop]permission-card" -///| -fn wasmImportUuidToString(p0 : Int64, p1 : Int64, p2 : Int) = "golem:core/types@2.0.0" "uuid-to-string" +fn wasmImportParseUuid(p0 : Int, p1 : Int, p2 : Int) = "golem:core/types@2.0.0" "parse-uuid" -///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +fn wasmImportUuidToString(p0 : Int64, p1 : Int64, p2 : Int) = "golem:core/types@2.0.0" "uuid-to-string" ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) + +///| +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/core/types/pkg.generated.mbti b/sdks/moonbit/golem_sdk/interface/golem/core/types/pkg.generated.mbti index 17928cc385..0b1bc36fe2 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/core/types/pkg.generated.mbti +++ b/sdks/moonbit/golem_sdk/interface/golem/core/types/pkg.generated.mbti @@ -128,6 +128,13 @@ pub(all) struct PathSpec { allowed_extensions : Array[String]? } derive(Eq, Show) +pub(all) struct PermissionCard(Int) derive(Eq, Show) +pub fn PermissionCard::drop(Self) -> Unit + +pub(all) struct PermissionCardSpec { + polymorphic : Bool +} derive(Eq, Show) + pub(all) struct PromiseId { agent_id : AgentId oplog_idx : UInt64 @@ -211,6 +218,7 @@ pub(all) enum SchemaTypeBody { UnionType(UnionSpec) SecretType(SecretSpec) QuotaTokenType(QuotaTokenSpec) + PermissionCardType(PermissionCardSpec) FutureType(Int?) StreamType(Int?) } derive(Eq, Show) @@ -260,6 +268,7 @@ pub(all) enum SchemaValueNode { UnionValue(UnionValuePayload) SecretValue(Secret) QuotaTokenHandle(QuotaToken) + PermissionCardHandle(PermissionCard) } derive(Eq, Show) pub(all) struct SchemaValueTree { diff --git a/sdks/moonbit/golem_sdk/interface/golem/core/types/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/core/types/top.mbt index 8724dbfbd2..23179dfa8e 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/core/types/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/core/types/top.mbt @@ -1,25 +1,19 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// ============================================================ /// Common embedded value types /// ============================================================ pub(all) struct Uuid { - high_bits : UInt64 - low_bits : UInt64 + high_bits : UInt64; low_bits : UInt64 } derive(Show, Eq) - ///| pub(all) struct Datetime { - seconds : Int64 - nanoseconds : UInt + seconds : Int64; nanoseconds : UInt } derive(Show, Eq) - ///| pub(all) struct EnvironmentId { - uuid : Uuid + uuid : Uuid } derive(Show, Eq) - ///| /// ============================================================ /// Platform identifiers @@ -29,37 +23,30 @@ pub(all) struct EnvironmentId { /// here lets migrated interfaces depend on a single core version. /// Represents a Golem component pub(all) struct ComponentId { - uuid : Uuid + uuid : Uuid } derive(Show, Eq) - ///| /// Represents a Golem agent pub(all) struct AgentId { - component_id : ComponentId - agent_id : String + component_id : ComponentId; agent_id : String } derive(Show, Eq) - ///| /// Represents a Golem account pub(all) struct AccountId { - uuid : Uuid + uuid : Uuid } derive(Show, Eq) - ///| /// Represents a Golem permission card pub(all) struct CardId { - uuid : Uuid + uuid : Uuid } derive(Show, Eq) - ///| /// A promise ID is a value that can be passed to an external Golem API to /// complete that promise from an arbitrary external source, while Golem /// agents can await for this completion. pub(all) struct PromiseId { - agent_id : AgentId - oplog_idx : UInt64 + agent_id : AgentId; oplog_idx : UInt64 } derive(Show, Eq) - ///| /// ============================================================ /// Capability resources @@ -73,26 +60,39 @@ pub(all) struct PromiseId { /// representation at the boundary. pub(all) struct QuotaToken(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn QuotaToken::drop(self : QuotaToken) -> Unit { - let QuotaToken(resource) = self - wasmImportResourceDropQuotaToken(resource) + let QuotaToken(resource) = self + wasmImportResourceDropQuotaToken(resource) } - ///| /// An unforgeable handle to sensitive material held by the runtime. The /// handle is opaque to guests: components can pass it through schema values /// and reveal it only through capability-gated host interfaces. pub(all) struct Secret(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Secret::drop(self : Secret) -> Unit { - let Secret(resource) = self - wasmImportResourceDropSecret(resource) + let Secret(resource) = self + wasmImportResourceDropSecret(resource) } +///| +/// An unforgeable handle to a permission card held by the runtime. The +/// handle is opaque to guests: components can hold, pass, derive, install, +/// and revoke cards only through the `golem:permissions` interfaces. When +/// carried in a `schema-value-tree` (see +/// `schema-value-node::permission-card-handle`) the handle is transferred +/// by ownership; the host converts it to/from its internal trusted +/// card-store representation at the boundary. The wire form is the card-id +/// (UUID) alone — no grants, parents, or metadata cross the wire as +/// authority. +pub(all) struct PermissionCard(Int) derive(Show, Eq) +/// Drops a resource handle. +pub fn PermissionCard::drop(self : PermissionCard) -> Unit { + let PermissionCard(resource) = self + wasmImportResourceDropPermissionCard(resource) +} ///| /// A named type definition inside a `schema-graph`. /// @@ -100,217 +100,155 @@ pub fn Secret::drop(self : Secret) -> Unit { /// referenced `schema-type-node` so there is one source of truth for /// docs / aliases / examples / deprecation / role on each type. pub(all) struct SchemaTypeDef { - id : String - name : String? - body : Int + id : String; name : String?; body : Int } derive(Show, Eq) - ///| /// Open registry; unknown roles fall back to structural handling. pub(all) enum Role { - Multimodal - UnstructuredText - UnstructuredBinary - Other(String) + Multimodal + UnstructuredText + UnstructuredBinary + Other(String) } derive(Show, Eq) - ///| /// Typed metadata envelope. Holds non-validation, non-rendering-critical /// information (docs, aliases, examples, deprecation, role). Per-scalar /// validation constraints live on the relevant scalar's typed substructure, /// not here. pub(all) struct MetadataEnvelope { - doc : String? - aliases : Array[String] - examples : Array[String] - deprecated : String? - role : Role? + doc : String?; aliases : Array[String]; examples : Array[String]; deprecated : String?; role : Role? } derive(Show, Eq) - ///| pub(all) struct NamedFieldType { - name : String - body : Int - metadata : MetadataEnvelope + name : String; body : Int; metadata : MetadataEnvelope } derive(Show, Eq) - ///| pub(all) struct VariantCaseType { - name : String - payload : Int? - metadata : MetadataEnvelope + name : String; payload : Int?; metadata : MetadataEnvelope } derive(Show, Eq) - ///| pub(all) struct FixedListSpec { - element : Int - length : UInt + element : Int; length : UInt } derive(Show, Eq) - ///| /// Map key types are restricted to primitives. Enforced at schema /// construction time, not by the WIT type itself. pub(all) struct MapSpec { - key : Int - value : Int + key : Int; value : Int } derive(Show, Eq) - ///| pub(all) struct ResultSpec { - ok : Int? - err : Int? + ok : Int?; err : Int? } derive(Show, Eq) - ///| /// --- Numeric restrictions --- /// A numeric bound usable across every numeric representation. Float bounds /// carry canonical IEEE-754 `f64` bits (NaN/inf rejected, -0.0 normalized); /// comparisons decode the bits to `f64` and compare numerically. pub(all) enum NumericBound { - Signed(Int64) - Unsigned(UInt64) - FloatBits(UInt64) + Signed(Int64) + Unsigned(UInt64) + FloatBits(UInt64) } derive(Show, Eq) - ///| /// Inline numeric refinement. `none` on a numeric type means unconstrained /// (the common case). The empty restriction set is never encoded as `some`: /// producers normalize it to `none`, decoders normalize a decoded empty to /// `none`. `unit` is schema/help metadata only. pub(all) struct NumericRestrictions { - min : NumericBound? - max : NumericBound? - unit : String? + min : NumericBound?; max : NumericBound?; unit : String? } derive(Show, Eq) - ///| /// --- Text / Binary restrictions --- pub(all) struct TextRestrictions { - languages : Array[String]? - min_length : UInt? - max_length : UInt? - regex : String? + languages : Array[String]?; min_length : UInt?; max_length : UInt?; regex : String? } derive(Show, Eq) - ///| pub(all) struct BinaryRestrictions { - mime_types : Array[String]? - min_bytes : UInt? - max_bytes : UInt? + mime_types : Array[String]?; min_bytes : UInt?; max_bytes : UInt? } derive(Show, Eq) - ///| /// --- Path --- pub(all) enum PathDirection { - INPUT - OUTPUT - IN_OUT + INPUT; OUTPUT; IN_OUT } derive(Show, Eq) -///| pub fn PathDirection::ordinal(self : PathDirection) -> Int { - match self { - INPUT => 0 - OUTPUT => 1 - IN_OUT => 2 - } + match self { + INPUT => 0 + OUTPUT => 1 + IN_OUT => 2 + } } -///| pub fn PathDirection::from(self : Int) -> PathDirection { - match self { - 0 => INPUT - 1 => OUTPUT - 2 => IN_OUT - _ => panic() - } + match self { + 0 => INPUT + 1 => OUTPUT + 2 => IN_OUT + _ => panic() + } } - ///| pub(all) enum PathKind { - FILE - DIRECTORY - ANY + FILE; DIRECTORY; ANY } derive(Show, Eq) -///| pub fn PathKind::ordinal(self : PathKind) -> Int { - match self { - FILE => 0 - DIRECTORY => 1 - ANY => 2 - } + match self { + FILE => 0 + DIRECTORY => 1 + ANY => 2 + } } -///| pub fn PathKind::from(self : Int) -> PathKind { - match self { - 0 => FILE - 1 => DIRECTORY - 2 => ANY - _ => panic() - } + match self { + 0 => FILE + 1 => DIRECTORY + 2 => ANY + _ => panic() + } } - ///| pub(all) struct PathSpec { - direction : PathDirection - kind : PathKind - allowed_mime_types : Array[String]? - allowed_extensions : Array[String]? + direction : PathDirection; kind : PathKind; allowed_mime_types : Array[String]?; allowed_extensions : Array[String]? } derive(Show, Eq) - ///| /// --- URL --- pub(all) struct UrlRestrictions { - allowed_schemes : Array[String]? - allowed_hosts : Array[String]? + allowed_schemes : Array[String]?; allowed_hosts : Array[String]? } derive(Show, Eq) - ///| /// --- Quantity --- /// Fixed-point decimal value with unit: numeric value = `mantissa * 10^(-scale)`. /// `unit` is a free-form string at the value level; the schema's /// `quantity-spec` constrains the accepted set. pub(all) struct QuantityValue { - mantissa : Int64 - scale : Int - unit : String + mantissa : Int64; scale : Int; unit : String } derive(Show, Eq) - ///| pub(all) struct QuantitySpec { - base_unit : String - allowed_suffixes : Array[String] - min : QuantityValue? - max : QuantityValue? + base_unit : String; allowed_suffixes : Array[String]; min : QuantityValue?; max : QuantityValue? } derive(Show, Eq) - ///| pub(all) struct FieldDiscriminator { - field_name : String - literal : String? + field_name : String; literal : String? } derive(Show, Eq) - ///| /// How the decoder identifies that a value belongs to a given union branch. pub(all) enum DiscriminatorRule { - Prefix(String) - Suffix(String) - Contains(String) - Regex(String) - FieldEquals(FieldDiscriminator) - FieldAbsent(String) + Prefix(String) + Suffix(String) + Contains(String) + Regex(String) + FieldEquals(FieldDiscriminator) + FieldAbsent(String) } derive(Show, Eq) - ///| pub(all) struct UnionBranch { - tag : String - body : Int - discriminator : DiscriminatorRule - metadata : MetadataEnvelope + tag : String; body : Int; discriminator : DiscriminatorRule; metadata : MetadataEnvelope } derive(Show, Eq) - ///| /// --- Discriminated union --- /// @@ -330,21 +268,21 @@ pub(all) struct UnionBranch { /// (e.g., `prefix("a")` and `prefix("ab")` overlap) and best-effort /// for `regex`. pub(all) struct UnionSpec { - branches : Array[UnionBranch] + branches : Array[UnionBranch] } derive(Show, Eq) - ///| /// --- Capability nodes --- pub(all) struct SecretSpec { - inner : Int - category : String? + inner : Int; category : String? } derive(Show, Eq) - ///| pub(all) struct QuotaTokenSpec { - resource_name : String? + resource_name : String? +} derive(Show, Eq) +///| +pub(all) struct PermissionCardSpec { + polymorphic : Bool } derive(Show, Eq) - ///| /// The structural body of a `schema-type-node`. /// @@ -366,44 +304,44 @@ pub(all) struct QuotaTokenSpec { /// `"kind"` field picks the variant, an MCP content block whose /// `"type"` field picks the part shape, …). pub(all) enum SchemaTypeBody { - RefType(Int) - BoolType - S8Type(NumericRestrictions?) - S16Type(NumericRestrictions?) - S32Type(NumericRestrictions?) - S64Type(NumericRestrictions?) - U8Type(NumericRestrictions?) - U16Type(NumericRestrictions?) - U32Type(NumericRestrictions?) - U64Type(NumericRestrictions?) - F32Type(NumericRestrictions?) - F64Type(NumericRestrictions?) - CharType - StringType - RecordType(Array[NamedFieldType]) - VariantType(Array[VariantCaseType]) - EnumType(Array[String]) - FlagsType(Array[String]) - TupleType(Array[Int]) - ListType(Int) - FixedListType(FixedListSpec) - MapType(MapSpec) - OptionType(Int) - ResultType(ResultSpec) - TextType(TextRestrictions) - BinaryType(BinaryRestrictions) - PathType(PathSpec) - UrlType(UrlRestrictions) - DatetimeType - DurationType - QuantityType(QuantitySpec) - UnionType(UnionSpec) - SecretType(SecretSpec) - QuotaTokenType(QuotaTokenSpec) - FutureType(Int?) - StreamType(Int?) + RefType(Int) + BoolType + S8Type(NumericRestrictions?) + S16Type(NumericRestrictions?) + S32Type(NumericRestrictions?) + S64Type(NumericRestrictions?) + U8Type(NumericRestrictions?) + U16Type(NumericRestrictions?) + U32Type(NumericRestrictions?) + U64Type(NumericRestrictions?) + F32Type(NumericRestrictions?) + F64Type(NumericRestrictions?) + CharType + StringType + RecordType(Array[NamedFieldType]) + VariantType(Array[VariantCaseType]) + EnumType(Array[String]) + FlagsType(Array[String]) + TupleType(Array[Int]) + ListType(Int) + FixedListType(FixedListSpec) + MapType(MapSpec) + OptionType(Int) + ResultType(ResultSpec) + TextType(TextRestrictions) + BinaryType(BinaryRestrictions) + PathType(PathSpec) + UrlType(UrlRestrictions) + DatetimeType + DurationType + QuantityType(QuantitySpec) + UnionType(UnionSpec) + SecretType(SecretSpec) + QuotaTokenType(QuotaTokenSpec) + PermissionCardType(PermissionCardSpec) + FutureType(Int?) + StreamType(Int?) } derive(Show, Eq) - ///| /// ============================================================ /// Schema type @@ -413,10 +351,8 @@ pub(all) enum SchemaTypeBody { /// Recursive positions reference other nodes (or named definitions) by /// index inside the body. pub(all) struct SchemaTypeNode { - body : SchemaTypeBody - metadata : MetadataEnvelope + body : SchemaTypeBody; metadata : MetadataEnvelope } derive(Show, Eq) - ///| /// ============================================================ /// Schema graph (self-contained type carrier) @@ -426,93 +362,78 @@ pub(all) struct SchemaTypeNode { /// rendering), the payload owns its own `schema-graph` — there is no /// implicit external registry that consumers must look up. pub(all) struct SchemaGraph { - type_nodes : Array[SchemaTypeNode] - defs : Array[SchemaTypeDef] - root : Int + type_nodes : Array[SchemaTypeNode]; defs : Array[SchemaTypeDef]; root : Int } derive(Show, Eq) - ///| pub(all) struct VariantValuePayload { - case : UInt - payload : Int? + case : UInt; payload : Int? } derive(Show, Eq) - ///| pub(all) struct MapEntry { - key : Int - value : Int + key : Int; value : Int } derive(Show, Eq) - ///| /// Result payload: exactly one of `ok-value` / `err-value` is set. Each /// inner option allows `result<_, _>` cases whose ok/err type is unit (no /// payload). pub(all) enum ResultValuePayload { - OkValue(Int?) - ErrValue(Int?) + OkValue(Int?) + ErrValue(Int?) } derive(Show, Eq) - ///| pub(all) struct TextValuePayload { - text : String - language : String? + text : String; language : String? } derive(Show, Eq) - ///| pub(all) struct BinaryValuePayload { - bytes : FixedArray[Byte] - mime_type : String? + bytes : FixedArray[Byte]; mime_type : String? } derive(Show, Eq) - ///| /// Signed duration as total nanoseconds. pub(all) struct DurationValuePayload { - nanoseconds : Int64 + nanoseconds : Int64 } derive(Show, Eq) - ///| pub(all) struct UnionValuePayload { - tag : String - body : Int + tag : String; body : Int } derive(Show, Eq) - ///| pub(all) enum SchemaValueNode { - BoolValue(Bool) - S8Value(Int) - S16Value(Int) - S32Value(Int) - S64Value(Int64) - U8Value(Byte) - U16Value(UInt) - U32Value(UInt) - U64Value(UInt64) - F32Value(Float) - F64Value(Double) - CharValue(Char) - StringValue(String) - RecordValue(Array[Int]) - VariantValue(VariantValuePayload) - EnumValue(UInt) - FlagsValue(Array[Bool]) - TupleValue(Array[Int]) - ListValue(Array[Int]) - FixedListValue(Array[Int]) - MapValue(Array[MapEntry]) - OptionValue(Int?) - ResultValue(ResultValuePayload) - TextValue(TextValuePayload) - BinaryValue(BinaryValuePayload) - PathValue(String) - UrlValue(String) - DatetimeValue(Datetime) - DurationValue(DurationValuePayload) - QuantityValueNode(QuantityValue) - UnionValue(UnionValuePayload) - SecretValue(Secret) - QuotaTokenHandle(QuotaToken) + BoolValue(Bool) + S8Value(Int) + S16Value(Int) + S32Value(Int) + S64Value(Int64) + U8Value(Byte) + U16Value(UInt) + U32Value(UInt) + U64Value(UInt64) + F32Value(Float) + F64Value(Double) + CharValue(Char) + StringValue(String) + RecordValue(Array[Int]) + VariantValue(VariantValuePayload) + EnumValue(UInt) + FlagsValue(Array[Bool]) + TupleValue(Array[Int]) + ListValue(Array[Int]) + FixedListValue(Array[Int]) + MapValue(Array[MapEntry]) + OptionValue(Int?) + ResultValue(ResultValuePayload) + TextValue(TextValuePayload) + BinaryValue(BinaryValuePayload) + PathValue(String) + UrlValue(String) + DatetimeValue(Datetime) + DurationValue(DurationValuePayload) + QuantityValueNode(QuantityValue) + UnionValue(UnionValuePayload) + SecretValue(Secret) + QuotaTokenHandle(QuotaToken) + PermissionCardHandle(PermissionCard) } derive(Show, Eq) - ///| /// ============================================================ /// Schema value (always paired with a schema-graph) @@ -528,10 +449,8 @@ pub(all) enum SchemaValueNode { /// field names, case names, or named-ref identifiers — those come from the /// schema. pub(all) struct SchemaValueTree { - value_nodes : Array[SchemaValueNode] - root : Int + value_nodes : Array[SchemaValueNode]; root : Int } derive(Show, Eq) - ///| /// ============================================================ /// Wire carriers @@ -539,54 +458,46 @@ pub(all) struct SchemaValueTree { /// A typed value: a self-contained schema graph paired with a value tree /// built against that schema. pub(all) struct TypedSchemaValue { - graph : SchemaGraph - value : SchemaValueTree + graph : SchemaGraph; value : SchemaValueTree } derive(Show, Eq) - ///| /// Parses a UUID from a string pub fn parse_uuid(uuid : String) -> Result[Uuid, String] { - let ptr = mbt_ffi_str2ptr(uuid) - let return_area = mbt_ffi_malloc(24) - wasmImportParseUuid(ptr, uuid.length(), return_area) - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok(Uuid::{ - high_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 16).reinterpret_as_uint64(), - }) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) + let ptr = mbt_ffi_str2ptr(uuid) + let return_area = mbt_ffi_malloc(24) + wasmImportParseUuid(ptr, uuid.length(), return_area); - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(Uuid::{high_bits : (mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 16)).reinterpret_as_uint64()}) + } + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret +} ///| /// Converts a UUID to a string pub fn uuid_to_string(uuid : Uuid) -> String { - let return_area = mbt_ffi_malloc(8) - wasmImportUuidToString( - uuid.high_bits.reinterpret_as_int64(), - uuid.low_bits.reinterpret_as_int64(), - return_area, - ) - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 0), - mbt_ffi_load32(return_area + 4), - ) - let ret = result - mbt_ffi_free(return_area) - return ret + let return_area = mbt_ffi_malloc(8) + wasmImportUuidToString(((uuid).high_bits).reinterpret_as_int64(), ((uuid).low_bits).reinterpret_as_int64(), return_area); + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 0), mbt_ffi_load32((return_area) + 4)) + let ret = result + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/durability/durability/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/durability/durability/ffi.mbt index a09a64fdb1..51c06cab41 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/durability/durability/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/durability/durability/ffi.mbt @@ -1,124 +1,113 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| -fn wasmImportObserveFunctionCall(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "golem:durability/durability@1.5.0" "observe-function-call" +fn wasmImportObserveFunctionCall(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "golem:durability/durability@1.5.0" "observe-function-call" -///| fn wasmImportBeginDurableFunction(p0 : Int, p1 : Int, p2 : Int64) -> Int64 = "golem:durability/durability@1.5.0" "begin-durable-function" -///| -fn wasmImportEndDurableFunction( - p0 : Int, - p1 : Int, - p2 : Int64, - p3 : Int64, - p4 : Int, -) = "golem:durability/durability@1.5.0" "end-durable-function" +fn wasmImportEndDurableFunction(p0 : Int, p1 : Int, p2 : Int64, p3 : Int64, p4 : Int) = "golem:durability/durability@1.5.0" "end-durable-function" -///| -fn wasmImportCurrentDurableExecutionState(p0 : Int) = "golem:durability/durability@1.5.0" "current-durable-execution-state" +fn wasmImportCurrentDurableExecutionState(p0 : Int) = "golem:durability/durability@1.5.0" "current-durable-execution-state" -///| -fn wasmImportPersistDurableFunctionInvocation(p0 : Int) = "golem:durability/durability@1.5.0" "persist-durable-function-invocation" +fn wasmImportPersistDurableFunctionInvocation(p0 : Int) = "golem:durability/durability@1.5.0" "persist-durable-function-invocation" -///| -fn wasmImportReadPersistedDurableFunctionInvocation(p0 : Int) = "golem:durability/durability@1.5.0" "read-persisted-durable-function-invocation" +fn wasmImportReadPersistedDurableFunctionInvocation(p0 : Int) = "golem:durability/durability@1.5.0" "read-persisted-durable-function-invocation" ///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = +#|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) ///| -extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = - #|(func (param i32) (result f32) local.get 0 f32.load) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend16_s) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = - #|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) +extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_s) ///| -extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = - #|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend8_s) ///| -#owned(bytes) -extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_s) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_u) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = +#|(func (param i32) (result f32) local.get 0 f32.load) ///| -extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend8_s) +extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = +#|(func (param i32) (result f64) local.get 0 f64.load) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_s) +#owned(bytes) +extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend16_s) ///| extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = - #|(func (param i32) (result f64) local.get 0 f64.load) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_s) +extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) ///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = +#|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/durability/durability/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/durability/durability/top.mbt index 9aa7a7f983..844e5a2b80 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/durability/durability/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/durability/durability/top.mbt @@ -1,97 +1,109 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Represents the current durable execution state pub(all) struct DurableExecutionState { - is_live : Bool - persistence_level : @host.PersistenceLevel + is_live : Bool; persistence_level : @host.PersistenceLevel } derive(Show, Eq) - ///| /// Represents the oplog entry version; this is for backward compatibility and most use cases should always use /// (and expect) the latest version. pub(all) enum OplogEntryVersion { - V1 - V2 + V1; V2 } derive(Show, Eq) -///| pub fn OplogEntryVersion::ordinal(self : OplogEntryVersion) -> Int { - match self { - V1 => 0 - V2 => 1 - } + match self { + V1 => 0 + V2 => 1 + } } -///| pub fn OplogEntryVersion::from(self : Int) -> OplogEntryVersion { - match self { - 0 => V1 - 1 => V2 - _ => panic() - } + match self { + 0 => V1 + 1 => V2 + _ => panic() + } } - ///| /// Represents a persisted durable function invocation. The `response` field /// contains a value and its schema graph together, making the user-defined payload observable by external tools. pub(all) struct PersistedDurableFunctionInvocation { - timestamp : @system-clock.Instant - function_name : String - response : @types.TypedSchemaValue - function_type : @oplog.WrappedFunctionType - entry_version : OplogEntryVersion + timestamp : @system-clock.Instant; function_name : String; response : @types.TypedSchemaValue; function_type : @oplog.WrappedFunctionType; entry_version : OplogEntryVersion } derive(Show, Eq) - ///| /// Observes a function call (produces logs and metrics) pub fn observe_function_call(iface : String, function : String) -> Unit { - let ptr = mbt_ffi_str2ptr(iface) - let ptr0 = mbt_ffi_str2ptr(function) - wasmImportObserveFunctionCall(ptr, iface.length(), ptr0, function.length()) - mbt_ffi_free(ptr) - mbt_ffi_free(ptr0) -} + let ptr = mbt_ffi_str2ptr(iface) + let ptr0 = mbt_ffi_str2ptr(function) + wasmImportObserveFunctionCall(ptr, iface.length(), ptr0, function.length()); + mbt_ffi_free(ptr) + mbt_ffi_free(ptr0) + +} ///| /// Marks the beginning of a durable function. /// /// There must be a corresponding call to `end-durable-function` after the function has /// performed its work (it can be ended in a different context, for example after an async /// pollable operation has been completed) -pub fn begin_durable_function( - function_type : @oplog.WrappedFunctionType, -) -> UInt64 { - let (lowered12, lowered13, lowered14) = match function_type { - ReadLocal => (0, 0, 0L) - WriteLocal => (1, 0, 0L) - ReadRemote => (2, 0, 0L) - WriteRemote => (3, 0, 0L) - WriteRemoteBatched(payload3) => { - let (lowered, lowered6) = match payload3 { - None => (0, 0L) - Some(payload5) => (1, payload5.reinterpret_as_int64()) - } +pub fn begin_durable_function(function_type : @oplog.WrappedFunctionType) -> UInt64 { + + let (lowered12,lowered13,lowered14) = match function_type { + ReadLocal => { + + ((0), 0, 0L) + } + WriteLocal => { + + ((1), 0, 0L) + } + ReadRemote => { + + ((2), 0, 0L) + } + WriteRemote => { + + ((3), 0, 0L) + } + WriteRemoteBatched(payload3) => { + + let (lowered, lowered6) = match (payload3) { + None => { + + ((0), 0L) + } + Some(payload5) => { + + ((1), (payload5).reinterpret_as_int64()) + } + } + + ((4), lowered, lowered6) + } + WriteRemoteTransaction(payload7) => { + + let (lowered10, lowered11) = match (payload7) { + None => { + + ((0), 0L) + } + Some(payload9) => { + + ((1), (payload9).reinterpret_as_int64()) + } + } - (4, lowered, lowered6) - } - WriteRemoteTransaction(payload7) => { - let (lowered10, lowered11) = match payload7 { - None => (0, 0L) - Some(payload9) => (1, payload9.reinterpret_as_int64()) + ((5), lowered10, lowered11) + } } + let result : Int64 = wasmImportBeginDurableFunction(lowered12, lowered13, lowered14); + let ret = (result).reinterpret_as_uint64() + return ret - (5, lowered10, lowered11) - } - } - let result : Int64 = wasmImportBeginDurableFunction( - lowered12, lowered13, lowered14, - ) - let ret = result.reinterpret_as_uint64() - return ret } - ///| /// Marks the end of a durable function /// @@ -101,7812 +113,7367 @@ pub fn begin_durable_function( /// /// Normally commit behavior is decided by the executor based on the `function-type`. However, in special /// cases the `forced-commit` parameter can be used to force commit the oplog in an efficient way. -pub fn end_durable_function( - function_type : @oplog.WrappedFunctionType, - begin_index : UInt64, - forced_commit : Bool, -) -> Unit { - let (lowered12, lowered13, lowered14) = match function_type { - ReadLocal => (0, 0, 0L) - WriteLocal => (1, 0, 0L) - ReadRemote => (2, 0, 0L) - WriteRemote => (3, 0, 0L) - WriteRemoteBatched(payload3) => { - let (lowered, lowered6) = match payload3 { - None => (0, 0L) - Some(payload5) => (1, payload5.reinterpret_as_int64()) - } - - (4, lowered, lowered6) - } - WriteRemoteTransaction(payload7) => { - let (lowered10, lowered11) = match payload7 { - None => (0, 0L) - Some(payload9) => (1, payload9.reinterpret_as_int64()) - } +pub fn end_durable_function(function_type : @oplog.WrappedFunctionType, begin_index : UInt64, forced_commit : Bool) -> Unit { - (5, lowered10, lowered11) - } - } - wasmImportEndDurableFunction( - lowered12, - lowered13, - lowered14, - begin_index.reinterpret_as_int64(), - if forced_commit { - 1 - } else { - 0 - }, - ) -} + let (lowered12,lowered13,lowered14) = match function_type { + ReadLocal => { -///| -/// Gets the current durable execution state -pub fn current_durable_execution_state() -> DurableExecutionState { - let return_area = mbt_ffi_malloc(2) - wasmImportCurrentDurableExecutionState(return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 1) { - 0 => @host.PersistenceLevel::PersistNothing - 1 => @host.PersistenceLevel::PersistRemoteSideEffects - 2 => @host.PersistenceLevel::Smart - _ => panic() - } - let ret = DurableExecutionState::{ - is_live: mbt_ffi_load8_u(return_area + 0) != 0, - persistence_level: lifted, - } - mbt_ffi_free(return_area) - return ret -} + ((0), 0, 0L) + } + WriteLocal => { -///| -/// Writes a record to the agent's oplog representing a durable function invocation -/// -/// The request and response are defined as schema-carrying values, which makes it -/// self-describing for observers of oplogs. -pub fn persist_durable_function_invocation( - function_name : String, - request : @types.TypedSchemaValue, - response : @types.TypedSchemaValue, - function_type : @oplog.WrappedFunctionType, -) -> Unit { - let cleanup_list : Array[Int] = [] - let return_area = mbt_ffi_malloc(96) - - let ptr = mbt_ffi_str2ptr(function_name) - mbt_ffi_store32(return_area + 4, function_name.length()) - mbt_ffi_store32(return_area + 0, ptr) - - let address358 = mbt_ffi_malloc(request.graph.type_nodes.length() * 144) - for index359 = 0 - index359 < request.graph.type_nodes.length() - index359 = index359 + 1 { - let iter_elem : @types.SchemaTypeNode = request.graph.type_nodes[index359] - let iter_base = address358 + index359 * 144 - - match iter_elem.body { - RefType(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store32(iter_base + 8, payload) - - () - } - BoolType => { - mbt_ffi_store8(iter_base + 0, 1) + ((1), 0, 0L) + } + ReadRemote => { - () - } - S8Type(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) + ((2), 0, 0L) + } + WriteRemote => { - match payload1 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + ((3), 0, 0L) + } + WriteRemoteBatched(payload3) => { - () - } - Some(payload3) => { - mbt_ffi_store8(iter_base + 8, 1) + let (lowered, lowered6) = match (payload3) { + None => { - match payload3.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + ((0), 0L) + } + Some(payload5) => { - () - } - Some(payload5) => { - mbt_ffi_store8(iter_base + 16, 1) + ((1), (payload5).reinterpret_as_int64()) + } + } - match payload5 { - Signed(payload6) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload6) + ((4), lowered, lowered6) + } + WriteRemoteTransaction(payload7) => { - () - } - Unsigned(payload7) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload7.reinterpret_as_int64(), - ) + let (lowered10, lowered11) = match (payload7) { + None => { - () - } - FloatBits(payload8) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload8.reinterpret_as_int64(), - ) + ((0), 0L) + } + Some(payload9) => { - () + ((1), (payload9).reinterpret_as_int64()) + } } - } - () - } + ((5), lowered10, lowered11) } + } + wasmImportEndDurableFunction(lowered12, lowered13, lowered14, (begin_index).reinterpret_as_int64(), (if forced_commit { 1 } else { 0 })); - match payload3.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload10) => { - mbt_ffi_store8(iter_base + 40, 1) +} +///| +/// Gets the current durable execution state +pub fn current_durable_execution_state() -> DurableExecutionState { - match payload10 { - Signed(payload11) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload11) + let return_area = mbt_ffi_malloc(2) + wasmImportCurrentDurableExecutionState(return_area); - () - } - Unsigned(payload12) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload12.reinterpret_as_int64(), - ) + let lifted = match (mbt_ffi_load8_u((return_area) + 1)) { + 0 => { - () - } - FloatBits(payload13) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload13.reinterpret_as_int64(), - ) + @host.PersistenceLevel::PersistNothing + } + 1 => { - () - } - } + @host.PersistenceLevel::PersistRemoteSideEffects + } + 2 => { - () - } + @host.PersistenceLevel::Smart } + _ => panic() + } + let ret = DurableExecutionState::{is_live : (mbt_ffi_load8_u((return_area) + 0) != 0), persistence_level : lifted} + mbt_ffi_free(return_area) + return ret - match payload3.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) +} +///| +/// Writes a record to the agent's oplog representing a durable function invocation +/// +/// The request and response are defined as schema-carrying values, which makes it +/// self-describing for observers of oplogs. +pub fn persist_durable_function_invocation(function_name : String, request : @types.TypedSchemaValue, response : @types.TypedSchemaValue, function_type : @oplog.WrappedFunctionType) -> Unit { + let cleanup_list : Array[Int] = [] + let return_area = mbt_ffi_malloc(96) - () - } - Some(payload15) => { - mbt_ffi_store8(iter_base + 64, 1) + let ptr = mbt_ffi_str2ptr(function_name) + mbt_ffi_store32((return_area) + 4, function_name.length()) + mbt_ffi_store32((return_area) + 0, ptr) - let ptr16 = mbt_ffi_str2ptr(payload15) - mbt_ffi_store32(iter_base + 72, payload15.length()) - mbt_ffi_store32(iter_base + 68, ptr16) - cleanup_list.push(ptr16) + let address359 = mbt_ffi_malloc((((request).graph).type_nodes).length() * 144); + for index360 = 0; index360 < (((request).graph).type_nodes).length(); index360 = index360 + 1 { + let iter_elem : @types.SchemaTypeNode = (((request).graph).type_nodes)[(index360)] + let iter_base = address359 + (index360 * 144); - () - } - } + match (iter_elem).body { + RefType(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store32((iter_base) + 8, payload) - () - } - } + () + } + BoolType => { + mbt_ffi_store8((iter_base) + 0, (1)) - () - } - S16Type(payload17) => { - mbt_ffi_store8(iter_base + 0, 3) + () + } + S8Type(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + + match (payload1) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload3).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload5) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload5 { + Signed(payload6) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload6) + + () + } + Unsigned(payload7) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload7).reinterpret_as_int64()) + + () + } + FloatBits(payload8) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload8).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload3).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload10) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload10 { + Signed(payload11) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload11) + + () + } + Unsigned(payload12) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload12).reinterpret_as_int64()) + + () + } + FloatBits(payload13) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload13).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload3).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload15) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr16 = mbt_ffi_str2ptr(payload15) + mbt_ffi_store32((iter_base) + 72, payload15.length()) + mbt_ffi_store32((iter_base) + 68, ptr16) + cleanup_list.push(ptr16) + + () + } + } + + () + } + } + + () + } + S16Type(payload17) => { + mbt_ffi_store8((iter_base) + 0, (3)) + + match (payload17) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload19) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload19).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload21) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload21 { + Signed(payload22) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload22) + + () + } + Unsigned(payload23) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload23).reinterpret_as_int64()) + + () + } + FloatBits(payload24) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload24).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload19).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload26) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload26 { + Signed(payload27) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload27) + + () + } + Unsigned(payload28) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload28).reinterpret_as_int64()) + + () + } + FloatBits(payload29) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload29).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload19).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload31) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr32 = mbt_ffi_str2ptr(payload31) + mbt_ffi_store32((iter_base) + 72, payload31.length()) + mbt_ffi_store32((iter_base) + 68, ptr32) + cleanup_list.push(ptr32) + + () + } + } + + () + } + } + + () + } + S32Type(payload33) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + match (payload33) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload35) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload35).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload37) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload37 { + Signed(payload38) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload38) + + () + } + Unsigned(payload39) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload39).reinterpret_as_int64()) + + () + } + FloatBits(payload40) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload40).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload35).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload42) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload42 { + Signed(payload43) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload43) + + () + } + Unsigned(payload44) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload44).reinterpret_as_int64()) + + () + } + FloatBits(payload45) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload45).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload35).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload47) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr48 = mbt_ffi_str2ptr(payload47) + mbt_ffi_store32((iter_base) + 72, payload47.length()) + mbt_ffi_store32((iter_base) + 68, ptr48) + cleanup_list.push(ptr48) + + () + } + } + + () + } + } + + () + } + S64Type(payload49) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + match (payload49) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload51) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload51).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload53) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload53 { + Signed(payload54) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload54) + + () + } + Unsigned(payload55) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload55).reinterpret_as_int64()) + + () + } + FloatBits(payload56) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload56).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload51).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload58) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload58 { + Signed(payload59) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload59) + + () + } + Unsigned(payload60) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload60).reinterpret_as_int64()) + + () + } + FloatBits(payload61) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload61).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload51).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload63) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr64 = mbt_ffi_str2ptr(payload63) + mbt_ffi_store32((iter_base) + 72, payload63.length()) + mbt_ffi_store32((iter_base) + 68, ptr64) + cleanup_list.push(ptr64) + + () + } + } + + () + } + } + + () + } + U8Type(payload65) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + match (payload65) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload67) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload67).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload69) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload69 { + Signed(payload70) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload70) + + () + } + Unsigned(payload71) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload71).reinterpret_as_int64()) + + () + } + FloatBits(payload72) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload72).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload67).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload74) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload74 { + Signed(payload75) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload75) + + () + } + Unsigned(payload76) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload76).reinterpret_as_int64()) + + () + } + FloatBits(payload77) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload77).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload67).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload79) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr80 = mbt_ffi_str2ptr(payload79) + mbt_ffi_store32((iter_base) + 72, payload79.length()) + mbt_ffi_store32((iter_base) + 68, ptr80) + cleanup_list.push(ptr80) + + () + } + } + + () + } + } + + () + } + U16Type(payload81) => { + mbt_ffi_store8((iter_base) + 0, (7)) + + match (payload81) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload83) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload83).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload85) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload85 { + Signed(payload86) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload86) + + () + } + Unsigned(payload87) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload87).reinterpret_as_int64()) + + () + } + FloatBits(payload88) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload88).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload83).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload90) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload90 { + Signed(payload91) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload91) + + () + } + Unsigned(payload92) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload92).reinterpret_as_int64()) + + () + } + FloatBits(payload93) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload93).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload83).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload95) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr96 = mbt_ffi_str2ptr(payload95) + mbt_ffi_store32((iter_base) + 72, payload95.length()) + mbt_ffi_store32((iter_base) + 68, ptr96) + cleanup_list.push(ptr96) + + () + } + } + + () + } + } + + () + } + U32Type(payload97) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + match (payload97) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload99) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload99).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload101) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload101 { + Signed(payload102) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload102) + + () + } + Unsigned(payload103) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload103).reinterpret_as_int64()) + + () + } + FloatBits(payload104) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload104).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload99).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload106) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload106 { + Signed(payload107) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload107) + + () + } + Unsigned(payload108) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload108).reinterpret_as_int64()) + + () + } + FloatBits(payload109) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload109).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload99).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload111) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr112 = mbt_ffi_str2ptr(payload111) + mbt_ffi_store32((iter_base) + 72, payload111.length()) + mbt_ffi_store32((iter_base) + 68, ptr112) + cleanup_list.push(ptr112) + + () + } + } + + () + } + } + + () + } + U64Type(payload113) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + match (payload113) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload115) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload115).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload117) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload117 { + Signed(payload118) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload118) + + () + } + Unsigned(payload119) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload119).reinterpret_as_int64()) + + () + } + FloatBits(payload120) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload120).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload115).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload122) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload122 { + Signed(payload123) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload123) + + () + } + Unsigned(payload124) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload124).reinterpret_as_int64()) + + () + } + FloatBits(payload125) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload125).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload115).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload127) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr128 = mbt_ffi_str2ptr(payload127) + mbt_ffi_store32((iter_base) + 72, payload127.length()) + mbt_ffi_store32((iter_base) + 68, ptr128) + cleanup_list.push(ptr128) + + () + } + } + + () + } + } + + () + } + F32Type(payload129) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + match (payload129) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload131) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload131).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload133) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload133 { + Signed(payload134) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload134) + + () + } + Unsigned(payload135) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload135).reinterpret_as_int64()) + + () + } + FloatBits(payload136) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload136).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload131).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload138) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload138 { + Signed(payload139) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload139) + + () + } + Unsigned(payload140) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload140).reinterpret_as_int64()) + + () + } + FloatBits(payload141) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload141).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload131).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload143) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr144 = mbt_ffi_str2ptr(payload143) + mbt_ffi_store32((iter_base) + 72, payload143.length()) + mbt_ffi_store32((iter_base) + 68, ptr144) + cleanup_list.push(ptr144) + + () + } + } + + () + } + } + + () + } + F64Type(payload145) => { + mbt_ffi_store8((iter_base) + 0, (11)) + + match (payload145) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload147) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload147).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload149) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload149 { + Signed(payload150) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload150) + + () + } + Unsigned(payload151) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload151).reinterpret_as_int64()) + + () + } + FloatBits(payload152) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload152).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload147).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload154) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload154 { + Signed(payload155) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload155) + + () + } + Unsigned(payload156) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload156).reinterpret_as_int64()) + + () + } + FloatBits(payload157) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload157).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload147).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload159) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr160 = mbt_ffi_str2ptr(payload159) + mbt_ffi_store32((iter_base) + 72, payload159.length()) + mbt_ffi_store32((iter_base) + 68, ptr160) + cleanup_list.push(ptr160) + + () + } + } + + () + } + } + + () + } + CharType => { + mbt_ffi_store8((iter_base) + 0, (12)) - match payload17 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + StringType => { + mbt_ffi_store8((iter_base) + 0, (13)) - () - } - Some(payload19) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + RecordType(payload163) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let address182 = mbt_ffi_malloc((payload163).length() * 68); + for index183 = 0; index183 < (payload163).length(); index183 = index183 + 1 { + let iter_elem : @types.NamedFieldType = (payload163)[(index183)] + let iter_base = address182 + (index183 * 68); + + let ptr164 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr164) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload166) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr167 = mbt_ffi_str2ptr(payload166) + mbt_ffi_store32((iter_base) + 20, payload166.length()) + mbt_ffi_store32((iter_base) + 16, ptr167) + cleanup_list.push(ptr167) + + () + } + } + + let address = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index = 0; index < (((iter_elem).metadata).aliases).length(); index = index + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index)] + let iter_base = address + (index * 8); + + let ptr168 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr168) + cleanup_list.push(ptr168) + + } + mbt_ffi_store32((iter_base) + 28, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 24, address) + + let address170 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index171 = 0; index171 < (((iter_elem).metadata).examples).length(); index171 = index171 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index171)] + let iter_base = address170 + (index171 * 8); + + let ptr169 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr169) + cleanup_list.push(ptr169) + + } + mbt_ffi_store32((iter_base) + 36, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 32, address170) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload173) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + let ptr174 = mbt_ffi_str2ptr(payload173) + mbt_ffi_store32((iter_base) + 48, payload173.length()) + mbt_ffi_store32((iter_base) + 44, ptr174) + cleanup_list.push(ptr174) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 52, (0)) + + () + } + Some(payload176) => { + mbt_ffi_store8((iter_base) + 52, (1)) + + match payload176 { + Multimodal => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 56, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 56, (2)) + + () + } + Other(payload180) => { + mbt_ffi_store8((iter_base) + 56, (3)) + + let ptr181 = mbt_ffi_str2ptr(payload180) + mbt_ffi_store32((iter_base) + 64, payload180.length()) + mbt_ffi_store32((iter_base) + 60, ptr181) + cleanup_list.push(ptr181) + + () + } + } + + () + } + } + cleanup_list.push(ptr164) + cleanup_list.push(address) + cleanup_list.push(address170) + + } + mbt_ffi_store32((iter_base) + 12, (payload163).length()) + mbt_ffi_store32((iter_base) + 8, address182) + cleanup_list.push(address182) + + () + } + VariantType(payload184) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let address207 = mbt_ffi_malloc((payload184).length() * 72); + for index208 = 0; index208 < (payload184).length(); index208 = index208 + 1 { + let iter_elem : @types.VariantCaseType = (payload184)[(index208)] + let iter_base = address207 + (index208 * 72); + + let ptr185 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr185) + + match ((iter_elem).payload) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload187) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload187) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload189) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr190 = mbt_ffi_str2ptr(payload189) + mbt_ffi_store32((iter_base) + 24, payload189.length()) + mbt_ffi_store32((iter_base) + 20, ptr190) + cleanup_list.push(ptr190) + + () + } + } + + let address192 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index193 = 0; index193 < (((iter_elem).metadata).aliases).length(); index193 = index193 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index193)] + let iter_base = address192 + (index193 * 8); + + let ptr191 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr191) + cleanup_list.push(ptr191) + + } + mbt_ffi_store32((iter_base) + 32, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 28, address192) + + let address195 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index196 = 0; index196 < (((iter_elem).metadata).examples).length(); index196 = index196 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index196)] + let iter_base = address195 + (index196 * 8); + + let ptr194 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr194) + cleanup_list.push(ptr194) + + } + mbt_ffi_store32((iter_base) + 40, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 36, address195) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 44, (0)) + + () + } + Some(payload198) => { + mbt_ffi_store8((iter_base) + 44, (1)) + + let ptr199 = mbt_ffi_str2ptr(payload198) + mbt_ffi_store32((iter_base) + 52, payload198.length()) + mbt_ffi_store32((iter_base) + 48, ptr199) + cleanup_list.push(ptr199) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload201) => { + mbt_ffi_store8((iter_base) + 56, (1)) + + match payload201 { + Multimodal => { + mbt_ffi_store8((iter_base) + 60, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 60, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 60, (2)) + + () + } + Other(payload205) => { + mbt_ffi_store8((iter_base) + 60, (3)) + + let ptr206 = mbt_ffi_str2ptr(payload205) + mbt_ffi_store32((iter_base) + 68, payload205.length()) + mbt_ffi_store32((iter_base) + 64, ptr206) + cleanup_list.push(ptr206) + + () + } + } + + () + } + } + cleanup_list.push(ptr185) + cleanup_list.push(address192) + cleanup_list.push(address195) + + } + mbt_ffi_store32((iter_base) + 12, (payload184).length()) + mbt_ffi_store32((iter_base) + 8, address207) + cleanup_list.push(address207) + + () + } + EnumType(payload209) => { + mbt_ffi_store8((iter_base) + 0, (16)) - match payload19.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let address211 = mbt_ffi_malloc((payload209).length() * 8); + for index212 = 0; index212 < (payload209).length(); index212 = index212 + 1 { + let iter_elem : String = (payload209)[(index212)] + let iter_base = address211 + (index212 * 8); - () - } - Some(payload21) => { - mbt_ffi_store8(iter_base + 16, 1) + let ptr210 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr210) + cleanup_list.push(ptr210) - match payload21 { - Signed(payload22) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload22) + } + mbt_ffi_store32((iter_base) + 12, (payload209).length()) + mbt_ffi_store32((iter_base) + 8, address211) + cleanup_list.push(address211) - () + () } - Unsigned(payload23) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload23.reinterpret_as_int64(), - ) + FlagsType(payload213) => { + mbt_ffi_store8((iter_base) + 0, (17)) - () - } - FloatBits(payload24) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload24.reinterpret_as_int64(), - ) + let address215 = mbt_ffi_malloc((payload213).length() * 8); + for index216 = 0; index216 < (payload213).length(); index216 = index216 + 1 { + let iter_elem : String = (payload213)[(index216)] + let iter_base = address215 + (index216 * 8); - () - } - } + let ptr214 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr214) + cleanup_list.push(ptr214) - () - } - } + } + mbt_ffi_store32((iter_base) + 12, (payload213).length()) + mbt_ffi_store32((iter_base) + 8, address215) + cleanup_list.push(address215) - match payload19.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + TupleType(payload217) => { + mbt_ffi_store8((iter_base) + 0, (18)) - () - } - Some(payload26) => { - mbt_ffi_store8(iter_base + 40, 1) + let address218 = mbt_ffi_malloc((payload217).length() * 4); + for index219 = 0; index219 < (payload217).length(); index219 = index219 + 1 { + let iter_elem : Int = (payload217)[(index219)] + let iter_base = address218 + (index219 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match payload26 { - Signed(payload27) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload27) + } + mbt_ffi_store32((iter_base) + 12, (payload217).length()) + mbt_ffi_store32((iter_base) + 8, address218) + cleanup_list.push(address218) - () + () } - Unsigned(payload28) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload28.reinterpret_as_int64(), - ) + ListType(payload220) => { + mbt_ffi_store8((iter_base) + 0, (19)) + mbt_ffi_store32((iter_base) + 8, payload220) - () + () } - FloatBits(payload29) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload29.reinterpret_as_int64(), - ) + FixedListType(payload221) => { + mbt_ffi_store8((iter_base) + 0, (20)) + mbt_ffi_store32((iter_base) + 8, (payload221).element) + mbt_ffi_store32((iter_base) + 12, ((payload221).length).reinterpret_as_int()) - () + () } - } + MapType(payload222) => { + mbt_ffi_store8((iter_base) + 0, (21)) + mbt_ffi_store32((iter_base) + 8, (payload222).key) + mbt_ffi_store32((iter_base) + 12, (payload222).value) - () - } - } + () + } + OptionType(payload223) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store32((iter_base) + 8, payload223) + + () + } + ResultType(payload224) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match ((payload224).ok) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload226) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload226) + + () + } + } + + match ((payload224).err) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload228) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload228) + + () + } + } + + () + } + TextType(payload229) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match ((payload229).languages) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload231) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address233 = mbt_ffi_malloc((payload231).length() * 8); + for index234 = 0; index234 < (payload231).length(); index234 = index234 + 1 { + let iter_elem : String = (payload231)[(index234)] + let iter_base = address233 + (index234 * 8); + + let ptr232 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr232) + cleanup_list.push(ptr232) + + } + mbt_ffi_store32((iter_base) + 16, (payload231).length()) + mbt_ffi_store32((iter_base) + 12, address233) + cleanup_list.push(address233) + + () + } + } + + match ((payload229).min_length) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload236) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload236).reinterpret_as_int()) + + () + } + } + + match ((payload229).max_length) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload238) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload238).reinterpret_as_int()) + + () + } + } + + match ((payload229).regex) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload240) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr241 = mbt_ffi_str2ptr(payload240) + mbt_ffi_store32((iter_base) + 44, payload240.length()) + mbt_ffi_store32((iter_base) + 40, ptr241) + cleanup_list.push(ptr241) + + () + } + } + + () + } + BinaryType(payload242) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + match ((payload242).mime_types) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload244) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address246 = mbt_ffi_malloc((payload244).length() * 8); + for index247 = 0; index247 < (payload244).length(); index247 = index247 + 1 { + let iter_elem : String = (payload244)[(index247)] + let iter_base = address246 + (index247 * 8); + + let ptr245 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr245) + cleanup_list.push(ptr245) + + } + mbt_ffi_store32((iter_base) + 16, (payload244).length()) + mbt_ffi_store32((iter_base) + 12, address246) + cleanup_list.push(address246) + + () + } + } + + match ((payload242).min_bytes) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload249) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload249).reinterpret_as_int()) + + () + } + } + + match ((payload242).max_bytes) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload251) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload251).reinterpret_as_int()) + + () + } + } + + () + } + PathType(payload252) => { + mbt_ffi_store8((iter_base) + 0, (26)) + mbt_ffi_store8((iter_base) + 8, (payload252).direction.ordinal()) + mbt_ffi_store8((iter_base) + 9, (payload252).kind.ordinal()) + + match ((payload252).allowed_mime_types) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload254) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let address256 = mbt_ffi_malloc((payload254).length() * 8); + for index257 = 0; index257 < (payload254).length(); index257 = index257 + 1 { + let iter_elem : String = (payload254)[(index257)] + let iter_base = address256 + (index257 * 8); + + let ptr255 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr255) + cleanup_list.push(ptr255) + + } + mbt_ffi_store32((iter_base) + 20, (payload254).length()) + mbt_ffi_store32((iter_base) + 16, address256) + cleanup_list.push(address256) + + () + } + } + + match ((payload252).allowed_extensions) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload259) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let address261 = mbt_ffi_malloc((payload259).length() * 8); + for index262 = 0; index262 < (payload259).length(); index262 = index262 + 1 { + let iter_elem : String = (payload259)[(index262)] + let iter_base = address261 + (index262 * 8); + + let ptr260 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr260) + cleanup_list.push(ptr260) + + } + mbt_ffi_store32((iter_base) + 32, (payload259).length()) + mbt_ffi_store32((iter_base) + 28, address261) + cleanup_list.push(address261) + + () + } + } + + () + } + UrlType(payload263) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + match ((payload263).allowed_schemes) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload265) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address267 = mbt_ffi_malloc((payload265).length() * 8); + for index268 = 0; index268 < (payload265).length(); index268 = index268 + 1 { + let iter_elem : String = (payload265)[(index268)] + let iter_base = address267 + (index268 * 8); + + let ptr266 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr266) + cleanup_list.push(ptr266) + + } + mbt_ffi_store32((iter_base) + 16, (payload265).length()) + mbt_ffi_store32((iter_base) + 12, address267) + cleanup_list.push(address267) + + () + } + } + + match ((payload263).allowed_hosts) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload270) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let address272 = mbt_ffi_malloc((payload270).length() * 8); + for index273 = 0; index273 < (payload270).length(); index273 = index273 + 1 { + let iter_elem : String = (payload270)[(index273)] + let iter_base = address272 + (index273 * 8); + + let ptr271 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr271) + cleanup_list.push(ptr271) + + } + mbt_ffi_store32((iter_base) + 28, (payload270).length()) + mbt_ffi_store32((iter_base) + 24, address272) + cleanup_list.push(address272) + + () + } + } + + () + } + DatetimeType => { + mbt_ffi_store8((iter_base) + 0, (28)) - match payload19.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + () + } + DurationType => { + mbt_ffi_store8((iter_base) + 0, (29)) - () - } - Some(payload31) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + QuantityType(payload276) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr277 = mbt_ffi_str2ptr((payload276).base_unit) + mbt_ffi_store32((iter_base) + 12, (payload276).base_unit.length()) + mbt_ffi_store32((iter_base) + 8, ptr277) + + let address279 = mbt_ffi_malloc(((payload276).allowed_suffixes).length() * 8); + for index280 = 0; index280 < ((payload276).allowed_suffixes).length(); index280 = index280 + 1 { + let iter_elem : String = ((payload276).allowed_suffixes)[(index280)] + let iter_base = address279 + (index280 * 8); + + let ptr278 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr278) + cleanup_list.push(ptr278) + + } + mbt_ffi_store32((iter_base) + 20, ((payload276).allowed_suffixes).length()) + mbt_ffi_store32((iter_base) + 16, address279) + + match ((payload276).min) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload282) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload282).mantissa) + mbt_ffi_store32((iter_base) + 40, (payload282).scale) + + let ptr283 = mbt_ffi_str2ptr((payload282).unit) + mbt_ffi_store32((iter_base) + 48, (payload282).unit.length()) + mbt_ffi_store32((iter_base) + 44, ptr283) + cleanup_list.push(ptr283) + + () + } + } + + match ((payload276).max) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload285) => { + mbt_ffi_store8((iter_base) + 56, (1)) + mbt_ffi_store64((iter_base) + 64, (payload285).mantissa) + mbt_ffi_store32((iter_base) + 72, (payload285).scale) + + let ptr286 = mbt_ffi_str2ptr((payload285).unit) + mbt_ffi_store32((iter_base) + 80, (payload285).unit.length()) + mbt_ffi_store32((iter_base) + 76, ptr286) + cleanup_list.push(ptr286) + + () + } + } + cleanup_list.push(ptr277) + cleanup_list.push(address279) + + () + } + UnionType(payload287) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let address323 = mbt_ffi_malloc(((payload287).branches).length() * 92); + for index324 = 0; index324 < ((payload287).branches).length(); index324 = index324 + 1 { + let iter_elem : @types.UnionBranch = ((payload287).branches)[(index324)] + let iter_base = address323 + (index324 * 92); + + let ptr288 = mbt_ffi_str2ptr((iter_elem).tag) + mbt_ffi_store32((iter_base) + 4, (iter_elem).tag.length()) + mbt_ffi_store32((iter_base) + 0, ptr288) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (iter_elem).discriminator { + Prefix(payload289) => { + mbt_ffi_store8((iter_base) + 12, (0)) + + let ptr290 = mbt_ffi_str2ptr(payload289) + mbt_ffi_store32((iter_base) + 20, payload289.length()) + mbt_ffi_store32((iter_base) + 16, ptr290) + cleanup_list.push(ptr290) + + () + } + Suffix(payload291) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr292 = mbt_ffi_str2ptr(payload291) + mbt_ffi_store32((iter_base) + 20, payload291.length()) + mbt_ffi_store32((iter_base) + 16, ptr292) + cleanup_list.push(ptr292) + + () + } + Contains(payload293) => { + mbt_ffi_store8((iter_base) + 12, (2)) + + let ptr294 = mbt_ffi_str2ptr(payload293) + mbt_ffi_store32((iter_base) + 20, payload293.length()) + mbt_ffi_store32((iter_base) + 16, ptr294) + cleanup_list.push(ptr294) + + () + } + Regex(payload295) => { + mbt_ffi_store8((iter_base) + 12, (3)) + + let ptr296 = mbt_ffi_str2ptr(payload295) + mbt_ffi_store32((iter_base) + 20, payload295.length()) + mbt_ffi_store32((iter_base) + 16, ptr296) + cleanup_list.push(ptr296) + + () + } + FieldEquals(payload297) => { + mbt_ffi_store8((iter_base) + 12, (4)) + + let ptr298 = mbt_ffi_str2ptr((payload297).field_name) + mbt_ffi_store32((iter_base) + 20, (payload297).field_name.length()) + mbt_ffi_store32((iter_base) + 16, ptr298) + + match ((payload297).literal) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload300) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let ptr301 = mbt_ffi_str2ptr(payload300) + mbt_ffi_store32((iter_base) + 32, payload300.length()) + mbt_ffi_store32((iter_base) + 28, ptr301) + cleanup_list.push(ptr301) + + () + } + } + cleanup_list.push(ptr298) + + () + } + FieldAbsent(payload302) => { + mbt_ffi_store8((iter_base) + 12, (5)) + + let ptr303 = mbt_ffi_str2ptr(payload302) + mbt_ffi_store32((iter_base) + 20, payload302.length()) + mbt_ffi_store32((iter_base) + 16, ptr303) + cleanup_list.push(ptr303) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload305) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr306 = mbt_ffi_str2ptr(payload305) + mbt_ffi_store32((iter_base) + 44, payload305.length()) + mbt_ffi_store32((iter_base) + 40, ptr306) + cleanup_list.push(ptr306) + + () + } + } + + let address308 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index309 = 0; index309 < (((iter_elem).metadata).aliases).length(); index309 = index309 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index309)] + let iter_base = address308 + (index309 * 8); + + let ptr307 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr307) + cleanup_list.push(ptr307) + + } + mbt_ffi_store32((iter_base) + 52, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 48, address308) + + let address311 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index312 = 0; index312 < (((iter_elem).metadata).examples).length(); index312 = index312 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index312)] + let iter_base = address311 + (index312 * 8); + + let ptr310 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr310) + cleanup_list.push(ptr310) + + } + mbt_ffi_store32((iter_base) + 60, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 56, address311) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload314) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr315 = mbt_ffi_str2ptr(payload314) + mbt_ffi_store32((iter_base) + 72, payload314.length()) + mbt_ffi_store32((iter_base) + 68, ptr315) + cleanup_list.push(ptr315) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 76, (0)) + + () + } + Some(payload317) => { + mbt_ffi_store8((iter_base) + 76, (1)) + + match payload317 { + Multimodal => { + mbt_ffi_store8((iter_base) + 80, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 80, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 80, (2)) + + () + } + Other(payload321) => { + mbt_ffi_store8((iter_base) + 80, (3)) + + let ptr322 = mbt_ffi_str2ptr(payload321) + mbt_ffi_store32((iter_base) + 88, payload321.length()) + mbt_ffi_store32((iter_base) + 84, ptr322) + cleanup_list.push(ptr322) + + () + } + } + + () + } + } + cleanup_list.push(ptr288) + cleanup_list.push(address308) + cleanup_list.push(address311) + + } + mbt_ffi_store32((iter_base) + 12, ((payload287).branches).length()) + mbt_ffi_store32((iter_base) + 8, address323) + cleanup_list.push(address323) + + () + } + SecretType(payload325) => { + mbt_ffi_store8((iter_base) + 0, (32)) + mbt_ffi_store32((iter_base) + 8, (payload325).inner) - let ptr32 = mbt_ffi_str2ptr(payload31) - mbt_ffi_store32(iter_base + 72, payload31.length()) - mbt_ffi_store32(iter_base + 68, ptr32) - cleanup_list.push(ptr32) + match ((payload325).category) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - } + () + } + Some(payload327) => { + mbt_ffi_store8((iter_base) + 12, (1)) - () - } - } + let ptr328 = mbt_ffi_str2ptr(payload327) + mbt_ffi_store32((iter_base) + 20, payload327.length()) + mbt_ffi_store32((iter_base) + 16, ptr328) + cleanup_list.push(ptr328) - () - } - S32Type(payload33) => { - mbt_ffi_store8(iter_base + 0, 4) + () + } + } - match payload33 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + QuotaTokenType(payload329) => { + mbt_ffi_store8((iter_base) + 0, (33)) - () - } - Some(payload35) => { - mbt_ffi_store8(iter_base + 8, 1) + match ((payload329).resource_name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload35.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + Some(payload331) => { + mbt_ffi_store8((iter_base) + 8, (1)) - () - } - Some(payload37) => { - mbt_ffi_store8(iter_base + 16, 1) + let ptr332 = mbt_ffi_str2ptr(payload331) + mbt_ffi_store32((iter_base) + 16, payload331.length()) + mbt_ffi_store32((iter_base) + 12, ptr332) + cleanup_list.push(ptr332) - match payload37 { - Signed(payload38) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload38) + () + } + } - () + () } - Unsigned(payload39) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload39.reinterpret_as_int64(), - ) + PermissionCardType(payload333) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store8((iter_base) + 8, (if (payload333).polymorphic { 1 } else { 0 })) - () + () } - FloatBits(payload40) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload40.reinterpret_as_int64(), - ) + FutureType(payload334) => { + mbt_ffi_store8((iter_base) + 0, (35)) - () - } - } + match (payload334) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - } + () + } + Some(payload336) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload336) - match payload35.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + } - () - } - Some(payload42) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + StreamType(payload337) => { + mbt_ffi_store8((iter_base) + 0, (36)) - match payload42 { - Signed(payload43) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload43) + match (payload337) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - Unsigned(payload44) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload44.reinterpret_as_int64(), - ) + () + } + Some(payload339) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload339) - () - } - FloatBits(payload45) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload45.reinterpret_as_int64(), - ) + () + } + } - () + () } - } - - () - } } - match payload35.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 88, (0)) - () - } - Some(payload47) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + Some(payload341) => { + mbt_ffi_store8((iter_base) + 88, (1)) - let ptr48 = mbt_ffi_str2ptr(payload47) - mbt_ffi_store32(iter_base + 72, payload47.length()) - mbt_ffi_store32(iter_base + 68, ptr48) - cleanup_list.push(ptr48) + let ptr342 = mbt_ffi_str2ptr(payload341) + mbt_ffi_store32((iter_base) + 96, payload341.length()) + mbt_ffi_store32((iter_base) + 92, ptr342) + cleanup_list.push(ptr342) - () - } + () + } } - () - } - } + let address344 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index345 = 0; index345 < (((iter_elem).metadata).aliases).length(); index345 = index345 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index345)] + let iter_base = address344 + (index345 * 8); - () - } - S64Type(payload49) => { - mbt_ffi_store8(iter_base + 0, 5) + let ptr343 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr343) + cleanup_list.push(ptr343) - match payload49 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + mbt_ffi_store32((iter_base) + 104, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 100, address344) - () - } - Some(payload51) => { - mbt_ffi_store8(iter_base + 8, 1) + let address347 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index348 = 0; index348 < (((iter_elem).metadata).examples).length(); index348 = index348 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index348)] + let iter_base = address347 + (index348 * 8); - match payload51.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let ptr346 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr346) + cleanup_list.push(ptr346) - () - } - Some(payload53) => { - mbt_ffi_store8(iter_base + 16, 1) + } + mbt_ffi_store32((iter_base) + 112, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 108, address347) - match payload53 { - Signed(payload54) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload54) + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 116, (0)) - () + () } - Unsigned(payload55) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload55.reinterpret_as_int64(), - ) + Some(payload350) => { + mbt_ffi_store8((iter_base) + 116, (1)) - () - } - FloatBits(payload56) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload56.reinterpret_as_int64(), - ) + let ptr351 = mbt_ffi_str2ptr(payload350) + mbt_ffi_store32((iter_base) + 124, payload350.length()) + mbt_ffi_store32((iter_base) + 120, ptr351) + cleanup_list.push(ptr351) - () + () } - } - - () - } } - match payload51.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload58) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload58 { - Signed(payload59) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload59) + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 128, (0)) - () + () } - Unsigned(payload60) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload60.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload61) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload61.reinterpret_as_int64(), - ) - - () + Some(payload353) => { + mbt_ffi_store8((iter_base) + 128, (1)) + + match payload353 { + Multimodal => { + mbt_ffi_store8((iter_base) + 132, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 132, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 132, (2)) + + () + } + Other(payload357) => { + mbt_ffi_store8((iter_base) + 132, (3)) + + let ptr358 = mbt_ffi_str2ptr(payload357) + mbt_ffi_store32((iter_base) + 140, payload357.length()) + mbt_ffi_store32((iter_base) + 136, ptr358) + cleanup_list.push(ptr358) + + () + } + } + + () } - } - - () - } } + cleanup_list.push(address344) + cleanup_list.push(address347) - match payload51.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload63) => { - mbt_ffi_store8(iter_base + 64, 1) + } + mbt_ffi_store32((return_area) + 12, (((request).graph).type_nodes).length()) + mbt_ffi_store32((return_area) + 8, address359) - let ptr64 = mbt_ffi_str2ptr(payload63) - mbt_ffi_store32(iter_base + 72, payload63.length()) - mbt_ffi_store32(iter_base + 68, ptr64) - cleanup_list.push(ptr64) + let address365 = mbt_ffi_malloc((((request).graph).defs).length() * 24); + for index366 = 0; index366 < (((request).graph).defs).length(); index366 = index366 + 1 { + let iter_elem : @types.SchemaTypeDef = (((request).graph).defs)[(index366)] + let iter_base = address365 + (index366 * 24); - () - } - } + let ptr361 = mbt_ffi_str2ptr((iter_elem).id) + mbt_ffi_store32((iter_base) + 4, (iter_elem).id.length()) + mbt_ffi_store32((iter_base) + 0, ptr361) - () - } - } + match ((iter_elem).name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - U8Type(payload65) => { - mbt_ffi_store8(iter_base + 0, 6) + () + } + Some(payload363) => { + mbt_ffi_store8((iter_base) + 8, (1)) - match payload65 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr364 = mbt_ffi_str2ptr(payload363) + mbt_ffi_store32((iter_base) + 16, payload363.length()) + mbt_ffi_store32((iter_base) + 12, ptr364) + cleanup_list.push(ptr364) - () - } - Some(payload67) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + } + mbt_ffi_store32((iter_base) + 20, (iter_elem).body) + cleanup_list.push(ptr361) - match payload67.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + mbt_ffi_store32((return_area) + 20, (((request).graph).defs).length()) + mbt_ffi_store32((return_area) + 16, address365) + mbt_ffi_store32((return_area) + 24, ((request).graph).root) - () - } - Some(payload69) => { - mbt_ffi_store8(iter_base + 16, 1) + let address438 = mbt_ffi_malloc((((request).value).value_nodes).length() * 32); + for index439 = 0; index439 < (((request).value).value_nodes).length(); index439 = index439 + 1 { + let iter_elem : @types.SchemaValueNode = (((request).value).value_nodes)[(index439)] + let iter_base = address438 + (index439 * 32); - match payload69 { - Signed(payload70) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload70) + match iter_elem { + BoolValue(payload367) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload367 { 1 } else { 0 })) - () + () } - Unsigned(payload71) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload71.reinterpret_as_int64(), - ) + S8Value(payload368) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload368)) - () + () } - FloatBits(payload72) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload72.reinterpret_as_int64(), - ) + S16Value(payload369) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload369)) - () + () } - } + S32Value(payload370) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload370) - () - } - } - - match payload67.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload74) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + S64Value(payload371) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload371) - match payload74 { - Signed(payload75) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload75) + () + } + U8Value(payload372) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload372).to_int()) - () + () } - Unsigned(payload76) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload76.reinterpret_as_int64(), - ) + U16Value(payload373) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload373).reinterpret_as_int()) - () + () } - FloatBits(payload77) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload77.reinterpret_as_int64(), - ) + U32Value(payload374) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload374).reinterpret_as_int()) - () + () } - } + U64Value(payload375) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload375).reinterpret_as_int64()) - () - } - } + () + } + F32Value(payload376) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload376) - match payload67.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + () + } + F64Value(payload377) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload377) - () - } - Some(payload79) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + CharValue(payload378) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload378).to_int()) - let ptr80 = mbt_ffi_str2ptr(payload79) - mbt_ffi_store32(iter_base + 72, payload79.length()) - mbt_ffi_store32(iter_base + 68, ptr80) - cleanup_list.push(ptr80) + () + } + StringValue(payload379) => { + mbt_ffi_store8((iter_base) + 0, (12)) - () - } - } + let ptr380 = mbt_ffi_str2ptr(payload379) + mbt_ffi_store32((iter_base) + 12, payload379.length()) + mbt_ffi_store32((iter_base) + 8, ptr380) + cleanup_list.push(ptr380) - () - } - } + () + } + RecordValue(payload381) => { + mbt_ffi_store8((iter_base) + 0, (13)) - () - } - U16Type(payload81) => { - mbt_ffi_store8(iter_base + 0, 7) + let address382 = mbt_ffi_malloc((payload381).length() * 4); + for index383 = 0; index383 < (payload381).length(); index383 = index383 + 1 { + let iter_elem : Int = (payload381)[(index383)] + let iter_base = address382 + (index383 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match payload81 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + mbt_ffi_store32((iter_base) + 12, (payload381).length()) + mbt_ffi_store32((iter_base) + 8, address382) + cleanup_list.push(address382) - () - } - Some(payload83) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + VariantValue(payload384) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload384).case).reinterpret_as_int()) - match payload83.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + match ((payload384).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - Some(payload85) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + Some(payload386) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload386) - match payload85 { - Signed(payload86) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload86) + () + } + } - () + () } - Unsigned(payload87) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload87.reinterpret_as_int64(), - ) + EnumValue(payload387) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload387).reinterpret_as_int()) - () + () } - FloatBits(payload88) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload88.reinterpret_as_int64(), - ) + FlagsValue(payload388) => { + mbt_ffi_store8((iter_base) + 0, (16)) - () - } - } + let address389 = mbt_ffi_malloc((payload388).length() * 1); + for index390 = 0; index390 < (payload388).length(); index390 = index390 + 1 { + let iter_elem : Bool = (payload388)[(index390)] + let iter_base = address389 + (index390 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) - () - } - } + } + mbt_ffi_store32((iter_base) + 12, (payload388).length()) + mbt_ffi_store32((iter_base) + 8, address389) + cleanup_list.push(address389) - match payload83.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + TupleValue(payload391) => { + mbt_ffi_store8((iter_base) + 0, (17)) - () - } - Some(payload90) => { - mbt_ffi_store8(iter_base + 40, 1) + let address392 = mbt_ffi_malloc((payload391).length() * 4); + for index393 = 0; index393 < (payload391).length(); index393 = index393 + 1 { + let iter_elem : Int = (payload391)[(index393)] + let iter_base = address392 + (index393 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match payload90 { - Signed(payload91) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload91) + } + mbt_ffi_store32((iter_base) + 12, (payload391).length()) + mbt_ffi_store32((iter_base) + 8, address392) + cleanup_list.push(address392) - () + () } - Unsigned(payload92) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload92.reinterpret_as_int64(), - ) + ListValue(payload394) => { + mbt_ffi_store8((iter_base) + 0, (18)) - () - } - FloatBits(payload93) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload93.reinterpret_as_int64(), - ) + let address395 = mbt_ffi_malloc((payload394).length() * 4); + for index396 = 0; index396 < (payload394).length(); index396 = index396 + 1 { + let iter_elem : Int = (payload394)[(index396)] + let iter_base = address395 + (index396 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () + } + mbt_ffi_store32((iter_base) + 12, (payload394).length()) + mbt_ffi_store32((iter_base) + 8, address395) + cleanup_list.push(address395) + + () } - } + FixedListValue(payload397) => { + mbt_ffi_store8((iter_base) + 0, (19)) - () - } - } + let address398 = mbt_ffi_malloc((payload397).length() * 4); + for index399 = 0; index399 < (payload397).length(); index399 = index399 + 1 { + let iter_elem : Int = (payload397)[(index399)] + let iter_base = address398 + (index399 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match payload83.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + } + mbt_ffi_store32((iter_base) + 12, (payload397).length()) + mbt_ffi_store32((iter_base) + 8, address398) + cleanup_list.push(address398) - () - } - Some(payload95) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + MapValue(payload400) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let address401 = mbt_ffi_malloc((payload400).length() * 8); + for index402 = 0; index402 < (payload400).length(); index402 = index402 + 1 { + let iter_elem : @types.MapEntry = (payload400)[(index402)] + let iter_base = address401 + (index402 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload400).length()) + mbt_ffi_store32((iter_base) + 8, address401) + cleanup_list.push(address401) + + () + } + OptionValue(payload403) => { + mbt_ffi_store8((iter_base) + 0, (21)) - let ptr96 = mbt_ffi_str2ptr(payload95) - mbt_ffi_store32(iter_base + 72, payload95.length()) - mbt_ffi_store32(iter_base + 68, ptr96) - cleanup_list.push(ptr96) + match (payload403) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - } + () + } + Some(payload405) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload405) - () - } - } + () + } + } - () - } - U32Type(payload97) => { - mbt_ffi_store8(iter_base + 0, 8) + () + } + ResultValue(payload406) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload406 { + OkValue(payload407) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload407) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload409) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload409) + + () + } + } + + () + } + ErrValue(payload410) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload410) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload412) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload412) + + () + } + } + + () + } + } + + () + } + TextValue(payload413) => { + mbt_ffi_store8((iter_base) + 0, (23)) - match payload97 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr414 = mbt_ffi_str2ptr((payload413).text) + mbt_ffi_store32((iter_base) + 12, (payload413).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr414) - () - } - Some(payload99) => { - mbt_ffi_store8(iter_base + 8, 1) + match ((payload413).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - match payload99.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + Some(payload416) => { + mbt_ffi_store8((iter_base) + 16, (1)) - () - } - Some(payload101) => { - mbt_ffi_store8(iter_base + 16, 1) + let ptr417 = mbt_ffi_str2ptr(payload416) + mbt_ffi_store32((iter_base) + 24, payload416.length()) + mbt_ffi_store32((iter_base) + 20, ptr417) + cleanup_list.push(ptr417) - match payload101 { - Signed(payload102) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload102) + () + } + } + cleanup_list.push(ptr414) - () + () } - Unsigned(payload103) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload103.reinterpret_as_int64(), - ) + BinaryValue(payload418) => { + mbt_ffi_store8((iter_base) + 0, (24)) - () - } - FloatBits(payload104) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload104.reinterpret_as_int64(), - ) + let ptr419 = mbt_ffi_bytes2ptr((payload418).bytes) - () - } - } + mbt_ffi_store32((iter_base) + 12, (payload418).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr419) - () - } - } + match ((payload418).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - match payload99.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + Some(payload421) => { + mbt_ffi_store8((iter_base) + 16, (1)) - () - } - Some(payload106) => { - mbt_ffi_store8(iter_base + 40, 1) + let ptr422 = mbt_ffi_str2ptr(payload421) + mbt_ffi_store32((iter_base) + 24, payload421.length()) + mbt_ffi_store32((iter_base) + 20, ptr422) + cleanup_list.push(ptr422) - match payload106 { - Signed(payload107) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload107) + () + } + } + cleanup_list.push(ptr419) - () + () } - Unsigned(payload108) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload108.reinterpret_as_int64(), - ) + PathValue(payload423) => { + mbt_ffi_store8((iter_base) + 0, (25)) - () - } - FloatBits(payload109) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload109.reinterpret_as_int64(), - ) + let ptr424 = mbt_ffi_str2ptr(payload423) + mbt_ffi_store32((iter_base) + 12, payload423.length()) + mbt_ffi_store32((iter_base) + 8, ptr424) + cleanup_list.push(ptr424) - () + () } - } - - () - } - } + UrlValue(payload425) => { + mbt_ffi_store8((iter_base) + 0, (26)) - match payload99.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let ptr426 = mbt_ffi_str2ptr(payload425) + mbt_ffi_store32((iter_base) + 12, payload425.length()) + mbt_ffi_store32((iter_base) + 8, ptr426) + cleanup_list.push(ptr426) - () - } - Some(payload111) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + DatetimeValue(payload427) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload427).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload427).nanoseconds).reinterpret_as_int()) - let ptr112 = mbt_ffi_str2ptr(payload111) - mbt_ffi_store32(iter_base + 72, payload111.length()) - mbt_ffi_store32(iter_base + 68, ptr112) - cleanup_list.push(ptr112) + () + } + DurationValue(payload428) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload428).nanoseconds) - () - } - } + () + } + QuantityValueNode(payload429) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload429).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload429).scale) - () - } - } + let ptr430 = mbt_ffi_str2ptr((payload429).unit) + mbt_ffi_store32((iter_base) + 24, (payload429).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr430) + cleanup_list.push(ptr430) - () - } - U64Type(payload113) => { - mbt_ffi_store8(iter_base + 0, 9) + () + } + UnionValue(payload431) => { + mbt_ffi_store8((iter_base) + 0, (30)) - match payload113 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr432 = mbt_ffi_str2ptr((payload431).tag) + mbt_ffi_store32((iter_base) + 12, (payload431).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr432) + mbt_ffi_store32((iter_base) + 16, (payload431).body) + cleanup_list.push(ptr432) - () - } - Some(payload115) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + SecretValue(payload433) => { + mbt_ffi_store8((iter_base) + 0, (31)) - match payload115.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let @types.Secret(handle) = payload433 + mbt_ffi_store32((iter_base) + 8, handle) - () - } - Some(payload117) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + QuotaTokenHandle(payload434) => { + mbt_ffi_store8((iter_base) + 0, (32)) - match payload117 { - Signed(payload118) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload118) + let @types.QuotaToken(handle435) = payload434 + mbt_ffi_store32((iter_base) + 8, handle435) - () + () } - Unsigned(payload119) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload119.reinterpret_as_int64(), - ) + PermissionCardHandle(payload436) => { + mbt_ffi_store8((iter_base) + 0, (33)) - () - } - FloatBits(payload120) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload120.reinterpret_as_int64(), - ) + let @types.PermissionCard(handle437) = payload436 + mbt_ffi_store32((iter_base) + 8, handle437) - () + () } - } - - () - } } - match payload115.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + } + mbt_ffi_store32((return_area) + 32, (((request).value).value_nodes).length()) + mbt_ffi_store32((return_area) + 28, address438) + mbt_ffi_store32((return_area) + 36, ((request).value).root) - () - } - Some(payload122) => { - mbt_ffi_store8(iter_base + 40, 1) + let address802 = mbt_ffi_malloc((((response).graph).type_nodes).length() * 144); + for index803 = 0; index803 < (((response).graph).type_nodes).length(); index803 = index803 + 1 { + let iter_elem : @types.SchemaTypeNode = (((response).graph).type_nodes)[(index803)] + let iter_base = address802 + (index803 * 144); - match payload122 { - Signed(payload123) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload123) + match (iter_elem).body { + RefType(payload440) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store32((iter_base) + 8, payload440) - () + () } - Unsigned(payload124) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload124.reinterpret_as_int64(), - ) + BoolType => { + mbt_ffi_store8((iter_base) + 0, (1)) - () + () } - FloatBits(payload125) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload125.reinterpret_as_int64(), - ) - - () + S8Type(payload442) => { + mbt_ffi_store8((iter_base) + 0, (2)) + + match (payload442) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload444) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload444).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload446) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload446 { + Signed(payload447) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload447) + + () + } + Unsigned(payload448) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload448).reinterpret_as_int64()) + + () + } + FloatBits(payload449) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload449).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload444).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload451) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload451 { + Signed(payload452) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload452) + + () + } + Unsigned(payload453) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload453).reinterpret_as_int64()) + + () + } + FloatBits(payload454) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload454).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload444).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload456) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr457 = mbt_ffi_str2ptr(payload456) + mbt_ffi_store32((iter_base) + 72, payload456.length()) + mbt_ffi_store32((iter_base) + 68, ptr457) + cleanup_list.push(ptr457) + + () + } + } + + () + } + } + + () + } + S16Type(payload458) => { + mbt_ffi_store8((iter_base) + 0, (3)) + + match (payload458) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload460) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload460).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload462) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload462 { + Signed(payload463) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload463) + + () + } + Unsigned(payload464) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload464).reinterpret_as_int64()) + + () + } + FloatBits(payload465) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload465).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload460).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload467) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload467 { + Signed(payload468) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload468) + + () + } + Unsigned(payload469) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload469).reinterpret_as_int64()) + + () + } + FloatBits(payload470) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload470).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload460).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload472) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr473 = mbt_ffi_str2ptr(payload472) + mbt_ffi_store32((iter_base) + 72, payload472.length()) + mbt_ffi_store32((iter_base) + 68, ptr473) + cleanup_list.push(ptr473) + + () + } + } + + () + } + } + + () + } + S32Type(payload474) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + match (payload474) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload476) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload476).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload478) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload478 { + Signed(payload479) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload479) + + () + } + Unsigned(payload480) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload480).reinterpret_as_int64()) + + () + } + FloatBits(payload481) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload481).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload476).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload483) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload483 { + Signed(payload484) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload484) + + () + } + Unsigned(payload485) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload485).reinterpret_as_int64()) + + () + } + FloatBits(payload486) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload486).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload476).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload488) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr489 = mbt_ffi_str2ptr(payload488) + mbt_ffi_store32((iter_base) + 72, payload488.length()) + mbt_ffi_store32((iter_base) + 68, ptr489) + cleanup_list.push(ptr489) + + () + } + } + + () + } + } + + () + } + S64Type(payload490) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + match (payload490) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload492) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload492).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload494) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload494 { + Signed(payload495) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload495) + + () + } + Unsigned(payload496) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload496).reinterpret_as_int64()) + + () + } + FloatBits(payload497) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload497).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload492).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload499) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload499 { + Signed(payload500) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload500) + + () + } + Unsigned(payload501) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload501).reinterpret_as_int64()) + + () + } + FloatBits(payload502) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload502).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload492).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload504) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr505 = mbt_ffi_str2ptr(payload504) + mbt_ffi_store32((iter_base) + 72, payload504.length()) + mbt_ffi_store32((iter_base) + 68, ptr505) + cleanup_list.push(ptr505) + + () + } + } + + () + } + } + + () + } + U8Type(payload506) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + match (payload506) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload508) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload508).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload510) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload510 { + Signed(payload511) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload511) + + () + } + Unsigned(payload512) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload512).reinterpret_as_int64()) + + () + } + FloatBits(payload513) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload513).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload508).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload515) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload515 { + Signed(payload516) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload516) + + () + } + Unsigned(payload517) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload517).reinterpret_as_int64()) + + () + } + FloatBits(payload518) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload518).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload508).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload520) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr521 = mbt_ffi_str2ptr(payload520) + mbt_ffi_store32((iter_base) + 72, payload520.length()) + mbt_ffi_store32((iter_base) + 68, ptr521) + cleanup_list.push(ptr521) + + () + } + } + + () + } + } + + () } - } + U16Type(payload522) => { + mbt_ffi_store8((iter_base) + 0, (7)) + + match (payload522) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload524) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload524).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload526) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload526 { + Signed(payload527) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload527) + + () + } + Unsigned(payload528) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload528).reinterpret_as_int64()) + + () + } + FloatBits(payload529) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload529).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload524).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload531) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload531 { + Signed(payload532) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload532) + + () + } + Unsigned(payload533) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload533).reinterpret_as_int64()) + + () + } + FloatBits(payload534) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload534).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload524).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload536) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr537 = mbt_ffi_str2ptr(payload536) + mbt_ffi_store32((iter_base) + 72, payload536.length()) + mbt_ffi_store32((iter_base) + 68, ptr537) + cleanup_list.push(ptr537) + + () + } + } + + () + } + } + + () + } + U32Type(payload538) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + match (payload538) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload540) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload540).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload542) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload542 { + Signed(payload543) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload543) + + () + } + Unsigned(payload544) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload544).reinterpret_as_int64()) + + () + } + FloatBits(payload545) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload545).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload540).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload547) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload547 { + Signed(payload548) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload548) + + () + } + Unsigned(payload549) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload549).reinterpret_as_int64()) + + () + } + FloatBits(payload550) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload550).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload540).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload552) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr553 = mbt_ffi_str2ptr(payload552) + mbt_ffi_store32((iter_base) + 72, payload552.length()) + mbt_ffi_store32((iter_base) + 68, ptr553) + cleanup_list.push(ptr553) + + () + } + } + + () + } + } + + () + } + U64Type(payload554) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + match (payload554) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload556) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload556).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload558) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload558 { + Signed(payload559) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload559) + + () + } + Unsigned(payload560) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload560).reinterpret_as_int64()) + + () + } + FloatBits(payload561) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload561).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload556).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload563) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload563 { + Signed(payload564) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload564) + + () + } + Unsigned(payload565) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload565).reinterpret_as_int64()) + + () + } + FloatBits(payload566) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload566).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload556).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload568) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr569 = mbt_ffi_str2ptr(payload568) + mbt_ffi_store32((iter_base) + 72, payload568.length()) + mbt_ffi_store32((iter_base) + 68, ptr569) + cleanup_list.push(ptr569) + + () + } + } + + () + } + } + + () + } + F32Type(payload570) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + match (payload570) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload572) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload572).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload574) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload574 { + Signed(payload575) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload575) + + () + } + Unsigned(payload576) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload576).reinterpret_as_int64()) + + () + } + FloatBits(payload577) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload577).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload572).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload579) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload579 { + Signed(payload580) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload580) + + () + } + Unsigned(payload581) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload581).reinterpret_as_int64()) + + () + } + FloatBits(payload582) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload582).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload572).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload584) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr585 = mbt_ffi_str2ptr(payload584) + mbt_ffi_store32((iter_base) + 72, payload584.length()) + mbt_ffi_store32((iter_base) + 68, ptr585) + cleanup_list.push(ptr585) + + () + } + } + + () + } + } + + () + } + F64Type(payload586) => { + mbt_ffi_store8((iter_base) + 0, (11)) + + match (payload586) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload588) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload588).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload590) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload590 { + Signed(payload591) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload591) + + () + } + Unsigned(payload592) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload592).reinterpret_as_int64()) + + () + } + FloatBits(payload593) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload593).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload588).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload595) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload595 { + Signed(payload596) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload596) + + () + } + Unsigned(payload597) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload597).reinterpret_as_int64()) + + () + } + FloatBits(payload598) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload598).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload588).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload600) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr601 = mbt_ffi_str2ptr(payload600) + mbt_ffi_store32((iter_base) + 72, payload600.length()) + mbt_ffi_store32((iter_base) + 68, ptr601) + cleanup_list.push(ptr601) + + () + } + } + + () + } + } + + () + } + CharType => { + mbt_ffi_store8((iter_base) + 0, (12)) - () - } - } + () + } + StringType => { + mbt_ffi_store8((iter_base) + 0, (13)) - match payload115.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + () + } + RecordType(payload604) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let address625 = mbt_ffi_malloc((payload604).length() * 68); + for index626 = 0; index626 < (payload604).length(); index626 = index626 + 1 { + let iter_elem : @types.NamedFieldType = (payload604)[(index626)] + let iter_base = address625 + (index626 * 68); + + let ptr605 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr605) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload607) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr608 = mbt_ffi_str2ptr(payload607) + mbt_ffi_store32((iter_base) + 20, payload607.length()) + mbt_ffi_store32((iter_base) + 16, ptr608) + cleanup_list.push(ptr608) + + () + } + } + + let address610 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index611 = 0; index611 < (((iter_elem).metadata).aliases).length(); index611 = index611 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index611)] + let iter_base = address610 + (index611 * 8); + + let ptr609 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr609) + cleanup_list.push(ptr609) + + } + mbt_ffi_store32((iter_base) + 28, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 24, address610) + + let address613 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index614 = 0; index614 < (((iter_elem).metadata).examples).length(); index614 = index614 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index614)] + let iter_base = address613 + (index614 * 8); + + let ptr612 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr612) + cleanup_list.push(ptr612) + + } + mbt_ffi_store32((iter_base) + 36, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 32, address613) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload616) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + let ptr617 = mbt_ffi_str2ptr(payload616) + mbt_ffi_store32((iter_base) + 48, payload616.length()) + mbt_ffi_store32((iter_base) + 44, ptr617) + cleanup_list.push(ptr617) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 52, (0)) + + () + } + Some(payload619) => { + mbt_ffi_store8((iter_base) + 52, (1)) + + match payload619 { + Multimodal => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 56, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 56, (2)) + + () + } + Other(payload623) => { + mbt_ffi_store8((iter_base) + 56, (3)) + + let ptr624 = mbt_ffi_str2ptr(payload623) + mbt_ffi_store32((iter_base) + 64, payload623.length()) + mbt_ffi_store32((iter_base) + 60, ptr624) + cleanup_list.push(ptr624) + + () + } + } + + () + } + } + cleanup_list.push(ptr605) + cleanup_list.push(address610) + cleanup_list.push(address613) + + } + mbt_ffi_store32((iter_base) + 12, (payload604).length()) + mbt_ffi_store32((iter_base) + 8, address625) + cleanup_list.push(address625) + + () + } + VariantType(payload627) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let address650 = mbt_ffi_malloc((payload627).length() * 72); + for index651 = 0; index651 < (payload627).length(); index651 = index651 + 1 { + let iter_elem : @types.VariantCaseType = (payload627)[(index651)] + let iter_base = address650 + (index651 * 72); + + let ptr628 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr628) + + match ((iter_elem).payload) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload630) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload630) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload632) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr633 = mbt_ffi_str2ptr(payload632) + mbt_ffi_store32((iter_base) + 24, payload632.length()) + mbt_ffi_store32((iter_base) + 20, ptr633) + cleanup_list.push(ptr633) + + () + } + } + + let address635 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index636 = 0; index636 < (((iter_elem).metadata).aliases).length(); index636 = index636 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index636)] + let iter_base = address635 + (index636 * 8); + + let ptr634 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr634) + cleanup_list.push(ptr634) + + } + mbt_ffi_store32((iter_base) + 32, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 28, address635) + + let address638 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index639 = 0; index639 < (((iter_elem).metadata).examples).length(); index639 = index639 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index639)] + let iter_base = address638 + (index639 * 8); + + let ptr637 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr637) + cleanup_list.push(ptr637) + + } + mbt_ffi_store32((iter_base) + 40, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 36, address638) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 44, (0)) + + () + } + Some(payload641) => { + mbt_ffi_store8((iter_base) + 44, (1)) + + let ptr642 = mbt_ffi_str2ptr(payload641) + mbt_ffi_store32((iter_base) + 52, payload641.length()) + mbt_ffi_store32((iter_base) + 48, ptr642) + cleanup_list.push(ptr642) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload644) => { + mbt_ffi_store8((iter_base) + 56, (1)) + + match payload644 { + Multimodal => { + mbt_ffi_store8((iter_base) + 60, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 60, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 60, (2)) + + () + } + Other(payload648) => { + mbt_ffi_store8((iter_base) + 60, (3)) + + let ptr649 = mbt_ffi_str2ptr(payload648) + mbt_ffi_store32((iter_base) + 68, payload648.length()) + mbt_ffi_store32((iter_base) + 64, ptr649) + cleanup_list.push(ptr649) + + () + } + } + + () + } + } + cleanup_list.push(ptr628) + cleanup_list.push(address635) + cleanup_list.push(address638) + + } + mbt_ffi_store32((iter_base) + 12, (payload627).length()) + mbt_ffi_store32((iter_base) + 8, address650) + cleanup_list.push(address650) + + () + } + EnumType(payload652) => { + mbt_ffi_store8((iter_base) + 0, (16)) - () - } - Some(payload127) => { - mbt_ffi_store8(iter_base + 64, 1) + let address654 = mbt_ffi_malloc((payload652).length() * 8); + for index655 = 0; index655 < (payload652).length(); index655 = index655 + 1 { + let iter_elem : String = (payload652)[(index655)] + let iter_base = address654 + (index655 * 8); - let ptr128 = mbt_ffi_str2ptr(payload127) - mbt_ffi_store32(iter_base + 72, payload127.length()) - mbt_ffi_store32(iter_base + 68, ptr128) - cleanup_list.push(ptr128) + let ptr653 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr653) + cleanup_list.push(ptr653) - () - } - } + } + mbt_ffi_store32((iter_base) + 12, (payload652).length()) + mbt_ffi_store32((iter_base) + 8, address654) + cleanup_list.push(address654) - () - } - } + () + } + FlagsType(payload656) => { + mbt_ffi_store8((iter_base) + 0, (17)) - () - } - F32Type(payload129) => { - mbt_ffi_store8(iter_base + 0, 10) + let address658 = mbt_ffi_malloc((payload656).length() * 8); + for index659 = 0; index659 < (payload656).length(); index659 = index659 + 1 { + let iter_elem : String = (payload656)[(index659)] + let iter_base = address658 + (index659 * 8); - match payload129 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr657 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr657) + cleanup_list.push(ptr657) - () - } - Some(payload131) => { - mbt_ffi_store8(iter_base + 8, 1) + } + mbt_ffi_store32((iter_base) + 12, (payload656).length()) + mbt_ffi_store32((iter_base) + 8, address658) + cleanup_list.push(address658) - match payload131.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + TupleType(payload660) => { + mbt_ffi_store8((iter_base) + 0, (18)) - () - } - Some(payload133) => { - mbt_ffi_store8(iter_base + 16, 1) + let address661 = mbt_ffi_malloc((payload660).length() * 4); + for index662 = 0; index662 < (payload660).length(); index662 = index662 + 1 { + let iter_elem : Int = (payload660)[(index662)] + let iter_base = address661 + (index662 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match payload133 { - Signed(payload134) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload134) + } + mbt_ffi_store32((iter_base) + 12, (payload660).length()) + mbt_ffi_store32((iter_base) + 8, address661) + cleanup_list.push(address661) - () + () } - Unsigned(payload135) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload135.reinterpret_as_int64(), - ) + ListType(payload663) => { + mbt_ffi_store8((iter_base) + 0, (19)) + mbt_ffi_store32((iter_base) + 8, payload663) - () + () } - FloatBits(payload136) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload136.reinterpret_as_int64(), - ) + FixedListType(payload664) => { + mbt_ffi_store8((iter_base) + 0, (20)) + mbt_ffi_store32((iter_base) + 8, (payload664).element) + mbt_ffi_store32((iter_base) + 12, ((payload664).length).reinterpret_as_int()) - () + () } - } - - () - } - } + MapType(payload665) => { + mbt_ffi_store8((iter_base) + 0, (21)) + mbt_ffi_store32((iter_base) + 8, (payload665).key) + mbt_ffi_store32((iter_base) + 12, (payload665).value) - match payload131.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload138) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload138 { - Signed(payload139) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload139) + () + } + OptionType(payload666) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store32((iter_base) + 8, payload666) - () + () + } + ResultType(payload667) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match ((payload667).ok) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload669) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload669) + + () + } + } + + match ((payload667).err) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload671) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload671) + + () + } + } + + () + } + TextType(payload672) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match ((payload672).languages) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload674) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address676 = mbt_ffi_malloc((payload674).length() * 8); + for index677 = 0; index677 < (payload674).length(); index677 = index677 + 1 { + let iter_elem : String = (payload674)[(index677)] + let iter_base = address676 + (index677 * 8); + + let ptr675 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr675) + cleanup_list.push(ptr675) + + } + mbt_ffi_store32((iter_base) + 16, (payload674).length()) + mbt_ffi_store32((iter_base) + 12, address676) + cleanup_list.push(address676) + + () + } + } + + match ((payload672).min_length) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload679) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload679).reinterpret_as_int()) + + () + } + } + + match ((payload672).max_length) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload681) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload681).reinterpret_as_int()) + + () + } + } + + match ((payload672).regex) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload683) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr684 = mbt_ffi_str2ptr(payload683) + mbt_ffi_store32((iter_base) + 44, payload683.length()) + mbt_ffi_store32((iter_base) + 40, ptr684) + cleanup_list.push(ptr684) + + () + } + } + + () + } + BinaryType(payload685) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + match ((payload685).mime_types) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload687) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address689 = mbt_ffi_malloc((payload687).length() * 8); + for index690 = 0; index690 < (payload687).length(); index690 = index690 + 1 { + let iter_elem : String = (payload687)[(index690)] + let iter_base = address689 + (index690 * 8); + + let ptr688 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr688) + cleanup_list.push(ptr688) + + } + mbt_ffi_store32((iter_base) + 16, (payload687).length()) + mbt_ffi_store32((iter_base) + 12, address689) + cleanup_list.push(address689) + + () + } + } + + match ((payload685).min_bytes) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload692) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload692).reinterpret_as_int()) + + () + } + } + + match ((payload685).max_bytes) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload694) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload694).reinterpret_as_int()) + + () + } + } + + () + } + PathType(payload695) => { + mbt_ffi_store8((iter_base) + 0, (26)) + mbt_ffi_store8((iter_base) + 8, (payload695).direction.ordinal()) + mbt_ffi_store8((iter_base) + 9, (payload695).kind.ordinal()) + + match ((payload695).allowed_mime_types) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload697) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let address699 = mbt_ffi_malloc((payload697).length() * 8); + for index700 = 0; index700 < (payload697).length(); index700 = index700 + 1 { + let iter_elem : String = (payload697)[(index700)] + let iter_base = address699 + (index700 * 8); + + let ptr698 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr698) + cleanup_list.push(ptr698) + + } + mbt_ffi_store32((iter_base) + 20, (payload697).length()) + mbt_ffi_store32((iter_base) + 16, address699) + cleanup_list.push(address699) + + () + } + } + + match ((payload695).allowed_extensions) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload702) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let address704 = mbt_ffi_malloc((payload702).length() * 8); + for index705 = 0; index705 < (payload702).length(); index705 = index705 + 1 { + let iter_elem : String = (payload702)[(index705)] + let iter_base = address704 + (index705 * 8); + + let ptr703 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr703) + cleanup_list.push(ptr703) + + } + mbt_ffi_store32((iter_base) + 32, (payload702).length()) + mbt_ffi_store32((iter_base) + 28, address704) + cleanup_list.push(address704) + + () + } + } + + () + } + UrlType(payload706) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + match ((payload706).allowed_schemes) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload708) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address710 = mbt_ffi_malloc((payload708).length() * 8); + for index711 = 0; index711 < (payload708).length(); index711 = index711 + 1 { + let iter_elem : String = (payload708)[(index711)] + let iter_base = address710 + (index711 * 8); + + let ptr709 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr709) + cleanup_list.push(ptr709) + + } + mbt_ffi_store32((iter_base) + 16, (payload708).length()) + mbt_ffi_store32((iter_base) + 12, address710) + cleanup_list.push(address710) + + () + } + } + + match ((payload706).allowed_hosts) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload713) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let address715 = mbt_ffi_malloc((payload713).length() * 8); + for index716 = 0; index716 < (payload713).length(); index716 = index716 + 1 { + let iter_elem : String = (payload713)[(index716)] + let iter_base = address715 + (index716 * 8); + + let ptr714 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr714) + cleanup_list.push(ptr714) + + } + mbt_ffi_store32((iter_base) + 28, (payload713).length()) + mbt_ffi_store32((iter_base) + 24, address715) + cleanup_list.push(address715) + + () + } + } + + () } - Unsigned(payload140) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload140.reinterpret_as_int64(), - ) + DatetimeType => { + mbt_ffi_store8((iter_base) + 0, (28)) - () + () } - FloatBits(payload141) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload141.reinterpret_as_int64(), - ) + DurationType => { + mbt_ffi_store8((iter_base) + 0, (29)) - () + () } - } + QuantityType(payload719) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr720 = mbt_ffi_str2ptr((payload719).base_unit) + mbt_ffi_store32((iter_base) + 12, (payload719).base_unit.length()) + mbt_ffi_store32((iter_base) + 8, ptr720) + + let address722 = mbt_ffi_malloc(((payload719).allowed_suffixes).length() * 8); + for index723 = 0; index723 < ((payload719).allowed_suffixes).length(); index723 = index723 + 1 { + let iter_elem : String = ((payload719).allowed_suffixes)[(index723)] + let iter_base = address722 + (index723 * 8); + + let ptr721 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr721) + cleanup_list.push(ptr721) + + } + mbt_ffi_store32((iter_base) + 20, ((payload719).allowed_suffixes).length()) + mbt_ffi_store32((iter_base) + 16, address722) + + match ((payload719).min) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload725) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload725).mantissa) + mbt_ffi_store32((iter_base) + 40, (payload725).scale) + + let ptr726 = mbt_ffi_str2ptr((payload725).unit) + mbt_ffi_store32((iter_base) + 48, (payload725).unit.length()) + mbt_ffi_store32((iter_base) + 44, ptr726) + cleanup_list.push(ptr726) + + () + } + } + + match ((payload719).max) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload728) => { + mbt_ffi_store8((iter_base) + 56, (1)) + mbt_ffi_store64((iter_base) + 64, (payload728).mantissa) + mbt_ffi_store32((iter_base) + 72, (payload728).scale) + + let ptr729 = mbt_ffi_str2ptr((payload728).unit) + mbt_ffi_store32((iter_base) + 80, (payload728).unit.length()) + mbt_ffi_store32((iter_base) + 76, ptr729) + cleanup_list.push(ptr729) + + () + } + } + cleanup_list.push(ptr720) + cleanup_list.push(address722) + + () + } + UnionType(payload730) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let address766 = mbt_ffi_malloc(((payload730).branches).length() * 92); + for index767 = 0; index767 < ((payload730).branches).length(); index767 = index767 + 1 { + let iter_elem : @types.UnionBranch = ((payload730).branches)[(index767)] + let iter_base = address766 + (index767 * 92); + + let ptr731 = mbt_ffi_str2ptr((iter_elem).tag) + mbt_ffi_store32((iter_base) + 4, (iter_elem).tag.length()) + mbt_ffi_store32((iter_base) + 0, ptr731) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (iter_elem).discriminator { + Prefix(payload732) => { + mbt_ffi_store8((iter_base) + 12, (0)) + + let ptr733 = mbt_ffi_str2ptr(payload732) + mbt_ffi_store32((iter_base) + 20, payload732.length()) + mbt_ffi_store32((iter_base) + 16, ptr733) + cleanup_list.push(ptr733) + + () + } + Suffix(payload734) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr735 = mbt_ffi_str2ptr(payload734) + mbt_ffi_store32((iter_base) + 20, payload734.length()) + mbt_ffi_store32((iter_base) + 16, ptr735) + cleanup_list.push(ptr735) + + () + } + Contains(payload736) => { + mbt_ffi_store8((iter_base) + 12, (2)) + + let ptr737 = mbt_ffi_str2ptr(payload736) + mbt_ffi_store32((iter_base) + 20, payload736.length()) + mbt_ffi_store32((iter_base) + 16, ptr737) + cleanup_list.push(ptr737) + + () + } + Regex(payload738) => { + mbt_ffi_store8((iter_base) + 12, (3)) + + let ptr739 = mbt_ffi_str2ptr(payload738) + mbt_ffi_store32((iter_base) + 20, payload738.length()) + mbt_ffi_store32((iter_base) + 16, ptr739) + cleanup_list.push(ptr739) + + () + } + FieldEquals(payload740) => { + mbt_ffi_store8((iter_base) + 12, (4)) + + let ptr741 = mbt_ffi_str2ptr((payload740).field_name) + mbt_ffi_store32((iter_base) + 20, (payload740).field_name.length()) + mbt_ffi_store32((iter_base) + 16, ptr741) + + match ((payload740).literal) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload743) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let ptr744 = mbt_ffi_str2ptr(payload743) + mbt_ffi_store32((iter_base) + 32, payload743.length()) + mbt_ffi_store32((iter_base) + 28, ptr744) + cleanup_list.push(ptr744) + + () + } + } + cleanup_list.push(ptr741) + + () + } + FieldAbsent(payload745) => { + mbt_ffi_store8((iter_base) + 12, (5)) + + let ptr746 = mbt_ffi_str2ptr(payload745) + mbt_ffi_store32((iter_base) + 20, payload745.length()) + mbt_ffi_store32((iter_base) + 16, ptr746) + cleanup_list.push(ptr746) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload748) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr749 = mbt_ffi_str2ptr(payload748) + mbt_ffi_store32((iter_base) + 44, payload748.length()) + mbt_ffi_store32((iter_base) + 40, ptr749) + cleanup_list.push(ptr749) + + () + } + } + + let address751 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index752 = 0; index752 < (((iter_elem).metadata).aliases).length(); index752 = index752 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index752)] + let iter_base = address751 + (index752 * 8); + + let ptr750 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr750) + cleanup_list.push(ptr750) + + } + mbt_ffi_store32((iter_base) + 52, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 48, address751) + + let address754 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index755 = 0; index755 < (((iter_elem).metadata).examples).length(); index755 = index755 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index755)] + let iter_base = address754 + (index755 * 8); + + let ptr753 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr753) + cleanup_list.push(ptr753) + + } + mbt_ffi_store32((iter_base) + 60, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 56, address754) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload757) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr758 = mbt_ffi_str2ptr(payload757) + mbt_ffi_store32((iter_base) + 72, payload757.length()) + mbt_ffi_store32((iter_base) + 68, ptr758) + cleanup_list.push(ptr758) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 76, (0)) + + () + } + Some(payload760) => { + mbt_ffi_store8((iter_base) + 76, (1)) + + match payload760 { + Multimodal => { + mbt_ffi_store8((iter_base) + 80, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 80, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 80, (2)) + + () + } + Other(payload764) => { + mbt_ffi_store8((iter_base) + 80, (3)) + + let ptr765 = mbt_ffi_str2ptr(payload764) + mbt_ffi_store32((iter_base) + 88, payload764.length()) + mbt_ffi_store32((iter_base) + 84, ptr765) + cleanup_list.push(ptr765) + + () + } + } + + () + } + } + cleanup_list.push(ptr731) + cleanup_list.push(address751) + cleanup_list.push(address754) + + } + mbt_ffi_store32((iter_base) + 12, ((payload730).branches).length()) + mbt_ffi_store32((iter_base) + 8, address766) + cleanup_list.push(address766) + + () + } + SecretType(payload768) => { + mbt_ffi_store8((iter_base) + 0, (32)) + mbt_ffi_store32((iter_base) + 8, (payload768).inner) - () - } - } + match ((payload768).category) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - match payload131.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + () + } + Some(payload770) => { + mbt_ffi_store8((iter_base) + 12, (1)) - () - } - Some(payload143) => { - mbt_ffi_store8(iter_base + 64, 1) + let ptr771 = mbt_ffi_str2ptr(payload770) + mbt_ffi_store32((iter_base) + 20, payload770.length()) + mbt_ffi_store32((iter_base) + 16, ptr771) + cleanup_list.push(ptr771) - let ptr144 = mbt_ffi_str2ptr(payload143) - mbt_ffi_store32(iter_base + 72, payload143.length()) - mbt_ffi_store32(iter_base + 68, ptr144) - cleanup_list.push(ptr144) + () + } + } - () - } - } + () + } + QuotaTokenType(payload772) => { + mbt_ffi_store8((iter_base) + 0, (33)) - () - } - } + match ((payload772).resource_name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - F64Type(payload145) => { - mbt_ffi_store8(iter_base + 0, 11) + () + } + Some(payload774) => { + mbt_ffi_store8((iter_base) + 8, (1)) - match payload145 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr775 = mbt_ffi_str2ptr(payload774) + mbt_ffi_store32((iter_base) + 16, payload774.length()) + mbt_ffi_store32((iter_base) + 12, ptr775) + cleanup_list.push(ptr775) - () - } - Some(payload147) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + } + + () + } + PermissionCardType(payload776) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store8((iter_base) + 8, (if (payload776).polymorphic { 1 } else { 0 })) - match payload147.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + FutureType(payload777) => { + mbt_ffi_store8((iter_base) + 0, (35)) - () - } - Some(payload149) => { - mbt_ffi_store8(iter_base + 16, 1) + match (payload777) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload149 { - Signed(payload150) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload150) + () + } + Some(payload779) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload779) - () - } - Unsigned(payload151) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload151.reinterpret_as_int64(), - ) + () + } + } - () + () } - FloatBits(payload152) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload152.reinterpret_as_int64(), - ) + StreamType(payload780) => { + mbt_ffi_store8((iter_base) + 0, (36)) - () - } - } + match (payload780) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - } + () + } + Some(payload782) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload782) - match payload147.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + } - () - } - Some(payload154) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + } - match payload154 { - Signed(payload155) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload155) + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 88, (0)) - () + () } - Unsigned(payload156) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload156.reinterpret_as_int64(), - ) + Some(payload784) => { + mbt_ffi_store8((iter_base) + 88, (1)) - () - } - FloatBits(payload157) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload157.reinterpret_as_int64(), - ) + let ptr785 = mbt_ffi_str2ptr(payload784) + mbt_ffi_store32((iter_base) + 96, payload784.length()) + mbt_ffi_store32((iter_base) + 92, ptr785) + cleanup_list.push(ptr785) - () + () } - } - - () - } } - match payload147.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let address787 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index788 = 0; index788 < (((iter_elem).metadata).aliases).length(); index788 = index788 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index788)] + let iter_base = address787 + (index788 * 8); - () - } - Some(payload159) => { - mbt_ffi_store8(iter_base + 64, 1) + let ptr786 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr786) + cleanup_list.push(ptr786) - let ptr160 = mbt_ffi_str2ptr(payload159) - mbt_ffi_store32(iter_base + 72, payload159.length()) - mbt_ffi_store32(iter_base + 68, ptr160) - cleanup_list.push(ptr160) - - () - } } + mbt_ffi_store32((iter_base) + 104, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 100, address787) - () - } - } - - () - } - CharType => { - mbt_ffi_store8(iter_base + 0, 12) + let address790 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index791 = 0; index791 < (((iter_elem).metadata).examples).length(); index791 = index791 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index791)] + let iter_base = address790 + (index791 * 8); - () - } - StringType => { - mbt_ffi_store8(iter_base + 0, 13) + let ptr789 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr789) + cleanup_list.push(ptr789) - () - } - RecordType(payload163) => { - mbt_ffi_store8(iter_base + 0, 14) - - let address182 = mbt_ffi_malloc(payload163.length() * 68) - for index183 = 0 - index183 < payload163.length() - index183 = index183 + 1 { - let iter_elem : @types.NamedFieldType = payload163[index183] - let iter_base = address182 + index183 * 68 - - let ptr164 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr164) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () } - Some(payload166) => { - mbt_ffi_store8(iter_base + 12, 1) + mbt_ffi_store32((iter_base) + 112, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 108, address790) - let ptr167 = mbt_ffi_str2ptr(payload166) - mbt_ffi_store32(iter_base + 20, payload166.length()) - mbt_ffi_store32(iter_base + 16, ptr167) - cleanup_list.push(ptr167) + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 116, (0)) - () - } - } - - let address = mbt_ffi_malloc(iter_elem.metadata.aliases.length() * 8) - for index = 0 - index < iter_elem.metadata.aliases.length() - index = index + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index] - let iter_base = address + index * 8 - - let ptr168 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr168) - cleanup_list.push(ptr168) - } - mbt_ffi_store32(iter_base + 28, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 24, address) - - let address170 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index171 = 0 - index171 < iter_elem.metadata.examples.length() - index171 = index171 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index171] - let iter_base = address170 + index171 * 8 - - let ptr169 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr169) - cleanup_list.push(ptr169) - } - mbt_ffi_store32(iter_base + 36, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 32, address170) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload173) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + Some(payload793) => { + mbt_ffi_store8((iter_base) + 116, (1)) - let ptr174 = mbt_ffi_str2ptr(payload173) - mbt_ffi_store32(iter_base + 48, payload173.length()) - mbt_ffi_store32(iter_base + 44, ptr174) - cleanup_list.push(ptr174) + let ptr794 = mbt_ffi_str2ptr(payload793) + mbt_ffi_store32((iter_base) + 124, payload793.length()) + mbt_ffi_store32((iter_base) + 120, ptr794) + cleanup_list.push(ptr794) - () + () + } } - } - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 52, 0) + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 128, (0)) - () + () + } + Some(payload796) => { + mbt_ffi_store8((iter_base) + 128, (1)) + + match payload796 { + Multimodal => { + mbt_ffi_store8((iter_base) + 132, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 132, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 132, (2)) + + () + } + Other(payload800) => { + mbt_ffi_store8((iter_base) + 132, (3)) + + let ptr801 = mbt_ffi_str2ptr(payload800) + mbt_ffi_store32((iter_base) + 140, payload800.length()) + mbt_ffi_store32((iter_base) + 136, ptr801) + cleanup_list.push(ptr801) + + () + } + } + + () + } } - Some(payload176) => { - mbt_ffi_store8(iter_base + 52, 1) + cleanup_list.push(address787) + cleanup_list.push(address790) - match payload176 { - Multimodal => { - mbt_ffi_store8(iter_base + 56, 0) + } + mbt_ffi_store32((return_area) + 44, (((response).graph).type_nodes).length()) + mbt_ffi_store32((return_area) + 40, address802) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 56, 1) + let address808 = mbt_ffi_malloc((((response).graph).defs).length() * 24); + for index809 = 0; index809 < (((response).graph).defs).length(); index809 = index809 + 1 { + let iter_elem : @types.SchemaTypeDef = (((response).graph).defs)[(index809)] + let iter_base = address808 + (index809 * 24); - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 56, 2) + let ptr804 = mbt_ffi_str2ptr((iter_elem).id) + mbt_ffi_store32((iter_base) + 4, (iter_elem).id.length()) + mbt_ffi_store32((iter_base) + 0, ptr804) - () - } - Other(payload180) => { - mbt_ffi_store8(iter_base + 56, 3) + match ((iter_elem).name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - let ptr181 = mbt_ffi_str2ptr(payload180) - mbt_ffi_store32(iter_base + 64, payload180.length()) - mbt_ffi_store32(iter_base + 60, ptr181) - cleanup_list.push(ptr181) + () + } + Some(payload806) => { + mbt_ffi_store8((iter_base) + 8, (1)) - () - } - } + let ptr807 = mbt_ffi_str2ptr(payload806) + mbt_ffi_store32((iter_base) + 16, payload806.length()) + mbt_ffi_store32((iter_base) + 12, ptr807) + cleanup_list.push(ptr807) - () + () + } } - } - cleanup_list.push(ptr164) - cleanup_list.push(address) - cleanup_list.push(address170) - } - mbt_ffi_store32(iter_base + 12, payload163.length()) - mbt_ffi_store32(iter_base + 8, address182) - cleanup_list.push(address182) - - () + mbt_ffi_store32((iter_base) + 20, (iter_elem).body) + cleanup_list.push(ptr804) + } - VariantType(payload184) => { - mbt_ffi_store8(iter_base + 0, 15) + mbt_ffi_store32((return_area) + 52, (((response).graph).defs).length()) + mbt_ffi_store32((return_area) + 48, address808) + mbt_ffi_store32((return_area) + 56, ((response).graph).root) - let address207 = mbt_ffi_malloc(payload184.length() * 72) - for index208 = 0 - index208 < payload184.length() - index208 = index208 + 1 { - let iter_elem : @types.VariantCaseType = payload184[index208] - let iter_base = address207 + index208 * 72 + let address882 = mbt_ffi_malloc((((response).value).value_nodes).length() * 32); + for index883 = 0; index883 < (((response).value).value_nodes).length(); index883 = index883 + 1 { + let iter_elem : @types.SchemaValueNode = (((response).value).value_nodes)[(index883)] + let iter_base = address882 + (index883 * 32); - let ptr185 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr185) + match iter_elem { + BoolValue(payload810) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload810 { 1 } else { 0 })) - match iter_elem.payload { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + S8Value(payload811) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload811)) - () - } - Some(payload187) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload187) + () + } + S16Value(payload812) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload812)) - () - } - } + () + } + S32Value(payload813) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload813) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + S64Value(payload814) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload814) - () - } - Some(payload189) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + U8Value(payload815) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload815).to_int()) - let ptr190 = mbt_ffi_str2ptr(payload189) - mbt_ffi_store32(iter_base + 24, payload189.length()) - mbt_ffi_store32(iter_base + 20, ptr190) - cleanup_list.push(ptr190) + () + } + U16Value(payload816) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload816).reinterpret_as_int()) - () - } - } - - let address192 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index193 = 0 - index193 < iter_elem.metadata.aliases.length() - index193 = index193 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index193] - let iter_base = address192 + index193 * 8 - - let ptr191 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr191) - cleanup_list.push(ptr191) - } - mbt_ffi_store32(iter_base + 32, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 28, address192) - - let address195 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index196 = 0 - index196 < iter_elem.metadata.examples.length() - index196 = index196 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index196] - let iter_base = address195 + index196 * 8 - - let ptr194 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr194) - cleanup_list.push(ptr194) - } - mbt_ffi_store32(iter_base + 40, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 36, address195) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 44, 0) - - () - } - Some(payload198) => { - mbt_ffi_store8(iter_base + 44, 1) + () + } + U32Value(payload817) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload817).reinterpret_as_int()) - let ptr199 = mbt_ffi_str2ptr(payload198) - mbt_ffi_store32(iter_base + 52, payload198.length()) - mbt_ffi_store32(iter_base + 48, ptr199) - cleanup_list.push(ptr199) + () + } + U64Value(payload818) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload818).reinterpret_as_int64()) - () - } - } + () + } + F32Value(payload819) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload819) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 56, 0) + () + } + F64Value(payload820) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload820) - () - } - Some(payload201) => { - mbt_ffi_store8(iter_base + 56, 1) + () + } + CharValue(payload821) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload821).to_int()) - match payload201 { - Multimodal => { - mbt_ffi_store8(iter_base + 60, 0) + () + } + StringValue(payload822) => { + mbt_ffi_store8((iter_base) + 0, (12)) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 60, 1) + let ptr823 = mbt_ffi_str2ptr(payload822) + mbt_ffi_store32((iter_base) + 12, payload822.length()) + mbt_ffi_store32((iter_base) + 8, ptr823) + cleanup_list.push(ptr823) - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 60, 2) + () + } + RecordValue(payload824) => { + mbt_ffi_store8((iter_base) + 0, (13)) - () - } - Other(payload205) => { - mbt_ffi_store8(iter_base + 60, 3) + let address825 = mbt_ffi_malloc((payload824).length() * 4); + for index826 = 0; index826 < (payload824).length(); index826 = index826 + 1 { + let iter_elem : Int = (payload824)[(index826)] + let iter_base = address825 + (index826 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - let ptr206 = mbt_ffi_str2ptr(payload205) - mbt_ffi_store32(iter_base + 68, payload205.length()) - mbt_ffi_store32(iter_base + 64, ptr206) - cleanup_list.push(ptr206) + } + mbt_ffi_store32((iter_base) + 12, (payload824).length()) + mbt_ffi_store32((iter_base) + 8, address825) + cleanup_list.push(address825) - () - } - } + () + } + VariantValue(payload827) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload827).case).reinterpret_as_int()) - () - } - } - cleanup_list.push(ptr185) - cleanup_list.push(address192) - cleanup_list.push(address195) - } - mbt_ffi_store32(iter_base + 12, payload184.length()) - mbt_ffi_store32(iter_base + 8, address207) - cleanup_list.push(address207) - - () - } - EnumType(payload209) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address211 = mbt_ffi_malloc(payload209.length() * 8) - for index212 = 0 - index212 < payload209.length() - index212 = index212 + 1 { - let iter_elem : String = payload209[index212] - let iter_base = address211 + index212 * 8 - - let ptr210 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr210) - cleanup_list.push(ptr210) - } - mbt_ffi_store32(iter_base + 12, payload209.length()) - mbt_ffi_store32(iter_base + 8, address211) - cleanup_list.push(address211) - - () - } - FlagsType(payload213) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address215 = mbt_ffi_malloc(payload213.length() * 8) - for index216 = 0 - index216 < payload213.length() - index216 = index216 + 1 { - let iter_elem : String = payload213[index216] - let iter_base = address215 + index216 * 8 - - let ptr214 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr214) - cleanup_list.push(ptr214) - } - mbt_ffi_store32(iter_base + 12, payload213.length()) - mbt_ffi_store32(iter_base + 8, address215) - cleanup_list.push(address215) - - () - } - TupleType(payload217) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address218 = mbt_ffi_malloc(payload217.length() * 4) - for index219 = 0 - index219 < payload217.length() - index219 = index219 + 1 { - let iter_elem : Int = payload217[index219] - let iter_base = address218 + index219 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload217.length()) - mbt_ffi_store32(iter_base + 8, address218) - cleanup_list.push(address218) - - () - } - ListType(payload220) => { - mbt_ffi_store8(iter_base + 0, 19) - mbt_ffi_store32(iter_base + 8, payload220) + match ((payload827).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - FixedListType(payload221) => { - mbt_ffi_store8(iter_base + 0, 20) - mbt_ffi_store32(iter_base + 8, payload221.element) - mbt_ffi_store32(iter_base + 12, payload221.length.reinterpret_as_int()) + () + } + Some(payload829) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload829) - () - } - MapType(payload222) => { - mbt_ffi_store8(iter_base + 0, 21) - mbt_ffi_store32(iter_base + 8, payload222.key) - mbt_ffi_store32(iter_base + 12, payload222.value) + () + } + } - () - } - OptionType(payload223) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store32(iter_base + 8, payload223) + () + } + EnumValue(payload830) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload830).reinterpret_as_int()) - () - } - ResultType(payload224) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload224.ok { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload226) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload226) - - () - } - } - - match payload224.err { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload228) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload228) - - () - } - } - - () - } - TextType(payload229) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload229.languages { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload231) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address233 = mbt_ffi_malloc(payload231.length() * 8) - for index234 = 0 - index234 < payload231.length() - index234 = index234 + 1 { - let iter_elem : String = payload231[index234] - let iter_base = address233 + index234 * 8 - - let ptr232 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr232) - cleanup_list.push(ptr232) - } - mbt_ffi_store32(iter_base + 16, payload231.length()) - mbt_ffi_store32(iter_base + 12, address233) - cleanup_list.push(address233) - - () - } - } - - match payload229.min_length { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload236) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload236.reinterpret_as_int()) - - () - } - } - - match payload229.max_length { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload238) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload238.reinterpret_as_int()) - - () - } - } - - match payload229.regex { - None => { - mbt_ffi_store8(iter_base + 36, 0) - - () - } - Some(payload240) => { - mbt_ffi_store8(iter_base + 36, 1) - - let ptr241 = mbt_ffi_str2ptr(payload240) - mbt_ffi_store32(iter_base + 44, payload240.length()) - mbt_ffi_store32(iter_base + 40, ptr241) - cleanup_list.push(ptr241) - - () - } - } - - () - } - BinaryType(payload242) => { - mbt_ffi_store8(iter_base + 0, 25) - - match payload242.mime_types { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload244) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address246 = mbt_ffi_malloc(payload244.length() * 8) - for index247 = 0 - index247 < payload244.length() - index247 = index247 + 1 { - let iter_elem : String = payload244[index247] - let iter_base = address246 + index247 * 8 - - let ptr245 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr245) - cleanup_list.push(ptr245) - } - mbt_ffi_store32(iter_base + 16, payload244.length()) - mbt_ffi_store32(iter_base + 12, address246) - cleanup_list.push(address246) - - () - } - } - - match payload242.min_bytes { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload249) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload249.reinterpret_as_int()) - - () - } - } - - match payload242.max_bytes { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload251) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload251.reinterpret_as_int()) - - () - } - } - - () - } - PathType(payload252) => { - mbt_ffi_store8(iter_base + 0, 26) - mbt_ffi_store8(iter_base + 8, payload252.direction.ordinal()) - mbt_ffi_store8(iter_base + 9, payload252.kind.ordinal()) - - match payload252.allowed_mime_types { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload254) => { - mbt_ffi_store8(iter_base + 12, 1) - - let address256 = mbt_ffi_malloc(payload254.length() * 8) - for index257 = 0 - index257 < payload254.length() - index257 = index257 + 1 { - let iter_elem : String = payload254[index257] - let iter_base = address256 + index257 * 8 - - let ptr255 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr255) - cleanup_list.push(ptr255) - } - mbt_ffi_store32(iter_base + 20, payload254.length()) - mbt_ffi_store32(iter_base + 16, address256) - cleanup_list.push(address256) - - () - } - } - - match payload252.allowed_extensions { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload259) => { - mbt_ffi_store8(iter_base + 24, 1) - - let address261 = mbt_ffi_malloc(payload259.length() * 8) - for index262 = 0 - index262 < payload259.length() - index262 = index262 + 1 { - let iter_elem : String = payload259[index262] - let iter_base = address261 + index262 * 8 - - let ptr260 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr260) - cleanup_list.push(ptr260) - } - mbt_ffi_store32(iter_base + 32, payload259.length()) - mbt_ffi_store32(iter_base + 28, address261) - cleanup_list.push(address261) + () + } + FlagsValue(payload831) => { + mbt_ffi_store8((iter_base) + 0, (16)) - () - } - } + let address832 = mbt_ffi_malloc((payload831).length() * 1); + for index833 = 0; index833 < (payload831).length(); index833 = index833 + 1 { + let iter_elem : Bool = (payload831)[(index833)] + let iter_base = address832 + (index833 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) - () - } - UrlType(payload263) => { - mbt_ffi_store8(iter_base + 0, 27) - - match payload263.allowed_schemes { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload265) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address267 = mbt_ffi_malloc(payload265.length() * 8) - for index268 = 0 - index268 < payload265.length() - index268 = index268 + 1 { - let iter_elem : String = payload265[index268] - let iter_base = address267 + index268 * 8 - - let ptr266 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr266) - cleanup_list.push(ptr266) - } - mbt_ffi_store32(iter_base + 16, payload265.length()) - mbt_ffi_store32(iter_base + 12, address267) - cleanup_list.push(address267) - - () - } - } - - match payload263.allowed_hosts { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload270) => { - mbt_ffi_store8(iter_base + 20, 1) - - let address272 = mbt_ffi_malloc(payload270.length() * 8) - for index273 = 0 - index273 < payload270.length() - index273 = index273 + 1 { - let iter_elem : String = payload270[index273] - let iter_base = address272 + index273 * 8 - - let ptr271 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr271) - cleanup_list.push(ptr271) - } - mbt_ffi_store32(iter_base + 28, payload270.length()) - mbt_ffi_store32(iter_base + 24, address272) - cleanup_list.push(address272) + } + mbt_ffi_store32((iter_base) + 12, (payload831).length()) + mbt_ffi_store32((iter_base) + 8, address832) + cleanup_list.push(address832) - () - } - } + () + } + TupleValue(payload834) => { + mbt_ffi_store8((iter_base) + 0, (17)) - () - } - DatetimeType => { - mbt_ffi_store8(iter_base + 0, 28) + let address835 = mbt_ffi_malloc((payload834).length() * 4); + for index836 = 0; index836 < (payload834).length(); index836 = index836 + 1 { + let iter_elem : Int = (payload834)[(index836)] + let iter_base = address835 + (index836 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () - } - DurationType => { - mbt_ffi_store8(iter_base + 0, 29) + } + mbt_ffi_store32((iter_base) + 12, (payload834).length()) + mbt_ffi_store32((iter_base) + 8, address835) + cleanup_list.push(address835) - () - } - QuantityType(payload276) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr277 = mbt_ffi_str2ptr(payload276.base_unit) - mbt_ffi_store32(iter_base + 12, payload276.base_unit.length()) - mbt_ffi_store32(iter_base + 8, ptr277) - - let address279 = mbt_ffi_malloc( - payload276.allowed_suffixes.length() * 8, - ) - for index280 = 0 - index280 < payload276.allowed_suffixes.length() - index280 = index280 + 1 { - let iter_elem : String = payload276.allowed_suffixes[index280] - let iter_base = address279 + index280 * 8 - - let ptr278 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr278) - cleanup_list.push(ptr278) - } - mbt_ffi_store32(iter_base + 20, payload276.allowed_suffixes.length()) - mbt_ffi_store32(iter_base + 16, address279) - - match payload276.min { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload282) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload282.mantissa) - mbt_ffi_store32(iter_base + 40, payload282.scale) - - let ptr283 = mbt_ffi_str2ptr(payload282.unit) - mbt_ffi_store32(iter_base + 48, payload282.unit.length()) - mbt_ffi_store32(iter_base + 44, ptr283) - cleanup_list.push(ptr283) - - () - } - } - - match payload276.max { - None => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - Some(payload285) => { - mbt_ffi_store8(iter_base + 56, 1) - mbt_ffi_store64(iter_base + 64, payload285.mantissa) - mbt_ffi_store32(iter_base + 72, payload285.scale) - - let ptr286 = mbt_ffi_str2ptr(payload285.unit) - mbt_ffi_store32(iter_base + 80, payload285.unit.length()) - mbt_ffi_store32(iter_base + 76, ptr286) - cleanup_list.push(ptr286) - - () - } - } - cleanup_list.push(ptr277) - cleanup_list.push(address279) - - () - } - UnionType(payload287) => { - mbt_ffi_store8(iter_base + 0, 31) - - let address323 = mbt_ffi_malloc(payload287.branches.length() * 92) - for index324 = 0 - index324 < payload287.branches.length() - index324 = index324 + 1 { - let iter_elem : @types.UnionBranch = payload287.branches[index324] - let iter_base = address323 + index324 * 92 - - let ptr288 = mbt_ffi_str2ptr(iter_elem.tag) - mbt_ffi_store32(iter_base + 4, iter_elem.tag.length()) - mbt_ffi_store32(iter_base + 0, ptr288) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.discriminator { - Prefix(payload289) => { - mbt_ffi_store8(iter_base + 12, 0) - - let ptr290 = mbt_ffi_str2ptr(payload289) - mbt_ffi_store32(iter_base + 20, payload289.length()) - mbt_ffi_store32(iter_base + 16, ptr290) - cleanup_list.push(ptr290) - - () - } - Suffix(payload291) => { - mbt_ffi_store8(iter_base + 12, 1) + () + } + ListValue(payload837) => { + mbt_ffi_store8((iter_base) + 0, (18)) - let ptr292 = mbt_ffi_str2ptr(payload291) - mbt_ffi_store32(iter_base + 20, payload291.length()) - mbt_ffi_store32(iter_base + 16, ptr292) - cleanup_list.push(ptr292) + let address838 = mbt_ffi_malloc((payload837).length() * 4); + for index839 = 0; index839 < (payload837).length(); index839 = index839 + 1 { + let iter_elem : Int = (payload837)[(index839)] + let iter_base = address838 + (index839 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () - } - Contains(payload293) => { - mbt_ffi_store8(iter_base + 12, 2) + } + mbt_ffi_store32((iter_base) + 12, (payload837).length()) + mbt_ffi_store32((iter_base) + 8, address838) + cleanup_list.push(address838) - let ptr294 = mbt_ffi_str2ptr(payload293) - mbt_ffi_store32(iter_base + 20, payload293.length()) - mbt_ffi_store32(iter_base + 16, ptr294) - cleanup_list.push(ptr294) + () + } + FixedListValue(payload840) => { + mbt_ffi_store8((iter_base) + 0, (19)) - () - } - Regex(payload295) => { - mbt_ffi_store8(iter_base + 12, 3) + let address841 = mbt_ffi_malloc((payload840).length() * 4); + for index842 = 0; index842 < (payload840).length(); index842 = index842 + 1 { + let iter_elem : Int = (payload840)[(index842)] + let iter_base = address841 + (index842 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - let ptr296 = mbt_ffi_str2ptr(payload295) - mbt_ffi_store32(iter_base + 20, payload295.length()) - mbt_ffi_store32(iter_base + 16, ptr296) - cleanup_list.push(ptr296) + } + mbt_ffi_store32((iter_base) + 12, (payload840).length()) + mbt_ffi_store32((iter_base) + 8, address841) + cleanup_list.push(address841) - () - } - FieldEquals(payload297) => { - mbt_ffi_store8(iter_base + 12, 4) + () + } + MapValue(payload843) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let address844 = mbt_ffi_malloc((payload843).length() * 8); + for index845 = 0; index845 < (payload843).length(); index845 = index845 + 1 { + let iter_elem : @types.MapEntry = (payload843)[(index845)] + let iter_base = address844 + (index845 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload843).length()) + mbt_ffi_store32((iter_base) + 8, address844) + cleanup_list.push(address844) + + () + } + OptionValue(payload846) => { + mbt_ffi_store8((iter_base) + 0, (21)) - let ptr298 = mbt_ffi_str2ptr(payload297.field_name) - mbt_ffi_store32(iter_base + 20, payload297.field_name.length()) - mbt_ffi_store32(iter_base + 16, ptr298) + match (payload846) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload297.literal { - None => { - mbt_ffi_store8(iter_base + 24, 0) + () + } + Some(payload848) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload848) - () - } - Some(payload300) => { - mbt_ffi_store8(iter_base + 24, 1) + () + } + } - let ptr301 = mbt_ffi_str2ptr(payload300) - mbt_ffi_store32(iter_base + 32, payload300.length()) - mbt_ffi_store32(iter_base + 28, ptr301) - cleanup_list.push(ptr301) + () + } + ResultValue(payload849) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload849 { + OkValue(payload850) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload850) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload852) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload852) + + () + } + } + + () + } + ErrValue(payload853) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload853) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload855) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload855) + + () + } + } + + () + } + } + + () + } + TextValue(payload856) => { + mbt_ffi_store8((iter_base) + 0, (23)) - () - } - } - cleanup_list.push(ptr298) + let ptr857 = mbt_ffi_str2ptr((payload856).text) + mbt_ffi_store32((iter_base) + 12, (payload856).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr857) - () - } - FieldAbsent(payload302) => { - mbt_ffi_store8(iter_base + 12, 5) + match ((payload856).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - let ptr303 = mbt_ffi_str2ptr(payload302) - mbt_ffi_store32(iter_base + 20, payload302.length()) - mbt_ffi_store32(iter_base + 16, ptr303) - cleanup_list.push(ptr303) + () + } + Some(payload859) => { + mbt_ffi_store8((iter_base) + 16, (1)) - () - } - } + let ptr860 = mbt_ffi_str2ptr(payload859) + mbt_ffi_store32((iter_base) + 24, payload859.length()) + mbt_ffi_store32((iter_base) + 20, ptr860) + cleanup_list.push(ptr860) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 36, 0) + () + } + } + cleanup_list.push(ptr857) - () - } - Some(payload305) => { - mbt_ffi_store8(iter_base + 36, 1) + () + } + BinaryValue(payload861) => { + mbt_ffi_store8((iter_base) + 0, (24)) - let ptr306 = mbt_ffi_str2ptr(payload305) - mbt_ffi_store32(iter_base + 44, payload305.length()) - mbt_ffi_store32(iter_base + 40, ptr306) - cleanup_list.push(ptr306) + let ptr862 = mbt_ffi_bytes2ptr((payload861).bytes) - () - } - } - - let address308 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index309 = 0 - index309 < iter_elem.metadata.aliases.length() - index309 = index309 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index309] - let iter_base = address308 + index309 * 8 - - let ptr307 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr307) - cleanup_list.push(ptr307) - } - mbt_ffi_store32(iter_base + 52, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 48, address308) - - let address311 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index312 = 0 - index312 < iter_elem.metadata.examples.length() - index312 = index312 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index312] - let iter_base = address311 + index312 * 8 - - let ptr310 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr310) - cleanup_list.push(ptr310) - } - mbt_ffi_store32(iter_base + 60, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 56, address311) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload314) => { - mbt_ffi_store8(iter_base + 64, 1) + mbt_ffi_store32((iter_base) + 12, (payload861).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr862) - let ptr315 = mbt_ffi_str2ptr(payload314) - mbt_ffi_store32(iter_base + 72, payload314.length()) - mbt_ffi_store32(iter_base + 68, ptr315) - cleanup_list.push(ptr315) + match ((payload861).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - () - } - } + () + } + Some(payload864) => { + mbt_ffi_store8((iter_base) + 16, (1)) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 76, 0) + let ptr865 = mbt_ffi_str2ptr(payload864) + mbt_ffi_store32((iter_base) + 24, payload864.length()) + mbt_ffi_store32((iter_base) + 20, ptr865) + cleanup_list.push(ptr865) - () - } - Some(payload317) => { - mbt_ffi_store8(iter_base + 76, 1) + () + } + } + cleanup_list.push(ptr862) - match payload317 { - Multimodal => { - mbt_ffi_store8(iter_base + 80, 0) + () + } + PathValue(payload866) => { + mbt_ffi_store8((iter_base) + 0, (25)) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 80, 1) + let ptr867 = mbt_ffi_str2ptr(payload866) + mbt_ffi_store32((iter_base) + 12, payload866.length()) + mbt_ffi_store32((iter_base) + 8, ptr867) + cleanup_list.push(ptr867) - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 80, 2) + () + } + UrlValue(payload868) => { + mbt_ffi_store8((iter_base) + 0, (26)) - () - } - Other(payload321) => { - mbt_ffi_store8(iter_base + 80, 3) + let ptr869 = mbt_ffi_str2ptr(payload868) + mbt_ffi_store32((iter_base) + 12, payload868.length()) + mbt_ffi_store32((iter_base) + 8, ptr869) + cleanup_list.push(ptr869) - let ptr322 = mbt_ffi_str2ptr(payload321) - mbt_ffi_store32(iter_base + 88, payload321.length()) - mbt_ffi_store32(iter_base + 84, ptr322) - cleanup_list.push(ptr322) + () + } + DatetimeValue(payload870) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload870).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload870).nanoseconds).reinterpret_as_int()) - () - } - } + () + } + DurationValue(payload871) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload871).nanoseconds) - () - } - } - cleanup_list.push(ptr288) - cleanup_list.push(address308) - cleanup_list.push(address311) - } - mbt_ffi_store32(iter_base + 12, payload287.branches.length()) - mbt_ffi_store32(iter_base + 8, address323) - cleanup_list.push(address323) - - () - } - SecretType(payload325) => { - mbt_ffi_store8(iter_base + 0, 32) - mbt_ffi_store32(iter_base + 8, payload325.inner) + () + } + QuantityValueNode(payload872) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload872).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload872).scale) - match payload325.category { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let ptr873 = mbt_ffi_str2ptr((payload872).unit) + mbt_ffi_store32((iter_base) + 24, (payload872).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr873) + cleanup_list.push(ptr873) - () - } - Some(payload327) => { - mbt_ffi_store8(iter_base + 12, 1) + () + } + UnionValue(payload874) => { + mbt_ffi_store8((iter_base) + 0, (30)) - let ptr328 = mbt_ffi_str2ptr(payload327) - mbt_ffi_store32(iter_base + 20, payload327.length()) - mbt_ffi_store32(iter_base + 16, ptr328) - cleanup_list.push(ptr328) + let ptr875 = mbt_ffi_str2ptr((payload874).tag) + mbt_ffi_store32((iter_base) + 12, (payload874).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr875) + mbt_ffi_store32((iter_base) + 16, (payload874).body) + cleanup_list.push(ptr875) - () - } - } + () + } + SecretValue(payload876) => { + mbt_ffi_store8((iter_base) + 0, (31)) - () - } - QuotaTokenType(payload329) => { - mbt_ffi_store8(iter_base + 0, 33) + let @types.Secret(handle877) = payload876 + mbt_ffi_store32((iter_base) + 8, handle877) - match payload329.resource_name { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + QuotaTokenHandle(payload878) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let @types.QuotaToken(handle879) = payload878 + mbt_ffi_store32((iter_base) + 8, handle879) - () - } - Some(payload331) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + PermissionCardHandle(payload880) => { + mbt_ffi_store8((iter_base) + 0, (33)) - let ptr332 = mbt_ffi_str2ptr(payload331) - mbt_ffi_store32(iter_base + 16, payload331.length()) - mbt_ffi_store32(iter_base + 12, ptr332) - cleanup_list.push(ptr332) + let @types.PermissionCard(handle881) = payload880 + mbt_ffi_store32((iter_base) + 8, handle881) - () - } - } + () + } + } - () } - FutureType(payload333) => { - mbt_ffi_store8(iter_base + 0, 34) + mbt_ffi_store32((return_area) + 64, (((response).value).value_nodes).length()) + mbt_ffi_store32((return_area) + 60, address882) + mbt_ffi_store32((return_area) + 68, ((response).value).root) - match payload333 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match function_type { + ReadLocal => { + mbt_ffi_store8((return_area) + 72, (0)) - () - } - Some(payload335) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload335) + () + } + WriteLocal => { + mbt_ffi_store8((return_area) + 72, (1)) - () - } - } + () + } + ReadRemote => { + mbt_ffi_store8((return_area) + 72, (2)) - () - } - StreamType(payload336) => { - mbt_ffi_store8(iter_base + 0, 35) + () + } + WriteRemote => { + mbt_ffi_store8((return_area) + 72, (3)) - match payload336 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + WriteRemoteBatched(payload888) => { + mbt_ffi_store8((return_area) + 72, (4)) - () - } - Some(payload338) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload338) + match (payload888) { + None => { + mbt_ffi_store8((return_area) + 80, (0)) - () - } - } + () + } + Some(payload890) => { + mbt_ffi_store8((return_area) + 80, (1)) + mbt_ffi_store64((return_area) + 88, (payload890).reinterpret_as_int64()) - () - } - } + () + } + } - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 88, 0) + () + } + WriteRemoteTransaction(payload891) => { + mbt_ffi_store8((return_area) + 72, (5)) - () - } - Some(payload340) => { - mbt_ffi_store8(iter_base + 88, 1) + match (payload891) { + None => { + mbt_ffi_store8((return_area) + 80, (0)) - let ptr341 = mbt_ffi_str2ptr(payload340) - mbt_ffi_store32(iter_base + 96, payload340.length()) - mbt_ffi_store32(iter_base + 92, ptr341) - cleanup_list.push(ptr341) + () + } + Some(payload893) => { + mbt_ffi_store8((return_area) + 80, (1)) + mbt_ffi_store64((return_area) + 88, (payload893).reinterpret_as_int64()) - () - } - } - - let address343 = mbt_ffi_malloc(iter_elem.metadata.aliases.length() * 8) - for index344 = 0 - index344 < iter_elem.metadata.aliases.length() - index344 = index344 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index344] - let iter_base = address343 + index344 * 8 - - let ptr342 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr342) - cleanup_list.push(ptr342) - } - mbt_ffi_store32(iter_base + 104, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 100, address343) - - let address346 = mbt_ffi_malloc(iter_elem.metadata.examples.length() * 8) - for index347 = 0 - index347 < iter_elem.metadata.examples.length() - index347 = index347 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index347] - let iter_base = address346 + index347 * 8 - - let ptr345 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr345) - cleanup_list.push(ptr345) - } - mbt_ffi_store32(iter_base + 112, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 108, address346) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 116, 0) - - () + () + } + } + + () + } } - Some(payload349) => { - mbt_ffi_store8(iter_base + 116, 1) + wasmImportPersistDurableFunctionInvocation(return_area); + mbt_ffi_free(return_area) + mbt_ffi_free(ptr) + mbt_ffi_free(address359) + mbt_ffi_free(address365) + mbt_ffi_free(address438) + mbt_ffi_free(address802) + mbt_ffi_free(address808) + mbt_ffi_free(address882) - let ptr350 = mbt_ffi_str2ptr(payload349) - mbt_ffi_store32(iter_base + 124, payload349.length()) - mbt_ffi_store32(iter_base + 120, ptr350) - cleanup_list.push(ptr350) + cleanup_list.each(mbt_ffi_free) - () - } - } +} +///| +/// Reads the next persisted durable function invocation from the oplog during replay +pub fn read_persisted_durable_function_invocation() -> PersistedDurableFunctionInvocation { - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 128, 0) + let return_area = mbt_ffi_malloc(88) + wasmImportReadPersistedDurableFunctionInvocation(return_area); - () - } - Some(payload352) => { - mbt_ffi_store8(iter_base + 128, 1) - - match payload352 { - Multimodal => { - mbt_ffi_store8(iter_base + 132, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 132, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 132, 2) - - () - } - Other(payload356) => { - mbt_ffi_store8(iter_base + 132, 3) - - let ptr357 = mbt_ffi_str2ptr(payload356) - mbt_ffi_store32(iter_base + 140, payload356.length()) - mbt_ffi_store32(iter_base + 136, ptr357) - cleanup_list.push(ptr357) - - () - } - } - - () - } - } - cleanup_list.push(address343) - cleanup_list.push(address346) - } - mbt_ffi_store32(return_area + 12, request.graph.type_nodes.length()) - mbt_ffi_store32(return_area + 8, address358) - - let address364 = mbt_ffi_malloc(request.graph.defs.length() * 24) - for index365 = 0 - index365 < request.graph.defs.length() - index365 = index365 + 1 { - let iter_elem : @types.SchemaTypeDef = request.graph.defs[index365] - let iter_base = address364 + index365 * 24 - - let ptr360 = mbt_ffi_str2ptr(iter_elem.id) - mbt_ffi_store32(iter_base + 4, iter_elem.id.length()) - mbt_ffi_store32(iter_base + 0, ptr360) - - match iter_elem.name { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload362) => { - mbt_ffi_store8(iter_base + 8, 1) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 16), mbt_ffi_load32((return_area) + 20)) - let ptr363 = mbt_ffi_str2ptr(payload362) - mbt_ffi_store32(iter_base + 16, payload362.length()) - mbt_ffi_store32(iter_base + 12, ptr363) - cleanup_list.push(ptr363) + let array193 : Array[@types.SchemaTypeNode] = []; + for index194 = 0; index194 < (mbt_ffi_load32((return_area) + 28)); index194 = index194 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 24)) + (index194 * 144) - () - } - } - mbt_ffi_store32(iter_base + 20, iter_elem.body) - cleanup_list.push(ptr360) - } - mbt_ffi_store32(return_area + 20, request.graph.defs.length()) - mbt_ffi_store32(return_area + 16, address364) - mbt_ffi_store32(return_area + 24, request.graph.root) - - let address435 = mbt_ffi_malloc(request.value.value_nodes.length() * 32) - for index436 = 0 - index436 < request.value.value_nodes.length() - index436 = index436 + 1 { - let iter_elem : @types.SchemaValueNode = request.value.value_nodes[index436] - let iter_base = address435 + index436 * 32 - - match iter_elem { - BoolValue(payload366) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload366 { 1 } else { 0 }) - - () - } - S8Value(payload367) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload367)) + let lifted179 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - S16Value(payload368) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload368)) + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { - () - } - S32Value(payload369) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload369) + @types.SchemaTypeBody::BoolType + } + 2 => { - () - } - S64Value(payload370) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload370) + let lifted5 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - U8Value(payload371) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload371.to_int()) + let lifted0 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - U16Value(payload372) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload372.reinterpret_as_int()) + let lifted = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - () - } - U32Value(payload373) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload373.reinterpret_as_int()) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - () - } - U64Value(payload374) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload374.reinterpret_as_int64()) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - () - } - F32Value(payload375) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload375) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - F64Value(payload376) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload376) + Option::Some(lifted) + } + _ => panic() + } - () - } - CharValue(payload377) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload377.to_int()) + let lifted2 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - StringValue(payload378) => { - mbt_ffi_store8(iter_base + 0, 12) + let lifted1 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let ptr379 = mbt_ffi_str2ptr(payload378) - mbt_ffi_store32(iter_base + 12, payload378.length()) - mbt_ffi_store32(iter_base + 8, ptr379) - cleanup_list.push(ptr379) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - () - } - RecordValue(payload380) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address381 = mbt_ffi_malloc(payload380.length() * 4) - for index382 = 0 - index382 < payload380.length() - index382 = index382 + 1 { - let iter_elem : Int = payload380[index382] - let iter_base = address381 + index382 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload380.length()) - mbt_ffi_store32(iter_base + 8, address381) - cleanup_list.push(address381) - - () - } - VariantValue(payload383) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload383.case.reinterpret_as_int()) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - match payload383.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - Some(payload385) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload385) + Option::Some(lifted1) + } + _ => panic() + } - () - } - } + let lifted4 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - EnumValue(payload386) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload386.reinterpret_as_int()) + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - () - } - FlagsValue(payload387) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address388 = mbt_ffi_malloc(payload387.length() * 1) - for index389 = 0 - index389 < payload387.length() - index389 = index389 + 1 { - let iter_elem : Bool = payload387[index389] - let iter_base = address388 + index389 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload387.length()) - mbt_ffi_store32(iter_base + 8, address388) - cleanup_list.push(address388) - - () - } - TupleValue(payload390) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address391 = mbt_ffi_malloc(payload390.length() * 4) - for index392 = 0 - index392 < payload390.length() - index392 = index392 + 1 { - let iter_elem : Int = payload390[index392] - let iter_base = address391 + index392 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload390.length()) - mbt_ffi_store32(iter_base + 8, address391) - cleanup_list.push(address391) - - () - } - ListValue(payload393) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address394 = mbt_ffi_malloc(payload393.length() * 4) - for index395 = 0 - index395 < payload393.length() - index395 = index395 + 1 { - let iter_elem : Int = payload393[index395] - let iter_base = address394 + index395 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload393.length()) - mbt_ffi_store32(iter_base + 8, address394) - cleanup_list.push(address394) - - () - } - FixedListValue(payload396) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address397 = mbt_ffi_malloc(payload396.length() * 4) - for index398 = 0 - index398 < payload396.length() - index398 = index398 + 1 { - let iter_elem : Int = payload396[index398] - let iter_base = address397 + index398 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload396.length()) - mbt_ffi_store32(iter_base + 8, address397) - cleanup_list.push(address397) - - () - } - MapValue(payload399) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address400 = mbt_ffi_malloc(payload399.length() * 8) - for index401 = 0 - index401 < payload399.length() - index401 = index401 + 1 { - let iter_elem : @types.MapEntry = payload399[index401] - let iter_base = address400 + index401 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload399.length()) - mbt_ffi_store32(iter_base + 8, address400) - cleanup_list.push(address400) - - () - } - OptionValue(payload402) => { - mbt_ffi_store8(iter_base + 0, 21) + Option::Some(result3) + } + _ => panic() + } - match payload402 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + Option::Some(@types.NumericRestrictions::{min : lifted0, max : lifted2, unit : lifted4}) + } + _ => panic() + } - () - } - Some(payload404) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload404) + @types.SchemaTypeBody::S8Type(lifted5) + } + 3 => { - () - } - } + let lifted12 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - ResultValue(payload405) => { - mbt_ffi_store8(iter_base + 0, 22) + let lifted7 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - match payload405 { - OkValue(payload406) => { - mbt_ffi_store8(iter_base + 8, 0) + let lifted6 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - match payload406 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - () - } - Some(payload408) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload408) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - () - } - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - ErrValue(payload409) => { - mbt_ffi_store8(iter_base + 8, 1) + Option::Some(lifted6) + } + _ => panic() + } - match payload409 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let lifted9 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - Some(payload411) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload411) + let lifted8 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - () - } - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - () - } - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - () - } - TextValue(payload412) => { - mbt_ffi_store8(iter_base + 0, 23) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let ptr413 = mbt_ffi_str2ptr(payload412.text) - mbt_ffi_store32(iter_base + 12, payload412.text.length()) - mbt_ffi_store32(iter_base + 8, ptr413) + Option::Some(lifted8) + } + _ => panic() + } - match payload412.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted11 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - Some(payload415) => { - mbt_ffi_store8(iter_base + 16, 1) + let result10 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let ptr416 = mbt_ffi_str2ptr(payload415) - mbt_ffi_store32(iter_base + 24, payload415.length()) - mbt_ffi_store32(iter_base + 20, ptr416) - cleanup_list.push(ptr416) + Option::Some(result10) + } + _ => panic() + } - () - } - } - cleanup_list.push(ptr413) + Option::Some(@types.NumericRestrictions::{min : lifted7, max : lifted9, unit : lifted11}) + } + _ => panic() + } - () - } - BinaryValue(payload417) => { - mbt_ffi_store8(iter_base + 0, 24) + @types.SchemaTypeBody::S16Type(lifted12) + } + 4 => { - let ptr418 = mbt_ffi_bytes2ptr(payload417.bytes) + let lifted19 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - mbt_ffi_store32(iter_base + 12, payload417.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr418) + let lifted14 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - match payload417.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted13 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - () - } - Some(payload420) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let ptr421 = mbt_ffi_str2ptr(payload420) - mbt_ffi_store32(iter_base + 24, payload420.length()) - mbt_ffi_store32(iter_base + 20, ptr421) - cleanup_list.push(ptr421) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - () - } - } - cleanup_list.push(ptr418) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - PathValue(payload422) => { - mbt_ffi_store8(iter_base + 0, 25) + Option::Some(lifted13) + } + _ => panic() + } - let ptr423 = mbt_ffi_str2ptr(payload422) - mbt_ffi_store32(iter_base + 12, payload422.length()) - mbt_ffi_store32(iter_base + 8, ptr423) - cleanup_list.push(ptr423) + let lifted16 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - UrlValue(payload424) => { - mbt_ffi_store8(iter_base + 0, 26) + let lifted15 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let ptr425 = mbt_ffi_str2ptr(payload424) - mbt_ffi_store32(iter_base + 12, payload424.length()) - mbt_ffi_store32(iter_base + 8, ptr425) - cleanup_list.push(ptr425) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - () - } - DatetimeValue(payload426) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload426.seconds) - mbt_ffi_store32( - iter_base + 16, - payload426.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload427) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload427.nanoseconds) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - () - } - QuantityValueNode(payload428) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload428.mantissa) - mbt_ffi_store32(iter_base + 16, payload428.scale) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let ptr429 = mbt_ffi_str2ptr(payload428.unit) - mbt_ffi_store32(iter_base + 24, payload428.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr429) - cleanup_list.push(ptr429) + Option::Some(lifted15) + } + _ => panic() + } - () - } - UnionValue(payload430) => { - mbt_ffi_store8(iter_base + 0, 30) + let lifted18 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let ptr431 = mbt_ffi_str2ptr(payload430.tag) - mbt_ffi_store32(iter_base + 12, payload430.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr431) - mbt_ffi_store32(iter_base + 16, payload430.body) - cleanup_list.push(ptr431) + let result17 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - () - } - SecretValue(payload432) => { - mbt_ffi_store8(iter_base + 0, 31) + Option::Some(result17) + } + _ => panic() + } - let @types.Secret(handle) = payload432 - mbt_ffi_store32(iter_base + 8, handle) + Option::Some(@types.NumericRestrictions::{min : lifted14, max : lifted16, unit : lifted18}) + } + _ => panic() + } - () - } - QuotaTokenHandle(payload433) => { - mbt_ffi_store8(iter_base + 0, 32) + @types.SchemaTypeBody::S32Type(lifted19) + } + 5 => { - let @types.QuotaToken(handle434) = payload433 - mbt_ffi_store32(iter_base + 8, handle434) + let lifted26 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - } - } - mbt_ffi_store32(return_area + 32, request.value.value_nodes.length()) - mbt_ffi_store32(return_area + 28, address435) - mbt_ffi_store32(return_area + 36, request.value.root) - - let address798 = mbt_ffi_malloc(response.graph.type_nodes.length() * 144) - for index799 = 0 - index799 < response.graph.type_nodes.length() - index799 = index799 + 1 { - let iter_elem : @types.SchemaTypeNode = response.graph.type_nodes[index799] - let iter_base = address798 + index799 * 144 - - match iter_elem.body { - RefType(payload437) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store32(iter_base + 8, payload437) - - () - } - BoolType => { - mbt_ffi_store8(iter_base + 0, 1) + let lifted21 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - S8Type(payload439) => { - mbt_ffi_store8(iter_base + 0, 2) + let lifted20 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - match payload439 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - () - } - Some(payload441) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - match payload441.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - Some(payload443) => { - mbt_ffi_store8(iter_base + 16, 1) + Option::Some(lifted20) + } + _ => panic() + } - match payload443 { - Signed(payload444) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload444) + let lifted23 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - Unsigned(payload445) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload445.reinterpret_as_int64(), - ) + let lifted22 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - () - } - FloatBits(payload446) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload446.reinterpret_as_int64(), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - () - } - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - () - } - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - match payload441.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + Option::Some(lifted22) + } + _ => panic() + } - () - } - Some(payload448) => { - mbt_ffi_store8(iter_base + 40, 1) + let lifted25 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - match payload448 { - Signed(payload449) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload449) + let result24 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - () - } - Unsigned(payload450) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload450.reinterpret_as_int64(), - ) + Option::Some(result24) + } + _ => panic() + } - () - } - FloatBits(payload451) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload451.reinterpret_as_int64(), - ) + Option::Some(@types.NumericRestrictions::{min : lifted21, max : lifted23, unit : lifted25}) + } + _ => panic() + } - () + @types.SchemaTypeBody::S64Type(lifted26) } - } + 6 => { - () - } - } + let lifted33 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload441.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted28 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload453) => { - mbt_ffi_store8(iter_base + 64, 1) + let lifted27 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let ptr454 = mbt_ffi_str2ptr(payload453) - mbt_ffi_store32(iter_base + 72, payload453.length()) - mbt_ffi_store32(iter_base + 68, ptr454) - cleanup_list.push(ptr454) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - () - } - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - () - } - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - S16Type(payload455) => { - mbt_ffi_store8(iter_base + 0, 3) + Option::Some(lifted27) + } + _ => panic() + } - match payload455 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let lifted30 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - Some(payload457) => { - mbt_ffi_store8(iter_base + 8, 1) + let lifted29 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - match payload457.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - () - } - Some(payload459) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - match payload459 { - Signed(payload460) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload460) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - Unsigned(payload461) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload461.reinterpret_as_int64(), - ) + Option::Some(lifted29) + } + _ => panic() + } - () - } - FloatBits(payload462) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload462.reinterpret_as_int64(), - ) + let lifted32 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - } + let result31 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - () - } - } + Option::Some(result31) + } + _ => panic() + } - match payload457.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + Option::Some(@types.NumericRestrictions::{min : lifted28, max : lifted30, unit : lifted32}) + } + _ => panic() + } - () - } - Some(payload464) => { - mbt_ffi_store8(iter_base + 40, 1) + @types.SchemaTypeBody::U8Type(lifted33) + } + 7 => { - match payload464 { - Signed(payload465) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload465) + let lifted40 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - Unsigned(payload466) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload466.reinterpret_as_int64(), - ) + let lifted35 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - FloatBits(payload467) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload467.reinterpret_as_int64(), - ) + let lifted34 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - () - } - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - () - } - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - match payload457.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - Some(payload469) => { - mbt_ffi_store8(iter_base + 64, 1) + Option::Some(lifted34) + } + _ => panic() + } - let ptr470 = mbt_ffi_str2ptr(payload469) - mbt_ffi_store32(iter_base + 72, payload469.length()) - mbt_ffi_store32(iter_base + 68, ptr470) - cleanup_list.push(ptr470) + let lifted37 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - } + let lifted36 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - () - } - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - () - } - S32Type(payload471) => { - mbt_ffi_store8(iter_base + 0, 4) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - match payload471 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - Some(payload473) => { - mbt_ffi_store8(iter_base + 8, 1) + Option::Some(lifted36) + } + _ => panic() + } - match payload473.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted39 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - Some(payload475) => { - mbt_ffi_store8(iter_base + 16, 1) + let result38 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - match payload475 { - Signed(payload476) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload476) + Option::Some(result38) + } + _ => panic() + } - () - } - Unsigned(payload477) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload477.reinterpret_as_int64(), - ) + Option::Some(@types.NumericRestrictions::{min : lifted35, max : lifted37, unit : lifted39}) + } + _ => panic() + } - () + @types.SchemaTypeBody::U16Type(lifted40) } - FloatBits(payload478) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload478.reinterpret_as_int64(), - ) + 8 => { - () - } - } + let lifted47 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - } + let lifted42 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - match payload473.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let lifted41 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - () - } - Some(payload480) => { - mbt_ffi_store8(iter_base + 40, 1) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - match payload480 { - Signed(payload481) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload481) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - () - } - Unsigned(payload482) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload482.reinterpret_as_int64(), - ) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - FloatBits(payload483) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload483.reinterpret_as_int64(), - ) + Option::Some(lifted41) + } + _ => panic() + } - () - } - } + let lifted44 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - } + let lifted43 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - match payload473.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - () - } - Some(payload485) => { - mbt_ffi_store8(iter_base + 64, 1) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - let ptr486 = mbt_ffi_str2ptr(payload485) - mbt_ffi_store32(iter_base + 72, payload485.length()) - mbt_ffi_store32(iter_base + 68, ptr486) - cleanup_list.push(ptr486) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - } + Option::Some(lifted43) + } + _ => panic() + } - () - } - } + let lifted46 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - S64Type(payload487) => { - mbt_ffi_store8(iter_base + 0, 5) + let result45 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - match payload487 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + Option::Some(result45) + } + _ => panic() + } - () - } - Some(payload489) => { - mbt_ffi_store8(iter_base + 8, 1) + Option::Some(@types.NumericRestrictions::{min : lifted42, max : lifted44, unit : lifted46}) + } + _ => panic() + } - match payload489.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaTypeBody::U32Type(lifted47) + } + 9 => { - () - } - Some(payload491) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted54 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload491 { - Signed(payload492) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload492) + let lifted49 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - Unsigned(payload493) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload493.reinterpret_as_int64(), - ) + let lifted48 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - () - } - FloatBits(payload494) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload494.reinterpret_as_int64(), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - () - } - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - () - } - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - match payload489.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + Option::Some(lifted48) + } + _ => panic() + } - () - } - Some(payload496) => { - mbt_ffi_store8(iter_base + 40, 1) + let lifted51 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - match payload496 { - Signed(payload497) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload497) + let lifted50 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - () - } - Unsigned(payload498) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload498.reinterpret_as_int64(), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - () - } - FloatBits(payload499) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload499.reinterpret_as_int64(), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - () - } - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - } + Option::Some(lifted50) + } + _ => panic() + } - match payload489.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted53 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - Some(payload501) => { - mbt_ffi_store8(iter_base + 64, 1) + let result52 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let ptr502 = mbt_ffi_str2ptr(payload501) - mbt_ffi_store32(iter_base + 72, payload501.length()) - mbt_ffi_store32(iter_base + 68, ptr502) - cleanup_list.push(ptr502) + Option::Some(result52) + } + _ => panic() + } - () - } - } + Option::Some(@types.NumericRestrictions::{min : lifted49, max : lifted51, unit : lifted53}) + } + _ => panic() + } - () - } - } + @types.SchemaTypeBody::U64Type(lifted54) + } + 10 => { - () - } - U8Type(payload503) => { - mbt_ffi_store8(iter_base + 0, 6) + let lifted61 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload503 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let lifted56 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload505) => { - mbt_ffi_store8(iter_base + 8, 1) + let lifted55 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - match payload505.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - () - } - Some(payload507) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - match payload507 { - Signed(payload508) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload508) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - Unsigned(payload509) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload509.reinterpret_as_int64(), - ) + Option::Some(lifted55) + } + _ => panic() + } - () - } - FloatBits(payload510) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload510.reinterpret_as_int64(), - ) + let lifted58 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - } + let lifted57 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - () - } - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - match payload505.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - () - } - Some(payload512) => { - mbt_ffi_store8(iter_base + 40, 1) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - match payload512 { - Signed(payload513) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload513) + Option::Some(lifted57) + } + _ => panic() + } - () - } - Unsigned(payload514) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload514.reinterpret_as_int64(), - ) + let lifted60 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - FloatBits(payload515) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload515.reinterpret_as_int64(), - ) + let result59 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - () - } - } + Option::Some(result59) + } + _ => panic() + } - () - } - } + Option::Some(@types.NumericRestrictions::{min : lifted56, max : lifted58, unit : lifted60}) + } + _ => panic() + } - match payload505.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + @types.SchemaTypeBody::F32Type(lifted61) + } + 11 => { - () - } - Some(payload517) => { - mbt_ffi_store8(iter_base + 64, 1) + let lifted68 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let ptr518 = mbt_ffi_str2ptr(payload517) - mbt_ffi_store32(iter_base + 72, payload517.length()) - mbt_ffi_store32(iter_base + 68, ptr518) - cleanup_list.push(ptr518) + let lifted63 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - } + let lifted62 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - () - } - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - () - } - U16Type(payload519) => { - mbt_ffi_store8(iter_base + 0, 7) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - match payload519 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - Some(payload521) => { - mbt_ffi_store8(iter_base + 8, 1) + Option::Some(lifted62) + } + _ => panic() + } - match payload521.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted65 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - Some(payload523) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted64 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - match payload523 { - Signed(payload524) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload524) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - () - } - Unsigned(payload525) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload525.reinterpret_as_int64(), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - () - } - FloatBits(payload526) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload526.reinterpret_as_int64(), - ) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - } + Option::Some(lifted64) + } + _ => panic() + } - () - } - } + let lifted67 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - match payload521.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let result66 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - () - } - Some(payload528) => { - mbt_ffi_store8(iter_base + 40, 1) + Option::Some(result66) + } + _ => panic() + } - match payload528 { - Signed(payload529) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload529) + Option::Some(@types.NumericRestrictions::{min : lifted63, max : lifted65, unit : lifted67}) + } + _ => panic() + } - () + @types.SchemaTypeBody::F64Type(lifted68) } - Unsigned(payload530) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload530.reinterpret_as_int64(), - ) + 12 => { - () + @types.SchemaTypeBody::CharType } - FloatBits(payload531) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload531.reinterpret_as_int64(), - ) + 13 => { - () + @types.SchemaTypeBody::StringType } - } + 14 => { - () - } - } + let array81 : Array[@types.NamedFieldType] = []; + for index82 = 0; index82 < (mbt_ffi_load32((iter_base) + 12)); index82 = index82 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index82 * 68) - match payload521.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let result69 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload533) => { - mbt_ffi_store8(iter_base + 64, 1) + let lifted71 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let ptr534 = mbt_ffi_str2ptr(payload533) - mbt_ffi_store32(iter_base + 72, payload533.length()) - mbt_ffi_store32(iter_base + 68, ptr534) - cleanup_list.push(ptr534) + let result70 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - } + Option::Some(result70) + } + _ => panic() + } - () - } - } + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 28)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index * 8) - () - } - U32Type(payload535) => { - mbt_ffi_store8(iter_base + 0, 8) + let result72 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload535 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + array.push(result72) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - () - } - Some(payload537) => { - mbt_ffi_store8(iter_base + 8, 1) + let array74 : Array[String] = []; + for index75 = 0; index75 < (mbt_ffi_load32((iter_base) + 36)); index75 = index75 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index75 * 8) - match payload537.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let result73 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload539) => { - mbt_ffi_store8(iter_base + 16, 1) + array74.push(result73) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - match payload539 { - Signed(payload540) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload540) + let lifted77 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - Unsigned(payload541) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload541.reinterpret_as_int64(), - ) + let result76 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - () - } - FloatBits(payload542) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload542.reinterpret_as_int64(), - ) + Option::Some(result76) + } + _ => panic() + } - () - } - } + let lifted80 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { - () - } - } + let lifted79 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { - match payload537.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.Role::Multimodal + } + 1 => { - () - } - Some(payload544) => { - mbt_ffi_store8(iter_base + 40, 1) + @types.Role::UnstructuredText + } + 2 => { - match payload544 { - Signed(payload545) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload545) + @types.Role::UnstructuredBinary + } + 3 => { - () - } - Unsigned(payload546) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload546.reinterpret_as_int64(), - ) + let result78 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - () - } - FloatBits(payload547) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload547.reinterpret_as_int64(), - ) + @types.Role::Other(result78) + } + _ => panic() + } - () + Option::Some(lifted79) + } + _ => panic() + } + + array81.push(@types.NamedFieldType::{name : result69, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted71, aliases : array, examples : array74, deprecated : lifted77, role : lifted80}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array81) } - } + 15 => { - () - } - } + let array98 : Array[@types.VariantCaseType] = []; + for index99 = 0; index99 < (mbt_ffi_load32((iter_base) + 12)); index99 = index99 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index99 * 72) - match payload537.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let result83 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload549) => { - mbt_ffi_store8(iter_base + 64, 1) + let lifted84 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let ptr550 = mbt_ffi_str2ptr(payload549) - mbt_ffi_store32(iter_base + 72, payload549.length()) - mbt_ffi_store32(iter_base + 68, ptr550) - cleanup_list.push(ptr550) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - () - } - } + let lifted86 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - } + let result85 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - U64Type(payload551) => { - mbt_ffi_store8(iter_base + 0, 9) + Option::Some(result85) + } + _ => panic() + } - match payload551 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let array88 : Array[String] = []; + for index89 = 0; index89 < (mbt_ffi_load32((iter_base) + 32)); index89 = index89 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index89 * 8) - () - } - Some(payload553) => { - mbt_ffi_store8(iter_base + 8, 1) + let result87 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload553.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + array88.push(result87) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () - } - Some(payload555) => { - mbt_ffi_store8(iter_base + 16, 1) + let array91 : Array[String] = []; + for index92 = 0; index92 < (mbt_ffi_load32((iter_base) + 40)); index92 = index92 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index92 * 8) - match payload555 { - Signed(payload556) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload556) + let result90 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Unsigned(payload557) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload557.reinterpret_as_int64(), - ) + array91.push(result90) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - () - } - FloatBits(payload558) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload558.reinterpret_as_int64(), - ) + let lifted94 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { - () - } - } + let result93 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - () - } - } + Option::Some(result93) + } + _ => panic() + } - match payload553.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let lifted97 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - () - } - Some(payload560) => { - mbt_ffi_store8(iter_base + 40, 1) + let lifted96 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { - match payload560 { - Signed(payload561) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload561) + @types.Role::Multimodal + } + 1 => { - () - } - Unsigned(payload562) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload562.reinterpret_as_int64(), - ) + @types.Role::UnstructuredText + } + 2 => { - () - } - FloatBits(payload563) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload563.reinterpret_as_int64(), - ) + @types.Role::UnstructuredBinary + } + 3 => { - () - } - } + let result95 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) - () - } - } + @types.Role::Other(result95) + } + _ => panic() + } - match payload553.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + Option::Some(lifted96) + } + _ => panic() + } - () - } - Some(payload565) => { - mbt_ffi_store8(iter_base + 64, 1) + array98.push(@types.VariantCaseType::{name : result83, payload : lifted84, metadata : @types.MetadataEnvelope::{doc : lifted86, aliases : array88, examples : array91, deprecated : lifted94, role : lifted97}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let ptr566 = mbt_ffi_str2ptr(payload565) - mbt_ffi_store32(iter_base + 72, payload565.length()) - mbt_ffi_store32(iter_base + 68, ptr566) - cleanup_list.push(ptr566) + @types.SchemaTypeBody::VariantType(array98) + } + 16 => { - () - } - } + let array101 : Array[String] = []; + for index102 = 0; index102 < (mbt_ffi_load32((iter_base) + 12)); index102 = index102 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index102 * 8) - () - } - } + let result100 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - F32Type(payload567) => { - mbt_ffi_store8(iter_base + 0, 10) + array101.push(result100) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload567 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaTypeBody::EnumType(array101) + } + 17 => { + + let array104 : Array[String] = []; + for index105 = 0; index105 < (mbt_ffi_load32((iter_base) + 12)); index105 = index105 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index105 * 8) - () - } - Some(payload569) => { - mbt_ffi_store8(iter_base + 8, 1) + let result103 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload569.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + array104.push(result103) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array104) + } + 18 => { - () - } - Some(payload571) => { - mbt_ffi_store8(iter_base + 16, 1) + let array106 : Array[Int] = []; + for index107 = 0; index107 < (mbt_ffi_load32((iter_base) + 12)); index107 = index107 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index107 * 4) - match payload571 { - Signed(payload572) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload572) + array106.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () + @types.SchemaTypeBody::TupleType(array106) } - Unsigned(payload573) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload573.reinterpret_as_int64(), - ) + 19 => { - () + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) } - FloatBits(payload574) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload574.reinterpret_as_int64(), - ) + 20 => { - () + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) } - } + 21 => { - () - } - } + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { - match payload569.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { - () - } - Some(payload576) => { - mbt_ffi_store8(iter_base + 40, 1) + let lifted108 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload576 { - Signed(payload577) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload577) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - () - } - Unsigned(payload578) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload578.reinterpret_as_int64(), - ) + let lifted109 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - FloatBits(payload579) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload579.reinterpret_as_int64(), - ) + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } - () + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted108, err : lifted109}) } - } + 24 => { - () - } - } + let lifted113 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload569.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let array111 : Array[String] = []; + for index112 = 0; index112 < (mbt_ffi_load32((iter_base) + 16)); index112 = index112 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index112 * 8) - () - } - Some(payload581) => { - mbt_ffi_store8(iter_base + 64, 1) + let result110 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let ptr582 = mbt_ffi_str2ptr(payload581) - mbt_ffi_store32(iter_base + 72, payload581.length()) - mbt_ffi_store32(iter_base + 68, ptr582) - cleanup_list.push(ptr582) + array111.push(result110) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - } + Option::Some(array111) + } + _ => panic() + } - () - } - } + let lifted114 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - () - } - F64Type(payload583) => { - mbt_ffi_store8(iter_base + 0, 11) + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - match payload583 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let lifted115 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - () - } - Some(payload585) => { - mbt_ffi_store8(iter_base + 8, 1) + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - match payload585.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted117 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - () - } - Some(payload587) => { - mbt_ffi_store8(iter_base + 16, 1) + let result116 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - match payload587 { - Signed(payload588) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload588) + Option::Some(result116) + } + _ => panic() + } - () + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted113, min_length : lifted114, max_length : lifted115, regex : lifted117}) } - Unsigned(payload589) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload589.reinterpret_as_int64(), - ) + 25 => { - () - } - FloatBits(payload590) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload590.reinterpret_as_int64(), - ) + let lifted121 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - } + let array119 : Array[String] = []; + for index120 = 0; index120 < (mbt_ffi_load32((iter_base) + 16)); index120 = index120 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index120 * 8) - () - } - } + let result118 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload585.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + array119.push(result118) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - Some(payload592) => { - mbt_ffi_store8(iter_base + 40, 1) + Option::Some(array119) + } + _ => panic() + } - match payload592 { - Signed(payload593) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload593) + let lifted122 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - () - } - Unsigned(payload594) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload594.reinterpret_as_int64(), - ) + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - FloatBits(payload595) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload595.reinterpret_as_int64(), - ) + let lifted123 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted121, min_bytes : lifted122, max_bytes : lifted123}) } - } + 26 => { - () - } - } + let lifted127 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - match payload585.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let array125 : Array[String] = []; + for index126 = 0; index126 < (mbt_ffi_load32((iter_base) + 20)); index126 = index126 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index126 * 8) - () - } - Some(payload597) => { - mbt_ffi_store8(iter_base + 64, 1) + let result124 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let ptr598 = mbt_ffi_str2ptr(payload597) - mbt_ffi_store32(iter_base + 72, payload597.length()) - mbt_ffi_store32(iter_base + 68, ptr598) - cleanup_list.push(ptr598) + array125.push(result124) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - } + Option::Some(array125) + } + _ => panic() + } - () - } - } + let lifted131 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - () - } - CharType => { - mbt_ffi_store8(iter_base + 0, 12) - - () - } - StringType => { - mbt_ffi_store8(iter_base + 0, 13) - - () - } - RecordType(payload601) => { - mbt_ffi_store8(iter_base + 0, 14) - - let address622 = mbt_ffi_malloc(payload601.length() * 68) - for index623 = 0 - index623 < payload601.length() - index623 = index623 + 1 { - let iter_elem : @types.NamedFieldType = payload601[index623] - let iter_base = address622 + index623 * 68 - - let ptr602 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr602) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload604) => { - mbt_ffi_store8(iter_base + 12, 1) - - let ptr605 = mbt_ffi_str2ptr(payload604) - mbt_ffi_store32(iter_base + 20, payload604.length()) - mbt_ffi_store32(iter_base + 16, ptr605) - cleanup_list.push(ptr605) - - () - } - } - - let address607 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index608 = 0 - index608 < iter_elem.metadata.aliases.length() - index608 = index608 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index608] - let iter_base = address607 + index608 * 8 - - let ptr606 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr606) - cleanup_list.push(ptr606) - } - mbt_ffi_store32(iter_base + 28, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 24, address607) - - let address610 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index611 = 0 - index611 < iter_elem.metadata.examples.length() - index611 = index611 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index611] - let iter_base = address610 + index611 * 8 - - let ptr609 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr609) - cleanup_list.push(ptr609) - } - mbt_ffi_store32(iter_base + 36, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 32, address610) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload613) => { - mbt_ffi_store8(iter_base + 40, 1) - - let ptr614 = mbt_ffi_str2ptr(payload613) - mbt_ffi_store32(iter_base + 48, payload613.length()) - mbt_ffi_store32(iter_base + 44, ptr614) - cleanup_list.push(ptr614) - - () - } - } - - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 52, 0) - - () - } - Some(payload616) => { - mbt_ffi_store8(iter_base + 52, 1) - - match payload616 { - Multimodal => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 56, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 56, 2) + let array129 : Array[String] = []; + for index130 = 0; index130 < (mbt_ffi_load32((iter_base) + 32)); index130 = index130 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index130 * 8) - () - } - Other(payload620) => { - mbt_ffi_store8(iter_base + 56, 3) - - let ptr621 = mbt_ffi_str2ptr(payload620) - mbt_ffi_store32(iter_base + 64, payload620.length()) - mbt_ffi_store32(iter_base + 60, ptr621) - cleanup_list.push(ptr621) + let result128 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - } - - () - } - } - cleanup_list.push(ptr602) - cleanup_list.push(address607) - cleanup_list.push(address610) - } - mbt_ffi_store32(iter_base + 12, payload601.length()) - mbt_ffi_store32(iter_base + 8, address622) - cleanup_list.push(address622) - - () - } - VariantType(payload624) => { - mbt_ffi_store8(iter_base + 0, 15) - - let address647 = mbt_ffi_malloc(payload624.length() * 72) - for index648 = 0 - index648 < payload624.length() - index648 = index648 + 1 { - let iter_elem : @types.VariantCaseType = payload624[index648] - let iter_base = address647 + index648 * 72 - - let ptr625 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr625) - - match iter_elem.payload { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload627) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload627) - - () - } - } - - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload629) => { - mbt_ffi_store8(iter_base + 16, 1) - - let ptr630 = mbt_ffi_str2ptr(payload629) - mbt_ffi_store32(iter_base + 24, payload629.length()) - mbt_ffi_store32(iter_base + 20, ptr630) - cleanup_list.push(ptr630) - - () - } - } - - let address632 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index633 = 0 - index633 < iter_elem.metadata.aliases.length() - index633 = index633 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index633] - let iter_base = address632 + index633 * 8 - - let ptr631 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr631) - cleanup_list.push(ptr631) - } - mbt_ffi_store32(iter_base + 32, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 28, address632) - - let address635 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index636 = 0 - index636 < iter_elem.metadata.examples.length() - index636 = index636 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index636] - let iter_base = address635 + index636 * 8 - - let ptr634 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr634) - cleanup_list.push(ptr634) - } - mbt_ffi_store32(iter_base + 40, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 36, address635) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 44, 0) - - () - } - Some(payload638) => { - mbt_ffi_store8(iter_base + 44, 1) - - let ptr639 = mbt_ffi_str2ptr(payload638) - mbt_ffi_store32(iter_base + 52, payload638.length()) - mbt_ffi_store32(iter_base + 48, ptr639) - cleanup_list.push(ptr639) - - () - } - } - - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - Some(payload641) => { - mbt_ffi_store8(iter_base + 56, 1) + array129.push(result128) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - match payload641 { - Multimodal => { - mbt_ffi_store8(iter_base + 60, 0) + Option::Some(array129) + } + _ => panic() + } - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 60, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 60, 2) - - () - } - Other(payload645) => { - mbt_ffi_store8(iter_base + 60, 3) - - let ptr646 = mbt_ffi_str2ptr(payload645) - mbt_ffi_store32(iter_base + 68, payload645.length()) - mbt_ffi_store32(iter_base + 64, ptr646) - cleanup_list.push(ptr646) - - () - } - } - - () - } - } - cleanup_list.push(ptr625) - cleanup_list.push(address632) - cleanup_list.push(address635) - } - mbt_ffi_store32(iter_base + 12, payload624.length()) - mbt_ffi_store32(iter_base + 8, address647) - cleanup_list.push(address647) - - () - } - EnumType(payload649) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address651 = mbt_ffi_malloc(payload649.length() * 8) - for index652 = 0 - index652 < payload649.length() - index652 = index652 + 1 { - let iter_elem : String = payload649[index652] - let iter_base = address651 + index652 * 8 - - let ptr650 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr650) - cleanup_list.push(ptr650) - } - mbt_ffi_store32(iter_base + 12, payload649.length()) - mbt_ffi_store32(iter_base + 8, address651) - cleanup_list.push(address651) - - () - } - FlagsType(payload653) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address655 = mbt_ffi_malloc(payload653.length() * 8) - for index656 = 0 - index656 < payload653.length() - index656 = index656 + 1 { - let iter_elem : String = payload653[index656] - let iter_base = address655 + index656 * 8 - - let ptr654 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr654) - cleanup_list.push(ptr654) - } - mbt_ffi_store32(iter_base + 12, payload653.length()) - mbt_ffi_store32(iter_base + 8, address655) - cleanup_list.push(address655) - - () - } - TupleType(payload657) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address658 = mbt_ffi_malloc(payload657.length() * 4) - for index659 = 0 - index659 < payload657.length() - index659 = index659 + 1 { - let iter_elem : Int = payload657[index659] - let iter_base = address658 + index659 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload657.length()) - mbt_ffi_store32(iter_base + 8, address658) - cleanup_list.push(address658) - - () - } - ListType(payload660) => { - mbt_ffi_store8(iter_base + 0, 19) - mbt_ffi_store32(iter_base + 8, payload660) - - () - } - FixedListType(payload661) => { - mbt_ffi_store8(iter_base + 0, 20) - mbt_ffi_store32(iter_base + 8, payload661.element) - mbt_ffi_store32(iter_base + 12, payload661.length.reinterpret_as_int()) - - () - } - MapType(payload662) => { - mbt_ffi_store8(iter_base + 0, 21) - mbt_ffi_store32(iter_base + 8, payload662.key) - mbt_ffi_store32(iter_base + 12, payload662.value) - - () - } - OptionType(payload663) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store32(iter_base + 8, payload663) - - () - } - ResultType(payload664) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload664.ok { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload666) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload666) - - () - } - } - - match payload664.err { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload668) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload668) - - () - } - } - - () - } - TextType(payload669) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload669.languages { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload671) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address673 = mbt_ffi_malloc(payload671.length() * 8) - for index674 = 0 - index674 < payload671.length() - index674 = index674 + 1 { - let iter_elem : String = payload671[index674] - let iter_base = address673 + index674 * 8 - - let ptr672 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr672) - cleanup_list.push(ptr672) - } - mbt_ffi_store32(iter_base + 16, payload671.length()) - mbt_ffi_store32(iter_base + 12, address673) - cleanup_list.push(address673) - - () - } - } - - match payload669.min_length { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload676) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload676.reinterpret_as_int()) - - () - } - } - - match payload669.max_length { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload678) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload678.reinterpret_as_int()) - - () - } - } - - match payload669.regex { - None => { - mbt_ffi_store8(iter_base + 36, 0) - - () - } - Some(payload680) => { - mbt_ffi_store8(iter_base + 36, 1) - - let ptr681 = mbt_ffi_str2ptr(payload680) - mbt_ffi_store32(iter_base + 44, payload680.length()) - mbt_ffi_store32(iter_base + 40, ptr681) - cleanup_list.push(ptr681) - - () - } - } - - () - } - BinaryType(payload682) => { - mbt_ffi_store8(iter_base + 0, 25) - - match payload682.mime_types { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload684) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address686 = mbt_ffi_malloc(payload684.length() * 8) - for index687 = 0 - index687 < payload684.length() - index687 = index687 + 1 { - let iter_elem : String = payload684[index687] - let iter_base = address686 + index687 * 8 - - let ptr685 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr685) - cleanup_list.push(ptr685) - } - mbt_ffi_store32(iter_base + 16, payload684.length()) - mbt_ffi_store32(iter_base + 12, address686) - cleanup_list.push(address686) - - () - } - } - - match payload682.min_bytes { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload689) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload689.reinterpret_as_int()) - - () - } - } - - match payload682.max_bytes { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload691) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload691.reinterpret_as_int()) - - () - } - } - - () - } - PathType(payload692) => { - mbt_ffi_store8(iter_base + 0, 26) - mbt_ffi_store8(iter_base + 8, payload692.direction.ordinal()) - mbt_ffi_store8(iter_base + 9, payload692.kind.ordinal()) - - match payload692.allowed_mime_types { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload694) => { - mbt_ffi_store8(iter_base + 12, 1) - - let address696 = mbt_ffi_malloc(payload694.length() * 8) - for index697 = 0 - index697 < payload694.length() - index697 = index697 + 1 { - let iter_elem : String = payload694[index697] - let iter_base = address696 + index697 * 8 - - let ptr695 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr695) - cleanup_list.push(ptr695) - } - mbt_ffi_store32(iter_base + 20, payload694.length()) - mbt_ffi_store32(iter_base + 16, address696) - cleanup_list.push(address696) - - () - } - } - - match payload692.allowed_extensions { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload699) => { - mbt_ffi_store8(iter_base + 24, 1) - - let address701 = mbt_ffi_malloc(payload699.length() * 8) - for index702 = 0 - index702 < payload699.length() - index702 = index702 + 1 { - let iter_elem : String = payload699[index702] - let iter_base = address701 + index702 * 8 - - let ptr700 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr700) - cleanup_list.push(ptr700) - } - mbt_ffi_store32(iter_base + 32, payload699.length()) - mbt_ffi_store32(iter_base + 28, address701) - cleanup_list.push(address701) - - () - } - } - - () - } - UrlType(payload703) => { - mbt_ffi_store8(iter_base + 0, 27) - - match payload703.allowed_schemes { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload705) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address707 = mbt_ffi_malloc(payload705.length() * 8) - for index708 = 0 - index708 < payload705.length() - index708 = index708 + 1 { - let iter_elem : String = payload705[index708] - let iter_base = address707 + index708 * 8 - - let ptr706 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr706) - cleanup_list.push(ptr706) - } - mbt_ffi_store32(iter_base + 16, payload705.length()) - mbt_ffi_store32(iter_base + 12, address707) - cleanup_list.push(address707) - - () - } - } - - match payload703.allowed_hosts { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload710) => { - mbt_ffi_store8(iter_base + 20, 1) - - let address712 = mbt_ffi_malloc(payload710.length() * 8) - for index713 = 0 - index713 < payload710.length() - index713 = index713 + 1 { - let iter_elem : String = payload710[index713] - let iter_base = address712 + index713 * 8 - - let ptr711 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr711) - cleanup_list.push(ptr711) - } - mbt_ffi_store32(iter_base + 28, payload710.length()) - mbt_ffi_store32(iter_base + 24, address712) - cleanup_list.push(address712) - - () - } - } - - () - } - DatetimeType => { - mbt_ffi_store8(iter_base + 0, 28) - - () - } - DurationType => { - mbt_ffi_store8(iter_base + 0, 29) - - () - } - QuantityType(payload716) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr717 = mbt_ffi_str2ptr(payload716.base_unit) - mbt_ffi_store32(iter_base + 12, payload716.base_unit.length()) - mbt_ffi_store32(iter_base + 8, ptr717) - - let address719 = mbt_ffi_malloc( - payload716.allowed_suffixes.length() * 8, - ) - for index720 = 0 - index720 < payload716.allowed_suffixes.length() - index720 = index720 + 1 { - let iter_elem : String = payload716.allowed_suffixes[index720] - let iter_base = address719 + index720 * 8 - - let ptr718 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr718) - cleanup_list.push(ptr718) - } - mbt_ffi_store32(iter_base + 20, payload716.allowed_suffixes.length()) - mbt_ffi_store32(iter_base + 16, address719) - - match payload716.min { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload722) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload722.mantissa) - mbt_ffi_store32(iter_base + 40, payload722.scale) - - let ptr723 = mbt_ffi_str2ptr(payload722.unit) - mbt_ffi_store32(iter_base + 48, payload722.unit.length()) - mbt_ffi_store32(iter_base + 44, ptr723) - cleanup_list.push(ptr723) - - () - } - } - - match payload716.max { - None => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - Some(payload725) => { - mbt_ffi_store8(iter_base + 56, 1) - mbt_ffi_store64(iter_base + 64, payload725.mantissa) - mbt_ffi_store32(iter_base + 72, payload725.scale) - - let ptr726 = mbt_ffi_str2ptr(payload725.unit) - mbt_ffi_store32(iter_base + 80, payload725.unit.length()) - mbt_ffi_store32(iter_base + 76, ptr726) - cleanup_list.push(ptr726) - - () - } - } - cleanup_list.push(ptr717) - cleanup_list.push(address719) - - () - } - UnionType(payload727) => { - mbt_ffi_store8(iter_base + 0, 31) - - let address763 = mbt_ffi_malloc(payload727.branches.length() * 92) - for index764 = 0 - index764 < payload727.branches.length() - index764 = index764 + 1 { - let iter_elem : @types.UnionBranch = payload727.branches[index764] - let iter_base = address763 + index764 * 92 - - let ptr728 = mbt_ffi_str2ptr(iter_elem.tag) - mbt_ffi_store32(iter_base + 4, iter_elem.tag.length()) - mbt_ffi_store32(iter_base + 0, ptr728) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.discriminator { - Prefix(payload729) => { - mbt_ffi_store8(iter_base + 12, 0) - - let ptr730 = mbt_ffi_str2ptr(payload729) - mbt_ffi_store32(iter_base + 20, payload729.length()) - mbt_ffi_store32(iter_base + 16, ptr730) - cleanup_list.push(ptr730) - - () - } - Suffix(payload731) => { - mbt_ffi_store8(iter_base + 12, 1) - - let ptr732 = mbt_ffi_str2ptr(payload731) - mbt_ffi_store32(iter_base + 20, payload731.length()) - mbt_ffi_store32(iter_base + 16, ptr732) - cleanup_list.push(ptr732) - - () - } - Contains(payload733) => { - mbt_ffi_store8(iter_base + 12, 2) - - let ptr734 = mbt_ffi_str2ptr(payload733) - mbt_ffi_store32(iter_base + 20, payload733.length()) - mbt_ffi_store32(iter_base + 16, ptr734) - cleanup_list.push(ptr734) - - () - } - Regex(payload735) => { - mbt_ffi_store8(iter_base + 12, 3) + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted127, allowed_extensions : lifted131}) + } + 27 => { - let ptr736 = mbt_ffi_str2ptr(payload735) - mbt_ffi_store32(iter_base + 20, payload735.length()) - mbt_ffi_store32(iter_base + 16, ptr736) - cleanup_list.push(ptr736) + let lifted135 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - FieldEquals(payload737) => { - mbt_ffi_store8(iter_base + 12, 4) + let array133 : Array[String] = []; + for index134 = 0; index134 < (mbt_ffi_load32((iter_base) + 16)); index134 = index134 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index134 * 8) - let ptr738 = mbt_ffi_str2ptr(payload737.field_name) - mbt_ffi_store32(iter_base + 20, payload737.field_name.length()) - mbt_ffi_store32(iter_base + 16, ptr738) + let result132 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload737.literal { - None => { - mbt_ffi_store8(iter_base + 24, 0) + array133.push(result132) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - Some(payload740) => { - mbt_ffi_store8(iter_base + 24, 1) + Option::Some(array133) + } + _ => panic() + } - let ptr741 = mbt_ffi_str2ptr(payload740) - mbt_ffi_store32(iter_base + 32, payload740.length()) - mbt_ffi_store32(iter_base + 28, ptr741) - cleanup_list.push(ptr741) + let lifted139 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - () - } - } - cleanup_list.push(ptr738) + let array137 : Array[String] = []; + for index138 = 0; index138 < (mbt_ffi_load32((iter_base) + 28)); index138 = index138 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index138 * 8) - () - } - FieldAbsent(payload742) => { - mbt_ffi_store8(iter_base + 12, 5) + let result136 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let ptr743 = mbt_ffi_str2ptr(payload742) - mbt_ffi_store32(iter_base + 20, payload742.length()) - mbt_ffi_store32(iter_base + 16, ptr743) - cleanup_list.push(ptr743) + array137.push(result136) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - () - } - } + Option::Some(array137) + } + _ => panic() + } - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 36, 0) + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted135, allowed_hosts : lifted139}) + } + 28 => { - () - } - Some(payload745) => { - mbt_ffi_store8(iter_base + 36, 1) + @types.SchemaTypeBody::DatetimeType + } + 29 => { - let ptr746 = mbt_ffi_str2ptr(payload745) - mbt_ffi_store32(iter_base + 44, payload745.length()) - mbt_ffi_store32(iter_base + 40, ptr746) - cleanup_list.push(ptr746) + @types.SchemaTypeBody::DurationType + } + 30 => { - () - } - } - - let address748 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index749 = 0 - index749 < iter_elem.metadata.aliases.length() - index749 = index749 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index749] - let iter_base = address748 + index749 * 8 - - let ptr747 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr747) - cleanup_list.push(ptr747) - } - mbt_ffi_store32(iter_base + 52, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 48, address748) - - let address751 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index752 = 0 - index752 < iter_elem.metadata.examples.length() - index752 = index752 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index752] - let iter_base = address751 + index752 * 8 - - let ptr750 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr750) - cleanup_list.push(ptr750) - } - mbt_ffi_store32(iter_base + 60, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 56, address751) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload754) => { - mbt_ffi_store8(iter_base + 64, 1) + let result140 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr755 = mbt_ffi_str2ptr(payload754) - mbt_ffi_store32(iter_base + 72, payload754.length()) - mbt_ffi_store32(iter_base + 68, ptr755) - cleanup_list.push(ptr755) + let array142 : Array[String] = []; + for index143 = 0; index143 < (mbt_ffi_load32((iter_base) + 20)); index143 = index143 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index143 * 8) - () - } - } + let result141 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 76, 0) + array142.push(result141) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - Some(payload757) => { - mbt_ffi_store8(iter_base + 76, 1) + let lifted145 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - match payload757 { - Multimodal => { - mbt_ffi_store8(iter_base + 80, 0) + let result144 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 80, 1) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result144}) + } + _ => panic() + } - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 80, 2) + let lifted147 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - () - } - Other(payload761) => { - mbt_ffi_store8(iter_base + 80, 3) + let result146 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - let ptr762 = mbt_ffi_str2ptr(payload761) - mbt_ffi_store32(iter_base + 88, payload761.length()) - mbt_ffi_store32(iter_base + 84, ptr762) - cleanup_list.push(ptr762) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result146}) + } + _ => panic() + } - () - } - } + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result140, allowed_suffixes : array142, min : lifted145, max : lifted147}) + } + 31 => { - () - } - } - cleanup_list.push(ptr728) - cleanup_list.push(address748) - cleanup_list.push(address751) - } - mbt_ffi_store32(iter_base + 12, payload727.branches.length()) - mbt_ffi_store32(iter_base + 8, address763) - cleanup_list.push(address763) - - () - } - SecretType(payload765) => { - mbt_ffi_store8(iter_base + 0, 32) - mbt_ffi_store32(iter_base + 8, payload765.inner) + let array171 : Array[@types.UnionBranch] = []; + for index172 = 0; index172 < (mbt_ffi_load32((iter_base) + 12)); index172 = index172 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index172 * 92) - match payload765.category { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let result148 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload767) => { - mbt_ffi_store8(iter_base + 12, 1) + let lifted157 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { - let ptr768 = mbt_ffi_str2ptr(payload767) - mbt_ffi_store32(iter_base + 20, payload767.length()) - mbt_ffi_store32(iter_base + 16, ptr768) - cleanup_list.push(ptr768) + let result149 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - } + @types.DiscriminatorRule::Prefix(result149) + } + 1 => { - () - } - QuotaTokenType(payload769) => { - mbt_ffi_store8(iter_base + 0, 33) + let result150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match payload769.resource_name { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.DiscriminatorRule::Suffix(result150) + } + 2 => { - () - } - Some(payload771) => { - mbt_ffi_store8(iter_base + 8, 1) + let result151 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let ptr772 = mbt_ffi_str2ptr(payload771) - mbt_ffi_store32(iter_base + 16, payload771.length()) - mbt_ffi_store32(iter_base + 12, ptr772) - cleanup_list.push(ptr772) + @types.DiscriminatorRule::Contains(result151) + } + 3 => { - () - } - } + let result152 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - FutureType(payload773) => { - mbt_ffi_store8(iter_base + 0, 34) + @types.DiscriminatorRule::Regex(result152) + } + 4 => { - match payload773 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let result153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - Some(payload775) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload775) + let lifted155 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - () - } - } + let result154 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - () - } - StreamType(payload776) => { - mbt_ffi_store8(iter_base + 0, 35) + Option::Some(result154) + } + _ => panic() + } - match payload776 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result153, literal : lifted155}) + } + 5 => { - () - } - Some(payload778) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload778) + let result156 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - } + @types.DiscriminatorRule::FieldAbsent(result156) + } + _ => panic() + } - () - } - } + let lifted159 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 88, 0) + let result158 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - () - } - Some(payload780) => { - mbt_ffi_store8(iter_base + 88, 1) + Option::Some(result158) + } + _ => panic() + } - let ptr781 = mbt_ffi_str2ptr(payload780) - mbt_ffi_store32(iter_base + 96, payload780.length()) - mbt_ffi_store32(iter_base + 92, ptr781) - cleanup_list.push(ptr781) + let array161 : Array[String] = []; + for index162 = 0; index162 < (mbt_ffi_load32((iter_base) + 52)); index162 = index162 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index162 * 8) - () - } - } - - let address783 = mbt_ffi_malloc(iter_elem.metadata.aliases.length() * 8) - for index784 = 0 - index784 < iter_elem.metadata.aliases.length() - index784 = index784 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index784] - let iter_base = address783 + index784 * 8 - - let ptr782 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr782) - cleanup_list.push(ptr782) - } - mbt_ffi_store32(iter_base + 104, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 100, address783) - - let address786 = mbt_ffi_malloc(iter_elem.metadata.examples.length() * 8) - for index787 = 0 - index787 < iter_elem.metadata.examples.length() - index787 = index787 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index787] - let iter_base = address786 + index787 * 8 - - let ptr785 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr785) - cleanup_list.push(ptr785) - } - mbt_ffi_store32(iter_base + 112, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 108, address786) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 116, 0) - - () - } - Some(payload789) => { - mbt_ffi_store8(iter_base + 116, 1) + let result160 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let ptr790 = mbt_ffi_str2ptr(payload789) - mbt_ffi_store32(iter_base + 124, payload789.length()) - mbt_ffi_store32(iter_base + 120, ptr790) - cleanup_list.push(ptr790) + array161.push(result160) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - () - } - } + let array164 : Array[String] = []; + for index165 = 0; index165 < (mbt_ffi_load32((iter_base) + 60)); index165 = index165 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index165 * 8) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 128, 0) + let result163 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload792) => { - mbt_ffi_store8(iter_base + 128, 1) - - match payload792 { - Multimodal => { - mbt_ffi_store8(iter_base + 132, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 132, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 132, 2) - - () - } - Other(payload796) => { - mbt_ffi_store8(iter_base + 132, 3) - - let ptr797 = mbt_ffi_str2ptr(payload796) - mbt_ffi_store32(iter_base + 140, payload796.length()) - mbt_ffi_store32(iter_base + 136, ptr797) - cleanup_list.push(ptr797) - - () - } - } - - () - } - } - cleanup_list.push(address783) - cleanup_list.push(address786) - } - mbt_ffi_store32(return_area + 44, response.graph.type_nodes.length()) - mbt_ffi_store32(return_area + 40, address798) - - let address804 = mbt_ffi_malloc(response.graph.defs.length() * 24) - for index805 = 0 - index805 < response.graph.defs.length() - index805 = index805 + 1 { - let iter_elem : @types.SchemaTypeDef = response.graph.defs[index805] - let iter_base = address804 + index805 * 24 - - let ptr800 = mbt_ffi_str2ptr(iter_elem.id) - mbt_ffi_store32(iter_base + 4, iter_elem.id.length()) - mbt_ffi_store32(iter_base + 0, ptr800) - - match iter_elem.name { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload802) => { - mbt_ffi_store8(iter_base + 8, 1) + array164.push(result163) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - let ptr803 = mbt_ffi_str2ptr(payload802) - mbt_ffi_store32(iter_base + 16, payload802.length()) - mbt_ffi_store32(iter_base + 12, ptr803) - cleanup_list.push(ptr803) + let lifted167 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - } - mbt_ffi_store32(iter_base + 20, iter_elem.body) - cleanup_list.push(ptr800) - } - mbt_ffi_store32(return_area + 52, response.graph.defs.length()) - mbt_ffi_store32(return_area + 48, address804) - mbt_ffi_store32(return_area + 56, response.graph.root) - - let address876 = mbt_ffi_malloc(response.value.value_nodes.length() * 32) - for index877 = 0 - index877 < response.value.value_nodes.length() - index877 = index877 + 1 { - let iter_elem : @types.SchemaValueNode = response.value.value_nodes[index877] - let iter_base = address876 + index877 * 32 - - match iter_elem { - BoolValue(payload806) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload806 { 1 } else { 0 }) - - () - } - S8Value(payload807) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload807)) + let result166 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - () - } - S16Value(payload808) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload808)) + Option::Some(result166) + } + _ => panic() + } - () - } - S32Value(payload809) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload809) + let lifted170 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - () - } - S64Value(payload810) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload810) + let lifted169 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { - () - } - U8Value(payload811) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload811.to_int()) + @types.Role::Multimodal + } + 1 => { - () - } - U16Value(payload812) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload812.reinterpret_as_int()) + @types.Role::UnstructuredText + } + 2 => { - () - } - U32Value(payload813) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload813.reinterpret_as_int()) + @types.Role::UnstructuredBinary + } + 3 => { - () - } - U64Value(payload814) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload814.reinterpret_as_int64()) + let result168 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - () - } - F32Value(payload815) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload815) + @types.Role::Other(result168) + } + _ => panic() + } - () - } - F64Value(payload816) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload816) + Option::Some(lifted169) + } + _ => panic() + } - () - } - CharValue(payload817) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload817.to_int()) + array171.push(@types.UnionBranch::{tag : result148, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted157, metadata : @types.MetadataEnvelope::{doc : lifted159, aliases : array161, examples : array164, deprecated : lifted167, role : lifted170}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - StringValue(payload818) => { - mbt_ffi_store8(iter_base + 0, 12) + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array171}) + } + 32 => { - let ptr819 = mbt_ffi_str2ptr(payload818) - mbt_ffi_store32(iter_base + 12, payload818.length()) - mbt_ffi_store32(iter_base + 8, ptr819) - cleanup_list.push(ptr819) + let lifted174 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - RecordValue(payload820) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address821 = mbt_ffi_malloc(payload820.length() * 4) - for index822 = 0 - index822 < payload820.length() - index822 = index822 + 1 { - let iter_elem : Int = payload820[index822] - let iter_base = address821 + index822 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload820.length()) - mbt_ffi_store32(iter_base + 8, address821) - cleanup_list.push(address821) - - () - } - VariantValue(payload823) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload823.case.reinterpret_as_int()) + let result173 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match payload823.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + Option::Some(result173) + } + _ => panic() + } - () - } - Some(payload825) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload825) + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted174}) + } + 33 => { - () - } - } + let lifted176 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - EnumValue(payload826) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload826.reinterpret_as_int()) + let result175 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - () - } - FlagsValue(payload827) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address828 = mbt_ffi_malloc(payload827.length() * 1) - for index829 = 0 - index829 < payload827.length() - index829 = index829 + 1 { - let iter_elem : Bool = payload827[index829] - let iter_base = address828 + index829 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload827.length()) - mbt_ffi_store32(iter_base + 8, address828) - cleanup_list.push(address828) - - () - } - TupleValue(payload830) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address831 = mbt_ffi_malloc(payload830.length() * 4) - for index832 = 0 - index832 < payload830.length() - index832 = index832 + 1 { - let iter_elem : Int = payload830[index832] - let iter_base = address831 + index832 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload830.length()) - mbt_ffi_store32(iter_base + 8, address831) - cleanup_list.push(address831) - - () - } - ListValue(payload833) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address834 = mbt_ffi_malloc(payload833.length() * 4) - for index835 = 0 - index835 < payload833.length() - index835 = index835 + 1 { - let iter_elem : Int = payload833[index835] - let iter_base = address834 + index835 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload833.length()) - mbt_ffi_store32(iter_base + 8, address834) - cleanup_list.push(address834) - - () - } - FixedListValue(payload836) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address837 = mbt_ffi_malloc(payload836.length() * 4) - for index838 = 0 - index838 < payload836.length() - index838 = index838 + 1 { - let iter_elem : Int = payload836[index838] - let iter_base = address837 + index838 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload836.length()) - mbt_ffi_store32(iter_base + 8, address837) - cleanup_list.push(address837) - - () - } - MapValue(payload839) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address840 = mbt_ffi_malloc(payload839.length() * 8) - for index841 = 0 - index841 < payload839.length() - index841 = index841 + 1 { - let iter_elem : @types.MapEntry = payload839[index841] - let iter_base = address840 + index841 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload839.length()) - mbt_ffi_store32(iter_base + 8, address840) - cleanup_list.push(address840) - - () - } - OptionValue(payload842) => { - mbt_ffi_store8(iter_base + 0, 21) + Option::Some(result175) + } + _ => panic() + } - match payload842 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted176}) + } + 34 => { - () - } - Some(payload844) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload844) + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - () - } - } + let lifted177 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - ResultValue(payload845) => { - mbt_ffi_store8(iter_base + 0, 22) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - match payload845 { - OkValue(payload846) => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaTypeBody::FutureType(lifted177) + } + 36 => { - match payload846 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let lifted178 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - Some(payload848) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload848) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - () - } + @types.SchemaTypeBody::StreamType(lifted178) + } + _ => panic() } - () - } - ErrValue(payload849) => { - mbt_ffi_store8(iter_base + 8, 1) - - match payload849 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let lifted181 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { - () - } - Some(payload851) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload851) + let result180 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - () - } + Option::Some(result180) + } + _ => panic() } - () - } - } - - () - } - TextValue(payload852) => { - mbt_ffi_store8(iter_base + 0, 23) - - let ptr853 = mbt_ffi_str2ptr(payload852.text) - mbt_ffi_store32(iter_base + 12, payload852.text.length()) - mbt_ffi_store32(iter_base + 8, ptr853) + let array183 : Array[String] = []; + for index184 = 0; index184 < (mbt_ffi_load32((iter_base) + 104)); index184 = index184 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index184 * 8) - match payload852.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let result182 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload855) => { - mbt_ffi_store8(iter_base + 16, 1) + array183.push(result182) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - let ptr856 = mbt_ffi_str2ptr(payload855) - mbt_ffi_store32(iter_base + 24, payload855.length()) - mbt_ffi_store32(iter_base + 20, ptr856) - cleanup_list.push(ptr856) + let array186 : Array[String] = []; + for index187 = 0; index187 < (mbt_ffi_load32((iter_base) + 112)); index187 = index187 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index187 * 8) - () - } - } - cleanup_list.push(ptr853) + let result185 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - BinaryValue(payload857) => { - mbt_ffi_store8(iter_base + 0, 24) + array186.push(result185) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - let ptr858 = mbt_ffi_bytes2ptr(payload857.bytes) + let lifted189 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - mbt_ffi_store32(iter_base + 12, payload857.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr858) + let result188 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - match payload857.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + Option::Some(result188) + } + _ => panic() + } - () - } - Some(payload860) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted192 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - let ptr861 = mbt_ffi_str2ptr(payload860) - mbt_ffi_store32(iter_base + 24, payload860.length()) - mbt_ffi_store32(iter_base + 20, ptr861) - cleanup_list.push(ptr861) + let lifted191 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - () - } - } - cleanup_list.push(ptr858) + @types.Role::Multimodal + } + 1 => { - () - } - PathValue(payload862) => { - mbt_ffi_store8(iter_base + 0, 25) + @types.Role::UnstructuredText + } + 2 => { - let ptr863 = mbt_ffi_str2ptr(payload862) - mbt_ffi_store32(iter_base + 12, payload862.length()) - mbt_ffi_store32(iter_base + 8, ptr863) - cleanup_list.push(ptr863) + @types.Role::UnstructuredBinary + } + 3 => { - () - } - UrlValue(payload864) => { - mbt_ffi_store8(iter_base + 0, 26) + let result190 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - let ptr865 = mbt_ffi_str2ptr(payload864) - mbt_ffi_store32(iter_base + 12, payload864.length()) - mbt_ffi_store32(iter_base + 8, ptr865) - cleanup_list.push(ptr865) + @types.Role::Other(result190) + } + _ => panic() + } - () - } - DatetimeValue(payload866) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload866.seconds) - mbt_ffi_store32( - iter_base + 16, - payload866.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload867) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload867.nanoseconds) + Option::Some(lifted191) + } + _ => panic() + } - () + array193.push(@types.SchemaTypeNode::{body : lifted179, metadata : @types.MetadataEnvelope::{doc : lifted181, aliases : array183, examples : array186, deprecated : lifted189, role : lifted192}}) } - QuantityValueNode(payload868) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload868.mantissa) - mbt_ffi_store32(iter_base + 16, payload868.scale) + mbt_ffi_free(mbt_ffi_load32((return_area) + 24)) - let ptr869 = mbt_ffi_str2ptr(payload868.unit) - mbt_ffi_store32(iter_base + 24, payload868.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr869) - cleanup_list.push(ptr869) + let array198 : Array[@types.SchemaTypeDef] = []; + for index199 = 0; index199 < (mbt_ffi_load32((return_area) + 36)); index199 = index199 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 32)) + (index199 * 24) - () - } - UnionValue(payload870) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr871 = mbt_ffi_str2ptr(payload870.tag) - mbt_ffi_store32(iter_base + 12, payload870.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr871) - mbt_ffi_store32(iter_base + 16, payload870.body) - cleanup_list.push(ptr871) + let result195 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - SecretValue(payload872) => { - mbt_ffi_store8(iter_base + 0, 31) + let lifted197 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let @types.Secret(handle873) = payload872 - mbt_ffi_store32(iter_base + 8, handle873) + let result196 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - () - } - QuotaTokenHandle(payload874) => { - mbt_ffi_store8(iter_base + 0, 32) - - let @types.QuotaToken(handle875) = payload874 - mbt_ffi_store32(iter_base + 8, handle875) + Option::Some(result196) + } + _ => panic() + } - () - } - } - } - mbt_ffi_store32(return_area + 64, response.value.value_nodes.length()) - mbt_ffi_store32(return_area + 60, address876) - mbt_ffi_store32(return_area + 68, response.value.root) - - match function_type { - ReadLocal => { - mbt_ffi_store8(return_area + 72, 0) - - () - } - WriteLocal => { - mbt_ffi_store8(return_area + 72, 1) - - () - } - ReadRemote => { - mbt_ffi_store8(return_area + 72, 2) - - () - } - WriteRemote => { - mbt_ffi_store8(return_area + 72, 3) - - () - } - WriteRemoteBatched(payload882) => { - mbt_ffi_store8(return_area + 72, 4) - - match payload882 { - None => { - mbt_ffi_store8(return_area + 80, 0) - - () - } - Some(payload884) => { - mbt_ffi_store8(return_area + 80, 1) - mbt_ffi_store64(return_area + 88, payload884.reinterpret_as_int64()) - - () - } + array198.push(@types.SchemaTypeDef::{id : result195, name : lifted197, body : mbt_ffi_load32((iter_base) + 20)}) } + mbt_ffi_free(mbt_ffi_load32((return_area) + 32)) - () - } - WriteRemoteTransaction(payload885) => { - mbt_ffi_store8(return_area + 72, 5) + let array229 : Array[@types.SchemaValueNode] = []; + for index230 = 0; index230 < (mbt_ffi_load32((return_area) + 48)); index230 = index230 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 44)) + (index230 * 32) - match payload885 { - None => { - mbt_ffi_store8(return_area + 80, 0) + let lifted228 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - Some(payload887) => { - mbt_ffi_store8(return_area + 80, 1) - mbt_ffi_store64(return_area + 88, payload887.reinterpret_as_int64()) + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - () - } - } + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - () - } - } - wasmImportPersistDurableFunctionInvocation(return_area) - mbt_ffi_free(return_area) - mbt_ffi_free(ptr) - mbt_ffi_free(address358) - mbt_ffi_free(address364) - mbt_ffi_free(address435) - mbt_ffi_free(address798) - mbt_ffi_free(address804) - mbt_ffi_free(address876) - - cleanup_list.each(mbt_ffi_free) -} + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { -///| -/// Reads the next persisted durable function invocation from the oplog during replay -pub fn read_persisted_durable_function_invocation() -> PersistedDurableFunctionInvocation { - let return_area = mbt_ffi_malloc(88) - wasmImportReadPersistedDurableFunctionInvocation(return_area) - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 16), - mbt_ffi_load32(return_area + 20), - ) - - let array193 : Array[@types.SchemaTypeNode] = [] - for index194 = 0 - index194 < mbt_ffi_load32(return_area + 28) - index194 = index194 + 1 { - let iter_base = mbt_ffi_load32(return_area + 24) + index194 * 144 - - let lifted179 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted5 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted0 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 32)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - Option::Some(lifted) - } - _ => panic() - } + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - let lifted2 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 56)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - Option::Some(lifted1) - } - _ => panic() - } + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - let lifted4 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result3) - } - _ => panic() - } + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted0, - max: lifted2, - unit: lifted4, - }) - } - _ => panic() - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - @types.SchemaTypeBody::S8Type(lifted5) - } - 3 => { - let lifted12 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted7 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted6 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 32)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - Option::Some(lifted6) - } - _ => panic() - } + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - let lifted9 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted8 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 56)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - Option::Some(lifted8) - } - _ => panic() - } + let result200 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let lifted11 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result10 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result10) - } - _ => panic() - } + @types.SchemaValueNode::StringValue(result200) + } + 13 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted7, - max: lifted9, - unit: lifted11, - }) - } - _ => panic() - } + let array201 : Array[Int] = []; + for index202 = 0; index202 < (mbt_ffi_load32((iter_base) + 12)); index202 = index202 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index202 * 4) - @types.SchemaTypeBody::S16Type(lifted12) - } - 4 => { - let lifted19 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted14 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted13 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 32)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + array201.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted13) - } - _ => panic() - } + @types.SchemaValueNode::RecordValue(array201) + } + 14 => { - let lifted16 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted15 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 56)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted203 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted15) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let lifted18 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result17 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result17) - } - _ => panic() - } + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted203}) + } + 15 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted14, - max: lifted16, - unit: lifted18, - }) - } - _ => panic() - } + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - @types.SchemaTypeBody::S32Type(lifted19) - } - 5 => { - let lifted26 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted21 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted20 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 32)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array204 : Array[Bool] = []; + for index205 = 0; index205 < (mbt_ffi_load32((iter_base) + 12)); index205 = index205 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index205 * 1) - Option::Some(lifted20) - } - _ => panic() - } + array204.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted23 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted22 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 56)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::FlagsValue(array204) + } + 17 => { - Option::Some(lifted22) - } - _ => panic() - } + let array206 : Array[Int] = []; + for index207 = 0; index207 < (mbt_ffi_load32((iter_base) + 12)); index207 = index207 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index207 * 4) - let lifted25 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result24 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result24) - } - _ => panic() - } + array206.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(@types.NumericRestrictions::{ - min: lifted21, - max: lifted23, - unit: lifted25, - }) - } - _ => panic() - } + @types.SchemaValueNode::TupleValue(array206) + } + 18 => { - @types.SchemaTypeBody::S64Type(lifted26) - } - 6 => { - let lifted33 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted28 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted27 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 32)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array208 : Array[Int] = []; + for index209 = 0; index209 < (mbt_ffi_load32((iter_base) + 12)); index209 = index209 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index209 * 4) - Option::Some(lifted27) - } - _ => panic() - } + array208.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted30 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted29 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 56)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::ListValue(array208) + } + 19 => { - Option::Some(lifted29) - } - _ => panic() - } + let array210 : Array[Int] = []; + for index211 = 0; index211 < (mbt_ffi_load32((iter_base) + 12)); index211 = index211 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index211 * 4) - let lifted32 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result31 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result31) - } - _ => panic() - } + array210.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(@types.NumericRestrictions::{ - min: lifted28, - max: lifted30, - unit: lifted32, - }) - } - _ => panic() - } + @types.SchemaValueNode::FixedListValue(array210) + } + 20 => { - @types.SchemaTypeBody::U8Type(lifted33) - } - 7 => { - let lifted40 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted35 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted34 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 32)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let array212 : Array[@types.MapEntry] = []; + for index213 = 0; index213 < (mbt_ffi_load32((iter_base) + 12)); index213 = index213 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index213 * 8) - Option::Some(lifted34) - } - _ => panic() - } + array212.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted37 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted36 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 56)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::MapValue(array212) + } + 21 => { - Option::Some(lifted36) - } - _ => panic() - } + let lifted214 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted39 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result38 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result38) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted35, - max: lifted37, - unit: lifted39, - }) - } - _ => panic() - } + @types.SchemaValueNode::OptionValue(lifted214) + } + 22 => { - @types.SchemaTypeBody::U16Type(lifted40) - } - 8 => { - let lifted47 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted42 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted41 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 32)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted217 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - Option::Some(lifted41) - } - _ => panic() - } + let lifted215 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let lifted44 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted43 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 56)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - Option::Some(lifted43) - } - _ => panic() - } + @types.ResultValuePayload::OkValue(lifted215) + } + 1 => { - let lifted46 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result45 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result45) - } - _ => panic() - } + let lifted216 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted42, - max: lifted44, - unit: lifted46, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - @types.SchemaTypeBody::U32Type(lifted47) - } - 9 => { - let lifted54 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted49 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted48 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 32)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.ResultValuePayload::ErrValue(lifted216) + } + _ => panic() + } - Option::Some(lifted48) - } - _ => panic() - } + @types.SchemaValueNode::ResultValue(lifted217) + } + 23 => { - let lifted51 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted50 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 56)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result218 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted50) - } - _ => panic() - } + let lifted220 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted53 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result52 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result52) - } - _ => panic() - } + let result219 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Option::Some(@types.NumericRestrictions::{ - min: lifted49, - max: lifted51, - unit: lifted53, - }) - } - _ => panic() - } + Option::Some(result219) + } + _ => panic() + } - @types.SchemaTypeBody::U64Type(lifted54) - } - 10 => { - let lifted61 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted56 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted55 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 32)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result218, language : lifted220}) + } + 24 => { - Option::Some(lifted55) - } - _ => panic() - } + let result221 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let lifted58 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted57 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 56)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted223 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(lifted57) - } - _ => panic() - } + let result222 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted60 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result59 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result59) - } - _ => panic() - } + Option::Some(result222) + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted56, - max: lifted58, - unit: lifted60, - }) - } - _ => panic() - } + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result221, mime_type : lifted223}) + } + 25 => { - @types.SchemaTypeBody::F32Type(lifted61) - } - 11 => { - let lifted68 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted63 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted62 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 32)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } + let result224 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted62) - } - _ => panic() - } + @types.SchemaValueNode::PathValue(result224) + } + 26 => { - let lifted65 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted64 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed(mbt_ffi_load64(iter_base + 56)) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result225 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted64) - } - _ => panic() - } + @types.SchemaValueNode::UrlValue(result225) + } + 27 => { - let lifted67 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result66 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result66) - } - _ => panic() - } + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted63, - max: lifted65, - unit: lifted67, - }) - } - _ => panic() - } + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - @types.SchemaTypeBody::F64Type(lifted68) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array81 : Array[@types.NamedFieldType] = [] - for index82 = 0 - index82 < mbt_ffi_load32(iter_base + 12) - index82 = index82 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index82 * 68 - - let result69 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted71 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result70 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let result226 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Option::Some(result70) - } - _ => panic() - } - - let array : Array[String] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 28) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index * 8 - - let result72 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result72) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array74 : Array[String] = [] - for index75 = 0 - index75 < mbt_ffi_load32(iter_base + 36) - index75 = index75 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index75 * 8 - - let result73 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array74.push(result73) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted77 : String? = match mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result76 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result226}) + } + 30 => { - Option::Some(result76) - } - _ => panic() - } + let result227 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let lifted80 : @types.Role? = match mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted79 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result78 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result78) - } - _ => panic() - } - - Option::Some(lifted79) - } - _ => panic() - } - - array81.push(@types.NamedFieldType::{ - name: result69, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted71, - aliases: array, - examples: array74, - deprecated: lifted77, - role: lifted80, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array81) - } - 15 => { - let array98 : Array[@types.VariantCaseType] = [] - for index99 = 0 - index99 < mbt_ffi_load32(iter_base + 12) - index99 = index99 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index99 * 72 - - let result83 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted84 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result227, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - let lifted86 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result85 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - Option::Some(result85) - } - _ => panic() - } - - let array88 : Array[String] = [] - for index89 = 0 - index89 < mbt_ffi_load32(iter_base + 32) - index89 = index89 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index89 * 8 - - let result87 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array88.push(result87) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array91 : Array[String] = [] - for index92 = 0 - index92 < mbt_ffi_load32(iter_base + 40) - index92 = index92 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index92 * 8 - - let result90 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array91.push(result90) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted94 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result93 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - Option::Some(result93) + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() } - _ => panic() - } - let lifted97 : @types.Role? = match mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted96 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result95 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result95) - } - _ => panic() - } - - Option::Some(lifted96) - } - _ => panic() - } - - array98.push(@types.VariantCaseType::{ - name: result83, - payload: lifted84, - metadata: @types.MetadataEnvelope::{ - doc: lifted86, - aliases: array88, - examples: array91, - deprecated: lifted94, - role: lifted97, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array98) - } - 16 => { - let array101 : Array[String] = [] - for index102 = 0 - index102 < mbt_ffi_load32(iter_base + 12) - index102 = index102 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index102 * 8 - - let result100 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array101.push(result100) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array101) - } - 17 => { - let array104 : Array[String] = [] - for index105 = 0 - index105 < mbt_ffi_load32(iter_base + 12) - index105 = index105 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index105 * 8 - - let result103 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array104.push(result103) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array104) - } - 18 => { - let array106 : Array[Int] = [] - for index107 = 0 - index107 < mbt_ffi_load32(iter_base + 12) - index107 = index107 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index107 * 4 - - array106.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array106) - } - 19 => @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted108 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted109 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted108, - err: lifted109, - }) - } - 24 => { - let lifted113 : Array[String]? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array111 : Array[String] = [] - for index112 = 0 - index112 < mbt_ffi_load32(iter_base + 16) - index112 = index112 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index112 * 8 - - let result110 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array111.push(result110) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array111) - } - _ => panic() - } - - let lifted114 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 24).reinterpret_as_uint()) - _ => panic() - } - - let lifted115 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 32).reinterpret_as_uint()) - _ => panic() - } - - let lifted117 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result116 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result116) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted113, - min_length: lifted114, - max_length: lifted115, - regex: lifted117, - }) - } - 25 => { - let lifted121 : Array[String]? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array119 : Array[String] = [] - for index120 = 0 - index120 < mbt_ffi_load32(iter_base + 16) - index120 = index120 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index120 * 8 - - let result118 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array119.push(result118) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array119) - } - _ => panic() - } - - let lifted122 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 24).reinterpret_as_uint()) - _ => panic() - } - - let lifted123 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 32).reinterpret_as_uint()) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted121, - min_bytes: lifted122, - max_bytes: lifted123, - }) + array229.push(lifted228) } - 26 => { - let lifted127 : Array[String]? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array125 : Array[String] = [] - for index126 = 0 - index126 < mbt_ffi_load32(iter_base + 20) - index126 = index126 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index126 * 8 - - let result124 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array125.push(result124) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array125) - } - _ => panic() - } - - let lifted131 : Array[String]? = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array129 : Array[String] = [] - for index130 = 0 - index130 < mbt_ffi_load32(iter_base + 32) - index130 = index130 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index130 * 8 - - let result128 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array129.push(result128) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array129) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from(mbt_ffi_load8_u(iter_base + 8)), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted127, - allowed_extensions: lifted131, - }) - } - 27 => { - let lifted135 : Array[String]? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array133 : Array[String] = [] - for index134 = 0 - index134 < mbt_ffi_load32(iter_base + 16) - index134 = index134 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index134 * 8 - - let result132 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array133.push(result132) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array133) - } - _ => panic() - } - - let lifted139 : Array[String]? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array137 : Array[String] = [] - for index138 = 0 - index138 < mbt_ffi_load32(iter_base + 28) - index138 = index138 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index138 * 8 - - let result136 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array137.push(result136) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array137) - } - _ => panic() - } + mbt_ffi_free(mbt_ffi_load32((return_area) + 44)) - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted135, - allowed_hosts: lifted139, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result140 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array142 : Array[String] = [] - for index143 = 0 - index143 < mbt_ffi_load32(iter_base + 20) - index143 = index143 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index143 * 8 - - let result141 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array142.push(result141) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted145 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result144 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result144, - }) - } - _ => panic() - } - - let lifted147 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result146 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result146, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result140, - allowed_suffixes: array142, - min: lifted145, - max: lifted147, - }) - } - 31 => { - let array171 : Array[@types.UnionBranch] = [] - for index172 = 0 - index172 < mbt_ffi_load32(iter_base + 12) - index172 = index172 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index172 * 92 - - let result148 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted157 = match mbt_ffi_load8_u(iter_base + 12) { + let lifted233 = match (mbt_ffi_load8_u((return_area) + 56)) { 0 => { - let result149 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - @types.DiscriminatorRule::Prefix(result149) + @oplog.WrappedFunctionType::ReadLocal } 1 => { - let result150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - @types.DiscriminatorRule::Suffix(result150) + @oplog.WrappedFunctionType::WriteLocal } 2 => { - let result151 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - @types.DiscriminatorRule::Contains(result151) + @oplog.WrappedFunctionType::ReadRemote } 3 => { - let result152 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - @types.DiscriminatorRule::Regex(result152) + @oplog.WrappedFunctionType::WriteRemote } 4 => { - let result153 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted155 : String? = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result154 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result154) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result153, - literal: lifted155, - }) - } - 5 => { - let result156 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - @types.DiscriminatorRule::FieldAbsent(result156) - } - _ => panic() - } + let lifted231 : UInt64? = match mbt_ffi_load8_u((return_area) + 64) { + 0 => Option::None + 1 => { - let lifted159 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result158 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + Option::Some((mbt_ffi_load64((return_area) + 72)).reinterpret_as_uint64()) + } + _ => panic() + } - Option::Some(result158) + @oplog.WrappedFunctionType::WriteRemoteBatched(lifted231) } - _ => panic() - } - - let array161 : Array[String] = [] - for index162 = 0 - index162 < mbt_ffi_load32(iter_base + 52) - index162 = index162 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index162 * 8 - - let result160 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array161.push(result160) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array164 : Array[String] = [] - for index165 = 0 - index165 < mbt_ffi_load32(iter_base + 60) - index165 = index165 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index165 * 8 - - let result163 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array164.push(result163) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted167 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result166 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + 5 => { - Option::Some(result166) - } - _ => panic() - } + let lifted232 : UInt64? = match mbt_ffi_load8_u((return_area) + 64) { + 0 => Option::None + 1 => { - let lifted170 : @types.Role? = match mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted169 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result168 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result168) - } - _ => panic() - } - - Option::Some(lifted169) - } - _ => panic() - } - - array171.push(@types.UnionBranch::{ - tag: result148, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted157, - metadata: @types.MetadataEnvelope::{ - doc: lifted159, - aliases: array161, - examples: array164, - deprecated: lifted167, - role: lifted170, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array171, - }) - } - 32 => { - let lifted174 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result173 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result173) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted174, - }) - } - 33 => { - let lifted176 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result175) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted176, - }) - } - 34 => { - let lifted177 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted177) - } - 35 => { - let lifted178 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted178) - } - _ => panic() - } - - let lifted181 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result180 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result180) - } - _ => panic() - } - - let array183 : Array[String] = [] - for index184 = 0 - index184 < mbt_ffi_load32(iter_base + 104) - index184 = index184 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index184 * 8 - - let result182 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array183.push(result182) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array186 : Array[String] = [] - for index187 = 0 - index187 < mbt_ffi_load32(iter_base + 112) - index187 = index187 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index187 * 8 - - let result185 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array186.push(result185) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted189 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result188 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result188) - } - _ => panic() - } - - let lifted192 : @types.Role? = match mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted191 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result190 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result190) - } - _ => panic() - } - - Option::Some(lifted191) - } - _ => panic() - } - - array193.push(@types.SchemaTypeNode::{ - body: lifted179, - metadata: @types.MetadataEnvelope::{ - doc: lifted181, - aliases: array183, - examples: array186, - deprecated: lifted189, - role: lifted192, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 24)) - - let array198 : Array[@types.SchemaTypeDef] = [] - for index199 = 0 - index199 < mbt_ffi_load32(return_area + 36) - index199 = index199 + 1 { - let iter_base = mbt_ffi_load32(return_area + 32) + index199 * 24 - - let result195 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted197 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result196 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result196) - } - _ => panic() - } - - array198.push(@types.SchemaTypeDef::{ - id: result195, - name: lifted197, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 32)) - - let array229 : Array[@types.SchemaValueNode] = [] - for index230 = 0 - index230 < mbt_ffi_load32(return_area + 48) - index230 = index230 + 1 { - let iter_base = mbt_ffi_load32(return_area + 44) + index230 * 32 - - let lifted228 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue(mbt_ffi_load8_u(iter_base + 8) != 0) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8).land(0xFFFF).reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result200 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result200) - } - 13 => { - let array201 : Array[Int] = [] - for index202 = 0 - index202 < mbt_ffi_load32(iter_base + 12) - index202 = index202 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index202 * 4 - - array201.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array201) - } - 14 => { - let lifted203 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted203, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array204 : Array[Bool] = [] - for index205 = 0 - index205 < mbt_ffi_load32(iter_base + 12) - index205 = index205 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index205 * 1 - - array204.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array204) - } - 17 => { - let array206 : Array[Int] = [] - for index207 = 0 - index207 < mbt_ffi_load32(iter_base + 12) - index207 = index207 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index207 * 4 - - array206.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array206) - } - 18 => { - let array208 : Array[Int] = [] - for index209 = 0 - index209 < mbt_ffi_load32(iter_base + 12) - index209 = index209 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index209 * 4 - - array208.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array208) - } - 19 => { - let array210 : Array[Int] = [] - for index211 = 0 - index211 < mbt_ffi_load32(iter_base + 12) - index211 = index211 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index211 * 4 - - array210.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array210) - } - 20 => { - let array212 : Array[@types.MapEntry] = [] - for index213 = 0 - index213 < mbt_ffi_load32(iter_base + 12) - index213 = index213 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index213 * 8 - - array212.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array212) - } - 21 => { - let lifted214 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted214) - } - 22 => { - let lifted217 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted215 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + Option::Some((mbt_ffi_load64((return_area) + 72)).reinterpret_as_uint64()) + } + _ => panic() + } - @types.ResultValuePayload::OkValue(lifted215) - } - 1 => { - let lifted216 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() + @oplog.WrappedFunctionType::WriteRemoteTransaction(lifted232) } - - @types.ResultValuePayload::ErrValue(lifted216) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted217) - } - 23 => { - let result218 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted220 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result219 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result219) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result218, - language: lifted220, - }) - } - 24 => { - let result221 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted223 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result222 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result222) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result221, - mime_type: lifted223, - }) - } - 25 => { - let result224 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result224) - } - 26 => { - let result225 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result225) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result226 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result226, - }) - } - 30 => { - let result227 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result227, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } - - array229.push(lifted228) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 44)) - - let lifted233 = match mbt_ffi_load8_u(return_area + 56) { - 0 => @oplog.WrappedFunctionType::ReadLocal - 1 => @oplog.WrappedFunctionType::WriteLocal - 2 => @oplog.WrappedFunctionType::ReadRemote - 3 => @oplog.WrappedFunctionType::WriteRemote - 4 => { - let lifted231 : UInt64? = match mbt_ffi_load8_u(return_area + 64) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load64(return_area + 72).reinterpret_as_uint64()) - _ => panic() - } - - @oplog.WrappedFunctionType::WriteRemoteBatched(lifted231) - } - 5 => { - let lifted232 : UInt64? = match mbt_ffi_load8_u(return_area + 64) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load64(return_area + 72).reinterpret_as_uint64()) - _ => panic() + _ => panic() } + let ret = PersistedDurableFunctionInvocation::{timestamp : @system-clock.Instant::{seconds : mbt_ffi_load64((return_area) + 0), nanoseconds : (mbt_ffi_load32((return_area) + 8)).reinterpret_as_uint()}, function_name : result, response : @types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array193, defs : array198, root : mbt_ffi_load32((return_area) + 40)}, value : @types.SchemaValueTree::{value_nodes : array229, root : mbt_ffi_load32((return_area) + 52)}}, function_type : lifted233, entry_version : OplogEntryVersion::from(mbt_ffi_load8_u((return_area) + 80))} + mbt_ffi_free(return_area) + return ret - @oplog.WrappedFunctionType::WriteRemoteTransaction(lifted232) - } - _ => panic() - } - let ret = PersistedDurableFunctionInvocation::{ - timestamp: @system-clock.Instant::{ - seconds: mbt_ffi_load64(return_area + 0), - nanoseconds: mbt_ffi_load32(return_area + 8).reinterpret_as_uint(), - }, - function_name: result, - response: @types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array193, - defs: array198, - root: mbt_ffi_load32(return_area + 40), - }, - value: @types.SchemaValueTree::{ - value_nodes: array229, - root: mbt_ffi_load32(return_area + 52), - }, - }, - function_type: lifted233, - entry_version: OplogEntryVersion::from(mbt_ffi_load8_u(return_area + 80)), - } - mbt_ffi_free(return_area) - return ret } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/quota/types/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/quota/types/ffi.mbt index 333d494cc8..0684b9e4bf 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/quota/types/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/quota/types/ffi.mbt @@ -1,47 +1,42 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropReservation(resource : Int) = "golem:quota/types@1.5.0" "[resource-drop]reservation" -///| -fn wasmImportStaticReservationCommit(p0 : Int, p1 : Int64) = "golem:quota/types@1.5.0" "[static]reservation.commit" +fn wasmImportStaticReservationCommit(p0 : Int, p1 : Int64) = "golem:quota/types@1.5.0" "[static]reservation.commit" -///| fn wasmImportNewToken(p0 : Int, p1 : Int, p2 : Int64) -> Int = "golem:quota/types@1.5.0" "new-token" -///| -fn wasmImportReserve(p0 : Int, p1 : Int64, p2 : Int) = "golem:quota/types@1.5.0" "reserve" +fn wasmImportReserve(p0 : Int, p1 : Int64, p2 : Int) = "golem:quota/types@1.5.0" "reserve" -///| fn wasmImportSplit(p0 : Int, p1 : Int64) -> Int = "golem:quota/types@1.5.0" "split" -///| -fn wasmImportMerge(p0 : Int, p1 : Int) = "golem:quota/types@1.5.0" "merge" +fn wasmImportMerge(p0 : Int, p1 : Int) = "golem:quota/types@1.5.0" "merge" ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) - -///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| #owned(str) extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) + +///| +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#|(func (param i32) local.get 0 call $moonbit.decref) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/quota/types/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/quota/types/top.mbt index 253cd16d3f..fa4a2277be 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/quota/types/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/quota/types/top.mbt @@ -1,5 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Error returned when a reservation cannot be satisfied because the /// resource's enforcement policy is `reject`. @@ -8,22 +7,19 @@ /// the caller would need to wait for capacity (only available for /// rate-limited resources). pub(all) struct FailedReservation { - estimated_wait_nanos : UInt64? + estimated_wait_nanos : UInt64? } derive(Show, Eq) - ///| /// A short-lived capability that represents a pending or committed /// resource consumption. Drop without committing is equivalent to /// committing zero usage. pub(all) struct Reservation(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Reservation::drop(self : Reservation) -> Unit { - let Reservation(resource) = self - wasmImportResourceDropReservation(resource) + let Reservation(resource) = self + wasmImportResourceDropReservation(resource) } - ///| /// Commit actual usage, consuming the reservation. /// @@ -31,63 +27,62 @@ pub fn Reservation::drop(self : Reservation) -> Unit { /// If `used` > reserved — the excess is deducted from the token's /// remaining allocation as "debt". pub fn Reservation::commit(this : Reservation, used : UInt64) -> Unit { - let Reservation(handle) = this - wasmImportStaticReservationCommit(handle, used.reinterpret_as_int64()) -} + let Reservation(handle) = this + wasmImportStaticReservationCommit(handle, (used).reinterpret_as_int64()); + +} ///| /// Request a quota capability for the given resource. /// - `resource-name` : the resource name (as declared in the manifest). /// - `expected-use` : expected units per reservation; used to derive /// credit rate and max-credit for fair scheduling. -pub fn new_token( - resource_name : String, - expected_use : UInt64, -) -> @types.QuotaToken { - let ptr = mbt_ffi_str2ptr(resource_name) - let result : Int = wasmImportNewToken( - ptr, - resource_name.length(), - expected_use.reinterpret_as_int64(), - ) - let ret = @types.QuotaToken::QuotaToken(result) - mbt_ffi_free(ptr) - return ret -} +pub fn new_token(resource_name : String, expected_use : UInt64) -> @types.QuotaToken { + + let ptr = mbt_ffi_str2ptr(resource_name) + let result : Int = wasmImportNewToken(ptr, resource_name.length(), (expected_use).reinterpret_as_int64()); + let ret = @types.QuotaToken::QuotaToken(result) + mbt_ffi_free(ptr) + return ret +} ///| /// Reserve `amount` units from the token's local allocation. /// /// Blocks internally until capacity is available or the resource's /// enforcement action fires. Returns a `reservation` handle that /// must be committed (or dropped) to release unused capacity. -pub fn reserve( - token : @types.QuotaToken, - amount : UInt64, -) -> Result[Reservation, FailedReservation] { - let @types.QuotaToken(handle) = token - let return_area = mbt_ffi_malloc(24) - wasmImportReserve(handle, amount.reinterpret_as_int64(), return_area) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(Reservation::Reservation(mbt_ffi_load32(return_area + 8))) - 1 => { - let lifted : UInt64? = match mbt_ffi_load8_u(return_area + 8) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load64(return_area + 16).reinterpret_as_uint64()) - _ => panic() +pub fn reserve(token : @types.QuotaToken, amount : UInt64) -> Result[Reservation, FailedReservation] { + + let @types.QuotaToken(handle) = token + let return_area = mbt_ffi_malloc(24) + wasmImportReserve(handle, (amount).reinterpret_as_int64(), return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(Reservation::Reservation(mbt_ffi_load32((return_area) + 8))) + } + 1 => { + + let lifted : UInt64? = match mbt_ffi_load8_u((return_area) + 8) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((return_area) + 16)).reinterpret_as_uint64()) + } + _ => panic() + } + + Result::Err(FailedReservation::{estimated_wait_nanos : lifted}) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(return_area) + return ret - Result::Err(FailedReservation::{ estimated_wait_nanos: lifted }) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(return_area) - return ret } - ///| /// Split off a child token with `child-expected-use` units from `token`. /// @@ -95,19 +90,14 @@ pub fn reserve( /// Credits are divided proportionally between parent and child. /// /// Traps if `child-expected-use` exceeds the parent's current `expected-use`. -pub fn split( - token : @types.QuotaToken, - child_expected_use : UInt64, -) -> @types.QuotaToken { - let @types.QuotaToken(handle) = token - let result : Int = wasmImportSplit( - handle, - child_expected_use.reinterpret_as_int64(), - ) - let ret = @types.QuotaToken::QuotaToken(result) - return ret -} +pub fn split(token : @types.QuotaToken, child_expected_use : UInt64) -> @types.QuotaToken { + let @types.QuotaToken(handle) = token + let result : Int = wasmImportSplit(handle, (child_expected_use).reinterpret_as_int64()); + let ret = @types.QuotaToken::QuotaToken(result) + return ret + +} ///| /// Merge `other` back into `token`. /// @@ -116,8 +106,11 @@ pub fn split( /// /// Traps if the tokens refer to different resources. pub fn merge(token : @types.QuotaToken, other : @types.QuotaToken) -> Unit { - let @types.QuotaToken(handle) = token - let @types.QuotaToken(handle0) = other - wasmImportMerge(handle, handle0) + let @types.QuotaToken(handle) = token + + let @types.QuotaToken(handle0) = other + wasmImportMerge(handle, handle0); + } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/rdbms/ignite2/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/rdbms/ignite2/ffi.mbt index 0403439e57..ab7faff5ff 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/rdbms/ignite2/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/rdbms/ignite2/ffi.mbt @@ -1,187 +1,131 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropDbResultStream(resource : Int) = "golem:rdbms/ignite2@1.5.0" "[resource-drop]db-result-stream" -///| fn wasmImportResourceDropDbTransaction(resource : Int) = "golem:rdbms/ignite2@1.5.0" "[resource-drop]db-transaction" -///| fn wasmImportResourceDropDbConnection(resource : Int) = "golem:rdbms/ignite2@1.5.0" "[resource-drop]db-connection" -///| -fn wasmImportMethodDbResultStreamGetColumns(p0 : Int, p1 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-result-stream.get-columns" +fn wasmImportMethodDbResultStreamGetColumns(p0 : Int, p1 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-result-stream.get-columns" -///| -fn wasmImportMethodDbResultStreamGetNext(p0 : Int, p1 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-result-stream.get-next" +fn wasmImportMethodDbResultStreamGetNext(p0 : Int, p1 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-result-stream.get-next" -///| -fn wasmImportMethodDbTransactionQuery( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/ignite2@1.5.0" "[method]db-transaction.query" +fn wasmImportMethodDbTransactionQuery(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-transaction.query" -///| -fn wasmImportMethodDbTransactionQueryStream( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/ignite2@1.5.0" "[method]db-transaction.query-stream" +fn wasmImportMethodDbTransactionQueryStream(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-transaction.query-stream" -///| -fn wasmImportMethodDbTransactionExecute( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/ignite2@1.5.0" "[method]db-transaction.execute" +fn wasmImportMethodDbTransactionExecute(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-transaction.execute" -///| -fn wasmImportMethodDbTransactionCommit(p0 : Int, p1 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-transaction.commit" +fn wasmImportMethodDbTransactionCommit(p0 : Int, p1 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-transaction.commit" -///| -fn wasmImportMethodDbTransactionRollback(p0 : Int, p1 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-transaction.rollback" +fn wasmImportMethodDbTransactionRollback(p0 : Int, p1 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-transaction.rollback" -///| -fn wasmImportStaticDbConnectionOpen(p0 : Int, p1 : Int, p2 : Int) = "golem:rdbms/ignite2@1.5.0" "[static]db-connection.open" +fn wasmImportStaticDbConnectionOpen(p0 : Int, p1 : Int, p2 : Int) = "golem:rdbms/ignite2@1.5.0" "[static]db-connection.open" -///| -fn wasmImportMethodDbConnectionQuery( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/ignite2@1.5.0" "[method]db-connection.query" +fn wasmImportMethodDbConnectionQuery(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-connection.query" -///| -fn wasmImportMethodDbConnectionQueryStream( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/ignite2@1.5.0" "[method]db-connection.query-stream" +fn wasmImportMethodDbConnectionQueryStream(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-connection.query-stream" -///| -fn wasmImportMethodDbConnectionExecute( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/ignite2@1.5.0" "[method]db-connection.execute" +fn wasmImportMethodDbConnectionExecute(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-connection.execute" -///| -fn wasmImportMethodDbConnectionBeginTransaction(p0 : Int, p1 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-connection.begin-transaction" +fn wasmImportMethodDbConnectionBeginTransaction(p0 : Int, p1 : Int) = "golem:rdbms/ignite2@1.5.0" "[method]db-connection.begin-transaction" ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = - #|(func (param i32) (result f32) local.get 0 f32.load) +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend8_s) +extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = +#|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = +#|(func (param i32) (result f64) local.get 0 f64.load) ///| -extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = - #|(func (param i32) (result f64) local.get 0 f64.load) +extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_s) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = +#|(func (param i32) (result f32) local.get 0 f32.load) ///| -extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_s) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| #owned(bytes) extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_s) ///| extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend16_s) ///| extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend8_s) ///| -extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = - #|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = - #|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) +#|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) ///| -extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_s) +extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_u) ///| -extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend16_s) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/rdbms/ignite2/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/rdbms/ignite2/top.mbt index bdd2e3fd24..e2daa85189 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/rdbms/ignite2/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/rdbms/ignite2/top.mbt @@ -1,1967 +1,1829 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// ── Error ────────────────────────────────────────────────────────────────── pub(all) suberror Error_ { - ConnectionFailure(String) - QueryParameterFailure(String) - QueryExecutionFailure(String) - QueryResponseFailure(String) - Other(String) + ConnectionFailure(String) + QueryParameterFailure(String) + QueryExecutionFailure(String) + QueryResponseFailure(String) + Other(String) } derive(Show, Eq) - ///| /// ── Value types (maps 1-to-1 onto ignite_client::IgniteValue) ───────────── pub(all) enum DbValue { - DbNull - DbBoolean(Bool) - DbByte(Int) - DbShort(Int) - DbInt(Int) - DbLong(Int64) - DbFloat(Float) - DbDouble(Double) - DbChar(UInt) - DbString(String) - DbUuid((UInt64, UInt64)) - DbDate(Int64) - DbTimestamp((Int64, Int)) - DbTime(Int64) - DbDecimal(String) - DbByteArray(FixedArray[Byte]) + DbNull + DbBoolean(Bool) + DbByte(Int) + DbShort(Int) + DbInt(Int) + DbLong(Int64) + DbFloat(Float) + DbDouble(Double) + DbChar(UInt) + DbString(String) + DbUuid((UInt64, UInt64)) + DbDate(Int64) + DbTimestamp((Int64, Int)) + DbTime(Int64) + DbDecimal(String) + DbByteArray(FixedArray[Byte]) } derive(Show, Eq) - ///| /// ── Metadata ─────────────────────────────────────────────────────────────── pub(all) struct DbColumn { - ordinal : UInt64 - name : String + ordinal : UInt64; name : String } derive(Show, Eq) - ///| pub(all) struct DbRow { - values : Array[DbValue] + values : Array[DbValue] } derive(Show, Eq) - ///| pub(all) struct DbResult { - columns : Array[DbColumn] - rows : Array[DbRow] + columns : Array[DbColumn]; rows : Array[DbRow] } derive(Show, Eq) - ///| /// ── Resources ────────────────────────────────────────────────────────────── pub(all) struct DbResultStream(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn DbResultStream::drop(self : DbResultStream) -> Unit { - let DbResultStream(resource) = self - wasmImportResourceDropDbResultStream(resource) + let DbResultStream(resource) = self + wasmImportResourceDropDbResultStream(resource) } - ///| pub(all) struct DbTransaction(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn DbTransaction::drop(self : DbTransaction) -> Unit { - let DbTransaction(resource) = self - wasmImportResourceDropDbTransaction(resource) + let DbTransaction(resource) = self + wasmImportResourceDropDbTransaction(resource) } - ///| pub(all) struct DbConnection(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn DbConnection::drop(self : DbConnection) -> Unit { - let DbConnection(resource) = self - wasmImportResourceDropDbConnection(resource) + let DbConnection(resource) = self + wasmImportResourceDropDbConnection(resource) } - ///| -pub fn DbResultStream::get_columns( - self : DbResultStream, -) -> Result[Array[DbColumn], Error_] { - let DbResultStream(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbResultStreamGetColumns(handle, return_area) - - let lifted5 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array : Array[DbColumn] = [] - for index = 0; index < mbt_ffi_load32(return_area + 8); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index * 16 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array.push(DbColumn::{ - ordinal: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - name: result, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Result::Ok(array) - } - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result0) - } - 1 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result1) - } - 2 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result2) - } - 3 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result3) - } - 4 => { - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result4) - } - _ => panic() - } +pub fn DbResultStream::get_columns(self : DbResultStream) -> Result[Array[DbColumn], Error_] { - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted5 - mbt_ffi_free(return_area) - return ret -} + let DbResultStream(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbResultStreamGetColumns(handle, return_area); -///| -pub fn DbResultStream::get_next( - self : DbResultStream, -) -> Result[Array[DbRow]?, Error_] { - let DbResultStream(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbResultStreamGetNext(handle, return_area) - - let lifted11 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let lifted4 : Array[DbRow]? = match mbt_ffi_load8_u(return_area + 4) { - 0 => Option::None - 1 => { - let array2 : Array[DbRow] = [] - for index3 = 0 - index3 < mbt_ffi_load32(return_area + 12) - index3 = index3 + 1 { - let iter_base = mbt_ffi_load32(return_area + 8) + index3 * 8 - - let array : Array[DbValue] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 4) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + index * 24 - - let lifted = match mbt_ffi_load8_u(iter_base + 0) { - 0 => DbValue::DbNull - 1 => DbValue::DbBoolean(mbt_ffi_load8_u(iter_base + 8) != 0) - 2 => DbValue::DbByte(mbt_ffi_load8(iter_base + 8)) - 3 => DbValue::DbShort(mbt_ffi_load16(iter_base + 8)) - 4 => DbValue::DbInt(mbt_ffi_load32(iter_base + 8)) - 5 => DbValue::DbLong(mbt_ffi_load64(iter_base + 8)) - 6 => DbValue::DbFloat(mbt_ffi_loadf32(iter_base + 8)) - 7 => DbValue::DbDouble(mbt_ffi_loadf64(iter_base + 8)) - 8 => - DbValue::DbChar( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 9 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::DbString(result) - } - 10 => - DbValue::DbUuid( - ( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - ), - ) - 11 => DbValue::DbDate(mbt_ffi_load64(iter_base + 8)) - 12 => - DbValue::DbTimestamp( - ( - mbt_ffi_load64(iter_base + 8), - mbt_ffi_load32(iter_base + 16), - ), - ) - 13 => DbValue::DbTime(mbt_ffi_load64(iter_base + 8)) - 14 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::DbDecimal(result0) - } - 15 => { - let result1 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::DbByteArray(result1) - } - _ => panic() - } - - array.push(lifted) + let lifted5 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let array : Array[DbColumn] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 8)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index * 16) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array.push(DbColumn::{ordinal : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), name : result}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) + + Result::Ok(array) } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + 1 => { - array2.push(DbRow::{ values: array }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 8)) + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - Option::Some(array2) - } - _ => panic() - } + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result0) + } + 1 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result1) + } + 2 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result2) + } + 3 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result3) + } + 4 => { - Result::Ok(lifted4) - } - 1 => { - let lifted10 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result5) - } - 1 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result6) - } - 2 => { - let result7 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result7) - } - 3 => { - let result8 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result8) - } - 4 => { - let result9 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result9) - } - _ => panic() + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result4) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted5 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted10) - } - _ => panic() - } - let ret = lifted11 - mbt_ffi_free(return_area) - return ret } - ///| -pub fn DbTransaction::query( - self : DbTransaction, - statement : String, - params : Array[DbValue], -) -> Result[DbResult, Error_] { - let cleanup_list : Array[Int] = [] +pub fn DbResultStream::get_next(self : DbResultStream) -> Result[Array[DbRow]?, Error_] { - let DbTransaction(handle) = self + let DbResultStream(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbResultStreamGetNext(handle, return_area); - let ptr = mbt_ffi_str2ptr(statement) + let lifted11 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - let address = mbt_ffi_malloc(params.length() * 24) - for index = 0; index < params.length(); index = index + 1 { - let iter_elem : DbValue = params[index] - let iter_base = address + index * 24 + let lifted4 : Array[DbRow]? = match mbt_ffi_load8_u((return_area) + 4) { + 0 => Option::None + 1 => { - match iter_elem { - DbNull => { - mbt_ffi_store8(iter_base + 0, 0) + let array2 : Array[DbRow] = []; + for index3 = 0; index3 < (mbt_ffi_load32((return_area) + 12)); index3 = index3 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 8)) + (index3 * 8) - () - } - DbBoolean(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, if payload0 { 1 } else { 0 }) + let array : Array[DbValue] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 4)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index * 24) - () - } - DbByte(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload1)) + let lifted = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - DbShort(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload2)) + DbValue::DbNull + } + 1 => { - () - } - DbInt(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 8, payload3) + DbValue::DbBoolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 2 => { - () - } - DbLong(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store64(iter_base + 8, payload4) + DbValue::DbByte((mbt_ffi_load8((iter_base) + 8))) + } + 3 => { - () - } - DbFloat(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_storef32(iter_base + 8, payload5) + DbValue::DbShort((mbt_ffi_load16((iter_base) + 8))) + } + 4 => { - () - } - DbDouble(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_storef64(iter_base + 8, payload6) + DbValue::DbInt(mbt_ffi_load32((iter_base) + 8)) + } + 5 => { - () - } - DbChar(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store16(iter_base + 8, payload7.reinterpret_as_int()) + DbValue::DbLong(mbt_ffi_load64((iter_base) + 8)) + } + 6 => { - () - } - DbString(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) + DbValue::DbFloat(mbt_ffi_loadf32((iter_base) + 8)) + } + 7 => { - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(iter_base + 12, payload8.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - cleanup_list.push(ptr9) + DbValue::DbDouble(mbt_ffi_loadf64((iter_base) + 8)) + } + 8 => { - () - } - DbUuid(payload10) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_store64(iter_base + 8, payload10.0.reinterpret_as_int64()) - mbt_ffi_store64(iter_base + 16, payload10.1.reinterpret_as_int64()) + DbValue::DbChar((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 9 => { - () - } - DbDate(payload11) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store64(iter_base + 8, payload11) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - DbTimestamp(payload12) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store64(iter_base + 8, payload12.0) - mbt_ffi_store32(iter_base + 16, payload12.1) + DbValue::DbString(result) + } + 10 => { - () - } - DbTime(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store64(iter_base + 8, payload13) + DbValue::DbUuid(((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64())) + } + 11 => { - () - } - DbDecimal(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) + DbValue::DbDate(mbt_ffi_load64((iter_base) + 8)) + } + 12 => { - let ptr15 = mbt_ffi_str2ptr(payload14) - mbt_ffi_store32(iter_base + 12, payload14.length()) - mbt_ffi_store32(iter_base + 8, ptr15) - cleanup_list.push(ptr15) + DbValue::DbTimestamp((mbt_ffi_load64((iter_base) + 8), mbt_ffi_load32((iter_base) + 16))) + } + 13 => { - () - } - DbByteArray(payload16) => { - mbt_ffi_store8(iter_base + 0, 15) + DbValue::DbTime(mbt_ffi_load64((iter_base) + 8)) + } + 14 => { - let ptr17 = mbt_ffi_bytes2ptr(payload16) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - mbt_ffi_store32(iter_base + 12, payload16.length()) - mbt_ffi_store32(iter_base + 8, ptr17) - cleanup_list.push(ptr17) + DbValue::DbDecimal(result0) + } + 15 => { - () - } - } - } - let return_area = mbt_ffi_malloc(20) - wasmImportMethodDbTransactionQuery( - handle, - ptr, - statement.length(), - address, - params.length(), - return_area, - ) - - let lifted32 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array : Array[DbColumn] = [] - for index18 = 0 - index18 < mbt_ffi_load32(return_area + 8) - index18 = index18 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index18 * 16 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array.push(DbColumn::{ - ordinal: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - name: result, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - let array24 : Array[DbRow] = [] - for index25 = 0 - index25 < mbt_ffi_load32(return_area + 16) - index25 = index25 + 1 { - let iter_base = mbt_ffi_load32(return_area + 12) + index25 * 8 - - let array22 : Array[DbValue] = [] - for index23 = 0 - index23 < mbt_ffi_load32(iter_base + 4) - index23 = index23 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + index23 * 24 - - let lifted = match mbt_ffi_load8_u(iter_base + 0) { - 0 => DbValue::DbNull - 1 => DbValue::DbBoolean(mbt_ffi_load8_u(iter_base + 8) != 0) - 2 => DbValue::DbByte(mbt_ffi_load8(iter_base + 8)) - 3 => DbValue::DbShort(mbt_ffi_load16(iter_base + 8)) - 4 => DbValue::DbInt(mbt_ffi_load32(iter_base + 8)) - 5 => DbValue::DbLong(mbt_ffi_load64(iter_base + 8)) - 6 => DbValue::DbFloat(mbt_ffi_loadf32(iter_base + 8)) - 7 => DbValue::DbDouble(mbt_ffi_loadf64(iter_base + 8)) - 8 => - DbValue::DbChar( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 9 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::DbString(result19) - } - 10 => - DbValue::DbUuid( - ( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - ), - ) - 11 => DbValue::DbDate(mbt_ffi_load64(iter_base + 8)) - 12 => - DbValue::DbTimestamp( - (mbt_ffi_load64(iter_base + 8), mbt_ffi_load32(iter_base + 16)), - ) - 13 => DbValue::DbTime(mbt_ffi_load64(iter_base + 8)) - 14 => { - let result20 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::DbDecimal(result20) + let result1 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::DbByteArray(result1) + } + _ => panic() + } + + array.push(lifted) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array2.push(DbRow::{values : array}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 8)) + + Option::Some(array2) + } + _ => panic() + } + + Result::Ok(lifted4) } - 15 => { - let result21 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 1 => { - DbValue::DbByteArray(result21) + let lifted10 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result5) + } + 1 => { + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result6) + } + 2 => { + + let result7 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result7) + } + 3 => { + + let result8 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result8) + } + 4 => { + + let result9 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result9) + } + _ => panic() + } + + Result::Err(lifted10) } _ => panic() - } + } + let ret = lifted11 + mbt_ffi_free(return_area) + return ret - array22.push(lifted) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) +} +///| +pub fn DbTransaction::query(self : DbTransaction, statement : String, params : Array[DbValue]) -> Result[DbResult, Error_] { + let cleanup_list : Array[Int] = [] + + let DbTransaction(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address = mbt_ffi_malloc((params).length() * 24); + for index = 0; index < (params).length(); index = index + 1 { + let iter_elem : DbValue = (params)[(index)] + let iter_base = address + (index * 24); + + match iter_elem { + DbNull => { + mbt_ffi_store8((iter_base) + 0, (0)) + + () + } + DbBoolean(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, (if payload0 { 1 } else { 0 })) + + () + } + DbByte(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload1)) + + () + } + DbShort(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload2)) + + () + } + DbInt(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 8, payload3) + + () + } + DbLong(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store64((iter_base) + 8, payload4) + + () + } + DbFloat(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_storef32((iter_base) + 8, payload5) + + () + } + DbDouble(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_storef64((iter_base) + 8, payload6) + + () + } + DbChar(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store16((iter_base) + 8, (payload7).reinterpret_as_int()) + + () + } + DbString(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((iter_base) + 12, payload8.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + cleanup_list.push(ptr9) + + () + } + DbUuid(payload10) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_store64((iter_base) + 8, ((payload10).0).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload10).1).reinterpret_as_int64()) + + () + } + DbDate(payload11) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store64((iter_base) + 8, payload11) + + () + } + DbTimestamp(payload12) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store64((iter_base) + 8, (payload12).0) + mbt_ffi_store32((iter_base) + 16, (payload12).1) + + () + } + DbTime(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store64((iter_base) + 8, payload13) + + () + } + DbDecimal(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let ptr15 = mbt_ffi_str2ptr(payload14) + mbt_ffi_store32((iter_base) + 12, payload14.length()) + mbt_ffi_store32((iter_base) + 8, ptr15) + cleanup_list.push(ptr15) + + () + } + DbByteArray(payload16) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let ptr17 = mbt_ffi_bytes2ptr(payload16) + + mbt_ffi_store32((iter_base) + 12, payload16.length()) + mbt_ffi_store32((iter_base) + 8, ptr17) + cleanup_list.push(ptr17) + + () + } + } - array24.push(DbRow::{ values: array22 }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 12)) - - Result::Ok(DbResult::{ columns: array, rows: array24 }) - } - 1 => { - let lifted31 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result26 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result26) - } - 1 => { - let result27 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result27) - } - 2 => { - let result28 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result28) - } - 3 => { - let result29 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result29) - } - 4 => { - let result30 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result30) - } - _ => panic() } + let return_area = mbt_ffi_malloc(20) + wasmImportMethodDbTransactionQuery(handle, ptr, statement.length(), address, (params).length(), return_area); - Result::Err(lifted31) - } - _ => panic() - } - let ret = lifted32 - mbt_ffi_free(ptr) - mbt_ffi_free(address) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let lifted32 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { -///| -pub fn DbTransaction::query_stream( - self : DbTransaction, - statement : String, - params : Array[DbValue], -) -> Result[DbResultStream, Error_] { - let cleanup_list : Array[Int] = [] + let array : Array[DbColumn] = []; + for index18 = 0; index18 < (mbt_ffi_load32((return_area) + 8)); index18 = index18 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index18 * 16) - let DbTransaction(handle) = self + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr = mbt_ffi_str2ptr(statement) + array.push(DbColumn::{ordinal : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), name : result}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) - let address = mbt_ffi_malloc(params.length() * 24) - for index = 0; index < params.length(); index = index + 1 { - let iter_elem : DbValue = params[index] - let iter_base = address + index * 24 + let array24 : Array[DbRow] = []; + for index25 = 0; index25 < (mbt_ffi_load32((return_area) + 16)); index25 = index25 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 12)) + (index25 * 8) - match iter_elem { - DbNull => { - mbt_ffi_store8(iter_base + 0, 0) + let array22 : Array[DbValue] = []; + for index23 = 0; index23 < (mbt_ffi_load32((iter_base) + 4)); index23 = index23 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index23 * 24) - () - } - DbBoolean(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, if payload0 { 1 } else { 0 }) + let lifted = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - DbByte(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload1)) + DbValue::DbNull + } + 1 => { - () - } - DbShort(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload2)) + DbValue::DbBoolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 2 => { - () - } - DbInt(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 8, payload3) + DbValue::DbByte((mbt_ffi_load8((iter_base) + 8))) + } + 3 => { - () - } - DbLong(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store64(iter_base + 8, payload4) + DbValue::DbShort((mbt_ffi_load16((iter_base) + 8))) + } + 4 => { - () - } - DbFloat(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_storef32(iter_base + 8, payload5) + DbValue::DbInt(mbt_ffi_load32((iter_base) + 8)) + } + 5 => { - () - } - DbDouble(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_storef64(iter_base + 8, payload6) + DbValue::DbLong(mbt_ffi_load64((iter_base) + 8)) + } + 6 => { - () - } - DbChar(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store16(iter_base + 8, payload7.reinterpret_as_int()) + DbValue::DbFloat(mbt_ffi_loadf32((iter_base) + 8)) + } + 7 => { - () - } - DbString(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) + DbValue::DbDouble(mbt_ffi_loadf64((iter_base) + 8)) + } + 8 => { - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(iter_base + 12, payload8.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - cleanup_list.push(ptr9) + DbValue::DbChar((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 9 => { - () - } - DbUuid(payload10) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_store64(iter_base + 8, payload10.0.reinterpret_as_int64()) - mbt_ffi_store64(iter_base + 16, payload10.1.reinterpret_as_int64()) + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - DbDate(payload11) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store64(iter_base + 8, payload11) + DbValue::DbString(result19) + } + 10 => { - () - } - DbTimestamp(payload12) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store64(iter_base + 8, payload12.0) - mbt_ffi_store32(iter_base + 16, payload12.1) + DbValue::DbUuid(((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64())) + } + 11 => { - () - } - DbTime(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store64(iter_base + 8, payload13) + DbValue::DbDate(mbt_ffi_load64((iter_base) + 8)) + } + 12 => { - () - } - DbDecimal(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) + DbValue::DbTimestamp((mbt_ffi_load64((iter_base) + 8), mbt_ffi_load32((iter_base) + 16))) + } + 13 => { - let ptr15 = mbt_ffi_str2ptr(payload14) - mbt_ffi_store32(iter_base + 12, payload14.length()) - mbt_ffi_store32(iter_base + 8, ptr15) - cleanup_list.push(ptr15) + DbValue::DbTime(mbt_ffi_load64((iter_base) + 8)) + } + 14 => { - () - } - DbByteArray(payload16) => { - mbt_ffi_store8(iter_base + 0, 15) + let result20 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr17 = mbt_ffi_bytes2ptr(payload16) + DbValue::DbDecimal(result20) + } + 15 => { - mbt_ffi_store32(iter_base + 12, payload16.length()) - mbt_ffi_store32(iter_base + 8, ptr17) - cleanup_list.push(ptr17) + let result21 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } - } - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbTransactionQueryStream( - handle, - ptr, - statement.length(), - address, - params.length(), - return_area, - ) - - let lifted22 = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok( - DbResultStream::DbResultStream(mbt_ffi_load32(return_area + 4)), - ) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result18) - } - 2 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result19) - } - 3 => { - let result20 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result20) - } - 4 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result21) - } - _ => panic() - } + DbValue::DbByteArray(result21) + } + _ => panic() + } - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted22 - mbt_ffi_free(ptr) - mbt_ffi_free(address) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + array22.push(lifted) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) -///| -pub fn DbTransaction::execute( - self : DbTransaction, - statement : String, - params : Array[DbValue], -) -> Result[Int64, Error_] { - let cleanup_list : Array[Int] = [] + array24.push(DbRow::{values : array22}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 12)) - let DbTransaction(handle) = self + Result::Ok(DbResult::{columns : array, rows : array24}) + } + 1 => { - let ptr = mbt_ffi_str2ptr(statement) + let lifted31 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - let address = mbt_ffi_malloc(params.length() * 24) - for index = 0; index < params.length(); index = index + 1 { - let iter_elem : DbValue = params[index] - let iter_base = address + index * 24 + let result26 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - match iter_elem { - DbNull => { - mbt_ffi_store8(iter_base + 0, 0) + Error_::ConnectionFailure(result26) + } + 1 => { - () - } - DbBoolean(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, if payload0 { 1 } else { 0 }) + let result27 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbByte(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload1)) + Error_::QueryParameterFailure(result27) + } + 2 => { - () - } - DbShort(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload2)) + let result28 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbInt(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 8, payload3) + Error_::QueryExecutionFailure(result28) + } + 3 => { - () - } - DbLong(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store64(iter_base + 8, payload4) + let result29 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbFloat(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_storef32(iter_base + 8, payload5) + Error_::QueryResponseFailure(result29) + } + 4 => { - () - } - DbDouble(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_storef64(iter_base + 8, payload6) + let result30 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbChar(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store16(iter_base + 8, payload7.reinterpret_as_int()) + Error_::Other(result30) + } + _ => panic() + } - () + Result::Err(lifted31) + } + _ => panic() } - DbString(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) + let ret = lifted32 + mbt_ffi_free(ptr) + mbt_ffi_free(address) + mbt_ffi_free(return_area) - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(iter_base + 12, payload8.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - cleanup_list.push(ptr9) + cleanup_list.each(mbt_ffi_free) + return ret - () - } - DbUuid(payload10) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_store64(iter_base + 8, payload10.0.reinterpret_as_int64()) - mbt_ffi_store64(iter_base + 16, payload10.1.reinterpret_as_int64()) +} +///| +pub fn DbTransaction::query_stream(self : DbTransaction, statement : String, params : Array[DbValue]) -> Result[DbResultStream, Error_] { + let cleanup_list : Array[Int] = [] + + let DbTransaction(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address = mbt_ffi_malloc((params).length() * 24); + for index = 0; index < (params).length(); index = index + 1 { + let iter_elem : DbValue = (params)[(index)] + let iter_base = address + (index * 24); + + match iter_elem { + DbNull => { + mbt_ffi_store8((iter_base) + 0, (0)) + + () + } + DbBoolean(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, (if payload0 { 1 } else { 0 })) + + () + } + DbByte(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload1)) + + () + } + DbShort(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload2)) + + () + } + DbInt(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 8, payload3) + + () + } + DbLong(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store64((iter_base) + 8, payload4) + + () + } + DbFloat(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_storef32((iter_base) + 8, payload5) + + () + } + DbDouble(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_storef64((iter_base) + 8, payload6) + + () + } + DbChar(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store16((iter_base) + 8, (payload7).reinterpret_as_int()) + + () + } + DbString(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((iter_base) + 12, payload8.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + cleanup_list.push(ptr9) + + () + } + DbUuid(payload10) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_store64((iter_base) + 8, ((payload10).0).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload10).1).reinterpret_as_int64()) + + () + } + DbDate(payload11) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store64((iter_base) + 8, payload11) + + () + } + DbTimestamp(payload12) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store64((iter_base) + 8, (payload12).0) + mbt_ffi_store32((iter_base) + 16, (payload12).1) + + () + } + DbTime(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store64((iter_base) + 8, payload13) + + () + } + DbDecimal(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let ptr15 = mbt_ffi_str2ptr(payload14) + mbt_ffi_store32((iter_base) + 12, payload14.length()) + mbt_ffi_store32((iter_base) + 8, ptr15) + cleanup_list.push(ptr15) + + () + } + DbByteArray(payload16) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let ptr17 = mbt_ffi_bytes2ptr(payload16) + + mbt_ffi_store32((iter_base) + 12, payload16.length()) + mbt_ffi_store32((iter_base) + 8, ptr17) + cleanup_list.push(ptr17) + + () + } + } - () } - DbDate(payload11) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store64(iter_base + 8, payload11) + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbTransactionQueryStream(handle, ptr, statement.length(), address, (params).length(), return_area); - () - } - DbTimestamp(payload12) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store64(iter_base + 8, payload12.0) - mbt_ffi_store32(iter_base + 16, payload12.1) + let lifted22 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - () - } - DbTime(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store64(iter_base + 8, payload13) + Result::Ok(DbResultStream::DbResultStream(mbt_ffi_load32((return_area) + 4))) + } + 1 => { - () - } - DbDecimal(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result18) + } + 2 => { + + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result19) + } + 3 => { + + let result20 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result20) + } + 4 => { - let ptr15 = mbt_ffi_str2ptr(payload14) - mbt_ffi_store32(iter_base + 12, payload14.length()) - mbt_ffi_store32(iter_base + 8, ptr15) - cleanup_list.push(ptr15) + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () + Error_::Other(result21) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } - DbByteArray(payload16) => { - mbt_ffi_store8(iter_base + 0, 15) + let ret = lifted22 + mbt_ffi_free(ptr) + mbt_ffi_free(address) + mbt_ffi_free(return_area) - let ptr17 = mbt_ffi_bytes2ptr(payload16) + cleanup_list.each(mbt_ffi_free) + return ret - mbt_ffi_store32(iter_base + 12, payload16.length()) - mbt_ffi_store32(iter_base + 8, ptr17) - cleanup_list.push(ptr17) +} +///| +pub fn DbTransaction::execute(self : DbTransaction, statement : String, params : Array[DbValue]) -> Result[Int64, Error_] { + let cleanup_list : Array[Int] = [] + + let DbTransaction(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address = mbt_ffi_malloc((params).length() * 24); + for index = 0; index < (params).length(); index = index + 1 { + let iter_elem : DbValue = (params)[(index)] + let iter_base = address + (index * 24); + + match iter_elem { + DbNull => { + mbt_ffi_store8((iter_base) + 0, (0)) + + () + } + DbBoolean(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, (if payload0 { 1 } else { 0 })) + + () + } + DbByte(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload1)) + + () + } + DbShort(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload2)) + + () + } + DbInt(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 8, payload3) + + () + } + DbLong(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store64((iter_base) + 8, payload4) + + () + } + DbFloat(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_storef32((iter_base) + 8, payload5) + + () + } + DbDouble(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_storef64((iter_base) + 8, payload6) + + () + } + DbChar(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store16((iter_base) + 8, (payload7).reinterpret_as_int()) + + () + } + DbString(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((iter_base) + 12, payload8.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + cleanup_list.push(ptr9) + + () + } + DbUuid(payload10) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_store64((iter_base) + 8, ((payload10).0).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload10).1).reinterpret_as_int64()) + + () + } + DbDate(payload11) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store64((iter_base) + 8, payload11) + + () + } + DbTimestamp(payload12) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store64((iter_base) + 8, (payload12).0) + mbt_ffi_store32((iter_base) + 16, (payload12).1) + + () + } + DbTime(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store64((iter_base) + 8, payload13) + + () + } + DbDecimal(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let ptr15 = mbt_ffi_str2ptr(payload14) + mbt_ffi_store32((iter_base) + 12, payload14.length()) + mbt_ffi_store32((iter_base) + 8, ptr15) + cleanup_list.push(ptr15) + + () + } + DbByteArray(payload16) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let ptr17 = mbt_ffi_bytes2ptr(payload16) + + mbt_ffi_store32((iter_base) + 12, payload16.length()) + mbt_ffi_store32((iter_base) + 8, ptr17) + cleanup_list.push(ptr17) + + () + } + } - () } - } - } - let return_area = mbt_ffi_malloc(24) - wasmImportMethodDbTransactionExecute( - handle, - ptr, - statement.length(), - address, - params.length(), - return_area, - ) - - let lifted22 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load64(return_area + 8)) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 8) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryParameterFailure(result18) - } - 2 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryExecutionFailure(result19) - } - 3 => { - let result20 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryResponseFailure(result20) - } - 4 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::Other(result21) - } - _ => panic() + let return_area = mbt_ffi_malloc(24) + wasmImportMethodDbTransactionExecute(handle, ptr, statement.length(), address, (params).length(), return_area); + + let lifted22 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(mbt_ffi_load64((return_area) + 8)) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::QueryParameterFailure(result18) + } + 2 => { + + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::QueryExecutionFailure(result19) + } + 3 => { + + let result20 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::QueryResponseFailure(result20) + } + 4 => { + + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::Other(result21) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted22 + mbt_ffi_free(ptr) + mbt_ffi_free(address) + mbt_ffi_free(return_area) - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted22 - mbt_ffi_free(ptr) - mbt_ffi_free(address) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + cleanup_list.each(mbt_ffi_free) + return ret +} ///| pub fn DbTransaction::commit(self : DbTransaction) -> Result[Unit, Error_] { - let DbTransaction(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbTransactionCommit(handle, return_area) - - let lifted4 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result0) - } - 2 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result1) - } - 3 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result2) - } - 4 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result3) - } - _ => panic() + + let DbTransaction(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbTransactionCommit(handle, return_area); + + let lifted4 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result0) + } + 2 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result1) + } + 3 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result2) + } + 4 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result3) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted4 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted4 - mbt_ffi_free(return_area) - return ret } - ///| pub fn DbTransaction::rollback(self : DbTransaction) -> Result[Unit, Error_] { - let DbTransaction(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbTransactionRollback(handle, return_area) - - let lifted4 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result0) - } - 2 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result1) - } - 3 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result2) - } - 4 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result3) - } - _ => panic() + + let DbTransaction(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbTransactionRollback(handle, return_area); + + let lifted4 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result0) + } + 2 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result1) + } + 3 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result2) + } + 4 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result3) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted4 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted4 - mbt_ffi_free(return_area) - return ret } - ///| /// Open a connection to an Apache Ignite 2.x node. /// /// Address format: `ignite://[user:pass@]host:port[?pool_size=N&tls=true]` /// Default port: 10800. pub fn DbConnection::open(address : String) -> Result[DbConnection, Error_] { - let ptr = mbt_ffi_str2ptr(address) - let return_area = mbt_ffi_malloc(16) - wasmImportStaticDbConnectionOpen(ptr, address.length(), return_area) - - let lifted4 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(DbConnection::DbConnection(mbt_ffi_load32(return_area + 4))) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result0) - } - 2 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result1) - } - 3 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result2) - } - 4 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result3) - } - _ => panic() - } - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted4 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + let ptr = mbt_ffi_str2ptr(address) + let return_area = mbt_ffi_malloc(16) + wasmImportStaticDbConnectionOpen(ptr, address.length(), return_area); -///| -pub fn DbConnection::query( - self : DbConnection, - statement : String, - params : Array[DbValue], -) -> Result[DbResult, Error_] { - let cleanup_list : Array[Int] = [] + let lifted4 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - let DbConnection(handle) = self + Result::Ok(DbConnection::DbConnection(mbt_ffi_load32((return_area) + 4))) + } + 1 => { - let ptr = mbt_ffi_str2ptr(statement) + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - let address = mbt_ffi_malloc(params.length() * 24) - for index = 0; index < params.length(); index = index + 1 { - let iter_elem : DbValue = params[index] - let iter_base = address + index * 24 + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - match iter_elem { - DbNull => { - mbt_ffi_store8(iter_base + 0, 0) + Error_::ConnectionFailure(result) + } + 1 => { - () - } - DbBoolean(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, if payload0 { 1 } else { 0 }) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbByte(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload1)) + Error_::QueryParameterFailure(result0) + } + 2 => { - () - } - DbShort(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload2)) + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbInt(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 8, payload3) + Error_::QueryExecutionFailure(result1) + } + 3 => { - () - } - DbLong(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store64(iter_base + 8, payload4) + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbFloat(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_storef32(iter_base + 8, payload5) + Error_::QueryResponseFailure(result2) + } + 4 => { - () - } - DbDouble(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_storef64(iter_base + 8, payload6) + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbChar(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store16(iter_base + 8, payload7.reinterpret_as_int()) + Error_::Other(result3) + } + _ => panic() + } - () + Result::Err(lifted) + } + _ => panic() } - DbString(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) + let ret = lifted4 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(iter_base + 12, payload8.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - cleanup_list.push(ptr9) +} +///| +pub fn DbConnection::query(self : DbConnection, statement : String, params : Array[DbValue]) -> Result[DbResult, Error_] { + let cleanup_list : Array[Int] = [] + + let DbConnection(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address = mbt_ffi_malloc((params).length() * 24); + for index = 0; index < (params).length(); index = index + 1 { + let iter_elem : DbValue = (params)[(index)] + let iter_base = address + (index * 24); + + match iter_elem { + DbNull => { + mbt_ffi_store8((iter_base) + 0, (0)) + + () + } + DbBoolean(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, (if payload0 { 1 } else { 0 })) + + () + } + DbByte(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload1)) + + () + } + DbShort(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload2)) + + () + } + DbInt(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 8, payload3) + + () + } + DbLong(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store64((iter_base) + 8, payload4) + + () + } + DbFloat(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_storef32((iter_base) + 8, payload5) + + () + } + DbDouble(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_storef64((iter_base) + 8, payload6) + + () + } + DbChar(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store16((iter_base) + 8, (payload7).reinterpret_as_int()) + + () + } + DbString(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((iter_base) + 12, payload8.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + cleanup_list.push(ptr9) + + () + } + DbUuid(payload10) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_store64((iter_base) + 8, ((payload10).0).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload10).1).reinterpret_as_int64()) + + () + } + DbDate(payload11) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store64((iter_base) + 8, payload11) + + () + } + DbTimestamp(payload12) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store64((iter_base) + 8, (payload12).0) + mbt_ffi_store32((iter_base) + 16, (payload12).1) + + () + } + DbTime(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store64((iter_base) + 8, payload13) + + () + } + DbDecimal(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let ptr15 = mbt_ffi_str2ptr(payload14) + mbt_ffi_store32((iter_base) + 12, payload14.length()) + mbt_ffi_store32((iter_base) + 8, ptr15) + cleanup_list.push(ptr15) + + () + } + DbByteArray(payload16) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let ptr17 = mbt_ffi_bytes2ptr(payload16) + + mbt_ffi_store32((iter_base) + 12, payload16.length()) + mbt_ffi_store32((iter_base) + 8, ptr17) + cleanup_list.push(ptr17) + + () + } + } - () } - DbUuid(payload10) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_store64(iter_base + 8, payload10.0.reinterpret_as_int64()) - mbt_ffi_store64(iter_base + 16, payload10.1.reinterpret_as_int64()) + let return_area = mbt_ffi_malloc(20) + wasmImportMethodDbConnectionQuery(handle, ptr, statement.length(), address, (params).length(), return_area); - () - } - DbDate(payload11) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store64(iter_base + 8, payload11) + let lifted32 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - () - } - DbTimestamp(payload12) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store64(iter_base + 8, payload12.0) - mbt_ffi_store32(iter_base + 16, payload12.1) + let array : Array[DbColumn] = []; + for index18 = 0; index18 < (mbt_ffi_load32((return_area) + 8)); index18 = index18 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index18 * 16) - () - } - DbTime(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store64(iter_base + 8, payload13) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - DbDecimal(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) + array.push(DbColumn::{ordinal : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), name : result}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) - let ptr15 = mbt_ffi_str2ptr(payload14) - mbt_ffi_store32(iter_base + 12, payload14.length()) - mbt_ffi_store32(iter_base + 8, ptr15) - cleanup_list.push(ptr15) + let array24 : Array[DbRow] = []; + for index25 = 0; index25 < (mbt_ffi_load32((return_area) + 16)); index25 = index25 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 12)) + (index25 * 8) - () - } - DbByteArray(payload16) => { - mbt_ffi_store8(iter_base + 0, 15) + let array22 : Array[DbValue] = []; + for index23 = 0; index23 < (mbt_ffi_load32((iter_base) + 4)); index23 = index23 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index23 * 24) - let ptr17 = mbt_ffi_bytes2ptr(payload16) + let lifted = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - mbt_ffi_store32(iter_base + 12, payload16.length()) - mbt_ffi_store32(iter_base + 8, ptr17) - cleanup_list.push(ptr17) + DbValue::DbNull + } + 1 => { - () - } - } - } - let return_area = mbt_ffi_malloc(20) - wasmImportMethodDbConnectionQuery( - handle, - ptr, - statement.length(), - address, - params.length(), - return_area, - ) - - let lifted32 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array : Array[DbColumn] = [] - for index18 = 0 - index18 < mbt_ffi_load32(return_area + 8) - index18 = index18 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index18 * 16 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array.push(DbColumn::{ - ordinal: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - name: result, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - let array24 : Array[DbRow] = [] - for index25 = 0 - index25 < mbt_ffi_load32(return_area + 16) - index25 = index25 + 1 { - let iter_base = mbt_ffi_load32(return_area + 12) + index25 * 8 - - let array22 : Array[DbValue] = [] - for index23 = 0 - index23 < mbt_ffi_load32(iter_base + 4) - index23 = index23 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + index23 * 24 - - let lifted = match mbt_ffi_load8_u(iter_base + 0) { - 0 => DbValue::DbNull - 1 => DbValue::DbBoolean(mbt_ffi_load8_u(iter_base + 8) != 0) - 2 => DbValue::DbByte(mbt_ffi_load8(iter_base + 8)) - 3 => DbValue::DbShort(mbt_ffi_load16(iter_base + 8)) - 4 => DbValue::DbInt(mbt_ffi_load32(iter_base + 8)) - 5 => DbValue::DbLong(mbt_ffi_load64(iter_base + 8)) - 6 => DbValue::DbFloat(mbt_ffi_loadf32(iter_base + 8)) - 7 => DbValue::DbDouble(mbt_ffi_loadf64(iter_base + 8)) - 8 => - DbValue::DbChar( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 9 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::DbString(result19) - } - 10 => - DbValue::DbUuid( - ( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - ), - ) - 11 => DbValue::DbDate(mbt_ffi_load64(iter_base + 8)) - 12 => - DbValue::DbTimestamp( - (mbt_ffi_load64(iter_base + 8), mbt_ffi_load32(iter_base + 16)), - ) - 13 => DbValue::DbTime(mbt_ffi_load64(iter_base + 8)) - 14 => { - let result20 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::DbDecimal(result20) - } - 15 => { - let result21 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbValue::DbBoolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 2 => { - DbValue::DbByteArray(result21) - } - _ => panic() - } + DbValue::DbByte((mbt_ffi_load8((iter_base) + 8))) + } + 3 => { - array22.push(lifted) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + DbValue::DbShort((mbt_ffi_load16((iter_base) + 8))) + } + 4 => { - array24.push(DbRow::{ values: array22 }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 12)) - - Result::Ok(DbResult::{ columns: array, rows: array24 }) - } - 1 => { - let lifted31 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result26 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result26) - } - 1 => { - let result27 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result27) - } - 2 => { - let result28 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result28) - } - 3 => { - let result29 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result29) - } - 4 => { - let result30 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result30) - } - _ => panic() - } + DbValue::DbInt(mbt_ffi_load32((iter_base) + 8)) + } + 5 => { - Result::Err(lifted31) - } - _ => panic() - } - let ret = lifted32 - mbt_ffi_free(ptr) - mbt_ffi_free(address) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + DbValue::DbLong(mbt_ffi_load64((iter_base) + 8)) + } + 6 => { -///| -pub fn DbConnection::query_stream( - self : DbConnection, - statement : String, - params : Array[DbValue], -) -> Result[DbResultStream, Error_] { - let cleanup_list : Array[Int] = [] + DbValue::DbFloat(mbt_ffi_loadf32((iter_base) + 8)) + } + 7 => { - let DbConnection(handle) = self + DbValue::DbDouble(mbt_ffi_loadf64((iter_base) + 8)) + } + 8 => { - let ptr = mbt_ffi_str2ptr(statement) + DbValue::DbChar((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 9 => { - let address = mbt_ffi_malloc(params.length() * 24) - for index = 0; index < params.length(); index = index + 1 { - let iter_elem : DbValue = params[index] - let iter_base = address + index * 24 + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match iter_elem { - DbNull => { - mbt_ffi_store8(iter_base + 0, 0) + DbValue::DbString(result19) + } + 10 => { - () - } - DbBoolean(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, if payload0 { 1 } else { 0 }) + DbValue::DbUuid(((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64())) + } + 11 => { - () - } - DbByte(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload1)) + DbValue::DbDate(mbt_ffi_load64((iter_base) + 8)) + } + 12 => { - () - } - DbShort(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload2)) + DbValue::DbTimestamp((mbt_ffi_load64((iter_base) + 8), mbt_ffi_load32((iter_base) + 16))) + } + 13 => { - () - } - DbInt(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 8, payload3) + DbValue::DbTime(mbt_ffi_load64((iter_base) + 8)) + } + 14 => { - () - } - DbLong(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store64(iter_base + 8, payload4) + let result20 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - DbFloat(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_storef32(iter_base + 8, payload5) + DbValue::DbDecimal(result20) + } + 15 => { - () - } - DbDouble(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_storef64(iter_base + 8, payload6) + let result21 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - DbChar(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store16(iter_base + 8, payload7.reinterpret_as_int()) + DbValue::DbByteArray(result21) + } + _ => panic() + } - () - } - DbString(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) + array22.push(lifted) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(iter_base + 12, payload8.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - cleanup_list.push(ptr9) + array24.push(DbRow::{values : array22}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 12)) - () - } - DbUuid(payload10) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_store64(iter_base + 8, payload10.0.reinterpret_as_int64()) - mbt_ffi_store64(iter_base + 16, payload10.1.reinterpret_as_int64()) + Result::Ok(DbResult::{columns : array, rows : array24}) + } + 1 => { - () - } - DbDate(payload11) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store64(iter_base + 8, payload11) + let lifted31 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - () - } - DbTimestamp(payload12) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store64(iter_base + 8, payload12.0) - mbt_ffi_store32(iter_base + 16, payload12.1) + let result26 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbTime(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store64(iter_base + 8, payload13) + Error_::ConnectionFailure(result26) + } + 1 => { - () - } - DbDecimal(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) + let result27 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr15 = mbt_ffi_str2ptr(payload14) - mbt_ffi_store32(iter_base + 12, payload14.length()) - mbt_ffi_store32(iter_base + 8, ptr15) - cleanup_list.push(ptr15) + Error_::QueryParameterFailure(result27) + } + 2 => { - () - } - DbByteArray(payload16) => { - mbt_ffi_store8(iter_base + 0, 15) + let result28 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr17 = mbt_ffi_bytes2ptr(payload16) + Error_::QueryExecutionFailure(result28) + } + 3 => { - mbt_ffi_store32(iter_base + 12, payload16.length()) - mbt_ffi_store32(iter_base + 8, ptr17) - cleanup_list.push(ptr17) + let result29 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - } - } - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbConnectionQueryStream( - handle, - ptr, - statement.length(), - address, - params.length(), - return_area, - ) - - let lifted22 = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok( - DbResultStream::DbResultStream(mbt_ffi_load32(return_area + 4)), - ) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result18) - } - 2 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result19) - } - 3 => { - let result20 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result20) - } - 4 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result21) - } - _ => panic() + Error_::QueryResponseFailure(result29) + } + 4 => { + + let result30 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result30) + } + _ => panic() + } + + Result::Err(lifted31) + } + _ => panic() } + let ret = lifted32 + mbt_ffi_free(ptr) + mbt_ffi_free(address) + mbt_ffi_free(return_area) - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted22 - mbt_ffi_free(ptr) - mbt_ffi_free(address) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + cleanup_list.each(mbt_ffi_free) + return ret +} ///| -pub fn DbConnection::execute( - self : DbConnection, - statement : String, - params : Array[DbValue], -) -> Result[Int64, Error_] { - let cleanup_list : Array[Int] = [] +pub fn DbConnection::query_stream(self : DbConnection, statement : String, params : Array[DbValue]) -> Result[DbResultStream, Error_] { + let cleanup_list : Array[Int] = [] + + let DbConnection(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address = mbt_ffi_malloc((params).length() * 24); + for index = 0; index < (params).length(); index = index + 1 { + let iter_elem : DbValue = (params)[(index)] + let iter_base = address + (index * 24); + + match iter_elem { + DbNull => { + mbt_ffi_store8((iter_base) + 0, (0)) + + () + } + DbBoolean(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, (if payload0 { 1 } else { 0 })) + + () + } + DbByte(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload1)) + + () + } + DbShort(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload2)) + + () + } + DbInt(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 8, payload3) + + () + } + DbLong(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store64((iter_base) + 8, payload4) + + () + } + DbFloat(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_storef32((iter_base) + 8, payload5) + + () + } + DbDouble(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_storef64((iter_base) + 8, payload6) + + () + } + DbChar(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store16((iter_base) + 8, (payload7).reinterpret_as_int()) + + () + } + DbString(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((iter_base) + 12, payload8.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + cleanup_list.push(ptr9) + + () + } + DbUuid(payload10) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_store64((iter_base) + 8, ((payload10).0).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload10).1).reinterpret_as_int64()) + + () + } + DbDate(payload11) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store64((iter_base) + 8, payload11) + + () + } + DbTimestamp(payload12) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store64((iter_base) + 8, (payload12).0) + mbt_ffi_store32((iter_base) + 16, (payload12).1) + + () + } + DbTime(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store64((iter_base) + 8, payload13) + + () + } + DbDecimal(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let ptr15 = mbt_ffi_str2ptr(payload14) + mbt_ffi_store32((iter_base) + 12, payload14.length()) + mbt_ffi_store32((iter_base) + 8, ptr15) + cleanup_list.push(ptr15) + + () + } + DbByteArray(payload16) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let ptr17 = mbt_ffi_bytes2ptr(payload16) + + mbt_ffi_store32((iter_base) + 12, payload16.length()) + mbt_ffi_store32((iter_base) + 8, ptr17) + cleanup_list.push(ptr17) + + () + } + } - let DbConnection(handle) = self + } + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbConnectionQueryStream(handle, ptr, statement.length(), address, (params).length(), return_area); - let ptr = mbt_ffi_str2ptr(statement) + let lifted22 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - let address = mbt_ffi_malloc(params.length() * 24) - for index = 0; index < params.length(); index = index + 1 { - let iter_elem : DbValue = params[index] - let iter_base = address + index * 24 + Result::Ok(DbResultStream::DbResultStream(mbt_ffi_load32((return_area) + 4))) + } + 1 => { - match iter_elem { - DbNull => { - mbt_ffi_store8(iter_base + 0, 0) + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - () - } - DbBoolean(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, if payload0 { 1 } else { 0 }) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbByte(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload1)) + Error_::ConnectionFailure(result) + } + 1 => { - () - } - DbShort(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload2)) + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbInt(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 8, payload3) + Error_::QueryParameterFailure(result18) + } + 2 => { - () - } - DbLong(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store64(iter_base + 8, payload4) + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbFloat(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_storef32(iter_base + 8, payload5) + Error_::QueryExecutionFailure(result19) + } + 3 => { - () - } - DbDouble(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_storef64(iter_base + 8, payload6) + let result20 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - DbChar(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store16(iter_base + 8, payload7.reinterpret_as_int()) + Error_::QueryResponseFailure(result20) + } + 4 => { - () - } - DbString(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(iter_base + 12, payload8.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - cleanup_list.push(ptr9) + Error_::Other(result21) + } + _ => panic() + } - () + Result::Err(lifted) + } + _ => panic() } - DbUuid(payload10) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_store64(iter_base + 8, payload10.0.reinterpret_as_int64()) - mbt_ffi_store64(iter_base + 16, payload10.1.reinterpret_as_int64()) + let ret = lifted22 + mbt_ffi_free(ptr) + mbt_ffi_free(address) + mbt_ffi_free(return_area) - () - } - DbDate(payload11) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store64(iter_base + 8, payload11) + cleanup_list.each(mbt_ffi_free) + return ret - () - } - DbTimestamp(payload12) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store64(iter_base + 8, payload12.0) - mbt_ffi_store32(iter_base + 16, payload12.1) +} +///| +pub fn DbConnection::execute(self : DbConnection, statement : String, params : Array[DbValue]) -> Result[Int64, Error_] { + let cleanup_list : Array[Int] = [] + + let DbConnection(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address = mbt_ffi_malloc((params).length() * 24); + for index = 0; index < (params).length(); index = index + 1 { + let iter_elem : DbValue = (params)[(index)] + let iter_base = address + (index * 24); + + match iter_elem { + DbNull => { + mbt_ffi_store8((iter_base) + 0, (0)) + + () + } + DbBoolean(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, (if payload0 { 1 } else { 0 })) + + () + } + DbByte(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload1)) + + () + } + DbShort(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload2)) + + () + } + DbInt(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 8, payload3) + + () + } + DbLong(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store64((iter_base) + 8, payload4) + + () + } + DbFloat(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_storef32((iter_base) + 8, payload5) + + () + } + DbDouble(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_storef64((iter_base) + 8, payload6) + + () + } + DbChar(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store16((iter_base) + 8, (payload7).reinterpret_as_int()) + + () + } + DbString(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((iter_base) + 12, payload8.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + cleanup_list.push(ptr9) + + () + } + DbUuid(payload10) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_store64((iter_base) + 8, ((payload10).0).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload10).1).reinterpret_as_int64()) + + () + } + DbDate(payload11) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store64((iter_base) + 8, payload11) + + () + } + DbTimestamp(payload12) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store64((iter_base) + 8, (payload12).0) + mbt_ffi_store32((iter_base) + 16, (payload12).1) + + () + } + DbTime(payload13) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store64((iter_base) + 8, payload13) + + () + } + DbDecimal(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let ptr15 = mbt_ffi_str2ptr(payload14) + mbt_ffi_store32((iter_base) + 12, payload14.length()) + mbt_ffi_store32((iter_base) + 8, ptr15) + cleanup_list.push(ptr15) + + () + } + DbByteArray(payload16) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let ptr17 = mbt_ffi_bytes2ptr(payload16) + + mbt_ffi_store32((iter_base) + 12, payload16.length()) + mbt_ffi_store32((iter_base) + 8, ptr17) + cleanup_list.push(ptr17) + + () + } + } - () } - DbTime(payload13) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store64(iter_base + 8, payload13) + let return_area = mbt_ffi_malloc(24) + wasmImportMethodDbConnectionExecute(handle, ptr, statement.length(), address, (params).length(), return_area); - () - } - DbDecimal(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) + let lifted22 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - let ptr15 = mbt_ffi_str2ptr(payload14) - mbt_ffi_store32(iter_base + 12, payload14.length()) - mbt_ffi_store32(iter_base + 8, ptr15) - cleanup_list.push(ptr15) + Result::Ok(mbt_ffi_load64((return_area) + 8)) + } + 1 => { - () - } - DbByteArray(payload16) => { - mbt_ffi_store8(iter_base + 0, 15) + let lifted = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - let ptr17 = mbt_ffi_bytes2ptr(payload16) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - mbt_ffi_store32(iter_base + 12, payload16.length()) - mbt_ffi_store32(iter_base + 8, ptr17) - cleanup_list.push(ptr17) + Error_::ConnectionFailure(result) + } + 1 => { - () - } - } - } - let return_area = mbt_ffi_malloc(24) - wasmImportMethodDbConnectionExecute( - handle, - ptr, - statement.length(), - address, - params.length(), - return_area, - ) - - let lifted22 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load64(return_area + 8)) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 8) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryParameterFailure(result18) - } - 2 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryExecutionFailure(result19) - } - 3 => { - let result20 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryResponseFailure(result20) - } - 4 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::Other(result21) - } - _ => panic() + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::QueryParameterFailure(result18) + } + 2 => { + + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::QueryExecutionFailure(result19) + } + 3 => { + + let result20 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::QueryResponseFailure(result20) + } + 4 => { + + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::Other(result21) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted22 + mbt_ffi_free(ptr) + mbt_ffi_free(address) + mbt_ffi_free(return_area) - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted22 - mbt_ffi_free(ptr) - mbt_ffi_free(address) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + cleanup_list.each(mbt_ffi_free) + return ret +} ///| -pub fn DbConnection::begin_transaction( - self : DbConnection, -) -> Result[DbTransaction, Error_] { - let DbConnection(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbConnectionBeginTransaction(handle, return_area) - - let lifted4 = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok(DbTransaction::DbTransaction(mbt_ffi_load32(return_area + 4))) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result0) - } - 2 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result1) - } - 3 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result2) - } - 4 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result3) - } - _ => panic() +pub fn DbConnection::begin_transaction(self : DbConnection) -> Result[DbTransaction, Error_] { + + let DbConnection(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbConnectionBeginTransaction(handle, return_area); + + let lifted4 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(DbTransaction::DbTransaction(mbt_ffi_load32((return_area) + 4))) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result0) + } + 2 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result1) + } + 3 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result2) + } + 4 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result3) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted4 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted4 - mbt_ffi_free(return_area) - return ret } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/rdbms/mysql/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/rdbms/mysql/ffi.mbt index 0ff213dc98..ad82a2094c 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/rdbms/mysql/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/rdbms/mysql/ffi.mbt @@ -1,187 +1,131 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropDbResultStream(resource : Int) = "golem:rdbms/mysql@1.5.0" "[resource-drop]db-result-stream" -///| fn wasmImportResourceDropDbConnection(resource : Int) = "golem:rdbms/mysql@1.5.0" "[resource-drop]db-connection" -///| fn wasmImportResourceDropDbTransaction(resource : Int) = "golem:rdbms/mysql@1.5.0" "[resource-drop]db-transaction" -///| -fn wasmImportMethodDbResultStreamGetColumns(p0 : Int, p1 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-result-stream.get-columns" +fn wasmImportMethodDbResultStreamGetColumns(p0 : Int, p1 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-result-stream.get-columns" -///| -fn wasmImportMethodDbResultStreamGetNext(p0 : Int, p1 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-result-stream.get-next" - -///| -fn wasmImportStaticDbConnectionOpen(p0 : Int, p1 : Int, p2 : Int) = "golem:rdbms/mysql@1.5.0" "[static]db-connection.open" +fn wasmImportMethodDbResultStreamGetNext(p0 : Int, p1 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-result-stream.get-next" -///| -fn wasmImportMethodDbConnectionQuery( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/mysql@1.5.0" "[method]db-connection.query" +fn wasmImportStaticDbConnectionOpen(p0 : Int, p1 : Int, p2 : Int) = "golem:rdbms/mysql@1.5.0" "[static]db-connection.open" -///| -fn wasmImportMethodDbConnectionQueryStream( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/mysql@1.5.0" "[method]db-connection.query-stream" +fn wasmImportMethodDbConnectionQuery(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-connection.query" -///| -fn wasmImportMethodDbConnectionExecute( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/mysql@1.5.0" "[method]db-connection.execute" +fn wasmImportMethodDbConnectionQueryStream(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-connection.query-stream" -///| -fn wasmImportMethodDbConnectionBeginTransaction(p0 : Int, p1 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-connection.begin-transaction" +fn wasmImportMethodDbConnectionExecute(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-connection.execute" -///| -fn wasmImportMethodDbTransactionQuery( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/mysql@1.5.0" "[method]db-transaction.query" +fn wasmImportMethodDbConnectionBeginTransaction(p0 : Int, p1 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-connection.begin-transaction" -///| -fn wasmImportMethodDbTransactionQueryStream( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/mysql@1.5.0" "[method]db-transaction.query-stream" +fn wasmImportMethodDbTransactionQuery(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-transaction.query" -///| -fn wasmImportMethodDbTransactionExecute( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/mysql@1.5.0" "[method]db-transaction.execute" +fn wasmImportMethodDbTransactionQueryStream(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-transaction.query-stream" -///| -fn wasmImportMethodDbTransactionCommit(p0 : Int, p1 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-transaction.commit" +fn wasmImportMethodDbTransactionExecute(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-transaction.execute" -///| -fn wasmImportMethodDbTransactionRollback(p0 : Int, p1 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-transaction.rollback" +fn wasmImportMethodDbTransactionCommit(p0 : Int, p1 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-transaction.commit" -///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +fn wasmImportMethodDbTransactionRollback(p0 : Int, p1 : Int) = "golem:rdbms/mysql@1.5.0" "[method]db-transaction.rollback" ///| extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = - #|(func (param i32) (result f64) local.get 0 f64.load) +#|(func (param i32) (result f64) local.get 0 f64.load) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) ///| -extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_s) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend16_s) ///| extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| #owned(str) extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +#owned(bytes) +extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = +#|(func (param i32) (result i32) local.get 0) + +///| +extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = +#|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) ///| extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend8_s) +#|(func (param i32) (result i32) local.get 0 i32.extend8_s) ///| extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) +#|(func (param i32) (result i32) local.get 0 i32.load16_u) ///| -extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_s) ///| -extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_s) +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_s) ///| -extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend16_s) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = - #|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) +extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = +#|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) ///| -extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = - #|(func (param i32) (result f32) local.get 0 f32.load) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -#owned(bytes) -extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = - #|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) +extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = +#|(func (param i32) (result f32) local.get 0 f32.load) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/rdbms/mysql/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/rdbms/mysql/top.mbt index e2063b8438..ec4871213d 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/rdbms/mysql/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/rdbms/mysql/top.mbt @@ -1,3804 +1,3782 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| pub(all) suberror Error_ { - ConnectionFailure(String) - QueryParameterFailure(String) - QueryExecutionFailure(String) - QueryResponseFailure(String) - Other(String) + ConnectionFailure(String) + QueryParameterFailure(String) + QueryExecutionFailure(String) + QueryResponseFailure(String) + Other(String) } derive(Show, Eq) - ///| pub(all) enum DbColumnType { - Boolean - Tinyint - Smallint - Mediumint - Int - Bigint - TinyintUnsigned - SmallintUnsigned - MediumintUnsigned - IntUnsigned - BigintUnsigned - Float - Double - Decimal - Date - Datetime - Timestamp - Time - Year - Fixchar - Varchar - Tinytext - Text - Mediumtext - Longtext - Binary - Varbinary - Tinyblob - Blob - Mediumblob - Longblob - Enumeration - Set - Bit - Json + Boolean + Tinyint + Smallint + Mediumint + Int + Bigint + TinyintUnsigned + SmallintUnsigned + MediumintUnsigned + IntUnsigned + BigintUnsigned + Float + Double + Decimal + Date + Datetime + Timestamp + Time + Year + Fixchar + Varchar + Tinytext + Text + Mediumtext + Longtext + Binary + Varbinary + Tinyblob + Blob + Mediumblob + Longblob + Enumeration + Set + Bit + Json } derive(Show, Eq) - ///| pub(all) struct DbColumn { - ordinal : UInt64 - name : String - db_type : DbColumnType - db_type_name : String + ordinal : UInt64; name : String; db_type : DbColumnType; db_type_name : String } derive(Show, Eq) - ///| /// Value descriptor for a single database value pub(all) enum DbValue { - Boolean(Bool) - Tinyint(Int) - Smallint(Int) - Mediumint(Int) - Int(Int) - Bigint(Int64) - TinyintUnsigned(Byte) - SmallintUnsigned(UInt) - MediumintUnsigned(UInt) - IntUnsigned(UInt) - BigintUnsigned(UInt64) - Float(Float) - Double(Double) - Decimal(String) - Date(@types.Date) - Datetime(@types.Timestamp) - Timestamp(@types.Timestamp) - Time(@types.Time) - Year(UInt) - Fixchar(String) - Varchar(String) - Tinytext(String) - Text(String) - Mediumtext(String) - Longtext(String) - Binary(FixedArray[Byte]) - Varbinary(FixedArray[Byte]) - Tinyblob(FixedArray[Byte]) - Blob(FixedArray[Byte]) - Mediumblob(FixedArray[Byte]) - Longblob(FixedArray[Byte]) - Enumeration(String) - Set(String) - Bit(Array[Bool]) - Json(String) - Null + Boolean(Bool) + Tinyint(Int) + Smallint(Int) + Mediumint(Int) + Int(Int) + Bigint(Int64) + TinyintUnsigned(Byte) + SmallintUnsigned(UInt) + MediumintUnsigned(UInt) + IntUnsigned(UInt) + BigintUnsigned(UInt64) + Float(Float) + Double(Double) + Decimal(String) + Date(@types.Date) + Datetime(@types.Timestamp) + Timestamp(@types.Timestamp) + Time(@types.Time) + Year(UInt) + Fixchar(String) + Varchar(String) + Tinytext(String) + Text(String) + Mediumtext(String) + Longtext(String) + Binary(FixedArray[Byte]) + Varbinary(FixedArray[Byte]) + Tinyblob(FixedArray[Byte]) + Blob(FixedArray[Byte]) + Mediumblob(FixedArray[Byte]) + Longblob(FixedArray[Byte]) + Enumeration(String) + Set(String) + Bit(Array[Bool]) + Json(String) + Null } derive(Show, Eq) - ///| /// A single row of values pub(all) struct DbRow { - values : Array[DbValue] + values : Array[DbValue] } derive(Show, Eq) - ///| pub(all) struct DbResult { - columns : Array[DbColumn] - rows : Array[DbRow] + columns : Array[DbColumn]; rows : Array[DbRow] } derive(Show, Eq) - ///| /// A potentially very large and lazy stream of rows: pub(all) struct DbResultStream(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn DbResultStream::drop(self : DbResultStream) -> Unit { - let DbResultStream(resource) = self - wasmImportResourceDropDbResultStream(resource) + let DbResultStream(resource) = self + wasmImportResourceDropDbResultStream(resource) } - ///| pub(all) struct DbConnection(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn DbConnection::drop(self : DbConnection) -> Unit { - let DbConnection(resource) = self - wasmImportResourceDropDbConnection(resource) + let DbConnection(resource) = self + wasmImportResourceDropDbConnection(resource) } - ///| pub(all) struct DbTransaction(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn DbTransaction::drop(self : DbTransaction) -> Unit { - let DbTransaction(resource) = self - wasmImportResourceDropDbTransaction(resource) + let DbTransaction(resource) = self + wasmImportResourceDropDbTransaction(resource) } - ///| pub fn DbResultStream::get_columns(self : DbResultStream) -> Array[DbColumn] { - let DbResultStream(handle) = self - let return_area = mbt_ffi_malloc(8) - wasmImportMethodDbResultStreamGetColumns(handle, return_area) - - let array : Array[DbColumn] = [] - for index = 0; index < mbt_ffi_load32(return_area + 4); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index * 32 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted = match mbt_ffi_load8_u(iter_base + 16) { - 0 => DbColumnType::Boolean - 1 => DbColumnType::Tinyint - 2 => DbColumnType::Smallint - 3 => DbColumnType::Mediumint - 4 => DbColumnType::Int - 5 => DbColumnType::Bigint - 6 => DbColumnType::TinyintUnsigned - 7 => DbColumnType::SmallintUnsigned - 8 => DbColumnType::MediumintUnsigned - 9 => DbColumnType::IntUnsigned - 10 => DbColumnType::BigintUnsigned - 11 => DbColumnType::Float - 12 => DbColumnType::Double - 13 => DbColumnType::Decimal - 14 => DbColumnType::Date - 15 => DbColumnType::Datetime - 16 => DbColumnType::Timestamp - 17 => DbColumnType::Time - 18 => DbColumnType::Year - 19 => DbColumnType::Fixchar - 20 => DbColumnType::Varchar - 21 => DbColumnType::Tinytext - 22 => DbColumnType::Text - 23 => DbColumnType::Mediumtext - 24 => DbColumnType::Longtext - 25 => DbColumnType::Binary - 26 => DbColumnType::Varbinary - 27 => DbColumnType::Tinyblob - 28 => DbColumnType::Blob - 29 => DbColumnType::Mediumblob - 30 => DbColumnType::Longblob - 31 => DbColumnType::Enumeration - 32 => DbColumnType::Set - 33 => DbColumnType::Bit - 34 => DbColumnType::Json - _ => panic() - } - - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - array.push(DbColumn::{ - ordinal: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - name: result, - db_type: lifted, - db_type_name: result0, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array - mbt_ffi_free(return_area) - return ret -} -///| -pub fn DbResultStream::get_next(self : DbResultStream) -> Array[DbRow]? { - let DbResultStream(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodDbResultStreamGetNext(handle, return_area) - - let lifted19 : Array[DbRow]? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let array17 : Array[DbRow] = [] - for index18 = 0 - index18 < mbt_ffi_load32(return_area + 8) - index18 = index18 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index18 * 8 - - let array15 : Array[DbValue] = [] - for index16 = 0 - index16 < mbt_ffi_load32(iter_base + 4) - index16 = index16 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + index16 * 24 - - let lifted = match mbt_ffi_load8_u(iter_base + 0) { - 0 => DbValue::Boolean(mbt_ffi_load8_u(iter_base + 8) != 0) - 1 => DbValue::Tinyint(mbt_ffi_load8(iter_base + 8)) - 2 => DbValue::Smallint(mbt_ffi_load16(iter_base + 8)) - 3 => DbValue::Mediumint(mbt_ffi_load32(iter_base + 8)) - 4 => DbValue::Int(mbt_ffi_load32(iter_base + 8)) - 5 => DbValue::Bigint(mbt_ffi_load64(iter_base + 8)) - 6 => - DbValue::TinyintUnsigned(mbt_ffi_load8_u(iter_base + 8).to_byte()) - 7 => - DbValue::SmallintUnsigned( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 8 => - DbValue::MediumintUnsigned( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 9 => - DbValue::IntUnsigned( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 10 => - DbValue::BigintUnsigned( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 11 => DbValue::Float(mbt_ffi_loadf32(iter_base + 8)) - 12 => DbValue::Double(mbt_ffi_loadf64(iter_base + 8)) - 13 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::Decimal(result) - } - 14 => - DbValue::Date(@types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }) - 15 => - DbValue::Datetime(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 16).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 17).to_byte(), - second: mbt_ffi_load8_u(iter_base + 18).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 20).reinterpret_as_uint(), - }, - }) - 16 => - DbValue::Timestamp(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 16).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 17).to_byte(), - second: mbt_ffi_load8_u(iter_base + 18).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 20).reinterpret_as_uint(), - }, - }) - 17 => - DbValue::Time(@types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 8).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 9).to_byte(), - second: mbt_ffi_load8_u(iter_base + 10).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 18 => - DbValue::Year( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 19 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::Fixchar(result0) - } - 20 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let DbResultStream(handle) = self + let return_area = mbt_ffi_malloc(8) + wasmImportMethodDbResultStreamGetColumns(handle, return_area); - DbValue::Varchar(result1) - } - 21 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let array : Array[DbColumn] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 32) - DbValue::Tinytext(result2) - } - 22 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - DbValue::Text(result3) - } - 23 => { - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let lifted = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - DbValue::Mediumtext(result4) - } - 24 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::Boolean + } + 1 => { - DbValue::Longtext(result5) - } - 25 => { - let result6 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::Tinyint + } + 2 => { - DbValue::Binary(result6) - } - 26 => { - let result7 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::Smallint + } + 3 => { - DbValue::Varbinary(result7) - } - 27 => { - let result8 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::Mediumint + } + 4 => { - DbValue::Tinyblob(result8) - } - 28 => { - let result9 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::Int + } + 5 => { - DbValue::Blob(result9) - } - 29 => { - let result10 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::Bigint + } + 6 => { - DbValue::Mediumblob(result10) - } - 30 => { - let result11 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::TinyintUnsigned + } + 7 => { - DbValue::Longblob(result11) - } - 31 => { - let result12 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::SmallintUnsigned + } + 8 => { - DbValue::Enumeration(result12) - } - 32 => { - let result13 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::MediumintUnsigned + } + 9 => { - DbValue::Set(result13) - } - 33 => { - let array : Array[Bool] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 12) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index * 1 - - array.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - DbValue::Bit(array) - } - 34 => { - let result14 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::IntUnsigned + } + 10 => { - DbValue::Json(result14) - } - 35 => DbValue::Null - _ => panic() - } + DbColumnType::BigintUnsigned + } + 11 => { - array15.push(lifted) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + DbColumnType::Float + } + 12 => { - array17.push(DbRow::{ values: array15 }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Option::Some(array17) - } - _ => panic() - } - let ret = lifted19 - mbt_ffi_free(return_area) - return ret -} + DbColumnType::Double + } + 13 => { -///| -pub fn DbConnection::open(address : String) -> Result[DbConnection, Error_] { - let ptr = mbt_ffi_str2ptr(address) - let return_area = mbt_ffi_malloc(16) - wasmImportStaticDbConnectionOpen(ptr, address.length(), return_area) - - let lifted4 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(DbConnection::DbConnection(mbt_ffi_load32(return_area + 4))) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result0) - } - 2 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result1) - } - 3 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result2) - } - 4 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result3) - } - _ => panic() - } + DbColumnType::Decimal + } + 14 => { - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted4 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + DbColumnType::Date + } + 15 => { -///| -pub fn DbConnection::query( - self : DbConnection, - statement : String, - params : Array[DbValue], -) -> Result[DbResult, Error_] { - let cleanup_list : Array[Int] = [] + DbColumnType::Datetime + } + 16 => { - let DbConnection(handle) = self + DbColumnType::Timestamp + } + 17 => { - let ptr = mbt_ffi_str2ptr(statement) + DbColumnType::Time + } + 18 => { - let address51 = mbt_ffi_malloc(params.length() * 24) - for index52 = 0; index52 < params.length(); index52 = index52 + 1 { - let iter_elem : DbValue = params[index52] - let iter_base = address51 + index52 * 24 + DbColumnType::Year + } + 19 => { - match iter_elem { - Boolean(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) + DbColumnType::Fixchar + } + 20 => { - () - } - Tinyint(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + DbColumnType::Varchar + } + 21 => { - () - } - Smallint(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + DbColumnType::Tinytext + } + 22 => { - () - } - Mediumint(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + DbColumnType::Text + } + 23 => { - () - } - Int(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 8, payload3) + DbColumnType::Mediumtext + } + 24 => { - () - } - Bigint(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store64(iter_base + 8, payload4) + DbColumnType::Longtext + } + 25 => { - () - } - TinyintUnsigned(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store8(iter_base + 8, payload5.to_int()) + DbColumnType::Binary + } + 26 => { - () - } - SmallintUnsigned(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store16(iter_base + 8, payload6.reinterpret_as_int()) + DbColumnType::Varbinary + } + 27 => { - () - } - MediumintUnsigned(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store32(iter_base + 8, payload7.reinterpret_as_int()) + DbColumnType::Tinyblob + } + 28 => { - () - } - IntUnsigned(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_store32(iter_base + 8, payload8.reinterpret_as_int()) + DbColumnType::Blob + } + 29 => { - () - } - BigintUnsigned(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_store64(iter_base + 8, payload9.reinterpret_as_int64()) + DbColumnType::Mediumblob + } + 30 => { - () - } - Float(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_storef32(iter_base + 8, payload10) + DbColumnType::Longblob + } + 31 => { - () - } - Double(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_storef64(iter_base + 8, payload11) + DbColumnType::Enumeration + } + 32 => { - () - } - Decimal(payload12) => { - mbt_ffi_store8(iter_base + 0, 13) + DbColumnType::Set + } + 33 => { - let ptr13 = mbt_ffi_str2ptr(payload12) - mbt_ffi_store32(iter_base + 12, payload12.length()) - mbt_ffi_store32(iter_base + 8, ptr13) - cleanup_list.push(ptr13) + DbColumnType::Bit + } + 34 => { - () - } - Date(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.year) - mbt_ffi_store8(iter_base + 12, payload14.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload14.day.to_int()) + DbColumnType::Json + } + _ => panic() + } - () - } - Datetime(payload15) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload15.date.year) - mbt_ffi_store8(iter_base + 12, payload15.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload15.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload15.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload15.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload15.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload15.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Timestamp(payload16) => { - mbt_ffi_store8(iter_base + 0, 16) - mbt_ffi_store32(iter_base + 8, payload16.date.year) - mbt_ffi_store8(iter_base + 12, payload16.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload16.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload16.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload16.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload16.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload16.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Time(payload17) => { - mbt_ffi_store8(iter_base + 0, 17) - mbt_ffi_store8(iter_base + 8, payload17.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload17.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload17.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload17.nanosecond.reinterpret_as_int(), - ) - - () - } - Year(payload18) => { - mbt_ffi_store8(iter_base + 0, 18) - mbt_ffi_store16(iter_base + 8, payload18.reinterpret_as_int()) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () + array.push(DbColumn::{ordinal : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), name : result, db_type : lifted, db_type_name : result0}) } - Fixchar(payload19) => { - mbt_ffi_store8(iter_base + 0, 19) + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array + mbt_ffi_free(return_area) + return ret - let ptr20 = mbt_ffi_str2ptr(payload19) - mbt_ffi_store32(iter_base + 12, payload19.length()) - mbt_ffi_store32(iter_base + 8, ptr20) - cleanup_list.push(ptr20) +} +///| +pub fn DbResultStream::get_next(self : DbResultStream) -> Array[DbRow]? { - () - } - Varchar(payload21) => { - mbt_ffi_store8(iter_base + 0, 20) + let DbResultStream(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodDbResultStreamGetNext(handle, return_area); - let ptr22 = mbt_ffi_str2ptr(payload21) - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, ptr22) - cleanup_list.push(ptr22) + let lifted19 : Array[DbRow]? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { - () - } - Tinytext(payload23) => { - mbt_ffi_store8(iter_base + 0, 21) + let array17 : Array[DbRow] = []; + for index18 = 0; index18 < (mbt_ffi_load32((return_area) + 8)); index18 = index18 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index18 * 8) - let ptr24 = mbt_ffi_str2ptr(payload23) - mbt_ffi_store32(iter_base + 12, payload23.length()) - mbt_ffi_store32(iter_base + 8, ptr24) - cleanup_list.push(ptr24) + let array15 : Array[DbValue] = []; + for index16 = 0; index16 < (mbt_ffi_load32((iter_base) + 4)); index16 = index16 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index16 * 24) - () - } - Text(payload25) => { - mbt_ffi_store8(iter_base + 0, 22) + let lifted = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let ptr26 = mbt_ffi_str2ptr(payload25) - mbt_ffi_store32(iter_base + 12, payload25.length()) - mbt_ffi_store32(iter_base + 8, ptr26) - cleanup_list.push(ptr26) + DbValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - () - } - Mediumtext(payload27) => { - mbt_ffi_store8(iter_base + 0, 23) + DbValue::Tinyint((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - let ptr28 = mbt_ffi_str2ptr(payload27) - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, ptr28) - cleanup_list.push(ptr28) + DbValue::Smallint((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - () - } - Longtext(payload29) => { - mbt_ffi_store8(iter_base + 0, 24) + DbValue::Mediumint(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - let ptr30 = mbt_ffi_str2ptr(payload29) - mbt_ffi_store32(iter_base + 12, payload29.length()) - mbt_ffi_store32(iter_base + 8, ptr30) - cleanup_list.push(ptr30) + DbValue::Int(mbt_ffi_load32((iter_base) + 8)) + } + 5 => { - () - } - Binary(payload31) => { - mbt_ffi_store8(iter_base + 0, 25) + DbValue::Bigint(mbt_ffi_load64((iter_base) + 8)) + } + 6 => { - let ptr32 = mbt_ffi_bytes2ptr(payload31) + DbValue::TinyintUnsigned((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 7 => { - mbt_ffi_store32(iter_base + 12, payload31.length()) - mbt_ffi_store32(iter_base + 8, ptr32) - cleanup_list.push(ptr32) + DbValue::SmallintUnsigned((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 8 => { - () - } - Varbinary(payload33) => { - mbt_ffi_store8(iter_base + 0, 26) + DbValue::MediumintUnsigned((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 9 => { - let ptr34 = mbt_ffi_bytes2ptr(payload33) + DbValue::IntUnsigned((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 10 => { - mbt_ffi_store32(iter_base + 12, payload33.length()) - mbt_ffi_store32(iter_base + 8, ptr34) - cleanup_list.push(ptr34) + DbValue::BigintUnsigned((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 11 => { - () - } - Tinyblob(payload35) => { - mbt_ffi_store8(iter_base + 0, 27) + DbValue::Float(mbt_ffi_loadf32((iter_base) + 8)) + } + 12 => { - let ptr36 = mbt_ffi_bytes2ptr(payload35) + DbValue::Double(mbt_ffi_loadf64((iter_base) + 8)) + } + 13 => { - mbt_ffi_store32(iter_base + 12, payload35.length()) - mbt_ffi_store32(iter_base + 8, ptr36) - cleanup_list.push(ptr36) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Blob(payload37) => { - mbt_ffi_store8(iter_base + 0, 28) + DbValue::Decimal(result) + } + 14 => { - let ptr38 = mbt_ffi_bytes2ptr(payload37) + DbValue::Date(@types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}) + } + 15 => { - mbt_ffi_store32(iter_base + 12, payload37.length()) - mbt_ffi_store32(iter_base + 8, ptr38) - cleanup_list.push(ptr38) + DbValue::Datetime(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 17)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()}}) + } + 16 => { - () - } - Mediumblob(payload39) => { - mbt_ffi_store8(iter_base + 0, 29) + DbValue::Timestamp(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 17)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()}}) + } + 17 => { - let ptr40 = mbt_ffi_bytes2ptr(payload39) + DbValue::Time(@types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 8)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 9)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 10)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 18 => { - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, ptr40) - cleanup_list.push(ptr40) + DbValue::Year((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 19 => { - () - } - Longblob(payload41) => { - mbt_ffi_store8(iter_base + 0, 30) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr42 = mbt_ffi_bytes2ptr(payload41) + DbValue::Fixchar(result0) + } + 20 => { - mbt_ffi_store32(iter_base + 12, payload41.length()) - mbt_ffi_store32(iter_base + 8, ptr42) - cleanup_list.push(ptr42) + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Enumeration(payload43) => { - mbt_ffi_store8(iter_base + 0, 31) + DbValue::Varchar(result1) + } + 21 => { - let ptr44 = mbt_ffi_str2ptr(payload43) - mbt_ffi_store32(iter_base + 12, payload43.length()) - mbt_ffi_store32(iter_base + 8, ptr44) - cleanup_list.push(ptr44) + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Set(payload45) => { - mbt_ffi_store8(iter_base + 0, 32) + DbValue::Tinytext(result2) + } + 22 => { - let ptr46 = mbt_ffi_str2ptr(payload45) - mbt_ffi_store32(iter_base + 12, payload45.length()) - mbt_ffi_store32(iter_base + 8, ptr46) - cleanup_list.push(ptr46) + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Bit(payload47) => { - mbt_ffi_store8(iter_base + 0, 33) - - let address = mbt_ffi_malloc(payload47.length() * 1) - for index = 0; index < payload47.length(); index = index + 1 { - let iter_elem : Bool = payload47[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload47.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - Json(payload48) => { - mbt_ffi_store8(iter_base + 0, 34) + DbValue::Text(result3) + } + 23 => { - let ptr49 = mbt_ffi_str2ptr(payload48) - mbt_ffi_store32(iter_base + 12, payload48.length()) - mbt_ffi_store32(iter_base + 8, ptr49) - cleanup_list.push(ptr49) + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Null => { - mbt_ffi_store8(iter_base + 0, 35) + DbValue::Mediumtext(result4) + } + 24 => { - () - } - } - } - let return_area = mbt_ffi_malloc(20) - wasmImportMethodDbConnectionQuery( - handle, - ptr, - statement.length(), - address51, - params.length(), - return_area, - ) - - let lifted84 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array : Array[DbColumn] = [] - for index54 = 0 - index54 < mbt_ffi_load32(return_area + 8) - index54 = index54 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index54 * 32 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted = match mbt_ffi_load8_u(iter_base + 16) { - 0 => DbColumnType::Boolean - 1 => DbColumnType::Tinyint - 2 => DbColumnType::Smallint - 3 => DbColumnType::Mediumint - 4 => DbColumnType::Int - 5 => DbColumnType::Bigint - 6 => DbColumnType::TinyintUnsigned - 7 => DbColumnType::SmallintUnsigned - 8 => DbColumnType::MediumintUnsigned - 9 => DbColumnType::IntUnsigned - 10 => DbColumnType::BigintUnsigned - 11 => DbColumnType::Float - 12 => DbColumnType::Double - 13 => DbColumnType::Decimal - 14 => DbColumnType::Date - 15 => DbColumnType::Datetime - 16 => DbColumnType::Timestamp - 17 => DbColumnType::Time - 18 => DbColumnType::Year - 19 => DbColumnType::Fixchar - 20 => DbColumnType::Varchar - 21 => DbColumnType::Tinytext - 22 => DbColumnType::Text - 23 => DbColumnType::Mediumtext - 24 => DbColumnType::Longtext - 25 => DbColumnType::Binary - 26 => DbColumnType::Varbinary - 27 => DbColumnType::Tinyblob - 28 => DbColumnType::Blob - 29 => DbColumnType::Mediumblob - 30 => DbColumnType::Longblob - 31 => DbColumnType::Enumeration - 32 => DbColumnType::Set - 33 => DbColumnType::Bit - 34 => DbColumnType::Json - _ => panic() - } - - let result53 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - array.push(DbColumn::{ - ordinal: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - name: result, - db_type: lifted, - db_type_name: result53, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - let array76 : Array[DbRow] = [] - for index77 = 0 - index77 < mbt_ffi_load32(return_area + 16) - index77 = index77 + 1 { - let iter_base = mbt_ffi_load32(return_area + 12) + index77 * 8 - - let array74 : Array[DbValue] = [] - for index75 = 0 - index75 < mbt_ffi_load32(iter_base + 4) - index75 = index75 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + index75 * 24 - - let lifted73 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => DbValue::Boolean(mbt_ffi_load8_u(iter_base + 8) != 0) - 1 => DbValue::Tinyint(mbt_ffi_load8(iter_base + 8)) - 2 => DbValue::Smallint(mbt_ffi_load16(iter_base + 8)) - 3 => DbValue::Mediumint(mbt_ffi_load32(iter_base + 8)) - 4 => DbValue::Int(mbt_ffi_load32(iter_base + 8)) - 5 => DbValue::Bigint(mbt_ffi_load64(iter_base + 8)) - 6 => - DbValue::TinyintUnsigned(mbt_ffi_load8_u(iter_base + 8).to_byte()) - 7 => - DbValue::SmallintUnsigned( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 8 => - DbValue::MediumintUnsigned( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 9 => - DbValue::IntUnsigned( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 10 => - DbValue::BigintUnsigned( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 11 => DbValue::Float(mbt_ffi_loadf32(iter_base + 8)) - 12 => DbValue::Double(mbt_ffi_loadf64(iter_base + 8)) - 13 => { - let result55 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::Decimal(result55) - } - 14 => - DbValue::Date(@types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }) - 15 => - DbValue::Datetime(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 16).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 17).to_byte(), - second: mbt_ffi_load8_u(iter_base + 18).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 20).reinterpret_as_uint(), - }, - }) - 16 => - DbValue::Timestamp(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 16).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 17).to_byte(), - second: mbt_ffi_load8_u(iter_base + 18).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 20).reinterpret_as_uint(), - }, - }) - 17 => - DbValue::Time(@types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 8).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 9).to_byte(), - second: mbt_ffi_load8_u(iter_base + 10).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 18 => - DbValue::Year( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 19 => { - let result56 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::Fixchar(result56) - } - 20 => { - let result57 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - DbValue::Varchar(result57) - } - 21 => { - let result58 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbValue::Longtext(result5) + } + 25 => { - DbValue::Tinytext(result58) - } - 22 => { - let result59 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let result6 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - DbValue::Text(result59) - } - 23 => { - let result60 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbValue::Binary(result6) + } + 26 => { - DbValue::Mediumtext(result60) - } - 24 => { - let result61 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let result7 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - DbValue::Longtext(result61) - } - 25 => { - let result62 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbValue::Varbinary(result7) + } + 27 => { - DbValue::Binary(result62) - } - 26 => { - let result63 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let result8 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - DbValue::Varbinary(result63) - } - 27 => { - let result64 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbValue::Tinyblob(result8) + } + 28 => { - DbValue::Tinyblob(result64) - } - 28 => { - let result65 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let result9 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - DbValue::Blob(result65) - } - 29 => { - let result66 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbValue::Blob(result9) + } + 29 => { - DbValue::Mediumblob(result66) - } - 30 => { - let result67 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let result10 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - DbValue::Longblob(result67) - } - 31 => { - let result68 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbValue::Mediumblob(result10) + } + 30 => { - DbValue::Enumeration(result68) - } - 32 => { - let result69 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let result11 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - DbValue::Set(result69) - } - 33 => { - let array70 : Array[Bool] = [] - for index71 = 0 - index71 < mbt_ffi_load32(iter_base + 12) - index71 = index71 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index71 * 1 - - array70.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - DbValue::Bit(array70) - } - 34 => { - let result72 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbValue::Longblob(result11) + } + 31 => { - DbValue::Json(result72) - } - 35 => DbValue::Null - _ => panic() - } + let result12 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - array74.push(lifted73) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + DbValue::Enumeration(result12) + } + 32 => { - array76.push(DbRow::{ values: array74 }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 12)) - - Result::Ok(DbResult::{ columns: array, rows: array76 }) - } - 1 => { - let lifted83 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result78 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result78) - } - 1 => { - let result79 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result79) - } - 2 => { - let result80 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result80) - } - 3 => { - let result81 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result81) - } - 4 => { - let result82 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result82) - } - _ => panic() + let result13 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Set(result13) + } + 33 => { + + let array : Array[Bool] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index * 1) + + array.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + DbValue::Bit(array) + } + 34 => { + + let result14 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Json(result14) + } + 35 => { + + DbValue::Null + } + _ => panic() + } + + array15.push(lifted) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array17.push(DbRow::{values : array15}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) + + Option::Some(array17) + } + _ => panic() } + let ret = lifted19 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted83) - } - _ => panic() - } - let ret = lifted84 - mbt_ffi_free(ptr) - mbt_ffi_free(address51) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret } - ///| -pub fn DbConnection::query_stream( - self : DbConnection, - statement : String, - params : Array[DbValue], -) -> Result[DbResultStream, Error_] { - let cleanup_list : Array[Int] = [] +pub fn DbConnection::open(address : String) -> Result[DbConnection, Error_] { - let DbConnection(handle) = self + let ptr = mbt_ffi_str2ptr(address) + let return_area = mbt_ffi_malloc(16) + wasmImportStaticDbConnectionOpen(ptr, address.length(), return_area); - let ptr = mbt_ffi_str2ptr(statement) + let lifted4 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - let address51 = mbt_ffi_malloc(params.length() * 24) - for index52 = 0; index52 < params.length(); index52 = index52 + 1 { - let iter_elem : DbValue = params[index52] - let iter_base = address51 + index52 * 24 + Result::Ok(DbConnection::DbConnection(mbt_ffi_load32((return_area) + 4))) + } + 1 => { - match iter_elem { - Boolean(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - () - } - Tinyint(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Smallint(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + Error_::ConnectionFailure(result) + } + 1 => { - () - } - Mediumint(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Int(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 8, payload3) + Error_::QueryParameterFailure(result0) + } + 2 => { - () - } - Bigint(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store64(iter_base + 8, payload4) + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - TinyintUnsigned(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store8(iter_base + 8, payload5.to_int()) + Error_::QueryExecutionFailure(result1) + } + 3 => { - () - } - SmallintUnsigned(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store16(iter_base + 8, payload6.reinterpret_as_int()) + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - MediumintUnsigned(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store32(iter_base + 8, payload7.reinterpret_as_int()) + Error_::QueryResponseFailure(result2) + } + 4 => { - () - } - IntUnsigned(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_store32(iter_base + 8, payload8.reinterpret_as_int()) + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - BigintUnsigned(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_store64(iter_base + 8, payload9.reinterpret_as_int64()) + Error_::Other(result3) + } + _ => panic() + } - () + Result::Err(lifted) + } + _ => panic() } - Float(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_storef32(iter_base + 8, payload10) + let ret = lifted4 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret - () - } - Double(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_storef64(iter_base + 8, payload11) +} +///| +pub fn DbConnection::query(self : DbConnection, statement : String, params : Array[DbValue]) -> Result[DbResult, Error_] { + let cleanup_list : Array[Int] = [] + + let DbConnection(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address51 = mbt_ffi_malloc((params).length() * 24); + for index52 = 0; index52 < (params).length(); index52 = index52 + 1 { + let iter_elem : DbValue = (params)[(index52)] + let iter_base = address51 + (index52 * 24); + + match iter_elem { + Boolean(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) + + () + } + Tinyint(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) + + () + } + Smallint(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) + + () + } + Mediumint(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) + + () + } + Int(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 8, payload3) + + () + } + Bigint(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store64((iter_base) + 8, payload4) + + () + } + TinyintUnsigned(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store8((iter_base) + 8, (payload5).to_int()) + + () + } + SmallintUnsigned(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store16((iter_base) + 8, (payload6).reinterpret_as_int()) + + () + } + MediumintUnsigned(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store32((iter_base) + 8, (payload7).reinterpret_as_int()) + + () + } + IntUnsigned(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_store32((iter_base) + 8, (payload8).reinterpret_as_int()) + + () + } + BigintUnsigned(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_store64((iter_base) + 8, (payload9).reinterpret_as_int64()) + + () + } + Float(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_storef32((iter_base) + 8, payload10) + + () + } + Double(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_storef64((iter_base) + 8, payload11) + + () + } + Decimal(payload12) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let ptr13 = mbt_ffi_str2ptr(payload12) + mbt_ffi_store32((iter_base) + 12, payload12.length()) + mbt_ffi_store32((iter_base) + 8, ptr13) + cleanup_list.push(ptr13) + + () + } + Date(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, (payload14).year) + mbt_ffi_store8((iter_base) + 12, ((payload14).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload14).day).to_int()) + + () + } + Datetime(payload15) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, ((payload15).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload15).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload15).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload15).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload15).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload15).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload15).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamp(payload16) => { + mbt_ffi_store8((iter_base) + 0, (16)) + mbt_ffi_store32((iter_base) + 8, ((payload16).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload16).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload16).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload16).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload16).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload16).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload16).time).nanosecond).reinterpret_as_int()) + + () + } + Time(payload17) => { + mbt_ffi_store8((iter_base) + 0, (17)) + mbt_ffi_store8((iter_base) + 8, ((payload17).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, ((payload17).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, ((payload17).second).to_int()) + mbt_ffi_store32((iter_base) + 12, ((payload17).nanosecond).reinterpret_as_int()) + + () + } + Year(payload18) => { + mbt_ffi_store8((iter_base) + 0, (18)) + mbt_ffi_store16((iter_base) + 8, (payload18).reinterpret_as_int()) + + () + } + Fixchar(payload19) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let ptr20 = mbt_ffi_str2ptr(payload19) + mbt_ffi_store32((iter_base) + 12, payload19.length()) + mbt_ffi_store32((iter_base) + 8, ptr20) + cleanup_list.push(ptr20) + + () + } + Varchar(payload21) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let ptr22 = mbt_ffi_str2ptr(payload21) + mbt_ffi_store32((iter_base) + 12, payload21.length()) + mbt_ffi_store32((iter_base) + 8, ptr22) + cleanup_list.push(ptr22) + + () + } + Tinytext(payload23) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + let ptr24 = mbt_ffi_str2ptr(payload23) + mbt_ffi_store32((iter_base) + 12, payload23.length()) + mbt_ffi_store32((iter_base) + 8, ptr24) + cleanup_list.push(ptr24) + + () + } + Text(payload25) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + let ptr26 = mbt_ffi_str2ptr(payload25) + mbt_ffi_store32((iter_base) + 12, payload25.length()) + mbt_ffi_store32((iter_base) + 8, ptr26) + cleanup_list.push(ptr26) + + () + } + Mediumtext(payload27) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr28 = mbt_ffi_str2ptr(payload27) + mbt_ffi_store32((iter_base) + 12, payload27.length()) + mbt_ffi_store32((iter_base) + 8, ptr28) + cleanup_list.push(ptr28) + + () + } + Longtext(payload29) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr30 = mbt_ffi_str2ptr(payload29) + mbt_ffi_store32((iter_base) + 12, payload29.length()) + mbt_ffi_store32((iter_base) + 8, ptr30) + cleanup_list.push(ptr30) + + () + } + Binary(payload31) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr32 = mbt_ffi_bytes2ptr(payload31) + + mbt_ffi_store32((iter_base) + 12, payload31.length()) + mbt_ffi_store32((iter_base) + 8, ptr32) + cleanup_list.push(ptr32) + + () + } + Varbinary(payload33) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr34 = mbt_ffi_bytes2ptr(payload33) + + mbt_ffi_store32((iter_base) + 12, payload33.length()) + mbt_ffi_store32((iter_base) + 8, ptr34) + cleanup_list.push(ptr34) + + () + } + Tinyblob(payload35) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + let ptr36 = mbt_ffi_bytes2ptr(payload35) + + mbt_ffi_store32((iter_base) + 12, payload35.length()) + mbt_ffi_store32((iter_base) + 8, ptr36) + cleanup_list.push(ptr36) + + () + } + Blob(payload37) => { + mbt_ffi_store8((iter_base) + 0, (28)) + + let ptr38 = mbt_ffi_bytes2ptr(payload37) + + mbt_ffi_store32((iter_base) + 12, payload37.length()) + mbt_ffi_store32((iter_base) + 8, ptr38) + cleanup_list.push(ptr38) + + () + } + Mediumblob(payload39) => { + mbt_ffi_store8((iter_base) + 0, (29)) + + let ptr40 = mbt_ffi_bytes2ptr(payload39) + + mbt_ffi_store32((iter_base) + 12, payload39.length()) + mbt_ffi_store32((iter_base) + 8, ptr40) + cleanup_list.push(ptr40) + + () + } + Longblob(payload41) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr42 = mbt_ffi_bytes2ptr(payload41) + + mbt_ffi_store32((iter_base) + 12, payload41.length()) + mbt_ffi_store32((iter_base) + 8, ptr42) + cleanup_list.push(ptr42) + + () + } + Enumeration(payload43) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let ptr44 = mbt_ffi_str2ptr(payload43) + mbt_ffi_store32((iter_base) + 12, payload43.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) + cleanup_list.push(ptr44) + + () + } + Set(payload45) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let ptr46 = mbt_ffi_str2ptr(payload45) + mbt_ffi_store32((iter_base) + 12, payload45.length()) + mbt_ffi_store32((iter_base) + 8, ptr46) + cleanup_list.push(ptr46) + + () + } + Bit(payload47) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let address = mbt_ffi_malloc((payload47).length() * 1); + for index = 0; index < (payload47).length(); index = index + 1 { + let iter_elem : Bool = (payload47)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload47).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + Json(payload48) => { + mbt_ffi_store8((iter_base) + 0, (34)) + + let ptr49 = mbt_ffi_str2ptr(payload48) + mbt_ffi_store32((iter_base) + 12, payload48.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) + cleanup_list.push(ptr49) + + () + } + Null => { + mbt_ffi_store8((iter_base) + 0, (35)) + + () + } + } - () } - Decimal(payload12) => { - mbt_ffi_store8(iter_base + 0, 13) + let return_area = mbt_ffi_malloc(20) + wasmImportMethodDbConnectionQuery(handle, ptr, statement.length(), address51, (params).length(), return_area); - let ptr13 = mbt_ffi_str2ptr(payload12) - mbt_ffi_store32(iter_base + 12, payload12.length()) - mbt_ffi_store32(iter_base + 8, ptr13) - cleanup_list.push(ptr13) + let lifted84 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - () - } - Date(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.year) - mbt_ffi_store8(iter_base + 12, payload14.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload14.day.to_int()) + let array : Array[DbColumn] = []; + for index54 = 0; index54 < (mbt_ffi_load32((return_area) + 8)); index54 = index54 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index54 * 32) - () - } - Datetime(payload15) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload15.date.year) - mbt_ffi_store8(iter_base + 12, payload15.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload15.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload15.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload15.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload15.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload15.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Timestamp(payload16) => { - mbt_ffi_store8(iter_base + 0, 16) - mbt_ffi_store32(iter_base + 8, payload16.date.year) - mbt_ffi_store8(iter_base + 12, payload16.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload16.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload16.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload16.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload16.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload16.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Time(payload17) => { - mbt_ffi_store8(iter_base + 0, 17) - mbt_ffi_store8(iter_base + 8, payload17.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload17.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload17.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload17.nanosecond.reinterpret_as_int(), - ) - - () - } - Year(payload18) => { - mbt_ffi_store8(iter_base + 0, 18) - mbt_ffi_store16(iter_base + 8, payload18.reinterpret_as_int()) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Fixchar(payload19) => { - mbt_ffi_store8(iter_base + 0, 19) + let lifted = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - let ptr20 = mbt_ffi_str2ptr(payload19) - mbt_ffi_store32(iter_base + 12, payload19.length()) - mbt_ffi_store32(iter_base + 8, ptr20) - cleanup_list.push(ptr20) + DbColumnType::Boolean + } + 1 => { - () - } - Varchar(payload21) => { - mbt_ffi_store8(iter_base + 0, 20) + DbColumnType::Tinyint + } + 2 => { - let ptr22 = mbt_ffi_str2ptr(payload21) - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, ptr22) - cleanup_list.push(ptr22) + DbColumnType::Smallint + } + 3 => { - () - } - Tinytext(payload23) => { - mbt_ffi_store8(iter_base + 0, 21) + DbColumnType::Mediumint + } + 4 => { - let ptr24 = mbt_ffi_str2ptr(payload23) - mbt_ffi_store32(iter_base + 12, payload23.length()) - mbt_ffi_store32(iter_base + 8, ptr24) - cleanup_list.push(ptr24) + DbColumnType::Int + } + 5 => { - () - } - Text(payload25) => { - mbt_ffi_store8(iter_base + 0, 22) + DbColumnType::Bigint + } + 6 => { - let ptr26 = mbt_ffi_str2ptr(payload25) - mbt_ffi_store32(iter_base + 12, payload25.length()) - mbt_ffi_store32(iter_base + 8, ptr26) - cleanup_list.push(ptr26) + DbColumnType::TinyintUnsigned + } + 7 => { - () - } - Mediumtext(payload27) => { - mbt_ffi_store8(iter_base + 0, 23) + DbColumnType::SmallintUnsigned + } + 8 => { - let ptr28 = mbt_ffi_str2ptr(payload27) - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, ptr28) - cleanup_list.push(ptr28) + DbColumnType::MediumintUnsigned + } + 9 => { - () - } - Longtext(payload29) => { - mbt_ffi_store8(iter_base + 0, 24) + DbColumnType::IntUnsigned + } + 10 => { - let ptr30 = mbt_ffi_str2ptr(payload29) - mbt_ffi_store32(iter_base + 12, payload29.length()) - mbt_ffi_store32(iter_base + 8, ptr30) - cleanup_list.push(ptr30) + DbColumnType::BigintUnsigned + } + 11 => { - () - } - Binary(payload31) => { - mbt_ffi_store8(iter_base + 0, 25) + DbColumnType::Float + } + 12 => { - let ptr32 = mbt_ffi_bytes2ptr(payload31) + DbColumnType::Double + } + 13 => { - mbt_ffi_store32(iter_base + 12, payload31.length()) - mbt_ffi_store32(iter_base + 8, ptr32) - cleanup_list.push(ptr32) + DbColumnType::Decimal + } + 14 => { - () - } - Varbinary(payload33) => { - mbt_ffi_store8(iter_base + 0, 26) + DbColumnType::Date + } + 15 => { - let ptr34 = mbt_ffi_bytes2ptr(payload33) + DbColumnType::Datetime + } + 16 => { - mbt_ffi_store32(iter_base + 12, payload33.length()) - mbt_ffi_store32(iter_base + 8, ptr34) - cleanup_list.push(ptr34) + DbColumnType::Timestamp + } + 17 => { - () - } - Tinyblob(payload35) => { - mbt_ffi_store8(iter_base + 0, 27) + DbColumnType::Time + } + 18 => { - let ptr36 = mbt_ffi_bytes2ptr(payload35) + DbColumnType::Year + } + 19 => { - mbt_ffi_store32(iter_base + 12, payload35.length()) - mbt_ffi_store32(iter_base + 8, ptr36) - cleanup_list.push(ptr36) + DbColumnType::Fixchar + } + 20 => { - () - } - Blob(payload37) => { - mbt_ffi_store8(iter_base + 0, 28) + DbColumnType::Varchar + } + 21 => { - let ptr38 = mbt_ffi_bytes2ptr(payload37) + DbColumnType::Tinytext + } + 22 => { - mbt_ffi_store32(iter_base + 12, payload37.length()) - mbt_ffi_store32(iter_base + 8, ptr38) - cleanup_list.push(ptr38) + DbColumnType::Text + } + 23 => { - () - } - Mediumblob(payload39) => { - mbt_ffi_store8(iter_base + 0, 29) + DbColumnType::Mediumtext + } + 24 => { - let ptr40 = mbt_ffi_bytes2ptr(payload39) + DbColumnType::Longtext + } + 25 => { - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, ptr40) - cleanup_list.push(ptr40) + DbColumnType::Binary + } + 26 => { - () - } - Longblob(payload41) => { - mbt_ffi_store8(iter_base + 0, 30) + DbColumnType::Varbinary + } + 27 => { - let ptr42 = mbt_ffi_bytes2ptr(payload41) + DbColumnType::Tinyblob + } + 28 => { - mbt_ffi_store32(iter_base + 12, payload41.length()) - mbt_ffi_store32(iter_base + 8, ptr42) - cleanup_list.push(ptr42) + DbColumnType::Blob + } + 29 => { - () - } - Enumeration(payload43) => { - mbt_ffi_store8(iter_base + 0, 31) + DbColumnType::Mediumblob + } + 30 => { - let ptr44 = mbt_ffi_str2ptr(payload43) - mbt_ffi_store32(iter_base + 12, payload43.length()) - mbt_ffi_store32(iter_base + 8, ptr44) - cleanup_list.push(ptr44) + DbColumnType::Longblob + } + 31 => { - () - } - Set(payload45) => { - mbt_ffi_store8(iter_base + 0, 32) + DbColumnType::Enumeration + } + 32 => { - let ptr46 = mbt_ffi_str2ptr(payload45) - mbt_ffi_store32(iter_base + 12, payload45.length()) - mbt_ffi_store32(iter_base + 8, ptr46) - cleanup_list.push(ptr46) + DbColumnType::Set + } + 33 => { - () - } - Bit(payload47) => { - mbt_ffi_store8(iter_base + 0, 33) - - let address = mbt_ffi_malloc(payload47.length() * 1) - for index = 0; index < payload47.length(); index = index + 1 { - let iter_elem : Bool = payload47[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload47.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - Json(payload48) => { - mbt_ffi_store8(iter_base + 0, 34) + DbColumnType::Bit + } + 34 => { - let ptr49 = mbt_ffi_str2ptr(payload48) - mbt_ffi_store32(iter_base + 12, payload48.length()) - mbt_ffi_store32(iter_base + 8, ptr49) - cleanup_list.push(ptr49) + DbColumnType::Json + } + _ => panic() + } - () - } - Null => { - mbt_ffi_store8(iter_base + 0, 35) + let result53 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - } - } - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbConnectionQueryStream( - handle, - ptr, - statement.length(), - address51, - params.length(), - return_area, - ) - - let lifted57 = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok( - DbResultStream::DbResultStream(mbt_ffi_load32(return_area + 4)), - ) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result53 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result53) - } - 2 => { - let result54 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result54) - } - 3 => { - let result55 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result55) - } - 4 => { - let result56 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result56) - } - _ => panic() - } + array.push(DbColumn::{ordinal : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), name : result, db_type : lifted, db_type_name : result53}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted57 - mbt_ffi_free(ptr) - mbt_ffi_free(address51) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let array76 : Array[DbRow] = []; + for index77 = 0; index77 < (mbt_ffi_load32((return_area) + 16)); index77 = index77 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 12)) + (index77 * 8) -///| -pub fn DbConnection::execute( - self : DbConnection, - statement : String, - params : Array[DbValue], -) -> Result[UInt64, Error_] { - let cleanup_list : Array[Int] = [] + let array74 : Array[DbValue] = []; + for index75 = 0; index75 < (mbt_ffi_load32((iter_base) + 4)); index75 = index75 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index75 * 24) - let DbConnection(handle) = self + let lifted73 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let ptr = mbt_ffi_str2ptr(statement) + DbValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - let address51 = mbt_ffi_malloc(params.length() * 24) - for index52 = 0; index52 < params.length(); index52 = index52 + 1 { - let iter_elem : DbValue = params[index52] - let iter_base = address51 + index52 * 24 + DbValue::Tinyint((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - match iter_elem { - Boolean(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) + DbValue::Smallint((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - () - } - Tinyint(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + DbValue::Mediumint(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - () - } - Smallint(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + DbValue::Int(mbt_ffi_load32((iter_base) + 8)) + } + 5 => { - () - } - Mediumint(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + DbValue::Bigint(mbt_ffi_load64((iter_base) + 8)) + } + 6 => { - () - } - Int(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 8, payload3) + DbValue::TinyintUnsigned((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 7 => { - () - } - Bigint(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store64(iter_base + 8, payload4) + DbValue::SmallintUnsigned((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 8 => { - () - } - TinyintUnsigned(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store8(iter_base + 8, payload5.to_int()) + DbValue::MediumintUnsigned((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 9 => { - () - } - SmallintUnsigned(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store16(iter_base + 8, payload6.reinterpret_as_int()) + DbValue::IntUnsigned((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 10 => { - () - } - MediumintUnsigned(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store32(iter_base + 8, payload7.reinterpret_as_int()) + DbValue::BigintUnsigned((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 11 => { - () - } - IntUnsigned(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_store32(iter_base + 8, payload8.reinterpret_as_int()) + DbValue::Float(mbt_ffi_loadf32((iter_base) + 8)) + } + 12 => { - () - } - BigintUnsigned(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_store64(iter_base + 8, payload9.reinterpret_as_int64()) + DbValue::Double(mbt_ffi_loadf64((iter_base) + 8)) + } + 13 => { - () - } - Float(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_storef32(iter_base + 8, payload10) + let result55 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Double(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_storef64(iter_base + 8, payload11) + DbValue::Decimal(result55) + } + 14 => { - () - } - Decimal(payload12) => { - mbt_ffi_store8(iter_base + 0, 13) + DbValue::Date(@types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}) + } + 15 => { - let ptr13 = mbt_ffi_str2ptr(payload12) - mbt_ffi_store32(iter_base + 12, payload12.length()) - mbt_ffi_store32(iter_base + 8, ptr13) - cleanup_list.push(ptr13) + DbValue::Datetime(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 17)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()}}) + } + 16 => { - () - } - Date(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.year) - mbt_ffi_store8(iter_base + 12, payload14.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload14.day.to_int()) + DbValue::Timestamp(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 17)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()}}) + } + 17 => { - () - } - Datetime(payload15) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload15.date.year) - mbt_ffi_store8(iter_base + 12, payload15.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload15.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload15.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload15.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload15.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload15.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Timestamp(payload16) => { - mbt_ffi_store8(iter_base + 0, 16) - mbt_ffi_store32(iter_base + 8, payload16.date.year) - mbt_ffi_store8(iter_base + 12, payload16.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload16.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload16.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload16.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload16.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload16.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Time(payload17) => { - mbt_ffi_store8(iter_base + 0, 17) - mbt_ffi_store8(iter_base + 8, payload17.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload17.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload17.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload17.nanosecond.reinterpret_as_int(), - ) - - () - } - Year(payload18) => { - mbt_ffi_store8(iter_base + 0, 18) - mbt_ffi_store16(iter_base + 8, payload18.reinterpret_as_int()) + DbValue::Time(@types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 8)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 9)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 10)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 18 => { - () - } - Fixchar(payload19) => { - mbt_ffi_store8(iter_base + 0, 19) + DbValue::Year((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 19 => { - let ptr20 = mbt_ffi_str2ptr(payload19) - mbt_ffi_store32(iter_base + 12, payload19.length()) - mbt_ffi_store32(iter_base + 8, ptr20) - cleanup_list.push(ptr20) + let result56 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Varchar(payload21) => { - mbt_ffi_store8(iter_base + 0, 20) + DbValue::Fixchar(result56) + } + 20 => { - let ptr22 = mbt_ffi_str2ptr(payload21) - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, ptr22) - cleanup_list.push(ptr22) + let result57 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Tinytext(payload23) => { - mbt_ffi_store8(iter_base + 0, 21) + DbValue::Varchar(result57) + } + 21 => { - let ptr24 = mbt_ffi_str2ptr(payload23) - mbt_ffi_store32(iter_base + 12, payload23.length()) - mbt_ffi_store32(iter_base + 8, ptr24) - cleanup_list.push(ptr24) + let result58 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Text(payload25) => { - mbt_ffi_store8(iter_base + 0, 22) + DbValue::Tinytext(result58) + } + 22 => { - let ptr26 = mbt_ffi_str2ptr(payload25) - mbt_ffi_store32(iter_base + 12, payload25.length()) - mbt_ffi_store32(iter_base + 8, ptr26) - cleanup_list.push(ptr26) + let result59 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Mediumtext(payload27) => { - mbt_ffi_store8(iter_base + 0, 23) + DbValue::Text(result59) + } + 23 => { - let ptr28 = mbt_ffi_str2ptr(payload27) - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, ptr28) - cleanup_list.push(ptr28) + let result60 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Longtext(payload29) => { - mbt_ffi_store8(iter_base + 0, 24) + DbValue::Mediumtext(result60) + } + 24 => { - let ptr30 = mbt_ffi_str2ptr(payload29) - mbt_ffi_store32(iter_base + 12, payload29.length()) - mbt_ffi_store32(iter_base + 8, ptr30) - cleanup_list.push(ptr30) + let result61 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Binary(payload31) => { - mbt_ffi_store8(iter_base + 0, 25) + DbValue::Longtext(result61) + } + 25 => { - let ptr32 = mbt_ffi_bytes2ptr(payload31) + let result62 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - mbt_ffi_store32(iter_base + 12, payload31.length()) - mbt_ffi_store32(iter_base + 8, ptr32) - cleanup_list.push(ptr32) + DbValue::Binary(result62) + } + 26 => { - () - } - Varbinary(payload33) => { - mbt_ffi_store8(iter_base + 0, 26) + let result63 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr34 = mbt_ffi_bytes2ptr(payload33) + DbValue::Varbinary(result63) + } + 27 => { - mbt_ffi_store32(iter_base + 12, payload33.length()) - mbt_ffi_store32(iter_base + 8, ptr34) - cleanup_list.push(ptr34) + let result64 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Tinyblob(payload35) => { - mbt_ffi_store8(iter_base + 0, 27) + DbValue::Tinyblob(result64) + } + 28 => { - let ptr36 = mbt_ffi_bytes2ptr(payload35) + let result65 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - mbt_ffi_store32(iter_base + 12, payload35.length()) - mbt_ffi_store32(iter_base + 8, ptr36) - cleanup_list.push(ptr36) + DbValue::Blob(result65) + } + 29 => { - () - } - Blob(payload37) => { - mbt_ffi_store8(iter_base + 0, 28) + let result66 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr38 = mbt_ffi_bytes2ptr(payload37) + DbValue::Mediumblob(result66) + } + 30 => { - mbt_ffi_store32(iter_base + 12, payload37.length()) - mbt_ffi_store32(iter_base + 8, ptr38) - cleanup_list.push(ptr38) + let result67 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Mediumblob(payload39) => { - mbt_ffi_store8(iter_base + 0, 29) + DbValue::Longblob(result67) + } + 31 => { - let ptr40 = mbt_ffi_bytes2ptr(payload39) + let result68 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, ptr40) - cleanup_list.push(ptr40) + DbValue::Enumeration(result68) + } + 32 => { - () - } - Longblob(payload41) => { - mbt_ffi_store8(iter_base + 0, 30) + let result69 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr42 = mbt_ffi_bytes2ptr(payload41) + DbValue::Set(result69) + } + 33 => { - mbt_ffi_store32(iter_base + 12, payload41.length()) - mbt_ffi_store32(iter_base + 8, ptr42) - cleanup_list.push(ptr42) + let array70 : Array[Bool] = []; + for index71 = 0; index71 < (mbt_ffi_load32((iter_base) + 12)); index71 = index71 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index71 * 1) - () - } - Enumeration(payload43) => { - mbt_ffi_store8(iter_base + 0, 31) + array70.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let ptr44 = mbt_ffi_str2ptr(payload43) - mbt_ffi_store32(iter_base + 12, payload43.length()) - mbt_ffi_store32(iter_base + 8, ptr44) - cleanup_list.push(ptr44) + DbValue::Bit(array70) + } + 34 => { - () - } - Set(payload45) => { - mbt_ffi_store8(iter_base + 0, 32) + let result72 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr46 = mbt_ffi_str2ptr(payload45) - mbt_ffi_store32(iter_base + 12, payload45.length()) - mbt_ffi_store32(iter_base + 8, ptr46) - cleanup_list.push(ptr46) + DbValue::Json(result72) + } + 35 => { - () - } - Bit(payload47) => { - mbt_ffi_store8(iter_base + 0, 33) - - let address = mbt_ffi_malloc(payload47.length() * 1) - for index = 0; index < payload47.length(); index = index + 1 { - let iter_elem : Bool = payload47[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload47.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - Json(payload48) => { - mbt_ffi_store8(iter_base + 0, 34) + DbValue::Null + } + _ => panic() + } - let ptr49 = mbt_ffi_str2ptr(payload48) - mbt_ffi_store32(iter_base + 12, payload48.length()) - mbt_ffi_store32(iter_base + 8, ptr49) - cleanup_list.push(ptr49) + array74.push(lifted73) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Null => { - mbt_ffi_store8(iter_base + 0, 35) + array76.push(DbRow::{values : array74}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 12)) - () - } - } - } - let return_area = mbt_ffi_malloc(24) - wasmImportMethodDbConnectionExecute( - handle, - ptr, - statement.length(), - address51, - params.length(), - return_area, - ) - - let lifted57 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 8) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result53 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryParameterFailure(result53) - } - 2 => { - let result54 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryExecutionFailure(result54) - } - 3 => { - let result55 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryResponseFailure(result55) - } - 4 => { - let result56 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::Other(result56) - } - _ => panic() - } + Result::Ok(DbResult::{columns : array, rows : array76}) + } + 1 => { - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted57 - mbt_ffi_free(ptr) - mbt_ffi_free(address51) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let lifted83 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { -///| -pub fn DbConnection::begin_transaction( - self : DbConnection, -) -> Result[DbTransaction, Error_] { - let DbConnection(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbConnectionBeginTransaction(handle, return_area) - - let lifted4 = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok(DbTransaction::DbTransaction(mbt_ffi_load32(return_area + 4))) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result0) - } - 2 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result1) - } - 3 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result2) - } - 4 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result3) - } - _ => panic() - } + let result78 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted4 - mbt_ffi_free(return_area) - return ret -} + Error_::ConnectionFailure(result78) + } + 1 => { -///| -pub fn DbTransaction::query( - self : DbTransaction, - statement : String, - params : Array[DbValue], -) -> Result[DbResult, Error_] { - let cleanup_list : Array[Int] = [] + let result79 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let DbTransaction(handle) = self + Error_::QueryParameterFailure(result79) + } + 2 => { - let ptr = mbt_ffi_str2ptr(statement) + let result80 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let address51 = mbt_ffi_malloc(params.length() * 24) - for index52 = 0; index52 < params.length(); index52 = index52 + 1 { - let iter_elem : DbValue = params[index52] - let iter_base = address51 + index52 * 24 + Error_::QueryExecutionFailure(result80) + } + 3 => { - match iter_elem { - Boolean(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) + let result81 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Tinyint(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + Error_::QueryResponseFailure(result81) + } + 4 => { - () - } - Smallint(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + let result82 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Mediumint(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + Error_::Other(result82) + } + _ => panic() + } - () + Result::Err(lifted83) + } + _ => panic() } - Int(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 8, payload3) + let ret = lifted84 + mbt_ffi_free(ptr) + mbt_ffi_free(address51) + mbt_ffi_free(return_area) - () - } - Bigint(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store64(iter_base + 8, payload4) + cleanup_list.each(mbt_ffi_free) + return ret - () - } - TinyintUnsigned(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store8(iter_base + 8, payload5.to_int()) +} +///| +pub fn DbConnection::query_stream(self : DbConnection, statement : String, params : Array[DbValue]) -> Result[DbResultStream, Error_] { + let cleanup_list : Array[Int] = [] + + let DbConnection(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address51 = mbt_ffi_malloc((params).length() * 24); + for index52 = 0; index52 < (params).length(); index52 = index52 + 1 { + let iter_elem : DbValue = (params)[(index52)] + let iter_base = address51 + (index52 * 24); + + match iter_elem { + Boolean(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) + + () + } + Tinyint(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) + + () + } + Smallint(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) + + () + } + Mediumint(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) + + () + } + Int(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 8, payload3) + + () + } + Bigint(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store64((iter_base) + 8, payload4) + + () + } + TinyintUnsigned(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store8((iter_base) + 8, (payload5).to_int()) + + () + } + SmallintUnsigned(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store16((iter_base) + 8, (payload6).reinterpret_as_int()) + + () + } + MediumintUnsigned(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store32((iter_base) + 8, (payload7).reinterpret_as_int()) + + () + } + IntUnsigned(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_store32((iter_base) + 8, (payload8).reinterpret_as_int()) + + () + } + BigintUnsigned(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_store64((iter_base) + 8, (payload9).reinterpret_as_int64()) + + () + } + Float(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_storef32((iter_base) + 8, payload10) + + () + } + Double(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_storef64((iter_base) + 8, payload11) + + () + } + Decimal(payload12) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let ptr13 = mbt_ffi_str2ptr(payload12) + mbt_ffi_store32((iter_base) + 12, payload12.length()) + mbt_ffi_store32((iter_base) + 8, ptr13) + cleanup_list.push(ptr13) + + () + } + Date(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, (payload14).year) + mbt_ffi_store8((iter_base) + 12, ((payload14).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload14).day).to_int()) + + () + } + Datetime(payload15) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, ((payload15).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload15).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload15).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload15).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload15).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload15).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload15).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamp(payload16) => { + mbt_ffi_store8((iter_base) + 0, (16)) + mbt_ffi_store32((iter_base) + 8, ((payload16).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload16).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload16).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload16).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload16).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload16).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload16).time).nanosecond).reinterpret_as_int()) + + () + } + Time(payload17) => { + mbt_ffi_store8((iter_base) + 0, (17)) + mbt_ffi_store8((iter_base) + 8, ((payload17).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, ((payload17).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, ((payload17).second).to_int()) + mbt_ffi_store32((iter_base) + 12, ((payload17).nanosecond).reinterpret_as_int()) + + () + } + Year(payload18) => { + mbt_ffi_store8((iter_base) + 0, (18)) + mbt_ffi_store16((iter_base) + 8, (payload18).reinterpret_as_int()) + + () + } + Fixchar(payload19) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let ptr20 = mbt_ffi_str2ptr(payload19) + mbt_ffi_store32((iter_base) + 12, payload19.length()) + mbt_ffi_store32((iter_base) + 8, ptr20) + cleanup_list.push(ptr20) + + () + } + Varchar(payload21) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let ptr22 = mbt_ffi_str2ptr(payload21) + mbt_ffi_store32((iter_base) + 12, payload21.length()) + mbt_ffi_store32((iter_base) + 8, ptr22) + cleanup_list.push(ptr22) + + () + } + Tinytext(payload23) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + let ptr24 = mbt_ffi_str2ptr(payload23) + mbt_ffi_store32((iter_base) + 12, payload23.length()) + mbt_ffi_store32((iter_base) + 8, ptr24) + cleanup_list.push(ptr24) + + () + } + Text(payload25) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + let ptr26 = mbt_ffi_str2ptr(payload25) + mbt_ffi_store32((iter_base) + 12, payload25.length()) + mbt_ffi_store32((iter_base) + 8, ptr26) + cleanup_list.push(ptr26) + + () + } + Mediumtext(payload27) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr28 = mbt_ffi_str2ptr(payload27) + mbt_ffi_store32((iter_base) + 12, payload27.length()) + mbt_ffi_store32((iter_base) + 8, ptr28) + cleanup_list.push(ptr28) + + () + } + Longtext(payload29) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr30 = mbt_ffi_str2ptr(payload29) + mbt_ffi_store32((iter_base) + 12, payload29.length()) + mbt_ffi_store32((iter_base) + 8, ptr30) + cleanup_list.push(ptr30) + + () + } + Binary(payload31) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr32 = mbt_ffi_bytes2ptr(payload31) + + mbt_ffi_store32((iter_base) + 12, payload31.length()) + mbt_ffi_store32((iter_base) + 8, ptr32) + cleanup_list.push(ptr32) + + () + } + Varbinary(payload33) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr34 = mbt_ffi_bytes2ptr(payload33) + + mbt_ffi_store32((iter_base) + 12, payload33.length()) + mbt_ffi_store32((iter_base) + 8, ptr34) + cleanup_list.push(ptr34) + + () + } + Tinyblob(payload35) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + let ptr36 = mbt_ffi_bytes2ptr(payload35) + + mbt_ffi_store32((iter_base) + 12, payload35.length()) + mbt_ffi_store32((iter_base) + 8, ptr36) + cleanup_list.push(ptr36) + + () + } + Blob(payload37) => { + mbt_ffi_store8((iter_base) + 0, (28)) + + let ptr38 = mbt_ffi_bytes2ptr(payload37) + + mbt_ffi_store32((iter_base) + 12, payload37.length()) + mbt_ffi_store32((iter_base) + 8, ptr38) + cleanup_list.push(ptr38) + + () + } + Mediumblob(payload39) => { + mbt_ffi_store8((iter_base) + 0, (29)) + + let ptr40 = mbt_ffi_bytes2ptr(payload39) + + mbt_ffi_store32((iter_base) + 12, payload39.length()) + mbt_ffi_store32((iter_base) + 8, ptr40) + cleanup_list.push(ptr40) + + () + } + Longblob(payload41) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr42 = mbt_ffi_bytes2ptr(payload41) + + mbt_ffi_store32((iter_base) + 12, payload41.length()) + mbt_ffi_store32((iter_base) + 8, ptr42) + cleanup_list.push(ptr42) + + () + } + Enumeration(payload43) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let ptr44 = mbt_ffi_str2ptr(payload43) + mbt_ffi_store32((iter_base) + 12, payload43.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) + cleanup_list.push(ptr44) + + () + } + Set(payload45) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let ptr46 = mbt_ffi_str2ptr(payload45) + mbt_ffi_store32((iter_base) + 12, payload45.length()) + mbt_ffi_store32((iter_base) + 8, ptr46) + cleanup_list.push(ptr46) + + () + } + Bit(payload47) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let address = mbt_ffi_malloc((payload47).length() * 1); + for index = 0; index < (payload47).length(); index = index + 1 { + let iter_elem : Bool = (payload47)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload47).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + Json(payload48) => { + mbt_ffi_store8((iter_base) + 0, (34)) + + let ptr49 = mbt_ffi_str2ptr(payload48) + mbt_ffi_store32((iter_base) + 12, payload48.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) + cleanup_list.push(ptr49) + + () + } + Null => { + mbt_ffi_store8((iter_base) + 0, (35)) + + () + } + } - () } - SmallintUnsigned(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store16(iter_base + 8, payload6.reinterpret_as_int()) + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbConnectionQueryStream(handle, ptr, statement.length(), address51, (params).length(), return_area); - () - } - MediumintUnsigned(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store32(iter_base + 8, payload7.reinterpret_as_int()) + let lifted57 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - () - } - IntUnsigned(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_store32(iter_base + 8, payload8.reinterpret_as_int()) + Result::Ok(DbResultStream::DbResultStream(mbt_ffi_load32((return_area) + 4))) + } + 1 => { - () - } - BigintUnsigned(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_store64(iter_base + 8, payload9.reinterpret_as_int64()) + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - () - } - Float(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_storef32(iter_base + 8, payload10) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Double(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_storef64(iter_base + 8, payload11) + Error_::ConnectionFailure(result) + } + 1 => { - () - } - Decimal(payload12) => { - mbt_ffi_store8(iter_base + 0, 13) + let result53 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr13 = mbt_ffi_str2ptr(payload12) - mbt_ffi_store32(iter_base + 12, payload12.length()) - mbt_ffi_store32(iter_base + 8, ptr13) - cleanup_list.push(ptr13) + Error_::QueryParameterFailure(result53) + } + 2 => { - () - } - Date(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.year) - mbt_ffi_store8(iter_base + 12, payload14.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload14.day.to_int()) + let result54 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Datetime(payload15) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload15.date.year) - mbt_ffi_store8(iter_base + 12, payload15.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload15.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload15.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload15.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload15.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload15.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Timestamp(payload16) => { - mbt_ffi_store8(iter_base + 0, 16) - mbt_ffi_store32(iter_base + 8, payload16.date.year) - mbt_ffi_store8(iter_base + 12, payload16.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload16.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload16.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload16.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload16.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload16.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Time(payload17) => { - mbt_ffi_store8(iter_base + 0, 17) - mbt_ffi_store8(iter_base + 8, payload17.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload17.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload17.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload17.nanosecond.reinterpret_as_int(), - ) - - () - } - Year(payload18) => { - mbt_ffi_store8(iter_base + 0, 18) - mbt_ffi_store16(iter_base + 8, payload18.reinterpret_as_int()) + Error_::QueryExecutionFailure(result54) + } + 3 => { - () - } - Fixchar(payload19) => { - mbt_ffi_store8(iter_base + 0, 19) + let result55 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr20 = mbt_ffi_str2ptr(payload19) - mbt_ffi_store32(iter_base + 12, payload19.length()) - mbt_ffi_store32(iter_base + 8, ptr20) - cleanup_list.push(ptr20) + Error_::QueryResponseFailure(result55) + } + 4 => { - () - } - Varchar(payload21) => { - mbt_ffi_store8(iter_base + 0, 20) + let result56 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr22 = mbt_ffi_str2ptr(payload21) - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, ptr22) - cleanup_list.push(ptr22) + Error_::Other(result56) + } + _ => panic() + } - () + Result::Err(lifted) + } + _ => panic() } - Tinytext(payload23) => { - mbt_ffi_store8(iter_base + 0, 21) + let ret = lifted57 + mbt_ffi_free(ptr) + mbt_ffi_free(address51) + mbt_ffi_free(return_area) - let ptr24 = mbt_ffi_str2ptr(payload23) - mbt_ffi_store32(iter_base + 12, payload23.length()) - mbt_ffi_store32(iter_base + 8, ptr24) - cleanup_list.push(ptr24) + cleanup_list.each(mbt_ffi_free) + return ret + +} +///| +pub fn DbConnection::execute(self : DbConnection, statement : String, params : Array[DbValue]) -> Result[UInt64, Error_] { + let cleanup_list : Array[Int] = [] + + let DbConnection(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address51 = mbt_ffi_malloc((params).length() * 24); + for index52 = 0; index52 < (params).length(); index52 = index52 + 1 { + let iter_elem : DbValue = (params)[(index52)] + let iter_base = address51 + (index52 * 24); + + match iter_elem { + Boolean(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) + + () + } + Tinyint(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) + + () + } + Smallint(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) + + () + } + Mediumint(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) + + () + } + Int(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 8, payload3) + + () + } + Bigint(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store64((iter_base) + 8, payload4) + + () + } + TinyintUnsigned(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store8((iter_base) + 8, (payload5).to_int()) + + () + } + SmallintUnsigned(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store16((iter_base) + 8, (payload6).reinterpret_as_int()) + + () + } + MediumintUnsigned(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store32((iter_base) + 8, (payload7).reinterpret_as_int()) + + () + } + IntUnsigned(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_store32((iter_base) + 8, (payload8).reinterpret_as_int()) + + () + } + BigintUnsigned(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_store64((iter_base) + 8, (payload9).reinterpret_as_int64()) + + () + } + Float(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_storef32((iter_base) + 8, payload10) + + () + } + Double(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_storef64((iter_base) + 8, payload11) + + () + } + Decimal(payload12) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let ptr13 = mbt_ffi_str2ptr(payload12) + mbt_ffi_store32((iter_base) + 12, payload12.length()) + mbt_ffi_store32((iter_base) + 8, ptr13) + cleanup_list.push(ptr13) + + () + } + Date(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, (payload14).year) + mbt_ffi_store8((iter_base) + 12, ((payload14).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload14).day).to_int()) + + () + } + Datetime(payload15) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, ((payload15).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload15).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload15).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload15).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload15).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload15).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload15).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamp(payload16) => { + mbt_ffi_store8((iter_base) + 0, (16)) + mbt_ffi_store32((iter_base) + 8, ((payload16).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload16).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload16).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload16).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload16).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload16).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload16).time).nanosecond).reinterpret_as_int()) + + () + } + Time(payload17) => { + mbt_ffi_store8((iter_base) + 0, (17)) + mbt_ffi_store8((iter_base) + 8, ((payload17).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, ((payload17).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, ((payload17).second).to_int()) + mbt_ffi_store32((iter_base) + 12, ((payload17).nanosecond).reinterpret_as_int()) + + () + } + Year(payload18) => { + mbt_ffi_store8((iter_base) + 0, (18)) + mbt_ffi_store16((iter_base) + 8, (payload18).reinterpret_as_int()) + + () + } + Fixchar(payload19) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let ptr20 = mbt_ffi_str2ptr(payload19) + mbt_ffi_store32((iter_base) + 12, payload19.length()) + mbt_ffi_store32((iter_base) + 8, ptr20) + cleanup_list.push(ptr20) + + () + } + Varchar(payload21) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let ptr22 = mbt_ffi_str2ptr(payload21) + mbt_ffi_store32((iter_base) + 12, payload21.length()) + mbt_ffi_store32((iter_base) + 8, ptr22) + cleanup_list.push(ptr22) + + () + } + Tinytext(payload23) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + let ptr24 = mbt_ffi_str2ptr(payload23) + mbt_ffi_store32((iter_base) + 12, payload23.length()) + mbt_ffi_store32((iter_base) + 8, ptr24) + cleanup_list.push(ptr24) + + () + } + Text(payload25) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + let ptr26 = mbt_ffi_str2ptr(payload25) + mbt_ffi_store32((iter_base) + 12, payload25.length()) + mbt_ffi_store32((iter_base) + 8, ptr26) + cleanup_list.push(ptr26) + + () + } + Mediumtext(payload27) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr28 = mbt_ffi_str2ptr(payload27) + mbt_ffi_store32((iter_base) + 12, payload27.length()) + mbt_ffi_store32((iter_base) + 8, ptr28) + cleanup_list.push(ptr28) + + () + } + Longtext(payload29) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr30 = mbt_ffi_str2ptr(payload29) + mbt_ffi_store32((iter_base) + 12, payload29.length()) + mbt_ffi_store32((iter_base) + 8, ptr30) + cleanup_list.push(ptr30) + + () + } + Binary(payload31) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr32 = mbt_ffi_bytes2ptr(payload31) + + mbt_ffi_store32((iter_base) + 12, payload31.length()) + mbt_ffi_store32((iter_base) + 8, ptr32) + cleanup_list.push(ptr32) + + () + } + Varbinary(payload33) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr34 = mbt_ffi_bytes2ptr(payload33) + + mbt_ffi_store32((iter_base) + 12, payload33.length()) + mbt_ffi_store32((iter_base) + 8, ptr34) + cleanup_list.push(ptr34) + + () + } + Tinyblob(payload35) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + let ptr36 = mbt_ffi_bytes2ptr(payload35) + + mbt_ffi_store32((iter_base) + 12, payload35.length()) + mbt_ffi_store32((iter_base) + 8, ptr36) + cleanup_list.push(ptr36) + + () + } + Blob(payload37) => { + mbt_ffi_store8((iter_base) + 0, (28)) + + let ptr38 = mbt_ffi_bytes2ptr(payload37) + + mbt_ffi_store32((iter_base) + 12, payload37.length()) + mbt_ffi_store32((iter_base) + 8, ptr38) + cleanup_list.push(ptr38) + + () + } + Mediumblob(payload39) => { + mbt_ffi_store8((iter_base) + 0, (29)) + + let ptr40 = mbt_ffi_bytes2ptr(payload39) + + mbt_ffi_store32((iter_base) + 12, payload39.length()) + mbt_ffi_store32((iter_base) + 8, ptr40) + cleanup_list.push(ptr40) + + () + } + Longblob(payload41) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr42 = mbt_ffi_bytes2ptr(payload41) + + mbt_ffi_store32((iter_base) + 12, payload41.length()) + mbt_ffi_store32((iter_base) + 8, ptr42) + cleanup_list.push(ptr42) + + () + } + Enumeration(payload43) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let ptr44 = mbt_ffi_str2ptr(payload43) + mbt_ffi_store32((iter_base) + 12, payload43.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) + cleanup_list.push(ptr44) + + () + } + Set(payload45) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let ptr46 = mbt_ffi_str2ptr(payload45) + mbt_ffi_store32((iter_base) + 12, payload45.length()) + mbt_ffi_store32((iter_base) + 8, ptr46) + cleanup_list.push(ptr46) + + () + } + Bit(payload47) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let address = mbt_ffi_malloc((payload47).length() * 1); + for index = 0; index < (payload47).length(); index = index + 1 { + let iter_elem : Bool = (payload47)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload47).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + Json(payload48) => { + mbt_ffi_store8((iter_base) + 0, (34)) + + let ptr49 = mbt_ffi_str2ptr(payload48) + mbt_ffi_store32((iter_base) + 12, payload48.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) + cleanup_list.push(ptr49) + + () + } + Null => { + mbt_ffi_store8((iter_base) + 0, (35)) + + () + } + } - () } - Text(payload25) => { - mbt_ffi_store8(iter_base + 0, 22) + let return_area = mbt_ffi_malloc(24) + wasmImportMethodDbConnectionExecute(handle, ptr, statement.length(), address51, (params).length(), return_area); - let ptr26 = mbt_ffi_str2ptr(payload25) - mbt_ffi_store32(iter_base + 12, payload25.length()) - mbt_ffi_store32(iter_base + 8, ptr26) - cleanup_list.push(ptr26) + let lifted57 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - () - } - Mediumtext(payload27) => { - mbt_ffi_store8(iter_base + 0, 23) + Result::Ok((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + 1 => { - let ptr28 = mbt_ffi_str2ptr(payload27) - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, ptr28) - cleanup_list.push(ptr28) + let lifted = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - () - } - Longtext(payload29) => { - mbt_ffi_store8(iter_base + 0, 24) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let ptr30 = mbt_ffi_str2ptr(payload29) - mbt_ffi_store32(iter_base + 12, payload29.length()) - mbt_ffi_store32(iter_base + 8, ptr30) - cleanup_list.push(ptr30) + Error_::ConnectionFailure(result) + } + 1 => { - () - } - Binary(payload31) => { - mbt_ffi_store8(iter_base + 0, 25) + let result53 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let ptr32 = mbt_ffi_bytes2ptr(payload31) + Error_::QueryParameterFailure(result53) + } + 2 => { - mbt_ffi_store32(iter_base + 12, payload31.length()) - mbt_ffi_store32(iter_base + 8, ptr32) - cleanup_list.push(ptr32) + let result54 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - () - } - Varbinary(payload33) => { - mbt_ffi_store8(iter_base + 0, 26) + Error_::QueryExecutionFailure(result54) + } + 3 => { + + let result55 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::QueryResponseFailure(result55) + } + 4 => { - let ptr34 = mbt_ffi_bytes2ptr(payload33) + let result56 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - mbt_ffi_store32(iter_base + 12, payload33.length()) - mbt_ffi_store32(iter_base + 8, ptr34) - cleanup_list.push(ptr34) + Error_::Other(result56) + } + _ => panic() + } - () + Result::Err(lifted) + } + _ => panic() } - Tinyblob(payload35) => { - mbt_ffi_store8(iter_base + 0, 27) + let ret = lifted57 + mbt_ffi_free(ptr) + mbt_ffi_free(address51) + mbt_ffi_free(return_area) - let ptr36 = mbt_ffi_bytes2ptr(payload35) + cleanup_list.each(mbt_ffi_free) + return ret - mbt_ffi_store32(iter_base + 12, payload35.length()) - mbt_ffi_store32(iter_base + 8, ptr36) - cleanup_list.push(ptr36) +} +///| +pub fn DbConnection::begin_transaction(self : DbConnection) -> Result[DbTransaction, Error_] { - () - } - Blob(payload37) => { - mbt_ffi_store8(iter_base + 0, 28) + let DbConnection(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbConnectionBeginTransaction(handle, return_area); - let ptr38 = mbt_ffi_bytes2ptr(payload37) + let lifted4 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - mbt_ffi_store32(iter_base + 12, payload37.length()) - mbt_ffi_store32(iter_base + 8, ptr38) - cleanup_list.push(ptr38) + Result::Ok(DbTransaction::DbTransaction(mbt_ffi_load32((return_area) + 4))) + } + 1 => { - () - } - Mediumblob(payload39) => { - mbt_ffi_store8(iter_base + 0, 29) + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - let ptr40 = mbt_ffi_bytes2ptr(payload39) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, ptr40) - cleanup_list.push(ptr40) + Error_::ConnectionFailure(result) + } + 1 => { - () - } - Longblob(payload41) => { - mbt_ffi_store8(iter_base + 0, 30) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr42 = mbt_ffi_bytes2ptr(payload41) + Error_::QueryParameterFailure(result0) + } + 2 => { - mbt_ffi_store32(iter_base + 12, payload41.length()) - mbt_ffi_store32(iter_base + 8, ptr42) - cleanup_list.push(ptr42) + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Enumeration(payload43) => { - mbt_ffi_store8(iter_base + 0, 31) + Error_::QueryExecutionFailure(result1) + } + 3 => { - let ptr44 = mbt_ffi_str2ptr(payload43) - mbt_ffi_store32(iter_base + 12, payload43.length()) - mbt_ffi_store32(iter_base + 8, ptr44) - cleanup_list.push(ptr44) + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Set(payload45) => { - mbt_ffi_store8(iter_base + 0, 32) + Error_::QueryResponseFailure(result2) + } + 4 => { - let ptr46 = mbt_ffi_str2ptr(payload45) - mbt_ffi_store32(iter_base + 12, payload45.length()) - mbt_ffi_store32(iter_base + 8, ptr46) - cleanup_list.push(ptr46) + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Bit(payload47) => { - mbt_ffi_store8(iter_base + 0, 33) - - let address = mbt_ffi_malloc(payload47.length() * 1) - for index = 0; index < payload47.length(); index = index + 1 { - let iter_elem : Bool = payload47[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload47.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () + Error_::Other(result3) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } - Json(payload48) => { - mbt_ffi_store8(iter_base + 0, 34) + let ret = lifted4 + mbt_ffi_free(return_area) + return ret - let ptr49 = mbt_ffi_str2ptr(payload48) - mbt_ffi_store32(iter_base + 12, payload48.length()) - mbt_ffi_store32(iter_base + 8, ptr49) - cleanup_list.push(ptr49) +} +///| +pub fn DbTransaction::query(self : DbTransaction, statement : String, params : Array[DbValue]) -> Result[DbResult, Error_] { + let cleanup_list : Array[Int] = [] + + let DbTransaction(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address51 = mbt_ffi_malloc((params).length() * 24); + for index52 = 0; index52 < (params).length(); index52 = index52 + 1 { + let iter_elem : DbValue = (params)[(index52)] + let iter_base = address51 + (index52 * 24); + + match iter_elem { + Boolean(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) + + () + } + Tinyint(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) + + () + } + Smallint(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) + + () + } + Mediumint(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) + + () + } + Int(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 8, payload3) + + () + } + Bigint(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store64((iter_base) + 8, payload4) + + () + } + TinyintUnsigned(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store8((iter_base) + 8, (payload5).to_int()) + + () + } + SmallintUnsigned(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store16((iter_base) + 8, (payload6).reinterpret_as_int()) + + () + } + MediumintUnsigned(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store32((iter_base) + 8, (payload7).reinterpret_as_int()) + + () + } + IntUnsigned(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_store32((iter_base) + 8, (payload8).reinterpret_as_int()) + + () + } + BigintUnsigned(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_store64((iter_base) + 8, (payload9).reinterpret_as_int64()) + + () + } + Float(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_storef32((iter_base) + 8, payload10) + + () + } + Double(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_storef64((iter_base) + 8, payload11) + + () + } + Decimal(payload12) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let ptr13 = mbt_ffi_str2ptr(payload12) + mbt_ffi_store32((iter_base) + 12, payload12.length()) + mbt_ffi_store32((iter_base) + 8, ptr13) + cleanup_list.push(ptr13) + + () + } + Date(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, (payload14).year) + mbt_ffi_store8((iter_base) + 12, ((payload14).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload14).day).to_int()) + + () + } + Datetime(payload15) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, ((payload15).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload15).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload15).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload15).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload15).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload15).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload15).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamp(payload16) => { + mbt_ffi_store8((iter_base) + 0, (16)) + mbt_ffi_store32((iter_base) + 8, ((payload16).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload16).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload16).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload16).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload16).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload16).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload16).time).nanosecond).reinterpret_as_int()) + + () + } + Time(payload17) => { + mbt_ffi_store8((iter_base) + 0, (17)) + mbt_ffi_store8((iter_base) + 8, ((payload17).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, ((payload17).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, ((payload17).second).to_int()) + mbt_ffi_store32((iter_base) + 12, ((payload17).nanosecond).reinterpret_as_int()) + + () + } + Year(payload18) => { + mbt_ffi_store8((iter_base) + 0, (18)) + mbt_ffi_store16((iter_base) + 8, (payload18).reinterpret_as_int()) + + () + } + Fixchar(payload19) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let ptr20 = mbt_ffi_str2ptr(payload19) + mbt_ffi_store32((iter_base) + 12, payload19.length()) + mbt_ffi_store32((iter_base) + 8, ptr20) + cleanup_list.push(ptr20) + + () + } + Varchar(payload21) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let ptr22 = mbt_ffi_str2ptr(payload21) + mbt_ffi_store32((iter_base) + 12, payload21.length()) + mbt_ffi_store32((iter_base) + 8, ptr22) + cleanup_list.push(ptr22) + + () + } + Tinytext(payload23) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + let ptr24 = mbt_ffi_str2ptr(payload23) + mbt_ffi_store32((iter_base) + 12, payload23.length()) + mbt_ffi_store32((iter_base) + 8, ptr24) + cleanup_list.push(ptr24) + + () + } + Text(payload25) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + let ptr26 = mbt_ffi_str2ptr(payload25) + mbt_ffi_store32((iter_base) + 12, payload25.length()) + mbt_ffi_store32((iter_base) + 8, ptr26) + cleanup_list.push(ptr26) + + () + } + Mediumtext(payload27) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr28 = mbt_ffi_str2ptr(payload27) + mbt_ffi_store32((iter_base) + 12, payload27.length()) + mbt_ffi_store32((iter_base) + 8, ptr28) + cleanup_list.push(ptr28) + + () + } + Longtext(payload29) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr30 = mbt_ffi_str2ptr(payload29) + mbt_ffi_store32((iter_base) + 12, payload29.length()) + mbt_ffi_store32((iter_base) + 8, ptr30) + cleanup_list.push(ptr30) + + () + } + Binary(payload31) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr32 = mbt_ffi_bytes2ptr(payload31) + + mbt_ffi_store32((iter_base) + 12, payload31.length()) + mbt_ffi_store32((iter_base) + 8, ptr32) + cleanup_list.push(ptr32) + + () + } + Varbinary(payload33) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr34 = mbt_ffi_bytes2ptr(payload33) + + mbt_ffi_store32((iter_base) + 12, payload33.length()) + mbt_ffi_store32((iter_base) + 8, ptr34) + cleanup_list.push(ptr34) + + () + } + Tinyblob(payload35) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + let ptr36 = mbt_ffi_bytes2ptr(payload35) + + mbt_ffi_store32((iter_base) + 12, payload35.length()) + mbt_ffi_store32((iter_base) + 8, ptr36) + cleanup_list.push(ptr36) + + () + } + Blob(payload37) => { + mbt_ffi_store8((iter_base) + 0, (28)) + + let ptr38 = mbt_ffi_bytes2ptr(payload37) + + mbt_ffi_store32((iter_base) + 12, payload37.length()) + mbt_ffi_store32((iter_base) + 8, ptr38) + cleanup_list.push(ptr38) + + () + } + Mediumblob(payload39) => { + mbt_ffi_store8((iter_base) + 0, (29)) + + let ptr40 = mbt_ffi_bytes2ptr(payload39) + + mbt_ffi_store32((iter_base) + 12, payload39.length()) + mbt_ffi_store32((iter_base) + 8, ptr40) + cleanup_list.push(ptr40) + + () + } + Longblob(payload41) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr42 = mbt_ffi_bytes2ptr(payload41) + + mbt_ffi_store32((iter_base) + 12, payload41.length()) + mbt_ffi_store32((iter_base) + 8, ptr42) + cleanup_list.push(ptr42) + + () + } + Enumeration(payload43) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let ptr44 = mbt_ffi_str2ptr(payload43) + mbt_ffi_store32((iter_base) + 12, payload43.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) + cleanup_list.push(ptr44) + + () + } + Set(payload45) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let ptr46 = mbt_ffi_str2ptr(payload45) + mbt_ffi_store32((iter_base) + 12, payload45.length()) + mbt_ffi_store32((iter_base) + 8, ptr46) + cleanup_list.push(ptr46) + + () + } + Bit(payload47) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let address = mbt_ffi_malloc((payload47).length() * 1); + for index = 0; index < (payload47).length(); index = index + 1 { + let iter_elem : Bool = (payload47)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload47).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + Json(payload48) => { + mbt_ffi_store8((iter_base) + 0, (34)) + + let ptr49 = mbt_ffi_str2ptr(payload48) + mbt_ffi_store32((iter_base) + 12, payload48.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) + cleanup_list.push(ptr49) + + () + } + Null => { + mbt_ffi_store8((iter_base) + 0, (35)) + + () + } + } - () } - Null => { - mbt_ffi_store8(iter_base + 0, 35) + let return_area = mbt_ffi_malloc(20) + wasmImportMethodDbTransactionQuery(handle, ptr, statement.length(), address51, (params).length(), return_area); - () - } - } - } - let return_area = mbt_ffi_malloc(20) - wasmImportMethodDbTransactionQuery( - handle, - ptr, - statement.length(), - address51, - params.length(), - return_area, - ) - - let lifted84 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array : Array[DbColumn] = [] - for index54 = 0 - index54 < mbt_ffi_load32(return_area + 8) - index54 = index54 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index54 * 32 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted = match mbt_ffi_load8_u(iter_base + 16) { - 0 => DbColumnType::Boolean - 1 => DbColumnType::Tinyint - 2 => DbColumnType::Smallint - 3 => DbColumnType::Mediumint - 4 => DbColumnType::Int - 5 => DbColumnType::Bigint - 6 => DbColumnType::TinyintUnsigned - 7 => DbColumnType::SmallintUnsigned - 8 => DbColumnType::MediumintUnsigned - 9 => DbColumnType::IntUnsigned - 10 => DbColumnType::BigintUnsigned - 11 => DbColumnType::Float - 12 => DbColumnType::Double - 13 => DbColumnType::Decimal - 14 => DbColumnType::Date - 15 => DbColumnType::Datetime - 16 => DbColumnType::Timestamp - 17 => DbColumnType::Time - 18 => DbColumnType::Year - 19 => DbColumnType::Fixchar - 20 => DbColumnType::Varchar - 21 => DbColumnType::Tinytext - 22 => DbColumnType::Text - 23 => DbColumnType::Mediumtext - 24 => DbColumnType::Longtext - 25 => DbColumnType::Binary - 26 => DbColumnType::Varbinary - 27 => DbColumnType::Tinyblob - 28 => DbColumnType::Blob - 29 => DbColumnType::Mediumblob - 30 => DbColumnType::Longblob - 31 => DbColumnType::Enumeration - 32 => DbColumnType::Set - 33 => DbColumnType::Bit - 34 => DbColumnType::Json - _ => panic() - } - - let result53 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - array.push(DbColumn::{ - ordinal: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - name: result, - db_type: lifted, - db_type_name: result53, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - let array76 : Array[DbRow] = [] - for index77 = 0 - index77 < mbt_ffi_load32(return_area + 16) - index77 = index77 + 1 { - let iter_base = mbt_ffi_load32(return_area + 12) + index77 * 8 - - let array74 : Array[DbValue] = [] - for index75 = 0 - index75 < mbt_ffi_load32(iter_base + 4) - index75 = index75 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + index75 * 24 - - let lifted73 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => DbValue::Boolean(mbt_ffi_load8_u(iter_base + 8) != 0) - 1 => DbValue::Tinyint(mbt_ffi_load8(iter_base + 8)) - 2 => DbValue::Smallint(mbt_ffi_load16(iter_base + 8)) - 3 => DbValue::Mediumint(mbt_ffi_load32(iter_base + 8)) - 4 => DbValue::Int(mbt_ffi_load32(iter_base + 8)) - 5 => DbValue::Bigint(mbt_ffi_load64(iter_base + 8)) - 6 => - DbValue::TinyintUnsigned(mbt_ffi_load8_u(iter_base + 8).to_byte()) - 7 => - DbValue::SmallintUnsigned( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 8 => - DbValue::MediumintUnsigned( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 9 => - DbValue::IntUnsigned( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 10 => - DbValue::BigintUnsigned( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 11 => DbValue::Float(mbt_ffi_loadf32(iter_base + 8)) - 12 => DbValue::Double(mbt_ffi_loadf64(iter_base + 8)) - 13 => { - let result55 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::Decimal(result55) - } - 14 => - DbValue::Date(@types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }) - 15 => - DbValue::Datetime(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 16).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 17).to_byte(), - second: mbt_ffi_load8_u(iter_base + 18).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 20).reinterpret_as_uint(), - }, - }) - 16 => - DbValue::Timestamp(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 16).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 17).to_byte(), - second: mbt_ffi_load8_u(iter_base + 18).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 20).reinterpret_as_uint(), - }, - }) - 17 => - DbValue::Time(@types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 8).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 9).to_byte(), - second: mbt_ffi_load8_u(iter_base + 10).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 18 => - DbValue::Year( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 19 => { - let result56 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::Fixchar(result56) - } - 20 => { - let result57 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let lifted84 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - DbValue::Varchar(result57) - } - 21 => { - let result58 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let array : Array[DbColumn] = []; + for index54 = 0; index54 < (mbt_ffi_load32((return_area) + 8)); index54 = index54 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index54 * 32) - DbValue::Tinytext(result58) - } - 22 => { - let result59 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - DbValue::Text(result59) - } - 23 => { - let result60 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let lifted = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - DbValue::Mediumtext(result60) - } - 24 => { - let result61 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::Boolean + } + 1 => { - DbValue::Longtext(result61) - } - 25 => { - let result62 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::Tinyint + } + 2 => { - DbValue::Binary(result62) - } - 26 => { - let result63 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::Smallint + } + 3 => { - DbValue::Varbinary(result63) - } - 27 => { - let result64 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::Mediumint + } + 4 => { - DbValue::Tinyblob(result64) - } - 28 => { - let result65 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::Int + } + 5 => { - DbValue::Blob(result65) - } - 29 => { - let result66 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::Bigint + } + 6 => { - DbValue::Mediumblob(result66) - } - 30 => { - let result67 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::TinyintUnsigned + } + 7 => { - DbValue::Longblob(result67) - } - 31 => { - let result68 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::SmallintUnsigned + } + 8 => { - DbValue::Enumeration(result68) - } - 32 => { - let result69 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::MediumintUnsigned + } + 9 => { - DbValue::Set(result69) - } - 33 => { - let array70 : Array[Bool] = [] - for index71 = 0 - index71 < mbt_ffi_load32(iter_base + 12) - index71 = index71 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index71 * 1 - - array70.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - DbValue::Bit(array70) - } - 34 => { - let result72 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbColumnType::IntUnsigned + } + 10 => { - DbValue::Json(result72) - } - 35 => DbValue::Null - _ => panic() - } + DbColumnType::BigintUnsigned + } + 11 => { - array74.push(lifted73) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + DbColumnType::Float + } + 12 => { - array76.push(DbRow::{ values: array74 }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 12)) - - Result::Ok(DbResult::{ columns: array, rows: array76 }) - } - 1 => { - let lifted83 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result78 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result78) - } - 1 => { - let result79 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result79) - } - 2 => { - let result80 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result80) - } - 3 => { - let result81 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result81) - } - 4 => { - let result82 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result82) - } - _ => panic() - } + DbColumnType::Double + } + 13 => { - Result::Err(lifted83) - } - _ => panic() - } - let ret = lifted84 - mbt_ffi_free(ptr) - mbt_ffi_free(address51) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + DbColumnType::Decimal + } + 14 => { -///| -pub fn DbTransaction::query_stream( - self : DbTransaction, - statement : String, - params : Array[DbValue], -) -> Result[DbResultStream, Error_] { - let cleanup_list : Array[Int] = [] + DbColumnType::Date + } + 15 => { - let DbTransaction(handle) = self + DbColumnType::Datetime + } + 16 => { - let ptr = mbt_ffi_str2ptr(statement) + DbColumnType::Timestamp + } + 17 => { - let address51 = mbt_ffi_malloc(params.length() * 24) - for index52 = 0; index52 < params.length(); index52 = index52 + 1 { - let iter_elem : DbValue = params[index52] - let iter_base = address51 + index52 * 24 + DbColumnType::Time + } + 18 => { - match iter_elem { - Boolean(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) + DbColumnType::Year + } + 19 => { - () - } - Tinyint(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + DbColumnType::Fixchar + } + 20 => { - () - } - Smallint(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + DbColumnType::Varchar + } + 21 => { - () - } - Mediumint(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + DbColumnType::Tinytext + } + 22 => { - () - } - Int(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 8, payload3) + DbColumnType::Text + } + 23 => { - () - } - Bigint(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store64(iter_base + 8, payload4) + DbColumnType::Mediumtext + } + 24 => { - () - } - TinyintUnsigned(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store8(iter_base + 8, payload5.to_int()) + DbColumnType::Longtext + } + 25 => { - () - } - SmallintUnsigned(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store16(iter_base + 8, payload6.reinterpret_as_int()) + DbColumnType::Binary + } + 26 => { - () - } - MediumintUnsigned(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store32(iter_base + 8, payload7.reinterpret_as_int()) + DbColumnType::Varbinary + } + 27 => { - () - } - IntUnsigned(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_store32(iter_base + 8, payload8.reinterpret_as_int()) + DbColumnType::Tinyblob + } + 28 => { - () - } - BigintUnsigned(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_store64(iter_base + 8, payload9.reinterpret_as_int64()) + DbColumnType::Blob + } + 29 => { - () - } - Float(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_storef32(iter_base + 8, payload10) + DbColumnType::Mediumblob + } + 30 => { - () - } - Double(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_storef64(iter_base + 8, payload11) + DbColumnType::Longblob + } + 31 => { - () - } - Decimal(payload12) => { - mbt_ffi_store8(iter_base + 0, 13) + DbColumnType::Enumeration + } + 32 => { - let ptr13 = mbt_ffi_str2ptr(payload12) - mbt_ffi_store32(iter_base + 12, payload12.length()) - mbt_ffi_store32(iter_base + 8, ptr13) - cleanup_list.push(ptr13) + DbColumnType::Set + } + 33 => { - () - } - Date(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.year) - mbt_ffi_store8(iter_base + 12, payload14.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload14.day.to_int()) + DbColumnType::Bit + } + 34 => { - () - } - Datetime(payload15) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload15.date.year) - mbt_ffi_store8(iter_base + 12, payload15.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload15.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload15.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload15.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload15.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload15.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Timestamp(payload16) => { - mbt_ffi_store8(iter_base + 0, 16) - mbt_ffi_store32(iter_base + 8, payload16.date.year) - mbt_ffi_store8(iter_base + 12, payload16.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload16.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload16.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload16.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload16.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload16.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Time(payload17) => { - mbt_ffi_store8(iter_base + 0, 17) - mbt_ffi_store8(iter_base + 8, payload17.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload17.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload17.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload17.nanosecond.reinterpret_as_int(), - ) - - () - } - Year(payload18) => { - mbt_ffi_store8(iter_base + 0, 18) - mbt_ffi_store16(iter_base + 8, payload18.reinterpret_as_int()) + DbColumnType::Json + } + _ => panic() + } - () - } - Fixchar(payload19) => { - mbt_ffi_store8(iter_base + 0, 19) + let result53 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let ptr20 = mbt_ffi_str2ptr(payload19) - mbt_ffi_store32(iter_base + 12, payload19.length()) - mbt_ffi_store32(iter_base + 8, ptr20) - cleanup_list.push(ptr20) + array.push(DbColumn::{ordinal : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), name : result, db_type : lifted, db_type_name : result53}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) - () - } - Varchar(payload21) => { - mbt_ffi_store8(iter_base + 0, 20) + let array76 : Array[DbRow] = []; + for index77 = 0; index77 < (mbt_ffi_load32((return_area) + 16)); index77 = index77 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 12)) + (index77 * 8) - let ptr22 = mbt_ffi_str2ptr(payload21) - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, ptr22) - cleanup_list.push(ptr22) + let array74 : Array[DbValue] = []; + for index75 = 0; index75 < (mbt_ffi_load32((iter_base) + 4)); index75 = index75 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index75 * 24) - () - } - Tinytext(payload23) => { - mbt_ffi_store8(iter_base + 0, 21) + let lifted73 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let ptr24 = mbt_ffi_str2ptr(payload23) - mbt_ffi_store32(iter_base + 12, payload23.length()) - mbt_ffi_store32(iter_base + 8, ptr24) - cleanup_list.push(ptr24) + DbValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - () - } - Text(payload25) => { - mbt_ffi_store8(iter_base + 0, 22) + DbValue::Tinyint((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - let ptr26 = mbt_ffi_str2ptr(payload25) - mbt_ffi_store32(iter_base + 12, payload25.length()) - mbt_ffi_store32(iter_base + 8, ptr26) - cleanup_list.push(ptr26) + DbValue::Smallint((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - () - } - Mediumtext(payload27) => { - mbt_ffi_store8(iter_base + 0, 23) + DbValue::Mediumint(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - let ptr28 = mbt_ffi_str2ptr(payload27) - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, ptr28) - cleanup_list.push(ptr28) + DbValue::Int(mbt_ffi_load32((iter_base) + 8)) + } + 5 => { - () - } - Longtext(payload29) => { - mbt_ffi_store8(iter_base + 0, 24) + DbValue::Bigint(mbt_ffi_load64((iter_base) + 8)) + } + 6 => { - let ptr30 = mbt_ffi_str2ptr(payload29) - mbt_ffi_store32(iter_base + 12, payload29.length()) - mbt_ffi_store32(iter_base + 8, ptr30) - cleanup_list.push(ptr30) + DbValue::TinyintUnsigned((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 7 => { - () - } - Binary(payload31) => { - mbt_ffi_store8(iter_base + 0, 25) + DbValue::SmallintUnsigned((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 8 => { - let ptr32 = mbt_ffi_bytes2ptr(payload31) + DbValue::MediumintUnsigned((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 9 => { - mbt_ffi_store32(iter_base + 12, payload31.length()) - mbt_ffi_store32(iter_base + 8, ptr32) - cleanup_list.push(ptr32) + DbValue::IntUnsigned((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 10 => { - () - } - Varbinary(payload33) => { - mbt_ffi_store8(iter_base + 0, 26) + DbValue::BigintUnsigned((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 11 => { - let ptr34 = mbt_ffi_bytes2ptr(payload33) + DbValue::Float(mbt_ffi_loadf32((iter_base) + 8)) + } + 12 => { - mbt_ffi_store32(iter_base + 12, payload33.length()) - mbt_ffi_store32(iter_base + 8, ptr34) - cleanup_list.push(ptr34) + DbValue::Double(mbt_ffi_loadf64((iter_base) + 8)) + } + 13 => { - () - } - Tinyblob(payload35) => { - mbt_ffi_store8(iter_base + 0, 27) + let result55 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr36 = mbt_ffi_bytes2ptr(payload35) + DbValue::Decimal(result55) + } + 14 => { - mbt_ffi_store32(iter_base + 12, payload35.length()) - mbt_ffi_store32(iter_base + 8, ptr36) - cleanup_list.push(ptr36) + DbValue::Date(@types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}) + } + 15 => { - () - } - Blob(payload37) => { - mbt_ffi_store8(iter_base + 0, 28) + DbValue::Datetime(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 17)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()}}) + } + 16 => { - let ptr38 = mbt_ffi_bytes2ptr(payload37) + DbValue::Timestamp(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 17)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()}}) + } + 17 => { - mbt_ffi_store32(iter_base + 12, payload37.length()) - mbt_ffi_store32(iter_base + 8, ptr38) - cleanup_list.push(ptr38) + DbValue::Time(@types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 8)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 9)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 10)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 18 => { - () - } - Mediumblob(payload39) => { - mbt_ffi_store8(iter_base + 0, 29) + DbValue::Year((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 19 => { - let ptr40 = mbt_ffi_bytes2ptr(payload39) + let result56 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, ptr40) - cleanup_list.push(ptr40) + DbValue::Fixchar(result56) + } + 20 => { - () - } - Longblob(payload41) => { - mbt_ffi_store8(iter_base + 0, 30) + let result57 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr42 = mbt_ffi_bytes2ptr(payload41) + DbValue::Varchar(result57) + } + 21 => { - mbt_ffi_store32(iter_base + 12, payload41.length()) - mbt_ffi_store32(iter_base + 8, ptr42) - cleanup_list.push(ptr42) + let result58 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Enumeration(payload43) => { - mbt_ffi_store8(iter_base + 0, 31) + DbValue::Tinytext(result58) + } + 22 => { - let ptr44 = mbt_ffi_str2ptr(payload43) - mbt_ffi_store32(iter_base + 12, payload43.length()) - mbt_ffi_store32(iter_base + 8, ptr44) - cleanup_list.push(ptr44) + let result59 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Set(payload45) => { - mbt_ffi_store8(iter_base + 0, 32) + DbValue::Text(result59) + } + 23 => { - let ptr46 = mbt_ffi_str2ptr(payload45) - mbt_ffi_store32(iter_base + 12, payload45.length()) - mbt_ffi_store32(iter_base + 8, ptr46) - cleanup_list.push(ptr46) + let result60 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Bit(payload47) => { - mbt_ffi_store8(iter_base + 0, 33) - - let address = mbt_ffi_malloc(payload47.length() * 1) - for index = 0; index < payload47.length(); index = index + 1 { - let iter_elem : Bool = payload47[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload47.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - Json(payload48) => { - mbt_ffi_store8(iter_base + 0, 34) + DbValue::Mediumtext(result60) + } + 24 => { - let ptr49 = mbt_ffi_str2ptr(payload48) - mbt_ffi_store32(iter_base + 12, payload48.length()) - mbt_ffi_store32(iter_base + 8, ptr49) - cleanup_list.push(ptr49) + let result61 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Null => { - mbt_ffi_store8(iter_base + 0, 35) + DbValue::Longtext(result61) + } + 25 => { - () - } - } - } - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbTransactionQueryStream( - handle, - ptr, - statement.length(), - address51, - params.length(), - return_area, - ) - - let lifted57 = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok( - DbResultStream::DbResultStream(mbt_ffi_load32(return_area + 4)), - ) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result53 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result53) - } - 2 => { - let result54 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result54) - } - 3 => { - let result55 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result55) - } - 4 => { - let result56 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result56) - } - _ => panic() - } + let result62 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted57 - mbt_ffi_free(ptr) - mbt_ffi_free(address51) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + DbValue::Binary(result62) + } + 26 => { -///| -pub fn DbTransaction::execute( - self : DbTransaction, - statement : String, - params : Array[DbValue], -) -> Result[UInt64, Error_] { - let cleanup_list : Array[Int] = [] + let result63 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let DbTransaction(handle) = self + DbValue::Varbinary(result63) + } + 27 => { - let ptr = mbt_ffi_str2ptr(statement) + let result64 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let address51 = mbt_ffi_malloc(params.length() * 24) - for index52 = 0; index52 < params.length(); index52 = index52 + 1 { - let iter_elem : DbValue = params[index52] - let iter_base = address51 + index52 * 24 + DbValue::Tinyblob(result64) + } + 28 => { - match iter_elem { - Boolean(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload { 1 } else { 0 }) + let result65 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Tinyint(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload0)) + DbValue::Blob(result65) + } + 29 => { - () - } - Smallint(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload1)) + let result66 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Mediumint(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload2) + DbValue::Mediumblob(result66) + } + 30 => { - () - } - Int(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store32(iter_base + 8, payload3) + let result67 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Bigint(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store64(iter_base + 8, payload4) + DbValue::Longblob(result67) + } + 31 => { - () - } - TinyintUnsigned(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store8(iter_base + 8, payload5.to_int()) + let result68 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - SmallintUnsigned(payload6) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store16(iter_base + 8, payload6.reinterpret_as_int()) + DbValue::Enumeration(result68) + } + 32 => { - () - } - MediumintUnsigned(payload7) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store32(iter_base + 8, payload7.reinterpret_as_int()) + let result69 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - IntUnsigned(payload8) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_store32(iter_base + 8, payload8.reinterpret_as_int()) + DbValue::Set(result69) + } + 33 => { - () - } - BigintUnsigned(payload9) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_store64(iter_base + 8, payload9.reinterpret_as_int64()) + let array70 : Array[Bool] = []; + for index71 = 0; index71 < (mbt_ffi_load32((iter_base) + 12)); index71 = index71 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index71 * 1) - () - } - Float(payload10) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_storef32(iter_base + 8, payload10) + array70.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Double(payload11) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_storef64(iter_base + 8, payload11) + DbValue::Bit(array70) + } + 34 => { - () - } - Decimal(payload12) => { - mbt_ffi_store8(iter_base + 0, 13) + let result72 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr13 = mbt_ffi_str2ptr(payload12) - mbt_ffi_store32(iter_base + 12, payload12.length()) - mbt_ffi_store32(iter_base + 8, ptr13) - cleanup_list.push(ptr13) + DbValue::Json(result72) + } + 35 => { - () - } - Date(payload14) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload14.year) - mbt_ffi_store8(iter_base + 12, payload14.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload14.day.to_int()) + DbValue::Null + } + _ => panic() + } - () - } - Datetime(payload15) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload15.date.year) - mbt_ffi_store8(iter_base + 12, payload15.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload15.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload15.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload15.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload15.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload15.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Timestamp(payload16) => { - mbt_ffi_store8(iter_base + 0, 16) - mbt_ffi_store32(iter_base + 8, payload16.date.year) - mbt_ffi_store8(iter_base + 12, payload16.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload16.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload16.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload16.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload16.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload16.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Time(payload17) => { - mbt_ffi_store8(iter_base + 0, 17) - mbt_ffi_store8(iter_base + 8, payload17.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload17.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload17.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload17.nanosecond.reinterpret_as_int(), - ) - - () - } - Year(payload18) => { - mbt_ffi_store8(iter_base + 0, 18) - mbt_ffi_store16(iter_base + 8, payload18.reinterpret_as_int()) + array74.push(lifted73) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Fixchar(payload19) => { - mbt_ffi_store8(iter_base + 0, 19) + array76.push(DbRow::{values : array74}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 12)) + + Result::Ok(DbResult::{columns : array, rows : array76}) + } + 1 => { - let ptr20 = mbt_ffi_str2ptr(payload19) - mbt_ffi_store32(iter_base + 12, payload19.length()) - mbt_ffi_store32(iter_base + 8, ptr20) - cleanup_list.push(ptr20) + let lifted83 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - () - } - Varchar(payload21) => { - mbt_ffi_store8(iter_base + 0, 20) + let result78 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr22 = mbt_ffi_str2ptr(payload21) - mbt_ffi_store32(iter_base + 12, payload21.length()) - mbt_ffi_store32(iter_base + 8, ptr22) - cleanup_list.push(ptr22) + Error_::ConnectionFailure(result78) + } + 1 => { - () - } - Tinytext(payload23) => { - mbt_ffi_store8(iter_base + 0, 21) + let result79 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr24 = mbt_ffi_str2ptr(payload23) - mbt_ffi_store32(iter_base + 12, payload23.length()) - mbt_ffi_store32(iter_base + 8, ptr24) - cleanup_list.push(ptr24) + Error_::QueryParameterFailure(result79) + } + 2 => { - () - } - Text(payload25) => { - mbt_ffi_store8(iter_base + 0, 22) + let result80 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr26 = mbt_ffi_str2ptr(payload25) - mbt_ffi_store32(iter_base + 12, payload25.length()) - mbt_ffi_store32(iter_base + 8, ptr26) - cleanup_list.push(ptr26) + Error_::QueryExecutionFailure(result80) + } + 3 => { - () - } - Mediumtext(payload27) => { - mbt_ffi_store8(iter_base + 0, 23) + let result81 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr28 = mbt_ffi_str2ptr(payload27) - mbt_ffi_store32(iter_base + 12, payload27.length()) - mbt_ffi_store32(iter_base + 8, ptr28) - cleanup_list.push(ptr28) + Error_::QueryResponseFailure(result81) + } + 4 => { - () - } - Longtext(payload29) => { - mbt_ffi_store8(iter_base + 0, 24) + let result82 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr30 = mbt_ffi_str2ptr(payload29) - mbt_ffi_store32(iter_base + 12, payload29.length()) - mbt_ffi_store32(iter_base + 8, ptr30) - cleanup_list.push(ptr30) + Error_::Other(result82) + } + _ => panic() + } - () + Result::Err(lifted83) + } + _ => panic() } - Binary(payload31) => { - mbt_ffi_store8(iter_base + 0, 25) + let ret = lifted84 + mbt_ffi_free(ptr) + mbt_ffi_free(address51) + mbt_ffi_free(return_area) - let ptr32 = mbt_ffi_bytes2ptr(payload31) + cleanup_list.each(mbt_ffi_free) + return ret - mbt_ffi_store32(iter_base + 12, payload31.length()) - mbt_ffi_store32(iter_base + 8, ptr32) - cleanup_list.push(ptr32) +} +///| +pub fn DbTransaction::query_stream(self : DbTransaction, statement : String, params : Array[DbValue]) -> Result[DbResultStream, Error_] { + let cleanup_list : Array[Int] = [] + + let DbTransaction(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address51 = mbt_ffi_malloc((params).length() * 24); + for index52 = 0; index52 < (params).length(); index52 = index52 + 1 { + let iter_elem : DbValue = (params)[(index52)] + let iter_base = address51 + (index52 * 24); + + match iter_elem { + Boolean(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) + + () + } + Tinyint(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) + + () + } + Smallint(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) + + () + } + Mediumint(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) + + () + } + Int(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 8, payload3) + + () + } + Bigint(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store64((iter_base) + 8, payload4) + + () + } + TinyintUnsigned(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store8((iter_base) + 8, (payload5).to_int()) + + () + } + SmallintUnsigned(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store16((iter_base) + 8, (payload6).reinterpret_as_int()) + + () + } + MediumintUnsigned(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store32((iter_base) + 8, (payload7).reinterpret_as_int()) + + () + } + IntUnsigned(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_store32((iter_base) + 8, (payload8).reinterpret_as_int()) + + () + } + BigintUnsigned(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_store64((iter_base) + 8, (payload9).reinterpret_as_int64()) + + () + } + Float(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_storef32((iter_base) + 8, payload10) + + () + } + Double(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_storef64((iter_base) + 8, payload11) + + () + } + Decimal(payload12) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let ptr13 = mbt_ffi_str2ptr(payload12) + mbt_ffi_store32((iter_base) + 12, payload12.length()) + mbt_ffi_store32((iter_base) + 8, ptr13) + cleanup_list.push(ptr13) + + () + } + Date(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, (payload14).year) + mbt_ffi_store8((iter_base) + 12, ((payload14).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload14).day).to_int()) + + () + } + Datetime(payload15) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, ((payload15).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload15).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload15).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload15).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload15).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload15).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload15).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamp(payload16) => { + mbt_ffi_store8((iter_base) + 0, (16)) + mbt_ffi_store32((iter_base) + 8, ((payload16).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload16).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload16).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload16).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload16).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload16).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload16).time).nanosecond).reinterpret_as_int()) + + () + } + Time(payload17) => { + mbt_ffi_store8((iter_base) + 0, (17)) + mbt_ffi_store8((iter_base) + 8, ((payload17).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, ((payload17).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, ((payload17).second).to_int()) + mbt_ffi_store32((iter_base) + 12, ((payload17).nanosecond).reinterpret_as_int()) + + () + } + Year(payload18) => { + mbt_ffi_store8((iter_base) + 0, (18)) + mbt_ffi_store16((iter_base) + 8, (payload18).reinterpret_as_int()) + + () + } + Fixchar(payload19) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let ptr20 = mbt_ffi_str2ptr(payload19) + mbt_ffi_store32((iter_base) + 12, payload19.length()) + mbt_ffi_store32((iter_base) + 8, ptr20) + cleanup_list.push(ptr20) + + () + } + Varchar(payload21) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let ptr22 = mbt_ffi_str2ptr(payload21) + mbt_ffi_store32((iter_base) + 12, payload21.length()) + mbt_ffi_store32((iter_base) + 8, ptr22) + cleanup_list.push(ptr22) + + () + } + Tinytext(payload23) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + let ptr24 = mbt_ffi_str2ptr(payload23) + mbt_ffi_store32((iter_base) + 12, payload23.length()) + mbt_ffi_store32((iter_base) + 8, ptr24) + cleanup_list.push(ptr24) + + () + } + Text(payload25) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + let ptr26 = mbt_ffi_str2ptr(payload25) + mbt_ffi_store32((iter_base) + 12, payload25.length()) + mbt_ffi_store32((iter_base) + 8, ptr26) + cleanup_list.push(ptr26) + + () + } + Mediumtext(payload27) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr28 = mbt_ffi_str2ptr(payload27) + mbt_ffi_store32((iter_base) + 12, payload27.length()) + mbt_ffi_store32((iter_base) + 8, ptr28) + cleanup_list.push(ptr28) + + () + } + Longtext(payload29) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr30 = mbt_ffi_str2ptr(payload29) + mbt_ffi_store32((iter_base) + 12, payload29.length()) + mbt_ffi_store32((iter_base) + 8, ptr30) + cleanup_list.push(ptr30) + + () + } + Binary(payload31) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr32 = mbt_ffi_bytes2ptr(payload31) + + mbt_ffi_store32((iter_base) + 12, payload31.length()) + mbt_ffi_store32((iter_base) + 8, ptr32) + cleanup_list.push(ptr32) + + () + } + Varbinary(payload33) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr34 = mbt_ffi_bytes2ptr(payload33) + + mbt_ffi_store32((iter_base) + 12, payload33.length()) + mbt_ffi_store32((iter_base) + 8, ptr34) + cleanup_list.push(ptr34) + + () + } + Tinyblob(payload35) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + let ptr36 = mbt_ffi_bytes2ptr(payload35) + + mbt_ffi_store32((iter_base) + 12, payload35.length()) + mbt_ffi_store32((iter_base) + 8, ptr36) + cleanup_list.push(ptr36) + + () + } + Blob(payload37) => { + mbt_ffi_store8((iter_base) + 0, (28)) + + let ptr38 = mbt_ffi_bytes2ptr(payload37) + + mbt_ffi_store32((iter_base) + 12, payload37.length()) + mbt_ffi_store32((iter_base) + 8, ptr38) + cleanup_list.push(ptr38) + + () + } + Mediumblob(payload39) => { + mbt_ffi_store8((iter_base) + 0, (29)) + + let ptr40 = mbt_ffi_bytes2ptr(payload39) + + mbt_ffi_store32((iter_base) + 12, payload39.length()) + mbt_ffi_store32((iter_base) + 8, ptr40) + cleanup_list.push(ptr40) + + () + } + Longblob(payload41) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr42 = mbt_ffi_bytes2ptr(payload41) + + mbt_ffi_store32((iter_base) + 12, payload41.length()) + mbt_ffi_store32((iter_base) + 8, ptr42) + cleanup_list.push(ptr42) + + () + } + Enumeration(payload43) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let ptr44 = mbt_ffi_str2ptr(payload43) + mbt_ffi_store32((iter_base) + 12, payload43.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) + cleanup_list.push(ptr44) + + () + } + Set(payload45) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let ptr46 = mbt_ffi_str2ptr(payload45) + mbt_ffi_store32((iter_base) + 12, payload45.length()) + mbt_ffi_store32((iter_base) + 8, ptr46) + cleanup_list.push(ptr46) + + () + } + Bit(payload47) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let address = mbt_ffi_malloc((payload47).length() * 1); + for index = 0; index < (payload47).length(); index = index + 1 { + let iter_elem : Bool = (payload47)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload47).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + Json(payload48) => { + mbt_ffi_store8((iter_base) + 0, (34)) + + let ptr49 = mbt_ffi_str2ptr(payload48) + mbt_ffi_store32((iter_base) + 12, payload48.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) + cleanup_list.push(ptr49) + + () + } + Null => { + mbt_ffi_store8((iter_base) + 0, (35)) + + () + } + } - () } - Varbinary(payload33) => { - mbt_ffi_store8(iter_base + 0, 26) + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbTransactionQueryStream(handle, ptr, statement.length(), address51, (params).length(), return_area); - let ptr34 = mbt_ffi_bytes2ptr(payload33) + let lifted57 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - mbt_ffi_store32(iter_base + 12, payload33.length()) - mbt_ffi_store32(iter_base + 8, ptr34) - cleanup_list.push(ptr34) + Result::Ok(DbResultStream::DbResultStream(mbt_ffi_load32((return_area) + 4))) + } + 1 => { - () - } - Tinyblob(payload35) => { - mbt_ffi_store8(iter_base + 0, 27) + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - let ptr36 = mbt_ffi_bytes2ptr(payload35) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - mbt_ffi_store32(iter_base + 12, payload35.length()) - mbt_ffi_store32(iter_base + 8, ptr36) - cleanup_list.push(ptr36) + Error_::ConnectionFailure(result) + } + 1 => { - () - } - Blob(payload37) => { - mbt_ffi_store8(iter_base + 0, 28) + let result53 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr38 = mbt_ffi_bytes2ptr(payload37) + Error_::QueryParameterFailure(result53) + } + 2 => { - mbt_ffi_store32(iter_base + 12, payload37.length()) - mbt_ffi_store32(iter_base + 8, ptr38) - cleanup_list.push(ptr38) + let result54 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Mediumblob(payload39) => { - mbt_ffi_store8(iter_base + 0, 29) + Error_::QueryExecutionFailure(result54) + } + 3 => { + + let result55 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result55) + } + 4 => { - let ptr40 = mbt_ffi_bytes2ptr(payload39) + let result56 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, ptr40) - cleanup_list.push(ptr40) + Error_::Other(result56) + } + _ => panic() + } - () + Result::Err(lifted) + } + _ => panic() } - Longblob(payload41) => { - mbt_ffi_store8(iter_base + 0, 30) + let ret = lifted57 + mbt_ffi_free(ptr) + mbt_ffi_free(address51) + mbt_ffi_free(return_area) - let ptr42 = mbt_ffi_bytes2ptr(payload41) + cleanup_list.each(mbt_ffi_free) + return ret - mbt_ffi_store32(iter_base + 12, payload41.length()) - mbt_ffi_store32(iter_base + 8, ptr42) - cleanup_list.push(ptr42) +} +///| +pub fn DbTransaction::execute(self : DbTransaction, statement : String, params : Array[DbValue]) -> Result[UInt64, Error_] { + let cleanup_list : Array[Int] = [] + + let DbTransaction(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address51 = mbt_ffi_malloc((params).length() * 24); + for index52 = 0; index52 < (params).length(); index52 = index52 + 1 { + let iter_elem : DbValue = (params)[(index52)] + let iter_base = address51 + (index52 * 24); + + match iter_elem { + Boolean(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload { 1 } else { 0 })) + + () + } + Tinyint(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload0)) + + () + } + Smallint(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload1)) + + () + } + Mediumint(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload2) + + () + } + Int(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store32((iter_base) + 8, payload3) + + () + } + Bigint(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store64((iter_base) + 8, payload4) + + () + } + TinyintUnsigned(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store8((iter_base) + 8, (payload5).to_int()) + + () + } + SmallintUnsigned(payload6) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store16((iter_base) + 8, (payload6).reinterpret_as_int()) + + () + } + MediumintUnsigned(payload7) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store32((iter_base) + 8, (payload7).reinterpret_as_int()) + + () + } + IntUnsigned(payload8) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_store32((iter_base) + 8, (payload8).reinterpret_as_int()) + + () + } + BigintUnsigned(payload9) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_store64((iter_base) + 8, (payload9).reinterpret_as_int64()) + + () + } + Float(payload10) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_storef32((iter_base) + 8, payload10) + + () + } + Double(payload11) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_storef64((iter_base) + 8, payload11) + + () + } + Decimal(payload12) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let ptr13 = mbt_ffi_str2ptr(payload12) + mbt_ffi_store32((iter_base) + 12, payload12.length()) + mbt_ffi_store32((iter_base) + 8, ptr13) + cleanup_list.push(ptr13) + + () + } + Date(payload14) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, (payload14).year) + mbt_ffi_store8((iter_base) + 12, ((payload14).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload14).day).to_int()) + + () + } + Datetime(payload15) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, ((payload15).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload15).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload15).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload15).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload15).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload15).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload15).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamp(payload16) => { + mbt_ffi_store8((iter_base) + 0, (16)) + mbt_ffi_store32((iter_base) + 8, ((payload16).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload16).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload16).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload16).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload16).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload16).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload16).time).nanosecond).reinterpret_as_int()) + + () + } + Time(payload17) => { + mbt_ffi_store8((iter_base) + 0, (17)) + mbt_ffi_store8((iter_base) + 8, ((payload17).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, ((payload17).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, ((payload17).second).to_int()) + mbt_ffi_store32((iter_base) + 12, ((payload17).nanosecond).reinterpret_as_int()) + + () + } + Year(payload18) => { + mbt_ffi_store8((iter_base) + 0, (18)) + mbt_ffi_store16((iter_base) + 8, (payload18).reinterpret_as_int()) + + () + } + Fixchar(payload19) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let ptr20 = mbt_ffi_str2ptr(payload19) + mbt_ffi_store32((iter_base) + 12, payload19.length()) + mbt_ffi_store32((iter_base) + 8, ptr20) + cleanup_list.push(ptr20) + + () + } + Varchar(payload21) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let ptr22 = mbt_ffi_str2ptr(payload21) + mbt_ffi_store32((iter_base) + 12, payload21.length()) + mbt_ffi_store32((iter_base) + 8, ptr22) + cleanup_list.push(ptr22) + + () + } + Tinytext(payload23) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + let ptr24 = mbt_ffi_str2ptr(payload23) + mbt_ffi_store32((iter_base) + 12, payload23.length()) + mbt_ffi_store32((iter_base) + 8, ptr24) + cleanup_list.push(ptr24) + + () + } + Text(payload25) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + let ptr26 = mbt_ffi_str2ptr(payload25) + mbt_ffi_store32((iter_base) + 12, payload25.length()) + mbt_ffi_store32((iter_base) + 8, ptr26) + cleanup_list.push(ptr26) + + () + } + Mediumtext(payload27) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr28 = mbt_ffi_str2ptr(payload27) + mbt_ffi_store32((iter_base) + 12, payload27.length()) + mbt_ffi_store32((iter_base) + 8, ptr28) + cleanup_list.push(ptr28) + + () + } + Longtext(payload29) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr30 = mbt_ffi_str2ptr(payload29) + mbt_ffi_store32((iter_base) + 12, payload29.length()) + mbt_ffi_store32((iter_base) + 8, ptr30) + cleanup_list.push(ptr30) + + () + } + Binary(payload31) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr32 = mbt_ffi_bytes2ptr(payload31) + + mbt_ffi_store32((iter_base) + 12, payload31.length()) + mbt_ffi_store32((iter_base) + 8, ptr32) + cleanup_list.push(ptr32) + + () + } + Varbinary(payload33) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr34 = mbt_ffi_bytes2ptr(payload33) + + mbt_ffi_store32((iter_base) + 12, payload33.length()) + mbt_ffi_store32((iter_base) + 8, ptr34) + cleanup_list.push(ptr34) + + () + } + Tinyblob(payload35) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + let ptr36 = mbt_ffi_bytes2ptr(payload35) + + mbt_ffi_store32((iter_base) + 12, payload35.length()) + mbt_ffi_store32((iter_base) + 8, ptr36) + cleanup_list.push(ptr36) + + () + } + Blob(payload37) => { + mbt_ffi_store8((iter_base) + 0, (28)) + + let ptr38 = mbt_ffi_bytes2ptr(payload37) + + mbt_ffi_store32((iter_base) + 12, payload37.length()) + mbt_ffi_store32((iter_base) + 8, ptr38) + cleanup_list.push(ptr38) + + () + } + Mediumblob(payload39) => { + mbt_ffi_store8((iter_base) + 0, (29)) + + let ptr40 = mbt_ffi_bytes2ptr(payload39) + + mbt_ffi_store32((iter_base) + 12, payload39.length()) + mbt_ffi_store32((iter_base) + 8, ptr40) + cleanup_list.push(ptr40) + + () + } + Longblob(payload41) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr42 = mbt_ffi_bytes2ptr(payload41) + + mbt_ffi_store32((iter_base) + 12, payload41.length()) + mbt_ffi_store32((iter_base) + 8, ptr42) + cleanup_list.push(ptr42) + + () + } + Enumeration(payload43) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let ptr44 = mbt_ffi_str2ptr(payload43) + mbt_ffi_store32((iter_base) + 12, payload43.length()) + mbt_ffi_store32((iter_base) + 8, ptr44) + cleanup_list.push(ptr44) + + () + } + Set(payload45) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let ptr46 = mbt_ffi_str2ptr(payload45) + mbt_ffi_store32((iter_base) + 12, payload45.length()) + mbt_ffi_store32((iter_base) + 8, ptr46) + cleanup_list.push(ptr46) + + () + } + Bit(payload47) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let address = mbt_ffi_malloc((payload47).length() * 1); + for index = 0; index < (payload47).length(); index = index + 1 { + let iter_elem : Bool = (payload47)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload47).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + Json(payload48) => { + mbt_ffi_store8((iter_base) + 0, (34)) + + let ptr49 = mbt_ffi_str2ptr(payload48) + mbt_ffi_store32((iter_base) + 12, payload48.length()) + mbt_ffi_store32((iter_base) + 8, ptr49) + cleanup_list.push(ptr49) + + () + } + Null => { + mbt_ffi_store8((iter_base) + 0, (35)) + + () + } + } - () } - Enumeration(payload43) => { - mbt_ffi_store8(iter_base + 0, 31) + let return_area = mbt_ffi_malloc(24) + wasmImportMethodDbTransactionExecute(handle, ptr, statement.length(), address51, (params).length(), return_area); - let ptr44 = mbt_ffi_str2ptr(payload43) - mbt_ffi_store32(iter_base + 12, payload43.length()) - mbt_ffi_store32(iter_base + 8, ptr44) - cleanup_list.push(ptr44) + let lifted57 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - () - } - Set(payload45) => { - mbt_ffi_store8(iter_base + 0, 32) + Result::Ok((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + 1 => { - let ptr46 = mbt_ffi_str2ptr(payload45) - mbt_ffi_store32(iter_base + 12, payload45.length()) - mbt_ffi_store32(iter_base + 8, ptr46) - cleanup_list.push(ptr46) + let lifted = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - () - } - Bit(payload47) => { - mbt_ffi_store8(iter_base + 0, 33) - - let address = mbt_ffi_malloc(payload47.length() * 1) - for index = 0; index < payload47.length(); index = index + 1 { - let iter_elem : Bool = payload47[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload47.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - Json(payload48) => { - mbt_ffi_store8(iter_base + 0, 34) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let ptr49 = mbt_ffi_str2ptr(payload48) - mbt_ffi_store32(iter_base + 12, payload48.length()) - mbt_ffi_store32(iter_base + 8, ptr49) - cleanup_list.push(ptr49) + Error_::ConnectionFailure(result) + } + 1 => { - () - } - Null => { - mbt_ffi_store8(iter_base + 0, 35) + let result53 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - () - } - } - } - let return_area = mbt_ffi_malloc(24) - wasmImportMethodDbTransactionExecute( - handle, - ptr, - statement.length(), - address51, - params.length(), - return_area, - ) - - let lifted57 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 8) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result53 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryParameterFailure(result53) - } - 2 => { - let result54 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryExecutionFailure(result54) - } - 3 => { - let result55 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryResponseFailure(result55) - } - 4 => { - let result56 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::Other(result56) - } - _ => panic() + Error_::QueryParameterFailure(result53) + } + 2 => { + + let result54 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::QueryExecutionFailure(result54) + } + 3 => { + + let result55 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::QueryResponseFailure(result55) + } + 4 => { + + let result56 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::Other(result56) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted57 + mbt_ffi_free(ptr) + mbt_ffi_free(address51) + mbt_ffi_free(return_area) - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted57 - mbt_ffi_free(ptr) - mbt_ffi_free(address51) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + cleanup_list.each(mbt_ffi_free) + return ret +} ///| pub fn DbTransaction::commit(self : DbTransaction) -> Result[Unit, Error_] { - let DbTransaction(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbTransactionCommit(handle, return_area) - - let lifted4 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result0) - } - 2 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result1) - } - 3 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result2) - } - 4 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result3) - } - _ => panic() + + let DbTransaction(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbTransactionCommit(handle, return_area); + + let lifted4 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result0) + } + 2 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result1) + } + 3 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result2) + } + 4 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result3) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted4 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted4 - mbt_ffi_free(return_area) - return ret } - ///| pub fn DbTransaction::rollback(self : DbTransaction) -> Result[Unit, Error_] { - let DbTransaction(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbTransactionRollback(handle, return_area) - - let lifted4 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result0) - } - 2 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result1) - } - 3 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result2) - } - 4 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result3) - } - _ => panic() + + let DbTransaction(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbTransactionRollback(handle, return_area); + + let lifted4 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result0) + } + 2 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result1) + } + 3 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result2) + } + 4 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result3) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted4 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted4 - mbt_ffi_free(return_area) - return ret } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/rdbms/postgres/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/rdbms/postgres/ffi.mbt index 88852c7335..8bd1b64f14 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/rdbms/postgres/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/rdbms/postgres/ffi.mbt @@ -1,238 +1,167 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropLazyDbValue(resource : Int) = "golem:rdbms/postgres@1.5.0" "[resource-drop]lazy-db-value" -///| fn wasmImportResourceDropLazyDbColumnType(resource : Int) = "golem:rdbms/postgres@1.5.0" "[resource-drop]lazy-db-column-type" -///| fn wasmImportResourceDropDbResultStream(resource : Int) = "golem:rdbms/postgres@1.5.0" "[resource-drop]db-result-stream" -///| fn wasmImportResourceDropDbConnection(resource : Int) = "golem:rdbms/postgres@1.5.0" "[resource-drop]db-connection" -///| fn wasmImportResourceDropDbTransaction(resource : Int) = "golem:rdbms/postgres@1.5.0" "[resource-drop]db-transaction" -///| fn wasmImportConstructorLazyDbValue(p0 : Int) -> Int = "golem:rdbms/postgres@1.5.0" "[constructor]lazy-db-value" -///| -fn wasmImportMethodLazyDbValueGet(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]lazy-db-value.get" +fn wasmImportMethodLazyDbValueGet(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]lazy-db-value.get" -///| -fn wasmImportConstructorLazyDbColumnType( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, -) -> Int = "golem:rdbms/postgres@1.5.0" "[constructor]lazy-db-column-type" +fn wasmImportConstructorLazyDbColumnType(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) -> Int = "golem:rdbms/postgres@1.5.0" "[constructor]lazy-db-column-type" -///| -fn wasmImportMethodLazyDbColumnTypeGet(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]lazy-db-column-type.get" +fn wasmImportMethodLazyDbColumnTypeGet(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]lazy-db-column-type.get" -///| -fn wasmImportMethodDbResultStreamGetColumns(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-result-stream.get-columns" +fn wasmImportMethodDbResultStreamGetColumns(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-result-stream.get-columns" -///| -fn wasmImportMethodDbResultStreamGetNext(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-result-stream.get-next" +fn wasmImportMethodDbResultStreamGetNext(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-result-stream.get-next" -///| -fn wasmImportStaticDbConnectionOpen(p0 : Int, p1 : Int, p2 : Int) = "golem:rdbms/postgres@1.5.0" "[static]db-connection.open" +fn wasmImportStaticDbConnectionOpen(p0 : Int, p1 : Int, p2 : Int) = "golem:rdbms/postgres@1.5.0" "[static]db-connection.open" -///| -fn wasmImportMethodDbConnectionQuery( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/postgres@1.5.0" "[method]db-connection.query" +fn wasmImportMethodDbConnectionQuery(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-connection.query" -///| -fn wasmImportMethodDbConnectionQueryStream( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/postgres@1.5.0" "[method]db-connection.query-stream" +fn wasmImportMethodDbConnectionQueryStream(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-connection.query-stream" -///| -fn wasmImportMethodDbConnectionExecute( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/postgres@1.5.0" "[method]db-connection.execute" +fn wasmImportMethodDbConnectionExecute(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-connection.execute" -///| -fn wasmImportMethodDbConnectionBeginTransaction(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-connection.begin-transaction" +fn wasmImportMethodDbConnectionBeginTransaction(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-connection.begin-transaction" -///| -fn wasmImportMethodDbTransactionQuery( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/postgres@1.5.0" "[method]db-transaction.query" +fn wasmImportMethodDbTransactionQuery(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-transaction.query" -///| -fn wasmImportMethodDbTransactionQueryStream( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/postgres@1.5.0" "[method]db-transaction.query-stream" +fn wasmImportMethodDbTransactionQueryStream(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-transaction.query-stream" -///| -fn wasmImportMethodDbTransactionExecute( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:rdbms/postgres@1.5.0" "[method]db-transaction.execute" +fn wasmImportMethodDbTransactionExecute(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-transaction.execute" -///| -fn wasmImportMethodDbTransactionCommit(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-transaction.commit" +fn wasmImportMethodDbTransactionCommit(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-transaction.commit" -///| -fn wasmImportMethodDbTransactionRollback(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-transaction.rollback" +fn wasmImportMethodDbTransactionRollback(p0 : Int, p1 : Int) = "golem:rdbms/postgres@1.5.0" "[method]db-transaction.rollback" ///| -extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = - #|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +#owned(array) +extern "wasm" fn mbt_ffi_int_array2ptr(array : FixedArray[Int]) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = - #|(func (param i32) (result f32) local.get 0 f32.load) +extern "wasm" fn mbt_ffi_ptr2float_array(ptr : Int, len : Int) -> FixedArray[Float] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array32 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = +#|(func (param i32) (result f64) local.get 0 f64.load) ///| -extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_s) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) +extern "wasm" fn mbt_ffi_ptr2int_array(ptr : Int, len : Int) -> FixedArray[Int] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array32 +#| local.get 0) ///| -#owned(bytes) -extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +#owned(array) +extern "wasm" fn mbt_ffi_float_array2ptr(array : FixedArray[Float]) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) +extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = +#|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = - #|(func (param i32) (result f64) local.get 0 f64.load) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_s) +extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend8_s) ///| extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| -#owned(array) -extern "wasm" fn mbt_ffi_float_array2ptr(array : FixedArray[Float]) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend16_s) ///| -extern "wasm" fn mbt_ffi_ptr2float_array( - ptr : Int, - len : Int, -) -> FixedArray[Float] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array32 - #| local.get 0) +extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_s) ///| -extern "wasm" fn mbt_ffi_ptr2int_array(ptr : Int, len : Int) -> FixedArray[Int] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array32 - #| local.get 0) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = - #|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) +extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +#owned(bytes) +extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -#owned(array) -extern "wasm" fn mbt_ffi_int_array2ptr(array : FixedArray[Int]) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_s) ///| -extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend8_s) +extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = +#|(func (param i32) (result f32) local.get 0 f32.load) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = +#|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend16_s) +extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_u) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/rdbms/postgres/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/rdbms/postgres/top.mbt index 60945c486b..3e5868693a 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/rdbms/postgres/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/rdbms/postgres/top.mbt @@ -1,11133 +1,9972 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| pub(all) suberror Error_ { - ConnectionFailure(String) - QueryParameterFailure(String) - QueryExecutionFailure(String) - QueryResponseFailure(String) - Other(String) + ConnectionFailure(String) + QueryParameterFailure(String) + QueryExecutionFailure(String) + QueryResponseFailure(String) + Other(String) } derive(Show, Eq) - ///| pub(all) struct Interval { - months : Int - days : Int - microseconds : Int64 + months : Int; days : Int; microseconds : Int64 } derive(Show, Eq) - ///| pub(all) enum Int4bound { - Included(Int) - Excluded(Int) - Unbounded + Included(Int) + Excluded(Int) + Unbounded } derive(Show, Eq) - ///| pub(all) enum Int8bound { - Included(Int64) - Excluded(Int64) - Unbounded + Included(Int64) + Excluded(Int64) + Unbounded } derive(Show, Eq) - ///| pub(all) enum Numbound { - Included(String) - Excluded(String) - Unbounded + Included(String) + Excluded(String) + Unbounded } derive(Show, Eq) - ///| pub(all) enum Tsbound { - Included(@types.Timestamp) - Excluded(@types.Timestamp) - Unbounded + Included(@types.Timestamp) + Excluded(@types.Timestamp) + Unbounded } derive(Show, Eq) - ///| pub(all) enum Tstzbound { - Included(@types.Timestamptz) - Excluded(@types.Timestamptz) - Unbounded + Included(@types.Timestamptz) + Excluded(@types.Timestamptz) + Unbounded } derive(Show, Eq) - ///| pub(all) enum Datebound { - Included(@types.Date) - Excluded(@types.Date) - Unbounded + Included(@types.Date) + Excluded(@types.Date) + Unbounded } derive(Show, Eq) - ///| pub(all) struct Int4range { - start : Int4bound - end : Int4bound + start : Int4bound; end : Int4bound } derive(Show, Eq) - ///| pub(all) struct Int8range { - start : Int8bound - end : Int8bound + start : Int8bound; end : Int8bound } derive(Show, Eq) - ///| pub(all) struct Numrange { - start : Numbound - end : Numbound + start : Numbound; end : Numbound } derive(Show, Eq) - ///| pub(all) struct Tsrange { - start : Tsbound - end : Tsbound + start : Tsbound; end : Tsbound } derive(Show, Eq) - ///| pub(all) struct Tstzrange { - start : Tstzbound - end : Tstzbound + start : Tstzbound; end : Tstzbound } derive(Show, Eq) - ///| pub(all) struct Daterange { - start : Datebound - end : Datebound + start : Datebound; end : Datebound } derive(Show, Eq) - ///| pub(all) struct EnumerationType { - name : String + name : String } derive(Show, Eq) - ///| pub(all) struct Enumeration { - name : String - value : String + name : String; value : String } derive(Show, Eq) - ///| pub(all) struct SparseVec { - dim : Int - indices : FixedArray[Int] - values : FixedArray[Float] + dim : Int; indices : FixedArray[Int]; values : FixedArray[Float] } derive(Show, Eq) - ///| pub(all) struct LazyDbValue(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn LazyDbValue::drop(self : LazyDbValue) -> Unit { - let LazyDbValue(resource) = self - wasmImportResourceDropLazyDbValue(resource) + let LazyDbValue(resource) = self + wasmImportResourceDropLazyDbValue(resource) } - ///| pub(all) struct Composite { - name : String - values : Array[LazyDbValue] + name : String; values : Array[LazyDbValue] } derive(Show, Eq) - ///| pub(all) struct Domain { - name : String - value : LazyDbValue + name : String; value : LazyDbValue } derive(Show, Eq) - ///| pub(all) enum ValueBound { - Included(LazyDbValue) - Excluded(LazyDbValue) - Unbounded + Included(LazyDbValue) + Excluded(LazyDbValue) + Unbounded } derive(Show, Eq) - ///| pub(all) struct ValuesRange { - start : ValueBound - end : ValueBound + start : ValueBound; end : ValueBound } derive(Show, Eq) - ///| pub(all) struct Range { - name : String - value : ValuesRange + name : String; value : ValuesRange } derive(Show, Eq) - ///| pub(all) enum DbValue { - Character(Int) - Int2(Int) - Int4(Int) - Int8(Int64) - Float4(Float) - Float8(Double) - Numeric(String) - Boolean(Bool) - Text(String) - Varchar(String) - Bpchar(String) - Timestamp(@types.Timestamp) - Timestamptz(@types.Timestamptz) - Date(@types.Date) - Time(@types.Time) - Timetz(@types.Timetz) - Interval(Interval) - Bytea(FixedArray[Byte]) - Json(String) - Jsonb(String) - Jsonpath(String) - Xml(String) - Uuid(@types.Uuid) - Inet(@types.IpAddress) - Cidr(@types.IpAddress) - Macaddr(@types.MacAddress) - Bit(Array[Bool]) - Varbit(Array[Bool]) - Int4range(Int4range) - Int8range(Int8range) - Numrange(Numrange) - Tsrange(Tsrange) - Tstzrange(Tstzrange) - Daterange(Daterange) - Money(Int64) - Oid(UInt) - Enumeration(Enumeration) - Composite(Composite) - Domain(Domain) - Array(Array[LazyDbValue]) - Range(Range) - Null - Vector(FixedArray[Float]) - Halfvec(FixedArray[Float]) - Sparsevec(SparseVec) + Character(Int) + Int2(Int) + Int4(Int) + Int8(Int64) + Float4(Float) + Float8(Double) + Numeric(String) + Boolean(Bool) + Text(String) + Varchar(String) + Bpchar(String) + Timestamp(@types.Timestamp) + Timestamptz(@types.Timestamptz) + Date(@types.Date) + Time(@types.Time) + Timetz(@types.Timetz) + Interval(Interval) + Bytea(FixedArray[Byte]) + Json(String) + Jsonb(String) + Jsonpath(String) + Xml(String) + Uuid(@types.Uuid) + Inet(@types.IpAddress) + Cidr(@types.IpAddress) + Macaddr(@types.MacAddress) + Bit(Array[Bool]) + Varbit(Array[Bool]) + Int4range(Int4range) + Int8range(Int8range) + Numrange(Numrange) + Tsrange(Tsrange) + Tstzrange(Tstzrange) + Daterange(Daterange) + Money(Int64) + Oid(UInt) + Enumeration(Enumeration) + Composite(Composite) + Domain(Domain) + Array(Array[LazyDbValue]) + Range(Range) + Null + Vector(FixedArray[Float]) + Halfvec(FixedArray[Float]) + Sparsevec(SparseVec) } derive(Show, Eq) - ///| pub(all) struct LazyDbColumnType(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn LazyDbColumnType::drop(self : LazyDbColumnType) -> Unit { - let LazyDbColumnType(resource) = self - wasmImportResourceDropLazyDbColumnType(resource) + let LazyDbColumnType(resource) = self + wasmImportResourceDropLazyDbColumnType(resource) } - ///| pub(all) struct CompositeType { - name : String - attributes : Array[(String, LazyDbColumnType)] + name : String; attributes : Array[(String, LazyDbColumnType)] } derive(Show, Eq) - ///| pub(all) struct DomainType { - name : String - base_type : LazyDbColumnType + name : String; base_type : LazyDbColumnType } derive(Show, Eq) - ///| pub(all) struct RangeType { - name : String - base_type : LazyDbColumnType + name : String; base_type : LazyDbColumnType } derive(Show, Eq) - ///| pub(all) enum DbColumnType { - Character - Int2 - Int4 - Int8 - Float4 - Float8 - Numeric - Boolean - Text - Varchar - Bpchar - Timestamp - Timestamptz - Date - Time - Timetz - Interval - Bytea - Uuid - Xml - Json - Jsonb - Jsonpath - Inet - Cidr - Macaddr - Bit - Varbit - Int4range - Int8range - Numrange - Tsrange - Tstzrange - Daterange - Money - Oid - Enumeration(EnumerationType) - Composite(CompositeType) - Domain(DomainType) - Array(LazyDbColumnType) - Range(RangeType) - Vector - Halfvec - Sparsevec + Character + Int2 + Int4 + Int8 + Float4 + Float8 + Numeric + Boolean + Text + Varchar + Bpchar + Timestamp + Timestamptz + Date + Time + Timetz + Interval + Bytea + Uuid + Xml + Json + Jsonb + Jsonpath + Inet + Cidr + Macaddr + Bit + Varbit + Int4range + Int8range + Numrange + Tsrange + Tstzrange + Daterange + Money + Oid + Enumeration(EnumerationType) + Composite(CompositeType) + Domain(DomainType) + Array(LazyDbColumnType) + Range(RangeType) + Vector + Halfvec + Sparsevec } derive(Show, Eq) - ///| pub(all) struct DbColumn { - ordinal : UInt64 - name : String - db_type : DbColumnType - db_type_name : String + ordinal : UInt64; name : String; db_type : DbColumnType; db_type_name : String } derive(Show, Eq) - ///| /// A single row of values pub(all) struct DbRow { - values : Array[DbValue] + values : Array[DbValue] } derive(Show, Eq) - ///| pub(all) struct DbResult { - columns : Array[DbColumn] - rows : Array[DbRow] + columns : Array[DbColumn]; rows : Array[DbRow] } derive(Show, Eq) - ///| /// A potentially very large and lazy stream of rows: pub(all) struct DbResultStream(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn DbResultStream::drop(self : DbResultStream) -> Unit { - let DbResultStream(resource) = self - wasmImportResourceDropDbResultStream(resource) + let DbResultStream(resource) = self + wasmImportResourceDropDbResultStream(resource) } - ///| pub(all) struct DbConnection(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn DbConnection::drop(self : DbConnection) -> Unit { - let DbConnection(resource) = self - wasmImportResourceDropDbConnection(resource) + let DbConnection(resource) = self + wasmImportResourceDropDbConnection(resource) } - ///| pub(all) struct DbTransaction(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn DbTransaction::drop(self : DbTransaction) -> Unit { - let DbTransaction(resource) = self - wasmImportResourceDropDbTransaction(resource) + let DbTransaction(resource) = self + wasmImportResourceDropDbTransaction(resource) } - ///| pub fn LazyDbValue::lazy_db_value(value : DbValue) -> LazyDbValue { - let cleanup_list : Array[Int] = [] - let return_area = mbt_ffi_malloc(56) - - match value { - Character(payload) => { - mbt_ffi_store8(return_area + 0, 0) - mbt_ffi_store8(return_area + 8, mbt_ffi_extend8(payload)) - - () - } - Int2(payload0) => { - mbt_ffi_store8(return_area + 0, 1) - mbt_ffi_store16(return_area + 8, mbt_ffi_extend16(payload0)) - - () - } - Int4(payload1) => { - mbt_ffi_store8(return_area + 0, 2) - mbt_ffi_store32(return_area + 8, payload1) - - () - } - Int8(payload2) => { - mbt_ffi_store8(return_area + 0, 3) - mbt_ffi_store64(return_area + 8, payload2) - - () - } - Float4(payload3) => { - mbt_ffi_store8(return_area + 0, 4) - mbt_ffi_storef32(return_area + 8, payload3) - - () - } - Float8(payload4) => { - mbt_ffi_store8(return_area + 0, 5) - mbt_ffi_storef64(return_area + 8, payload4) - - () - } - Numeric(payload5) => { - mbt_ffi_store8(return_area + 0, 6) - - let ptr = mbt_ffi_str2ptr(payload5) - mbt_ffi_store32(return_area + 12, payload5.length()) - mbt_ffi_store32(return_area + 8, ptr) - cleanup_list.push(ptr) - - () - } - Boolean(payload6) => { - mbt_ffi_store8(return_area + 0, 7) - mbt_ffi_store8(return_area + 8, if payload6 { 1 } else { 0 }) - - () - } - Text(payload7) => { - mbt_ffi_store8(return_area + 0, 8) - - let ptr8 = mbt_ffi_str2ptr(payload7) - mbt_ffi_store32(return_area + 12, payload7.length()) - mbt_ffi_store32(return_area + 8, ptr8) - cleanup_list.push(ptr8) - - () - } - Varchar(payload9) => { - mbt_ffi_store8(return_area + 0, 9) - - let ptr10 = mbt_ffi_str2ptr(payload9) - mbt_ffi_store32(return_area + 12, payload9.length()) - mbt_ffi_store32(return_area + 8, ptr10) - cleanup_list.push(ptr10) - - () - } - Bpchar(payload11) => { - mbt_ffi_store8(return_area + 0, 10) - - let ptr12 = mbt_ffi_str2ptr(payload11) - mbt_ffi_store32(return_area + 12, payload11.length()) - mbt_ffi_store32(return_area + 8, ptr12) - cleanup_list.push(ptr12) - - () - } - Timestamp(payload13) => { - mbt_ffi_store8(return_area + 0, 11) - mbt_ffi_store32(return_area + 8, payload13.date.year) - mbt_ffi_store8(return_area + 12, payload13.date.month.to_int()) - mbt_ffi_store8(return_area + 13, payload13.date.day.to_int()) - mbt_ffi_store8(return_area + 16, payload13.time.hour.to_int()) - mbt_ffi_store8(return_area + 17, payload13.time.minute.to_int()) - mbt_ffi_store8(return_area + 18, payload13.time.second.to_int()) - mbt_ffi_store32( - return_area + 20, - payload13.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Timestamptz(payload14) => { - mbt_ffi_store8(return_area + 0, 12) - mbt_ffi_store32(return_area + 8, payload14.timestamp.date.year) - mbt_ffi_store8(return_area + 12, payload14.timestamp.date.month.to_int()) - mbt_ffi_store8(return_area + 13, payload14.timestamp.date.day.to_int()) - mbt_ffi_store8(return_area + 16, payload14.timestamp.time.hour.to_int()) - mbt_ffi_store8(return_area + 17, payload14.timestamp.time.minute.to_int()) - mbt_ffi_store8(return_area + 18, payload14.timestamp.time.second.to_int()) - mbt_ffi_store32( - return_area + 20, - payload14.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(return_area + 24, payload14.offset) - - () - } - Date(payload15) => { - mbt_ffi_store8(return_area + 0, 13) - mbt_ffi_store32(return_area + 8, payload15.year) - mbt_ffi_store8(return_area + 12, payload15.month.to_int()) - mbt_ffi_store8(return_area + 13, payload15.day.to_int()) - - () - } - Time(payload16) => { - mbt_ffi_store8(return_area + 0, 14) - mbt_ffi_store8(return_area + 8, payload16.hour.to_int()) - mbt_ffi_store8(return_area + 9, payload16.minute.to_int()) - mbt_ffi_store8(return_area + 10, payload16.second.to_int()) - mbt_ffi_store32( - return_area + 12, - payload16.nanosecond.reinterpret_as_int(), - ) - - () - } - Timetz(payload17) => { - mbt_ffi_store8(return_area + 0, 15) - mbt_ffi_store8(return_area + 8, payload17.time.hour.to_int()) - mbt_ffi_store8(return_area + 9, payload17.time.minute.to_int()) - mbt_ffi_store8(return_area + 10, payload17.time.second.to_int()) - mbt_ffi_store32( - return_area + 12, - payload17.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(return_area + 16, payload17.offset) - - () - } - Interval(payload18) => { - mbt_ffi_store8(return_area + 0, 16) - mbt_ffi_store32(return_area + 8, payload18.months) - mbt_ffi_store32(return_area + 12, payload18.days) - mbt_ffi_store64(return_area + 16, payload18.microseconds) - - () - } - Bytea(payload19) => { - mbt_ffi_store8(return_area + 0, 17) - - let ptr20 = mbt_ffi_bytes2ptr(payload19) - - mbt_ffi_store32(return_area + 12, payload19.length()) - mbt_ffi_store32(return_area + 8, ptr20) - cleanup_list.push(ptr20) - - () - } - Json(payload21) => { - mbt_ffi_store8(return_area + 0, 18) - - let ptr22 = mbt_ffi_str2ptr(payload21) - mbt_ffi_store32(return_area + 12, payload21.length()) - mbt_ffi_store32(return_area + 8, ptr22) - cleanup_list.push(ptr22) - - () - } - Jsonb(payload23) => { - mbt_ffi_store8(return_area + 0, 19) - - let ptr24 = mbt_ffi_str2ptr(payload23) - mbt_ffi_store32(return_area + 12, payload23.length()) - mbt_ffi_store32(return_area + 8, ptr24) - cleanup_list.push(ptr24) - - () - } - Jsonpath(payload25) => { - mbt_ffi_store8(return_area + 0, 20) - - let ptr26 = mbt_ffi_str2ptr(payload25) - mbt_ffi_store32(return_area + 12, payload25.length()) - mbt_ffi_store32(return_area + 8, ptr26) - cleanup_list.push(ptr26) - - () - } - Xml(payload27) => { - mbt_ffi_store8(return_area + 0, 21) - - let ptr28 = mbt_ffi_str2ptr(payload27) - mbt_ffi_store32(return_area + 12, payload27.length()) - mbt_ffi_store32(return_area + 8, ptr28) - cleanup_list.push(ptr28) - - () - } - Uuid(payload29) => { - mbt_ffi_store8(return_area + 0, 22) - mbt_ffi_store64( - return_area + 8, - payload29.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - return_area + 16, - payload29.low_bits.reinterpret_as_int64(), - ) - - () - } - Inet(payload30) => { - mbt_ffi_store8(return_area + 0, 23) - - match payload30 { - Ipv4(payload31) => { - mbt_ffi_store8(return_area + 8, 0) - mbt_ffi_store8(return_area + 10, payload31.0.to_int()) - mbt_ffi_store8(return_area + 11, payload31.1.to_int()) - mbt_ffi_store8(return_area + 12, payload31.2.to_int()) - mbt_ffi_store8(return_area + 13, payload31.3.to_int()) - - () - } - Ipv6(payload32) => { - mbt_ffi_store8(return_area + 8, 1) - mbt_ffi_store16(return_area + 10, payload32.0.reinterpret_as_int()) - mbt_ffi_store16(return_area + 12, payload32.1.reinterpret_as_int()) - mbt_ffi_store16(return_area + 14, payload32.2.reinterpret_as_int()) - mbt_ffi_store16(return_area + 16, payload32.3.reinterpret_as_int()) - mbt_ffi_store16(return_area + 18, payload32.4.reinterpret_as_int()) - mbt_ffi_store16(return_area + 20, payload32.5.reinterpret_as_int()) - mbt_ffi_store16(return_area + 22, payload32.6.reinterpret_as_int()) - mbt_ffi_store16(return_area + 24, payload32.7.reinterpret_as_int()) - - () - } - } + let cleanup_list : Array[Int] = [] + let return_area = mbt_ffi_malloc(56) - () - } - Cidr(payload33) => { - mbt_ffi_store8(return_area + 0, 24) - - match payload33 { - Ipv4(payload34) => { - mbt_ffi_store8(return_area + 8, 0) - mbt_ffi_store8(return_area + 10, payload34.0.to_int()) - mbt_ffi_store8(return_area + 11, payload34.1.to_int()) - mbt_ffi_store8(return_area + 12, payload34.2.to_int()) - mbt_ffi_store8(return_area + 13, payload34.3.to_int()) - - () - } - Ipv6(payload35) => { - mbt_ffi_store8(return_area + 8, 1) - mbt_ffi_store16(return_area + 10, payload35.0.reinterpret_as_int()) - mbt_ffi_store16(return_area + 12, payload35.1.reinterpret_as_int()) - mbt_ffi_store16(return_area + 14, payload35.2.reinterpret_as_int()) - mbt_ffi_store16(return_area + 16, payload35.3.reinterpret_as_int()) - mbt_ffi_store16(return_area + 18, payload35.4.reinterpret_as_int()) - mbt_ffi_store16(return_area + 20, payload35.5.reinterpret_as_int()) - mbt_ffi_store16(return_area + 22, payload35.6.reinterpret_as_int()) - mbt_ffi_store16(return_area + 24, payload35.7.reinterpret_as_int()) - - () - } - } + match value { + Character(payload) => { + mbt_ffi_store8((return_area) + 0, (0)) + mbt_ffi_store8((return_area) + 8, mbt_ffi_extend8(payload)) - () - } - Macaddr(payload36) => { - mbt_ffi_store8(return_area + 0, 25) - mbt_ffi_store8(return_area + 8, payload36.octets.0.to_int()) - mbt_ffi_store8(return_area + 9, payload36.octets.1.to_int()) - mbt_ffi_store8(return_area + 10, payload36.octets.2.to_int()) - mbt_ffi_store8(return_area + 11, payload36.octets.3.to_int()) - mbt_ffi_store8(return_area + 12, payload36.octets.4.to_int()) - mbt_ffi_store8(return_area + 13, payload36.octets.5.to_int()) - - () - } - Bit(payload37) => { - mbt_ffi_store8(return_area + 0, 26) - - let address = mbt_ffi_malloc(payload37.length() * 1) - for index = 0; index < payload37.length(); index = index + 1 { - let iter_elem : Bool = payload37[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(return_area + 12, payload37.length()) - mbt_ffi_store32(return_area + 8, address) - cleanup_list.push(address) - - () - } - Varbit(payload38) => { - mbt_ffi_store8(return_area + 0, 27) - - let address39 = mbt_ffi_malloc(payload38.length() * 1) - for index40 = 0; index40 < payload38.length(); index40 = index40 + 1 { - let iter_elem : Bool = payload38[index40] - let iter_base = address39 + index40 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(return_area + 12, payload38.length()) - mbt_ffi_store32(return_area + 8, address39) - cleanup_list.push(address39) - - () - } - Int4range(payload41) => { - mbt_ffi_store8(return_area + 0, 28) - - match payload41.start { - Included(payload42) => { - mbt_ffi_store8(return_area + 8, 0) - mbt_ffi_store32(return_area + 12, payload42) - - () - } - Excluded(payload43) => { - mbt_ffi_store8(return_area + 8, 1) - mbt_ffi_store32(return_area + 12, payload43) - - () - } - Unbounded => { - mbt_ffi_store8(return_area + 8, 2) - - () - } - } + () + } + Int2(payload0) => { + mbt_ffi_store8((return_area) + 0, (1)) + mbt_ffi_store16((return_area) + 8, mbt_ffi_extend16(payload0)) - match payload41.end { - Included(payload45) => { - mbt_ffi_store8(return_area + 16, 0) - mbt_ffi_store32(return_area + 20, payload45) + () + } + Int4(payload1) => { + mbt_ffi_store8((return_area) + 0, (2)) + mbt_ffi_store32((return_area) + 8, payload1) - () - } - Excluded(payload46) => { - mbt_ffi_store8(return_area + 16, 1) - mbt_ffi_store32(return_area + 20, payload46) + () + } + Int8(payload2) => { + mbt_ffi_store8((return_area) + 0, (3)) + mbt_ffi_store64((return_area) + 8, payload2) - () - } - Unbounded => { - mbt_ffi_store8(return_area + 16, 2) + () + } + Float4(payload3) => { + mbt_ffi_store8((return_area) + 0, (4)) + mbt_ffi_storef32((return_area) + 8, payload3) - () - } - } + () + } + Float8(payload4) => { + mbt_ffi_store8((return_area) + 0, (5)) + mbt_ffi_storef64((return_area) + 8, payload4) - () - } - Int8range(payload48) => { - mbt_ffi_store8(return_area + 0, 29) - - match payload48.start { - Included(payload49) => { - mbt_ffi_store8(return_area + 8, 0) - mbt_ffi_store64(return_area + 16, payload49) - - () - } - Excluded(payload50) => { - mbt_ffi_store8(return_area + 8, 1) - mbt_ffi_store64(return_area + 16, payload50) - - () - } - Unbounded => { - mbt_ffi_store8(return_area + 8, 2) - - () - } - } + () + } + Numeric(payload5) => { + mbt_ffi_store8((return_area) + 0, (6)) - match payload48.end { - Included(payload52) => { - mbt_ffi_store8(return_area + 24, 0) - mbt_ffi_store64(return_area + 32, payload52) + let ptr = mbt_ffi_str2ptr(payload5) + mbt_ffi_store32((return_area) + 12, payload5.length()) + mbt_ffi_store32((return_area) + 8, ptr) + cleanup_list.push(ptr) - () - } - Excluded(payload53) => { - mbt_ffi_store8(return_area + 24, 1) - mbt_ffi_store64(return_area + 32, payload53) + () + } + Boolean(payload6) => { + mbt_ffi_store8((return_area) + 0, (7)) + mbt_ffi_store8((return_area) + 8, (if payload6 { 1 } else { 0 })) - () - } - Unbounded => { - mbt_ffi_store8(return_area + 24, 2) + () + } + Text(payload7) => { + mbt_ffi_store8((return_area) + 0, (8)) - () - } - } + let ptr8 = mbt_ffi_str2ptr(payload7) + mbt_ffi_store32((return_area) + 12, payload7.length()) + mbt_ffi_store32((return_area) + 8, ptr8) + cleanup_list.push(ptr8) - () - } - Numrange(payload55) => { - mbt_ffi_store8(return_area + 0, 30) - - match payload55.start { - Included(payload56) => { - mbt_ffi_store8(return_area + 8, 0) - - let ptr57 = mbt_ffi_str2ptr(payload56) - mbt_ffi_store32(return_area + 16, payload56.length()) - mbt_ffi_store32(return_area + 12, ptr57) - cleanup_list.push(ptr57) - - () - } - Excluded(payload58) => { - mbt_ffi_store8(return_area + 8, 1) - - let ptr59 = mbt_ffi_str2ptr(payload58) - mbt_ffi_store32(return_area + 16, payload58.length()) - mbt_ffi_store32(return_area + 12, ptr59) - cleanup_list.push(ptr59) - - () - } - Unbounded => { - mbt_ffi_store8(return_area + 8, 2) - - () - } - } + () + } + Varchar(payload9) => { + mbt_ffi_store8((return_area) + 0, (9)) - match payload55.end { - Included(payload61) => { - mbt_ffi_store8(return_area + 20, 0) + let ptr10 = mbt_ffi_str2ptr(payload9) + mbt_ffi_store32((return_area) + 12, payload9.length()) + mbt_ffi_store32((return_area) + 8, ptr10) + cleanup_list.push(ptr10) - let ptr62 = mbt_ffi_str2ptr(payload61) - mbt_ffi_store32(return_area + 28, payload61.length()) - mbt_ffi_store32(return_area + 24, ptr62) - cleanup_list.push(ptr62) + () + } + Bpchar(payload11) => { + mbt_ffi_store8((return_area) + 0, (10)) - () - } - Excluded(payload63) => { - mbt_ffi_store8(return_area + 20, 1) + let ptr12 = mbt_ffi_str2ptr(payload11) + mbt_ffi_store32((return_area) + 12, payload11.length()) + mbt_ffi_store32((return_area) + 8, ptr12) + cleanup_list.push(ptr12) - let ptr64 = mbt_ffi_str2ptr(payload63) - mbt_ffi_store32(return_area + 28, payload63.length()) - mbt_ffi_store32(return_area + 24, ptr64) - cleanup_list.push(ptr64) + () + } + Timestamp(payload13) => { + mbt_ffi_store8((return_area) + 0, (11)) + mbt_ffi_store32((return_area) + 8, ((payload13).date).year) + mbt_ffi_store8((return_area) + 12, (((payload13).date).month).to_int()) + mbt_ffi_store8((return_area) + 13, (((payload13).date).day).to_int()) + mbt_ffi_store8((return_area) + 16, (((payload13).time).hour).to_int()) + mbt_ffi_store8((return_area) + 17, (((payload13).time).minute).to_int()) + mbt_ffi_store8((return_area) + 18, (((payload13).time).second).to_int()) + mbt_ffi_store32((return_area) + 20, (((payload13).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamptz(payload14) => { + mbt_ffi_store8((return_area) + 0, (12)) + mbt_ffi_store32((return_area) + 8, (((payload14).timestamp).date).year) + mbt_ffi_store8((return_area) + 12, ((((payload14).timestamp).date).month).to_int()) + mbt_ffi_store8((return_area) + 13, ((((payload14).timestamp).date).day).to_int()) + mbt_ffi_store8((return_area) + 16, ((((payload14).timestamp).time).hour).to_int()) + mbt_ffi_store8((return_area) + 17, ((((payload14).timestamp).time).minute).to_int()) + mbt_ffi_store8((return_area) + 18, ((((payload14).timestamp).time).second).to_int()) + mbt_ffi_store32((return_area) + 20, ((((payload14).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((return_area) + 24, (payload14).offset) + + () + } + Date(payload15) => { + mbt_ffi_store8((return_area) + 0, (13)) + mbt_ffi_store32((return_area) + 8, (payload15).year) + mbt_ffi_store8((return_area) + 12, ((payload15).month).to_int()) + mbt_ffi_store8((return_area) + 13, ((payload15).day).to_int()) - () - } - Unbounded => { - mbt_ffi_store8(return_area + 20, 2) + () + } + Time(payload16) => { + mbt_ffi_store8((return_area) + 0, (14)) + mbt_ffi_store8((return_area) + 8, ((payload16).hour).to_int()) + mbt_ffi_store8((return_area) + 9, ((payload16).minute).to_int()) + mbt_ffi_store8((return_area) + 10, ((payload16).second).to_int()) + mbt_ffi_store32((return_area) + 12, ((payload16).nanosecond).reinterpret_as_int()) + + () + } + Timetz(payload17) => { + mbt_ffi_store8((return_area) + 0, (15)) + mbt_ffi_store8((return_area) + 8, (((payload17).time).hour).to_int()) + mbt_ffi_store8((return_area) + 9, (((payload17).time).minute).to_int()) + mbt_ffi_store8((return_area) + 10, (((payload17).time).second).to_int()) + mbt_ffi_store32((return_area) + 12, (((payload17).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((return_area) + 16, (payload17).offset) + + () + } + Interval(payload18) => { + mbt_ffi_store8((return_area) + 0, (16)) + mbt_ffi_store32((return_area) + 8, (payload18).months) + mbt_ffi_store32((return_area) + 12, (payload18).days) + mbt_ffi_store64((return_area) + 16, (payload18).microseconds) - () - } - } + () + } + Bytea(payload19) => { + mbt_ffi_store8((return_area) + 0, (17)) - () - } - Tsrange(payload66) => { - mbt_ffi_store8(return_area + 0, 31) - - match payload66.start { - Included(payload67) => { - mbt_ffi_store8(return_area + 8, 0) - mbt_ffi_store32(return_area + 12, payload67.date.year) - mbt_ffi_store8(return_area + 16, payload67.date.month.to_int()) - mbt_ffi_store8(return_area + 17, payload67.date.day.to_int()) - mbt_ffi_store8(return_area + 20, payload67.time.hour.to_int()) - mbt_ffi_store8(return_area + 21, payload67.time.minute.to_int()) - mbt_ffi_store8(return_area + 22, payload67.time.second.to_int()) - mbt_ffi_store32( - return_area + 24, - payload67.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload68) => { - mbt_ffi_store8(return_area + 8, 1) - mbt_ffi_store32(return_area + 12, payload68.date.year) - mbt_ffi_store8(return_area + 16, payload68.date.month.to_int()) - mbt_ffi_store8(return_area + 17, payload68.date.day.to_int()) - mbt_ffi_store8(return_area + 20, payload68.time.hour.to_int()) - mbt_ffi_store8(return_area + 21, payload68.time.minute.to_int()) - mbt_ffi_store8(return_area + 22, payload68.time.second.to_int()) - mbt_ffi_store32( - return_area + 24, - payload68.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(return_area + 8, 2) - - () - } - } + let ptr20 = mbt_ffi_bytes2ptr(payload19) - match payload66.end { - Included(payload70) => { - mbt_ffi_store8(return_area + 28, 0) - mbt_ffi_store32(return_area + 32, payload70.date.year) - mbt_ffi_store8(return_area + 36, payload70.date.month.to_int()) - mbt_ffi_store8(return_area + 37, payload70.date.day.to_int()) - mbt_ffi_store8(return_area + 40, payload70.time.hour.to_int()) - mbt_ffi_store8(return_area + 41, payload70.time.minute.to_int()) - mbt_ffi_store8(return_area + 42, payload70.time.second.to_int()) - mbt_ffi_store32( - return_area + 44, - payload70.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload71) => { - mbt_ffi_store8(return_area + 28, 1) - mbt_ffi_store32(return_area + 32, payload71.date.year) - mbt_ffi_store8(return_area + 36, payload71.date.month.to_int()) - mbt_ffi_store8(return_area + 37, payload71.date.day.to_int()) - mbt_ffi_store8(return_area + 40, payload71.time.hour.to_int()) - mbt_ffi_store8(return_area + 41, payload71.time.minute.to_int()) - mbt_ffi_store8(return_area + 42, payload71.time.second.to_int()) - mbt_ffi_store32( - return_area + 44, - payload71.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(return_area + 28, 2) - - () - } - } + mbt_ffi_store32((return_area) + 12, payload19.length()) + mbt_ffi_store32((return_area) + 8, ptr20) + cleanup_list.push(ptr20) - () - } - Tstzrange(payload73) => { - mbt_ffi_store8(return_area + 0, 32) - - match payload73.start { - Included(payload74) => { - mbt_ffi_store8(return_area + 8, 0) - mbt_ffi_store32(return_area + 12, payload74.timestamp.date.year) - mbt_ffi_store8( - return_area + 16, - payload74.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - return_area + 17, - payload74.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - return_area + 20, - payload74.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - return_area + 21, - payload74.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - return_area + 22, - payload74.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - return_area + 24, - payload74.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(return_area + 28, payload74.offset) - - () - } - Excluded(payload75) => { - mbt_ffi_store8(return_area + 8, 1) - mbt_ffi_store32(return_area + 12, payload75.timestamp.date.year) - mbt_ffi_store8( - return_area + 16, - payload75.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - return_area + 17, - payload75.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - return_area + 20, - payload75.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - return_area + 21, - payload75.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - return_area + 22, - payload75.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - return_area + 24, - payload75.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(return_area + 28, payload75.offset) - - () - } - Unbounded => { - mbt_ffi_store8(return_area + 8, 2) - - () - } - } + () + } + Json(payload21) => { + mbt_ffi_store8((return_area) + 0, (18)) - match payload73.end { - Included(payload77) => { - mbt_ffi_store8(return_area + 32, 0) - mbt_ffi_store32(return_area + 36, payload77.timestamp.date.year) - mbt_ffi_store8( - return_area + 40, - payload77.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - return_area + 41, - payload77.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - return_area + 44, - payload77.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - return_area + 45, - payload77.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - return_area + 46, - payload77.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - return_area + 48, - payload77.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(return_area + 52, payload77.offset) - - () - } - Excluded(payload78) => { - mbt_ffi_store8(return_area + 32, 1) - mbt_ffi_store32(return_area + 36, payload78.timestamp.date.year) - mbt_ffi_store8( - return_area + 40, - payload78.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - return_area + 41, - payload78.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - return_area + 44, - payload78.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - return_area + 45, - payload78.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - return_area + 46, - payload78.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - return_area + 48, - payload78.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(return_area + 52, payload78.offset) - - () - } - Unbounded => { - mbt_ffi_store8(return_area + 32, 2) - - () - } - } + let ptr22 = mbt_ffi_str2ptr(payload21) + mbt_ffi_store32((return_area) + 12, payload21.length()) + mbt_ffi_store32((return_area) + 8, ptr22) + cleanup_list.push(ptr22) - () - } - Daterange(payload80) => { - mbt_ffi_store8(return_area + 0, 33) - - match payload80.start { - Included(payload81) => { - mbt_ffi_store8(return_area + 8, 0) - mbt_ffi_store32(return_area + 12, payload81.year) - mbt_ffi_store8(return_area + 16, payload81.month.to_int()) - mbt_ffi_store8(return_area + 17, payload81.day.to_int()) - - () - } - Excluded(payload82) => { - mbt_ffi_store8(return_area + 8, 1) - mbt_ffi_store32(return_area + 12, payload82.year) - mbt_ffi_store8(return_area + 16, payload82.month.to_int()) - mbt_ffi_store8(return_area + 17, payload82.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(return_area + 8, 2) - - () - } - } + () + } + Jsonb(payload23) => { + mbt_ffi_store8((return_area) + 0, (19)) - match payload80.end { - Included(payload84) => { - mbt_ffi_store8(return_area + 20, 0) - mbt_ffi_store32(return_area + 24, payload84.year) - mbt_ffi_store8(return_area + 28, payload84.month.to_int()) - mbt_ffi_store8(return_area + 29, payload84.day.to_int()) - - () - } - Excluded(payload85) => { - mbt_ffi_store8(return_area + 20, 1) - mbt_ffi_store32(return_area + 24, payload85.year) - mbt_ffi_store8(return_area + 28, payload85.month.to_int()) - mbt_ffi_store8(return_area + 29, payload85.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(return_area + 20, 2) - - () - } - } + let ptr24 = mbt_ffi_str2ptr(payload23) + mbt_ffi_store32((return_area) + 12, payload23.length()) + mbt_ffi_store32((return_area) + 8, ptr24) + cleanup_list.push(ptr24) - () - } - Money(payload87) => { - mbt_ffi_store8(return_area + 0, 34) - mbt_ffi_store64(return_area + 8, payload87) - - () - } - Oid(payload88) => { - mbt_ffi_store8(return_area + 0, 35) - mbt_ffi_store32(return_area + 8, payload88.reinterpret_as_int()) - - () - } - Enumeration(payload89) => { - mbt_ffi_store8(return_area + 0, 36) - - let ptr90 = mbt_ffi_str2ptr(payload89.name) - mbt_ffi_store32(return_area + 12, payload89.name.length()) - mbt_ffi_store32(return_area + 8, ptr90) - - let ptr91 = mbt_ffi_str2ptr(payload89.value) - mbt_ffi_store32(return_area + 20, payload89.value.length()) - mbt_ffi_store32(return_area + 16, ptr91) - cleanup_list.push(ptr90) - cleanup_list.push(ptr91) - - () - } - Composite(payload92) => { - mbt_ffi_store8(return_area + 0, 37) - - let ptr93 = mbt_ffi_str2ptr(payload92.name) - mbt_ffi_store32(return_area + 12, payload92.name.length()) - mbt_ffi_store32(return_area + 8, ptr93) - - let address94 = mbt_ffi_malloc(payload92.values.length() * 4) - for index95 = 0 - index95 < payload92.values.length() - index95 = index95 + 1 { - let iter_elem : LazyDbValue = payload92.values[index95] - let iter_base = address94 + index95 * 4 - - let LazyDbValue(handle) = iter_elem - mbt_ffi_store32(iter_base + 0, handle) - } - mbt_ffi_store32(return_area + 20, payload92.values.length()) - mbt_ffi_store32(return_area + 16, address94) - cleanup_list.push(ptr93) - cleanup_list.push(address94) - - () - } - Domain(payload96) => { - mbt_ffi_store8(return_area + 0, 38) - - let ptr97 = mbt_ffi_str2ptr(payload96.name) - mbt_ffi_store32(return_area + 12, payload96.name.length()) - mbt_ffi_store32(return_area + 8, ptr97) - - let LazyDbValue(handle98) = payload96.value - mbt_ffi_store32(return_area + 16, handle98) - cleanup_list.push(ptr97) - - () - } - Array(payload99) => { - mbt_ffi_store8(return_area + 0, 39) - - let address101 = mbt_ffi_malloc(payload99.length() * 4) - for index102 = 0; index102 < payload99.length(); index102 = index102 + 1 { - let iter_elem : LazyDbValue = payload99[index102] - let iter_base = address101 + index102 * 4 - - let LazyDbValue(handle100) = iter_elem - mbt_ffi_store32(iter_base + 0, handle100) - } - mbt_ffi_store32(return_area + 12, payload99.length()) - mbt_ffi_store32(return_area + 8, address101) - cleanup_list.push(address101) + () + } + Jsonpath(payload25) => { + mbt_ffi_store8((return_area) + 0, (20)) - () - } - Range(payload103) => { - mbt_ffi_store8(return_area + 0, 40) + let ptr26 = mbt_ffi_str2ptr(payload25) + mbt_ffi_store32((return_area) + 12, payload25.length()) + mbt_ffi_store32((return_area) + 8, ptr26) + cleanup_list.push(ptr26) - let ptr104 = mbt_ffi_str2ptr(payload103.name) - mbt_ffi_store32(return_area + 12, payload103.name.length()) - mbt_ffi_store32(return_area + 8, ptr104) + () + } + Xml(payload27) => { + mbt_ffi_store8((return_area) + 0, (21)) - match payload103.value.start { - Included(payload105) => { - mbt_ffi_store8(return_area + 16, 0) + let ptr28 = mbt_ffi_str2ptr(payload27) + mbt_ffi_store32((return_area) + 12, payload27.length()) + mbt_ffi_store32((return_area) + 8, ptr28) + cleanup_list.push(ptr28) - let LazyDbValue(handle106) = payload105 - mbt_ffi_store32(return_area + 20, handle106) + () + } + Uuid(payload29) => { + mbt_ffi_store8((return_area) + 0, (22)) + mbt_ffi_store64((return_area) + 8, ((payload29).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((return_area) + 16, ((payload29).low_bits).reinterpret_as_int64()) - () - } - Excluded(payload107) => { - mbt_ffi_store8(return_area + 16, 1) + () + } + Inet(payload30) => { + mbt_ffi_store8((return_area) + 0, (23)) + + match payload30 { + Ipv4(payload31) => { + mbt_ffi_store8((return_area) + 8, (0)) + mbt_ffi_store8((return_area) + 10, ((payload31).0).to_int()) + mbt_ffi_store8((return_area) + 11, ((payload31).1).to_int()) + mbt_ffi_store8((return_area) + 12, ((payload31).2).to_int()) + mbt_ffi_store8((return_area) + 13, ((payload31).3).to_int()) + + () + } + Ipv6(payload32) => { + mbt_ffi_store8((return_area) + 8, (1)) + mbt_ffi_store16((return_area) + 10, ((payload32).0).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 12, ((payload32).1).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 14, ((payload32).2).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 16, ((payload32).3).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 18, ((payload32).4).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 20, ((payload32).5).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 22, ((payload32).6).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 24, ((payload32).7).reinterpret_as_int()) + + () + } + } + + () + } + Cidr(payload33) => { + mbt_ffi_store8((return_area) + 0, (24)) + + match payload33 { + Ipv4(payload34) => { + mbt_ffi_store8((return_area) + 8, (0)) + mbt_ffi_store8((return_area) + 10, ((payload34).0).to_int()) + mbt_ffi_store8((return_area) + 11, ((payload34).1).to_int()) + mbt_ffi_store8((return_area) + 12, ((payload34).2).to_int()) + mbt_ffi_store8((return_area) + 13, ((payload34).3).to_int()) + + () + } + Ipv6(payload35) => { + mbt_ffi_store8((return_area) + 8, (1)) + mbt_ffi_store16((return_area) + 10, ((payload35).0).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 12, ((payload35).1).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 14, ((payload35).2).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 16, ((payload35).3).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 18, ((payload35).4).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 20, ((payload35).5).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 22, ((payload35).6).reinterpret_as_int()) + mbt_ffi_store16((return_area) + 24, ((payload35).7).reinterpret_as_int()) + + () + } + } + + () + } + Macaddr(payload36) => { + mbt_ffi_store8((return_area) + 0, (25)) + mbt_ffi_store8((return_area) + 8, (((payload36).octets).0).to_int()) + mbt_ffi_store8((return_area) + 9, (((payload36).octets).1).to_int()) + mbt_ffi_store8((return_area) + 10, (((payload36).octets).2).to_int()) + mbt_ffi_store8((return_area) + 11, (((payload36).octets).3).to_int()) + mbt_ffi_store8((return_area) + 12, (((payload36).octets).4).to_int()) + mbt_ffi_store8((return_area) + 13, (((payload36).octets).5).to_int()) + + () + } + Bit(payload37) => { + mbt_ffi_store8((return_area) + 0, (26)) - let LazyDbValue(handle108) = payload107 - mbt_ffi_store32(return_area + 20, handle108) + let address = mbt_ffi_malloc((payload37).length() * 1); + for index = 0; index < (payload37).length(); index = index + 1 { + let iter_elem : Bool = (payload37)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) - () - } - Unbounded => { - mbt_ffi_store8(return_area + 16, 2) + } + mbt_ffi_store32((return_area) + 12, (payload37).length()) + mbt_ffi_store32((return_area) + 8, address) + cleanup_list.push(address) - () - } - } + () + } + Varbit(payload38) => { + mbt_ffi_store8((return_area) + 0, (27)) - match payload103.value.end { - Included(payload110) => { - mbt_ffi_store8(return_area + 24, 0) + let address39 = mbt_ffi_malloc((payload38).length() * 1); + for index40 = 0; index40 < (payload38).length(); index40 = index40 + 1 { + let iter_elem : Bool = (payload38)[(index40)] + let iter_base = address39 + (index40 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) - let LazyDbValue(handle111) = payload110 - mbt_ffi_store32(return_area + 28, handle111) + } + mbt_ffi_store32((return_area) + 12, (payload38).length()) + mbt_ffi_store32((return_area) + 8, address39) + cleanup_list.push(address39) - () - } - Excluded(payload112) => { - mbt_ffi_store8(return_area + 24, 1) + () + } + Int4range(payload41) => { + mbt_ffi_store8((return_area) + 0, (28)) + + match (payload41).start { + Included(payload42) => { + mbt_ffi_store8((return_area) + 8, (0)) + mbt_ffi_store32((return_area) + 12, payload42) + + () + } + Excluded(payload43) => { + mbt_ffi_store8((return_area) + 8, (1)) + mbt_ffi_store32((return_area) + 12, payload43) + + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 8, (2)) + + () + } + } + + match (payload41).end { + Included(payload45) => { + mbt_ffi_store8((return_area) + 16, (0)) + mbt_ffi_store32((return_area) + 20, payload45) + + () + } + Excluded(payload46) => { + mbt_ffi_store8((return_area) + 16, (1)) + mbt_ffi_store32((return_area) + 20, payload46) + + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 16, (2)) + + () + } + } + + () + } + Int8range(payload48) => { + mbt_ffi_store8((return_area) + 0, (29)) + + match (payload48).start { + Included(payload49) => { + mbt_ffi_store8((return_area) + 8, (0)) + mbt_ffi_store64((return_area) + 16, payload49) + + () + } + Excluded(payload50) => { + mbt_ffi_store8((return_area) + 8, (1)) + mbt_ffi_store64((return_area) + 16, payload50) + + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 8, (2)) + + () + } + } + + match (payload48).end { + Included(payload52) => { + mbt_ffi_store8((return_area) + 24, (0)) + mbt_ffi_store64((return_area) + 32, payload52) + + () + } + Excluded(payload53) => { + mbt_ffi_store8((return_area) + 24, (1)) + mbt_ffi_store64((return_area) + 32, payload53) + + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 24, (2)) + + () + } + } + + () + } + Numrange(payload55) => { + mbt_ffi_store8((return_area) + 0, (30)) + + match (payload55).start { + Included(payload56) => { + mbt_ffi_store8((return_area) + 8, (0)) + + let ptr57 = mbt_ffi_str2ptr(payload56) + mbt_ffi_store32((return_area) + 16, payload56.length()) + mbt_ffi_store32((return_area) + 12, ptr57) + cleanup_list.push(ptr57) + + () + } + Excluded(payload58) => { + mbt_ffi_store8((return_area) + 8, (1)) + + let ptr59 = mbt_ffi_str2ptr(payload58) + mbt_ffi_store32((return_area) + 16, payload58.length()) + mbt_ffi_store32((return_area) + 12, ptr59) + cleanup_list.push(ptr59) + + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 8, (2)) + + () + } + } + + match (payload55).end { + Included(payload61) => { + mbt_ffi_store8((return_area) + 20, (0)) + + let ptr62 = mbt_ffi_str2ptr(payload61) + mbt_ffi_store32((return_area) + 28, payload61.length()) + mbt_ffi_store32((return_area) + 24, ptr62) + cleanup_list.push(ptr62) + + () + } + Excluded(payload63) => { + mbt_ffi_store8((return_area) + 20, (1)) + + let ptr64 = mbt_ffi_str2ptr(payload63) + mbt_ffi_store32((return_area) + 28, payload63.length()) + mbt_ffi_store32((return_area) + 24, ptr64) + cleanup_list.push(ptr64) + + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 20, (2)) + + () + } + } + + () + } + Tsrange(payload66) => { + mbt_ffi_store8((return_area) + 0, (31)) + + match (payload66).start { + Included(payload67) => { + mbt_ffi_store8((return_area) + 8, (0)) + mbt_ffi_store32((return_area) + 12, ((payload67).date).year) + mbt_ffi_store8((return_area) + 16, (((payload67).date).month).to_int()) + mbt_ffi_store8((return_area) + 17, (((payload67).date).day).to_int()) + mbt_ffi_store8((return_area) + 20, (((payload67).time).hour).to_int()) + mbt_ffi_store8((return_area) + 21, (((payload67).time).minute).to_int()) + mbt_ffi_store8((return_area) + 22, (((payload67).time).second).to_int()) + mbt_ffi_store32((return_area) + 24, (((payload67).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload68) => { + mbt_ffi_store8((return_area) + 8, (1)) + mbt_ffi_store32((return_area) + 12, ((payload68).date).year) + mbt_ffi_store8((return_area) + 16, (((payload68).date).month).to_int()) + mbt_ffi_store8((return_area) + 17, (((payload68).date).day).to_int()) + mbt_ffi_store8((return_area) + 20, (((payload68).time).hour).to_int()) + mbt_ffi_store8((return_area) + 21, (((payload68).time).minute).to_int()) + mbt_ffi_store8((return_area) + 22, (((payload68).time).second).to_int()) + mbt_ffi_store32((return_area) + 24, (((payload68).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 8, (2)) + + () + } + } + + match (payload66).end { + Included(payload70) => { + mbt_ffi_store8((return_area) + 28, (0)) + mbt_ffi_store32((return_area) + 32, ((payload70).date).year) + mbt_ffi_store8((return_area) + 36, (((payload70).date).month).to_int()) + mbt_ffi_store8((return_area) + 37, (((payload70).date).day).to_int()) + mbt_ffi_store8((return_area) + 40, (((payload70).time).hour).to_int()) + mbt_ffi_store8((return_area) + 41, (((payload70).time).minute).to_int()) + mbt_ffi_store8((return_area) + 42, (((payload70).time).second).to_int()) + mbt_ffi_store32((return_area) + 44, (((payload70).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload71) => { + mbt_ffi_store8((return_area) + 28, (1)) + mbt_ffi_store32((return_area) + 32, ((payload71).date).year) + mbt_ffi_store8((return_area) + 36, (((payload71).date).month).to_int()) + mbt_ffi_store8((return_area) + 37, (((payload71).date).day).to_int()) + mbt_ffi_store8((return_area) + 40, (((payload71).time).hour).to_int()) + mbt_ffi_store8((return_area) + 41, (((payload71).time).minute).to_int()) + mbt_ffi_store8((return_area) + 42, (((payload71).time).second).to_int()) + mbt_ffi_store32((return_area) + 44, (((payload71).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 28, (2)) + + () + } + } + + () + } + Tstzrange(payload73) => { + mbt_ffi_store8((return_area) + 0, (32)) + + match (payload73).start { + Included(payload74) => { + mbt_ffi_store8((return_area) + 8, (0)) + mbt_ffi_store32((return_area) + 12, (((payload74).timestamp).date).year) + mbt_ffi_store8((return_area) + 16, ((((payload74).timestamp).date).month).to_int()) + mbt_ffi_store8((return_area) + 17, ((((payload74).timestamp).date).day).to_int()) + mbt_ffi_store8((return_area) + 20, ((((payload74).timestamp).time).hour).to_int()) + mbt_ffi_store8((return_area) + 21, ((((payload74).timestamp).time).minute).to_int()) + mbt_ffi_store8((return_area) + 22, ((((payload74).timestamp).time).second).to_int()) + mbt_ffi_store32((return_area) + 24, ((((payload74).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((return_area) + 28, (payload74).offset) + + () + } + Excluded(payload75) => { + mbt_ffi_store8((return_area) + 8, (1)) + mbt_ffi_store32((return_area) + 12, (((payload75).timestamp).date).year) + mbt_ffi_store8((return_area) + 16, ((((payload75).timestamp).date).month).to_int()) + mbt_ffi_store8((return_area) + 17, ((((payload75).timestamp).date).day).to_int()) + mbt_ffi_store8((return_area) + 20, ((((payload75).timestamp).time).hour).to_int()) + mbt_ffi_store8((return_area) + 21, ((((payload75).timestamp).time).minute).to_int()) + mbt_ffi_store8((return_area) + 22, ((((payload75).timestamp).time).second).to_int()) + mbt_ffi_store32((return_area) + 24, ((((payload75).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((return_area) + 28, (payload75).offset) + + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 8, (2)) + + () + } + } + + match (payload73).end { + Included(payload77) => { + mbt_ffi_store8((return_area) + 32, (0)) + mbt_ffi_store32((return_area) + 36, (((payload77).timestamp).date).year) + mbt_ffi_store8((return_area) + 40, ((((payload77).timestamp).date).month).to_int()) + mbt_ffi_store8((return_area) + 41, ((((payload77).timestamp).date).day).to_int()) + mbt_ffi_store8((return_area) + 44, ((((payload77).timestamp).time).hour).to_int()) + mbt_ffi_store8((return_area) + 45, ((((payload77).timestamp).time).minute).to_int()) + mbt_ffi_store8((return_area) + 46, ((((payload77).timestamp).time).second).to_int()) + mbt_ffi_store32((return_area) + 48, ((((payload77).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((return_area) + 52, (payload77).offset) + + () + } + Excluded(payload78) => { + mbt_ffi_store8((return_area) + 32, (1)) + mbt_ffi_store32((return_area) + 36, (((payload78).timestamp).date).year) + mbt_ffi_store8((return_area) + 40, ((((payload78).timestamp).date).month).to_int()) + mbt_ffi_store8((return_area) + 41, ((((payload78).timestamp).date).day).to_int()) + mbt_ffi_store8((return_area) + 44, ((((payload78).timestamp).time).hour).to_int()) + mbt_ffi_store8((return_area) + 45, ((((payload78).timestamp).time).minute).to_int()) + mbt_ffi_store8((return_area) + 46, ((((payload78).timestamp).time).second).to_int()) + mbt_ffi_store32((return_area) + 48, ((((payload78).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((return_area) + 52, (payload78).offset) + + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 32, (2)) + + () + } + } + + () + } + Daterange(payload80) => { + mbt_ffi_store8((return_area) + 0, (33)) + + match (payload80).start { + Included(payload81) => { + mbt_ffi_store8((return_area) + 8, (0)) + mbt_ffi_store32((return_area) + 12, (payload81).year) + mbt_ffi_store8((return_area) + 16, ((payload81).month).to_int()) + mbt_ffi_store8((return_area) + 17, ((payload81).day).to_int()) + + () + } + Excluded(payload82) => { + mbt_ffi_store8((return_area) + 8, (1)) + mbt_ffi_store32((return_area) + 12, (payload82).year) + mbt_ffi_store8((return_area) + 16, ((payload82).month).to_int()) + mbt_ffi_store8((return_area) + 17, ((payload82).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 8, (2)) + + () + } + } + + match (payload80).end { + Included(payload84) => { + mbt_ffi_store8((return_area) + 20, (0)) + mbt_ffi_store32((return_area) + 24, (payload84).year) + mbt_ffi_store8((return_area) + 28, ((payload84).month).to_int()) + mbt_ffi_store8((return_area) + 29, ((payload84).day).to_int()) + + () + } + Excluded(payload85) => { + mbt_ffi_store8((return_area) + 20, (1)) + mbt_ffi_store32((return_area) + 24, (payload85).year) + mbt_ffi_store8((return_area) + 28, ((payload85).month).to_int()) + mbt_ffi_store8((return_area) + 29, ((payload85).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 20, (2)) + + () + } + } + + () + } + Money(payload87) => { + mbt_ffi_store8((return_area) + 0, (34)) + mbt_ffi_store64((return_area) + 8, payload87) - let LazyDbValue(handle113) = payload112 - mbt_ffi_store32(return_area + 28, handle113) + () + } + Oid(payload88) => { + mbt_ffi_store8((return_area) + 0, (35)) + mbt_ffi_store32((return_area) + 8, (payload88).reinterpret_as_int()) - () - } - Unbounded => { - mbt_ffi_store8(return_area + 24, 2) + () + } + Enumeration(payload89) => { + mbt_ffi_store8((return_area) + 0, (36)) - () - } - } - cleanup_list.push(ptr104) + let ptr90 = mbt_ffi_str2ptr((payload89).name) + mbt_ffi_store32((return_area) + 12, (payload89).name.length()) + mbt_ffi_store32((return_area) + 8, ptr90) - () - } - Null => { - mbt_ffi_store8(return_area + 0, 41) + let ptr91 = mbt_ffi_str2ptr((payload89).value) + mbt_ffi_store32((return_area) + 20, (payload89).value.length()) + mbt_ffi_store32((return_area) + 16, ptr91) + cleanup_list.push(ptr90) + cleanup_list.push(ptr91) - () - } - Vector(payload116) => { - mbt_ffi_store8(return_area + 0, 42) + () + } + Composite(payload92) => { + mbt_ffi_store8((return_area) + 0, (37)) - let ptr117 = mbt_ffi_float_array2ptr(payload116) + let ptr93 = mbt_ffi_str2ptr((payload92).name) + mbt_ffi_store32((return_area) + 12, (payload92).name.length()) + mbt_ffi_store32((return_area) + 8, ptr93) - mbt_ffi_store32(return_area + 12, payload116.length()) - mbt_ffi_store32(return_area + 8, ptr117) - cleanup_list.push(ptr117) + let address94 = mbt_ffi_malloc(((payload92).values).length() * 4); + for index95 = 0; index95 < ((payload92).values).length(); index95 = index95 + 1 { + let iter_elem : LazyDbValue = ((payload92).values)[(index95)] + let iter_base = address94 + (index95 * 4); - () - } - Halfvec(payload118) => { - mbt_ffi_store8(return_area + 0, 43) + let LazyDbValue(handle) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle) - let ptr119 = mbt_ffi_float_array2ptr(payload118) + } + mbt_ffi_store32((return_area) + 20, ((payload92).values).length()) + mbt_ffi_store32((return_area) + 16, address94) + cleanup_list.push(ptr93) + cleanup_list.push(address94) - mbt_ffi_store32(return_area + 12, payload118.length()) - mbt_ffi_store32(return_area + 8, ptr119) - cleanup_list.push(ptr119) + () + } + Domain(payload96) => { + mbt_ffi_store8((return_area) + 0, (38)) - () - } - Sparsevec(payload120) => { - mbt_ffi_store8(return_area + 0, 44) - mbt_ffi_store32(return_area + 8, payload120.dim) + let ptr97 = mbt_ffi_str2ptr((payload96).name) + mbt_ffi_store32((return_area) + 12, (payload96).name.length()) + mbt_ffi_store32((return_area) + 8, ptr97) - let ptr121 = mbt_ffi_int_array2ptr(payload120.indices) + let LazyDbValue(handle98) = (payload96).value + mbt_ffi_store32((return_area) + 16, handle98) + cleanup_list.push(ptr97) - mbt_ffi_store32(return_area + 16, payload120.indices.length()) - mbt_ffi_store32(return_area + 12, ptr121) + () + } + Array(payload99) => { + mbt_ffi_store8((return_area) + 0, (39)) - let ptr122 = mbt_ffi_float_array2ptr(payload120.values) + let address101 = mbt_ffi_malloc((payload99).length() * 4); + for index102 = 0; index102 < (payload99).length(); index102 = index102 + 1 { + let iter_elem : LazyDbValue = (payload99)[(index102)] + let iter_base = address101 + (index102 * 4); - mbt_ffi_store32(return_area + 24, payload120.values.length()) - mbt_ffi_store32(return_area + 20, ptr122) - cleanup_list.push(ptr121) - cleanup_list.push(ptr122) + let LazyDbValue(handle100) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle100) - () - } - } - let result : Int = wasmImportConstructorLazyDbValue(return_area) - let ret = LazyDbValue::LazyDbValue(result) - mbt_ffi_free(return_area) + } + mbt_ffi_store32((return_area) + 12, (payload99).length()) + mbt_ffi_store32((return_area) + 8, address101) + cleanup_list.push(address101) - cleanup_list.each(mbt_ffi_free) - return ret -} + () + } + Range(payload103) => { + mbt_ffi_store8((return_area) + 0, (40)) -///| -pub fn LazyDbValue::get(self : LazyDbValue) -> DbValue { - let LazyDbValue(handle) = self - let return_area = mbt_ffi_malloc(56) - wasmImportMethodLazyDbValueGet(handle, return_area) - - let lifted42 = match mbt_ffi_load8_u(return_area + 0) { - 0 => DbValue::Character(mbt_ffi_load8(return_area + 8)) - 1 => DbValue::Int2(mbt_ffi_load16(return_area + 8)) - 2 => DbValue::Int4(mbt_ffi_load32(return_area + 8)) - 3 => DbValue::Int8(mbt_ffi_load64(return_area + 8)) - 4 => DbValue::Float4(mbt_ffi_loadf32(return_area + 8)) - 5 => DbValue::Float8(mbt_ffi_loadf64(return_area + 8)) - 6 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - DbValue::Numeric(result) - } - 7 => DbValue::Boolean(mbt_ffi_load8_u(return_area + 8) != 0) - 8 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - DbValue::Text(result0) - } - 9 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - DbValue::Varchar(result1) - } - 10 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - DbValue::Bpchar(result2) - } - 11 => - DbValue::Timestamp(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(return_area + 8), - month: mbt_ffi_load8_u(return_area + 12).to_byte(), - day: mbt_ffi_load8_u(return_area + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(return_area + 16).to_byte(), - minute: mbt_ffi_load8_u(return_area + 17).to_byte(), - second: mbt_ffi_load8_u(return_area + 18).to_byte(), - nanosecond: mbt_ffi_load32(return_area + 20).reinterpret_as_uint(), - }, - }) - 12 => - DbValue::Timestamptz(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(return_area + 8), - month: mbt_ffi_load8_u(return_area + 12).to_byte(), - day: mbt_ffi_load8_u(return_area + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(return_area + 16).to_byte(), - minute: mbt_ffi_load8_u(return_area + 17).to_byte(), - second: mbt_ffi_load8_u(return_area + 18).to_byte(), - nanosecond: mbt_ffi_load32(return_area + 20).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(return_area + 24), - }) - 13 => - DbValue::Date(@types.Date::{ - year: mbt_ffi_load32(return_area + 8), - month: mbt_ffi_load8_u(return_area + 12).to_byte(), - day: mbt_ffi_load8_u(return_area + 13).to_byte(), - }) - 14 => - DbValue::Time(@types.Time::{ - hour: mbt_ffi_load8_u(return_area + 8).to_byte(), - minute: mbt_ffi_load8_u(return_area + 9).to_byte(), - second: mbt_ffi_load8_u(return_area + 10).to_byte(), - nanosecond: mbt_ffi_load32(return_area + 12).reinterpret_as_uint(), - }) - 15 => - DbValue::Timetz(@types.Timetz::{ - time: @types.Time::{ - hour: mbt_ffi_load8_u(return_area + 8).to_byte(), - minute: mbt_ffi_load8_u(return_area + 9).to_byte(), - second: mbt_ffi_load8_u(return_area + 10).to_byte(), - nanosecond: mbt_ffi_load32(return_area + 12).reinterpret_as_uint(), - }, - offset: mbt_ffi_load32(return_area + 16), - }) - 16 => - DbValue::Interval(Interval::{ - months: mbt_ffi_load32(return_area + 8), - days: mbt_ffi_load32(return_area + 12), - microseconds: mbt_ffi_load64(return_area + 16), - }) - 17 => { - let result3 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - DbValue::Bytea(result3) - } - 18 => { - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - DbValue::Json(result4) - } - 19 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - DbValue::Jsonb(result5) - } - 20 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - DbValue::Jsonpath(result6) - } - 21 => { - let result7 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - DbValue::Xml(result7) - } - 22 => - DbValue::Uuid(@types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 16).reinterpret_as_uint64(), - }) - 23 => { - let lifted = match mbt_ffi_load8_u(return_area + 8) { - 0 => - @types.IpAddress::Ipv4( - ( - mbt_ffi_load8_u(return_area + 10).to_byte(), - mbt_ffi_load8_u(return_area + 11).to_byte(), - mbt_ffi_load8_u(return_area + 12).to_byte(), - mbt_ffi_load8_u(return_area + 13).to_byte(), - ), - ) - 1 => - @types.IpAddress::Ipv6( - ( - mbt_ffi_load16_u(return_area + 10) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 14) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 16) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 18) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 20) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 22) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 24) - .land(0xFFFF) - .reinterpret_as_uint(), - ), - ) - _ => panic() - } + let ptr104 = mbt_ffi_str2ptr((payload103).name) + mbt_ffi_store32((return_area) + 12, (payload103).name.length()) + mbt_ffi_store32((return_area) + 8, ptr104) - DbValue::Inet(lifted) - } - 24 => { - let lifted8 = match mbt_ffi_load8_u(return_area + 8) { - 0 => - @types.IpAddress::Ipv4( - ( - mbt_ffi_load8_u(return_area + 10).to_byte(), - mbt_ffi_load8_u(return_area + 11).to_byte(), - mbt_ffi_load8_u(return_area + 12).to_byte(), - mbt_ffi_load8_u(return_area + 13).to_byte(), - ), - ) - 1 => - @types.IpAddress::Ipv6( - ( - mbt_ffi_load16_u(return_area + 10) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 14) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 16) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 18) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 20) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 22) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(return_area + 24) - .land(0xFFFF) - .reinterpret_as_uint(), - ), - ) - _ => panic() - } + match ((payload103).value).start { + Included(payload105) => { + mbt_ffi_store8((return_area) + 16, (0)) - DbValue::Cidr(lifted8) - } - 25 => - DbValue::Macaddr(@types.MacAddress::{ - octets: ( - mbt_ffi_load8_u(return_area + 8).to_byte(), - mbt_ffi_load8_u(return_area + 9).to_byte(), - mbt_ffi_load8_u(return_area + 10).to_byte(), - mbt_ffi_load8_u(return_area + 11).to_byte(), - mbt_ffi_load8_u(return_area + 12).to_byte(), - mbt_ffi_load8_u(return_area + 13).to_byte(), - ), - }) - 26 => { - let array : Array[Bool] = [] - for index = 0; index < mbt_ffi_load32(return_area + 12); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 8) + index * 1 - - array.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 8)) - - DbValue::Bit(array) - } - 27 => { - let array9 : Array[Bool] = [] - for index10 = 0 - index10 < mbt_ffi_load32(return_area + 12) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(return_area + 8) + index10 * 1 - - array9.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 8)) - - DbValue::Varbit(array9) - } - 28 => { - let lifted11 = match mbt_ffi_load8_u(return_area + 8) { - 0 => Int4bound::Included(mbt_ffi_load32(return_area + 12)) - 1 => Int4bound::Excluded(mbt_ffi_load32(return_area + 12)) - 2 => Int4bound::Unbounded - _ => panic() - } + let LazyDbValue(handle106) = payload105 + mbt_ffi_store32((return_area) + 20, handle106) - let lifted12 = match mbt_ffi_load8_u(return_area + 16) { - 0 => Int4bound::Included(mbt_ffi_load32(return_area + 20)) - 1 => Int4bound::Excluded(mbt_ffi_load32(return_area + 20)) - 2 => Int4bound::Unbounded - _ => panic() - } + () + } + Excluded(payload107) => { + mbt_ffi_store8((return_area) + 16, (1)) - DbValue::Int4range(Int4range::{ start: lifted11, end: lifted12 }) - } - 29 => { - let lifted13 = match mbt_ffi_load8_u(return_area + 8) { - 0 => Int8bound::Included(mbt_ffi_load64(return_area + 16)) - 1 => Int8bound::Excluded(mbt_ffi_load64(return_area + 16)) - 2 => Int8bound::Unbounded - _ => panic() - } + let LazyDbValue(handle108) = payload107 + mbt_ffi_store32((return_area) + 20, handle108) - let lifted14 = match mbt_ffi_load8_u(return_area + 24) { - 0 => Int8bound::Included(mbt_ffi_load64(return_area + 32)) - 1 => Int8bound::Excluded(mbt_ffi_load64(return_area + 32)) - 2 => Int8bound::Unbounded - _ => panic() - } + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 16, (2)) - DbValue::Int8range(Int8range::{ start: lifted13, end: lifted14 }) - } - 30 => { - let lifted17 = match mbt_ffi_load8_u(return_area + 8) { - 0 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Numbound::Included(result15) - } - 1 => { - let result16 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Numbound::Excluded(result16) - } - 2 => Numbound::Unbounded - _ => panic() - } + () + } + } - let lifted20 = match mbt_ffi_load8_u(return_area + 20) { - 0 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 24), - mbt_ffi_load32(return_area + 28), - ) - - Numbound::Included(result18) - } - 1 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 24), - mbt_ffi_load32(return_area + 28), - ) - - Numbound::Excluded(result19) - } - 2 => Numbound::Unbounded - _ => panic() - } + match ((payload103).value).end { + Included(payload110) => { + mbt_ffi_store8((return_area) + 24, (0)) - DbValue::Numrange(Numrange::{ start: lifted17, end: lifted20 }) - } - 31 => { - let lifted21 = match mbt_ffi_load8_u(return_area + 8) { - 0 => - Tsbound::Included(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(return_area + 12), - month: mbt_ffi_load8_u(return_area + 16).to_byte(), - day: mbt_ffi_load8_u(return_area + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(return_area + 20).to_byte(), - minute: mbt_ffi_load8_u(return_area + 21).to_byte(), - second: mbt_ffi_load8_u(return_area + 22).to_byte(), - nanosecond: mbt_ffi_load32(return_area + 24).reinterpret_as_uint(), - }, - }) - 1 => - Tsbound::Excluded(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(return_area + 12), - month: mbt_ffi_load8_u(return_area + 16).to_byte(), - day: mbt_ffi_load8_u(return_area + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(return_area + 20).to_byte(), - minute: mbt_ffi_load8_u(return_area + 21).to_byte(), - second: mbt_ffi_load8_u(return_area + 22).to_byte(), - nanosecond: mbt_ffi_load32(return_area + 24).reinterpret_as_uint(), - }, - }) - 2 => Tsbound::Unbounded - _ => panic() - } + let LazyDbValue(handle111) = payload110 + mbt_ffi_store32((return_area) + 28, handle111) - let lifted22 = match mbt_ffi_load8_u(return_area + 28) { - 0 => - Tsbound::Included(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(return_area + 32), - month: mbt_ffi_load8_u(return_area + 36).to_byte(), - day: mbt_ffi_load8_u(return_area + 37).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(return_area + 40).to_byte(), - minute: mbt_ffi_load8_u(return_area + 41).to_byte(), - second: mbt_ffi_load8_u(return_area + 42).to_byte(), - nanosecond: mbt_ffi_load32(return_area + 44).reinterpret_as_uint(), - }, - }) - 1 => - Tsbound::Excluded(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(return_area + 32), - month: mbt_ffi_load8_u(return_area + 36).to_byte(), - day: mbt_ffi_load8_u(return_area + 37).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(return_area + 40).to_byte(), - minute: mbt_ffi_load8_u(return_area + 41).to_byte(), - second: mbt_ffi_load8_u(return_area + 42).to_byte(), - nanosecond: mbt_ffi_load32(return_area + 44).reinterpret_as_uint(), - }, - }) - 2 => Tsbound::Unbounded - _ => panic() - } + () + } + Excluded(payload112) => { + mbt_ffi_store8((return_area) + 24, (1)) - DbValue::Tsrange(Tsrange::{ start: lifted21, end: lifted22 }) - } - 32 => { - let lifted23 = match mbt_ffi_load8_u(return_area + 8) { - 0 => - Tstzbound::Included(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(return_area + 12), - month: mbt_ffi_load8_u(return_area + 16).to_byte(), - day: mbt_ffi_load8_u(return_area + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(return_area + 20).to_byte(), - minute: mbt_ffi_load8_u(return_area + 21).to_byte(), - second: mbt_ffi_load8_u(return_area + 22).to_byte(), - nanosecond: mbt_ffi_load32(return_area + 24).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(return_area + 28), - }) - 1 => - Tstzbound::Excluded(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(return_area + 12), - month: mbt_ffi_load8_u(return_area + 16).to_byte(), - day: mbt_ffi_load8_u(return_area + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(return_area + 20).to_byte(), - minute: mbt_ffi_load8_u(return_area + 21).to_byte(), - second: mbt_ffi_load8_u(return_area + 22).to_byte(), - nanosecond: mbt_ffi_load32(return_area + 24).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(return_area + 28), - }) - 2 => Tstzbound::Unbounded - _ => panic() - } + let LazyDbValue(handle113) = payload112 + mbt_ffi_store32((return_area) + 28, handle113) - let lifted24 = match mbt_ffi_load8_u(return_area + 32) { - 0 => - Tstzbound::Included(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(return_area + 36), - month: mbt_ffi_load8_u(return_area + 40).to_byte(), - day: mbt_ffi_load8_u(return_area + 41).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(return_area + 44).to_byte(), - minute: mbt_ffi_load8_u(return_area + 45).to_byte(), - second: mbt_ffi_load8_u(return_area + 46).to_byte(), - nanosecond: mbt_ffi_load32(return_area + 48).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(return_area + 52), - }) - 1 => - Tstzbound::Excluded(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(return_area + 36), - month: mbt_ffi_load8_u(return_area + 40).to_byte(), - day: mbt_ffi_load8_u(return_area + 41).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(return_area + 44).to_byte(), - minute: mbt_ffi_load8_u(return_area + 45).to_byte(), - second: mbt_ffi_load8_u(return_area + 46).to_byte(), - nanosecond: mbt_ffi_load32(return_area + 48).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(return_area + 52), - }) - 2 => Tstzbound::Unbounded - _ => panic() - } + () + } + Unbounded => { + mbt_ffi_store8((return_area) + 24, (2)) - DbValue::Tstzrange(Tstzrange::{ start: lifted23, end: lifted24 }) - } - 33 => { - let lifted25 = match mbt_ffi_load8_u(return_area + 8) { - 0 => - Datebound::Included(@types.Date::{ - year: mbt_ffi_load32(return_area + 12), - month: mbt_ffi_load8_u(return_area + 16).to_byte(), - day: mbt_ffi_load8_u(return_area + 17).to_byte(), - }) - 1 => - Datebound::Excluded(@types.Date::{ - year: mbt_ffi_load32(return_area + 12), - month: mbt_ffi_load8_u(return_area + 16).to_byte(), - day: mbt_ffi_load8_u(return_area + 17).to_byte(), - }) - 2 => Datebound::Unbounded - _ => panic() - } + () + } + } + cleanup_list.push(ptr104) - let lifted26 = match mbt_ffi_load8_u(return_area + 20) { - 0 => - Datebound::Included(@types.Date::{ - year: mbt_ffi_load32(return_area + 24), - month: mbt_ffi_load8_u(return_area + 28).to_byte(), - day: mbt_ffi_load8_u(return_area + 29).to_byte(), - }) - 1 => - Datebound::Excluded(@types.Date::{ - year: mbt_ffi_load32(return_area + 24), - month: mbt_ffi_load8_u(return_area + 28).to_byte(), - day: mbt_ffi_load8_u(return_area + 29).to_byte(), - }) - 2 => Datebound::Unbounded - _ => panic() - } + () + } + Null => { + mbt_ffi_store8((return_area) + 0, (41)) - DbValue::Daterange(Daterange::{ start: lifted25, end: lifted26 }) - } - 34 => DbValue::Money(mbt_ffi_load64(return_area + 8)) - 35 => DbValue::Oid(mbt_ffi_load32(return_area + 8).reinterpret_as_uint()) - 36 => { - let result27 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - let result28 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 16), - mbt_ffi_load32(return_area + 20), - ) - - DbValue::Enumeration(Enumeration::{ name: result27, value: result28 }) - } - 37 => { - let result29 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - let array30 : Array[LazyDbValue] = [] - for index31 = 0 - index31 < mbt_ffi_load32(return_area + 20) - index31 = index31 + 1 { - let iter_base = mbt_ffi_load32(return_area + 16) + index31 * 4 - - array30.push(LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 0))) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 16)) - - DbValue::Composite(Composite::{ name: result29, values: array30 }) - } - 38 => { - let result32 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - DbValue::Domain(Domain::{ - name: result32, - value: LazyDbValue::LazyDbValue(mbt_ffi_load32(return_area + 16)), - }) - } - 39 => { - let array33 : Array[LazyDbValue] = [] - for index34 = 0 - index34 < mbt_ffi_load32(return_area + 12) - index34 = index34 + 1 { - let iter_base = mbt_ffi_load32(return_area + 8) + index34 * 4 - - array33.push(LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 0))) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 8)) - - DbValue::Array(array33) - } - 40 => { - let result35 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - let lifted36 = match mbt_ffi_load8_u(return_area + 16) { - 0 => - ValueBound::Included( - LazyDbValue::LazyDbValue(mbt_ffi_load32(return_area + 20)), - ) - 1 => - ValueBound::Excluded( - LazyDbValue::LazyDbValue(mbt_ffi_load32(return_area + 20)), - ) - 2 => ValueBound::Unbounded - _ => panic() - } + () + } + Vector(payload116) => { + mbt_ffi_store8((return_area) + 0, (42)) - let lifted37 = match mbt_ffi_load8_u(return_area + 24) { - 0 => - ValueBound::Included( - LazyDbValue::LazyDbValue(mbt_ffi_load32(return_area + 28)), - ) - 1 => - ValueBound::Excluded( - LazyDbValue::LazyDbValue(mbt_ffi_load32(return_area + 28)), - ) - 2 => ValueBound::Unbounded - _ => panic() - } + let ptr117 = mbt_ffi_float_array2ptr(payload116) - DbValue::Range(Range::{ - name: result35, - value: ValuesRange::{ start: lifted36, end: lifted37 }, - }) - } - 41 => DbValue::Null - 42 => { - let result38 = mbt_ffi_ptr2float_array( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - DbValue::Vector(result38) - } - 43 => { - let result39 = mbt_ffi_ptr2float_array( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - DbValue::Halfvec(result39) - } - 44 => { - let result40 = mbt_ffi_ptr2int_array( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - let result41 = mbt_ffi_ptr2float_array( - mbt_ffi_load32(return_area + 20), - mbt_ffi_load32(return_area + 24), - ) - - DbValue::Sparsevec(SparseVec::{ - dim: mbt_ffi_load32(return_area + 8), - indices: result40, - values: result41, - }) - } - _ => panic() - } - let ret = lifted42 - mbt_ffi_free(return_area) - return ret -} + mbt_ffi_store32((return_area) + 12, payload116.length()) + mbt_ffi_store32((return_area) + 8, ptr117) + cleanup_list.push(ptr117) -///| -pub fn LazyDbColumnType::lazy_db_column_type( - value : DbColumnType, -) -> LazyDbColumnType { - let cleanup_list : Array[Int] = [] - - let (lowered, lowered50, lowered51, lowered52, lowered53) = match value { - Character => (0, 0, 0, 0, 0) - Int2 => (1, 0, 0, 0, 0) - Int4 => (2, 0, 0, 0, 0) - Int8 => (3, 0, 0, 0, 0) - Float4 => (4, 0, 0, 0, 0) - Float8 => (5, 0, 0, 0, 0) - Numeric => (6, 0, 0, 0, 0) - Boolean => (7, 0, 0, 0, 0) - Text => (8, 0, 0, 0, 0) - Varchar => (9, 0, 0, 0, 0) - Bpchar => (10, 0, 0, 0, 0) - Timestamp => (11, 0, 0, 0, 0) - Timestamptz => (12, 0, 0, 0, 0) - Date => (13, 0, 0, 0, 0) - Time => (14, 0, 0, 0, 0) - Timetz => (15, 0, 0, 0, 0) - Interval => (16, 0, 0, 0, 0) - Bytea => (17, 0, 0, 0, 0) - Uuid => (18, 0, 0, 0, 0) - Xml => (19, 0, 0, 0, 0) - Json => (20, 0, 0, 0, 0) - Jsonb => (21, 0, 0, 0, 0) - Jsonpath => (22, 0, 0, 0, 0) - Inet => (23, 0, 0, 0, 0) - Cidr => (24, 0, 0, 0, 0) - Macaddr => (25, 0, 0, 0, 0) - Bit => (26, 0, 0, 0, 0) - Varbit => (27, 0, 0, 0, 0) - Int4range => (28, 0, 0, 0, 0) - Int8range => (29, 0, 0, 0, 0) - Numrange => (30, 0, 0, 0, 0) - Tsrange => (31, 0, 0, 0, 0) - Tstzrange => (32, 0, 0, 0, 0) - Daterange => (33, 0, 0, 0, 0) - Money => (34, 0, 0, 0, 0) - Oid => (35, 0, 0, 0, 0) - Enumeration(payload35) => { - let ptr = mbt_ffi_str2ptr(payload35.name) - cleanup_list.push(ptr) - - (36, ptr, payload35.name.length(), 0, 0) - } - Composite(payload36) => { - let ptr37 = mbt_ffi_str2ptr(payload36.name) - - let address = mbt_ffi_malloc(payload36.attributes.length() * 12) - for index = 0; index < payload36.attributes.length(); index = index + 1 { - let iter_elem : (String, LazyDbColumnType) = payload36.attributes[index] - let iter_base = address + index * 12 - - let ptr38 = mbt_ffi_str2ptr(iter_elem.0) - mbt_ffi_store32(iter_base + 4, iter_elem.0.length()) - mbt_ffi_store32(iter_base + 0, ptr38) - - let LazyDbColumnType(handle) = iter_elem.1 - mbt_ffi_store32(iter_base + 8, handle) - cleanup_list.push(ptr38) - } - cleanup_list.push(ptr37) - cleanup_list.push(address) - - ( - 37, - ptr37, - payload36.name.length(), - address, - payload36.attributes.length(), - ) - } - Domain(payload39) => { - let ptr40 = mbt_ffi_str2ptr(payload39.name) - - let LazyDbColumnType(handle41) = payload39.base_type - cleanup_list.push(ptr40) - - (38, ptr40, payload39.name.length(), handle41, 0) - } - Array(payload42) => { - let LazyDbColumnType(handle43) = payload42 - - (39, handle43, 0, 0, 0) - } - Range(payload44) => { - let ptr45 = mbt_ffi_str2ptr(payload44.name) - - let LazyDbColumnType(handle46) = payload44.base_type - cleanup_list.push(ptr45) - - (40, ptr45, payload44.name.length(), handle46, 0) - } - Vector => (41, 0, 0, 0, 0) - Halfvec => (42, 0, 0, 0, 0) - Sparsevec => (43, 0, 0, 0, 0) - } - let result : Int = wasmImportConstructorLazyDbColumnType( - lowered, lowered50, lowered51, lowered52, lowered53, - ) - let ret = LazyDbColumnType::LazyDbColumnType(result) - - cleanup_list.each(mbt_ffi_free) - return ret -} + () + } + Halfvec(payload118) => { + mbt_ffi_store8((return_area) + 0, (43)) -///| -pub fn LazyDbColumnType::get(self : LazyDbColumnType) -> DbColumnType { - let LazyDbColumnType(handle) = self - let return_area = mbt_ffi_malloc(20) - wasmImportMethodLazyDbColumnTypeGet(handle, return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => DbColumnType::Character - 1 => DbColumnType::Int2 - 2 => DbColumnType::Int4 - 3 => DbColumnType::Int8 - 4 => DbColumnType::Float4 - 5 => DbColumnType::Float8 - 6 => DbColumnType::Numeric - 7 => DbColumnType::Boolean - 8 => DbColumnType::Text - 9 => DbColumnType::Varchar - 10 => DbColumnType::Bpchar - 11 => DbColumnType::Timestamp - 12 => DbColumnType::Timestamptz - 13 => DbColumnType::Date - 14 => DbColumnType::Time - 15 => DbColumnType::Timetz - 16 => DbColumnType::Interval - 17 => DbColumnType::Bytea - 18 => DbColumnType::Uuid - 19 => DbColumnType::Xml - 20 => DbColumnType::Json - 21 => DbColumnType::Jsonb - 22 => DbColumnType::Jsonpath - 23 => DbColumnType::Inet - 24 => DbColumnType::Cidr - 25 => DbColumnType::Macaddr - 26 => DbColumnType::Bit - 27 => DbColumnType::Varbit - 28 => DbColumnType::Int4range - 29 => DbColumnType::Int8range - 30 => DbColumnType::Numrange - 31 => DbColumnType::Tsrange - 32 => DbColumnType::Tstzrange - 33 => DbColumnType::Daterange - 34 => DbColumnType::Money - 35 => DbColumnType::Oid - 36 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - DbColumnType::Enumeration(EnumerationType::{ name: result }) - } - 37 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - let array : Array[(String, LazyDbColumnType)] = [] - for index = 0; index < mbt_ffi_load32(return_area + 16); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 12) + index * 12 - - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push( - ( - result1, - LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32(iter_base + 8)), - ), - ) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 12)) - - DbColumnType::Composite(CompositeType::{ - name: result0, - attributes: array, - }) - } - 38 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - DbColumnType::Domain(DomainType::{ - name: result2, - base_type: LazyDbColumnType::LazyDbColumnType( - mbt_ffi_load32(return_area + 12), - ), - }) - } - 39 => - DbColumnType::Array( - LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32(return_area + 4)), - ) - 40 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - DbColumnType::Range(RangeType::{ - name: result3, - base_type: LazyDbColumnType::LazyDbColumnType( - mbt_ffi_load32(return_area + 12), - ), - }) - } - 41 => DbColumnType::Vector - 42 => DbColumnType::Halfvec - 43 => DbColumnType::Sparsevec - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} + let ptr119 = mbt_ffi_float_array2ptr(payload118) -///| -pub fn DbResultStream::get_columns(self : DbResultStream) -> Array[DbColumn] { - let DbResultStream(handle) = self - let return_area = mbt_ffi_malloc(8) - wasmImportMethodDbResultStreamGetColumns(handle, return_area) - - let array6 : Array[DbColumn] = [] - for index7 = 0; index7 < mbt_ffi_load32(return_area + 4); index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index7 * 48 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted = match mbt_ffi_load8_u(iter_base + 16) { - 0 => DbColumnType::Character - 1 => DbColumnType::Int2 - 2 => DbColumnType::Int4 - 3 => DbColumnType::Int8 - 4 => DbColumnType::Float4 - 5 => DbColumnType::Float8 - 6 => DbColumnType::Numeric - 7 => DbColumnType::Boolean - 8 => DbColumnType::Text - 9 => DbColumnType::Varchar - 10 => DbColumnType::Bpchar - 11 => DbColumnType::Timestamp - 12 => DbColumnType::Timestamptz - 13 => DbColumnType::Date - 14 => DbColumnType::Time - 15 => DbColumnType::Timetz - 16 => DbColumnType::Interval - 17 => DbColumnType::Bytea - 18 => DbColumnType::Uuid - 19 => DbColumnType::Xml - 20 => DbColumnType::Json - 21 => DbColumnType::Jsonb - 22 => DbColumnType::Jsonpath - 23 => DbColumnType::Inet - 24 => DbColumnType::Cidr - 25 => DbColumnType::Macaddr - 26 => DbColumnType::Bit - 27 => DbColumnType::Varbit - 28 => DbColumnType::Int4range - 29 => DbColumnType::Int8range - 30 => DbColumnType::Numrange - 31 => DbColumnType::Tsrange - 32 => DbColumnType::Tstzrange - 33 => DbColumnType::Daterange - 34 => DbColumnType::Money - 35 => DbColumnType::Oid - 36 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - DbColumnType::Enumeration(EnumerationType::{ name: result0 }) - } - 37 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - let array : Array[(String, LazyDbColumnType)] = [] - for index = 0; index < mbt_ffi_load32(iter_base + 32); index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index * 12 - - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push( - ( - result2, - LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32(iter_base + 8)), - ), - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - DbColumnType::Composite(CompositeType::{ - name: result1, - attributes: array, - }) - } - 38 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - DbColumnType::Domain(DomainType::{ - name: result3, - base_type: LazyDbColumnType::LazyDbColumnType( - mbt_ffi_load32(iter_base + 28), - ), - }) - } - 39 => - DbColumnType::Array( - LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32(iter_base + 20)), - ) - 40 => { - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - DbColumnType::Range(RangeType::{ - name: result4, - base_type: LazyDbColumnType::LazyDbColumnType( - mbt_ffi_load32(iter_base + 28), - ), - }) + mbt_ffi_store32((return_area) + 12, payload118.length()) + mbt_ffi_store32((return_area) + 8, ptr119) + cleanup_list.push(ptr119) + + () + } + Sparsevec(payload120) => { + mbt_ffi_store8((return_area) + 0, (44)) + mbt_ffi_store32((return_area) + 8, (payload120).dim) + + let ptr121 = mbt_ffi_int_array2ptr((payload120).indices) + + mbt_ffi_store32((return_area) + 16, (payload120).indices.length()) + mbt_ffi_store32((return_area) + 12, ptr121) + + let ptr122 = mbt_ffi_float_array2ptr((payload120).values) + + mbt_ffi_store32((return_area) + 24, (payload120).values.length()) + mbt_ffi_store32((return_area) + 20, ptr122) + cleanup_list.push(ptr121) + cleanup_list.push(ptr122) + + () + } } - 41 => DbColumnType::Vector - 42 => DbColumnType::Halfvec - 43 => DbColumnType::Sparsevec - _ => panic() - } - - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - array6.push(DbColumn::{ - ordinal: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - name: result, - db_type: lifted, - db_type_name: result5, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array6 - mbt_ffi_free(return_area) - return ret -} + let result : Int = wasmImportConstructorLazyDbValue(return_area); + let ret = LazyDbValue::LazyDbValue(result) + mbt_ffi_free(return_area) + + cleanup_list.each(mbt_ffi_free) + return ret +} ///| -pub fn DbResultStream::get_next(self : DbResultStream) -> Array[DbRow]? { - let DbResultStream(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodDbResultStreamGetNext(handle, return_area) - - let lifted47 : Array[DbRow]? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let array45 : Array[DbRow] = [] - for index46 = 0 - index46 < mbt_ffi_load32(return_area + 8) - index46 = index46 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index46 * 8 - - let array43 : Array[DbValue] = [] - for index44 = 0 - index44 < mbt_ffi_load32(iter_base + 4) - index44 = index44 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + index44 * 56 - - let lifted42 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => DbValue::Character(mbt_ffi_load8(iter_base + 8)) - 1 => DbValue::Int2(mbt_ffi_load16(iter_base + 8)) - 2 => DbValue::Int4(mbt_ffi_load32(iter_base + 8)) - 3 => DbValue::Int8(mbt_ffi_load64(iter_base + 8)) - 4 => DbValue::Float4(mbt_ffi_loadf32(iter_base + 8)) - 5 => DbValue::Float8(mbt_ffi_loadf64(iter_base + 8)) - 6 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) +pub fn LazyDbValue::get(self : LazyDbValue) -> DbValue { + + let LazyDbValue(handle) = self + let return_area = mbt_ffi_malloc(56) + wasmImportMethodLazyDbValueGet(handle, return_area); + + let lifted42 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - DbValue::Numeric(result) + DbValue::Character((mbt_ffi_load8((return_area) + 8))) } - 7 => DbValue::Boolean(mbt_ffi_load8_u(iter_base + 8) != 0) - 8 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 1 => { - DbValue::Text(result0) + DbValue::Int2((mbt_ffi_load16((return_area) + 8))) } - 9 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 2 => { - DbValue::Varchar(result1) + DbValue::Int4(mbt_ffi_load32((return_area) + 8)) } - 10 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::Bpchar(result2) - } - 11 => - DbValue::Timestamp(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 16).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 17).to_byte(), - second: mbt_ffi_load8_u(iter_base + 18).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 20).reinterpret_as_uint(), - }, - }) - 12 => - DbValue::Timestamptz(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 16).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 17).to_byte(), - second: mbt_ffi_load8_u(iter_base + 18).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 20).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 24), - }) - 13 => - DbValue::Date(@types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }) - 14 => - DbValue::Time(@types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 8).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 9).to_byte(), - second: mbt_ffi_load8_u(iter_base + 10).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 15 => - DbValue::Timetz(@types.Timetz::{ - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 8).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 9).to_byte(), - second: mbt_ffi_load8_u(iter_base + 10).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }, - offset: mbt_ffi_load32(iter_base + 16), - }) - 16 => - DbValue::Interval(Interval::{ - months: mbt_ffi_load32(iter_base + 8), - days: mbt_ffi_load32(iter_base + 12), - microseconds: mbt_ffi_load64(iter_base + 16), - }) - 17 => { - let result3 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 3 => { - DbValue::Bytea(result3) + DbValue::Int8(mbt_ffi_load64((return_area) + 8)) } - 18 => { - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 4 => { - DbValue::Json(result4) + DbValue::Float4(mbt_ffi_loadf32((return_area) + 8)) } - 19 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 5 => { - DbValue::Jsonb(result5) + DbValue::Float8(mbt_ffi_loadf64((return_area) + 8)) } - 20 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 6 => { - DbValue::Jsonpath(result6) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + DbValue::Numeric(result) } - 21 => { - let result7 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::Xml(result7) - } - 22 => - DbValue::Uuid(@types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - }) - 23 => { - let lifted = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - @types.IpAddress::Ipv4( - ( - mbt_ffi_load8_u(iter_base + 10).to_byte(), - mbt_ffi_load8_u(iter_base + 11).to_byte(), - mbt_ffi_load8_u(iter_base + 12).to_byte(), - mbt_ffi_load8_u(iter_base + 13).to_byte(), - ), - ) - 1 => - @types.IpAddress::Ipv6( - ( - mbt_ffi_load16_u(iter_base + 10) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 14) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 16) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 18) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 20) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 22) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 24) - .land(0xFFFF) - .reinterpret_as_uint(), - ), - ) - _ => panic() - } - - DbValue::Inet(lifted) + 7 => { + + DbValue::Boolean((mbt_ffi_load8_u((return_area) + 8) != 0)) } - 24 => { - let lifted8 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - @types.IpAddress::Ipv4( - ( - mbt_ffi_load8_u(iter_base + 10).to_byte(), - mbt_ffi_load8_u(iter_base + 11).to_byte(), - mbt_ffi_load8_u(iter_base + 12).to_byte(), - mbt_ffi_load8_u(iter_base + 13).to_byte(), - ), - ) - 1 => - @types.IpAddress::Ipv6( - ( - mbt_ffi_load16_u(iter_base + 10) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 14) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 16) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 18) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 20) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 22) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 24) - .land(0xFFFF) - .reinterpret_as_uint(), - ), - ) - _ => panic() - } - - DbValue::Cidr(lifted8) - } - 25 => - DbValue::Macaddr(@types.MacAddress::{ - octets: ( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - mbt_ffi_load8_u(iter_base + 9).to_byte(), - mbt_ffi_load8_u(iter_base + 10).to_byte(), - mbt_ffi_load8_u(iter_base + 11).to_byte(), - mbt_ffi_load8_u(iter_base + 12).to_byte(), - mbt_ffi_load8_u(iter_base + 13).to_byte(), - ), - }) - 26 => { - let array : Array[Bool] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 12) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index * 1 + 8 => { - array.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - DbValue::Bit(array) + DbValue::Text(result0) } - 27 => { - let array9 : Array[Bool] = [] - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 12) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index10 * 1 + 9 => { - array9.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - DbValue::Varbit(array9) + DbValue::Varchar(result1) } - 28 => { - let lifted11 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Int4bound::Included(mbt_ffi_load32(iter_base + 12)) - 1 => Int4bound::Excluded(mbt_ffi_load32(iter_base + 12)) - 2 => Int4bound::Unbounded - _ => panic() - } - - let lifted12 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Int4bound::Included(mbt_ffi_load32(iter_base + 20)) - 1 => Int4bound::Excluded(mbt_ffi_load32(iter_base + 20)) - 2 => Int4bound::Unbounded - _ => panic() - } - - DbValue::Int4range(Int4range::{ start: lifted11, end: lifted12 }) + 10 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + DbValue::Bpchar(result2) } - 29 => { - let lifted13 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Int8bound::Included(mbt_ffi_load64(iter_base + 16)) - 1 => Int8bound::Excluded(mbt_ffi_load64(iter_base + 16)) - 2 => Int8bound::Unbounded - _ => panic() - } - - let lifted14 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Int8bound::Included(mbt_ffi_load64(iter_base + 32)) - 1 => Int8bound::Excluded(mbt_ffi_load64(iter_base + 32)) - 2 => Int8bound::Unbounded - _ => panic() - } - - DbValue::Int8range(Int8range::{ start: lifted13, end: lifted14 }) + 11 => { + + DbValue::Timestamp(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((return_area) + 8), month : (mbt_ffi_load8_u((return_area) + 12)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((return_area) + 16)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 17)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((return_area) + 20)).reinterpret_as_uint()}}) } - 30 => { - let lifted17 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Numbound::Included(result15) - } - 1 => { - let result16 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Numbound::Excluded(result16) - } - 2 => Numbound::Unbounded - _ => panic() - } - - let lifted20 = match mbt_ffi_load8_u(iter_base + 20) { - 0 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - Numbound::Included(result18) - } - 1 => { - let result19 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - Numbound::Excluded(result19) - } - 2 => Numbound::Unbounded - _ => panic() - } - - DbValue::Numrange(Numrange::{ start: lifted17, end: lifted20 }) + 12 => { + + DbValue::Timestamptz(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((return_area) + 8), month : (mbt_ffi_load8_u((return_area) + 12)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((return_area) + 16)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 17)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((return_area) + 20)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((return_area) + 24)}) } - 31 => { - let lifted21 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - Tsbound::Included(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 20).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 21).to_byte(), - second: mbt_ffi_load8_u(iter_base + 22).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }) - 1 => - Tsbound::Excluded(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 20).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 21).to_byte(), - second: mbt_ffi_load8_u(iter_base + 22).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }) - 2 => Tsbound::Unbounded - _ => panic() - } - - let lifted22 = match mbt_ffi_load8_u(iter_base + 28) { - 0 => - Tsbound::Included(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 32), - month: mbt_ffi_load8_u(iter_base + 36).to_byte(), - day: mbt_ffi_load8_u(iter_base + 37).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 40).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 41).to_byte(), - second: mbt_ffi_load8_u(iter_base + 42).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 44).reinterpret_as_uint(), - }, - }) - 1 => - Tsbound::Excluded(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 32), - month: mbt_ffi_load8_u(iter_base + 36).to_byte(), - day: mbt_ffi_load8_u(iter_base + 37).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 40).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 41).to_byte(), - second: mbt_ffi_load8_u(iter_base + 42).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 44).reinterpret_as_uint(), - }, - }) - 2 => Tsbound::Unbounded - _ => panic() - } - - DbValue::Tsrange(Tsrange::{ start: lifted21, end: lifted22 }) + 13 => { + + DbValue::Date(@types.Date::{year : mbt_ffi_load32((return_area) + 8), month : (mbt_ffi_load8_u((return_area) + 12)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 13)).to_byte()}) } - 32 => { - let lifted23 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - Tstzbound::Included(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 20).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 21).to_byte(), - second: mbt_ffi_load8_u(iter_base + 22).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 28), - }) - 1 => - Tstzbound::Excluded(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 20).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 21).to_byte(), - second: mbt_ffi_load8_u(iter_base + 22).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 28), - }) - 2 => Tstzbound::Unbounded - _ => panic() - } - - let lifted24 = match mbt_ffi_load8_u(iter_base + 32) { - 0 => - Tstzbound::Included(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 36), - month: mbt_ffi_load8_u(iter_base + 40).to_byte(), - day: mbt_ffi_load8_u(iter_base + 41).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 44).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 45).to_byte(), - second: mbt_ffi_load8_u(iter_base + 46).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 48).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 52), - }) - 1 => - Tstzbound::Excluded(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 36), - month: mbt_ffi_load8_u(iter_base + 40).to_byte(), - day: mbt_ffi_load8_u(iter_base + 41).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 44).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 45).to_byte(), - second: mbt_ffi_load8_u(iter_base + 46).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 48).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 52), - }) - 2 => Tstzbound::Unbounded - _ => panic() - } - - DbValue::Tstzrange(Tstzrange::{ start: lifted23, end: lifted24 }) + 14 => { + + DbValue::Time(@types.Time::{hour : (mbt_ffi_load8_u((return_area) + 8)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 9)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 10)).to_byte(), nanosecond : (mbt_ffi_load32((return_area) + 12)).reinterpret_as_uint()}) } - 33 => { - let lifted25 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - Datebound::Included(@types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }) - 1 => - Datebound::Excluded(@types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }) - 2 => Datebound::Unbounded - _ => panic() - } - - let lifted26 = match mbt_ffi_load8_u(iter_base + 20) { - 0 => - Datebound::Included(@types.Date::{ - year: mbt_ffi_load32(iter_base + 24), - month: mbt_ffi_load8_u(iter_base + 28).to_byte(), - day: mbt_ffi_load8_u(iter_base + 29).to_byte(), - }) - 1 => - Datebound::Excluded(@types.Date::{ - year: mbt_ffi_load32(iter_base + 24), - month: mbt_ffi_load8_u(iter_base + 28).to_byte(), - day: mbt_ffi_load8_u(iter_base + 29).to_byte(), - }) - 2 => Datebound::Unbounded - _ => panic() - } - - DbValue::Daterange(Daterange::{ start: lifted25, end: lifted26 }) - } - 34 => DbValue::Money(mbt_ffi_load64(iter_base + 8)) - 35 => - DbValue::Oid(mbt_ffi_load32(iter_base + 8).reinterpret_as_uint()) - 36 => { - let result27 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 15 => { - let result28 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + DbValue::Timetz(@types.Timetz::{time : @types.Time::{hour : (mbt_ffi_load8_u((return_area) + 8)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 9)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 10)).to_byte(), nanosecond : (mbt_ffi_load32((return_area) + 12)).reinterpret_as_uint()}, offset : mbt_ffi_load32((return_area) + 16)}) + } + 16 => { - DbValue::Enumeration(Enumeration::{ - name: result27, - value: result28, - }) + DbValue::Interval(Interval::{months : mbt_ffi_load32((return_area) + 8), days : mbt_ffi_load32((return_area) + 12), microseconds : mbt_ffi_load64((return_area) + 16)}) } - 37 => { - let result29 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 17 => { - let array30 : Array[LazyDbValue] = [] - for index31 = 0 - index31 < mbt_ffi_load32(iter_base + 20) - index31 = index31 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index31 * 4 + let result3 = mbt_ffi_ptr2bytes(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + DbValue::Bytea(result3) + } + 18 => { - array30.push( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 0)), - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - DbValue::Composite(Composite::{ name: result29, values: array30 }) + DbValue::Json(result4) } - 38 => { - let result32 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 19 => { + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - DbValue::Domain(Domain::{ - name: result32, - value: LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 16)), - }) + DbValue::Jsonb(result5) } - 39 => { - let array33 : Array[LazyDbValue] = [] - for index34 = 0 - index34 < mbt_ffi_load32(iter_base + 12) - index34 = index34 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index34 * 4 + 20 => { - array33.push( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 0)), - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - DbValue::Array(array33) + DbValue::Jsonpath(result6) } - 40 => { - let result35 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted36 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => - ValueBound::Included( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 20)), - ) - 1 => - ValueBound::Excluded( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 20)), - ) - 2 => ValueBound::Unbounded - _ => panic() - } - - let lifted37 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - ValueBound::Included( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 28)), - ) - 1 => - ValueBound::Excluded( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 28)), - ) - 2 => ValueBound::Unbounded - _ => panic() - } - - DbValue::Range(Range::{ - name: result35, - value: ValuesRange::{ start: lifted36, end: lifted37 }, - }) - } - 41 => DbValue::Null - 42 => { - let result38 = mbt_ffi_ptr2float_array( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 21 => { + + let result7 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - DbValue::Vector(result38) + DbValue::Xml(result7) } - 43 => { - let result39 = mbt_ffi_ptr2float_array( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 22 => { - DbValue::Halfvec(result39) + DbValue::Uuid(@types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 16)).reinterpret_as_uint64()}) } - 44 => { - let result40 = mbt_ffi_ptr2int_array( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - let result41 = mbt_ffi_ptr2float_array( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - DbValue::Sparsevec(SparseVec::{ - dim: mbt_ffi_load32(iter_base + 8), - indices: result40, - values: result41, - }) + 23 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { + + @types.IpAddress::Ipv4(((mbt_ffi_load8_u((return_area) + 10)).to_byte(), (mbt_ffi_load8_u((return_area) + 11)).to_byte(), (mbt_ffi_load8_u((return_area) + 12)).to_byte(), (mbt_ffi_load8_u((return_area) + 13)).to_byte())) + } + 1 => { + + @types.IpAddress::Ipv6(((mbt_ffi_load16_u((return_area) + 10).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 12).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 14).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 16).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 18).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 20).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 22).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 24).land(0xFFFF).reinterpret_as_uint()))) + } + _ => panic() + } + + DbValue::Inet(lifted) } - _ => panic() - } + 24 => { - array43.push(lifted42) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + let lifted8 = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - array45.push(DbRow::{ values: array43 }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Option::Some(array45) - } - _ => panic() - } - let ret = lifted47 - mbt_ffi_free(return_area) - return ret -} + @types.IpAddress::Ipv4(((mbt_ffi_load8_u((return_area) + 10)).to_byte(), (mbt_ffi_load8_u((return_area) + 11)).to_byte(), (mbt_ffi_load8_u((return_area) + 12)).to_byte(), (mbt_ffi_load8_u((return_area) + 13)).to_byte())) + } + 1 => { -///| -pub fn DbConnection::open(address : String) -> Result[DbConnection, Error_] { - let ptr = mbt_ffi_str2ptr(address) - let return_area = mbt_ffi_malloc(16) - wasmImportStaticDbConnectionOpen(ptr, address.length(), return_area) - - let lifted4 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(DbConnection::DbConnection(mbt_ffi_load32(return_area + 4))) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result0) - } - 2 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result1) - } - 3 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result2) - } - 4 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result3) - } - _ => panic() - } + @types.IpAddress::Ipv6(((mbt_ffi_load16_u((return_area) + 10).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 12).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 14).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 16).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 18).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 20).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 22).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((return_area) + 24).land(0xFFFF).reinterpret_as_uint()))) + } + _ => panic() + } - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted4 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + DbValue::Cidr(lifted8) + } + 25 => { -///| -pub fn DbConnection::query( - self : DbConnection, - statement : String, - params : Array[DbValue], -) -> Result[DbResult, Error_] { - let cleanup_list : Array[Int] = [] + DbValue::Macaddr(@types.MacAddress::{octets : ((mbt_ffi_load8_u((return_area) + 8)).to_byte(), (mbt_ffi_load8_u((return_area) + 9)).to_byte(), (mbt_ffi_load8_u((return_area) + 10)).to_byte(), (mbt_ffi_load8_u((return_area) + 11)).to_byte(), (mbt_ffi_load8_u((return_area) + 12)).to_byte(), (mbt_ffi_load8_u((return_area) + 13)).to_byte())}) + } + 26 => { - let DbConnection(handle) = self + let array : Array[Bool] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 8)) + (index * 1) - let ptr = mbt_ffi_str2ptr(statement) + array.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 8)) - let address125 = mbt_ffi_malloc(params.length() * 56) - for index126 = 0; index126 < params.length(); index126 = index126 + 1 { - let iter_elem : DbValue = params[index126] - let iter_base = address125 + index126 * 56 + DbValue::Bit(array) + } + 27 => { - match iter_elem { - Character(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload)) + let array9 : Array[Bool] = []; + for index10 = 0; index10 < (mbt_ffi_load32((return_area) + 12)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 8)) + (index10 * 1) - () - } - Int2(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload0)) + array9.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 8)) - () - } - Int4(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store32(iter_base + 8, payload1) + DbValue::Varbit(array9) + } + 28 => { - () - } - Int8(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store64(iter_base + 8, payload2) + let lifted11 = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - () - } - Float4(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_storef32(iter_base + 8, payload3) + Int4bound::Included(mbt_ffi_load32((return_area) + 12)) + } + 1 => { - () - } - Float8(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_storef64(iter_base + 8, payload4) + Int4bound::Excluded(mbt_ffi_load32((return_area) + 12)) + } + 2 => { - () - } - Numeric(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) + Int4bound::Unbounded + } + _ => panic() + } - let ptr6 = mbt_ffi_str2ptr(payload5) - mbt_ffi_store32(iter_base + 12, payload5.length()) - mbt_ffi_store32(iter_base + 8, ptr6) - cleanup_list.push(ptr6) + let lifted12 = match (mbt_ffi_load8_u((return_area) + 16)) { + 0 => { - () - } - Boolean(payload7) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store8(iter_base + 8, if payload7 { 1 } else { 0 }) + Int4bound::Included(mbt_ffi_load32((return_area) + 20)) + } + 1 => { - () - } - Text(payload8) => { - mbt_ffi_store8(iter_base + 0, 8) + Int4bound::Excluded(mbt_ffi_load32((return_area) + 20)) + } + 2 => { - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(iter_base + 12, payload8.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - cleanup_list.push(ptr9) + Int4bound::Unbounded + } + _ => panic() + } - () - } - Varchar(payload10) => { - mbt_ffi_store8(iter_base + 0, 9) + DbValue::Int4range(Int4range::{start : lifted11, end : lifted12}) + } + 29 => { - let ptr11 = mbt_ffi_str2ptr(payload10) - mbt_ffi_store32(iter_base + 12, payload10.length()) - mbt_ffi_store32(iter_base + 8, ptr11) - cleanup_list.push(ptr11) + let lifted13 = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - () - } - Bpchar(payload12) => { - mbt_ffi_store8(iter_base + 0, 10) + Int8bound::Included(mbt_ffi_load64((return_area) + 16)) + } + 1 => { - let ptr13 = mbt_ffi_str2ptr(payload12) - mbt_ffi_store32(iter_base + 12, payload12.length()) - mbt_ffi_store32(iter_base + 8, ptr13) - cleanup_list.push(ptr13) + Int8bound::Excluded(mbt_ffi_load64((return_area) + 16)) + } + 2 => { - () - } - Timestamp(payload14) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload14.date.year) - mbt_ffi_store8(iter_base + 12, payload14.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload14.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload14.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload14.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload14.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload14.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Timestamptz(payload15) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store32(iter_base + 8, payload15.timestamp.date.year) - mbt_ffi_store8(iter_base + 12, payload15.timestamp.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload15.timestamp.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload15.timestamp.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload15.timestamp.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload15.timestamp.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload15.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 24, payload15.offset) - - () - } - Date(payload16) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store32(iter_base + 8, payload16.year) - mbt_ffi_store8(iter_base + 12, payload16.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload16.day.to_int()) + Int8bound::Unbounded + } + _ => panic() + } - () - } - Time(payload17) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store8(iter_base + 8, payload17.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload17.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload17.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload17.nanosecond.reinterpret_as_int(), - ) - - () - } - Timetz(payload18) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store8(iter_base + 8, payload18.time.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload18.time.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload18.time.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload18.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 16, payload18.offset) - - () - } - Interval(payload19) => { - mbt_ffi_store8(iter_base + 0, 16) - mbt_ffi_store32(iter_base + 8, payload19.months) - mbt_ffi_store32(iter_base + 12, payload19.days) - mbt_ffi_store64(iter_base + 16, payload19.microseconds) + let lifted14 = match (mbt_ffi_load8_u((return_area) + 24)) { + 0 => { - () - } - Bytea(payload20) => { - mbt_ffi_store8(iter_base + 0, 17) + Int8bound::Included(mbt_ffi_load64((return_area) + 32)) + } + 1 => { - let ptr21 = mbt_ffi_bytes2ptr(payload20) + Int8bound::Excluded(mbt_ffi_load64((return_area) + 32)) + } + 2 => { - mbt_ffi_store32(iter_base + 12, payload20.length()) - mbt_ffi_store32(iter_base + 8, ptr21) - cleanup_list.push(ptr21) + Int8bound::Unbounded + } + _ => panic() + } - () - } - Json(payload22) => { - mbt_ffi_store8(iter_base + 0, 18) + DbValue::Int8range(Int8range::{start : lifted13, end : lifted14}) + } + 30 => { - let ptr23 = mbt_ffi_str2ptr(payload22) - mbt_ffi_store32(iter_base + 12, payload22.length()) - mbt_ffi_store32(iter_base + 8, ptr23) - cleanup_list.push(ptr23) + let lifted17 = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - () - } - Jsonb(payload24) => { - mbt_ffi_store8(iter_base + 0, 19) + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let ptr25 = mbt_ffi_str2ptr(payload24) - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, ptr25) - cleanup_list.push(ptr25) + Numbound::Included(result15) + } + 1 => { - () - } - Jsonpath(payload26) => { - mbt_ffi_store8(iter_base + 0, 20) + let result16 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let ptr27 = mbt_ffi_str2ptr(payload26) - mbt_ffi_store32(iter_base + 12, payload26.length()) - mbt_ffi_store32(iter_base + 8, ptr27) - cleanup_list.push(ptr27) + Numbound::Excluded(result16) + } + 2 => { - () - } - Xml(payload28) => { - mbt_ffi_store8(iter_base + 0, 21) + Numbound::Unbounded + } + _ => panic() + } - let ptr29 = mbt_ffi_str2ptr(payload28) - mbt_ffi_store32(iter_base + 12, payload28.length()) - mbt_ffi_store32(iter_base + 8, ptr29) - cleanup_list.push(ptr29) + let lifted20 = match (mbt_ffi_load8_u((return_area) + 20)) { + 0 => { - () - } - Uuid(payload30) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store64( - iter_base + 8, - payload30.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 16, - payload30.low_bits.reinterpret_as_int64(), - ) - - () - } - Inet(payload31) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload31 { - Ipv4(payload32) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store8(iter_base + 10, payload32.0.to_int()) - mbt_ffi_store8(iter_base + 11, payload32.1.to_int()) - mbt_ffi_store8(iter_base + 12, payload32.2.to_int()) - mbt_ffi_store8(iter_base + 13, payload32.3.to_int()) - - () - } - Ipv6(payload33) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store16(iter_base + 10, payload33.0.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 12, payload33.1.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 14, payload33.2.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 16, payload33.3.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 18, payload33.4.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 20, payload33.5.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 22, payload33.6.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 24, payload33.7.reinterpret_as_int()) - - () - } - } - - () - } - Cidr(payload34) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload34 { - Ipv4(payload35) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store8(iter_base + 10, payload35.0.to_int()) - mbt_ffi_store8(iter_base + 11, payload35.1.to_int()) - mbt_ffi_store8(iter_base + 12, payload35.2.to_int()) - mbt_ffi_store8(iter_base + 13, payload35.3.to_int()) - - () - } - Ipv6(payload36) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store16(iter_base + 10, payload36.0.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 12, payload36.1.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 14, payload36.2.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 16, payload36.3.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 18, payload36.4.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 20, payload36.5.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 22, payload36.6.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 24, payload36.7.reinterpret_as_int()) - - () - } - } - - () - } - Macaddr(payload37) => { - mbt_ffi_store8(iter_base + 0, 25) - mbt_ffi_store8(iter_base + 8, payload37.octets.0.to_int()) - mbt_ffi_store8(iter_base + 9, payload37.octets.1.to_int()) - mbt_ffi_store8(iter_base + 10, payload37.octets.2.to_int()) - mbt_ffi_store8(iter_base + 11, payload37.octets.3.to_int()) - mbt_ffi_store8(iter_base + 12, payload37.octets.4.to_int()) - mbt_ffi_store8(iter_base + 13, payload37.octets.5.to_int()) - - () - } - Bit(payload38) => { - mbt_ffi_store8(iter_base + 0, 26) - - let address = mbt_ffi_malloc(payload38.length() * 1) - for index = 0; index < payload38.length(); index = index + 1 { - let iter_elem : Bool = payload38[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload38.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - Varbit(payload39) => { - mbt_ffi_store8(iter_base + 0, 27) - - let address40 = mbt_ffi_malloc(payload39.length() * 1) - for index41 = 0; index41 < payload39.length(); index41 = index41 + 1 { - let iter_elem : Bool = payload39[index41] - let iter_base = address40 + index41 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, address40) - cleanup_list.push(address40) - - () - } - Int4range(payload42) => { - mbt_ffi_store8(iter_base + 0, 28) - - match payload42.start { - Included(payload43) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload43) - - () - } - Excluded(payload44) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload44) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload42.end { - Included(payload46) => { - mbt_ffi_store8(iter_base + 16, 0) - mbt_ffi_store32(iter_base + 20, payload46) - - () - } - Excluded(payload47) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload47) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 16, 2) - - () - } - } - - () - } - Int8range(payload49) => { - mbt_ffi_store8(iter_base + 0, 29) - - match payload49.start { - Included(payload50) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store64(iter_base + 16, payload50) - - () - } - Excluded(payload51) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store64(iter_base + 16, payload51) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload49.end { - Included(payload53) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload53) - - () - } - Excluded(payload54) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload54) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 24, 2) - - () - } - } - - () - } - Numrange(payload56) => { - mbt_ffi_store8(iter_base + 0, 30) - - match payload56.start { - Included(payload57) => { - mbt_ffi_store8(iter_base + 8, 0) - - let ptr58 = mbt_ffi_str2ptr(payload57) - mbt_ffi_store32(iter_base + 16, payload57.length()) - mbt_ffi_store32(iter_base + 12, ptr58) - cleanup_list.push(ptr58) - - () - } - Excluded(payload59) => { - mbt_ffi_store8(iter_base + 8, 1) - - let ptr60 = mbt_ffi_str2ptr(payload59) - mbt_ffi_store32(iter_base + 16, payload59.length()) - mbt_ffi_store32(iter_base + 12, ptr60) - cleanup_list.push(ptr60) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload56.end { - Included(payload62) => { - mbt_ffi_store8(iter_base + 20, 0) - - let ptr63 = mbt_ffi_str2ptr(payload62) - mbt_ffi_store32(iter_base + 28, payload62.length()) - mbt_ffi_store32(iter_base + 24, ptr63) - cleanup_list.push(ptr63) - - () - } - Excluded(payload64) => { - mbt_ffi_store8(iter_base + 20, 1) - - let ptr65 = mbt_ffi_str2ptr(payload64) - mbt_ffi_store32(iter_base + 28, payload64.length()) - mbt_ffi_store32(iter_base + 24, ptr65) - cleanup_list.push(ptr65) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 20, 2) - - () - } - } - - () - } - Tsrange(payload67) => { - mbt_ffi_store8(iter_base + 0, 31) - - match payload67.start { - Included(payload68) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload68.date.year) - mbt_ffi_store8(iter_base + 16, payload68.date.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload68.date.day.to_int()) - mbt_ffi_store8(iter_base + 20, payload68.time.hour.to_int()) - mbt_ffi_store8(iter_base + 21, payload68.time.minute.to_int()) - mbt_ffi_store8(iter_base + 22, payload68.time.second.to_int()) - mbt_ffi_store32( - iter_base + 24, - payload68.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload69) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload69.date.year) - mbt_ffi_store8(iter_base + 16, payload69.date.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload69.date.day.to_int()) - mbt_ffi_store8(iter_base + 20, payload69.time.hour.to_int()) - mbt_ffi_store8(iter_base + 21, payload69.time.minute.to_int()) - mbt_ffi_store8(iter_base + 22, payload69.time.second.to_int()) - mbt_ffi_store32( - iter_base + 24, - payload69.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload67.end { - Included(payload71) => { - mbt_ffi_store8(iter_base + 28, 0) - mbt_ffi_store32(iter_base + 32, payload71.date.year) - mbt_ffi_store8(iter_base + 36, payload71.date.month.to_int()) - mbt_ffi_store8(iter_base + 37, payload71.date.day.to_int()) - mbt_ffi_store8(iter_base + 40, payload71.time.hour.to_int()) - mbt_ffi_store8(iter_base + 41, payload71.time.minute.to_int()) - mbt_ffi_store8(iter_base + 42, payload71.time.second.to_int()) - mbt_ffi_store32( - iter_base + 44, - payload71.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload72) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload72.date.year) - mbt_ffi_store8(iter_base + 36, payload72.date.month.to_int()) - mbt_ffi_store8(iter_base + 37, payload72.date.day.to_int()) - mbt_ffi_store8(iter_base + 40, payload72.time.hour.to_int()) - mbt_ffi_store8(iter_base + 41, payload72.time.minute.to_int()) - mbt_ffi_store8(iter_base + 42, payload72.time.second.to_int()) - mbt_ffi_store32( - iter_base + 44, - payload72.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 28, 2) - - () - } - } - - () - } - Tstzrange(payload74) => { - mbt_ffi_store8(iter_base + 0, 32) - - match payload74.start { - Included(payload75) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload75.timestamp.date.year) - mbt_ffi_store8( - iter_base + 16, - payload75.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 17, - payload75.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 20, - payload75.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 21, - payload75.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 22, - payload75.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 24, - payload75.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 28, payload75.offset) - - () - } - Excluded(payload76) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload76.timestamp.date.year) - mbt_ffi_store8( - iter_base + 16, - payload76.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 17, - payload76.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 20, - payload76.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 21, - payload76.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 22, - payload76.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 24, - payload76.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 28, payload76.offset) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload74.end { - Included(payload78) => { - mbt_ffi_store8(iter_base + 32, 0) - mbt_ffi_store32(iter_base + 36, payload78.timestamp.date.year) - mbt_ffi_store8( - iter_base + 40, - payload78.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 41, - payload78.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 44, - payload78.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 45, - payload78.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 46, - payload78.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 48, - payload78.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 52, payload78.offset) - - () - } - Excluded(payload79) => { - mbt_ffi_store8(iter_base + 32, 1) - mbt_ffi_store32(iter_base + 36, payload79.timestamp.date.year) - mbt_ffi_store8( - iter_base + 40, - payload79.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 41, - payload79.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 44, - payload79.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 45, - payload79.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 46, - payload79.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 48, - payload79.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 52, payload79.offset) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 32, 2) - - () - } - } - - () - } - Daterange(payload81) => { - mbt_ffi_store8(iter_base + 0, 33) - - match payload81.start { - Included(payload82) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload82.year) - mbt_ffi_store8(iter_base + 16, payload82.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload82.day.to_int()) - - () - } - Excluded(payload83) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload83.year) - mbt_ffi_store8(iter_base + 16, payload83.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload83.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload81.end { - Included(payload85) => { - mbt_ffi_store8(iter_base + 20, 0) - mbt_ffi_store32(iter_base + 24, payload85.year) - mbt_ffi_store8(iter_base + 28, payload85.month.to_int()) - mbt_ffi_store8(iter_base + 29, payload85.day.to_int()) - - () - } - Excluded(payload86) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload86.year) - mbt_ffi_store8(iter_base + 28, payload86.month.to_int()) - mbt_ffi_store8(iter_base + 29, payload86.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 20, 2) - - () - } - } - - () - } - Money(payload88) => { - mbt_ffi_store8(iter_base + 0, 34) - mbt_ffi_store64(iter_base + 8, payload88) - - () - } - Oid(payload89) => { - mbt_ffi_store8(iter_base + 0, 35) - mbt_ffi_store32(iter_base + 8, payload89.reinterpret_as_int()) + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 24), mbt_ffi_load32((return_area) + 28)) - () - } - Enumeration(payload90) => { - mbt_ffi_store8(iter_base + 0, 36) + Numbound::Included(result18) + } + 1 => { - let ptr91 = mbt_ffi_str2ptr(payload90.name) - mbt_ffi_store32(iter_base + 12, payload90.name.length()) - mbt_ffi_store32(iter_base + 8, ptr91) + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 24), mbt_ffi_load32((return_area) + 28)) - let ptr92 = mbt_ffi_str2ptr(payload90.value) - mbt_ffi_store32(iter_base + 20, payload90.value.length()) - mbt_ffi_store32(iter_base + 16, ptr92) - cleanup_list.push(ptr91) - cleanup_list.push(ptr92) + Numbound::Excluded(result19) + } + 2 => { - () - } - Composite(payload93) => { - mbt_ffi_store8(iter_base + 0, 37) - - let ptr94 = mbt_ffi_str2ptr(payload93.name) - mbt_ffi_store32(iter_base + 12, payload93.name.length()) - mbt_ffi_store32(iter_base + 8, ptr94) - - let address96 = mbt_ffi_malloc(payload93.values.length() * 4) - for index97 = 0 - index97 < payload93.values.length() - index97 = index97 + 1 { - let iter_elem : LazyDbValue = payload93.values[index97] - let iter_base = address96 + index97 * 4 - - let LazyDbValue(handle95) = iter_elem - mbt_ffi_store32(iter_base + 0, handle95) - } - mbt_ffi_store32(iter_base + 20, payload93.values.length()) - mbt_ffi_store32(iter_base + 16, address96) - cleanup_list.push(ptr94) - cleanup_list.push(address96) - - () - } - Domain(payload98) => { - mbt_ffi_store8(iter_base + 0, 38) + Numbound::Unbounded + } + _ => panic() + } - let ptr99 = mbt_ffi_str2ptr(payload98.name) - mbt_ffi_store32(iter_base + 12, payload98.name.length()) - mbt_ffi_store32(iter_base + 8, ptr99) + DbValue::Numrange(Numrange::{start : lifted17, end : lifted20}) + } + 31 => { - let LazyDbValue(handle100) = payload98.value - mbt_ffi_store32(iter_base + 16, handle100) - cleanup_list.push(ptr99) + let lifted21 = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - () - } - Array(payload101) => { - mbt_ffi_store8(iter_base + 0, 39) - - let address103 = mbt_ffi_malloc(payload101.length() * 4) - for index104 = 0 - index104 < payload101.length() - index104 = index104 + 1 { - let iter_elem : LazyDbValue = payload101[index104] - let iter_base = address103 + index104 * 4 - - let LazyDbValue(handle102) = iter_elem - mbt_ffi_store32(iter_base + 0, handle102) - } - mbt_ffi_store32(iter_base + 12, payload101.length()) - mbt_ffi_store32(iter_base + 8, address103) - cleanup_list.push(address103) - - () - } - Range(payload105) => { - mbt_ffi_store8(iter_base + 0, 40) + Tsbound::Included(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((return_area) + 12), month : (mbt_ffi_load8_u((return_area) + 16)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((return_area) + 20)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 21)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((return_area) + 24)).reinterpret_as_uint()}}) + } + 1 => { - let ptr106 = mbt_ffi_str2ptr(payload105.name) - mbt_ffi_store32(iter_base + 12, payload105.name.length()) - mbt_ffi_store32(iter_base + 8, ptr106) + Tsbound::Excluded(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((return_area) + 12), month : (mbt_ffi_load8_u((return_area) + 16)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((return_area) + 20)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 21)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((return_area) + 24)).reinterpret_as_uint()}}) + } + 2 => { - match payload105.value.start { - Included(payload107) => { - mbt_ffi_store8(iter_base + 16, 0) + Tsbound::Unbounded + } + _ => panic() + } - let LazyDbValue(handle108) = payload107 - mbt_ffi_store32(iter_base + 20, handle108) + let lifted22 = match (mbt_ffi_load8_u((return_area) + 28)) { + 0 => { - () - } - Excluded(payload109) => { - mbt_ffi_store8(iter_base + 16, 1) + Tsbound::Included(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((return_area) + 32), month : (mbt_ffi_load8_u((return_area) + 36)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 37)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((return_area) + 40)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 41)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 42)).to_byte(), nanosecond : (mbt_ffi_load32((return_area) + 44)).reinterpret_as_uint()}}) + } + 1 => { - let LazyDbValue(handle110) = payload109 - mbt_ffi_store32(iter_base + 20, handle110) + Tsbound::Excluded(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((return_area) + 32), month : (mbt_ffi_load8_u((return_area) + 36)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 37)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((return_area) + 40)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 41)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 42)).to_byte(), nanosecond : (mbt_ffi_load32((return_area) + 44)).reinterpret_as_uint()}}) + } + 2 => { - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 16, 2) + Tsbound::Unbounded + } + _ => panic() + } - () - } - } + DbValue::Tsrange(Tsrange::{start : lifted21, end : lifted22}) + } + 32 => { - match payload105.value.end { - Included(payload112) => { - mbt_ffi_store8(iter_base + 24, 0) + let lifted23 = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - let LazyDbValue(handle113) = payload112 - mbt_ffi_store32(iter_base + 28, handle113) + Tstzbound::Included(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((return_area) + 12), month : (mbt_ffi_load8_u((return_area) + 16)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((return_area) + 20)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 21)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((return_area) + 24)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((return_area) + 28)}) + } + 1 => { - () - } - Excluded(payload114) => { - mbt_ffi_store8(iter_base + 24, 1) + Tstzbound::Excluded(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((return_area) + 12), month : (mbt_ffi_load8_u((return_area) + 16)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((return_area) + 20)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 21)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((return_area) + 24)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((return_area) + 28)}) + } + 2 => { - let LazyDbValue(handle115) = payload114 - mbt_ffi_store32(iter_base + 28, handle115) + Tstzbound::Unbounded + } + _ => panic() + } - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 24, 2) + let lifted24 = match (mbt_ffi_load8_u((return_area) + 32)) { + 0 => { - () - } - } - cleanup_list.push(ptr106) + Tstzbound::Included(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((return_area) + 36), month : (mbt_ffi_load8_u((return_area) + 40)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 41)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((return_area) + 44)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 45)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 46)).to_byte(), nanosecond : (mbt_ffi_load32((return_area) + 48)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((return_area) + 52)}) + } + 1 => { - () - } - Null => { - mbt_ffi_store8(iter_base + 0, 41) + Tstzbound::Excluded(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((return_area) + 36), month : (mbt_ffi_load8_u((return_area) + 40)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 41)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((return_area) + 44)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 45)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 46)).to_byte(), nanosecond : (mbt_ffi_load32((return_area) + 48)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((return_area) + 52)}) + } + 2 => { - () - } - Vector(payload118) => { - mbt_ffi_store8(iter_base + 0, 42) + Tstzbound::Unbounded + } + _ => panic() + } - let ptr119 = mbt_ffi_float_array2ptr(payload118) + DbValue::Tstzrange(Tstzrange::{start : lifted23, end : lifted24}) + } + 33 => { - mbt_ffi_store32(iter_base + 12, payload118.length()) - mbt_ffi_store32(iter_base + 8, ptr119) - cleanup_list.push(ptr119) + let lifted25 = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - () - } - Halfvec(payload120) => { - mbt_ffi_store8(iter_base + 0, 43) + Datebound::Included(@types.Date::{year : mbt_ffi_load32((return_area) + 12), month : (mbt_ffi_load8_u((return_area) + 16)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 17)).to_byte()}) + } + 1 => { - let ptr121 = mbt_ffi_float_array2ptr(payload120) + Datebound::Excluded(@types.Date::{year : mbt_ffi_load32((return_area) + 12), month : (mbt_ffi_load8_u((return_area) + 16)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 17)).to_byte()}) + } + 2 => { - mbt_ffi_store32(iter_base + 12, payload120.length()) - mbt_ffi_store32(iter_base + 8, ptr121) - cleanup_list.push(ptr121) + Datebound::Unbounded + } + _ => panic() + } - () - } - Sparsevec(payload122) => { - mbt_ffi_store8(iter_base + 0, 44) - mbt_ffi_store32(iter_base + 8, payload122.dim) + let lifted26 = match (mbt_ffi_load8_u((return_area) + 20)) { + 0 => { - let ptr123 = mbt_ffi_int_array2ptr(payload122.indices) + Datebound::Included(@types.Date::{year : mbt_ffi_load32((return_area) + 24), month : (mbt_ffi_load8_u((return_area) + 28)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 29)).to_byte()}) + } + 1 => { - mbt_ffi_store32(iter_base + 16, payload122.indices.length()) - mbt_ffi_store32(iter_base + 12, ptr123) + Datebound::Excluded(@types.Date::{year : mbt_ffi_load32((return_area) + 24), month : (mbt_ffi_load8_u((return_area) + 28)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 29)).to_byte()}) + } + 2 => { - let ptr124 = mbt_ffi_float_array2ptr(payload122.values) + Datebound::Unbounded + } + _ => panic() + } - mbt_ffi_store32(iter_base + 24, payload122.values.length()) - mbt_ffi_store32(iter_base + 20, ptr124) - cleanup_list.push(ptr123) - cleanup_list.push(ptr124) + DbValue::Daterange(Daterange::{start : lifted25, end : lifted26}) + } + 34 => { - () - } - } - } - let return_area = mbt_ffi_malloc(20) - wasmImportMethodDbConnectionQuery( - handle, - ptr, - statement.length(), - address125, - params.length(), - return_area, - ) - - let lifted193 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array134 : Array[DbColumn] = [] - for index135 = 0 - index135 < mbt_ffi_load32(return_area + 8) - index135 = index135 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index135 * 48 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted = match mbt_ffi_load8_u(iter_base + 16) { - 0 => DbColumnType::Character - 1 => DbColumnType::Int2 - 2 => DbColumnType::Int4 - 3 => DbColumnType::Int8 - 4 => DbColumnType::Float4 - 5 => DbColumnType::Float8 - 6 => DbColumnType::Numeric - 7 => DbColumnType::Boolean - 8 => DbColumnType::Text - 9 => DbColumnType::Varchar - 10 => DbColumnType::Bpchar - 11 => DbColumnType::Timestamp - 12 => DbColumnType::Timestamptz - 13 => DbColumnType::Date - 14 => DbColumnType::Time - 15 => DbColumnType::Timetz - 16 => DbColumnType::Interval - 17 => DbColumnType::Bytea - 18 => DbColumnType::Uuid - 19 => DbColumnType::Xml - 20 => DbColumnType::Json - 21 => DbColumnType::Jsonb - 22 => DbColumnType::Jsonpath - 23 => DbColumnType::Inet - 24 => DbColumnType::Cidr - 25 => DbColumnType::Macaddr - 26 => DbColumnType::Bit - 27 => DbColumnType::Varbit - 28 => DbColumnType::Int4range - 29 => DbColumnType::Int8range - 30 => DbColumnType::Numrange - 31 => DbColumnType::Tsrange - 32 => DbColumnType::Tstzrange - 33 => DbColumnType::Daterange - 34 => DbColumnType::Money - 35 => DbColumnType::Oid - 36 => { - let result127 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - DbColumnType::Enumeration(EnumerationType::{ name: result127 }) - } - 37 => { - let result128 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - let array : Array[(String, LazyDbColumnType)] = [] - for index130 = 0 - index130 < mbt_ffi_load32(iter_base + 32) - index130 = index130 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index130 * 12 - - let result129 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push( - ( - result129, - LazyDbColumnType::LazyDbColumnType( - mbt_ffi_load32(iter_base + 8), - ), - ), - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - DbColumnType::Composite(CompositeType::{ - name: result128, - attributes: array, - }) - } - 38 => { - let result131 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - DbColumnType::Domain(DomainType::{ - name: result131, - base_type: LazyDbColumnType::LazyDbColumnType( - mbt_ffi_load32(iter_base + 28), - ), - }) - } - 39 => - DbColumnType::Array( - LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32(iter_base + 20)), - ) - 40 => { - let result132 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - DbColumnType::Range(RangeType::{ - name: result132, - base_type: LazyDbColumnType::LazyDbColumnType( - mbt_ffi_load32(iter_base + 28), - ), - }) - } - 41 => DbColumnType::Vector - 42 => DbColumnType::Halfvec - 43 => DbColumnType::Sparsevec - _ => panic() - } - - let result133 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - array134.push(DbColumn::{ - ordinal: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - name: result, - db_type: lifted, - db_type_name: result133, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - let array185 : Array[DbRow] = [] - for index186 = 0 - index186 < mbt_ffi_load32(return_area + 16) - index186 = index186 + 1 { - let iter_base = mbt_ffi_load32(return_area + 12) + index186 * 8 - - let array183 : Array[DbValue] = [] - for index184 = 0 - index184 < mbt_ffi_load32(iter_base + 4) - index184 = index184 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + index184 * 56 - - let lifted182 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => DbValue::Character(mbt_ffi_load8(iter_base + 8)) - 1 => DbValue::Int2(mbt_ffi_load16(iter_base + 8)) - 2 => DbValue::Int4(mbt_ffi_load32(iter_base + 8)) - 3 => DbValue::Int8(mbt_ffi_load64(iter_base + 8)) - 4 => DbValue::Float4(mbt_ffi_loadf32(iter_base + 8)) - 5 => DbValue::Float8(mbt_ffi_loadf64(iter_base + 8)) - 6 => { - let result136 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbValue::Money(mbt_ffi_load64((return_area) + 8)) + } + 35 => { - DbValue::Numeric(result136) + DbValue::Oid((mbt_ffi_load32((return_area) + 8)).reinterpret_as_uint()) } - 7 => DbValue::Boolean(mbt_ffi_load8_u(iter_base + 8) != 0) - 8 => { - let result137 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 36 => { + + let result27 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - DbValue::Text(result137) + let result28 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 16), mbt_ffi_load32((return_area) + 20)) + + DbValue::Enumeration(Enumeration::{name : result27, value : result28}) } - 9 => { - let result138 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 37 => { + + let result29 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - DbValue::Varchar(result138) + let array30 : Array[LazyDbValue] = []; + for index31 = 0; index31 < (mbt_ffi_load32((return_area) + 20)); index31 = index31 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 16)) + (index31 * 4) + + array30.push(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 0))) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 16)) + + DbValue::Composite(Composite::{name : result29, values : array30}) } - 10 => { - let result139 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::Bpchar(result139) - } - 11 => - DbValue::Timestamp(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 16).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 17).to_byte(), - second: mbt_ffi_load8_u(iter_base + 18).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 20).reinterpret_as_uint(), - }, - }) - 12 => - DbValue::Timestamptz(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 16).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 17).to_byte(), - second: mbt_ffi_load8_u(iter_base + 18).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 20).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 24), - }) - 13 => - DbValue::Date(@types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }) - 14 => - DbValue::Time(@types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 8).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 9).to_byte(), - second: mbt_ffi_load8_u(iter_base + 10).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 15 => - DbValue::Timetz(@types.Timetz::{ - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 8).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 9).to_byte(), - second: mbt_ffi_load8_u(iter_base + 10).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }, - offset: mbt_ffi_load32(iter_base + 16), - }) - 16 => - DbValue::Interval(Interval::{ - months: mbt_ffi_load32(iter_base + 8), - days: mbt_ffi_load32(iter_base + 12), - microseconds: mbt_ffi_load64(iter_base + 16), - }) - 17 => { - let result140 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 38 => { + + let result32 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - DbValue::Bytea(result140) + DbValue::Domain(Domain::{name : result32, value : LazyDbValue::LazyDbValue(mbt_ffi_load32((return_area) + 16))}) } - 18 => { - let result141 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 39 => { - DbValue::Json(result141) + let array33 : Array[LazyDbValue] = []; + for index34 = 0; index34 < (mbt_ffi_load32((return_area) + 12)); index34 = index34 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 8)) + (index34 * 4) + + array33.push(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 0))) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 8)) + + DbValue::Array(array33) } - 19 => { - let result142 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 40 => { - DbValue::Jsonb(result142) + let result35 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + let lifted36 = match (mbt_ffi_load8_u((return_area) + 16)) { + 0 => { + + ValueBound::Included(LazyDbValue::LazyDbValue(mbt_ffi_load32((return_area) + 20))) + } + 1 => { + + ValueBound::Excluded(LazyDbValue::LazyDbValue(mbt_ffi_load32((return_area) + 20))) + } + 2 => { + + ValueBound::Unbounded + } + _ => panic() + } + + let lifted37 = match (mbt_ffi_load8_u((return_area) + 24)) { + 0 => { + + ValueBound::Included(LazyDbValue::LazyDbValue(mbt_ffi_load32((return_area) + 28))) + } + 1 => { + + ValueBound::Excluded(LazyDbValue::LazyDbValue(mbt_ffi_load32((return_area) + 28))) + } + 2 => { + + ValueBound::Unbounded + } + _ => panic() + } + + DbValue::Range(Range::{name : result35, value : ValuesRange::{start : lifted36, end : lifted37}}) } - 20 => { - let result143 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + 41 => { - DbValue::Jsonpath(result143) + DbValue::Null } - 21 => { - let result144 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::Xml(result144) - } - 22 => - DbValue::Uuid(@types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - }) - 23 => { - let lifted145 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - @types.IpAddress::Ipv4( - ( - mbt_ffi_load8_u(iter_base + 10).to_byte(), - mbt_ffi_load8_u(iter_base + 11).to_byte(), - mbt_ffi_load8_u(iter_base + 12).to_byte(), - mbt_ffi_load8_u(iter_base + 13).to_byte(), - ), - ) - 1 => - @types.IpAddress::Ipv6( - ( - mbt_ffi_load16_u(iter_base + 10) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 14) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 16) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 18) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 20) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 22) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 24) - .land(0xFFFF) - .reinterpret_as_uint(), - ), - ) - _ => panic() - } - - DbValue::Inet(lifted145) + 42 => { + + let result38 = mbt_ffi_ptr2float_array(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + DbValue::Vector(result38) } - 24 => { - let lifted146 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - @types.IpAddress::Ipv4( - ( - mbt_ffi_load8_u(iter_base + 10).to_byte(), - mbt_ffi_load8_u(iter_base + 11).to_byte(), - mbt_ffi_load8_u(iter_base + 12).to_byte(), - mbt_ffi_load8_u(iter_base + 13).to_byte(), - ), - ) - 1 => - @types.IpAddress::Ipv6( - ( - mbt_ffi_load16_u(iter_base + 10) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 14) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 16) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 18) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 20) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 22) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 24) - .land(0xFFFF) - .reinterpret_as_uint(), - ), - ) - _ => panic() - } - - DbValue::Cidr(lifted146) - } - 25 => - DbValue::Macaddr(@types.MacAddress::{ - octets: ( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - mbt_ffi_load8_u(iter_base + 9).to_byte(), - mbt_ffi_load8_u(iter_base + 10).to_byte(), - mbt_ffi_load8_u(iter_base + 11).to_byte(), - mbt_ffi_load8_u(iter_base + 12).to_byte(), - mbt_ffi_load8_u(iter_base + 13).to_byte(), - ), - }) - 26 => { - let array147 : Array[Bool] = [] - for index148 = 0 - index148 < mbt_ffi_load32(iter_base + 12) - index148 = index148 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index148 * 1 + 43 => { - array147.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result39 = mbt_ffi_ptr2float_array(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - DbValue::Bit(array147) + DbValue::Halfvec(result39) } - 27 => { - let array149 : Array[Bool] = [] - for index150 = 0 - index150 < mbt_ffi_load32(iter_base + 12) - index150 = index150 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index150 * 1 + 44 => { - array149.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result40 = mbt_ffi_ptr2int_array(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - DbValue::Varbit(array149) + let result41 = mbt_ffi_ptr2float_array(mbt_ffi_load32((return_area) + 20), mbt_ffi_load32((return_area) + 24)) + + DbValue::Sparsevec(SparseVec::{dim : mbt_ffi_load32((return_area) + 8), indices : result40, values : result41}) } - 28 => { - let lifted151 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Int4bound::Included(mbt_ffi_load32(iter_base + 12)) - 1 => Int4bound::Excluded(mbt_ffi_load32(iter_base + 12)) - 2 => Int4bound::Unbounded - _ => panic() - } - - let lifted152 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Int4bound::Included(mbt_ffi_load32(iter_base + 20)) - 1 => Int4bound::Excluded(mbt_ffi_load32(iter_base + 20)) - 2 => Int4bound::Unbounded - _ => panic() - } - - DbValue::Int4range(Int4range::{ start: lifted151, end: lifted152 }) + _ => panic() + } + let ret = lifted42 + mbt_ffi_free(return_area) + return ret + +} +///| +pub fn LazyDbColumnType::lazy_db_column_type(value : DbColumnType) -> LazyDbColumnType { + let cleanup_list : Array[Int] = [] + + let (lowered,lowered50,lowered51,lowered52,lowered53) = match value { + Character => { + + ((0), 0, 0, 0, 0) } - 29 => { - let lifted153 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Int8bound::Included(mbt_ffi_load64(iter_base + 16)) - 1 => Int8bound::Excluded(mbt_ffi_load64(iter_base + 16)) - 2 => Int8bound::Unbounded - _ => panic() - } - - let lifted154 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Int8bound::Included(mbt_ffi_load64(iter_base + 32)) - 1 => Int8bound::Excluded(mbt_ffi_load64(iter_base + 32)) - 2 => Int8bound::Unbounded - _ => panic() - } - - DbValue::Int8range(Int8range::{ start: lifted153, end: lifted154 }) + Int2 => { + + ((1), 0, 0, 0, 0) } - 30 => { - let lifted157 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Numbound::Included(result155) - } - 1 => { - let result156 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Numbound::Excluded(result156) - } - 2 => Numbound::Unbounded - _ => panic() - } - - let lifted160 = match mbt_ffi_load8_u(iter_base + 20) { - 0 => { - let result158 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - Numbound::Included(result158) - } - 1 => { - let result159 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - Numbound::Excluded(result159) - } - 2 => Numbound::Unbounded - _ => panic() - } - - DbValue::Numrange(Numrange::{ start: lifted157, end: lifted160 }) + Int4 => { + + ((2), 0, 0, 0, 0) } - 31 => { - let lifted161 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - Tsbound::Included(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 20).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 21).to_byte(), - second: mbt_ffi_load8_u(iter_base + 22).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }) - 1 => - Tsbound::Excluded(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 20).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 21).to_byte(), - second: mbt_ffi_load8_u(iter_base + 22).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }) - 2 => Tsbound::Unbounded - _ => panic() - } - - let lifted162 = match mbt_ffi_load8_u(iter_base + 28) { - 0 => - Tsbound::Included(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 32), - month: mbt_ffi_load8_u(iter_base + 36).to_byte(), - day: mbt_ffi_load8_u(iter_base + 37).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 40).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 41).to_byte(), - second: mbt_ffi_load8_u(iter_base + 42).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 44).reinterpret_as_uint(), - }, - }) - 1 => - Tsbound::Excluded(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 32), - month: mbt_ffi_load8_u(iter_base + 36).to_byte(), - day: mbt_ffi_load8_u(iter_base + 37).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 40).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 41).to_byte(), - second: mbt_ffi_load8_u(iter_base + 42).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 44).reinterpret_as_uint(), - }, - }) - 2 => Tsbound::Unbounded - _ => panic() - } - - DbValue::Tsrange(Tsrange::{ start: lifted161, end: lifted162 }) + Int8 => { + + ((3), 0, 0, 0, 0) } - 32 => { - let lifted163 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - Tstzbound::Included(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 20).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 21).to_byte(), - second: mbt_ffi_load8_u(iter_base + 22).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 28), - }) - 1 => - Tstzbound::Excluded(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 20).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 21).to_byte(), - second: mbt_ffi_load8_u(iter_base + 22).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 28), - }) - 2 => Tstzbound::Unbounded - _ => panic() - } - - let lifted164 = match mbt_ffi_load8_u(iter_base + 32) { - 0 => - Tstzbound::Included(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 36), - month: mbt_ffi_load8_u(iter_base + 40).to_byte(), - day: mbt_ffi_load8_u(iter_base + 41).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 44).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 45).to_byte(), - second: mbt_ffi_load8_u(iter_base + 46).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 48).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 52), - }) - 1 => - Tstzbound::Excluded(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 36), - month: mbt_ffi_load8_u(iter_base + 40).to_byte(), - day: mbt_ffi_load8_u(iter_base + 41).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 44).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 45).to_byte(), - second: mbt_ffi_load8_u(iter_base + 46).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 48).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 52), - }) - 2 => Tstzbound::Unbounded - _ => panic() - } - - DbValue::Tstzrange(Tstzrange::{ start: lifted163, end: lifted164 }) + Float4 => { + + ((4), 0, 0, 0, 0) } - 33 => { - let lifted165 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - Datebound::Included(@types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }) - 1 => - Datebound::Excluded(@types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }) - 2 => Datebound::Unbounded - _ => panic() - } - - let lifted166 = match mbt_ffi_load8_u(iter_base + 20) { - 0 => - Datebound::Included(@types.Date::{ - year: mbt_ffi_load32(iter_base + 24), - month: mbt_ffi_load8_u(iter_base + 28).to_byte(), - day: mbt_ffi_load8_u(iter_base + 29).to_byte(), - }) - 1 => - Datebound::Excluded(@types.Date::{ - year: mbt_ffi_load32(iter_base + 24), - month: mbt_ffi_load8_u(iter_base + 28).to_byte(), - day: mbt_ffi_load8_u(iter_base + 29).to_byte(), - }) - 2 => Datebound::Unbounded - _ => panic() - } - - DbValue::Daterange(Daterange::{ start: lifted165, end: lifted166 }) - } - 34 => DbValue::Money(mbt_ffi_load64(iter_base + 8)) - 35 => - DbValue::Oid(mbt_ffi_load32(iter_base + 8).reinterpret_as_uint()) - 36 => { - let result167 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Float8 => { - let result168 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + ((5), 0, 0, 0, 0) + } + Numeric => { - DbValue::Enumeration(Enumeration::{ - name: result167, - value: result168, - }) + ((6), 0, 0, 0, 0) } - 37 => { - let result169 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array170 : Array[LazyDbValue] = [] - for index171 = 0 - index171 < mbt_ffi_load32(iter_base + 20) - index171 = index171 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index171 * 4 - - array170.push( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 0)), - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - DbValue::Composite(Composite::{ - name: result169, - values: array170, - }) + Boolean => { + + ((7), 0, 0, 0, 0) } - 38 => { - let result172 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Text => { - DbValue::Domain(Domain::{ - name: result172, - value: LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 16)), - }) + ((8), 0, 0, 0, 0) } - 39 => { - let array173 : Array[LazyDbValue] = [] - for index174 = 0 - index174 < mbt_ffi_load32(iter_base + 12) - index174 = index174 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index174 * 4 + Varchar => { - array173.push( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 0)), - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + ((9), 0, 0, 0, 0) + } + Bpchar => { - DbValue::Array(array173) + ((10), 0, 0, 0, 0) } - 40 => { - let result175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted176 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => - ValueBound::Included( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 20)), - ) - 1 => - ValueBound::Excluded( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 20)), - ) - 2 => ValueBound::Unbounded - _ => panic() - } - - let lifted177 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - ValueBound::Included( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 28)), - ) - 1 => - ValueBound::Excluded( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 28)), - ) - 2 => ValueBound::Unbounded - _ => panic() - } - - DbValue::Range(Range::{ - name: result175, - value: ValuesRange::{ start: lifted176, end: lifted177 }, - }) - } - 41 => DbValue::Null - 42 => { - let result178 = mbt_ffi_ptr2float_array( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Timestamp => { - DbValue::Vector(result178) + ((11), 0, 0, 0, 0) } - 43 => { - let result179 = mbt_ffi_ptr2float_array( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Timestamptz => { - DbValue::Halfvec(result179) + ((12), 0, 0, 0, 0) } - 44 => { - let result180 = mbt_ffi_ptr2int_array( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - let result181 = mbt_ffi_ptr2float_array( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - DbValue::Sparsevec(SparseVec::{ - dim: mbt_ffi_load32(iter_base + 8), - indices: result180, - values: result181, - }) + Date => { + + ((13), 0, 0, 0, 0) } - _ => panic() - } + Time => { - array183.push(lifted182) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + ((14), 0, 0, 0, 0) + } + Timetz => { - array185.push(DbRow::{ values: array183 }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 12)) - - Result::Ok(DbResult::{ columns: array134, rows: array185 }) - } - 1 => { - let lifted192 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result187 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result187) - } - 1 => { - let result188 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result188) - } - 2 => { - let result189 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result189) - } - 3 => { - let result190 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result190) - } - 4 => { - let result191 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result191) - } - _ => panic() - } + ((15), 0, 0, 0, 0) + } + Interval => { - Result::Err(lifted192) - } - _ => panic() - } - let ret = lifted193 - mbt_ffi_free(ptr) - mbt_ffi_free(address125) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + ((16), 0, 0, 0, 0) + } + Bytea => { -///| -pub fn DbConnection::query_stream( - self : DbConnection, - statement : String, - params : Array[DbValue], -) -> Result[DbResultStream, Error_] { - let cleanup_list : Array[Int] = [] + ((17), 0, 0, 0, 0) + } + Uuid => { - let DbConnection(handle) = self + ((18), 0, 0, 0, 0) + } + Xml => { - let ptr = mbt_ffi_str2ptr(statement) + ((19), 0, 0, 0, 0) + } + Json => { - let address125 = mbt_ffi_malloc(params.length() * 56) - for index126 = 0; index126 < params.length(); index126 = index126 + 1 { - let iter_elem : DbValue = params[index126] - let iter_base = address125 + index126 * 56 + ((20), 0, 0, 0, 0) + } + Jsonb => { - match iter_elem { - Character(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload)) + ((21), 0, 0, 0, 0) + } + Jsonpath => { - () - } - Int2(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload0)) + ((22), 0, 0, 0, 0) + } + Inet => { - () - } - Int4(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store32(iter_base + 8, payload1) + ((23), 0, 0, 0, 0) + } + Cidr => { - () - } - Int8(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store64(iter_base + 8, payload2) + ((24), 0, 0, 0, 0) + } + Macaddr => { - () - } - Float4(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_storef32(iter_base + 8, payload3) + ((25), 0, 0, 0, 0) + } + Bit => { - () - } - Float8(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_storef64(iter_base + 8, payload4) + ((26), 0, 0, 0, 0) + } + Varbit => { - () - } - Numeric(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) + ((27), 0, 0, 0, 0) + } + Int4range => { - let ptr6 = mbt_ffi_str2ptr(payload5) - mbt_ffi_store32(iter_base + 12, payload5.length()) - mbt_ffi_store32(iter_base + 8, ptr6) - cleanup_list.push(ptr6) + ((28), 0, 0, 0, 0) + } + Int8range => { - () - } - Boolean(payload7) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store8(iter_base + 8, if payload7 { 1 } else { 0 }) + ((29), 0, 0, 0, 0) + } + Numrange => { - () - } - Text(payload8) => { - mbt_ffi_store8(iter_base + 0, 8) + ((30), 0, 0, 0, 0) + } + Tsrange => { - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(iter_base + 12, payload8.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - cleanup_list.push(ptr9) + ((31), 0, 0, 0, 0) + } + Tstzrange => { - () - } - Varchar(payload10) => { - mbt_ffi_store8(iter_base + 0, 9) + ((32), 0, 0, 0, 0) + } + Daterange => { - let ptr11 = mbt_ffi_str2ptr(payload10) - mbt_ffi_store32(iter_base + 12, payload10.length()) - mbt_ffi_store32(iter_base + 8, ptr11) - cleanup_list.push(ptr11) + ((33), 0, 0, 0, 0) + } + Money => { - () - } - Bpchar(payload12) => { - mbt_ffi_store8(iter_base + 0, 10) + ((34), 0, 0, 0, 0) + } + Oid => { - let ptr13 = mbt_ffi_str2ptr(payload12) - mbt_ffi_store32(iter_base + 12, payload12.length()) - mbt_ffi_store32(iter_base + 8, ptr13) - cleanup_list.push(ptr13) + ((35), 0, 0, 0, 0) + } + Enumeration(payload35) => { - () - } - Timestamp(payload14) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload14.date.year) - mbt_ffi_store8(iter_base + 12, payload14.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload14.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload14.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload14.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload14.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload14.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Timestamptz(payload15) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store32(iter_base + 8, payload15.timestamp.date.year) - mbt_ffi_store8(iter_base + 12, payload15.timestamp.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload15.timestamp.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload15.timestamp.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload15.timestamp.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload15.timestamp.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload15.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 24, payload15.offset) - - () - } - Date(payload16) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store32(iter_base + 8, payload16.year) - mbt_ffi_store8(iter_base + 12, payload16.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload16.day.to_int()) + let ptr = mbt_ffi_str2ptr((payload35).name) + cleanup_list.push(ptr) - () - } - Time(payload17) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store8(iter_base + 8, payload17.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload17.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload17.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload17.nanosecond.reinterpret_as_int(), - ) - - () - } - Timetz(payload18) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store8(iter_base + 8, payload18.time.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload18.time.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload18.time.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload18.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 16, payload18.offset) - - () - } - Interval(payload19) => { - mbt_ffi_store8(iter_base + 0, 16) - mbt_ffi_store32(iter_base + 8, payload19.months) - mbt_ffi_store32(iter_base + 12, payload19.days) - mbt_ffi_store64(iter_base + 16, payload19.microseconds) + ((36), ptr, (payload35).name.length(), 0, 0) + } + Composite(payload36) => { - () - } - Bytea(payload20) => { - mbt_ffi_store8(iter_base + 0, 17) + let ptr37 = mbt_ffi_str2ptr((payload36).name) - let ptr21 = mbt_ffi_bytes2ptr(payload20) + let address = mbt_ffi_malloc(((payload36).attributes).length() * 12); + for index = 0; index < ((payload36).attributes).length(); index = index + 1 { + let iter_elem : (String, LazyDbColumnType) = ((payload36).attributes)[(index)] + let iter_base = address + (index * 12); - mbt_ffi_store32(iter_base + 12, payload20.length()) - mbt_ffi_store32(iter_base + 8, ptr21) - cleanup_list.push(ptr21) + let ptr38 = mbt_ffi_str2ptr((iter_elem).0) + mbt_ffi_store32((iter_base) + 4, (iter_elem).0.length()) + mbt_ffi_store32((iter_base) + 0, ptr38) - () - } - Json(payload22) => { - mbt_ffi_store8(iter_base + 0, 18) + let LazyDbColumnType(handle) = (iter_elem).1 + mbt_ffi_store32((iter_base) + 8, handle) + cleanup_list.push(ptr38) - let ptr23 = mbt_ffi_str2ptr(payload22) - mbt_ffi_store32(iter_base + 12, payload22.length()) - mbt_ffi_store32(iter_base + 8, ptr23) - cleanup_list.push(ptr23) + } + cleanup_list.push(ptr37) + cleanup_list.push(address) - () - } - Jsonb(payload24) => { - mbt_ffi_store8(iter_base + 0, 19) + ((37), ptr37, (payload36).name.length(), address, ((payload36).attributes).length()) + } + Domain(payload39) => { - let ptr25 = mbt_ffi_str2ptr(payload24) - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, ptr25) - cleanup_list.push(ptr25) + let ptr40 = mbt_ffi_str2ptr((payload39).name) - () - } - Jsonpath(payload26) => { - mbt_ffi_store8(iter_base + 0, 20) + let LazyDbColumnType(handle41) = (payload39).base_type + cleanup_list.push(ptr40) - let ptr27 = mbt_ffi_str2ptr(payload26) - mbt_ffi_store32(iter_base + 12, payload26.length()) - mbt_ffi_store32(iter_base + 8, ptr27) - cleanup_list.push(ptr27) + ((38), ptr40, (payload39).name.length(), handle41, 0) + } + Array(payload42) => { - () - } - Xml(payload28) => { - mbt_ffi_store8(iter_base + 0, 21) + let LazyDbColumnType(handle43) = payload42 - let ptr29 = mbt_ffi_str2ptr(payload28) - mbt_ffi_store32(iter_base + 12, payload28.length()) - mbt_ffi_store32(iter_base + 8, ptr29) - cleanup_list.push(ptr29) + ((39), handle43, 0, 0, 0) + } + Range(payload44) => { - () - } - Uuid(payload30) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store64( - iter_base + 8, - payload30.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 16, - payload30.low_bits.reinterpret_as_int64(), - ) - - () - } - Inet(payload31) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload31 { - Ipv4(payload32) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store8(iter_base + 10, payload32.0.to_int()) - mbt_ffi_store8(iter_base + 11, payload32.1.to_int()) - mbt_ffi_store8(iter_base + 12, payload32.2.to_int()) - mbt_ffi_store8(iter_base + 13, payload32.3.to_int()) - - () - } - Ipv6(payload33) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store16(iter_base + 10, payload33.0.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 12, payload33.1.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 14, payload33.2.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 16, payload33.3.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 18, payload33.4.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 20, payload33.5.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 22, payload33.6.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 24, payload33.7.reinterpret_as_int()) - - () - } - } - - () - } - Cidr(payload34) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload34 { - Ipv4(payload35) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store8(iter_base + 10, payload35.0.to_int()) - mbt_ffi_store8(iter_base + 11, payload35.1.to_int()) - mbt_ffi_store8(iter_base + 12, payload35.2.to_int()) - mbt_ffi_store8(iter_base + 13, payload35.3.to_int()) - - () - } - Ipv6(payload36) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store16(iter_base + 10, payload36.0.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 12, payload36.1.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 14, payload36.2.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 16, payload36.3.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 18, payload36.4.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 20, payload36.5.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 22, payload36.6.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 24, payload36.7.reinterpret_as_int()) - - () - } - } - - () - } - Macaddr(payload37) => { - mbt_ffi_store8(iter_base + 0, 25) - mbt_ffi_store8(iter_base + 8, payload37.octets.0.to_int()) - mbt_ffi_store8(iter_base + 9, payload37.octets.1.to_int()) - mbt_ffi_store8(iter_base + 10, payload37.octets.2.to_int()) - mbt_ffi_store8(iter_base + 11, payload37.octets.3.to_int()) - mbt_ffi_store8(iter_base + 12, payload37.octets.4.to_int()) - mbt_ffi_store8(iter_base + 13, payload37.octets.5.to_int()) - - () - } - Bit(payload38) => { - mbt_ffi_store8(iter_base + 0, 26) - - let address = mbt_ffi_malloc(payload38.length() * 1) - for index = 0; index < payload38.length(); index = index + 1 { - let iter_elem : Bool = payload38[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload38.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - Varbit(payload39) => { - mbt_ffi_store8(iter_base + 0, 27) - - let address40 = mbt_ffi_malloc(payload39.length() * 1) - for index41 = 0; index41 < payload39.length(); index41 = index41 + 1 { - let iter_elem : Bool = payload39[index41] - let iter_base = address40 + index41 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, address40) - cleanup_list.push(address40) - - () - } - Int4range(payload42) => { - mbt_ffi_store8(iter_base + 0, 28) - - match payload42.start { - Included(payload43) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload43) - - () - } - Excluded(payload44) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload44) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload42.end { - Included(payload46) => { - mbt_ffi_store8(iter_base + 16, 0) - mbt_ffi_store32(iter_base + 20, payload46) - - () - } - Excluded(payload47) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload47) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 16, 2) - - () - } - } - - () - } - Int8range(payload49) => { - mbt_ffi_store8(iter_base + 0, 29) - - match payload49.start { - Included(payload50) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store64(iter_base + 16, payload50) - - () - } - Excluded(payload51) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store64(iter_base + 16, payload51) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload49.end { - Included(payload53) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload53) - - () - } - Excluded(payload54) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload54) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 24, 2) - - () - } - } - - () - } - Numrange(payload56) => { - mbt_ffi_store8(iter_base + 0, 30) - - match payload56.start { - Included(payload57) => { - mbt_ffi_store8(iter_base + 8, 0) - - let ptr58 = mbt_ffi_str2ptr(payload57) - mbt_ffi_store32(iter_base + 16, payload57.length()) - mbt_ffi_store32(iter_base + 12, ptr58) - cleanup_list.push(ptr58) - - () - } - Excluded(payload59) => { - mbt_ffi_store8(iter_base + 8, 1) - - let ptr60 = mbt_ffi_str2ptr(payload59) - mbt_ffi_store32(iter_base + 16, payload59.length()) - mbt_ffi_store32(iter_base + 12, ptr60) - cleanup_list.push(ptr60) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload56.end { - Included(payload62) => { - mbt_ffi_store8(iter_base + 20, 0) - - let ptr63 = mbt_ffi_str2ptr(payload62) - mbt_ffi_store32(iter_base + 28, payload62.length()) - mbt_ffi_store32(iter_base + 24, ptr63) - cleanup_list.push(ptr63) - - () - } - Excluded(payload64) => { - mbt_ffi_store8(iter_base + 20, 1) - - let ptr65 = mbt_ffi_str2ptr(payload64) - mbt_ffi_store32(iter_base + 28, payload64.length()) - mbt_ffi_store32(iter_base + 24, ptr65) - cleanup_list.push(ptr65) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 20, 2) - - () - } - } - - () - } - Tsrange(payload67) => { - mbt_ffi_store8(iter_base + 0, 31) - - match payload67.start { - Included(payload68) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload68.date.year) - mbt_ffi_store8(iter_base + 16, payload68.date.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload68.date.day.to_int()) - mbt_ffi_store8(iter_base + 20, payload68.time.hour.to_int()) - mbt_ffi_store8(iter_base + 21, payload68.time.minute.to_int()) - mbt_ffi_store8(iter_base + 22, payload68.time.second.to_int()) - mbt_ffi_store32( - iter_base + 24, - payload68.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload69) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload69.date.year) - mbt_ffi_store8(iter_base + 16, payload69.date.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload69.date.day.to_int()) - mbt_ffi_store8(iter_base + 20, payload69.time.hour.to_int()) - mbt_ffi_store8(iter_base + 21, payload69.time.minute.to_int()) - mbt_ffi_store8(iter_base + 22, payload69.time.second.to_int()) - mbt_ffi_store32( - iter_base + 24, - payload69.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload67.end { - Included(payload71) => { - mbt_ffi_store8(iter_base + 28, 0) - mbt_ffi_store32(iter_base + 32, payload71.date.year) - mbt_ffi_store8(iter_base + 36, payload71.date.month.to_int()) - mbt_ffi_store8(iter_base + 37, payload71.date.day.to_int()) - mbt_ffi_store8(iter_base + 40, payload71.time.hour.to_int()) - mbt_ffi_store8(iter_base + 41, payload71.time.minute.to_int()) - mbt_ffi_store8(iter_base + 42, payload71.time.second.to_int()) - mbt_ffi_store32( - iter_base + 44, - payload71.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload72) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload72.date.year) - mbt_ffi_store8(iter_base + 36, payload72.date.month.to_int()) - mbt_ffi_store8(iter_base + 37, payload72.date.day.to_int()) - mbt_ffi_store8(iter_base + 40, payload72.time.hour.to_int()) - mbt_ffi_store8(iter_base + 41, payload72.time.minute.to_int()) - mbt_ffi_store8(iter_base + 42, payload72.time.second.to_int()) - mbt_ffi_store32( - iter_base + 44, - payload72.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 28, 2) - - () - } - } - - () - } - Tstzrange(payload74) => { - mbt_ffi_store8(iter_base + 0, 32) - - match payload74.start { - Included(payload75) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload75.timestamp.date.year) - mbt_ffi_store8( - iter_base + 16, - payload75.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 17, - payload75.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 20, - payload75.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 21, - payload75.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 22, - payload75.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 24, - payload75.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 28, payload75.offset) - - () - } - Excluded(payload76) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload76.timestamp.date.year) - mbt_ffi_store8( - iter_base + 16, - payload76.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 17, - payload76.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 20, - payload76.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 21, - payload76.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 22, - payload76.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 24, - payload76.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 28, payload76.offset) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload74.end { - Included(payload78) => { - mbt_ffi_store8(iter_base + 32, 0) - mbt_ffi_store32(iter_base + 36, payload78.timestamp.date.year) - mbt_ffi_store8( - iter_base + 40, - payload78.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 41, - payload78.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 44, - payload78.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 45, - payload78.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 46, - payload78.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 48, - payload78.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 52, payload78.offset) - - () - } - Excluded(payload79) => { - mbt_ffi_store8(iter_base + 32, 1) - mbt_ffi_store32(iter_base + 36, payload79.timestamp.date.year) - mbt_ffi_store8( - iter_base + 40, - payload79.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 41, - payload79.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 44, - payload79.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 45, - payload79.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 46, - payload79.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 48, - payload79.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 52, payload79.offset) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 32, 2) - - () - } - } - - () - } - Daterange(payload81) => { - mbt_ffi_store8(iter_base + 0, 33) - - match payload81.start { - Included(payload82) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload82.year) - mbt_ffi_store8(iter_base + 16, payload82.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload82.day.to_int()) - - () - } - Excluded(payload83) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload83.year) - mbt_ffi_store8(iter_base + 16, payload83.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload83.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload81.end { - Included(payload85) => { - mbt_ffi_store8(iter_base + 20, 0) - mbt_ffi_store32(iter_base + 24, payload85.year) - mbt_ffi_store8(iter_base + 28, payload85.month.to_int()) - mbt_ffi_store8(iter_base + 29, payload85.day.to_int()) - - () - } - Excluded(payload86) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload86.year) - mbt_ffi_store8(iter_base + 28, payload86.month.to_int()) - mbt_ffi_store8(iter_base + 29, payload86.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 20, 2) - - () - } - } - - () - } - Money(payload88) => { - mbt_ffi_store8(iter_base + 0, 34) - mbt_ffi_store64(iter_base + 8, payload88) + let ptr45 = mbt_ffi_str2ptr((payload44).name) - () - } - Oid(payload89) => { - mbt_ffi_store8(iter_base + 0, 35) - mbt_ffi_store32(iter_base + 8, payload89.reinterpret_as_int()) + let LazyDbColumnType(handle46) = (payload44).base_type + cleanup_list.push(ptr45) - () - } - Enumeration(payload90) => { - mbt_ffi_store8(iter_base + 0, 36) + ((40), ptr45, (payload44).name.length(), handle46, 0) + } + Vector => { - let ptr91 = mbt_ffi_str2ptr(payload90.name) - mbt_ffi_store32(iter_base + 12, payload90.name.length()) - mbt_ffi_store32(iter_base + 8, ptr91) + ((41), 0, 0, 0, 0) + } + Halfvec => { - let ptr92 = mbt_ffi_str2ptr(payload90.value) - mbt_ffi_store32(iter_base + 20, payload90.value.length()) - mbt_ffi_store32(iter_base + 16, ptr92) - cleanup_list.push(ptr91) - cleanup_list.push(ptr92) + ((42), 0, 0, 0, 0) + } + Sparsevec => { - () - } - Composite(payload93) => { - mbt_ffi_store8(iter_base + 0, 37) - - let ptr94 = mbt_ffi_str2ptr(payload93.name) - mbt_ffi_store32(iter_base + 12, payload93.name.length()) - mbt_ffi_store32(iter_base + 8, ptr94) - - let address96 = mbt_ffi_malloc(payload93.values.length() * 4) - for index97 = 0 - index97 < payload93.values.length() - index97 = index97 + 1 { - let iter_elem : LazyDbValue = payload93.values[index97] - let iter_base = address96 + index97 * 4 - - let LazyDbValue(handle95) = iter_elem - mbt_ffi_store32(iter_base + 0, handle95) - } - mbt_ffi_store32(iter_base + 20, payload93.values.length()) - mbt_ffi_store32(iter_base + 16, address96) - cleanup_list.push(ptr94) - cleanup_list.push(address96) - - () + ((43), 0, 0, 0, 0) + } } - Domain(payload98) => { - mbt_ffi_store8(iter_base + 0, 38) + let result : Int = wasmImportConstructorLazyDbColumnType(lowered, lowered50, lowered51, lowered52, lowered53); + let ret = LazyDbColumnType::LazyDbColumnType(result) - let ptr99 = mbt_ffi_str2ptr(payload98.name) - mbt_ffi_store32(iter_base + 12, payload98.name.length()) - mbt_ffi_store32(iter_base + 8, ptr99) + cleanup_list.each(mbt_ffi_free) + return ret - let LazyDbValue(handle100) = payload98.value - mbt_ffi_store32(iter_base + 16, handle100) - cleanup_list.push(ptr99) +} +///| +pub fn LazyDbColumnType::get(self : LazyDbColumnType) -> DbColumnType { - () - } - Array(payload101) => { - mbt_ffi_store8(iter_base + 0, 39) - - let address103 = mbt_ffi_malloc(payload101.length() * 4) - for index104 = 0 - index104 < payload101.length() - index104 = index104 + 1 { - let iter_elem : LazyDbValue = payload101[index104] - let iter_base = address103 + index104 * 4 - - let LazyDbValue(handle102) = iter_elem - mbt_ffi_store32(iter_base + 0, handle102) - } - mbt_ffi_store32(iter_base + 12, payload101.length()) - mbt_ffi_store32(iter_base + 8, address103) - cleanup_list.push(address103) - - () - } - Range(payload105) => { - mbt_ffi_store8(iter_base + 0, 40) + let LazyDbColumnType(handle) = self + let return_area = mbt_ffi_malloc(20) + wasmImportMethodLazyDbColumnTypeGet(handle, return_area); - let ptr106 = mbt_ffi_str2ptr(payload105.name) - mbt_ffi_store32(iter_base + 12, payload105.name.length()) - mbt_ffi_store32(iter_base + 8, ptr106) + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - match payload105.value.start { - Included(payload107) => { - mbt_ffi_store8(iter_base + 16, 0) + DbColumnType::Character + } + 1 => { - let LazyDbValue(handle108) = payload107 - mbt_ffi_store32(iter_base + 20, handle108) + DbColumnType::Int2 + } + 2 => { - () - } - Excluded(payload109) => { - mbt_ffi_store8(iter_base + 16, 1) + DbColumnType::Int4 + } + 3 => { - let LazyDbValue(handle110) = payload109 - mbt_ffi_store32(iter_base + 20, handle110) + DbColumnType::Int8 + } + 4 => { - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 16, 2) + DbColumnType::Float4 + } + 5 => { - () - } - } + DbColumnType::Float8 + } + 6 => { - match payload105.value.end { - Included(payload112) => { - mbt_ffi_store8(iter_base + 24, 0) + DbColumnType::Numeric + } + 7 => { - let LazyDbValue(handle113) = payload112 - mbt_ffi_store32(iter_base + 28, handle113) + DbColumnType::Boolean + } + 8 => { - () - } - Excluded(payload114) => { - mbt_ffi_store8(iter_base + 24, 1) + DbColumnType::Text + } + 9 => { - let LazyDbValue(handle115) = payload114 - mbt_ffi_store32(iter_base + 28, handle115) + DbColumnType::Varchar + } + 10 => { - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 24, 2) + DbColumnType::Bpchar + } + 11 => { - () - } - } - cleanup_list.push(ptr106) + DbColumnType::Timestamp + } + 12 => { - () - } - Null => { - mbt_ffi_store8(iter_base + 0, 41) + DbColumnType::Timestamptz + } + 13 => { - () - } - Vector(payload118) => { - mbt_ffi_store8(iter_base + 0, 42) + DbColumnType::Date + } + 14 => { - let ptr119 = mbt_ffi_float_array2ptr(payload118) + DbColumnType::Time + } + 15 => { - mbt_ffi_store32(iter_base + 12, payload118.length()) - mbt_ffi_store32(iter_base + 8, ptr119) - cleanup_list.push(ptr119) + DbColumnType::Timetz + } + 16 => { - () - } - Halfvec(payload120) => { - mbt_ffi_store8(iter_base + 0, 43) + DbColumnType::Interval + } + 17 => { - let ptr121 = mbt_ffi_float_array2ptr(payload120) + DbColumnType::Bytea + } + 18 => { - mbt_ffi_store32(iter_base + 12, payload120.length()) - mbt_ffi_store32(iter_base + 8, ptr121) - cleanup_list.push(ptr121) + DbColumnType::Uuid + } + 19 => { - () - } - Sparsevec(payload122) => { - mbt_ffi_store8(iter_base + 0, 44) - mbt_ffi_store32(iter_base + 8, payload122.dim) + DbColumnType::Xml + } + 20 => { - let ptr123 = mbt_ffi_int_array2ptr(payload122.indices) + DbColumnType::Json + } + 21 => { - mbt_ffi_store32(iter_base + 16, payload122.indices.length()) - mbt_ffi_store32(iter_base + 12, ptr123) + DbColumnType::Jsonb + } + 22 => { - let ptr124 = mbt_ffi_float_array2ptr(payload122.values) + DbColumnType::Jsonpath + } + 23 => { - mbt_ffi_store32(iter_base + 24, payload122.values.length()) - mbt_ffi_store32(iter_base + 20, ptr124) - cleanup_list.push(ptr123) - cleanup_list.push(ptr124) + DbColumnType::Inet + } + 24 => { - () - } - } - } - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbConnectionQueryStream( - handle, - ptr, - statement.length(), - address125, - params.length(), - return_area, - ) - - let lifted131 = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok( - DbResultStream::DbResultStream(mbt_ffi_load32(return_area + 4)), - ) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result127 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result127) - } - 2 => { - let result128 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result128) - } - 3 => { - let result129 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result129) - } - 4 => { - let result130 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result130) - } - _ => panic() - } + DbColumnType::Cidr + } + 25 => { - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted131 - mbt_ffi_free(ptr) - mbt_ffi_free(address125) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + DbColumnType::Macaddr + } + 26 => { -///| -pub fn DbConnection::execute( - self : DbConnection, - statement : String, - params : Array[DbValue], -) -> Result[UInt64, Error_] { - let cleanup_list : Array[Int] = [] + DbColumnType::Bit + } + 27 => { - let DbConnection(handle) = self + DbColumnType::Varbit + } + 28 => { - let ptr = mbt_ffi_str2ptr(statement) + DbColumnType::Int4range + } + 29 => { - let address125 = mbt_ffi_malloc(params.length() * 56) - for index126 = 0; index126 < params.length(); index126 = index126 + 1 { - let iter_elem : DbValue = params[index126] - let iter_base = address125 + index126 * 56 + DbColumnType::Int8range + } + 30 => { - match iter_elem { - Character(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload)) + DbColumnType::Numrange + } + 31 => { - () - } - Int2(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload0)) + DbColumnType::Tsrange + } + 32 => { - () - } - Int4(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store32(iter_base + 8, payload1) + DbColumnType::Tstzrange + } + 33 => { - () - } - Int8(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store64(iter_base + 8, payload2) + DbColumnType::Daterange + } + 34 => { - () - } - Float4(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_storef32(iter_base + 8, payload3) + DbColumnType::Money + } + 35 => { - () - } - Float8(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_storef64(iter_base + 8, payload4) + DbColumnType::Oid + } + 36 => { - () - } - Numeric(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) - let ptr6 = mbt_ffi_str2ptr(payload5) - mbt_ffi_store32(iter_base + 12, payload5.length()) - mbt_ffi_store32(iter_base + 8, ptr6) - cleanup_list.push(ptr6) + DbColumnType::Enumeration(EnumerationType::{name : result}) + } + 37 => { - () - } - Boolean(payload7) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store8(iter_base + 8, if payload7 { 1 } else { 0 }) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) - () - } - Text(payload8) => { - mbt_ffi_store8(iter_base + 0, 8) + let array : Array[(String, LazyDbColumnType)] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 16)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 12)) + (index * 12) - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(iter_base + 12, payload8.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - cleanup_list.push(ptr9) + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Varchar(payload10) => { - mbt_ffi_store8(iter_base + 0, 9) + array.push((result1, LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 8)))) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 12)) - let ptr11 = mbt_ffi_str2ptr(payload10) - mbt_ffi_store32(iter_base + 12, payload10.length()) - mbt_ffi_store32(iter_base + 8, ptr11) - cleanup_list.push(ptr11) + DbColumnType::Composite(CompositeType::{name : result0, attributes : array}) + } + 38 => { - () - } - Bpchar(payload12) => { - mbt_ffi_store8(iter_base + 0, 10) + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) - let ptr13 = mbt_ffi_str2ptr(payload12) - mbt_ffi_store32(iter_base + 12, payload12.length()) - mbt_ffi_store32(iter_base + 8, ptr13) - cleanup_list.push(ptr13) + DbColumnType::Domain(DomainType::{name : result2, base_type : LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((return_area) + 12))}) + } + 39 => { - () - } - Timestamp(payload14) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload14.date.year) - mbt_ffi_store8(iter_base + 12, payload14.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload14.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload14.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload14.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload14.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload14.time.nanosecond.reinterpret_as_int(), - ) - - () + DbColumnType::Array(LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((return_area) + 4))) + } + 40 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + DbColumnType::Range(RangeType::{name : result3, base_type : LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((return_area) + 12))}) + } + 41 => { + + DbColumnType::Vector + } + 42 => { + + DbColumnType::Halfvec + } + 43 => { + + DbColumnType::Sparsevec + } + _ => panic() } - Timestamptz(payload15) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store32(iter_base + 8, payload15.timestamp.date.year) - mbt_ffi_store8(iter_base + 12, payload15.timestamp.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload15.timestamp.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload15.timestamp.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload15.timestamp.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload15.timestamp.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload15.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 24, payload15.offset) - - () + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} +///| +pub fn DbResultStream::get_columns(self : DbResultStream) -> Array[DbColumn] { + + let DbResultStream(handle) = self + let return_area = mbt_ffi_malloc(8) + wasmImportMethodDbResultStreamGetColumns(handle, return_area); + + let array6 : Array[DbColumn] = []; + for index7 = 0; index7 < (mbt_ffi_load32((return_area) + 4)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index7 * 48) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + DbColumnType::Character + } + 1 => { + + DbColumnType::Int2 + } + 2 => { + + DbColumnType::Int4 + } + 3 => { + + DbColumnType::Int8 + } + 4 => { + + DbColumnType::Float4 + } + 5 => { + + DbColumnType::Float8 + } + 6 => { + + DbColumnType::Numeric + } + 7 => { + + DbColumnType::Boolean + } + 8 => { + + DbColumnType::Text + } + 9 => { + + DbColumnType::Varchar + } + 10 => { + + DbColumnType::Bpchar + } + 11 => { + + DbColumnType::Timestamp + } + 12 => { + + DbColumnType::Timestamptz + } + 13 => { + + DbColumnType::Date + } + 14 => { + + DbColumnType::Time + } + 15 => { + + DbColumnType::Timetz + } + 16 => { + + DbColumnType::Interval + } + 17 => { + + DbColumnType::Bytea + } + 18 => { + + DbColumnType::Uuid + } + 19 => { + + DbColumnType::Xml + } + 20 => { + + DbColumnType::Json + } + 21 => { + + DbColumnType::Jsonb + } + 22 => { + + DbColumnType::Jsonpath + } + 23 => { + + DbColumnType::Inet + } + 24 => { + + DbColumnType::Cidr + } + 25 => { + + DbColumnType::Macaddr + } + 26 => { + + DbColumnType::Bit + } + 27 => { + + DbColumnType::Varbit + } + 28 => { + + DbColumnType::Int4range + } + 29 => { + + DbColumnType::Int8range + } + 30 => { + + DbColumnType::Numrange + } + 31 => { + + DbColumnType::Tsrange + } + 32 => { + + DbColumnType::Tstzrange + } + 33 => { + + DbColumnType::Daterange + } + 34 => { + + DbColumnType::Money + } + 35 => { + + DbColumnType::Oid + } + 36 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + DbColumnType::Enumeration(EnumerationType::{name : result0}) + } + 37 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + let array : Array[(String, LazyDbColumnType)] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 32)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index * 12) + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push((result2, LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 8)))) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + DbColumnType::Composite(CompositeType::{name : result1, attributes : array}) + } + 38 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + DbColumnType::Domain(DomainType::{name : result3, base_type : LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 28))}) + } + 39 => { + + DbColumnType::Array(LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 20))) + } + 40 => { + + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + DbColumnType::Range(RangeType::{name : result4, base_type : LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 28))}) + } + 41 => { + + DbColumnType::Vector + } + 42 => { + + DbColumnType::Halfvec + } + 43 => { + + DbColumnType::Sparsevec + } + _ => panic() + } + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + array6.push(DbColumn::{ordinal : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), name : result, db_type : lifted, db_type_name : result5}) } - Date(payload16) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store32(iter_base + 8, payload16.year) - mbt_ffi_store8(iter_base + 12, payload16.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload16.day.to_int()) + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array6 + mbt_ffi_free(return_area) + return ret + +} +///| +pub fn DbResultStream::get_next(self : DbResultStream) -> Array[DbRow]? { + + let DbResultStream(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodDbResultStreamGetNext(handle, return_area); + + let lifted47 : Array[DbRow]? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let array45 : Array[DbRow] = []; + for index46 = 0; index46 < (mbt_ffi_load32((return_area) + 8)); index46 = index46 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index46 * 8) + + let array43 : Array[DbValue] = []; + for index44 = 0; index44 < (mbt_ffi_load32((iter_base) + 4)); index44 = index44 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index44 * 56) + + let lifted42 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + DbValue::Character((mbt_ffi_load8((iter_base) + 8))) + } + 1 => { + + DbValue::Int2((mbt_ffi_load16((iter_base) + 8))) + } + 2 => { + + DbValue::Int4(mbt_ffi_load32((iter_base) + 8)) + } + 3 => { + + DbValue::Int8(mbt_ffi_load64((iter_base) + 8)) + } + 4 => { + + DbValue::Float4(mbt_ffi_loadf32((iter_base) + 8)) + } + 5 => { + + DbValue::Float8(mbt_ffi_loadf64((iter_base) + 8)) + } + 6 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Numeric(result) + } + 7 => { + + DbValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 8 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Text(result0) + } + 9 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Varchar(result1) + } + 10 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Bpchar(result2) + } + 11 => { + + DbValue::Timestamp(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 17)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()}}) + } + 12 => { + + DbValue::Timestamptz(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 17)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 24)}) + } + 13 => { + + DbValue::Date(@types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}) + } + 14 => { + + DbValue::Time(@types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 8)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 9)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 10)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 15 => { + + DbValue::Timetz(@types.Timetz::{time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 8)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 9)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 10)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}, offset : mbt_ffi_load32((iter_base) + 16)}) + } + 16 => { + + DbValue::Interval(Interval::{months : mbt_ffi_load32((iter_base) + 8), days : mbt_ffi_load32((iter_base) + 12), microseconds : mbt_ffi_load64((iter_base) + 16)}) + } + 17 => { + + let result3 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Bytea(result3) + } + 18 => { + + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Json(result4) + } + 19 => { + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Jsonb(result5) + } + 20 => { + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Jsonpath(result6) + } + 21 => { + + let result7 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Xml(result7) + } + 22 => { + + DbValue::Uuid(@types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64()}) + } + 23 => { + + let lifted = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + @types.IpAddress::Ipv4(((mbt_ffi_load8_u((iter_base) + 10)).to_byte(), (mbt_ffi_load8_u((iter_base) + 11)).to_byte(), (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), (mbt_ffi_load8_u((iter_base) + 13)).to_byte())) + } + 1 => { + + @types.IpAddress::Ipv6(((mbt_ffi_load16_u((iter_base) + 10).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 12).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 14).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 16).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 18).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 20).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 22).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 24).land(0xFFFF).reinterpret_as_uint()))) + } + _ => panic() + } + + DbValue::Inet(lifted) + } + 24 => { + + let lifted8 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + @types.IpAddress::Ipv4(((mbt_ffi_load8_u((iter_base) + 10)).to_byte(), (mbt_ffi_load8_u((iter_base) + 11)).to_byte(), (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), (mbt_ffi_load8_u((iter_base) + 13)).to_byte())) + } + 1 => { + + @types.IpAddress::Ipv6(((mbt_ffi_load16_u((iter_base) + 10).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 12).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 14).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 16).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 18).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 20).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 22).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 24).land(0xFFFF).reinterpret_as_uint()))) + } + _ => panic() + } + + DbValue::Cidr(lifted8) + } + 25 => { + + DbValue::Macaddr(@types.MacAddress::{octets : ((mbt_ffi_load8_u((iter_base) + 8)).to_byte(), (mbt_ffi_load8_u((iter_base) + 9)).to_byte(), (mbt_ffi_load8_u((iter_base) + 10)).to_byte(), (mbt_ffi_load8_u((iter_base) + 11)).to_byte(), (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), (mbt_ffi_load8_u((iter_base) + 13)).to_byte())}) + } + 26 => { + + let array : Array[Bool] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index * 1) + + array.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + DbValue::Bit(array) + } + 27 => { + + let array9 : Array[Bool] = []; + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 12)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index10 * 1) + + array9.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + DbValue::Varbit(array9) + } + 28 => { + + let lifted11 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + Int4bound::Included(mbt_ffi_load32((iter_base) + 12)) + } + 1 => { + + Int4bound::Excluded(mbt_ffi_load32((iter_base) + 12)) + } + 2 => { + + Int4bound::Unbounded + } + _ => panic() + } + + let lifted12 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + Int4bound::Included(mbt_ffi_load32((iter_base) + 20)) + } + 1 => { + + Int4bound::Excluded(mbt_ffi_load32((iter_base) + 20)) + } + 2 => { + + Int4bound::Unbounded + } + _ => panic() + } + + DbValue::Int4range(Int4range::{start : lifted11, end : lifted12}) + } + 29 => { + + let lifted13 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + Int8bound::Included(mbt_ffi_load64((iter_base) + 16)) + } + 1 => { + + Int8bound::Excluded(mbt_ffi_load64((iter_base) + 16)) + } + 2 => { + + Int8bound::Unbounded + } + _ => panic() + } + + let lifted14 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + Int8bound::Included(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + Int8bound::Excluded(mbt_ffi_load64((iter_base) + 32)) + } + 2 => { + + Int8bound::Unbounded + } + _ => panic() + } + + DbValue::Int8range(Int8range::{start : lifted13, end : lifted14}) + } + 30 => { + + let lifted17 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Numbound::Included(result15) + } + 1 => { + + let result16 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Numbound::Excluded(result16) + } + 2 => { + + Numbound::Unbounded + } + _ => panic() + } + + let lifted20 = match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => { + + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + Numbound::Included(result18) + } + 1 => { + + let result19 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + Numbound::Excluded(result19) + } + 2 => { + + Numbound::Unbounded + } + _ => panic() + } + + DbValue::Numrange(Numrange::{start : lifted17, end : lifted20}) + } + 31 => { + + let lifted21 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + Tsbound::Included(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 20)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 21)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}) + } + 1 => { + + Tsbound::Excluded(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 20)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 21)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}) + } + 2 => { + + Tsbound::Unbounded + } + _ => panic() + } + + let lifted22 = match (mbt_ffi_load8_u((iter_base) + 28)) { + 0 => { + + Tsbound::Included(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 32), month : (mbt_ffi_load8_u((iter_base) + 36)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 37)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 40)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 41)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 42)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 44)).reinterpret_as_uint()}}) + } + 1 => { + + Tsbound::Excluded(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 32), month : (mbt_ffi_load8_u((iter_base) + 36)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 37)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 40)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 41)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 42)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 44)).reinterpret_as_uint()}}) + } + 2 => { + + Tsbound::Unbounded + } + _ => panic() + } + + DbValue::Tsrange(Tsrange::{start : lifted21, end : lifted22}) + } + 32 => { + + let lifted23 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + Tstzbound::Included(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 20)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 21)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 28)}) + } + 1 => { + + Tstzbound::Excluded(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 20)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 21)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 28)}) + } + 2 => { + + Tstzbound::Unbounded + } + _ => panic() + } + + let lifted24 = match (mbt_ffi_load8_u((iter_base) + 32)) { + 0 => { + + Tstzbound::Included(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 36), month : (mbt_ffi_load8_u((iter_base) + 40)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 41)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 44)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 45)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 46)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 48)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 52)}) + } + 1 => { + + Tstzbound::Excluded(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 36), month : (mbt_ffi_load8_u((iter_base) + 40)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 41)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 44)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 45)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 46)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 48)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 52)}) + } + 2 => { + + Tstzbound::Unbounded + } + _ => panic() + } + + DbValue::Tstzrange(Tstzrange::{start : lifted23, end : lifted24}) + } + 33 => { + + let lifted25 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + Datebound::Included(@types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}) + } + 1 => { + + Datebound::Excluded(@types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}) + } + 2 => { + + Datebound::Unbounded + } + _ => panic() + } + + let lifted26 = match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => { + + Datebound::Included(@types.Date::{year : mbt_ffi_load32((iter_base) + 24), month : (mbt_ffi_load8_u((iter_base) + 28)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 29)).to_byte()}) + } + 1 => { + + Datebound::Excluded(@types.Date::{year : mbt_ffi_load32((iter_base) + 24), month : (mbt_ffi_load8_u((iter_base) + 28)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 29)).to_byte()}) + } + 2 => { + + Datebound::Unbounded + } + _ => panic() + } + + DbValue::Daterange(Daterange::{start : lifted25, end : lifted26}) + } + 34 => { + + DbValue::Money(mbt_ffi_load64((iter_base) + 8)) + } + 35 => { + + DbValue::Oid((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 36 => { + + let result27 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result28 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + DbValue::Enumeration(Enumeration::{name : result27, value : result28}) + } + 37 => { + + let result29 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array30 : Array[LazyDbValue] = []; + for index31 = 0; index31 < (mbt_ffi_load32((iter_base) + 20)); index31 = index31 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index31 * 4) + + array30.push(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 0))) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + DbValue::Composite(Composite::{name : result29, values : array30}) + } + 38 => { + + let result32 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Domain(Domain::{name : result32, value : LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 16))}) + } + 39 => { + + let array33 : Array[LazyDbValue] = []; + for index34 = 0; index34 < (mbt_ffi_load32((iter_base) + 12)); index34 = index34 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index34 * 4) + + array33.push(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 0))) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + DbValue::Array(array33) + } + 40 => { + + let result35 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted36 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + ValueBound::Included(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 20))) + } + 1 => { + + ValueBound::Excluded(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 20))) + } + 2 => { + + ValueBound::Unbounded + } + _ => panic() + } + + let lifted37 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + ValueBound::Included(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 28))) + } + 1 => { + + ValueBound::Excluded(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 28))) + } + 2 => { + + ValueBound::Unbounded + } + _ => panic() + } + + DbValue::Range(Range::{name : result35, value : ValuesRange::{start : lifted36, end : lifted37}}) + } + 41 => { + + DbValue::Null + } + 42 => { + + let result38 = mbt_ffi_ptr2float_array(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Vector(result38) + } + 43 => { + + let result39 = mbt_ffi_ptr2float_array(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Halfvec(result39) + } + 44 => { + + let result40 = mbt_ffi_ptr2int_array(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + let result41 = mbt_ffi_ptr2float_array(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + DbValue::Sparsevec(SparseVec::{dim : mbt_ffi_load32((iter_base) + 8), indices : result40, values : result41}) + } + _ => panic() + } + + array43.push(lifted42) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array45.push(DbRow::{values : array43}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) + + Option::Some(array45) + } + _ => panic() + } + let ret = lifted47 + mbt_ffi_free(return_area) + return ret + +} +///| +pub fn DbConnection::open(address : String) -> Result[DbConnection, Error_] { + + let ptr = mbt_ffi_str2ptr(address) + let return_area = mbt_ffi_malloc(16) + wasmImportStaticDbConnectionOpen(ptr, address.length(), return_area); + + let lifted4 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(DbConnection::DbConnection(mbt_ffi_load32((return_area) + 4))) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result0) + } + 2 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result1) + } + 3 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result2) + } + 4 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result3) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() + } + let ret = lifted4 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} +///| +pub fn DbConnection::query(self : DbConnection, statement : String, params : Array[DbValue]) -> Result[DbResult, Error_] { + let cleanup_list : Array[Int] = [] + + let DbConnection(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address125 = mbt_ffi_malloc((params).length() * 56); + for index126 = 0; index126 < (params).length(); index126 = index126 + 1 { + let iter_elem : DbValue = (params)[(index126)] + let iter_base = address125 + (index126 * 56); + + match iter_elem { + Character(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload)) + + () + } + Int2(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload0)) + + () + } + Int4(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store32((iter_base) + 8, payload1) + + () + } + Int8(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store64((iter_base) + 8, payload2) + + () + } + Float4(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_storef32((iter_base) + 8, payload3) + + () + } + Float8(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_storef64((iter_base) + 8, payload4) + + () + } + Numeric(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + let ptr6 = mbt_ffi_str2ptr(payload5) + mbt_ffi_store32((iter_base) + 12, payload5.length()) + mbt_ffi_store32((iter_base) + 8, ptr6) + cleanup_list.push(ptr6) + + () + } + Boolean(payload7) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store8((iter_base) + 8, (if payload7 { 1 } else { 0 })) + + () + } + Text(payload8) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((iter_base) + 12, payload8.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + cleanup_list.push(ptr9) + + () + } + Varchar(payload10) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr11 = mbt_ffi_str2ptr(payload10) + mbt_ffi_store32((iter_base) + 12, payload10.length()) + mbt_ffi_store32((iter_base) + 8, ptr11) + cleanup_list.push(ptr11) + + () + } + Bpchar(payload12) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + let ptr13 = mbt_ffi_str2ptr(payload12) + mbt_ffi_store32((iter_base) + 12, payload12.length()) + mbt_ffi_store32((iter_base) + 8, ptr13) + cleanup_list.push(ptr13) + + () + } + Timestamp(payload14) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, ((payload14).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload14).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload14).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload14).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload14).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload14).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload14).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamptz(payload15) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store32((iter_base) + 8, (((payload15).timestamp).date).year) + mbt_ffi_store8((iter_base) + 12, ((((payload15).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((((payload15).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, ((((payload15).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload15).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, ((((payload15).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, ((((payload15).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 24, (payload15).offset) + + () + } + Date(payload16) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store32((iter_base) + 8, (payload16).year) + mbt_ffi_store8((iter_base) + 12, ((payload16).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload16).day).to_int()) + + () + } + Time(payload17) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store8((iter_base) + 8, ((payload17).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, ((payload17).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, ((payload17).second).to_int()) + mbt_ffi_store32((iter_base) + 12, ((payload17).nanosecond).reinterpret_as_int()) + + () + } + Timetz(payload18) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store8((iter_base) + 8, (((payload18).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, (((payload18).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, (((payload18).time).second).to_int()) + mbt_ffi_store32((iter_base) + 12, (((payload18).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 16, (payload18).offset) + + () + } + Interval(payload19) => { + mbt_ffi_store8((iter_base) + 0, (16)) + mbt_ffi_store32((iter_base) + 8, (payload19).months) + mbt_ffi_store32((iter_base) + 12, (payload19).days) + mbt_ffi_store64((iter_base) + 16, (payload19).microseconds) + + () + } + Bytea(payload20) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let ptr21 = mbt_ffi_bytes2ptr(payload20) + + mbt_ffi_store32((iter_base) + 12, payload20.length()) + mbt_ffi_store32((iter_base) + 8, ptr21) + cleanup_list.push(ptr21) + + () + } + Json(payload22) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let ptr23 = mbt_ffi_str2ptr(payload22) + mbt_ffi_store32((iter_base) + 12, payload22.length()) + mbt_ffi_store32((iter_base) + 8, ptr23) + cleanup_list.push(ptr23) + + () + } + Jsonb(payload24) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let ptr25 = mbt_ffi_str2ptr(payload24) + mbt_ffi_store32((iter_base) + 12, payload24.length()) + mbt_ffi_store32((iter_base) + 8, ptr25) + cleanup_list.push(ptr25) + + () + } + Jsonpath(payload26) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let ptr27 = mbt_ffi_str2ptr(payload26) + mbt_ffi_store32((iter_base) + 12, payload26.length()) + mbt_ffi_store32((iter_base) + 8, ptr27) + cleanup_list.push(ptr27) + + () + } + Xml(payload28) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + let ptr29 = mbt_ffi_str2ptr(payload28) + mbt_ffi_store32((iter_base) + 12, payload28.length()) + mbt_ffi_store32((iter_base) + 8, ptr29) + cleanup_list.push(ptr29) + + () + } + Uuid(payload30) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store64((iter_base) + 8, ((payload30).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload30).low_bits).reinterpret_as_int64()) + + () + } + Inet(payload31) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match payload31 { + Ipv4(payload32) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store8((iter_base) + 10, ((payload32).0).to_int()) + mbt_ffi_store8((iter_base) + 11, ((payload32).1).to_int()) + mbt_ffi_store8((iter_base) + 12, ((payload32).2).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload32).3).to_int()) + + () + } + Ipv6(payload33) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store16((iter_base) + 10, ((payload33).0).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 12, ((payload33).1).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 14, ((payload33).2).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 16, ((payload33).3).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 18, ((payload33).4).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 20, ((payload33).5).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 22, ((payload33).6).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 24, ((payload33).7).reinterpret_as_int()) + + () + } + } + + () + } + Cidr(payload34) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match payload34 { + Ipv4(payload35) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store8((iter_base) + 10, ((payload35).0).to_int()) + mbt_ffi_store8((iter_base) + 11, ((payload35).1).to_int()) + mbt_ffi_store8((iter_base) + 12, ((payload35).2).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload35).3).to_int()) + + () + } + Ipv6(payload36) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store16((iter_base) + 10, ((payload36).0).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 12, ((payload36).1).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 14, ((payload36).2).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 16, ((payload36).3).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 18, ((payload36).4).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 20, ((payload36).5).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 22, ((payload36).6).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 24, ((payload36).7).reinterpret_as_int()) + + () + } + } + + () + } + Macaddr(payload37) => { + mbt_ffi_store8((iter_base) + 0, (25)) + mbt_ffi_store8((iter_base) + 8, (((payload37).octets).0).to_int()) + mbt_ffi_store8((iter_base) + 9, (((payload37).octets).1).to_int()) + mbt_ffi_store8((iter_base) + 10, (((payload37).octets).2).to_int()) + mbt_ffi_store8((iter_base) + 11, (((payload37).octets).3).to_int()) + mbt_ffi_store8((iter_base) + 12, (((payload37).octets).4).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload37).octets).5).to_int()) + + () + } + Bit(payload38) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let address = mbt_ffi_malloc((payload38).length() * 1); + for index = 0; index < (payload38).length(); index = index + 1 { + let iter_elem : Bool = (payload38)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload38).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + Varbit(payload39) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + let address40 = mbt_ffi_malloc((payload39).length() * 1); + for index41 = 0; index41 < (payload39).length(); index41 = index41 + 1 { + let iter_elem : Bool = (payload39)[(index41)] + let iter_base = address40 + (index41 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload39).length()) + mbt_ffi_store32((iter_base) + 8, address40) + cleanup_list.push(address40) + + () + } + Int4range(payload42) => { + mbt_ffi_store8((iter_base) + 0, (28)) + + match (payload42).start { + Included(payload43) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, payload43) + + () + } + Excluded(payload44) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload44) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload42).end { + Included(payload46) => { + mbt_ffi_store8((iter_base) + 16, (0)) + mbt_ffi_store32((iter_base) + 20, payload46) + + () + } + Excluded(payload47) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload47) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 16, (2)) + + () + } + } + + () + } + Int8range(payload49) => { + mbt_ffi_store8((iter_base) + 0, (29)) + + match (payload49).start { + Included(payload50) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store64((iter_base) + 16, payload50) + + () + } + Excluded(payload51) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store64((iter_base) + 16, payload51) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload49).end { + Included(payload53) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload53) + + () + } + Excluded(payload54) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, payload54) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 24, (2)) + + () + } + } + + () + } + Numrange(payload56) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + match (payload56).start { + Included(payload57) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + let ptr58 = mbt_ffi_str2ptr(payload57) + mbt_ffi_store32((iter_base) + 16, payload57.length()) + mbt_ffi_store32((iter_base) + 12, ptr58) + cleanup_list.push(ptr58) + + () + } + Excluded(payload59) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr60 = mbt_ffi_str2ptr(payload59) + mbt_ffi_store32((iter_base) + 16, payload59.length()) + mbt_ffi_store32((iter_base) + 12, ptr60) + cleanup_list.push(ptr60) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload56).end { + Included(payload62) => { + mbt_ffi_store8((iter_base) + 20, (0)) + + let ptr63 = mbt_ffi_str2ptr(payload62) + mbt_ffi_store32((iter_base) + 28, payload62.length()) + mbt_ffi_store32((iter_base) + 24, ptr63) + cleanup_list.push(ptr63) + + () + } + Excluded(payload64) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let ptr65 = mbt_ffi_str2ptr(payload64) + mbt_ffi_store32((iter_base) + 28, payload64.length()) + mbt_ffi_store32((iter_base) + 24, ptr65) + cleanup_list.push(ptr65) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 20, (2)) + + () + } + } + + () + } + Tsrange(payload67) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + match (payload67).start { + Included(payload68) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, ((payload68).date).year) + mbt_ffi_store8((iter_base) + 16, (((payload68).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload68).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, (((payload68).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, (((payload68).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, (((payload68).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, (((payload68).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload69) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, ((payload69).date).year) + mbt_ffi_store8((iter_base) + 16, (((payload69).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload69).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, (((payload69).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, (((payload69).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, (((payload69).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, (((payload69).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload67).end { + Included(payload71) => { + mbt_ffi_store8((iter_base) + 28, (0)) + mbt_ffi_store32((iter_base) + 32, ((payload71).date).year) + mbt_ffi_store8((iter_base) + 36, (((payload71).date).month).to_int()) + mbt_ffi_store8((iter_base) + 37, (((payload71).date).day).to_int()) + mbt_ffi_store8((iter_base) + 40, (((payload71).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 41, (((payload71).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 42, (((payload71).time).second).to_int()) + mbt_ffi_store32((iter_base) + 44, (((payload71).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload72) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, ((payload72).date).year) + mbt_ffi_store8((iter_base) + 36, (((payload72).date).month).to_int()) + mbt_ffi_store8((iter_base) + 37, (((payload72).date).day).to_int()) + mbt_ffi_store8((iter_base) + 40, (((payload72).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 41, (((payload72).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 42, (((payload72).time).second).to_int()) + mbt_ffi_store32((iter_base) + 44, (((payload72).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 28, (2)) + + () + } + } + + () + } + Tstzrange(payload74) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + match (payload74).start { + Included(payload75) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, (((payload75).timestamp).date).year) + mbt_ffi_store8((iter_base) + 16, ((((payload75).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload75).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, ((((payload75).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, ((((payload75).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, ((((payload75).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, ((((payload75).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 28, (payload75).offset) + + () + } + Excluded(payload76) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, (((payload76).timestamp).date).year) + mbt_ffi_store8((iter_base) + 16, ((((payload76).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload76).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, ((((payload76).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, ((((payload76).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, ((((payload76).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, ((((payload76).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 28, (payload76).offset) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload74).end { + Included(payload78) => { + mbt_ffi_store8((iter_base) + 32, (0)) + mbt_ffi_store32((iter_base) + 36, (((payload78).timestamp).date).year) + mbt_ffi_store8((iter_base) + 40, ((((payload78).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 41, ((((payload78).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 44, ((((payload78).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 45, ((((payload78).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 46, ((((payload78).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 48, ((((payload78).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 52, (payload78).offset) + + () + } + Excluded(payload79) => { + mbt_ffi_store8((iter_base) + 32, (1)) + mbt_ffi_store32((iter_base) + 36, (((payload79).timestamp).date).year) + mbt_ffi_store8((iter_base) + 40, ((((payload79).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 41, ((((payload79).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 44, ((((payload79).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 45, ((((payload79).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 46, ((((payload79).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 48, ((((payload79).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 52, (payload79).offset) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 32, (2)) + + () + } + } + + () + } + Daterange(payload81) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + match (payload81).start { + Included(payload82) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, (payload82).year) + mbt_ffi_store8((iter_base) + 16, ((payload82).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((payload82).day).to_int()) + + () + } + Excluded(payload83) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, (payload83).year) + mbt_ffi_store8((iter_base) + 16, ((payload83).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((payload83).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload81).end { + Included(payload85) => { + mbt_ffi_store8((iter_base) + 20, (0)) + mbt_ffi_store32((iter_base) + 24, (payload85).year) + mbt_ffi_store8((iter_base) + 28, ((payload85).month).to_int()) + mbt_ffi_store8((iter_base) + 29, ((payload85).day).to_int()) + + () + } + Excluded(payload86) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload86).year) + mbt_ffi_store8((iter_base) + 28, ((payload86).month).to_int()) + mbt_ffi_store8((iter_base) + 29, ((payload86).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 20, (2)) + + () + } + } + + () + } + Money(payload88) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store64((iter_base) + 8, payload88) + + () + } + Oid(payload89) => { + mbt_ffi_store8((iter_base) + 0, (35)) + mbt_ffi_store32((iter_base) + 8, (payload89).reinterpret_as_int()) + + () + } + Enumeration(payload90) => { + mbt_ffi_store8((iter_base) + 0, (36)) + + let ptr91 = mbt_ffi_str2ptr((payload90).name) + mbt_ffi_store32((iter_base) + 12, (payload90).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr91) + + let ptr92 = mbt_ffi_str2ptr((payload90).value) + mbt_ffi_store32((iter_base) + 20, (payload90).value.length()) + mbt_ffi_store32((iter_base) + 16, ptr92) + cleanup_list.push(ptr91) + cleanup_list.push(ptr92) + + () + } + Composite(payload93) => { + mbt_ffi_store8((iter_base) + 0, (37)) + + let ptr94 = mbt_ffi_str2ptr((payload93).name) + mbt_ffi_store32((iter_base) + 12, (payload93).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr94) + + let address96 = mbt_ffi_malloc(((payload93).values).length() * 4); + for index97 = 0; index97 < ((payload93).values).length(); index97 = index97 + 1 { + let iter_elem : LazyDbValue = ((payload93).values)[(index97)] + let iter_base = address96 + (index97 * 4); + + let LazyDbValue(handle95) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle95) + + } + mbt_ffi_store32((iter_base) + 20, ((payload93).values).length()) + mbt_ffi_store32((iter_base) + 16, address96) + cleanup_list.push(ptr94) + cleanup_list.push(address96) + + () + } + Domain(payload98) => { + mbt_ffi_store8((iter_base) + 0, (38)) + + let ptr99 = mbt_ffi_str2ptr((payload98).name) + mbt_ffi_store32((iter_base) + 12, (payload98).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr99) + + let LazyDbValue(handle100) = (payload98).value + mbt_ffi_store32((iter_base) + 16, handle100) + cleanup_list.push(ptr99) + + () + } + Array(payload101) => { + mbt_ffi_store8((iter_base) + 0, (39)) + + let address103 = mbt_ffi_malloc((payload101).length() * 4); + for index104 = 0; index104 < (payload101).length(); index104 = index104 + 1 { + let iter_elem : LazyDbValue = (payload101)[(index104)] + let iter_base = address103 + (index104 * 4); + + let LazyDbValue(handle102) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle102) + + } + mbt_ffi_store32((iter_base) + 12, (payload101).length()) + mbt_ffi_store32((iter_base) + 8, address103) + cleanup_list.push(address103) + + () + } + Range(payload105) => { + mbt_ffi_store8((iter_base) + 0, (40)) + + let ptr106 = mbt_ffi_str2ptr((payload105).name) + mbt_ffi_store32((iter_base) + 12, (payload105).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr106) + + match ((payload105).value).start { + Included(payload107) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let LazyDbValue(handle108) = payload107 + mbt_ffi_store32((iter_base) + 20, handle108) + + () + } + Excluded(payload109) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let LazyDbValue(handle110) = payload109 + mbt_ffi_store32((iter_base) + 20, handle110) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 16, (2)) + + () + } + } + + match ((payload105).value).end { + Included(payload112) => { + mbt_ffi_store8((iter_base) + 24, (0)) + + let LazyDbValue(handle113) = payload112 + mbt_ffi_store32((iter_base) + 28, handle113) + + () + } + Excluded(payload114) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let LazyDbValue(handle115) = payload114 + mbt_ffi_store32((iter_base) + 28, handle115) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 24, (2)) + + () + } + } + cleanup_list.push(ptr106) + + () + } + Null => { + mbt_ffi_store8((iter_base) + 0, (41)) + + () + } + Vector(payload118) => { + mbt_ffi_store8((iter_base) + 0, (42)) + + let ptr119 = mbt_ffi_float_array2ptr(payload118) + + mbt_ffi_store32((iter_base) + 12, payload118.length()) + mbt_ffi_store32((iter_base) + 8, ptr119) + cleanup_list.push(ptr119) + + () + } + Halfvec(payload120) => { + mbt_ffi_store8((iter_base) + 0, (43)) + + let ptr121 = mbt_ffi_float_array2ptr(payload120) + + mbt_ffi_store32((iter_base) + 12, payload120.length()) + mbt_ffi_store32((iter_base) + 8, ptr121) + cleanup_list.push(ptr121) + + () + } + Sparsevec(payload122) => { + mbt_ffi_store8((iter_base) + 0, (44)) + mbt_ffi_store32((iter_base) + 8, (payload122).dim) + + let ptr123 = mbt_ffi_int_array2ptr((payload122).indices) + + mbt_ffi_store32((iter_base) + 16, (payload122).indices.length()) + mbt_ffi_store32((iter_base) + 12, ptr123) + + let ptr124 = mbt_ffi_float_array2ptr((payload122).values) + + mbt_ffi_store32((iter_base) + 24, (payload122).values.length()) + mbt_ffi_store32((iter_base) + 20, ptr124) + cleanup_list.push(ptr123) + cleanup_list.push(ptr124) + + () + } + } + + } + let return_area = mbt_ffi_malloc(20) + wasmImportMethodDbConnectionQuery(handle, ptr, statement.length(), address125, (params).length(), return_area); + + let lifted193 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let array134 : Array[DbColumn] = []; + for index135 = 0; index135 < (mbt_ffi_load32((return_area) + 8)); index135 = index135 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index135 * 48) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + DbColumnType::Character + } + 1 => { + + DbColumnType::Int2 + } + 2 => { + + DbColumnType::Int4 + } + 3 => { + + DbColumnType::Int8 + } + 4 => { + + DbColumnType::Float4 + } + 5 => { + + DbColumnType::Float8 + } + 6 => { + + DbColumnType::Numeric + } + 7 => { + + DbColumnType::Boolean + } + 8 => { + + DbColumnType::Text + } + 9 => { + + DbColumnType::Varchar + } + 10 => { + + DbColumnType::Bpchar + } + 11 => { + + DbColumnType::Timestamp + } + 12 => { + + DbColumnType::Timestamptz + } + 13 => { + + DbColumnType::Date + } + 14 => { + + DbColumnType::Time + } + 15 => { + + DbColumnType::Timetz + } + 16 => { + + DbColumnType::Interval + } + 17 => { + + DbColumnType::Bytea + } + 18 => { + + DbColumnType::Uuid + } + 19 => { + + DbColumnType::Xml + } + 20 => { + + DbColumnType::Json + } + 21 => { + + DbColumnType::Jsonb + } + 22 => { + + DbColumnType::Jsonpath + } + 23 => { + + DbColumnType::Inet + } + 24 => { + + DbColumnType::Cidr + } + 25 => { + + DbColumnType::Macaddr + } + 26 => { + + DbColumnType::Bit + } + 27 => { + + DbColumnType::Varbit + } + 28 => { + + DbColumnType::Int4range + } + 29 => { + + DbColumnType::Int8range + } + 30 => { + + DbColumnType::Numrange + } + 31 => { + + DbColumnType::Tsrange + } + 32 => { + + DbColumnType::Tstzrange + } + 33 => { + + DbColumnType::Daterange + } + 34 => { + + DbColumnType::Money + } + 35 => { + + DbColumnType::Oid + } + 36 => { + + let result127 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + DbColumnType::Enumeration(EnumerationType::{name : result127}) + } + 37 => { + + let result128 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + let array : Array[(String, LazyDbColumnType)] = []; + for index130 = 0; index130 < (mbt_ffi_load32((iter_base) + 32)); index130 = index130 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index130 * 12) + + let result129 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push((result129, LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 8)))) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + DbColumnType::Composite(CompositeType::{name : result128, attributes : array}) + } + 38 => { + + let result131 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + DbColumnType::Domain(DomainType::{name : result131, base_type : LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 28))}) + } + 39 => { + + DbColumnType::Array(LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 20))) + } + 40 => { + + let result132 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + DbColumnType::Range(RangeType::{name : result132, base_type : LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 28))}) + } + 41 => { + + DbColumnType::Vector + } + 42 => { + + DbColumnType::Halfvec + } + 43 => { + + DbColumnType::Sparsevec + } + _ => panic() + } + + let result133 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + array134.push(DbColumn::{ordinal : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), name : result, db_type : lifted, db_type_name : result133}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) + + let array185 : Array[DbRow] = []; + for index186 = 0; index186 < (mbt_ffi_load32((return_area) + 16)); index186 = index186 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 12)) + (index186 * 8) + + let array183 : Array[DbValue] = []; + for index184 = 0; index184 < (mbt_ffi_load32((iter_base) + 4)); index184 = index184 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index184 * 56) + + let lifted182 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + DbValue::Character((mbt_ffi_load8((iter_base) + 8))) + } + 1 => { + + DbValue::Int2((mbt_ffi_load16((iter_base) + 8))) + } + 2 => { + + DbValue::Int4(mbt_ffi_load32((iter_base) + 8)) + } + 3 => { + + DbValue::Int8(mbt_ffi_load64((iter_base) + 8)) + } + 4 => { + + DbValue::Float4(mbt_ffi_loadf32((iter_base) + 8)) + } + 5 => { + + DbValue::Float8(mbt_ffi_loadf64((iter_base) + 8)) + } + 6 => { + + let result136 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Numeric(result136) + } + 7 => { + + DbValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 8 => { + + let result137 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Text(result137) + } + 9 => { + + let result138 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Varchar(result138) + } + 10 => { + + let result139 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Bpchar(result139) + } + 11 => { + + DbValue::Timestamp(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 17)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()}}) + } + 12 => { + + DbValue::Timestamptz(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 17)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 24)}) + } + 13 => { + + DbValue::Date(@types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}) + } + 14 => { + + DbValue::Time(@types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 8)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 9)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 10)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 15 => { + + DbValue::Timetz(@types.Timetz::{time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 8)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 9)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 10)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}, offset : mbt_ffi_load32((iter_base) + 16)}) + } + 16 => { + + DbValue::Interval(Interval::{months : mbt_ffi_load32((iter_base) + 8), days : mbt_ffi_load32((iter_base) + 12), microseconds : mbt_ffi_load64((iter_base) + 16)}) + } + 17 => { - () - } - Time(payload17) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store8(iter_base + 8, payload17.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload17.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload17.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload17.nanosecond.reinterpret_as_int(), - ) - - () - } - Timetz(payload18) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store8(iter_base + 8, payload18.time.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload18.time.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload18.time.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload18.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 16, payload18.offset) - - () - } - Interval(payload19) => { - mbt_ffi_store8(iter_base + 0, 16) - mbt_ffi_store32(iter_base + 8, payload19.months) - mbt_ffi_store32(iter_base + 12, payload19.days) - mbt_ffi_store64(iter_base + 16, payload19.microseconds) + let result140 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Bytea(payload20) => { - mbt_ffi_store8(iter_base + 0, 17) + DbValue::Bytea(result140) + } + 18 => { - let ptr21 = mbt_ffi_bytes2ptr(payload20) + let result141 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - mbt_ffi_store32(iter_base + 12, payload20.length()) - mbt_ffi_store32(iter_base + 8, ptr21) - cleanup_list.push(ptr21) + DbValue::Json(result141) + } + 19 => { - () - } - Json(payload22) => { - mbt_ffi_store8(iter_base + 0, 18) + let result142 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr23 = mbt_ffi_str2ptr(payload22) - mbt_ffi_store32(iter_base + 12, payload22.length()) - mbt_ffi_store32(iter_base + 8, ptr23) - cleanup_list.push(ptr23) + DbValue::Jsonb(result142) + } + 20 => { - () - } - Jsonb(payload24) => { - mbt_ffi_store8(iter_base + 0, 19) + let result143 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr25 = mbt_ffi_str2ptr(payload24) - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, ptr25) - cleanup_list.push(ptr25) + DbValue::Jsonpath(result143) + } + 21 => { - () - } - Jsonpath(payload26) => { - mbt_ffi_store8(iter_base + 0, 20) + let result144 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr27 = mbt_ffi_str2ptr(payload26) - mbt_ffi_store32(iter_base + 12, payload26.length()) - mbt_ffi_store32(iter_base + 8, ptr27) - cleanup_list.push(ptr27) + DbValue::Xml(result144) + } + 22 => { - () - } - Xml(payload28) => { - mbt_ffi_store8(iter_base + 0, 21) + DbValue::Uuid(@types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64()}) + } + 23 => { - let ptr29 = mbt_ffi_str2ptr(payload28) - mbt_ffi_store32(iter_base + 12, payload28.length()) - mbt_ffi_store32(iter_base + 8, ptr29) - cleanup_list.push(ptr29) + let lifted145 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - () - } - Uuid(payload30) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store64( - iter_base + 8, - payload30.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 16, - payload30.low_bits.reinterpret_as_int64(), - ) - - () - } - Inet(payload31) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload31 { - Ipv4(payload32) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store8(iter_base + 10, payload32.0.to_int()) - mbt_ffi_store8(iter_base + 11, payload32.1.to_int()) - mbt_ffi_store8(iter_base + 12, payload32.2.to_int()) - mbt_ffi_store8(iter_base + 13, payload32.3.to_int()) - - () - } - Ipv6(payload33) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store16(iter_base + 10, payload33.0.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 12, payload33.1.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 14, payload33.2.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 16, payload33.3.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 18, payload33.4.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 20, payload33.5.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 22, payload33.6.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 24, payload33.7.reinterpret_as_int()) - - () - } - } - - () - } - Cidr(payload34) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload34 { - Ipv4(payload35) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store8(iter_base + 10, payload35.0.to_int()) - mbt_ffi_store8(iter_base + 11, payload35.1.to_int()) - mbt_ffi_store8(iter_base + 12, payload35.2.to_int()) - mbt_ffi_store8(iter_base + 13, payload35.3.to_int()) - - () - } - Ipv6(payload36) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store16(iter_base + 10, payload36.0.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 12, payload36.1.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 14, payload36.2.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 16, payload36.3.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 18, payload36.4.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 20, payload36.5.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 22, payload36.6.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 24, payload36.7.reinterpret_as_int()) - - () - } - } - - () - } - Macaddr(payload37) => { - mbt_ffi_store8(iter_base + 0, 25) - mbt_ffi_store8(iter_base + 8, payload37.octets.0.to_int()) - mbt_ffi_store8(iter_base + 9, payload37.octets.1.to_int()) - mbt_ffi_store8(iter_base + 10, payload37.octets.2.to_int()) - mbt_ffi_store8(iter_base + 11, payload37.octets.3.to_int()) - mbt_ffi_store8(iter_base + 12, payload37.octets.4.to_int()) - mbt_ffi_store8(iter_base + 13, payload37.octets.5.to_int()) - - () - } - Bit(payload38) => { - mbt_ffi_store8(iter_base + 0, 26) - - let address = mbt_ffi_malloc(payload38.length() * 1) - for index = 0; index < payload38.length(); index = index + 1 { - let iter_elem : Bool = payload38[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload38.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - Varbit(payload39) => { - mbt_ffi_store8(iter_base + 0, 27) - - let address40 = mbt_ffi_malloc(payload39.length() * 1) - for index41 = 0; index41 < payload39.length(); index41 = index41 + 1 { - let iter_elem : Bool = payload39[index41] - let iter_base = address40 + index41 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, address40) - cleanup_list.push(address40) - - () + @types.IpAddress::Ipv4(((mbt_ffi_load8_u((iter_base) + 10)).to_byte(), (mbt_ffi_load8_u((iter_base) + 11)).to_byte(), (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), (mbt_ffi_load8_u((iter_base) + 13)).to_byte())) + } + 1 => { + + @types.IpAddress::Ipv6(((mbt_ffi_load16_u((iter_base) + 10).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 12).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 14).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 16).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 18).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 20).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 22).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 24).land(0xFFFF).reinterpret_as_uint()))) + } + _ => panic() + } + + DbValue::Inet(lifted145) + } + 24 => { + + let lifted146 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + @types.IpAddress::Ipv4(((mbt_ffi_load8_u((iter_base) + 10)).to_byte(), (mbt_ffi_load8_u((iter_base) + 11)).to_byte(), (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), (mbt_ffi_load8_u((iter_base) + 13)).to_byte())) + } + 1 => { + + @types.IpAddress::Ipv6(((mbt_ffi_load16_u((iter_base) + 10).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 12).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 14).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 16).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 18).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 20).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 22).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 24).land(0xFFFF).reinterpret_as_uint()))) + } + _ => panic() + } + + DbValue::Cidr(lifted146) + } + 25 => { + + DbValue::Macaddr(@types.MacAddress::{octets : ((mbt_ffi_load8_u((iter_base) + 8)).to_byte(), (mbt_ffi_load8_u((iter_base) + 9)).to_byte(), (mbt_ffi_load8_u((iter_base) + 10)).to_byte(), (mbt_ffi_load8_u((iter_base) + 11)).to_byte(), (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), (mbt_ffi_load8_u((iter_base) + 13)).to_byte())}) + } + 26 => { + + let array147 : Array[Bool] = []; + for index148 = 0; index148 < (mbt_ffi_load32((iter_base) + 12)); index148 = index148 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index148 * 1) + + array147.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + DbValue::Bit(array147) + } + 27 => { + + let array149 : Array[Bool] = []; + for index150 = 0; index150 < (mbt_ffi_load32((iter_base) + 12)); index150 = index150 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index150 * 1) + + array149.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + DbValue::Varbit(array149) + } + 28 => { + + let lifted151 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + Int4bound::Included(mbt_ffi_load32((iter_base) + 12)) + } + 1 => { + + Int4bound::Excluded(mbt_ffi_load32((iter_base) + 12)) + } + 2 => { + + Int4bound::Unbounded + } + _ => panic() + } + + let lifted152 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + Int4bound::Included(mbt_ffi_load32((iter_base) + 20)) + } + 1 => { + + Int4bound::Excluded(mbt_ffi_load32((iter_base) + 20)) + } + 2 => { + + Int4bound::Unbounded + } + _ => panic() + } + + DbValue::Int4range(Int4range::{start : lifted151, end : lifted152}) + } + 29 => { + + let lifted153 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + Int8bound::Included(mbt_ffi_load64((iter_base) + 16)) + } + 1 => { + + Int8bound::Excluded(mbt_ffi_load64((iter_base) + 16)) + } + 2 => { + + Int8bound::Unbounded + } + _ => panic() + } + + let lifted154 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + Int8bound::Included(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + Int8bound::Excluded(mbt_ffi_load64((iter_base) + 32)) + } + 2 => { + + Int8bound::Unbounded + } + _ => panic() + } + + DbValue::Int8range(Int8range::{start : lifted153, end : lifted154}) + } + 30 => { + + let lifted157 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let result155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Numbound::Included(result155) + } + 1 => { + + let result156 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Numbound::Excluded(result156) + } + 2 => { + + Numbound::Unbounded + } + _ => panic() + } + + let lifted160 = match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => { + + let result158 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + Numbound::Included(result158) + } + 1 => { + + let result159 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + Numbound::Excluded(result159) + } + 2 => { + + Numbound::Unbounded + } + _ => panic() + } + + DbValue::Numrange(Numrange::{start : lifted157, end : lifted160}) + } + 31 => { + + let lifted161 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + Tsbound::Included(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 20)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 21)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}) + } + 1 => { + + Tsbound::Excluded(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 20)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 21)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}) + } + 2 => { + + Tsbound::Unbounded + } + _ => panic() + } + + let lifted162 = match (mbt_ffi_load8_u((iter_base) + 28)) { + 0 => { + + Tsbound::Included(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 32), month : (mbt_ffi_load8_u((iter_base) + 36)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 37)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 40)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 41)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 42)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 44)).reinterpret_as_uint()}}) + } + 1 => { + + Tsbound::Excluded(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 32), month : (mbt_ffi_load8_u((iter_base) + 36)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 37)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 40)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 41)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 42)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 44)).reinterpret_as_uint()}}) + } + 2 => { + + Tsbound::Unbounded + } + _ => panic() + } + + DbValue::Tsrange(Tsrange::{start : lifted161, end : lifted162}) + } + 32 => { + + let lifted163 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + Tstzbound::Included(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 20)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 21)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 28)}) + } + 1 => { + + Tstzbound::Excluded(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 20)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 21)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 28)}) + } + 2 => { + + Tstzbound::Unbounded + } + _ => panic() + } + + let lifted164 = match (mbt_ffi_load8_u((iter_base) + 32)) { + 0 => { + + Tstzbound::Included(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 36), month : (mbt_ffi_load8_u((iter_base) + 40)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 41)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 44)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 45)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 46)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 48)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 52)}) + } + 1 => { + + Tstzbound::Excluded(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 36), month : (mbt_ffi_load8_u((iter_base) + 40)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 41)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 44)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 45)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 46)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 48)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 52)}) + } + 2 => { + + Tstzbound::Unbounded + } + _ => panic() + } + + DbValue::Tstzrange(Tstzrange::{start : lifted163, end : lifted164}) + } + 33 => { + + let lifted165 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + Datebound::Included(@types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}) + } + 1 => { + + Datebound::Excluded(@types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}) + } + 2 => { + + Datebound::Unbounded + } + _ => panic() + } + + let lifted166 = match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => { + + Datebound::Included(@types.Date::{year : mbt_ffi_load32((iter_base) + 24), month : (mbt_ffi_load8_u((iter_base) + 28)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 29)).to_byte()}) + } + 1 => { + + Datebound::Excluded(@types.Date::{year : mbt_ffi_load32((iter_base) + 24), month : (mbt_ffi_load8_u((iter_base) + 28)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 29)).to_byte()}) + } + 2 => { + + Datebound::Unbounded + } + _ => panic() + } + + DbValue::Daterange(Daterange::{start : lifted165, end : lifted166}) + } + 34 => { + + DbValue::Money(mbt_ffi_load64((iter_base) + 8)) + } + 35 => { + + DbValue::Oid((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 36 => { + + let result167 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result168 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + DbValue::Enumeration(Enumeration::{name : result167, value : result168}) + } + 37 => { + + let result169 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array170 : Array[LazyDbValue] = []; + for index171 = 0; index171 < (mbt_ffi_load32((iter_base) + 20)); index171 = index171 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index171 * 4) + + array170.push(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 0))) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + DbValue::Composite(Composite::{name : result169, values : array170}) + } + 38 => { + + let result172 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Domain(Domain::{name : result172, value : LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 16))}) + } + 39 => { + + let array173 : Array[LazyDbValue] = []; + for index174 = 0; index174 < (mbt_ffi_load32((iter_base) + 12)); index174 = index174 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index174 * 4) + + array173.push(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 0))) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + DbValue::Array(array173) + } + 40 => { + + let result175 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted176 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + ValueBound::Included(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 20))) + } + 1 => { + + ValueBound::Excluded(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 20))) + } + 2 => { + + ValueBound::Unbounded + } + _ => panic() + } + + let lifted177 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + ValueBound::Included(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 28))) + } + 1 => { + + ValueBound::Excluded(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 28))) + } + 2 => { + + ValueBound::Unbounded + } + _ => panic() + } + + DbValue::Range(Range::{name : result175, value : ValuesRange::{start : lifted176, end : lifted177}}) + } + 41 => { + + DbValue::Null + } + 42 => { + + let result178 = mbt_ffi_ptr2float_array(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Vector(result178) + } + 43 => { + + let result179 = mbt_ffi_ptr2float_array(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + DbValue::Halfvec(result179) + } + 44 => { + + let result180 = mbt_ffi_ptr2int_array(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + let result181 = mbt_ffi_ptr2float_array(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + DbValue::Sparsevec(SparseVec::{dim : mbt_ffi_load32((iter_base) + 8), indices : result180, values : result181}) + } + _ => panic() + } + + array183.push(lifted182) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array185.push(DbRow::{values : array183}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 12)) + + Result::Ok(DbResult::{columns : array134, rows : array185}) + } + 1 => { + + let lifted192 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result187 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result187) + } + 1 => { + + let result188 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result188) + } + 2 => { + + let result189 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result189) + } + 3 => { + + let result190 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result190) + } + 4 => { + + let result191 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result191) + } + _ => panic() + } + + Result::Err(lifted192) + } + _ => panic() } - Int4range(payload42) => { - mbt_ffi_store8(iter_base + 0, 28) - - match payload42.start { - Included(payload43) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload43) - - () - } - Excluded(payload44) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload44) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload42.end { - Included(payload46) => { - mbt_ffi_store8(iter_base + 16, 0) - mbt_ffi_store32(iter_base + 20, payload46) - - () - } - Excluded(payload47) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload47) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 16, 2) - - () - } - } - - () + let ret = lifted193 + mbt_ffi_free(ptr) + mbt_ffi_free(address125) + mbt_ffi_free(return_area) + + cleanup_list.each(mbt_ffi_free) + return ret + +} +///| +pub fn DbConnection::query_stream(self : DbConnection, statement : String, params : Array[DbValue]) -> Result[DbResultStream, Error_] { + let cleanup_list : Array[Int] = [] + + let DbConnection(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address125 = mbt_ffi_malloc((params).length() * 56); + for index126 = 0; index126 < (params).length(); index126 = index126 + 1 { + let iter_elem : DbValue = (params)[(index126)] + let iter_base = address125 + (index126 * 56); + + match iter_elem { + Character(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload)) + + () + } + Int2(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload0)) + + () + } + Int4(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store32((iter_base) + 8, payload1) + + () + } + Int8(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store64((iter_base) + 8, payload2) + + () + } + Float4(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_storef32((iter_base) + 8, payload3) + + () + } + Float8(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_storef64((iter_base) + 8, payload4) + + () + } + Numeric(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + let ptr6 = mbt_ffi_str2ptr(payload5) + mbt_ffi_store32((iter_base) + 12, payload5.length()) + mbt_ffi_store32((iter_base) + 8, ptr6) + cleanup_list.push(ptr6) + + () + } + Boolean(payload7) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store8((iter_base) + 8, (if payload7 { 1 } else { 0 })) + + () + } + Text(payload8) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((iter_base) + 12, payload8.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + cleanup_list.push(ptr9) + + () + } + Varchar(payload10) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr11 = mbt_ffi_str2ptr(payload10) + mbt_ffi_store32((iter_base) + 12, payload10.length()) + mbt_ffi_store32((iter_base) + 8, ptr11) + cleanup_list.push(ptr11) + + () + } + Bpchar(payload12) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + let ptr13 = mbt_ffi_str2ptr(payload12) + mbt_ffi_store32((iter_base) + 12, payload12.length()) + mbt_ffi_store32((iter_base) + 8, ptr13) + cleanup_list.push(ptr13) + + () + } + Timestamp(payload14) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, ((payload14).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload14).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload14).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload14).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload14).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload14).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload14).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamptz(payload15) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store32((iter_base) + 8, (((payload15).timestamp).date).year) + mbt_ffi_store8((iter_base) + 12, ((((payload15).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((((payload15).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, ((((payload15).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload15).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, ((((payload15).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, ((((payload15).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 24, (payload15).offset) + + () + } + Date(payload16) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store32((iter_base) + 8, (payload16).year) + mbt_ffi_store8((iter_base) + 12, ((payload16).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload16).day).to_int()) + + () + } + Time(payload17) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store8((iter_base) + 8, ((payload17).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, ((payload17).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, ((payload17).second).to_int()) + mbt_ffi_store32((iter_base) + 12, ((payload17).nanosecond).reinterpret_as_int()) + + () + } + Timetz(payload18) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store8((iter_base) + 8, (((payload18).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, (((payload18).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, (((payload18).time).second).to_int()) + mbt_ffi_store32((iter_base) + 12, (((payload18).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 16, (payload18).offset) + + () + } + Interval(payload19) => { + mbt_ffi_store8((iter_base) + 0, (16)) + mbt_ffi_store32((iter_base) + 8, (payload19).months) + mbt_ffi_store32((iter_base) + 12, (payload19).days) + mbt_ffi_store64((iter_base) + 16, (payload19).microseconds) + + () + } + Bytea(payload20) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let ptr21 = mbt_ffi_bytes2ptr(payload20) + + mbt_ffi_store32((iter_base) + 12, payload20.length()) + mbt_ffi_store32((iter_base) + 8, ptr21) + cleanup_list.push(ptr21) + + () + } + Json(payload22) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let ptr23 = mbt_ffi_str2ptr(payload22) + mbt_ffi_store32((iter_base) + 12, payload22.length()) + mbt_ffi_store32((iter_base) + 8, ptr23) + cleanup_list.push(ptr23) + + () + } + Jsonb(payload24) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let ptr25 = mbt_ffi_str2ptr(payload24) + mbt_ffi_store32((iter_base) + 12, payload24.length()) + mbt_ffi_store32((iter_base) + 8, ptr25) + cleanup_list.push(ptr25) + + () + } + Jsonpath(payload26) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let ptr27 = mbt_ffi_str2ptr(payload26) + mbt_ffi_store32((iter_base) + 12, payload26.length()) + mbt_ffi_store32((iter_base) + 8, ptr27) + cleanup_list.push(ptr27) + + () + } + Xml(payload28) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + let ptr29 = mbt_ffi_str2ptr(payload28) + mbt_ffi_store32((iter_base) + 12, payload28.length()) + mbt_ffi_store32((iter_base) + 8, ptr29) + cleanup_list.push(ptr29) + + () + } + Uuid(payload30) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store64((iter_base) + 8, ((payload30).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload30).low_bits).reinterpret_as_int64()) + + () + } + Inet(payload31) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match payload31 { + Ipv4(payload32) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store8((iter_base) + 10, ((payload32).0).to_int()) + mbt_ffi_store8((iter_base) + 11, ((payload32).1).to_int()) + mbt_ffi_store8((iter_base) + 12, ((payload32).2).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload32).3).to_int()) + + () + } + Ipv6(payload33) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store16((iter_base) + 10, ((payload33).0).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 12, ((payload33).1).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 14, ((payload33).2).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 16, ((payload33).3).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 18, ((payload33).4).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 20, ((payload33).5).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 22, ((payload33).6).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 24, ((payload33).7).reinterpret_as_int()) + + () + } + } + + () + } + Cidr(payload34) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match payload34 { + Ipv4(payload35) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store8((iter_base) + 10, ((payload35).0).to_int()) + mbt_ffi_store8((iter_base) + 11, ((payload35).1).to_int()) + mbt_ffi_store8((iter_base) + 12, ((payload35).2).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload35).3).to_int()) + + () + } + Ipv6(payload36) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store16((iter_base) + 10, ((payload36).0).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 12, ((payload36).1).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 14, ((payload36).2).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 16, ((payload36).3).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 18, ((payload36).4).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 20, ((payload36).5).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 22, ((payload36).6).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 24, ((payload36).7).reinterpret_as_int()) + + () + } + } + + () + } + Macaddr(payload37) => { + mbt_ffi_store8((iter_base) + 0, (25)) + mbt_ffi_store8((iter_base) + 8, (((payload37).octets).0).to_int()) + mbt_ffi_store8((iter_base) + 9, (((payload37).octets).1).to_int()) + mbt_ffi_store8((iter_base) + 10, (((payload37).octets).2).to_int()) + mbt_ffi_store8((iter_base) + 11, (((payload37).octets).3).to_int()) + mbt_ffi_store8((iter_base) + 12, (((payload37).octets).4).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload37).octets).5).to_int()) + + () + } + Bit(payload38) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let address = mbt_ffi_malloc((payload38).length() * 1); + for index = 0; index < (payload38).length(); index = index + 1 { + let iter_elem : Bool = (payload38)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload38).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + Varbit(payload39) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + let address40 = mbt_ffi_malloc((payload39).length() * 1); + for index41 = 0; index41 < (payload39).length(); index41 = index41 + 1 { + let iter_elem : Bool = (payload39)[(index41)] + let iter_base = address40 + (index41 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload39).length()) + mbt_ffi_store32((iter_base) + 8, address40) + cleanup_list.push(address40) + + () + } + Int4range(payload42) => { + mbt_ffi_store8((iter_base) + 0, (28)) + + match (payload42).start { + Included(payload43) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, payload43) + + () + } + Excluded(payload44) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload44) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload42).end { + Included(payload46) => { + mbt_ffi_store8((iter_base) + 16, (0)) + mbt_ffi_store32((iter_base) + 20, payload46) + + () + } + Excluded(payload47) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload47) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 16, (2)) + + () + } + } + + () + } + Int8range(payload49) => { + mbt_ffi_store8((iter_base) + 0, (29)) + + match (payload49).start { + Included(payload50) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store64((iter_base) + 16, payload50) + + () + } + Excluded(payload51) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store64((iter_base) + 16, payload51) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload49).end { + Included(payload53) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload53) + + () + } + Excluded(payload54) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, payload54) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 24, (2)) + + () + } + } + + () + } + Numrange(payload56) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + match (payload56).start { + Included(payload57) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + let ptr58 = mbt_ffi_str2ptr(payload57) + mbt_ffi_store32((iter_base) + 16, payload57.length()) + mbt_ffi_store32((iter_base) + 12, ptr58) + cleanup_list.push(ptr58) + + () + } + Excluded(payload59) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr60 = mbt_ffi_str2ptr(payload59) + mbt_ffi_store32((iter_base) + 16, payload59.length()) + mbt_ffi_store32((iter_base) + 12, ptr60) + cleanup_list.push(ptr60) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload56).end { + Included(payload62) => { + mbt_ffi_store8((iter_base) + 20, (0)) + + let ptr63 = mbt_ffi_str2ptr(payload62) + mbt_ffi_store32((iter_base) + 28, payload62.length()) + mbt_ffi_store32((iter_base) + 24, ptr63) + cleanup_list.push(ptr63) + + () + } + Excluded(payload64) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let ptr65 = mbt_ffi_str2ptr(payload64) + mbt_ffi_store32((iter_base) + 28, payload64.length()) + mbt_ffi_store32((iter_base) + 24, ptr65) + cleanup_list.push(ptr65) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 20, (2)) + + () + } + } + + () + } + Tsrange(payload67) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + match (payload67).start { + Included(payload68) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, ((payload68).date).year) + mbt_ffi_store8((iter_base) + 16, (((payload68).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload68).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, (((payload68).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, (((payload68).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, (((payload68).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, (((payload68).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload69) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, ((payload69).date).year) + mbt_ffi_store8((iter_base) + 16, (((payload69).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload69).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, (((payload69).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, (((payload69).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, (((payload69).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, (((payload69).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload67).end { + Included(payload71) => { + mbt_ffi_store8((iter_base) + 28, (0)) + mbt_ffi_store32((iter_base) + 32, ((payload71).date).year) + mbt_ffi_store8((iter_base) + 36, (((payload71).date).month).to_int()) + mbt_ffi_store8((iter_base) + 37, (((payload71).date).day).to_int()) + mbt_ffi_store8((iter_base) + 40, (((payload71).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 41, (((payload71).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 42, (((payload71).time).second).to_int()) + mbt_ffi_store32((iter_base) + 44, (((payload71).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload72) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, ((payload72).date).year) + mbt_ffi_store8((iter_base) + 36, (((payload72).date).month).to_int()) + mbt_ffi_store8((iter_base) + 37, (((payload72).date).day).to_int()) + mbt_ffi_store8((iter_base) + 40, (((payload72).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 41, (((payload72).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 42, (((payload72).time).second).to_int()) + mbt_ffi_store32((iter_base) + 44, (((payload72).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 28, (2)) + + () + } + } + + () + } + Tstzrange(payload74) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + match (payload74).start { + Included(payload75) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, (((payload75).timestamp).date).year) + mbt_ffi_store8((iter_base) + 16, ((((payload75).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload75).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, ((((payload75).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, ((((payload75).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, ((((payload75).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, ((((payload75).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 28, (payload75).offset) + + () + } + Excluded(payload76) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, (((payload76).timestamp).date).year) + mbt_ffi_store8((iter_base) + 16, ((((payload76).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload76).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, ((((payload76).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, ((((payload76).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, ((((payload76).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, ((((payload76).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 28, (payload76).offset) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload74).end { + Included(payload78) => { + mbt_ffi_store8((iter_base) + 32, (0)) + mbt_ffi_store32((iter_base) + 36, (((payload78).timestamp).date).year) + mbt_ffi_store8((iter_base) + 40, ((((payload78).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 41, ((((payload78).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 44, ((((payload78).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 45, ((((payload78).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 46, ((((payload78).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 48, ((((payload78).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 52, (payload78).offset) + + () + } + Excluded(payload79) => { + mbt_ffi_store8((iter_base) + 32, (1)) + mbt_ffi_store32((iter_base) + 36, (((payload79).timestamp).date).year) + mbt_ffi_store8((iter_base) + 40, ((((payload79).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 41, ((((payload79).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 44, ((((payload79).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 45, ((((payload79).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 46, ((((payload79).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 48, ((((payload79).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 52, (payload79).offset) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 32, (2)) + + () + } + } + + () + } + Daterange(payload81) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + match (payload81).start { + Included(payload82) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, (payload82).year) + mbt_ffi_store8((iter_base) + 16, ((payload82).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((payload82).day).to_int()) + + () + } + Excluded(payload83) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, (payload83).year) + mbt_ffi_store8((iter_base) + 16, ((payload83).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((payload83).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload81).end { + Included(payload85) => { + mbt_ffi_store8((iter_base) + 20, (0)) + mbt_ffi_store32((iter_base) + 24, (payload85).year) + mbt_ffi_store8((iter_base) + 28, ((payload85).month).to_int()) + mbt_ffi_store8((iter_base) + 29, ((payload85).day).to_int()) + + () + } + Excluded(payload86) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload86).year) + mbt_ffi_store8((iter_base) + 28, ((payload86).month).to_int()) + mbt_ffi_store8((iter_base) + 29, ((payload86).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 20, (2)) + + () + } + } + + () + } + Money(payload88) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store64((iter_base) + 8, payload88) + + () + } + Oid(payload89) => { + mbt_ffi_store8((iter_base) + 0, (35)) + mbt_ffi_store32((iter_base) + 8, (payload89).reinterpret_as_int()) + + () + } + Enumeration(payload90) => { + mbt_ffi_store8((iter_base) + 0, (36)) + + let ptr91 = mbt_ffi_str2ptr((payload90).name) + mbt_ffi_store32((iter_base) + 12, (payload90).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr91) + + let ptr92 = mbt_ffi_str2ptr((payload90).value) + mbt_ffi_store32((iter_base) + 20, (payload90).value.length()) + mbt_ffi_store32((iter_base) + 16, ptr92) + cleanup_list.push(ptr91) + cleanup_list.push(ptr92) + + () + } + Composite(payload93) => { + mbt_ffi_store8((iter_base) + 0, (37)) + + let ptr94 = mbt_ffi_str2ptr((payload93).name) + mbt_ffi_store32((iter_base) + 12, (payload93).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr94) + + let address96 = mbt_ffi_malloc(((payload93).values).length() * 4); + for index97 = 0; index97 < ((payload93).values).length(); index97 = index97 + 1 { + let iter_elem : LazyDbValue = ((payload93).values)[(index97)] + let iter_base = address96 + (index97 * 4); + + let LazyDbValue(handle95) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle95) + + } + mbt_ffi_store32((iter_base) + 20, ((payload93).values).length()) + mbt_ffi_store32((iter_base) + 16, address96) + cleanup_list.push(ptr94) + cleanup_list.push(address96) + + () + } + Domain(payload98) => { + mbt_ffi_store8((iter_base) + 0, (38)) + + let ptr99 = mbt_ffi_str2ptr((payload98).name) + mbt_ffi_store32((iter_base) + 12, (payload98).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr99) + + let LazyDbValue(handle100) = (payload98).value + mbt_ffi_store32((iter_base) + 16, handle100) + cleanup_list.push(ptr99) + + () + } + Array(payload101) => { + mbt_ffi_store8((iter_base) + 0, (39)) + + let address103 = mbt_ffi_malloc((payload101).length() * 4); + for index104 = 0; index104 < (payload101).length(); index104 = index104 + 1 { + let iter_elem : LazyDbValue = (payload101)[(index104)] + let iter_base = address103 + (index104 * 4); + + let LazyDbValue(handle102) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle102) + + } + mbt_ffi_store32((iter_base) + 12, (payload101).length()) + mbt_ffi_store32((iter_base) + 8, address103) + cleanup_list.push(address103) + + () + } + Range(payload105) => { + mbt_ffi_store8((iter_base) + 0, (40)) + + let ptr106 = mbt_ffi_str2ptr((payload105).name) + mbt_ffi_store32((iter_base) + 12, (payload105).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr106) + + match ((payload105).value).start { + Included(payload107) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let LazyDbValue(handle108) = payload107 + mbt_ffi_store32((iter_base) + 20, handle108) + + () + } + Excluded(payload109) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let LazyDbValue(handle110) = payload109 + mbt_ffi_store32((iter_base) + 20, handle110) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 16, (2)) + + () + } + } + + match ((payload105).value).end { + Included(payload112) => { + mbt_ffi_store8((iter_base) + 24, (0)) + + let LazyDbValue(handle113) = payload112 + mbt_ffi_store32((iter_base) + 28, handle113) + + () + } + Excluded(payload114) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let LazyDbValue(handle115) = payload114 + mbt_ffi_store32((iter_base) + 28, handle115) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 24, (2)) + + () + } + } + cleanup_list.push(ptr106) + + () + } + Null => { + mbt_ffi_store8((iter_base) + 0, (41)) + + () + } + Vector(payload118) => { + mbt_ffi_store8((iter_base) + 0, (42)) + + let ptr119 = mbt_ffi_float_array2ptr(payload118) + + mbt_ffi_store32((iter_base) + 12, payload118.length()) + mbt_ffi_store32((iter_base) + 8, ptr119) + cleanup_list.push(ptr119) + + () + } + Halfvec(payload120) => { + mbt_ffi_store8((iter_base) + 0, (43)) + + let ptr121 = mbt_ffi_float_array2ptr(payload120) + + mbt_ffi_store32((iter_base) + 12, payload120.length()) + mbt_ffi_store32((iter_base) + 8, ptr121) + cleanup_list.push(ptr121) + + () + } + Sparsevec(payload122) => { + mbt_ffi_store8((iter_base) + 0, (44)) + mbt_ffi_store32((iter_base) + 8, (payload122).dim) + + let ptr123 = mbt_ffi_int_array2ptr((payload122).indices) + + mbt_ffi_store32((iter_base) + 16, (payload122).indices.length()) + mbt_ffi_store32((iter_base) + 12, ptr123) + + let ptr124 = mbt_ffi_float_array2ptr((payload122).values) + + mbt_ffi_store32((iter_base) + 24, (payload122).values.length()) + mbt_ffi_store32((iter_base) + 20, ptr124) + cleanup_list.push(ptr123) + cleanup_list.push(ptr124) + + () + } + } + } - Int8range(payload49) => { - mbt_ffi_store8(iter_base + 0, 29) - - match payload49.start { - Included(payload50) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store64(iter_base + 16, payload50) - - () - } - Excluded(payload51) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store64(iter_base + 16, payload51) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload49.end { - Included(payload53) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload53) - - () - } - Excluded(payload54) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload54) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 24, 2) - - () - } - } - - () + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbConnectionQueryStream(handle, ptr, statement.length(), address125, (params).length(), return_area); + + let lifted131 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(DbResultStream::DbResultStream(mbt_ffi_load32((return_area) + 4))) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result127 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result127) + } + 2 => { + + let result128 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result128) + } + 3 => { + + let result129 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result129) + } + 4 => { + + let result130 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result130) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } - Numrange(payload56) => { - mbt_ffi_store8(iter_base + 0, 30) - - match payload56.start { - Included(payload57) => { - mbt_ffi_store8(iter_base + 8, 0) - - let ptr58 = mbt_ffi_str2ptr(payload57) - mbt_ffi_store32(iter_base + 16, payload57.length()) - mbt_ffi_store32(iter_base + 12, ptr58) - cleanup_list.push(ptr58) - - () - } - Excluded(payload59) => { - mbt_ffi_store8(iter_base + 8, 1) - - let ptr60 = mbt_ffi_str2ptr(payload59) - mbt_ffi_store32(iter_base + 16, payload59.length()) - mbt_ffi_store32(iter_base + 12, ptr60) - cleanup_list.push(ptr60) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload56.end { - Included(payload62) => { - mbt_ffi_store8(iter_base + 20, 0) - - let ptr63 = mbt_ffi_str2ptr(payload62) - mbt_ffi_store32(iter_base + 28, payload62.length()) - mbt_ffi_store32(iter_base + 24, ptr63) - cleanup_list.push(ptr63) - - () - } - Excluded(payload64) => { - mbt_ffi_store8(iter_base + 20, 1) - - let ptr65 = mbt_ffi_str2ptr(payload64) - mbt_ffi_store32(iter_base + 28, payload64.length()) - mbt_ffi_store32(iter_base + 24, ptr65) - cleanup_list.push(ptr65) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 20, 2) - - () - } - } - - () + let ret = lifted131 + mbt_ffi_free(ptr) + mbt_ffi_free(address125) + mbt_ffi_free(return_area) + + cleanup_list.each(mbt_ffi_free) + return ret + +} +///| +pub fn DbConnection::execute(self : DbConnection, statement : String, params : Array[DbValue]) -> Result[UInt64, Error_] { + let cleanup_list : Array[Int] = [] + + let DbConnection(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address125 = mbt_ffi_malloc((params).length() * 56); + for index126 = 0; index126 < (params).length(); index126 = index126 + 1 { + let iter_elem : DbValue = (params)[(index126)] + let iter_base = address125 + (index126 * 56); + + match iter_elem { + Character(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload)) + + () + } + Int2(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload0)) + + () + } + Int4(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store32((iter_base) + 8, payload1) + + () + } + Int8(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store64((iter_base) + 8, payload2) + + () + } + Float4(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_storef32((iter_base) + 8, payload3) + + () + } + Float8(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_storef64((iter_base) + 8, payload4) + + () + } + Numeric(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + let ptr6 = mbt_ffi_str2ptr(payload5) + mbt_ffi_store32((iter_base) + 12, payload5.length()) + mbt_ffi_store32((iter_base) + 8, ptr6) + cleanup_list.push(ptr6) + + () + } + Boolean(payload7) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store8((iter_base) + 8, (if payload7 { 1 } else { 0 })) + + () + } + Text(payload8) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((iter_base) + 12, payload8.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + cleanup_list.push(ptr9) + + () + } + Varchar(payload10) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr11 = mbt_ffi_str2ptr(payload10) + mbt_ffi_store32((iter_base) + 12, payload10.length()) + mbt_ffi_store32((iter_base) + 8, ptr11) + cleanup_list.push(ptr11) + + () + } + Bpchar(payload12) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + let ptr13 = mbt_ffi_str2ptr(payload12) + mbt_ffi_store32((iter_base) + 12, payload12.length()) + mbt_ffi_store32((iter_base) + 8, ptr13) + cleanup_list.push(ptr13) + + () + } + Timestamp(payload14) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, ((payload14).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload14).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload14).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload14).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload14).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload14).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload14).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamptz(payload15) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store32((iter_base) + 8, (((payload15).timestamp).date).year) + mbt_ffi_store8((iter_base) + 12, ((((payload15).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((((payload15).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, ((((payload15).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload15).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, ((((payload15).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, ((((payload15).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 24, (payload15).offset) + + () + } + Date(payload16) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store32((iter_base) + 8, (payload16).year) + mbt_ffi_store8((iter_base) + 12, ((payload16).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload16).day).to_int()) + + () + } + Time(payload17) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store8((iter_base) + 8, ((payload17).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, ((payload17).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, ((payload17).second).to_int()) + mbt_ffi_store32((iter_base) + 12, ((payload17).nanosecond).reinterpret_as_int()) + + () + } + Timetz(payload18) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store8((iter_base) + 8, (((payload18).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, (((payload18).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, (((payload18).time).second).to_int()) + mbt_ffi_store32((iter_base) + 12, (((payload18).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 16, (payload18).offset) + + () + } + Interval(payload19) => { + mbt_ffi_store8((iter_base) + 0, (16)) + mbt_ffi_store32((iter_base) + 8, (payload19).months) + mbt_ffi_store32((iter_base) + 12, (payload19).days) + mbt_ffi_store64((iter_base) + 16, (payload19).microseconds) + + () + } + Bytea(payload20) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let ptr21 = mbt_ffi_bytes2ptr(payload20) + + mbt_ffi_store32((iter_base) + 12, payload20.length()) + mbt_ffi_store32((iter_base) + 8, ptr21) + cleanup_list.push(ptr21) + + () + } + Json(payload22) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let ptr23 = mbt_ffi_str2ptr(payload22) + mbt_ffi_store32((iter_base) + 12, payload22.length()) + mbt_ffi_store32((iter_base) + 8, ptr23) + cleanup_list.push(ptr23) + + () + } + Jsonb(payload24) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let ptr25 = mbt_ffi_str2ptr(payload24) + mbt_ffi_store32((iter_base) + 12, payload24.length()) + mbt_ffi_store32((iter_base) + 8, ptr25) + cleanup_list.push(ptr25) + + () + } + Jsonpath(payload26) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let ptr27 = mbt_ffi_str2ptr(payload26) + mbt_ffi_store32((iter_base) + 12, payload26.length()) + mbt_ffi_store32((iter_base) + 8, ptr27) + cleanup_list.push(ptr27) + + () + } + Xml(payload28) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + let ptr29 = mbt_ffi_str2ptr(payload28) + mbt_ffi_store32((iter_base) + 12, payload28.length()) + mbt_ffi_store32((iter_base) + 8, ptr29) + cleanup_list.push(ptr29) + + () + } + Uuid(payload30) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store64((iter_base) + 8, ((payload30).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload30).low_bits).reinterpret_as_int64()) + + () + } + Inet(payload31) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match payload31 { + Ipv4(payload32) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store8((iter_base) + 10, ((payload32).0).to_int()) + mbt_ffi_store8((iter_base) + 11, ((payload32).1).to_int()) + mbt_ffi_store8((iter_base) + 12, ((payload32).2).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload32).3).to_int()) + + () + } + Ipv6(payload33) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store16((iter_base) + 10, ((payload33).0).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 12, ((payload33).1).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 14, ((payload33).2).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 16, ((payload33).3).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 18, ((payload33).4).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 20, ((payload33).5).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 22, ((payload33).6).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 24, ((payload33).7).reinterpret_as_int()) + + () + } + } + + () + } + Cidr(payload34) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match payload34 { + Ipv4(payload35) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store8((iter_base) + 10, ((payload35).0).to_int()) + mbt_ffi_store8((iter_base) + 11, ((payload35).1).to_int()) + mbt_ffi_store8((iter_base) + 12, ((payload35).2).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload35).3).to_int()) + + () + } + Ipv6(payload36) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store16((iter_base) + 10, ((payload36).0).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 12, ((payload36).1).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 14, ((payload36).2).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 16, ((payload36).3).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 18, ((payload36).4).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 20, ((payload36).5).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 22, ((payload36).6).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 24, ((payload36).7).reinterpret_as_int()) + + () + } + } + + () + } + Macaddr(payload37) => { + mbt_ffi_store8((iter_base) + 0, (25)) + mbt_ffi_store8((iter_base) + 8, (((payload37).octets).0).to_int()) + mbt_ffi_store8((iter_base) + 9, (((payload37).octets).1).to_int()) + mbt_ffi_store8((iter_base) + 10, (((payload37).octets).2).to_int()) + mbt_ffi_store8((iter_base) + 11, (((payload37).octets).3).to_int()) + mbt_ffi_store8((iter_base) + 12, (((payload37).octets).4).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload37).octets).5).to_int()) + + () + } + Bit(payload38) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let address = mbt_ffi_malloc((payload38).length() * 1); + for index = 0; index < (payload38).length(); index = index + 1 { + let iter_elem : Bool = (payload38)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload38).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + Varbit(payload39) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + let address40 = mbt_ffi_malloc((payload39).length() * 1); + for index41 = 0; index41 < (payload39).length(); index41 = index41 + 1 { + let iter_elem : Bool = (payload39)[(index41)] + let iter_base = address40 + (index41 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload39).length()) + mbt_ffi_store32((iter_base) + 8, address40) + cleanup_list.push(address40) + + () + } + Int4range(payload42) => { + mbt_ffi_store8((iter_base) + 0, (28)) + + match (payload42).start { + Included(payload43) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, payload43) + + () + } + Excluded(payload44) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload44) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload42).end { + Included(payload46) => { + mbt_ffi_store8((iter_base) + 16, (0)) + mbt_ffi_store32((iter_base) + 20, payload46) + + () + } + Excluded(payload47) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload47) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 16, (2)) + + () + } + } + + () + } + Int8range(payload49) => { + mbt_ffi_store8((iter_base) + 0, (29)) + + match (payload49).start { + Included(payload50) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store64((iter_base) + 16, payload50) + + () + } + Excluded(payload51) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store64((iter_base) + 16, payload51) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload49).end { + Included(payload53) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload53) + + () + } + Excluded(payload54) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, payload54) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 24, (2)) + + () + } + } + + () + } + Numrange(payload56) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + match (payload56).start { + Included(payload57) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + let ptr58 = mbt_ffi_str2ptr(payload57) + mbt_ffi_store32((iter_base) + 16, payload57.length()) + mbt_ffi_store32((iter_base) + 12, ptr58) + cleanup_list.push(ptr58) + + () + } + Excluded(payload59) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr60 = mbt_ffi_str2ptr(payload59) + mbt_ffi_store32((iter_base) + 16, payload59.length()) + mbt_ffi_store32((iter_base) + 12, ptr60) + cleanup_list.push(ptr60) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload56).end { + Included(payload62) => { + mbt_ffi_store8((iter_base) + 20, (0)) + + let ptr63 = mbt_ffi_str2ptr(payload62) + mbt_ffi_store32((iter_base) + 28, payload62.length()) + mbt_ffi_store32((iter_base) + 24, ptr63) + cleanup_list.push(ptr63) + + () + } + Excluded(payload64) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let ptr65 = mbt_ffi_str2ptr(payload64) + mbt_ffi_store32((iter_base) + 28, payload64.length()) + mbt_ffi_store32((iter_base) + 24, ptr65) + cleanup_list.push(ptr65) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 20, (2)) + + () + } + } + + () + } + Tsrange(payload67) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + match (payload67).start { + Included(payload68) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, ((payload68).date).year) + mbt_ffi_store8((iter_base) + 16, (((payload68).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload68).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, (((payload68).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, (((payload68).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, (((payload68).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, (((payload68).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload69) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, ((payload69).date).year) + mbt_ffi_store8((iter_base) + 16, (((payload69).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload69).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, (((payload69).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, (((payload69).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, (((payload69).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, (((payload69).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload67).end { + Included(payload71) => { + mbt_ffi_store8((iter_base) + 28, (0)) + mbt_ffi_store32((iter_base) + 32, ((payload71).date).year) + mbt_ffi_store8((iter_base) + 36, (((payload71).date).month).to_int()) + mbt_ffi_store8((iter_base) + 37, (((payload71).date).day).to_int()) + mbt_ffi_store8((iter_base) + 40, (((payload71).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 41, (((payload71).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 42, (((payload71).time).second).to_int()) + mbt_ffi_store32((iter_base) + 44, (((payload71).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload72) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, ((payload72).date).year) + mbt_ffi_store8((iter_base) + 36, (((payload72).date).month).to_int()) + mbt_ffi_store8((iter_base) + 37, (((payload72).date).day).to_int()) + mbt_ffi_store8((iter_base) + 40, (((payload72).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 41, (((payload72).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 42, (((payload72).time).second).to_int()) + mbt_ffi_store32((iter_base) + 44, (((payload72).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 28, (2)) + + () + } + } + + () + } + Tstzrange(payload74) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + match (payload74).start { + Included(payload75) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, (((payload75).timestamp).date).year) + mbt_ffi_store8((iter_base) + 16, ((((payload75).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload75).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, ((((payload75).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, ((((payload75).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, ((((payload75).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, ((((payload75).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 28, (payload75).offset) + + () + } + Excluded(payload76) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, (((payload76).timestamp).date).year) + mbt_ffi_store8((iter_base) + 16, ((((payload76).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload76).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, ((((payload76).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, ((((payload76).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, ((((payload76).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, ((((payload76).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 28, (payload76).offset) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload74).end { + Included(payload78) => { + mbt_ffi_store8((iter_base) + 32, (0)) + mbt_ffi_store32((iter_base) + 36, (((payload78).timestamp).date).year) + mbt_ffi_store8((iter_base) + 40, ((((payload78).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 41, ((((payload78).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 44, ((((payload78).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 45, ((((payload78).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 46, ((((payload78).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 48, ((((payload78).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 52, (payload78).offset) + + () + } + Excluded(payload79) => { + mbt_ffi_store8((iter_base) + 32, (1)) + mbt_ffi_store32((iter_base) + 36, (((payload79).timestamp).date).year) + mbt_ffi_store8((iter_base) + 40, ((((payload79).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 41, ((((payload79).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 44, ((((payload79).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 45, ((((payload79).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 46, ((((payload79).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 48, ((((payload79).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 52, (payload79).offset) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 32, (2)) + + () + } + } + + () + } + Daterange(payload81) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + match (payload81).start { + Included(payload82) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, (payload82).year) + mbt_ffi_store8((iter_base) + 16, ((payload82).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((payload82).day).to_int()) + + () + } + Excluded(payload83) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, (payload83).year) + mbt_ffi_store8((iter_base) + 16, ((payload83).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((payload83).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload81).end { + Included(payload85) => { + mbt_ffi_store8((iter_base) + 20, (0)) + mbt_ffi_store32((iter_base) + 24, (payload85).year) + mbt_ffi_store8((iter_base) + 28, ((payload85).month).to_int()) + mbt_ffi_store8((iter_base) + 29, ((payload85).day).to_int()) + + () + } + Excluded(payload86) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload86).year) + mbt_ffi_store8((iter_base) + 28, ((payload86).month).to_int()) + mbt_ffi_store8((iter_base) + 29, ((payload86).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 20, (2)) + + () + } + } + + () + } + Money(payload88) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store64((iter_base) + 8, payload88) + + () + } + Oid(payload89) => { + mbt_ffi_store8((iter_base) + 0, (35)) + mbt_ffi_store32((iter_base) + 8, (payload89).reinterpret_as_int()) + + () + } + Enumeration(payload90) => { + mbt_ffi_store8((iter_base) + 0, (36)) + + let ptr91 = mbt_ffi_str2ptr((payload90).name) + mbt_ffi_store32((iter_base) + 12, (payload90).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr91) + + let ptr92 = mbt_ffi_str2ptr((payload90).value) + mbt_ffi_store32((iter_base) + 20, (payload90).value.length()) + mbt_ffi_store32((iter_base) + 16, ptr92) + cleanup_list.push(ptr91) + cleanup_list.push(ptr92) + + () + } + Composite(payload93) => { + mbt_ffi_store8((iter_base) + 0, (37)) + + let ptr94 = mbt_ffi_str2ptr((payload93).name) + mbt_ffi_store32((iter_base) + 12, (payload93).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr94) + + let address96 = mbt_ffi_malloc(((payload93).values).length() * 4); + for index97 = 0; index97 < ((payload93).values).length(); index97 = index97 + 1 { + let iter_elem : LazyDbValue = ((payload93).values)[(index97)] + let iter_base = address96 + (index97 * 4); + + let LazyDbValue(handle95) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle95) + + } + mbt_ffi_store32((iter_base) + 20, ((payload93).values).length()) + mbt_ffi_store32((iter_base) + 16, address96) + cleanup_list.push(ptr94) + cleanup_list.push(address96) + + () + } + Domain(payload98) => { + mbt_ffi_store8((iter_base) + 0, (38)) + + let ptr99 = mbt_ffi_str2ptr((payload98).name) + mbt_ffi_store32((iter_base) + 12, (payload98).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr99) + + let LazyDbValue(handle100) = (payload98).value + mbt_ffi_store32((iter_base) + 16, handle100) + cleanup_list.push(ptr99) + + () + } + Array(payload101) => { + mbt_ffi_store8((iter_base) + 0, (39)) + + let address103 = mbt_ffi_malloc((payload101).length() * 4); + for index104 = 0; index104 < (payload101).length(); index104 = index104 + 1 { + let iter_elem : LazyDbValue = (payload101)[(index104)] + let iter_base = address103 + (index104 * 4); + + let LazyDbValue(handle102) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle102) + + } + mbt_ffi_store32((iter_base) + 12, (payload101).length()) + mbt_ffi_store32((iter_base) + 8, address103) + cleanup_list.push(address103) + + () + } + Range(payload105) => { + mbt_ffi_store8((iter_base) + 0, (40)) + + let ptr106 = mbt_ffi_str2ptr((payload105).name) + mbt_ffi_store32((iter_base) + 12, (payload105).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr106) + + match ((payload105).value).start { + Included(payload107) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let LazyDbValue(handle108) = payload107 + mbt_ffi_store32((iter_base) + 20, handle108) + + () + } + Excluded(payload109) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let LazyDbValue(handle110) = payload109 + mbt_ffi_store32((iter_base) + 20, handle110) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 16, (2)) + + () + } + } + + match ((payload105).value).end { + Included(payload112) => { + mbt_ffi_store8((iter_base) + 24, (0)) + + let LazyDbValue(handle113) = payload112 + mbt_ffi_store32((iter_base) + 28, handle113) + + () + } + Excluded(payload114) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let LazyDbValue(handle115) = payload114 + mbt_ffi_store32((iter_base) + 28, handle115) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 24, (2)) + + () + } + } + cleanup_list.push(ptr106) + + () + } + Null => { + mbt_ffi_store8((iter_base) + 0, (41)) + + () + } + Vector(payload118) => { + mbt_ffi_store8((iter_base) + 0, (42)) + + let ptr119 = mbt_ffi_float_array2ptr(payload118) + + mbt_ffi_store32((iter_base) + 12, payload118.length()) + mbt_ffi_store32((iter_base) + 8, ptr119) + cleanup_list.push(ptr119) + + () + } + Halfvec(payload120) => { + mbt_ffi_store8((iter_base) + 0, (43)) + + let ptr121 = mbt_ffi_float_array2ptr(payload120) + + mbt_ffi_store32((iter_base) + 12, payload120.length()) + mbt_ffi_store32((iter_base) + 8, ptr121) + cleanup_list.push(ptr121) + + () + } + Sparsevec(payload122) => { + mbt_ffi_store8((iter_base) + 0, (44)) + mbt_ffi_store32((iter_base) + 8, (payload122).dim) + + let ptr123 = mbt_ffi_int_array2ptr((payload122).indices) + + mbt_ffi_store32((iter_base) + 16, (payload122).indices.length()) + mbt_ffi_store32((iter_base) + 12, ptr123) + + let ptr124 = mbt_ffi_float_array2ptr((payload122).values) + + mbt_ffi_store32((iter_base) + 24, (payload122).values.length()) + mbt_ffi_store32((iter_base) + 20, ptr124) + cleanup_list.push(ptr123) + cleanup_list.push(ptr124) + + () + } + } + } - Tsrange(payload67) => { - mbt_ffi_store8(iter_base + 0, 31) - - match payload67.start { - Included(payload68) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload68.date.year) - mbt_ffi_store8(iter_base + 16, payload68.date.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload68.date.day.to_int()) - mbt_ffi_store8(iter_base + 20, payload68.time.hour.to_int()) - mbt_ffi_store8(iter_base + 21, payload68.time.minute.to_int()) - mbt_ffi_store8(iter_base + 22, payload68.time.second.to_int()) - mbt_ffi_store32( - iter_base + 24, - payload68.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload69) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload69.date.year) - mbt_ffi_store8(iter_base + 16, payload69.date.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload69.date.day.to_int()) - mbt_ffi_store8(iter_base + 20, payload69.time.hour.to_int()) - mbt_ffi_store8(iter_base + 21, payload69.time.minute.to_int()) - mbt_ffi_store8(iter_base + 22, payload69.time.second.to_int()) - mbt_ffi_store32( - iter_base + 24, - payload69.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload67.end { - Included(payload71) => { - mbt_ffi_store8(iter_base + 28, 0) - mbt_ffi_store32(iter_base + 32, payload71.date.year) - mbt_ffi_store8(iter_base + 36, payload71.date.month.to_int()) - mbt_ffi_store8(iter_base + 37, payload71.date.day.to_int()) - mbt_ffi_store8(iter_base + 40, payload71.time.hour.to_int()) - mbt_ffi_store8(iter_base + 41, payload71.time.minute.to_int()) - mbt_ffi_store8(iter_base + 42, payload71.time.second.to_int()) - mbt_ffi_store32( - iter_base + 44, - payload71.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload72) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload72.date.year) - mbt_ffi_store8(iter_base + 36, payload72.date.month.to_int()) - mbt_ffi_store8(iter_base + 37, payload72.date.day.to_int()) - mbt_ffi_store8(iter_base + 40, payload72.time.hour.to_int()) - mbt_ffi_store8(iter_base + 41, payload72.time.minute.to_int()) - mbt_ffi_store8(iter_base + 42, payload72.time.second.to_int()) - mbt_ffi_store32( - iter_base + 44, - payload72.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 28, 2) - - () - } - } - - () + let return_area = mbt_ffi_malloc(24) + wasmImportMethodDbConnectionExecute(handle, ptr, statement.length(), address125, (params).length(), return_area); + + let lifted131 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result127 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::QueryParameterFailure(result127) + } + 2 => { + + let result128 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::QueryExecutionFailure(result128) + } + 3 => { + + let result129 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::QueryResponseFailure(result129) + } + 4 => { + + let result130 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Error_::Other(result130) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } - Tstzrange(payload74) => { - mbt_ffi_store8(iter_base + 0, 32) - - match payload74.start { - Included(payload75) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload75.timestamp.date.year) - mbt_ffi_store8( - iter_base + 16, - payload75.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 17, - payload75.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 20, - payload75.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 21, - payload75.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 22, - payload75.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 24, - payload75.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 28, payload75.offset) - - () - } - Excluded(payload76) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload76.timestamp.date.year) - mbt_ffi_store8( - iter_base + 16, - payload76.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 17, - payload76.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 20, - payload76.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 21, - payload76.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 22, - payload76.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 24, - payload76.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 28, payload76.offset) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload74.end { - Included(payload78) => { - mbt_ffi_store8(iter_base + 32, 0) - mbt_ffi_store32(iter_base + 36, payload78.timestamp.date.year) - mbt_ffi_store8( - iter_base + 40, - payload78.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 41, - payload78.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 44, - payload78.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 45, - payload78.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 46, - payload78.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 48, - payload78.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 52, payload78.offset) - - () - } - Excluded(payload79) => { - mbt_ffi_store8(iter_base + 32, 1) - mbt_ffi_store32(iter_base + 36, payload79.timestamp.date.year) - mbt_ffi_store8( - iter_base + 40, - payload79.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 41, - payload79.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 44, - payload79.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 45, - payload79.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 46, - payload79.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 48, - payload79.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 52, payload79.offset) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 32, 2) - - () - } - } - - () + let ret = lifted131 + mbt_ffi_free(ptr) + mbt_ffi_free(address125) + mbt_ffi_free(return_area) + + cleanup_list.each(mbt_ffi_free) + return ret + +} +///| +pub fn DbConnection::begin_transaction(self : DbConnection) -> Result[DbTransaction, Error_] { + + let DbConnection(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbConnectionBeginTransaction(handle, return_area); + + let lifted4 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(DbTransaction::DbTransaction(mbt_ffi_load32((return_area) + 4))) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result0) + } + 2 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result1) + } + 3 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result2) + } + 4 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result3) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } - Daterange(payload81) => { - mbt_ffi_store8(iter_base + 0, 33) - - match payload81.start { - Included(payload82) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload82.year) - mbt_ffi_store8(iter_base + 16, payload82.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload82.day.to_int()) - - () - } - Excluded(payload83) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload83.year) - mbt_ffi_store8(iter_base + 16, payload83.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload83.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload81.end { - Included(payload85) => { - mbt_ffi_store8(iter_base + 20, 0) - mbt_ffi_store32(iter_base + 24, payload85.year) - mbt_ffi_store8(iter_base + 28, payload85.month.to_int()) - mbt_ffi_store8(iter_base + 29, payload85.day.to_int()) - - () - } - Excluded(payload86) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload86.year) - mbt_ffi_store8(iter_base + 28, payload86.month.to_int()) - mbt_ffi_store8(iter_base + 29, payload86.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 20, 2) - - () - } - } - - () + let ret = lifted4 + mbt_ffi_free(return_area) + return ret + +} +///| +pub fn DbTransaction::query(self : DbTransaction, statement : String, params : Array[DbValue]) -> Result[DbResult, Error_] { + let cleanup_list : Array[Int] = [] + + let DbTransaction(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address125 = mbt_ffi_malloc((params).length() * 56); + for index126 = 0; index126 < (params).length(); index126 = index126 + 1 { + let iter_elem : DbValue = (params)[(index126)] + let iter_base = address125 + (index126 * 56); + + match iter_elem { + Character(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload)) + + () + } + Int2(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload0)) + + () + } + Int4(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store32((iter_base) + 8, payload1) + + () + } + Int8(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store64((iter_base) + 8, payload2) + + () + } + Float4(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_storef32((iter_base) + 8, payload3) + + () + } + Float8(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_storef64((iter_base) + 8, payload4) + + () + } + Numeric(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + let ptr6 = mbt_ffi_str2ptr(payload5) + mbt_ffi_store32((iter_base) + 12, payload5.length()) + mbt_ffi_store32((iter_base) + 8, ptr6) + cleanup_list.push(ptr6) + + () + } + Boolean(payload7) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store8((iter_base) + 8, (if payload7 { 1 } else { 0 })) + + () + } + Text(payload8) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((iter_base) + 12, payload8.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + cleanup_list.push(ptr9) + + () + } + Varchar(payload10) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr11 = mbt_ffi_str2ptr(payload10) + mbt_ffi_store32((iter_base) + 12, payload10.length()) + mbt_ffi_store32((iter_base) + 8, ptr11) + cleanup_list.push(ptr11) + + () + } + Bpchar(payload12) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + let ptr13 = mbt_ffi_str2ptr(payload12) + mbt_ffi_store32((iter_base) + 12, payload12.length()) + mbt_ffi_store32((iter_base) + 8, ptr13) + cleanup_list.push(ptr13) + + () + } + Timestamp(payload14) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, ((payload14).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload14).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload14).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload14).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload14).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload14).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload14).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamptz(payload15) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store32((iter_base) + 8, (((payload15).timestamp).date).year) + mbt_ffi_store8((iter_base) + 12, ((((payload15).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((((payload15).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, ((((payload15).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload15).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, ((((payload15).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, ((((payload15).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 24, (payload15).offset) + + () + } + Date(payload16) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store32((iter_base) + 8, (payload16).year) + mbt_ffi_store8((iter_base) + 12, ((payload16).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload16).day).to_int()) + + () + } + Time(payload17) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store8((iter_base) + 8, ((payload17).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, ((payload17).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, ((payload17).second).to_int()) + mbt_ffi_store32((iter_base) + 12, ((payload17).nanosecond).reinterpret_as_int()) + + () + } + Timetz(payload18) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store8((iter_base) + 8, (((payload18).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, (((payload18).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, (((payload18).time).second).to_int()) + mbt_ffi_store32((iter_base) + 12, (((payload18).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 16, (payload18).offset) + + () + } + Interval(payload19) => { + mbt_ffi_store8((iter_base) + 0, (16)) + mbt_ffi_store32((iter_base) + 8, (payload19).months) + mbt_ffi_store32((iter_base) + 12, (payload19).days) + mbt_ffi_store64((iter_base) + 16, (payload19).microseconds) + + () + } + Bytea(payload20) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let ptr21 = mbt_ffi_bytes2ptr(payload20) + + mbt_ffi_store32((iter_base) + 12, payload20.length()) + mbt_ffi_store32((iter_base) + 8, ptr21) + cleanup_list.push(ptr21) + + () + } + Json(payload22) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let ptr23 = mbt_ffi_str2ptr(payload22) + mbt_ffi_store32((iter_base) + 12, payload22.length()) + mbt_ffi_store32((iter_base) + 8, ptr23) + cleanup_list.push(ptr23) + + () + } + Jsonb(payload24) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let ptr25 = mbt_ffi_str2ptr(payload24) + mbt_ffi_store32((iter_base) + 12, payload24.length()) + mbt_ffi_store32((iter_base) + 8, ptr25) + cleanup_list.push(ptr25) + + () + } + Jsonpath(payload26) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let ptr27 = mbt_ffi_str2ptr(payload26) + mbt_ffi_store32((iter_base) + 12, payload26.length()) + mbt_ffi_store32((iter_base) + 8, ptr27) + cleanup_list.push(ptr27) + + () + } + Xml(payload28) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + let ptr29 = mbt_ffi_str2ptr(payload28) + mbt_ffi_store32((iter_base) + 12, payload28.length()) + mbt_ffi_store32((iter_base) + 8, ptr29) + cleanup_list.push(ptr29) + + () + } + Uuid(payload30) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store64((iter_base) + 8, ((payload30).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload30).low_bits).reinterpret_as_int64()) + + () + } + Inet(payload31) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match payload31 { + Ipv4(payload32) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store8((iter_base) + 10, ((payload32).0).to_int()) + mbt_ffi_store8((iter_base) + 11, ((payload32).1).to_int()) + mbt_ffi_store8((iter_base) + 12, ((payload32).2).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload32).3).to_int()) + + () + } + Ipv6(payload33) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store16((iter_base) + 10, ((payload33).0).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 12, ((payload33).1).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 14, ((payload33).2).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 16, ((payload33).3).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 18, ((payload33).4).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 20, ((payload33).5).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 22, ((payload33).6).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 24, ((payload33).7).reinterpret_as_int()) + + () + } + } + + () + } + Cidr(payload34) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match payload34 { + Ipv4(payload35) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store8((iter_base) + 10, ((payload35).0).to_int()) + mbt_ffi_store8((iter_base) + 11, ((payload35).1).to_int()) + mbt_ffi_store8((iter_base) + 12, ((payload35).2).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload35).3).to_int()) + + () + } + Ipv6(payload36) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store16((iter_base) + 10, ((payload36).0).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 12, ((payload36).1).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 14, ((payload36).2).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 16, ((payload36).3).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 18, ((payload36).4).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 20, ((payload36).5).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 22, ((payload36).6).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 24, ((payload36).7).reinterpret_as_int()) + + () + } + } + + () + } + Macaddr(payload37) => { + mbt_ffi_store8((iter_base) + 0, (25)) + mbt_ffi_store8((iter_base) + 8, (((payload37).octets).0).to_int()) + mbt_ffi_store8((iter_base) + 9, (((payload37).octets).1).to_int()) + mbt_ffi_store8((iter_base) + 10, (((payload37).octets).2).to_int()) + mbt_ffi_store8((iter_base) + 11, (((payload37).octets).3).to_int()) + mbt_ffi_store8((iter_base) + 12, (((payload37).octets).4).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload37).octets).5).to_int()) + + () + } + Bit(payload38) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let address = mbt_ffi_malloc((payload38).length() * 1); + for index = 0; index < (payload38).length(); index = index + 1 { + let iter_elem : Bool = (payload38)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload38).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + Varbit(payload39) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + let address40 = mbt_ffi_malloc((payload39).length() * 1); + for index41 = 0; index41 < (payload39).length(); index41 = index41 + 1 { + let iter_elem : Bool = (payload39)[(index41)] + let iter_base = address40 + (index41 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload39).length()) + mbt_ffi_store32((iter_base) + 8, address40) + cleanup_list.push(address40) + + () + } + Int4range(payload42) => { + mbt_ffi_store8((iter_base) + 0, (28)) + + match (payload42).start { + Included(payload43) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, payload43) + + () + } + Excluded(payload44) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload44) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload42).end { + Included(payload46) => { + mbt_ffi_store8((iter_base) + 16, (0)) + mbt_ffi_store32((iter_base) + 20, payload46) + + () + } + Excluded(payload47) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload47) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 16, (2)) + + () + } + } + + () + } + Int8range(payload49) => { + mbt_ffi_store8((iter_base) + 0, (29)) + + match (payload49).start { + Included(payload50) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store64((iter_base) + 16, payload50) + + () + } + Excluded(payload51) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store64((iter_base) + 16, payload51) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload49).end { + Included(payload53) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload53) + + () + } + Excluded(payload54) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, payload54) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 24, (2)) + + () + } + } + + () + } + Numrange(payload56) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + match (payload56).start { + Included(payload57) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + let ptr58 = mbt_ffi_str2ptr(payload57) + mbt_ffi_store32((iter_base) + 16, payload57.length()) + mbt_ffi_store32((iter_base) + 12, ptr58) + cleanup_list.push(ptr58) + + () + } + Excluded(payload59) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr60 = mbt_ffi_str2ptr(payload59) + mbt_ffi_store32((iter_base) + 16, payload59.length()) + mbt_ffi_store32((iter_base) + 12, ptr60) + cleanup_list.push(ptr60) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload56).end { + Included(payload62) => { + mbt_ffi_store8((iter_base) + 20, (0)) + + let ptr63 = mbt_ffi_str2ptr(payload62) + mbt_ffi_store32((iter_base) + 28, payload62.length()) + mbt_ffi_store32((iter_base) + 24, ptr63) + cleanup_list.push(ptr63) + + () + } + Excluded(payload64) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let ptr65 = mbt_ffi_str2ptr(payload64) + mbt_ffi_store32((iter_base) + 28, payload64.length()) + mbt_ffi_store32((iter_base) + 24, ptr65) + cleanup_list.push(ptr65) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 20, (2)) + + () + } + } + + () + } + Tsrange(payload67) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + match (payload67).start { + Included(payload68) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, ((payload68).date).year) + mbt_ffi_store8((iter_base) + 16, (((payload68).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload68).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, (((payload68).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, (((payload68).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, (((payload68).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, (((payload68).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload69) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, ((payload69).date).year) + mbt_ffi_store8((iter_base) + 16, (((payload69).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload69).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, (((payload69).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, (((payload69).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, (((payload69).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, (((payload69).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload67).end { + Included(payload71) => { + mbt_ffi_store8((iter_base) + 28, (0)) + mbt_ffi_store32((iter_base) + 32, ((payload71).date).year) + mbt_ffi_store8((iter_base) + 36, (((payload71).date).month).to_int()) + mbt_ffi_store8((iter_base) + 37, (((payload71).date).day).to_int()) + mbt_ffi_store8((iter_base) + 40, (((payload71).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 41, (((payload71).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 42, (((payload71).time).second).to_int()) + mbt_ffi_store32((iter_base) + 44, (((payload71).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload72) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, ((payload72).date).year) + mbt_ffi_store8((iter_base) + 36, (((payload72).date).month).to_int()) + mbt_ffi_store8((iter_base) + 37, (((payload72).date).day).to_int()) + mbt_ffi_store8((iter_base) + 40, (((payload72).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 41, (((payload72).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 42, (((payload72).time).second).to_int()) + mbt_ffi_store32((iter_base) + 44, (((payload72).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 28, (2)) + + () + } + } + + () + } + Tstzrange(payload74) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + match (payload74).start { + Included(payload75) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, (((payload75).timestamp).date).year) + mbt_ffi_store8((iter_base) + 16, ((((payload75).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload75).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, ((((payload75).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, ((((payload75).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, ((((payload75).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, ((((payload75).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 28, (payload75).offset) + + () + } + Excluded(payload76) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, (((payload76).timestamp).date).year) + mbt_ffi_store8((iter_base) + 16, ((((payload76).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload76).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, ((((payload76).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, ((((payload76).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, ((((payload76).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, ((((payload76).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 28, (payload76).offset) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload74).end { + Included(payload78) => { + mbt_ffi_store8((iter_base) + 32, (0)) + mbt_ffi_store32((iter_base) + 36, (((payload78).timestamp).date).year) + mbt_ffi_store8((iter_base) + 40, ((((payload78).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 41, ((((payload78).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 44, ((((payload78).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 45, ((((payload78).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 46, ((((payload78).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 48, ((((payload78).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 52, (payload78).offset) + + () + } + Excluded(payload79) => { + mbt_ffi_store8((iter_base) + 32, (1)) + mbt_ffi_store32((iter_base) + 36, (((payload79).timestamp).date).year) + mbt_ffi_store8((iter_base) + 40, ((((payload79).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 41, ((((payload79).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 44, ((((payload79).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 45, ((((payload79).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 46, ((((payload79).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 48, ((((payload79).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 52, (payload79).offset) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 32, (2)) + + () + } + } + + () + } + Daterange(payload81) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + match (payload81).start { + Included(payload82) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, (payload82).year) + mbt_ffi_store8((iter_base) + 16, ((payload82).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((payload82).day).to_int()) + + () + } + Excluded(payload83) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, (payload83).year) + mbt_ffi_store8((iter_base) + 16, ((payload83).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((payload83).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload81).end { + Included(payload85) => { + mbt_ffi_store8((iter_base) + 20, (0)) + mbt_ffi_store32((iter_base) + 24, (payload85).year) + mbt_ffi_store8((iter_base) + 28, ((payload85).month).to_int()) + mbt_ffi_store8((iter_base) + 29, ((payload85).day).to_int()) + + () + } + Excluded(payload86) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload86).year) + mbt_ffi_store8((iter_base) + 28, ((payload86).month).to_int()) + mbt_ffi_store8((iter_base) + 29, ((payload86).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 20, (2)) + + () + } + } + + () + } + Money(payload88) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store64((iter_base) + 8, payload88) + + () + } + Oid(payload89) => { + mbt_ffi_store8((iter_base) + 0, (35)) + mbt_ffi_store32((iter_base) + 8, (payload89).reinterpret_as_int()) + + () + } + Enumeration(payload90) => { + mbt_ffi_store8((iter_base) + 0, (36)) + + let ptr91 = mbt_ffi_str2ptr((payload90).name) + mbt_ffi_store32((iter_base) + 12, (payload90).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr91) + + let ptr92 = mbt_ffi_str2ptr((payload90).value) + mbt_ffi_store32((iter_base) + 20, (payload90).value.length()) + mbt_ffi_store32((iter_base) + 16, ptr92) + cleanup_list.push(ptr91) + cleanup_list.push(ptr92) + + () + } + Composite(payload93) => { + mbt_ffi_store8((iter_base) + 0, (37)) + + let ptr94 = mbt_ffi_str2ptr((payload93).name) + mbt_ffi_store32((iter_base) + 12, (payload93).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr94) + + let address96 = mbt_ffi_malloc(((payload93).values).length() * 4); + for index97 = 0; index97 < ((payload93).values).length(); index97 = index97 + 1 { + let iter_elem : LazyDbValue = ((payload93).values)[(index97)] + let iter_base = address96 + (index97 * 4); + + let LazyDbValue(handle95) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle95) + + } + mbt_ffi_store32((iter_base) + 20, ((payload93).values).length()) + mbt_ffi_store32((iter_base) + 16, address96) + cleanup_list.push(ptr94) + cleanup_list.push(address96) + + () + } + Domain(payload98) => { + mbt_ffi_store8((iter_base) + 0, (38)) + + let ptr99 = mbt_ffi_str2ptr((payload98).name) + mbt_ffi_store32((iter_base) + 12, (payload98).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr99) + + let LazyDbValue(handle100) = (payload98).value + mbt_ffi_store32((iter_base) + 16, handle100) + cleanup_list.push(ptr99) + + () + } + Array(payload101) => { + mbt_ffi_store8((iter_base) + 0, (39)) + + let address103 = mbt_ffi_malloc((payload101).length() * 4); + for index104 = 0; index104 < (payload101).length(); index104 = index104 + 1 { + let iter_elem : LazyDbValue = (payload101)[(index104)] + let iter_base = address103 + (index104 * 4); + + let LazyDbValue(handle102) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle102) + + } + mbt_ffi_store32((iter_base) + 12, (payload101).length()) + mbt_ffi_store32((iter_base) + 8, address103) + cleanup_list.push(address103) + + () + } + Range(payload105) => { + mbt_ffi_store8((iter_base) + 0, (40)) + + let ptr106 = mbt_ffi_str2ptr((payload105).name) + mbt_ffi_store32((iter_base) + 12, (payload105).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr106) + + match ((payload105).value).start { + Included(payload107) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let LazyDbValue(handle108) = payload107 + mbt_ffi_store32((iter_base) + 20, handle108) + + () + } + Excluded(payload109) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let LazyDbValue(handle110) = payload109 + mbt_ffi_store32((iter_base) + 20, handle110) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 16, (2)) + + () + } + } + + match ((payload105).value).end { + Included(payload112) => { + mbt_ffi_store8((iter_base) + 24, (0)) + + let LazyDbValue(handle113) = payload112 + mbt_ffi_store32((iter_base) + 28, handle113) + + () + } + Excluded(payload114) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let LazyDbValue(handle115) = payload114 + mbt_ffi_store32((iter_base) + 28, handle115) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 24, (2)) + + () + } + } + cleanup_list.push(ptr106) + + () + } + Null => { + mbt_ffi_store8((iter_base) + 0, (41)) + + () + } + Vector(payload118) => { + mbt_ffi_store8((iter_base) + 0, (42)) + + let ptr119 = mbt_ffi_float_array2ptr(payload118) + + mbt_ffi_store32((iter_base) + 12, payload118.length()) + mbt_ffi_store32((iter_base) + 8, ptr119) + cleanup_list.push(ptr119) + + () + } + Halfvec(payload120) => { + mbt_ffi_store8((iter_base) + 0, (43)) + + let ptr121 = mbt_ffi_float_array2ptr(payload120) + + mbt_ffi_store32((iter_base) + 12, payload120.length()) + mbt_ffi_store32((iter_base) + 8, ptr121) + cleanup_list.push(ptr121) + + () + } + Sparsevec(payload122) => { + mbt_ffi_store8((iter_base) + 0, (44)) + mbt_ffi_store32((iter_base) + 8, (payload122).dim) + + let ptr123 = mbt_ffi_int_array2ptr((payload122).indices) + + mbt_ffi_store32((iter_base) + 16, (payload122).indices.length()) + mbt_ffi_store32((iter_base) + 12, ptr123) + + let ptr124 = mbt_ffi_float_array2ptr((payload122).values) + + mbt_ffi_store32((iter_base) + 24, (payload122).values.length()) + mbt_ffi_store32((iter_base) + 20, ptr124) + cleanup_list.push(ptr123) + cleanup_list.push(ptr124) + + () + } + } + } - Money(payload88) => { - mbt_ffi_store8(iter_base + 0, 34) - mbt_ffi_store64(iter_base + 8, payload88) + let return_area = mbt_ffi_malloc(20) + wasmImportMethodDbTransactionQuery(handle, ptr, statement.length(), address125, (params).length(), return_area); + + let lifted193 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let array134 : Array[DbColumn] = []; + for index135 = 0; index135 < (mbt_ffi_load32((return_area) + 8)); index135 = index135 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index135 * 48) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { + + DbColumnType::Character + } + 1 => { + + DbColumnType::Int2 + } + 2 => { + + DbColumnType::Int4 + } + 3 => { + + DbColumnType::Int8 + } + 4 => { + + DbColumnType::Float4 + } + 5 => { + + DbColumnType::Float8 + } + 6 => { + + DbColumnType::Numeric + } + 7 => { + + DbColumnType::Boolean + } + 8 => { + + DbColumnType::Text + } + 9 => { + + DbColumnType::Varchar + } + 10 => { + + DbColumnType::Bpchar + } + 11 => { - () - } - Oid(payload89) => { - mbt_ffi_store8(iter_base + 0, 35) - mbt_ffi_store32(iter_base + 8, payload89.reinterpret_as_int()) + DbColumnType::Timestamp + } + 12 => { - () - } - Enumeration(payload90) => { - mbt_ffi_store8(iter_base + 0, 36) + DbColumnType::Timestamptz + } + 13 => { - let ptr91 = mbt_ffi_str2ptr(payload90.name) - mbt_ffi_store32(iter_base + 12, payload90.name.length()) - mbt_ffi_store32(iter_base + 8, ptr91) + DbColumnType::Date + } + 14 => { - let ptr92 = mbt_ffi_str2ptr(payload90.value) - mbt_ffi_store32(iter_base + 20, payload90.value.length()) - mbt_ffi_store32(iter_base + 16, ptr92) - cleanup_list.push(ptr91) - cleanup_list.push(ptr92) + DbColumnType::Time + } + 15 => { - () - } - Composite(payload93) => { - mbt_ffi_store8(iter_base + 0, 37) - - let ptr94 = mbt_ffi_str2ptr(payload93.name) - mbt_ffi_store32(iter_base + 12, payload93.name.length()) - mbt_ffi_store32(iter_base + 8, ptr94) - - let address96 = mbt_ffi_malloc(payload93.values.length() * 4) - for index97 = 0 - index97 < payload93.values.length() - index97 = index97 + 1 { - let iter_elem : LazyDbValue = payload93.values[index97] - let iter_base = address96 + index97 * 4 - - let LazyDbValue(handle95) = iter_elem - mbt_ffi_store32(iter_base + 0, handle95) - } - mbt_ffi_store32(iter_base + 20, payload93.values.length()) - mbt_ffi_store32(iter_base + 16, address96) - cleanup_list.push(ptr94) - cleanup_list.push(address96) - - () - } - Domain(payload98) => { - mbt_ffi_store8(iter_base + 0, 38) + DbColumnType::Timetz + } + 16 => { - let ptr99 = mbt_ffi_str2ptr(payload98.name) - mbt_ffi_store32(iter_base + 12, payload98.name.length()) - mbt_ffi_store32(iter_base + 8, ptr99) + DbColumnType::Interval + } + 17 => { - let LazyDbValue(handle100) = payload98.value - mbt_ffi_store32(iter_base + 16, handle100) - cleanup_list.push(ptr99) + DbColumnType::Bytea + } + 18 => { - () - } - Array(payload101) => { - mbt_ffi_store8(iter_base + 0, 39) - - let address103 = mbt_ffi_malloc(payload101.length() * 4) - for index104 = 0 - index104 < payload101.length() - index104 = index104 + 1 { - let iter_elem : LazyDbValue = payload101[index104] - let iter_base = address103 + index104 * 4 - - let LazyDbValue(handle102) = iter_elem - mbt_ffi_store32(iter_base + 0, handle102) - } - mbt_ffi_store32(iter_base + 12, payload101.length()) - mbt_ffi_store32(iter_base + 8, address103) - cleanup_list.push(address103) - - () - } - Range(payload105) => { - mbt_ffi_store8(iter_base + 0, 40) + DbColumnType::Uuid + } + 19 => { - let ptr106 = mbt_ffi_str2ptr(payload105.name) - mbt_ffi_store32(iter_base + 12, payload105.name.length()) - mbt_ffi_store32(iter_base + 8, ptr106) + DbColumnType::Xml + } + 20 => { - match payload105.value.start { - Included(payload107) => { - mbt_ffi_store8(iter_base + 16, 0) + DbColumnType::Json + } + 21 => { - let LazyDbValue(handle108) = payload107 - mbt_ffi_store32(iter_base + 20, handle108) + DbColumnType::Jsonb + } + 22 => { - () - } - Excluded(payload109) => { - mbt_ffi_store8(iter_base + 16, 1) + DbColumnType::Jsonpath + } + 23 => { - let LazyDbValue(handle110) = payload109 - mbt_ffi_store32(iter_base + 20, handle110) + DbColumnType::Inet + } + 24 => { - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 16, 2) + DbColumnType::Cidr + } + 25 => { - () - } - } + DbColumnType::Macaddr + } + 26 => { - match payload105.value.end { - Included(payload112) => { - mbt_ffi_store8(iter_base + 24, 0) + DbColumnType::Bit + } + 27 => { - let LazyDbValue(handle113) = payload112 - mbt_ffi_store32(iter_base + 28, handle113) + DbColumnType::Varbit + } + 28 => { - () - } - Excluded(payload114) => { - mbt_ffi_store8(iter_base + 24, 1) + DbColumnType::Int4range + } + 29 => { - let LazyDbValue(handle115) = payload114 - mbt_ffi_store32(iter_base + 28, handle115) + DbColumnType::Int8range + } + 30 => { - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 24, 2) + DbColumnType::Numrange + } + 31 => { - () - } - } - cleanup_list.push(ptr106) + DbColumnType::Tsrange + } + 32 => { - () - } - Null => { - mbt_ffi_store8(iter_base + 0, 41) + DbColumnType::Tstzrange + } + 33 => { - () - } - Vector(payload118) => { - mbt_ffi_store8(iter_base + 0, 42) + DbColumnType::Daterange + } + 34 => { - let ptr119 = mbt_ffi_float_array2ptr(payload118) + DbColumnType::Money + } + 35 => { - mbt_ffi_store32(iter_base + 12, payload118.length()) - mbt_ffi_store32(iter_base + 8, ptr119) - cleanup_list.push(ptr119) + DbColumnType::Oid + } + 36 => { - () - } - Halfvec(payload120) => { - mbt_ffi_store8(iter_base + 0, 43) + let result127 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let ptr121 = mbt_ffi_float_array2ptr(payload120) + DbColumnType::Enumeration(EnumerationType::{name : result127}) + } + 37 => { - mbt_ffi_store32(iter_base + 12, payload120.length()) - mbt_ffi_store32(iter_base + 8, ptr121) - cleanup_list.push(ptr121) + let result128 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - Sparsevec(payload122) => { - mbt_ffi_store8(iter_base + 0, 44) - mbt_ffi_store32(iter_base + 8, payload122.dim) + let array : Array[(String, LazyDbColumnType)] = []; + for index130 = 0; index130 < (mbt_ffi_load32((iter_base) + 32)); index130 = index130 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index130 * 12) - let ptr123 = mbt_ffi_int_array2ptr(payload122.indices) + let result129 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - mbt_ffi_store32(iter_base + 16, payload122.indices.length()) - mbt_ffi_store32(iter_base + 12, ptr123) + array.push((result129, LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 8)))) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let ptr124 = mbt_ffi_float_array2ptr(payload122.values) + DbColumnType::Composite(CompositeType::{name : result128, attributes : array}) + } + 38 => { - mbt_ffi_store32(iter_base + 24, payload122.values.length()) - mbt_ffi_store32(iter_base + 20, ptr124) - cleanup_list.push(ptr123) - cleanup_list.push(ptr124) + let result131 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - } - } - let return_area = mbt_ffi_malloc(24) - wasmImportMethodDbConnectionExecute( - handle, - ptr, - statement.length(), - address125, - params.length(), - return_area, - ) - - let lifted131 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 8) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result127 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryParameterFailure(result127) - } - 2 => { - let result128 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryExecutionFailure(result128) - } - 3 => { - let result129 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryResponseFailure(result129) - } - 4 => { - let result130 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::Other(result130) - } - _ => panic() - } + DbColumnType::Domain(DomainType::{name : result131, base_type : LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 28))}) + } + 39 => { - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted131 - mbt_ffi_free(ptr) - mbt_ffi_free(address125) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + DbColumnType::Array(LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 20))) + } + 40 => { -///| -pub fn DbConnection::begin_transaction( - self : DbConnection, -) -> Result[DbTransaction, Error_] { - let DbConnection(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbConnectionBeginTransaction(handle, return_area) - - let lifted4 = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok(DbTransaction::DbTransaction(mbt_ffi_load32(return_area + 4))) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result0) - } - 2 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result1) - } - 3 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result2) - } - 4 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result3) - } - _ => panic() - } + let result132 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted4 - mbt_ffi_free(return_area) - return ret -} + DbColumnType::Range(RangeType::{name : result132, base_type : LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32((iter_base) + 28))}) + } + 41 => { -///| -pub fn DbTransaction::query( - self : DbTransaction, - statement : String, - params : Array[DbValue], -) -> Result[DbResult, Error_] { - let cleanup_list : Array[Int] = [] + DbColumnType::Vector + } + 42 => { - let DbTransaction(handle) = self + DbColumnType::Halfvec + } + 43 => { - let ptr = mbt_ffi_str2ptr(statement) + DbColumnType::Sparsevec + } + _ => panic() + } - let address125 = mbt_ffi_malloc(params.length() * 56) - for index126 = 0; index126 < params.length(); index126 = index126 + 1 { - let iter_elem : DbValue = params[index126] - let iter_base = address125 + index126 * 56 + let result133 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) - match iter_elem { - Character(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload)) + array134.push(DbColumn::{ordinal : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), name : result, db_type : lifted, db_type_name : result133}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) - () - } - Int2(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload0)) + let array185 : Array[DbRow] = []; + for index186 = 0; index186 < (mbt_ffi_load32((return_area) + 16)); index186 = index186 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 12)) + (index186 * 8) - () - } - Int4(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store32(iter_base + 8, payload1) + let array183 : Array[DbValue] = []; + for index184 = 0; index184 < (mbt_ffi_load32((iter_base) + 4)); index184 = index184 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index184 * 56) - () - } - Int8(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store64(iter_base + 8, payload2) + let lifted182 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - Float4(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_storef32(iter_base + 8, payload3) + DbValue::Character((mbt_ffi_load8((iter_base) + 8))) + } + 1 => { - () - } - Float8(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_storef64(iter_base + 8, payload4) + DbValue::Int2((mbt_ffi_load16((iter_base) + 8))) + } + 2 => { - () - } - Numeric(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) + DbValue::Int4(mbt_ffi_load32((iter_base) + 8)) + } + 3 => { - let ptr6 = mbt_ffi_str2ptr(payload5) - mbt_ffi_store32(iter_base + 12, payload5.length()) - mbt_ffi_store32(iter_base + 8, ptr6) - cleanup_list.push(ptr6) + DbValue::Int8(mbt_ffi_load64((iter_base) + 8)) + } + 4 => { - () - } - Boolean(payload7) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store8(iter_base + 8, if payload7 { 1 } else { 0 }) + DbValue::Float4(mbt_ffi_loadf32((iter_base) + 8)) + } + 5 => { - () - } - Text(payload8) => { - mbt_ffi_store8(iter_base + 0, 8) + DbValue::Float8(mbt_ffi_loadf64((iter_base) + 8)) + } + 6 => { - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(iter_base + 12, payload8.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - cleanup_list.push(ptr9) + let result136 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Varchar(payload10) => { - mbt_ffi_store8(iter_base + 0, 9) + DbValue::Numeric(result136) + } + 7 => { - let ptr11 = mbt_ffi_str2ptr(payload10) - mbt_ffi_store32(iter_base + 12, payload10.length()) - mbt_ffi_store32(iter_base + 8, ptr11) - cleanup_list.push(ptr11) + DbValue::Boolean((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 8 => { - () - } - Bpchar(payload12) => { - mbt_ffi_store8(iter_base + 0, 10) + let result137 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr13 = mbt_ffi_str2ptr(payload12) - mbt_ffi_store32(iter_base + 12, payload12.length()) - mbt_ffi_store32(iter_base + 8, ptr13) - cleanup_list.push(ptr13) + DbValue::Text(result137) + } + 9 => { - () - } - Timestamp(payload14) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload14.date.year) - mbt_ffi_store8(iter_base + 12, payload14.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload14.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload14.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload14.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload14.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload14.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Timestamptz(payload15) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store32(iter_base + 8, payload15.timestamp.date.year) - mbt_ffi_store8(iter_base + 12, payload15.timestamp.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload15.timestamp.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload15.timestamp.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload15.timestamp.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload15.timestamp.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload15.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 24, payload15.offset) - - () - } - Date(payload16) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store32(iter_base + 8, payload16.year) - mbt_ffi_store8(iter_base + 12, payload16.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload16.day.to_int()) + let result138 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Time(payload17) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store8(iter_base + 8, payload17.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload17.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload17.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload17.nanosecond.reinterpret_as_int(), - ) - - () - } - Timetz(payload18) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store8(iter_base + 8, payload18.time.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload18.time.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload18.time.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload18.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 16, payload18.offset) - - () - } - Interval(payload19) => { - mbt_ffi_store8(iter_base + 0, 16) - mbt_ffi_store32(iter_base + 8, payload19.months) - mbt_ffi_store32(iter_base + 12, payload19.days) - mbt_ffi_store64(iter_base + 16, payload19.microseconds) + DbValue::Varchar(result138) + } + 10 => { - () - } - Bytea(payload20) => { - mbt_ffi_store8(iter_base + 0, 17) + let result139 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr21 = mbt_ffi_bytes2ptr(payload20) + DbValue::Bpchar(result139) + } + 11 => { - mbt_ffi_store32(iter_base + 12, payload20.length()) - mbt_ffi_store32(iter_base + 8, ptr21) - cleanup_list.push(ptr21) + DbValue::Timestamp(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 17)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()}}) + } + 12 => { - () - } - Json(payload22) => { - mbt_ffi_store8(iter_base + 0, 18) + DbValue::Timestamptz(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 17)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 18)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 24)}) + } + 13 => { - let ptr23 = mbt_ffi_str2ptr(payload22) - mbt_ffi_store32(iter_base + 12, payload22.length()) - mbt_ffi_store32(iter_base + 8, ptr23) - cleanup_list.push(ptr23) + DbValue::Date(@types.Date::{year : mbt_ffi_load32((iter_base) + 8), month : (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 13)).to_byte()}) + } + 14 => { - () - } - Jsonb(payload24) => { - mbt_ffi_store8(iter_base + 0, 19) + DbValue::Time(@types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 8)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 9)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 10)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 15 => { - let ptr25 = mbt_ffi_str2ptr(payload24) - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, ptr25) - cleanup_list.push(ptr25) + DbValue::Timetz(@types.Timetz::{time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 8)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 9)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 10)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}, offset : mbt_ffi_load32((iter_base) + 16)}) + } + 16 => { - () - } - Jsonpath(payload26) => { - mbt_ffi_store8(iter_base + 0, 20) + DbValue::Interval(Interval::{months : mbt_ffi_load32((iter_base) + 8), days : mbt_ffi_load32((iter_base) + 12), microseconds : mbt_ffi_load64((iter_base) + 16)}) + } + 17 => { - let ptr27 = mbt_ffi_str2ptr(payload26) - mbt_ffi_store32(iter_base + 12, payload26.length()) - mbt_ffi_store32(iter_base + 8, ptr27) - cleanup_list.push(ptr27) + let result140 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Xml(payload28) => { - mbt_ffi_store8(iter_base + 0, 21) + DbValue::Bytea(result140) + } + 18 => { - let ptr29 = mbt_ffi_str2ptr(payload28) - mbt_ffi_store32(iter_base + 12, payload28.length()) - mbt_ffi_store32(iter_base + 8, ptr29) - cleanup_list.push(ptr29) + let result141 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Uuid(payload30) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store64( - iter_base + 8, - payload30.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 16, - payload30.low_bits.reinterpret_as_int64(), - ) - - () - } - Inet(payload31) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload31 { - Ipv4(payload32) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store8(iter_base + 10, payload32.0.to_int()) - mbt_ffi_store8(iter_base + 11, payload32.1.to_int()) - mbt_ffi_store8(iter_base + 12, payload32.2.to_int()) - mbt_ffi_store8(iter_base + 13, payload32.3.to_int()) - - () - } - Ipv6(payload33) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store16(iter_base + 10, payload33.0.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 12, payload33.1.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 14, payload33.2.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 16, payload33.3.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 18, payload33.4.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 20, payload33.5.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 22, payload33.6.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 24, payload33.7.reinterpret_as_int()) - - () - } - } - - () - } - Cidr(payload34) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload34 { - Ipv4(payload35) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store8(iter_base + 10, payload35.0.to_int()) - mbt_ffi_store8(iter_base + 11, payload35.1.to_int()) - mbt_ffi_store8(iter_base + 12, payload35.2.to_int()) - mbt_ffi_store8(iter_base + 13, payload35.3.to_int()) - - () - } - Ipv6(payload36) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store16(iter_base + 10, payload36.0.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 12, payload36.1.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 14, payload36.2.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 16, payload36.3.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 18, payload36.4.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 20, payload36.5.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 22, payload36.6.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 24, payload36.7.reinterpret_as_int()) - - () - } - } - - () - } - Macaddr(payload37) => { - mbt_ffi_store8(iter_base + 0, 25) - mbt_ffi_store8(iter_base + 8, payload37.octets.0.to_int()) - mbt_ffi_store8(iter_base + 9, payload37.octets.1.to_int()) - mbt_ffi_store8(iter_base + 10, payload37.octets.2.to_int()) - mbt_ffi_store8(iter_base + 11, payload37.octets.3.to_int()) - mbt_ffi_store8(iter_base + 12, payload37.octets.4.to_int()) - mbt_ffi_store8(iter_base + 13, payload37.octets.5.to_int()) - - () - } - Bit(payload38) => { - mbt_ffi_store8(iter_base + 0, 26) - - let address = mbt_ffi_malloc(payload38.length() * 1) - for index = 0; index < payload38.length(); index = index + 1 { - let iter_elem : Bool = payload38[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload38.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - Varbit(payload39) => { - mbt_ffi_store8(iter_base + 0, 27) - - let address40 = mbt_ffi_malloc(payload39.length() * 1) - for index41 = 0; index41 < payload39.length(); index41 = index41 + 1 { - let iter_elem : Bool = payload39[index41] - let iter_base = address40 + index41 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, address40) - cleanup_list.push(address40) - - () - } - Int4range(payload42) => { - mbt_ffi_store8(iter_base + 0, 28) - - match payload42.start { - Included(payload43) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload43) - - () - } - Excluded(payload44) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload44) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload42.end { - Included(payload46) => { - mbt_ffi_store8(iter_base + 16, 0) - mbt_ffi_store32(iter_base + 20, payload46) - - () - } - Excluded(payload47) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload47) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 16, 2) - - () - } - } - - () - } - Int8range(payload49) => { - mbt_ffi_store8(iter_base + 0, 29) - - match payload49.start { - Included(payload50) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store64(iter_base + 16, payload50) - - () - } - Excluded(payload51) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store64(iter_base + 16, payload51) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload49.end { - Included(payload53) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload53) - - () - } - Excluded(payload54) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload54) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 24, 2) - - () - } - } - - () - } - Numrange(payload56) => { - mbt_ffi_store8(iter_base + 0, 30) - - match payload56.start { - Included(payload57) => { - mbt_ffi_store8(iter_base + 8, 0) - - let ptr58 = mbt_ffi_str2ptr(payload57) - mbt_ffi_store32(iter_base + 16, payload57.length()) - mbt_ffi_store32(iter_base + 12, ptr58) - cleanup_list.push(ptr58) - - () - } - Excluded(payload59) => { - mbt_ffi_store8(iter_base + 8, 1) - - let ptr60 = mbt_ffi_str2ptr(payload59) - mbt_ffi_store32(iter_base + 16, payload59.length()) - mbt_ffi_store32(iter_base + 12, ptr60) - cleanup_list.push(ptr60) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload56.end { - Included(payload62) => { - mbt_ffi_store8(iter_base + 20, 0) - - let ptr63 = mbt_ffi_str2ptr(payload62) - mbt_ffi_store32(iter_base + 28, payload62.length()) - mbt_ffi_store32(iter_base + 24, ptr63) - cleanup_list.push(ptr63) - - () - } - Excluded(payload64) => { - mbt_ffi_store8(iter_base + 20, 1) - - let ptr65 = mbt_ffi_str2ptr(payload64) - mbt_ffi_store32(iter_base + 28, payload64.length()) - mbt_ffi_store32(iter_base + 24, ptr65) - cleanup_list.push(ptr65) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 20, 2) - - () - } - } - - () - } - Tsrange(payload67) => { - mbt_ffi_store8(iter_base + 0, 31) - - match payload67.start { - Included(payload68) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload68.date.year) - mbt_ffi_store8(iter_base + 16, payload68.date.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload68.date.day.to_int()) - mbt_ffi_store8(iter_base + 20, payload68.time.hour.to_int()) - mbt_ffi_store8(iter_base + 21, payload68.time.minute.to_int()) - mbt_ffi_store8(iter_base + 22, payload68.time.second.to_int()) - mbt_ffi_store32( - iter_base + 24, - payload68.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload69) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload69.date.year) - mbt_ffi_store8(iter_base + 16, payload69.date.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload69.date.day.to_int()) - mbt_ffi_store8(iter_base + 20, payload69.time.hour.to_int()) - mbt_ffi_store8(iter_base + 21, payload69.time.minute.to_int()) - mbt_ffi_store8(iter_base + 22, payload69.time.second.to_int()) - mbt_ffi_store32( - iter_base + 24, - payload69.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload67.end { - Included(payload71) => { - mbt_ffi_store8(iter_base + 28, 0) - mbt_ffi_store32(iter_base + 32, payload71.date.year) - mbt_ffi_store8(iter_base + 36, payload71.date.month.to_int()) - mbt_ffi_store8(iter_base + 37, payload71.date.day.to_int()) - mbt_ffi_store8(iter_base + 40, payload71.time.hour.to_int()) - mbt_ffi_store8(iter_base + 41, payload71.time.minute.to_int()) - mbt_ffi_store8(iter_base + 42, payload71.time.second.to_int()) - mbt_ffi_store32( - iter_base + 44, - payload71.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload72) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload72.date.year) - mbt_ffi_store8(iter_base + 36, payload72.date.month.to_int()) - mbt_ffi_store8(iter_base + 37, payload72.date.day.to_int()) - mbt_ffi_store8(iter_base + 40, payload72.time.hour.to_int()) - mbt_ffi_store8(iter_base + 41, payload72.time.minute.to_int()) - mbt_ffi_store8(iter_base + 42, payload72.time.second.to_int()) - mbt_ffi_store32( - iter_base + 44, - payload72.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 28, 2) - - () - } - } - - () - } - Tstzrange(payload74) => { - mbt_ffi_store8(iter_base + 0, 32) - - match payload74.start { - Included(payload75) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload75.timestamp.date.year) - mbt_ffi_store8( - iter_base + 16, - payload75.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 17, - payload75.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 20, - payload75.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 21, - payload75.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 22, - payload75.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 24, - payload75.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 28, payload75.offset) - - () - } - Excluded(payload76) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload76.timestamp.date.year) - mbt_ffi_store8( - iter_base + 16, - payload76.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 17, - payload76.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 20, - payload76.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 21, - payload76.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 22, - payload76.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 24, - payload76.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 28, payload76.offset) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload74.end { - Included(payload78) => { - mbt_ffi_store8(iter_base + 32, 0) - mbt_ffi_store32(iter_base + 36, payload78.timestamp.date.year) - mbt_ffi_store8( - iter_base + 40, - payload78.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 41, - payload78.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 44, - payload78.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 45, - payload78.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 46, - payload78.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 48, - payload78.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 52, payload78.offset) - - () - } - Excluded(payload79) => { - mbt_ffi_store8(iter_base + 32, 1) - mbt_ffi_store32(iter_base + 36, payload79.timestamp.date.year) - mbt_ffi_store8( - iter_base + 40, - payload79.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 41, - payload79.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 44, - payload79.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 45, - payload79.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 46, - payload79.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 48, - payload79.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 52, payload79.offset) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 32, 2) - - () - } - } - - () - } - Daterange(payload81) => { - mbt_ffi_store8(iter_base + 0, 33) - - match payload81.start { - Included(payload82) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload82.year) - mbt_ffi_store8(iter_base + 16, payload82.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload82.day.to_int()) - - () - } - Excluded(payload83) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload83.year) - mbt_ffi_store8(iter_base + 16, payload83.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload83.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload81.end { - Included(payload85) => { - mbt_ffi_store8(iter_base + 20, 0) - mbt_ffi_store32(iter_base + 24, payload85.year) - mbt_ffi_store8(iter_base + 28, payload85.month.to_int()) - mbt_ffi_store8(iter_base + 29, payload85.day.to_int()) - - () - } - Excluded(payload86) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload86.year) - mbt_ffi_store8(iter_base + 28, payload86.month.to_int()) - mbt_ffi_store8(iter_base + 29, payload86.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 20, 2) - - () - } - } - - () - } - Money(payload88) => { - mbt_ffi_store8(iter_base + 0, 34) - mbt_ffi_store64(iter_base + 8, payload88) + DbValue::Json(result141) + } + 19 => { - () - } - Oid(payload89) => { - mbt_ffi_store8(iter_base + 0, 35) - mbt_ffi_store32(iter_base + 8, payload89.reinterpret_as_int()) + let result142 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Enumeration(payload90) => { - mbt_ffi_store8(iter_base + 0, 36) + DbValue::Jsonb(result142) + } + 20 => { - let ptr91 = mbt_ffi_str2ptr(payload90.name) - mbt_ffi_store32(iter_base + 12, payload90.name.length()) - mbt_ffi_store32(iter_base + 8, ptr91) + let result143 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr92 = mbt_ffi_str2ptr(payload90.value) - mbt_ffi_store32(iter_base + 20, payload90.value.length()) - mbt_ffi_store32(iter_base + 16, ptr92) - cleanup_list.push(ptr91) - cleanup_list.push(ptr92) + DbValue::Jsonpath(result143) + } + 21 => { - () - } - Composite(payload93) => { - mbt_ffi_store8(iter_base + 0, 37) - - let ptr94 = mbt_ffi_str2ptr(payload93.name) - mbt_ffi_store32(iter_base + 12, payload93.name.length()) - mbt_ffi_store32(iter_base + 8, ptr94) - - let address96 = mbt_ffi_malloc(payload93.values.length() * 4) - for index97 = 0 - index97 < payload93.values.length() - index97 = index97 + 1 { - let iter_elem : LazyDbValue = payload93.values[index97] - let iter_base = address96 + index97 * 4 - - let LazyDbValue(handle95) = iter_elem - mbt_ffi_store32(iter_base + 0, handle95) - } - mbt_ffi_store32(iter_base + 20, payload93.values.length()) - mbt_ffi_store32(iter_base + 16, address96) - cleanup_list.push(ptr94) - cleanup_list.push(address96) - - () - } - Domain(payload98) => { - mbt_ffi_store8(iter_base + 0, 38) + let result144 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr99 = mbt_ffi_str2ptr(payload98.name) - mbt_ffi_store32(iter_base + 12, payload98.name.length()) - mbt_ffi_store32(iter_base + 8, ptr99) + DbValue::Xml(result144) + } + 22 => { - let LazyDbValue(handle100) = payload98.value - mbt_ffi_store32(iter_base + 16, handle100) - cleanup_list.push(ptr99) + DbValue::Uuid(@types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 16)).reinterpret_as_uint64()}) + } + 23 => { - () - } - Array(payload101) => { - mbt_ffi_store8(iter_base + 0, 39) - - let address103 = mbt_ffi_malloc(payload101.length() * 4) - for index104 = 0 - index104 < payload101.length() - index104 = index104 + 1 { - let iter_elem : LazyDbValue = payload101[index104] - let iter_base = address103 + index104 * 4 - - let LazyDbValue(handle102) = iter_elem - mbt_ffi_store32(iter_base + 0, handle102) - } - mbt_ffi_store32(iter_base + 12, payload101.length()) - mbt_ffi_store32(iter_base + 8, address103) - cleanup_list.push(address103) - - () - } - Range(payload105) => { - mbt_ffi_store8(iter_base + 0, 40) + let lifted145 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - let ptr106 = mbt_ffi_str2ptr(payload105.name) - mbt_ffi_store32(iter_base + 12, payload105.name.length()) - mbt_ffi_store32(iter_base + 8, ptr106) + @types.IpAddress::Ipv4(((mbt_ffi_load8_u((iter_base) + 10)).to_byte(), (mbt_ffi_load8_u((iter_base) + 11)).to_byte(), (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), (mbt_ffi_load8_u((iter_base) + 13)).to_byte())) + } + 1 => { - match payload105.value.start { - Included(payload107) => { - mbt_ffi_store8(iter_base + 16, 0) + @types.IpAddress::Ipv6(((mbt_ffi_load16_u((iter_base) + 10).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 12).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 14).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 16).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 18).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 20).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 22).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 24).land(0xFFFF).reinterpret_as_uint()))) + } + _ => panic() + } - let LazyDbValue(handle108) = payload107 - mbt_ffi_store32(iter_base + 20, handle108) + DbValue::Inet(lifted145) + } + 24 => { - () - } - Excluded(payload109) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted146 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - let LazyDbValue(handle110) = payload109 - mbt_ffi_store32(iter_base + 20, handle110) + @types.IpAddress::Ipv4(((mbt_ffi_load8_u((iter_base) + 10)).to_byte(), (mbt_ffi_load8_u((iter_base) + 11)).to_byte(), (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), (mbt_ffi_load8_u((iter_base) + 13)).to_byte())) + } + 1 => { - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 16, 2) + @types.IpAddress::Ipv6(((mbt_ffi_load16_u((iter_base) + 10).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 12).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 14).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 16).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 18).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 20).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 22).land(0xFFFF).reinterpret_as_uint()), (mbt_ffi_load16_u((iter_base) + 24).land(0xFFFF).reinterpret_as_uint()))) + } + _ => panic() + } - () - } - } + DbValue::Cidr(lifted146) + } + 25 => { - match payload105.value.end { - Included(payload112) => { - mbt_ffi_store8(iter_base + 24, 0) + DbValue::Macaddr(@types.MacAddress::{octets : ((mbt_ffi_load8_u((iter_base) + 8)).to_byte(), (mbt_ffi_load8_u((iter_base) + 9)).to_byte(), (mbt_ffi_load8_u((iter_base) + 10)).to_byte(), (mbt_ffi_load8_u((iter_base) + 11)).to_byte(), (mbt_ffi_load8_u((iter_base) + 12)).to_byte(), (mbt_ffi_load8_u((iter_base) + 13)).to_byte())}) + } + 26 => { - let LazyDbValue(handle113) = payload112 - mbt_ffi_store32(iter_base + 28, handle113) + let array147 : Array[Bool] = []; + for index148 = 0; index148 < (mbt_ffi_load32((iter_base) + 12)); index148 = index148 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index148 * 1) - () - } - Excluded(payload114) => { - mbt_ffi_store8(iter_base + 24, 1) + array147.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let LazyDbValue(handle115) = payload114 - mbt_ffi_store32(iter_base + 28, handle115) + DbValue::Bit(array147) + } + 27 => { - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 24, 2) + let array149 : Array[Bool] = []; + for index150 = 0; index150 < (mbt_ffi_load32((iter_base) + 12)); index150 = index150 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index150 * 1) - () - } - } - cleanup_list.push(ptr106) + array149.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Null => { - mbt_ffi_store8(iter_base + 0, 41) + DbValue::Varbit(array149) + } + 28 => { - () - } - Vector(payload118) => { - mbt_ffi_store8(iter_base + 0, 42) + let lifted151 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - let ptr119 = mbt_ffi_float_array2ptr(payload118) + Int4bound::Included(mbt_ffi_load32((iter_base) + 12)) + } + 1 => { - mbt_ffi_store32(iter_base + 12, payload118.length()) - mbt_ffi_store32(iter_base + 8, ptr119) - cleanup_list.push(ptr119) + Int4bound::Excluded(mbt_ffi_load32((iter_base) + 12)) + } + 2 => { - () - } - Halfvec(payload120) => { - mbt_ffi_store8(iter_base + 0, 43) + Int4bound::Unbounded + } + _ => panic() + } - let ptr121 = mbt_ffi_float_array2ptr(payload120) + let lifted152 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - mbt_ffi_store32(iter_base + 12, payload120.length()) - mbt_ffi_store32(iter_base + 8, ptr121) - cleanup_list.push(ptr121) + Int4bound::Included(mbt_ffi_load32((iter_base) + 20)) + } + 1 => { - () - } - Sparsevec(payload122) => { - mbt_ffi_store8(iter_base + 0, 44) - mbt_ffi_store32(iter_base + 8, payload122.dim) + Int4bound::Excluded(mbt_ffi_load32((iter_base) + 20)) + } + 2 => { - let ptr123 = mbt_ffi_int_array2ptr(payload122.indices) + Int4bound::Unbounded + } + _ => panic() + } - mbt_ffi_store32(iter_base + 16, payload122.indices.length()) - mbt_ffi_store32(iter_base + 12, ptr123) + DbValue::Int4range(Int4range::{start : lifted151, end : lifted152}) + } + 29 => { - let ptr124 = mbt_ffi_float_array2ptr(payload122.values) + let lifted153 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - mbt_ffi_store32(iter_base + 24, payload122.values.length()) - mbt_ffi_store32(iter_base + 20, ptr124) - cleanup_list.push(ptr123) - cleanup_list.push(ptr124) + Int8bound::Included(mbt_ffi_load64((iter_base) + 16)) + } + 1 => { - () - } - } - } - let return_area = mbt_ffi_malloc(20) - wasmImportMethodDbTransactionQuery( - handle, - ptr, - statement.length(), - address125, - params.length(), - return_area, - ) - - let lifted193 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array134 : Array[DbColumn] = [] - for index135 = 0 - index135 < mbt_ffi_load32(return_area + 8) - index135 = index135 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index135 * 48 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted = match mbt_ffi_load8_u(iter_base + 16) { - 0 => DbColumnType::Character - 1 => DbColumnType::Int2 - 2 => DbColumnType::Int4 - 3 => DbColumnType::Int8 - 4 => DbColumnType::Float4 - 5 => DbColumnType::Float8 - 6 => DbColumnType::Numeric - 7 => DbColumnType::Boolean - 8 => DbColumnType::Text - 9 => DbColumnType::Varchar - 10 => DbColumnType::Bpchar - 11 => DbColumnType::Timestamp - 12 => DbColumnType::Timestamptz - 13 => DbColumnType::Date - 14 => DbColumnType::Time - 15 => DbColumnType::Timetz - 16 => DbColumnType::Interval - 17 => DbColumnType::Bytea - 18 => DbColumnType::Uuid - 19 => DbColumnType::Xml - 20 => DbColumnType::Json - 21 => DbColumnType::Jsonb - 22 => DbColumnType::Jsonpath - 23 => DbColumnType::Inet - 24 => DbColumnType::Cidr - 25 => DbColumnType::Macaddr - 26 => DbColumnType::Bit - 27 => DbColumnType::Varbit - 28 => DbColumnType::Int4range - 29 => DbColumnType::Int8range - 30 => DbColumnType::Numrange - 31 => DbColumnType::Tsrange - 32 => DbColumnType::Tstzrange - 33 => DbColumnType::Daterange - 34 => DbColumnType::Money - 35 => DbColumnType::Oid - 36 => { - let result127 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - DbColumnType::Enumeration(EnumerationType::{ name: result127 }) - } - 37 => { - let result128 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - let array : Array[(String, LazyDbColumnType)] = [] - for index130 = 0 - index130 < mbt_ffi_load32(iter_base + 32) - index130 = index130 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index130 * 12 - - let result129 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push( - ( - result129, - LazyDbColumnType::LazyDbColumnType( - mbt_ffi_load32(iter_base + 8), - ), - ), - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - DbColumnType::Composite(CompositeType::{ - name: result128, - attributes: array, - }) - } - 38 => { - let result131 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - DbColumnType::Domain(DomainType::{ - name: result131, - base_type: LazyDbColumnType::LazyDbColumnType( - mbt_ffi_load32(iter_base + 28), - ), - }) - } - 39 => - DbColumnType::Array( - LazyDbColumnType::LazyDbColumnType(mbt_ffi_load32(iter_base + 20)), - ) - 40 => { - let result132 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - DbColumnType::Range(RangeType::{ - name: result132, - base_type: LazyDbColumnType::LazyDbColumnType( - mbt_ffi_load32(iter_base + 28), - ), - }) - } - 41 => DbColumnType::Vector - 42 => DbColumnType::Halfvec - 43 => DbColumnType::Sparsevec - _ => panic() - } - - let result133 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - array134.push(DbColumn::{ - ordinal: mbt_ffi_load64(iter_base + 0).reinterpret_as_uint64(), - name: result, - db_type: lifted, - db_type_name: result133, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - let array185 : Array[DbRow] = [] - for index186 = 0 - index186 < mbt_ffi_load32(return_area + 16) - index186 = index186 + 1 { - let iter_base = mbt_ffi_load32(return_area + 12) + index186 * 8 - - let array183 : Array[DbValue] = [] - for index184 = 0 - index184 < mbt_ffi_load32(iter_base + 4) - index184 = index184 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + index184 * 56 - - let lifted182 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => DbValue::Character(mbt_ffi_load8(iter_base + 8)) - 1 => DbValue::Int2(mbt_ffi_load16(iter_base + 8)) - 2 => DbValue::Int4(mbt_ffi_load32(iter_base + 8)) - 3 => DbValue::Int8(mbt_ffi_load64(iter_base + 8)) - 4 => DbValue::Float4(mbt_ffi_loadf32(iter_base + 8)) - 5 => DbValue::Float8(mbt_ffi_loadf64(iter_base + 8)) - 6 => { - let result136 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Int8bound::Excluded(mbt_ffi_load64((iter_base) + 16)) + } + 2 => { - DbValue::Numeric(result136) - } - 7 => DbValue::Boolean(mbt_ffi_load8_u(iter_base + 8) != 0) - 8 => { - let result137 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Int8bound::Unbounded + } + _ => panic() + } - DbValue::Text(result137) - } - 9 => { - let result138 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let lifted154 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - DbValue::Varchar(result138) - } - 10 => { - let result139 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::Bpchar(result139) - } - 11 => - DbValue::Timestamp(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 16).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 17).to_byte(), - second: mbt_ffi_load8_u(iter_base + 18).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 20).reinterpret_as_uint(), - }, - }) - 12 => - DbValue::Timestamptz(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 16).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 17).to_byte(), - second: mbt_ffi_load8_u(iter_base + 18).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 20).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 24), - }) - 13 => - DbValue::Date(@types.Date::{ - year: mbt_ffi_load32(iter_base + 8), - month: mbt_ffi_load8_u(iter_base + 12).to_byte(), - day: mbt_ffi_load8_u(iter_base + 13).to_byte(), - }) - 14 => - DbValue::Time(@types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 8).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 9).to_byte(), - second: mbt_ffi_load8_u(iter_base + 10).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 15 => - DbValue::Timetz(@types.Timetz::{ - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 8).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 9).to_byte(), - second: mbt_ffi_load8_u(iter_base + 10).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }, - offset: mbt_ffi_load32(iter_base + 16), - }) - 16 => - DbValue::Interval(Interval::{ - months: mbt_ffi_load32(iter_base + 8), - days: mbt_ffi_load32(iter_base + 12), - microseconds: mbt_ffi_load64(iter_base + 16), - }) - 17 => { - let result140 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Int8bound::Included(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - DbValue::Bytea(result140) - } - 18 => { - let result141 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Int8bound::Excluded(mbt_ffi_load64((iter_base) + 32)) + } + 2 => { - DbValue::Json(result141) - } - 19 => { - let result142 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Int8bound::Unbounded + } + _ => panic() + } - DbValue::Jsonb(result142) - } - 20 => { - let result143 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + DbValue::Int8range(Int8range::{start : lifted153, end : lifted154}) + } + 30 => { - DbValue::Jsonpath(result143) - } - 21 => { - let result144 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - DbValue::Xml(result144) - } - 22 => - DbValue::Uuid(@types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 16).reinterpret_as_uint64(), - }) - 23 => { - let lifted145 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - @types.IpAddress::Ipv4( - ( - mbt_ffi_load8_u(iter_base + 10).to_byte(), - mbt_ffi_load8_u(iter_base + 11).to_byte(), - mbt_ffi_load8_u(iter_base + 12).to_byte(), - mbt_ffi_load8_u(iter_base + 13).to_byte(), - ), - ) - 1 => - @types.IpAddress::Ipv6( - ( - mbt_ffi_load16_u(iter_base + 10) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 14) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 16) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 18) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 20) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 22) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 24) - .land(0xFFFF) - .reinterpret_as_uint(), - ), - ) - _ => panic() - } - - DbValue::Inet(lifted145) - } - 24 => { - let lifted146 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - @types.IpAddress::Ipv4( - ( - mbt_ffi_load8_u(iter_base + 10).to_byte(), - mbt_ffi_load8_u(iter_base + 11).to_byte(), - mbt_ffi_load8_u(iter_base + 12).to_byte(), - mbt_ffi_load8_u(iter_base + 13).to_byte(), - ), - ) - 1 => - @types.IpAddress::Ipv6( - ( - mbt_ffi_load16_u(iter_base + 10) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 14) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 16) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 18) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 20) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 22) - .land(0xFFFF) - .reinterpret_as_uint(), - mbt_ffi_load16_u(iter_base + 24) - .land(0xFFFF) - .reinterpret_as_uint(), - ), - ) - _ => panic() - } - - DbValue::Cidr(lifted146) - } - 25 => - DbValue::Macaddr(@types.MacAddress::{ - octets: ( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - mbt_ffi_load8_u(iter_base + 9).to_byte(), - mbt_ffi_load8_u(iter_base + 10).to_byte(), - mbt_ffi_load8_u(iter_base + 11).to_byte(), - mbt_ffi_load8_u(iter_base + 12).to_byte(), - mbt_ffi_load8_u(iter_base + 13).to_byte(), - ), - }) - 26 => { - let array147 : Array[Bool] = [] - for index148 = 0 - index148 < mbt_ffi_load32(iter_base + 12) - index148 = index148 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index148 * 1 + let lifted157 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - array147.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - DbValue::Bit(array147) - } - 27 => { - let array149 : Array[Bool] = [] - for index150 = 0 - index150 < mbt_ffi_load32(iter_base + 12) - index150 = index150 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index150 * 1 + Numbound::Included(result155) + } + 1 => { - array149.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result156 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - DbValue::Varbit(array149) - } - 28 => { - let lifted151 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Int4bound::Included(mbt_ffi_load32(iter_base + 12)) - 1 => Int4bound::Excluded(mbt_ffi_load32(iter_base + 12)) - 2 => Int4bound::Unbounded - _ => panic() - } - - let lifted152 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Int4bound::Included(mbt_ffi_load32(iter_base + 20)) - 1 => Int4bound::Excluded(mbt_ffi_load32(iter_base + 20)) - 2 => Int4bound::Unbounded - _ => panic() - } - - DbValue::Int4range(Int4range::{ start: lifted151, end: lifted152 }) - } - 29 => { - let lifted153 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Int8bound::Included(mbt_ffi_load64(iter_base + 16)) - 1 => Int8bound::Excluded(mbt_ffi_load64(iter_base + 16)) - 2 => Int8bound::Unbounded - _ => panic() - } - - let lifted154 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => Int8bound::Included(mbt_ffi_load64(iter_base + 32)) - 1 => Int8bound::Excluded(mbt_ffi_load64(iter_base + 32)) - 2 => Int8bound::Unbounded - _ => panic() - } - - DbValue::Int8range(Int8range::{ start: lifted153, end: lifted154 }) - } - 30 => { - let lifted157 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let result155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Numbound::Included(result155) - } - 1 => { - let result156 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Numbound::Excluded(result156) - } - 2 => Numbound::Unbounded - _ => panic() - } - - let lifted160 = match mbt_ffi_load8_u(iter_base + 20) { - 0 => { - let result158 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - Numbound::Included(result158) - } - 1 => { - let result159 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - Numbound::Excluded(result159) - } - 2 => Numbound::Unbounded - _ => panic() - } - - DbValue::Numrange(Numrange::{ start: lifted157, end: lifted160 }) - } - 31 => { - let lifted161 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - Tsbound::Included(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 20).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 21).to_byte(), - second: mbt_ffi_load8_u(iter_base + 22).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }) - 1 => - Tsbound::Excluded(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 20).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 21).to_byte(), - second: mbt_ffi_load8_u(iter_base + 22).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }) - 2 => Tsbound::Unbounded - _ => panic() - } - - let lifted162 = match mbt_ffi_load8_u(iter_base + 28) { - 0 => - Tsbound::Included(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 32), - month: mbt_ffi_load8_u(iter_base + 36).to_byte(), - day: mbt_ffi_load8_u(iter_base + 37).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 40).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 41).to_byte(), - second: mbt_ffi_load8_u(iter_base + 42).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 44).reinterpret_as_uint(), - }, - }) - 1 => - Tsbound::Excluded(@types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 32), - month: mbt_ffi_load8_u(iter_base + 36).to_byte(), - day: mbt_ffi_load8_u(iter_base + 37).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 40).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 41).to_byte(), - second: mbt_ffi_load8_u(iter_base + 42).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 44).reinterpret_as_uint(), - }, - }) - 2 => Tsbound::Unbounded - _ => panic() - } - - DbValue::Tsrange(Tsrange::{ start: lifted161, end: lifted162 }) - } - 32 => { - let lifted163 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - Tstzbound::Included(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 20).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 21).to_byte(), - second: mbt_ffi_load8_u(iter_base + 22).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 28), - }) - 1 => - Tstzbound::Excluded(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 20).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 21).to_byte(), - second: mbt_ffi_load8_u(iter_base + 22).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 28), - }) - 2 => Tstzbound::Unbounded - _ => panic() - } - - let lifted164 = match mbt_ffi_load8_u(iter_base + 32) { - 0 => - Tstzbound::Included(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 36), - month: mbt_ffi_load8_u(iter_base + 40).to_byte(), - day: mbt_ffi_load8_u(iter_base + 41).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 44).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 45).to_byte(), - second: mbt_ffi_load8_u(iter_base + 46).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 48).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 52), - }) - 1 => - Tstzbound::Excluded(@types.Timestamptz::{ - timestamp: @types.Timestamp::{ - date: @types.Date::{ - year: mbt_ffi_load32(iter_base + 36), - month: mbt_ffi_load8_u(iter_base + 40).to_byte(), - day: mbt_ffi_load8_u(iter_base + 41).to_byte(), - }, - time: @types.Time::{ - hour: mbt_ffi_load8_u(iter_base + 44).to_byte(), - minute: mbt_ffi_load8_u(iter_base + 45).to_byte(), - second: mbt_ffi_load8_u(iter_base + 46).to_byte(), - nanosecond: mbt_ffi_load32(iter_base + 48).reinterpret_as_uint(), - }, - }, - offset: mbt_ffi_load32(iter_base + 52), - }) - 2 => Tstzbound::Unbounded - _ => panic() - } - - DbValue::Tstzrange(Tstzrange::{ start: lifted163, end: lifted164 }) - } - 33 => { - let lifted165 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => - Datebound::Included(@types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }) - 1 => - Datebound::Excluded(@types.Date::{ - year: mbt_ffi_load32(iter_base + 12), - month: mbt_ffi_load8_u(iter_base + 16).to_byte(), - day: mbt_ffi_load8_u(iter_base + 17).to_byte(), - }) - 2 => Datebound::Unbounded - _ => panic() - } - - let lifted166 = match mbt_ffi_load8_u(iter_base + 20) { - 0 => - Datebound::Included(@types.Date::{ - year: mbt_ffi_load32(iter_base + 24), - month: mbt_ffi_load8_u(iter_base + 28).to_byte(), - day: mbt_ffi_load8_u(iter_base + 29).to_byte(), - }) - 1 => - Datebound::Excluded(@types.Date::{ - year: mbt_ffi_load32(iter_base + 24), - month: mbt_ffi_load8_u(iter_base + 28).to_byte(), - day: mbt_ffi_load8_u(iter_base + 29).to_byte(), - }) - 2 => Datebound::Unbounded - _ => panic() - } - - DbValue::Daterange(Daterange::{ start: lifted165, end: lifted166 }) - } - 34 => DbValue::Money(mbt_ffi_load64(iter_base + 8)) - 35 => - DbValue::Oid(mbt_ffi_load32(iter_base + 8).reinterpret_as_uint()) - 36 => { - let result167 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Numbound::Excluded(result156) + } + 2 => { - let result168 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + Numbound::Unbounded + } + _ => panic() + } - DbValue::Enumeration(Enumeration::{ - name: result167, - value: result168, - }) - } - 37 => { - let result169 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array170 : Array[LazyDbValue] = [] - for index171 = 0 - index171 < mbt_ffi_load32(iter_base + 20) - index171 = index171 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index171 * 4 - - array170.push( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 0)), - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - DbValue::Composite(Composite::{ - name: result169, - values: array170, - }) - } - 38 => { - let result172 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let lifted160 = match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => { - DbValue::Domain(Domain::{ - name: result172, - value: LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 16)), - }) - } - 39 => { - let array173 : Array[LazyDbValue] = [] - for index174 = 0 - index174 < mbt_ffi_load32(iter_base + 12) - index174 = index174 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index174 * 4 + let result158 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - array173.push( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 0)), - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + Numbound::Included(result158) + } + 1 => { - DbValue::Array(array173) - } - 40 => { - let result175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted176 = match mbt_ffi_load8_u(iter_base + 16) { - 0 => - ValueBound::Included( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 20)), - ) - 1 => - ValueBound::Excluded( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 20)), - ) - 2 => ValueBound::Unbounded - _ => panic() - } - - let lifted177 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - ValueBound::Included( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 28)), - ) - 1 => - ValueBound::Excluded( - LazyDbValue::LazyDbValue(mbt_ffi_load32(iter_base + 28)), - ) - 2 => ValueBound::Unbounded - _ => panic() - } - - DbValue::Range(Range::{ - name: result175, - value: ValuesRange::{ start: lifted176, end: lifted177 }, - }) - } - 41 => DbValue::Null - 42 => { - let result178 = mbt_ffi_ptr2float_array( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let result159 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - DbValue::Vector(result178) - } - 43 => { - let result179 = mbt_ffi_ptr2float_array( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Numbound::Excluded(result159) + } + 2 => { - DbValue::Halfvec(result179) - } - 44 => { - let result180 = mbt_ffi_ptr2int_array( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - let result181 = mbt_ffi_ptr2float_array( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - DbValue::Sparsevec(SparseVec::{ - dim: mbt_ffi_load32(iter_base + 8), - indices: result180, - values: result181, - }) - } - _ => panic() - } + Numbound::Unbounded + } + _ => panic() + } - array183.push(lifted182) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + DbValue::Numrange(Numrange::{start : lifted157, end : lifted160}) + } + 31 => { - array185.push(DbRow::{ values: array183 }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 12)) - - Result::Ok(DbResult::{ columns: array134, rows: array185 }) - } - 1 => { - let lifted192 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result187 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result187) - } - 1 => { - let result188 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result188) - } - 2 => { - let result189 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result189) - } - 3 => { - let result190 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result190) - } - 4 => { - let result191 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result191) - } - _ => panic() - } + let lifted161 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - Result::Err(lifted192) - } - _ => panic() - } - let ret = lifted193 - mbt_ffi_free(ptr) - mbt_ffi_free(address125) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + Tsbound::Included(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 20)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 21)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}) + } + 1 => { -///| -pub fn DbTransaction::query_stream( - self : DbTransaction, - statement : String, - params : Array[DbValue], -) -> Result[DbResultStream, Error_] { - let cleanup_list : Array[Int] = [] + Tsbound::Excluded(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 20)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 21)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}) + } + 2 => { - let DbTransaction(handle) = self + Tsbound::Unbounded + } + _ => panic() + } - let ptr = mbt_ffi_str2ptr(statement) + let lifted162 = match (mbt_ffi_load8_u((iter_base) + 28)) { + 0 => { - let address125 = mbt_ffi_malloc(params.length() * 56) - for index126 = 0; index126 < params.length(); index126 = index126 + 1 { - let iter_elem : DbValue = params[index126] - let iter_base = address125 + index126 * 56 + Tsbound::Included(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 32), month : (mbt_ffi_load8_u((iter_base) + 36)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 37)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 40)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 41)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 42)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 44)).reinterpret_as_uint()}}) + } + 1 => { - match iter_elem { - Character(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload)) + Tsbound::Excluded(@types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 32), month : (mbt_ffi_load8_u((iter_base) + 36)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 37)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 40)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 41)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 42)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 44)).reinterpret_as_uint()}}) + } + 2 => { - () - } - Int2(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload0)) + Tsbound::Unbounded + } + _ => panic() + } - () - } - Int4(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store32(iter_base + 8, payload1) + DbValue::Tsrange(Tsrange::{start : lifted161, end : lifted162}) + } + 32 => { - () - } - Int8(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store64(iter_base + 8, payload2) + let lifted163 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - () - } - Float4(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_storef32(iter_base + 8, payload3) + Tstzbound::Included(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 20)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 21)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 28)}) + } + 1 => { - () - } - Float8(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_storef64(iter_base + 8, payload4) + Tstzbound::Excluded(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 20)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 21)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 22)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 28)}) + } + 2 => { - () - } - Numeric(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) + Tstzbound::Unbounded + } + _ => panic() + } - let ptr6 = mbt_ffi_str2ptr(payload5) - mbt_ffi_store32(iter_base + 12, payload5.length()) - mbt_ffi_store32(iter_base + 8, ptr6) - cleanup_list.push(ptr6) + let lifted164 = match (mbt_ffi_load8_u((iter_base) + 32)) { + 0 => { - () - } - Boolean(payload7) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store8(iter_base + 8, if payload7 { 1 } else { 0 }) + Tstzbound::Included(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 36), month : (mbt_ffi_load8_u((iter_base) + 40)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 41)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 44)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 45)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 46)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 48)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 52)}) + } + 1 => { - () - } - Text(payload8) => { - mbt_ffi_store8(iter_base + 0, 8) + Tstzbound::Excluded(@types.Timestamptz::{timestamp : @types.Timestamp::{date : @types.Date::{year : mbt_ffi_load32((iter_base) + 36), month : (mbt_ffi_load8_u((iter_base) + 40)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 41)).to_byte()}, time : @types.Time::{hour : (mbt_ffi_load8_u((iter_base) + 44)).to_byte(), minute : (mbt_ffi_load8_u((iter_base) + 45)).to_byte(), second : (mbt_ffi_load8_u((iter_base) + 46)).to_byte(), nanosecond : (mbt_ffi_load32((iter_base) + 48)).reinterpret_as_uint()}}, offset : mbt_ffi_load32((iter_base) + 52)}) + } + 2 => { - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(iter_base + 12, payload8.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - cleanup_list.push(ptr9) + Tstzbound::Unbounded + } + _ => panic() + } - () - } - Varchar(payload10) => { - mbt_ffi_store8(iter_base + 0, 9) + DbValue::Tstzrange(Tstzrange::{start : lifted163, end : lifted164}) + } + 33 => { - let ptr11 = mbt_ffi_str2ptr(payload10) - mbt_ffi_store32(iter_base + 12, payload10.length()) - mbt_ffi_store32(iter_base + 8, ptr11) - cleanup_list.push(ptr11) + let lifted165 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - () - } - Bpchar(payload12) => { - mbt_ffi_store8(iter_base + 0, 10) + Datebound::Included(@types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}) + } + 1 => { - let ptr13 = mbt_ffi_str2ptr(payload12) - mbt_ffi_store32(iter_base + 12, payload12.length()) - mbt_ffi_store32(iter_base + 8, ptr13) - cleanup_list.push(ptr13) + Datebound::Excluded(@types.Date::{year : mbt_ffi_load32((iter_base) + 12), month : (mbt_ffi_load8_u((iter_base) + 16)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 17)).to_byte()}) + } + 2 => { - () - } - Timestamp(payload14) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload14.date.year) - mbt_ffi_store8(iter_base + 12, payload14.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload14.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload14.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload14.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload14.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload14.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Timestamptz(payload15) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store32(iter_base + 8, payload15.timestamp.date.year) - mbt_ffi_store8(iter_base + 12, payload15.timestamp.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload15.timestamp.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload15.timestamp.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload15.timestamp.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload15.timestamp.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload15.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 24, payload15.offset) - - () - } - Date(payload16) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store32(iter_base + 8, payload16.year) - mbt_ffi_store8(iter_base + 12, payload16.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload16.day.to_int()) + Datebound::Unbounded + } + _ => panic() + } - () - } - Time(payload17) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store8(iter_base + 8, payload17.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload17.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload17.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload17.nanosecond.reinterpret_as_int(), - ) - - () - } - Timetz(payload18) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store8(iter_base + 8, payload18.time.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload18.time.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload18.time.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload18.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 16, payload18.offset) - - () - } - Interval(payload19) => { - mbt_ffi_store8(iter_base + 0, 16) - mbt_ffi_store32(iter_base + 8, payload19.months) - mbt_ffi_store32(iter_base + 12, payload19.days) - mbt_ffi_store64(iter_base + 16, payload19.microseconds) + let lifted166 = match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => { - () - } - Bytea(payload20) => { - mbt_ffi_store8(iter_base + 0, 17) + Datebound::Included(@types.Date::{year : mbt_ffi_load32((iter_base) + 24), month : (mbt_ffi_load8_u((iter_base) + 28)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 29)).to_byte()}) + } + 1 => { - let ptr21 = mbt_ffi_bytes2ptr(payload20) + Datebound::Excluded(@types.Date::{year : mbt_ffi_load32((iter_base) + 24), month : (mbt_ffi_load8_u((iter_base) + 28)).to_byte(), day : (mbt_ffi_load8_u((iter_base) + 29)).to_byte()}) + } + 2 => { - mbt_ffi_store32(iter_base + 12, payload20.length()) - mbt_ffi_store32(iter_base + 8, ptr21) - cleanup_list.push(ptr21) + Datebound::Unbounded + } + _ => panic() + } - () - } - Json(payload22) => { - mbt_ffi_store8(iter_base + 0, 18) + DbValue::Daterange(Daterange::{start : lifted165, end : lifted166}) + } + 34 => { - let ptr23 = mbt_ffi_str2ptr(payload22) - mbt_ffi_store32(iter_base + 12, payload22.length()) - mbt_ffi_store32(iter_base + 8, ptr23) - cleanup_list.push(ptr23) + DbValue::Money(mbt_ffi_load64((iter_base) + 8)) + } + 35 => { - () - } - Jsonb(payload24) => { - mbt_ffi_store8(iter_base + 0, 19) + DbValue::Oid((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 36 => { - let ptr25 = mbt_ffi_str2ptr(payload24) - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, ptr25) - cleanup_list.push(ptr25) + let result167 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Jsonpath(payload26) => { - mbt_ffi_store8(iter_base + 0, 20) + let result168 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let ptr27 = mbt_ffi_str2ptr(payload26) - mbt_ffi_store32(iter_base + 12, payload26.length()) - mbt_ffi_store32(iter_base + 8, ptr27) - cleanup_list.push(ptr27) + DbValue::Enumeration(Enumeration::{name : result167, value : result168}) + } + 37 => { - () - } - Xml(payload28) => { - mbt_ffi_store8(iter_base + 0, 21) + let result169 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr29 = mbt_ffi_str2ptr(payload28) - mbt_ffi_store32(iter_base + 12, payload28.length()) - mbt_ffi_store32(iter_base + 8, ptr29) - cleanup_list.push(ptr29) + let array170 : Array[LazyDbValue] = []; + for index171 = 0; index171 < (mbt_ffi_load32((iter_base) + 20)); index171 = index171 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index171 * 4) - () - } - Uuid(payload30) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store64( - iter_base + 8, - payload30.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 16, - payload30.low_bits.reinterpret_as_int64(), - ) - - () - } - Inet(payload31) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload31 { - Ipv4(payload32) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store8(iter_base + 10, payload32.0.to_int()) - mbt_ffi_store8(iter_base + 11, payload32.1.to_int()) - mbt_ffi_store8(iter_base + 12, payload32.2.to_int()) - mbt_ffi_store8(iter_base + 13, payload32.3.to_int()) - - () - } - Ipv6(payload33) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store16(iter_base + 10, payload33.0.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 12, payload33.1.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 14, payload33.2.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 16, payload33.3.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 18, payload33.4.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 20, payload33.5.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 22, payload33.6.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 24, payload33.7.reinterpret_as_int()) - - () - } - } - - () - } - Cidr(payload34) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload34 { - Ipv4(payload35) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store8(iter_base + 10, payload35.0.to_int()) - mbt_ffi_store8(iter_base + 11, payload35.1.to_int()) - mbt_ffi_store8(iter_base + 12, payload35.2.to_int()) - mbt_ffi_store8(iter_base + 13, payload35.3.to_int()) - - () - } - Ipv6(payload36) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store16(iter_base + 10, payload36.0.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 12, payload36.1.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 14, payload36.2.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 16, payload36.3.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 18, payload36.4.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 20, payload36.5.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 22, payload36.6.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 24, payload36.7.reinterpret_as_int()) - - () - } - } - - () - } - Macaddr(payload37) => { - mbt_ffi_store8(iter_base + 0, 25) - mbt_ffi_store8(iter_base + 8, payload37.octets.0.to_int()) - mbt_ffi_store8(iter_base + 9, payload37.octets.1.to_int()) - mbt_ffi_store8(iter_base + 10, payload37.octets.2.to_int()) - mbt_ffi_store8(iter_base + 11, payload37.octets.3.to_int()) - mbt_ffi_store8(iter_base + 12, payload37.octets.4.to_int()) - mbt_ffi_store8(iter_base + 13, payload37.octets.5.to_int()) - - () - } - Bit(payload38) => { - mbt_ffi_store8(iter_base + 0, 26) - - let address = mbt_ffi_malloc(payload38.length() * 1) - for index = 0; index < payload38.length(); index = index + 1 { - let iter_elem : Bool = payload38[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload38.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - Varbit(payload39) => { - mbt_ffi_store8(iter_base + 0, 27) - - let address40 = mbt_ffi_malloc(payload39.length() * 1) - for index41 = 0; index41 < payload39.length(); index41 = index41 + 1 { - let iter_elem : Bool = payload39[index41] - let iter_base = address40 + index41 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, address40) - cleanup_list.push(address40) - - () - } - Int4range(payload42) => { - mbt_ffi_store8(iter_base + 0, 28) - - match payload42.start { - Included(payload43) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload43) - - () - } - Excluded(payload44) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload44) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload42.end { - Included(payload46) => { - mbt_ffi_store8(iter_base + 16, 0) - mbt_ffi_store32(iter_base + 20, payload46) - - () - } - Excluded(payload47) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload47) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 16, 2) - - () - } - } - - () - } - Int8range(payload49) => { - mbt_ffi_store8(iter_base + 0, 29) - - match payload49.start { - Included(payload50) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store64(iter_base + 16, payload50) - - () - } - Excluded(payload51) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store64(iter_base + 16, payload51) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload49.end { - Included(payload53) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload53) - - () - } - Excluded(payload54) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload54) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 24, 2) - - () - } - } - - () - } - Numrange(payload56) => { - mbt_ffi_store8(iter_base + 0, 30) - - match payload56.start { - Included(payload57) => { - mbt_ffi_store8(iter_base + 8, 0) - - let ptr58 = mbt_ffi_str2ptr(payload57) - mbt_ffi_store32(iter_base + 16, payload57.length()) - mbt_ffi_store32(iter_base + 12, ptr58) - cleanup_list.push(ptr58) - - () - } - Excluded(payload59) => { - mbt_ffi_store8(iter_base + 8, 1) - - let ptr60 = mbt_ffi_str2ptr(payload59) - mbt_ffi_store32(iter_base + 16, payload59.length()) - mbt_ffi_store32(iter_base + 12, ptr60) - cleanup_list.push(ptr60) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload56.end { - Included(payload62) => { - mbt_ffi_store8(iter_base + 20, 0) - - let ptr63 = mbt_ffi_str2ptr(payload62) - mbt_ffi_store32(iter_base + 28, payload62.length()) - mbt_ffi_store32(iter_base + 24, ptr63) - cleanup_list.push(ptr63) - - () - } - Excluded(payload64) => { - mbt_ffi_store8(iter_base + 20, 1) - - let ptr65 = mbt_ffi_str2ptr(payload64) - mbt_ffi_store32(iter_base + 28, payload64.length()) - mbt_ffi_store32(iter_base + 24, ptr65) - cleanup_list.push(ptr65) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 20, 2) - - () - } - } - - () - } - Tsrange(payload67) => { - mbt_ffi_store8(iter_base + 0, 31) - - match payload67.start { - Included(payload68) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload68.date.year) - mbt_ffi_store8(iter_base + 16, payload68.date.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload68.date.day.to_int()) - mbt_ffi_store8(iter_base + 20, payload68.time.hour.to_int()) - mbt_ffi_store8(iter_base + 21, payload68.time.minute.to_int()) - mbt_ffi_store8(iter_base + 22, payload68.time.second.to_int()) - mbt_ffi_store32( - iter_base + 24, - payload68.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload69) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload69.date.year) - mbt_ffi_store8(iter_base + 16, payload69.date.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload69.date.day.to_int()) - mbt_ffi_store8(iter_base + 20, payload69.time.hour.to_int()) - mbt_ffi_store8(iter_base + 21, payload69.time.minute.to_int()) - mbt_ffi_store8(iter_base + 22, payload69.time.second.to_int()) - mbt_ffi_store32( - iter_base + 24, - payload69.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload67.end { - Included(payload71) => { - mbt_ffi_store8(iter_base + 28, 0) - mbt_ffi_store32(iter_base + 32, payload71.date.year) - mbt_ffi_store8(iter_base + 36, payload71.date.month.to_int()) - mbt_ffi_store8(iter_base + 37, payload71.date.day.to_int()) - mbt_ffi_store8(iter_base + 40, payload71.time.hour.to_int()) - mbt_ffi_store8(iter_base + 41, payload71.time.minute.to_int()) - mbt_ffi_store8(iter_base + 42, payload71.time.second.to_int()) - mbt_ffi_store32( - iter_base + 44, - payload71.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload72) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload72.date.year) - mbt_ffi_store8(iter_base + 36, payload72.date.month.to_int()) - mbt_ffi_store8(iter_base + 37, payload72.date.day.to_int()) - mbt_ffi_store8(iter_base + 40, payload72.time.hour.to_int()) - mbt_ffi_store8(iter_base + 41, payload72.time.minute.to_int()) - mbt_ffi_store8(iter_base + 42, payload72.time.second.to_int()) - mbt_ffi_store32( - iter_base + 44, - payload72.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 28, 2) - - () - } - } - - () - } - Tstzrange(payload74) => { - mbt_ffi_store8(iter_base + 0, 32) - - match payload74.start { - Included(payload75) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload75.timestamp.date.year) - mbt_ffi_store8( - iter_base + 16, - payload75.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 17, - payload75.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 20, - payload75.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 21, - payload75.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 22, - payload75.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 24, - payload75.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 28, payload75.offset) - - () - } - Excluded(payload76) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload76.timestamp.date.year) - mbt_ffi_store8( - iter_base + 16, - payload76.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 17, - payload76.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 20, - payload76.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 21, - payload76.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 22, - payload76.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 24, - payload76.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 28, payload76.offset) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload74.end { - Included(payload78) => { - mbt_ffi_store8(iter_base + 32, 0) - mbt_ffi_store32(iter_base + 36, payload78.timestamp.date.year) - mbt_ffi_store8( - iter_base + 40, - payload78.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 41, - payload78.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 44, - payload78.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 45, - payload78.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 46, - payload78.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 48, - payload78.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 52, payload78.offset) - - () - } - Excluded(payload79) => { - mbt_ffi_store8(iter_base + 32, 1) - mbt_ffi_store32(iter_base + 36, payload79.timestamp.date.year) - mbt_ffi_store8( - iter_base + 40, - payload79.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 41, - payload79.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 44, - payload79.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 45, - payload79.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 46, - payload79.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 48, - payload79.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 52, payload79.offset) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 32, 2) - - () - } - } - - () - } - Daterange(payload81) => { - mbt_ffi_store8(iter_base + 0, 33) - - match payload81.start { - Included(payload82) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload82.year) - mbt_ffi_store8(iter_base + 16, payload82.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload82.day.to_int()) - - () - } - Excluded(payload83) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload83.year) - mbt_ffi_store8(iter_base + 16, payload83.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload83.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload81.end { - Included(payload85) => { - mbt_ffi_store8(iter_base + 20, 0) - mbt_ffi_store32(iter_base + 24, payload85.year) - mbt_ffi_store8(iter_base + 28, payload85.month.to_int()) - mbt_ffi_store8(iter_base + 29, payload85.day.to_int()) - - () - } - Excluded(payload86) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload86.year) - mbt_ffi_store8(iter_base + 28, payload86.month.to_int()) - mbt_ffi_store8(iter_base + 29, payload86.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 20, 2) - - () - } - } - - () - } - Money(payload88) => { - mbt_ffi_store8(iter_base + 0, 34) - mbt_ffi_store64(iter_base + 8, payload88) + array170.push(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 0))) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - Oid(payload89) => { - mbt_ffi_store8(iter_base + 0, 35) - mbt_ffi_store32(iter_base + 8, payload89.reinterpret_as_int()) + DbValue::Composite(Composite::{name : result169, values : array170}) + } + 38 => { - () - } - Enumeration(payload90) => { - mbt_ffi_store8(iter_base + 0, 36) + let result172 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let ptr91 = mbt_ffi_str2ptr(payload90.name) - mbt_ffi_store32(iter_base + 12, payload90.name.length()) - mbt_ffi_store32(iter_base + 8, ptr91) + DbValue::Domain(Domain::{name : result172, value : LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 16))}) + } + 39 => { - let ptr92 = mbt_ffi_str2ptr(payload90.value) - mbt_ffi_store32(iter_base + 20, payload90.value.length()) - mbt_ffi_store32(iter_base + 16, ptr92) - cleanup_list.push(ptr91) - cleanup_list.push(ptr92) + let array173 : Array[LazyDbValue] = []; + for index174 = 0; index174 < (mbt_ffi_load32((iter_base) + 12)); index174 = index174 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index174 * 4) - () - } - Composite(payload93) => { - mbt_ffi_store8(iter_base + 0, 37) - - let ptr94 = mbt_ffi_str2ptr(payload93.name) - mbt_ffi_store32(iter_base + 12, payload93.name.length()) - mbt_ffi_store32(iter_base + 8, ptr94) - - let address96 = mbt_ffi_malloc(payload93.values.length() * 4) - for index97 = 0 - index97 < payload93.values.length() - index97 = index97 + 1 { - let iter_elem : LazyDbValue = payload93.values[index97] - let iter_base = address96 + index97 * 4 - - let LazyDbValue(handle95) = iter_elem - mbt_ffi_store32(iter_base + 0, handle95) - } - mbt_ffi_store32(iter_base + 20, payload93.values.length()) - mbt_ffi_store32(iter_base + 16, address96) - cleanup_list.push(ptr94) - cleanup_list.push(address96) - - () - } - Domain(payload98) => { - mbt_ffi_store8(iter_base + 0, 38) + array173.push(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 0))) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let ptr99 = mbt_ffi_str2ptr(payload98.name) - mbt_ffi_store32(iter_base + 12, payload98.name.length()) - mbt_ffi_store32(iter_base + 8, ptr99) + DbValue::Array(array173) + } + 40 => { - let LazyDbValue(handle100) = payload98.value - mbt_ffi_store32(iter_base + 16, handle100) - cleanup_list.push(ptr99) + let result175 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Array(payload101) => { - mbt_ffi_store8(iter_base + 0, 39) - - let address103 = mbt_ffi_malloc(payload101.length() * 4) - for index104 = 0 - index104 < payload101.length() - index104 = index104 + 1 { - let iter_elem : LazyDbValue = payload101[index104] - let iter_base = address103 + index104 * 4 - - let LazyDbValue(handle102) = iter_elem - mbt_ffi_store32(iter_base + 0, handle102) - } - mbt_ffi_store32(iter_base + 12, payload101.length()) - mbt_ffi_store32(iter_base + 8, address103) - cleanup_list.push(address103) - - () - } - Range(payload105) => { - mbt_ffi_store8(iter_base + 0, 40) + let lifted176 = match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => { - let ptr106 = mbt_ffi_str2ptr(payload105.name) - mbt_ffi_store32(iter_base + 12, payload105.name.length()) - mbt_ffi_store32(iter_base + 8, ptr106) + ValueBound::Included(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 20))) + } + 1 => { - match payload105.value.start { - Included(payload107) => { - mbt_ffi_store8(iter_base + 16, 0) + ValueBound::Excluded(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 20))) + } + 2 => { - let LazyDbValue(handle108) = payload107 - mbt_ffi_store32(iter_base + 20, handle108) + ValueBound::Unbounded + } + _ => panic() + } - () - } - Excluded(payload109) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted177 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let LazyDbValue(handle110) = payload109 - mbt_ffi_store32(iter_base + 20, handle110) + ValueBound::Included(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 28))) + } + 1 => { - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 16, 2) + ValueBound::Excluded(LazyDbValue::LazyDbValue(mbt_ffi_load32((iter_base) + 28))) + } + 2 => { - () - } - } + ValueBound::Unbounded + } + _ => panic() + } - match payload105.value.end { - Included(payload112) => { - mbt_ffi_store8(iter_base + 24, 0) + DbValue::Range(Range::{name : result175, value : ValuesRange::{start : lifted176, end : lifted177}}) + } + 41 => { - let LazyDbValue(handle113) = payload112 - mbt_ffi_store32(iter_base + 28, handle113) + DbValue::Null + } + 42 => { - () - } - Excluded(payload114) => { - mbt_ffi_store8(iter_base + 24, 1) + let result178 = mbt_ffi_ptr2float_array(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let LazyDbValue(handle115) = payload114 - mbt_ffi_store32(iter_base + 28, handle115) + DbValue::Vector(result178) + } + 43 => { - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 24, 2) + let result179 = mbt_ffi_ptr2float_array(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } - cleanup_list.push(ptr106) + DbValue::Halfvec(result179) + } + 44 => { - () - } - Null => { - mbt_ffi_store8(iter_base + 0, 41) + let result180 = mbt_ffi_ptr2int_array(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - () - } - Vector(payload118) => { - mbt_ffi_store8(iter_base + 0, 42) + let result181 = mbt_ffi_ptr2float_array(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let ptr119 = mbt_ffi_float_array2ptr(payload118) + DbValue::Sparsevec(SparseVec::{dim : mbt_ffi_load32((iter_base) + 8), indices : result180, values : result181}) + } + _ => panic() + } - mbt_ffi_store32(iter_base + 12, payload118.length()) - mbt_ffi_store32(iter_base + 8, ptr119) - cleanup_list.push(ptr119) + array183.push(lifted182) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Halfvec(payload120) => { - mbt_ffi_store8(iter_base + 0, 43) + array185.push(DbRow::{values : array183}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 12)) - let ptr121 = mbt_ffi_float_array2ptr(payload120) + Result::Ok(DbResult::{columns : array134, rows : array185}) + } + 1 => { - mbt_ffi_store32(iter_base + 12, payload120.length()) - mbt_ffi_store32(iter_base + 8, ptr121) - cleanup_list.push(ptr121) + let lifted192 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - () - } - Sparsevec(payload122) => { - mbt_ffi_store8(iter_base + 0, 44) - mbt_ffi_store32(iter_base + 8, payload122.dim) + let result187 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr123 = mbt_ffi_int_array2ptr(payload122.indices) + Error_::ConnectionFailure(result187) + } + 1 => { - mbt_ffi_store32(iter_base + 16, payload122.indices.length()) - mbt_ffi_store32(iter_base + 12, ptr123) + let result188 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr124 = mbt_ffi_float_array2ptr(payload122.values) + Error_::QueryParameterFailure(result188) + } + 2 => { - mbt_ffi_store32(iter_base + 24, payload122.values.length()) - mbt_ffi_store32(iter_base + 20, ptr124) - cleanup_list.push(ptr123) - cleanup_list.push(ptr124) + let result189 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - } - } - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbTransactionQueryStream( - handle, - ptr, - statement.length(), - address125, - params.length(), - return_area, - ) - - let lifted131 = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok( - DbResultStream::DbResultStream(mbt_ffi_load32(return_area + 4)), - ) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result127 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result127) - } - 2 => { - let result128 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result128) - } - 3 => { - let result129 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result129) - } - 4 => { - let result130 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result130) - } - _ => panic() + Error_::QueryExecutionFailure(result189) + } + 3 => { + + let result190 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result190) + } + 4 => { + + let result191 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result191) + } + _ => panic() + } + + Result::Err(lifted192) + } + _ => panic() } + let ret = lifted193 + mbt_ffi_free(ptr) + mbt_ffi_free(address125) + mbt_ffi_free(return_area) - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted131 - mbt_ffi_free(ptr) - mbt_ffi_free(address125) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + cleanup_list.each(mbt_ffi_free) + return ret +} ///| -pub fn DbTransaction::execute( - self : DbTransaction, - statement : String, - params : Array[DbValue], -) -> Result[UInt64, Error_] { - let cleanup_list : Array[Int] = [] +pub fn DbTransaction::query_stream(self : DbTransaction, statement : String, params : Array[DbValue]) -> Result[DbResultStream, Error_] { + let cleanup_list : Array[Int] = [] + + let DbTransaction(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address125 = mbt_ffi_malloc((params).length() * 56); + for index126 = 0; index126 < (params).length(); index126 = index126 + 1 { + let iter_elem : DbValue = (params)[(index126)] + let iter_base = address125 + (index126 * 56); + + match iter_elem { + Character(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload)) + + () + } + Int2(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload0)) + + () + } + Int4(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store32((iter_base) + 8, payload1) + + () + } + Int8(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store64((iter_base) + 8, payload2) + + () + } + Float4(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_storef32((iter_base) + 8, payload3) + + () + } + Float8(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_storef64((iter_base) + 8, payload4) + + () + } + Numeric(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + let ptr6 = mbt_ffi_str2ptr(payload5) + mbt_ffi_store32((iter_base) + 12, payload5.length()) + mbt_ffi_store32((iter_base) + 8, ptr6) + cleanup_list.push(ptr6) + + () + } + Boolean(payload7) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store8((iter_base) + 8, (if payload7 { 1 } else { 0 })) + + () + } + Text(payload8) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((iter_base) + 12, payload8.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + cleanup_list.push(ptr9) + + () + } + Varchar(payload10) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr11 = mbt_ffi_str2ptr(payload10) + mbt_ffi_store32((iter_base) + 12, payload10.length()) + mbt_ffi_store32((iter_base) + 8, ptr11) + cleanup_list.push(ptr11) + + () + } + Bpchar(payload12) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + let ptr13 = mbt_ffi_str2ptr(payload12) + mbt_ffi_store32((iter_base) + 12, payload12.length()) + mbt_ffi_store32((iter_base) + 8, ptr13) + cleanup_list.push(ptr13) + + () + } + Timestamp(payload14) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, ((payload14).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload14).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload14).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload14).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload14).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload14).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload14).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamptz(payload15) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store32((iter_base) + 8, (((payload15).timestamp).date).year) + mbt_ffi_store8((iter_base) + 12, ((((payload15).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((((payload15).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, ((((payload15).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload15).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, ((((payload15).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, ((((payload15).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 24, (payload15).offset) + + () + } + Date(payload16) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store32((iter_base) + 8, (payload16).year) + mbt_ffi_store8((iter_base) + 12, ((payload16).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload16).day).to_int()) + + () + } + Time(payload17) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store8((iter_base) + 8, ((payload17).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, ((payload17).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, ((payload17).second).to_int()) + mbt_ffi_store32((iter_base) + 12, ((payload17).nanosecond).reinterpret_as_int()) + + () + } + Timetz(payload18) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store8((iter_base) + 8, (((payload18).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, (((payload18).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, (((payload18).time).second).to_int()) + mbt_ffi_store32((iter_base) + 12, (((payload18).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 16, (payload18).offset) + + () + } + Interval(payload19) => { + mbt_ffi_store8((iter_base) + 0, (16)) + mbt_ffi_store32((iter_base) + 8, (payload19).months) + mbt_ffi_store32((iter_base) + 12, (payload19).days) + mbt_ffi_store64((iter_base) + 16, (payload19).microseconds) + + () + } + Bytea(payload20) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let ptr21 = mbt_ffi_bytes2ptr(payload20) + + mbt_ffi_store32((iter_base) + 12, payload20.length()) + mbt_ffi_store32((iter_base) + 8, ptr21) + cleanup_list.push(ptr21) + + () + } + Json(payload22) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let ptr23 = mbt_ffi_str2ptr(payload22) + mbt_ffi_store32((iter_base) + 12, payload22.length()) + mbt_ffi_store32((iter_base) + 8, ptr23) + cleanup_list.push(ptr23) + + () + } + Jsonb(payload24) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let ptr25 = mbt_ffi_str2ptr(payload24) + mbt_ffi_store32((iter_base) + 12, payload24.length()) + mbt_ffi_store32((iter_base) + 8, ptr25) + cleanup_list.push(ptr25) + + () + } + Jsonpath(payload26) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let ptr27 = mbt_ffi_str2ptr(payload26) + mbt_ffi_store32((iter_base) + 12, payload26.length()) + mbt_ffi_store32((iter_base) + 8, ptr27) + cleanup_list.push(ptr27) + + () + } + Xml(payload28) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + let ptr29 = mbt_ffi_str2ptr(payload28) + mbt_ffi_store32((iter_base) + 12, payload28.length()) + mbt_ffi_store32((iter_base) + 8, ptr29) + cleanup_list.push(ptr29) + + () + } + Uuid(payload30) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store64((iter_base) + 8, ((payload30).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload30).low_bits).reinterpret_as_int64()) + + () + } + Inet(payload31) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match payload31 { + Ipv4(payload32) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store8((iter_base) + 10, ((payload32).0).to_int()) + mbt_ffi_store8((iter_base) + 11, ((payload32).1).to_int()) + mbt_ffi_store8((iter_base) + 12, ((payload32).2).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload32).3).to_int()) + + () + } + Ipv6(payload33) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store16((iter_base) + 10, ((payload33).0).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 12, ((payload33).1).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 14, ((payload33).2).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 16, ((payload33).3).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 18, ((payload33).4).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 20, ((payload33).5).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 22, ((payload33).6).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 24, ((payload33).7).reinterpret_as_int()) + + () + } + } + + () + } + Cidr(payload34) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match payload34 { + Ipv4(payload35) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store8((iter_base) + 10, ((payload35).0).to_int()) + mbt_ffi_store8((iter_base) + 11, ((payload35).1).to_int()) + mbt_ffi_store8((iter_base) + 12, ((payload35).2).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload35).3).to_int()) + + () + } + Ipv6(payload36) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store16((iter_base) + 10, ((payload36).0).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 12, ((payload36).1).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 14, ((payload36).2).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 16, ((payload36).3).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 18, ((payload36).4).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 20, ((payload36).5).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 22, ((payload36).6).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 24, ((payload36).7).reinterpret_as_int()) + + () + } + } + + () + } + Macaddr(payload37) => { + mbt_ffi_store8((iter_base) + 0, (25)) + mbt_ffi_store8((iter_base) + 8, (((payload37).octets).0).to_int()) + mbt_ffi_store8((iter_base) + 9, (((payload37).octets).1).to_int()) + mbt_ffi_store8((iter_base) + 10, (((payload37).octets).2).to_int()) + mbt_ffi_store8((iter_base) + 11, (((payload37).octets).3).to_int()) + mbt_ffi_store8((iter_base) + 12, (((payload37).octets).4).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload37).octets).5).to_int()) + + () + } + Bit(payload38) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let address = mbt_ffi_malloc((payload38).length() * 1); + for index = 0; index < (payload38).length(); index = index + 1 { + let iter_elem : Bool = (payload38)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload38).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + Varbit(payload39) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + let address40 = mbt_ffi_malloc((payload39).length() * 1); + for index41 = 0; index41 < (payload39).length(); index41 = index41 + 1 { + let iter_elem : Bool = (payload39)[(index41)] + let iter_base = address40 + (index41 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload39).length()) + mbt_ffi_store32((iter_base) + 8, address40) + cleanup_list.push(address40) + + () + } + Int4range(payload42) => { + mbt_ffi_store8((iter_base) + 0, (28)) + + match (payload42).start { + Included(payload43) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, payload43) + + () + } + Excluded(payload44) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload44) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload42).end { + Included(payload46) => { + mbt_ffi_store8((iter_base) + 16, (0)) + mbt_ffi_store32((iter_base) + 20, payload46) + + () + } + Excluded(payload47) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload47) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 16, (2)) + + () + } + } + + () + } + Int8range(payload49) => { + mbt_ffi_store8((iter_base) + 0, (29)) + + match (payload49).start { + Included(payload50) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store64((iter_base) + 16, payload50) + + () + } + Excluded(payload51) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store64((iter_base) + 16, payload51) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload49).end { + Included(payload53) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload53) + + () + } + Excluded(payload54) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, payload54) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 24, (2)) + + () + } + } + + () + } + Numrange(payload56) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + match (payload56).start { + Included(payload57) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + let ptr58 = mbt_ffi_str2ptr(payload57) + mbt_ffi_store32((iter_base) + 16, payload57.length()) + mbt_ffi_store32((iter_base) + 12, ptr58) + cleanup_list.push(ptr58) + + () + } + Excluded(payload59) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr60 = mbt_ffi_str2ptr(payload59) + mbt_ffi_store32((iter_base) + 16, payload59.length()) + mbt_ffi_store32((iter_base) + 12, ptr60) + cleanup_list.push(ptr60) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload56).end { + Included(payload62) => { + mbt_ffi_store8((iter_base) + 20, (0)) + + let ptr63 = mbt_ffi_str2ptr(payload62) + mbt_ffi_store32((iter_base) + 28, payload62.length()) + mbt_ffi_store32((iter_base) + 24, ptr63) + cleanup_list.push(ptr63) + + () + } + Excluded(payload64) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let ptr65 = mbt_ffi_str2ptr(payload64) + mbt_ffi_store32((iter_base) + 28, payload64.length()) + mbt_ffi_store32((iter_base) + 24, ptr65) + cleanup_list.push(ptr65) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 20, (2)) + + () + } + } + + () + } + Tsrange(payload67) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + match (payload67).start { + Included(payload68) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, ((payload68).date).year) + mbt_ffi_store8((iter_base) + 16, (((payload68).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload68).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, (((payload68).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, (((payload68).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, (((payload68).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, (((payload68).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload69) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, ((payload69).date).year) + mbt_ffi_store8((iter_base) + 16, (((payload69).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload69).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, (((payload69).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, (((payload69).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, (((payload69).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, (((payload69).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload67).end { + Included(payload71) => { + mbt_ffi_store8((iter_base) + 28, (0)) + mbt_ffi_store32((iter_base) + 32, ((payload71).date).year) + mbt_ffi_store8((iter_base) + 36, (((payload71).date).month).to_int()) + mbt_ffi_store8((iter_base) + 37, (((payload71).date).day).to_int()) + mbt_ffi_store8((iter_base) + 40, (((payload71).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 41, (((payload71).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 42, (((payload71).time).second).to_int()) + mbt_ffi_store32((iter_base) + 44, (((payload71).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload72) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, ((payload72).date).year) + mbt_ffi_store8((iter_base) + 36, (((payload72).date).month).to_int()) + mbt_ffi_store8((iter_base) + 37, (((payload72).date).day).to_int()) + mbt_ffi_store8((iter_base) + 40, (((payload72).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 41, (((payload72).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 42, (((payload72).time).second).to_int()) + mbt_ffi_store32((iter_base) + 44, (((payload72).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 28, (2)) + + () + } + } + + () + } + Tstzrange(payload74) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + match (payload74).start { + Included(payload75) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, (((payload75).timestamp).date).year) + mbt_ffi_store8((iter_base) + 16, ((((payload75).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload75).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, ((((payload75).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, ((((payload75).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, ((((payload75).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, ((((payload75).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 28, (payload75).offset) + + () + } + Excluded(payload76) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, (((payload76).timestamp).date).year) + mbt_ffi_store8((iter_base) + 16, ((((payload76).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload76).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, ((((payload76).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, ((((payload76).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, ((((payload76).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, ((((payload76).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 28, (payload76).offset) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload74).end { + Included(payload78) => { + mbt_ffi_store8((iter_base) + 32, (0)) + mbt_ffi_store32((iter_base) + 36, (((payload78).timestamp).date).year) + mbt_ffi_store8((iter_base) + 40, ((((payload78).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 41, ((((payload78).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 44, ((((payload78).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 45, ((((payload78).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 46, ((((payload78).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 48, ((((payload78).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 52, (payload78).offset) + + () + } + Excluded(payload79) => { + mbt_ffi_store8((iter_base) + 32, (1)) + mbt_ffi_store32((iter_base) + 36, (((payload79).timestamp).date).year) + mbt_ffi_store8((iter_base) + 40, ((((payload79).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 41, ((((payload79).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 44, ((((payload79).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 45, ((((payload79).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 46, ((((payload79).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 48, ((((payload79).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 52, (payload79).offset) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 32, (2)) + + () + } + } + + () + } + Daterange(payload81) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + match (payload81).start { + Included(payload82) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, (payload82).year) + mbt_ffi_store8((iter_base) + 16, ((payload82).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((payload82).day).to_int()) + + () + } + Excluded(payload83) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, (payload83).year) + mbt_ffi_store8((iter_base) + 16, ((payload83).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((payload83).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload81).end { + Included(payload85) => { + mbt_ffi_store8((iter_base) + 20, (0)) + mbt_ffi_store32((iter_base) + 24, (payload85).year) + mbt_ffi_store8((iter_base) + 28, ((payload85).month).to_int()) + mbt_ffi_store8((iter_base) + 29, ((payload85).day).to_int()) + + () + } + Excluded(payload86) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload86).year) + mbt_ffi_store8((iter_base) + 28, ((payload86).month).to_int()) + mbt_ffi_store8((iter_base) + 29, ((payload86).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 20, (2)) + + () + } + } + + () + } + Money(payload88) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store64((iter_base) + 8, payload88) + + () + } + Oid(payload89) => { + mbt_ffi_store8((iter_base) + 0, (35)) + mbt_ffi_store32((iter_base) + 8, (payload89).reinterpret_as_int()) + + () + } + Enumeration(payload90) => { + mbt_ffi_store8((iter_base) + 0, (36)) + + let ptr91 = mbt_ffi_str2ptr((payload90).name) + mbt_ffi_store32((iter_base) + 12, (payload90).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr91) + + let ptr92 = mbt_ffi_str2ptr((payload90).value) + mbt_ffi_store32((iter_base) + 20, (payload90).value.length()) + mbt_ffi_store32((iter_base) + 16, ptr92) + cleanup_list.push(ptr91) + cleanup_list.push(ptr92) + + () + } + Composite(payload93) => { + mbt_ffi_store8((iter_base) + 0, (37)) + + let ptr94 = mbt_ffi_str2ptr((payload93).name) + mbt_ffi_store32((iter_base) + 12, (payload93).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr94) + + let address96 = mbt_ffi_malloc(((payload93).values).length() * 4); + for index97 = 0; index97 < ((payload93).values).length(); index97 = index97 + 1 { + let iter_elem : LazyDbValue = ((payload93).values)[(index97)] + let iter_base = address96 + (index97 * 4); + + let LazyDbValue(handle95) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle95) + + } + mbt_ffi_store32((iter_base) + 20, ((payload93).values).length()) + mbt_ffi_store32((iter_base) + 16, address96) + cleanup_list.push(ptr94) + cleanup_list.push(address96) + + () + } + Domain(payload98) => { + mbt_ffi_store8((iter_base) + 0, (38)) + + let ptr99 = mbt_ffi_str2ptr((payload98).name) + mbt_ffi_store32((iter_base) + 12, (payload98).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr99) + + let LazyDbValue(handle100) = (payload98).value + mbt_ffi_store32((iter_base) + 16, handle100) + cleanup_list.push(ptr99) + + () + } + Array(payload101) => { + mbt_ffi_store8((iter_base) + 0, (39)) + + let address103 = mbt_ffi_malloc((payload101).length() * 4); + for index104 = 0; index104 < (payload101).length(); index104 = index104 + 1 { + let iter_elem : LazyDbValue = (payload101)[(index104)] + let iter_base = address103 + (index104 * 4); + + let LazyDbValue(handle102) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle102) + + } + mbt_ffi_store32((iter_base) + 12, (payload101).length()) + mbt_ffi_store32((iter_base) + 8, address103) + cleanup_list.push(address103) + + () + } + Range(payload105) => { + mbt_ffi_store8((iter_base) + 0, (40)) + + let ptr106 = mbt_ffi_str2ptr((payload105).name) + mbt_ffi_store32((iter_base) + 12, (payload105).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr106) + + match ((payload105).value).start { + Included(payload107) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let LazyDbValue(handle108) = payload107 + mbt_ffi_store32((iter_base) + 20, handle108) + + () + } + Excluded(payload109) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let LazyDbValue(handle110) = payload109 + mbt_ffi_store32((iter_base) + 20, handle110) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 16, (2)) + + () + } + } + + match ((payload105).value).end { + Included(payload112) => { + mbt_ffi_store8((iter_base) + 24, (0)) + + let LazyDbValue(handle113) = payload112 + mbt_ffi_store32((iter_base) + 28, handle113) + + () + } + Excluded(payload114) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let LazyDbValue(handle115) = payload114 + mbt_ffi_store32((iter_base) + 28, handle115) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 24, (2)) + + () + } + } + cleanup_list.push(ptr106) + + () + } + Null => { + mbt_ffi_store8((iter_base) + 0, (41)) - let DbTransaction(handle) = self + () + } + Vector(payload118) => { + mbt_ffi_store8((iter_base) + 0, (42)) - let ptr = mbt_ffi_str2ptr(statement) + let ptr119 = mbt_ffi_float_array2ptr(payload118) + + mbt_ffi_store32((iter_base) + 12, payload118.length()) + mbt_ffi_store32((iter_base) + 8, ptr119) + cleanup_list.push(ptr119) - let address125 = mbt_ffi_malloc(params.length() * 56) - for index126 = 0; index126 < params.length(); index126 = index126 + 1 { - let iter_elem : DbValue = params[index126] - let iter_base = address125 + index126 * 56 + () + } + Halfvec(payload120) => { + mbt_ffi_store8((iter_base) + 0, (43)) - match iter_elem { - Character(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload)) + let ptr121 = mbt_ffi_float_array2ptr(payload120) - () - } - Int2(payload0) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload0)) + mbt_ffi_store32((iter_base) + 12, payload120.length()) + mbt_ffi_store32((iter_base) + 8, ptr121) + cleanup_list.push(ptr121) - () - } - Int4(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store32(iter_base + 8, payload1) + () + } + Sparsevec(payload122) => { + mbt_ffi_store8((iter_base) + 0, (44)) + mbt_ffi_store32((iter_base) + 8, (payload122).dim) - () - } - Int8(payload2) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store64(iter_base + 8, payload2) + let ptr123 = mbt_ffi_int_array2ptr((payload122).indices) - () - } - Float4(payload3) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_storef32(iter_base + 8, payload3) + mbt_ffi_store32((iter_base) + 16, (payload122).indices.length()) + mbt_ffi_store32((iter_base) + 12, ptr123) - () - } - Float8(payload4) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_storef64(iter_base + 8, payload4) + let ptr124 = mbt_ffi_float_array2ptr((payload122).values) - () - } - Numeric(payload5) => { - mbt_ffi_store8(iter_base + 0, 6) + mbt_ffi_store32((iter_base) + 24, (payload122).values.length()) + mbt_ffi_store32((iter_base) + 20, ptr124) + cleanup_list.push(ptr123) + cleanup_list.push(ptr124) - let ptr6 = mbt_ffi_str2ptr(payload5) - mbt_ffi_store32(iter_base + 12, payload5.length()) - mbt_ffi_store32(iter_base + 8, ptr6) - cleanup_list.push(ptr6) + () + } + } - () } - Boolean(payload7) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store8(iter_base + 8, if payload7 { 1 } else { 0 }) + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbTransactionQueryStream(handle, ptr, statement.length(), address125, (params).length(), return_area); - () - } - Text(payload8) => { - mbt_ffi_store8(iter_base + 0, 8) + let lifted131 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - let ptr9 = mbt_ffi_str2ptr(payload8) - mbt_ffi_store32(iter_base + 12, payload8.length()) - mbt_ffi_store32(iter_base + 8, ptr9) - cleanup_list.push(ptr9) + Result::Ok(DbResultStream::DbResultStream(mbt_ffi_load32((return_area) + 4))) + } + 1 => { - () - } - Varchar(payload10) => { - mbt_ffi_store8(iter_base + 0, 9) + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - let ptr11 = mbt_ffi_str2ptr(payload10) - mbt_ffi_store32(iter_base + 12, payload10.length()) - mbt_ffi_store32(iter_base + 8, ptr11) - cleanup_list.push(ptr11) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Bpchar(payload12) => { - mbt_ffi_store8(iter_base + 0, 10) + Error_::ConnectionFailure(result) + } + 1 => { - let ptr13 = mbt_ffi_str2ptr(payload12) - mbt_ffi_store32(iter_base + 12, payload12.length()) - mbt_ffi_store32(iter_base + 8, ptr13) - cleanup_list.push(ptr13) + let result127 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Timestamp(payload14) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload14.date.year) - mbt_ffi_store8(iter_base + 12, payload14.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload14.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload14.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload14.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload14.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload14.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Timestamptz(payload15) => { - mbt_ffi_store8(iter_base + 0, 12) - mbt_ffi_store32(iter_base + 8, payload15.timestamp.date.year) - mbt_ffi_store8(iter_base + 12, payload15.timestamp.date.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload15.timestamp.date.day.to_int()) - mbt_ffi_store8(iter_base + 16, payload15.timestamp.time.hour.to_int()) - mbt_ffi_store8(iter_base + 17, payload15.timestamp.time.minute.to_int()) - mbt_ffi_store8(iter_base + 18, payload15.timestamp.time.second.to_int()) - mbt_ffi_store32( - iter_base + 20, - payload15.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 24, payload15.offset) - - () - } - Date(payload16) => { - mbt_ffi_store8(iter_base + 0, 13) - mbt_ffi_store32(iter_base + 8, payload16.year) - mbt_ffi_store8(iter_base + 12, payload16.month.to_int()) - mbt_ffi_store8(iter_base + 13, payload16.day.to_int()) + Error_::QueryParameterFailure(result127) + } + 2 => { - () - } - Time(payload17) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store8(iter_base + 8, payload17.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload17.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload17.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload17.nanosecond.reinterpret_as_int(), - ) - - () - } - Timetz(payload18) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store8(iter_base + 8, payload18.time.hour.to_int()) - mbt_ffi_store8(iter_base + 9, payload18.time.minute.to_int()) - mbt_ffi_store8(iter_base + 10, payload18.time.second.to_int()) - mbt_ffi_store32( - iter_base + 12, - payload18.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 16, payload18.offset) - - () - } - Interval(payload19) => { - mbt_ffi_store8(iter_base + 0, 16) - mbt_ffi_store32(iter_base + 8, payload19.months) - mbt_ffi_store32(iter_base + 12, payload19.days) - mbt_ffi_store64(iter_base + 16, payload19.microseconds) + let result128 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Bytea(payload20) => { - mbt_ffi_store8(iter_base + 0, 17) + Error_::QueryExecutionFailure(result128) + } + 3 => { - let ptr21 = mbt_ffi_bytes2ptr(payload20) + let result129 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - mbt_ffi_store32(iter_base + 12, payload20.length()) - mbt_ffi_store32(iter_base + 8, ptr21) - cleanup_list.push(ptr21) + Error_::QueryResponseFailure(result129) + } + 4 => { - () - } - Json(payload22) => { - mbt_ffi_store8(iter_base + 0, 18) + let result130 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr23 = mbt_ffi_str2ptr(payload22) - mbt_ffi_store32(iter_base + 12, payload22.length()) - mbt_ffi_store32(iter_base + 8, ptr23) - cleanup_list.push(ptr23) + Error_::Other(result130) + } + _ => panic() + } - () + Result::Err(lifted) + } + _ => panic() } - Jsonb(payload24) => { - mbt_ffi_store8(iter_base + 0, 19) + let ret = lifted131 + mbt_ffi_free(ptr) + mbt_ffi_free(address125) + mbt_ffi_free(return_area) - let ptr25 = mbt_ffi_str2ptr(payload24) - mbt_ffi_store32(iter_base + 12, payload24.length()) - mbt_ffi_store32(iter_base + 8, ptr25) - cleanup_list.push(ptr25) + cleanup_list.each(mbt_ffi_free) + return ret - () - } - Jsonpath(payload26) => { - mbt_ffi_store8(iter_base + 0, 20) +} +///| +pub fn DbTransaction::execute(self : DbTransaction, statement : String, params : Array[DbValue]) -> Result[UInt64, Error_] { + let cleanup_list : Array[Int] = [] + + let DbTransaction(handle) = self + + let ptr = mbt_ffi_str2ptr(statement) + + let address125 = mbt_ffi_malloc((params).length() * 56); + for index126 = 0; index126 < (params).length(); index126 = index126 + 1 { + let iter_elem : DbValue = (params)[(index126)] + let iter_base = address125 + (index126 * 56); + + match iter_elem { + Character(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload)) + + () + } + Int2(payload0) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload0)) + + () + } + Int4(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store32((iter_base) + 8, payload1) + + () + } + Int8(payload2) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store64((iter_base) + 8, payload2) + + () + } + Float4(payload3) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_storef32((iter_base) + 8, payload3) + + () + } + Float8(payload4) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_storef64((iter_base) + 8, payload4) + + () + } + Numeric(payload5) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + let ptr6 = mbt_ffi_str2ptr(payload5) + mbt_ffi_store32((iter_base) + 12, payload5.length()) + mbt_ffi_store32((iter_base) + 8, ptr6) + cleanup_list.push(ptr6) + + () + } + Boolean(payload7) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store8((iter_base) + 8, (if payload7 { 1 } else { 0 })) + + () + } + Text(payload8) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + let ptr9 = mbt_ffi_str2ptr(payload8) + mbt_ffi_store32((iter_base) + 12, payload8.length()) + mbt_ffi_store32((iter_base) + 8, ptr9) + cleanup_list.push(ptr9) + + () + } + Varchar(payload10) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + let ptr11 = mbt_ffi_str2ptr(payload10) + mbt_ffi_store32((iter_base) + 12, payload10.length()) + mbt_ffi_store32((iter_base) + 8, ptr11) + cleanup_list.push(ptr11) + + () + } + Bpchar(payload12) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + let ptr13 = mbt_ffi_str2ptr(payload12) + mbt_ffi_store32((iter_base) + 12, payload12.length()) + mbt_ffi_store32((iter_base) + 8, ptr13) + cleanup_list.push(ptr13) + + () + } + Timestamp(payload14) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, ((payload14).date).year) + mbt_ffi_store8((iter_base) + 12, (((payload14).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload14).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, (((payload14).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload14).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, (((payload14).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, (((payload14).time).nanosecond).reinterpret_as_int()) + + () + } + Timestamptz(payload15) => { + mbt_ffi_store8((iter_base) + 0, (12)) + mbt_ffi_store32((iter_base) + 8, (((payload15).timestamp).date).year) + mbt_ffi_store8((iter_base) + 12, ((((payload15).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((((payload15).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 16, ((((payload15).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload15).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 18, ((((payload15).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 20, ((((payload15).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 24, (payload15).offset) + + () + } + Date(payload16) => { + mbt_ffi_store8((iter_base) + 0, (13)) + mbt_ffi_store32((iter_base) + 8, (payload16).year) + mbt_ffi_store8((iter_base) + 12, ((payload16).month).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload16).day).to_int()) + + () + } + Time(payload17) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store8((iter_base) + 8, ((payload17).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, ((payload17).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, ((payload17).second).to_int()) + mbt_ffi_store32((iter_base) + 12, ((payload17).nanosecond).reinterpret_as_int()) + + () + } + Timetz(payload18) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store8((iter_base) + 8, (((payload18).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 9, (((payload18).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 10, (((payload18).time).second).to_int()) + mbt_ffi_store32((iter_base) + 12, (((payload18).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 16, (payload18).offset) + + () + } + Interval(payload19) => { + mbt_ffi_store8((iter_base) + 0, (16)) + mbt_ffi_store32((iter_base) + 8, (payload19).months) + mbt_ffi_store32((iter_base) + 12, (payload19).days) + mbt_ffi_store64((iter_base) + 16, (payload19).microseconds) + + () + } + Bytea(payload20) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let ptr21 = mbt_ffi_bytes2ptr(payload20) + + mbt_ffi_store32((iter_base) + 12, payload20.length()) + mbt_ffi_store32((iter_base) + 8, ptr21) + cleanup_list.push(ptr21) + + () + } + Json(payload22) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let ptr23 = mbt_ffi_str2ptr(payload22) + mbt_ffi_store32((iter_base) + 12, payload22.length()) + mbt_ffi_store32((iter_base) + 8, ptr23) + cleanup_list.push(ptr23) + + () + } + Jsonb(payload24) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let ptr25 = mbt_ffi_str2ptr(payload24) + mbt_ffi_store32((iter_base) + 12, payload24.length()) + mbt_ffi_store32((iter_base) + 8, ptr25) + cleanup_list.push(ptr25) + + () + } + Jsonpath(payload26) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let ptr27 = mbt_ffi_str2ptr(payload26) + mbt_ffi_store32((iter_base) + 12, payload26.length()) + mbt_ffi_store32((iter_base) + 8, ptr27) + cleanup_list.push(ptr27) + + () + } + Xml(payload28) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + let ptr29 = mbt_ffi_str2ptr(payload28) + mbt_ffi_store32((iter_base) + 12, payload28.length()) + mbt_ffi_store32((iter_base) + 8, ptr29) + cleanup_list.push(ptr29) + + () + } + Uuid(payload30) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store64((iter_base) + 8, ((payload30).high_bits).reinterpret_as_int64()) + mbt_ffi_store64((iter_base) + 16, ((payload30).low_bits).reinterpret_as_int64()) + + () + } + Inet(payload31) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match payload31 { + Ipv4(payload32) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store8((iter_base) + 10, ((payload32).0).to_int()) + mbt_ffi_store8((iter_base) + 11, ((payload32).1).to_int()) + mbt_ffi_store8((iter_base) + 12, ((payload32).2).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload32).3).to_int()) + + () + } + Ipv6(payload33) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store16((iter_base) + 10, ((payload33).0).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 12, ((payload33).1).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 14, ((payload33).2).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 16, ((payload33).3).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 18, ((payload33).4).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 20, ((payload33).5).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 22, ((payload33).6).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 24, ((payload33).7).reinterpret_as_int()) + + () + } + } + + () + } + Cidr(payload34) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match payload34 { + Ipv4(payload35) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store8((iter_base) + 10, ((payload35).0).to_int()) + mbt_ffi_store8((iter_base) + 11, ((payload35).1).to_int()) + mbt_ffi_store8((iter_base) + 12, ((payload35).2).to_int()) + mbt_ffi_store8((iter_base) + 13, ((payload35).3).to_int()) + + () + } + Ipv6(payload36) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store16((iter_base) + 10, ((payload36).0).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 12, ((payload36).1).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 14, ((payload36).2).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 16, ((payload36).3).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 18, ((payload36).4).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 20, ((payload36).5).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 22, ((payload36).6).reinterpret_as_int()) + mbt_ffi_store16((iter_base) + 24, ((payload36).7).reinterpret_as_int()) + + () + } + } + + () + } + Macaddr(payload37) => { + mbt_ffi_store8((iter_base) + 0, (25)) + mbt_ffi_store8((iter_base) + 8, (((payload37).octets).0).to_int()) + mbt_ffi_store8((iter_base) + 9, (((payload37).octets).1).to_int()) + mbt_ffi_store8((iter_base) + 10, (((payload37).octets).2).to_int()) + mbt_ffi_store8((iter_base) + 11, (((payload37).octets).3).to_int()) + mbt_ffi_store8((iter_base) + 12, (((payload37).octets).4).to_int()) + mbt_ffi_store8((iter_base) + 13, (((payload37).octets).5).to_int()) + + () + } + Bit(payload38) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let address = mbt_ffi_malloc((payload38).length() * 1); + for index = 0; index < (payload38).length(); index = index + 1 { + let iter_elem : Bool = (payload38)[(index)] + let iter_base = address + (index * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload38).length()) + mbt_ffi_store32((iter_base) + 8, address) + cleanup_list.push(address) + + () + } + Varbit(payload39) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + let address40 = mbt_ffi_malloc((payload39).length() * 1); + for index41 = 0; index41 < (payload39).length(); index41 = index41 + 1 { + let iter_elem : Bool = (payload39)[(index41)] + let iter_base = address40 + (index41 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload39).length()) + mbt_ffi_store32((iter_base) + 8, address40) + cleanup_list.push(address40) + + () + } + Int4range(payload42) => { + mbt_ffi_store8((iter_base) + 0, (28)) + + match (payload42).start { + Included(payload43) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, payload43) + + () + } + Excluded(payload44) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload44) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload42).end { + Included(payload46) => { + mbt_ffi_store8((iter_base) + 16, (0)) + mbt_ffi_store32((iter_base) + 20, payload46) + + () + } + Excluded(payload47) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload47) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 16, (2)) + + () + } + } + + () + } + Int8range(payload49) => { + mbt_ffi_store8((iter_base) + 0, (29)) + + match (payload49).start { + Included(payload50) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store64((iter_base) + 16, payload50) + + () + } + Excluded(payload51) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store64((iter_base) + 16, payload51) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload49).end { + Included(payload53) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload53) + + () + } + Excluded(payload54) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, payload54) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 24, (2)) + + () + } + } + + () + } + Numrange(payload56) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + match (payload56).start { + Included(payload57) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + let ptr58 = mbt_ffi_str2ptr(payload57) + mbt_ffi_store32((iter_base) + 16, payload57.length()) + mbt_ffi_store32((iter_base) + 12, ptr58) + cleanup_list.push(ptr58) + + () + } + Excluded(payload59) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr60 = mbt_ffi_str2ptr(payload59) + mbt_ffi_store32((iter_base) + 16, payload59.length()) + mbt_ffi_store32((iter_base) + 12, ptr60) + cleanup_list.push(ptr60) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload56).end { + Included(payload62) => { + mbt_ffi_store8((iter_base) + 20, (0)) + + let ptr63 = mbt_ffi_str2ptr(payload62) + mbt_ffi_store32((iter_base) + 28, payload62.length()) + mbt_ffi_store32((iter_base) + 24, ptr63) + cleanup_list.push(ptr63) + + () + } + Excluded(payload64) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let ptr65 = mbt_ffi_str2ptr(payload64) + mbt_ffi_store32((iter_base) + 28, payload64.length()) + mbt_ffi_store32((iter_base) + 24, ptr65) + cleanup_list.push(ptr65) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 20, (2)) + + () + } + } + + () + } + Tsrange(payload67) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + match (payload67).start { + Included(payload68) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, ((payload68).date).year) + mbt_ffi_store8((iter_base) + 16, (((payload68).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload68).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, (((payload68).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, (((payload68).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, (((payload68).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, (((payload68).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload69) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, ((payload69).date).year) + mbt_ffi_store8((iter_base) + 16, (((payload69).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, (((payload69).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, (((payload69).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, (((payload69).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, (((payload69).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, (((payload69).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload67).end { + Included(payload71) => { + mbt_ffi_store8((iter_base) + 28, (0)) + mbt_ffi_store32((iter_base) + 32, ((payload71).date).year) + mbt_ffi_store8((iter_base) + 36, (((payload71).date).month).to_int()) + mbt_ffi_store8((iter_base) + 37, (((payload71).date).day).to_int()) + mbt_ffi_store8((iter_base) + 40, (((payload71).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 41, (((payload71).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 42, (((payload71).time).second).to_int()) + mbt_ffi_store32((iter_base) + 44, (((payload71).time).nanosecond).reinterpret_as_int()) + + () + } + Excluded(payload72) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, ((payload72).date).year) + mbt_ffi_store8((iter_base) + 36, (((payload72).date).month).to_int()) + mbt_ffi_store8((iter_base) + 37, (((payload72).date).day).to_int()) + mbt_ffi_store8((iter_base) + 40, (((payload72).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 41, (((payload72).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 42, (((payload72).time).second).to_int()) + mbt_ffi_store32((iter_base) + 44, (((payload72).time).nanosecond).reinterpret_as_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 28, (2)) + + () + } + } + + () + } + Tstzrange(payload74) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + match (payload74).start { + Included(payload75) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, (((payload75).timestamp).date).year) + mbt_ffi_store8((iter_base) + 16, ((((payload75).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload75).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, ((((payload75).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, ((((payload75).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, ((((payload75).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, ((((payload75).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 28, (payload75).offset) + + () + } + Excluded(payload76) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, (((payload76).timestamp).date).year) + mbt_ffi_store8((iter_base) + 16, ((((payload76).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((((payload76).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 20, ((((payload76).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 21, ((((payload76).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 22, ((((payload76).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 24, ((((payload76).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 28, (payload76).offset) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload74).end { + Included(payload78) => { + mbt_ffi_store8((iter_base) + 32, (0)) + mbt_ffi_store32((iter_base) + 36, (((payload78).timestamp).date).year) + mbt_ffi_store8((iter_base) + 40, ((((payload78).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 41, ((((payload78).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 44, ((((payload78).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 45, ((((payload78).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 46, ((((payload78).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 48, ((((payload78).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 52, (payload78).offset) + + () + } + Excluded(payload79) => { + mbt_ffi_store8((iter_base) + 32, (1)) + mbt_ffi_store32((iter_base) + 36, (((payload79).timestamp).date).year) + mbt_ffi_store8((iter_base) + 40, ((((payload79).timestamp).date).month).to_int()) + mbt_ffi_store8((iter_base) + 41, ((((payload79).timestamp).date).day).to_int()) + mbt_ffi_store8((iter_base) + 44, ((((payload79).timestamp).time).hour).to_int()) + mbt_ffi_store8((iter_base) + 45, ((((payload79).timestamp).time).minute).to_int()) + mbt_ffi_store8((iter_base) + 46, ((((payload79).timestamp).time).second).to_int()) + mbt_ffi_store32((iter_base) + 48, ((((payload79).timestamp).time).nanosecond).reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 52, (payload79).offset) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 32, (2)) + + () + } + } + + () + } + Daterange(payload81) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + match (payload81).start { + Included(payload82) => { + mbt_ffi_store8((iter_base) + 8, (0)) + mbt_ffi_store32((iter_base) + 12, (payload82).year) + mbt_ffi_store8((iter_base) + 16, ((payload82).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((payload82).day).to_int()) + + () + } + Excluded(payload83) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, (payload83).year) + mbt_ffi_store8((iter_base) + 16, ((payload83).month).to_int()) + mbt_ffi_store8((iter_base) + 17, ((payload83).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 8, (2)) + + () + } + } + + match (payload81).end { + Included(payload85) => { + mbt_ffi_store8((iter_base) + 20, (0)) + mbt_ffi_store32((iter_base) + 24, (payload85).year) + mbt_ffi_store8((iter_base) + 28, ((payload85).month).to_int()) + mbt_ffi_store8((iter_base) + 29, ((payload85).day).to_int()) + + () + } + Excluded(payload86) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload86).year) + mbt_ffi_store8((iter_base) + 28, ((payload86).month).to_int()) + mbt_ffi_store8((iter_base) + 29, ((payload86).day).to_int()) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 20, (2)) + + () + } + } + + () + } + Money(payload88) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store64((iter_base) + 8, payload88) + + () + } + Oid(payload89) => { + mbt_ffi_store8((iter_base) + 0, (35)) + mbt_ffi_store32((iter_base) + 8, (payload89).reinterpret_as_int()) + + () + } + Enumeration(payload90) => { + mbt_ffi_store8((iter_base) + 0, (36)) + + let ptr91 = mbt_ffi_str2ptr((payload90).name) + mbt_ffi_store32((iter_base) + 12, (payload90).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr91) + + let ptr92 = mbt_ffi_str2ptr((payload90).value) + mbt_ffi_store32((iter_base) + 20, (payload90).value.length()) + mbt_ffi_store32((iter_base) + 16, ptr92) + cleanup_list.push(ptr91) + cleanup_list.push(ptr92) + + () + } + Composite(payload93) => { + mbt_ffi_store8((iter_base) + 0, (37)) + + let ptr94 = mbt_ffi_str2ptr((payload93).name) + mbt_ffi_store32((iter_base) + 12, (payload93).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr94) + + let address96 = mbt_ffi_malloc(((payload93).values).length() * 4); + for index97 = 0; index97 < ((payload93).values).length(); index97 = index97 + 1 { + let iter_elem : LazyDbValue = ((payload93).values)[(index97)] + let iter_base = address96 + (index97 * 4); + + let LazyDbValue(handle95) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle95) + + } + mbt_ffi_store32((iter_base) + 20, ((payload93).values).length()) + mbt_ffi_store32((iter_base) + 16, address96) + cleanup_list.push(ptr94) + cleanup_list.push(address96) + + () + } + Domain(payload98) => { + mbt_ffi_store8((iter_base) + 0, (38)) + + let ptr99 = mbt_ffi_str2ptr((payload98).name) + mbt_ffi_store32((iter_base) + 12, (payload98).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr99) + + let LazyDbValue(handle100) = (payload98).value + mbt_ffi_store32((iter_base) + 16, handle100) + cleanup_list.push(ptr99) + + () + } + Array(payload101) => { + mbt_ffi_store8((iter_base) + 0, (39)) + + let address103 = mbt_ffi_malloc((payload101).length() * 4); + for index104 = 0; index104 < (payload101).length(); index104 = index104 + 1 { + let iter_elem : LazyDbValue = (payload101)[(index104)] + let iter_base = address103 + (index104 * 4); + + let LazyDbValue(handle102) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle102) + + } + mbt_ffi_store32((iter_base) + 12, (payload101).length()) + mbt_ffi_store32((iter_base) + 8, address103) + cleanup_list.push(address103) + + () + } + Range(payload105) => { + mbt_ffi_store8((iter_base) + 0, (40)) + + let ptr106 = mbt_ffi_str2ptr((payload105).name) + mbt_ffi_store32((iter_base) + 12, (payload105).name.length()) + mbt_ffi_store32((iter_base) + 8, ptr106) + + match ((payload105).value).start { + Included(payload107) => { + mbt_ffi_store8((iter_base) + 16, (0)) + + let LazyDbValue(handle108) = payload107 + mbt_ffi_store32((iter_base) + 20, handle108) + + () + } + Excluded(payload109) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let LazyDbValue(handle110) = payload109 + mbt_ffi_store32((iter_base) + 20, handle110) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 16, (2)) + + () + } + } + + match ((payload105).value).end { + Included(payload112) => { + mbt_ffi_store8((iter_base) + 24, (0)) + + let LazyDbValue(handle113) = payload112 + mbt_ffi_store32((iter_base) + 28, handle113) + + () + } + Excluded(payload114) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let LazyDbValue(handle115) = payload114 + mbt_ffi_store32((iter_base) + 28, handle115) + + () + } + Unbounded => { + mbt_ffi_store8((iter_base) + 24, (2)) + + () + } + } + cleanup_list.push(ptr106) + + () + } + Null => { + mbt_ffi_store8((iter_base) + 0, (41)) - let ptr27 = mbt_ffi_str2ptr(payload26) - mbt_ffi_store32(iter_base + 12, payload26.length()) - mbt_ffi_store32(iter_base + 8, ptr27) - cleanup_list.push(ptr27) + () + } + Vector(payload118) => { + mbt_ffi_store8((iter_base) + 0, (42)) - () - } - Xml(payload28) => { - mbt_ffi_store8(iter_base + 0, 21) + let ptr119 = mbt_ffi_float_array2ptr(payload118) + + mbt_ffi_store32((iter_base) + 12, payload118.length()) + mbt_ffi_store32((iter_base) + 8, ptr119) + cleanup_list.push(ptr119) - let ptr29 = mbt_ffi_str2ptr(payload28) - mbt_ffi_store32(iter_base + 12, payload28.length()) - mbt_ffi_store32(iter_base + 8, ptr29) - cleanup_list.push(ptr29) + () + } + Halfvec(payload120) => { + mbt_ffi_store8((iter_base) + 0, (43)) - () - } - Uuid(payload30) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store64( - iter_base + 8, - payload30.high_bits.reinterpret_as_int64(), - ) - mbt_ffi_store64( - iter_base + 16, - payload30.low_bits.reinterpret_as_int64(), - ) - - () - } - Inet(payload31) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload31 { - Ipv4(payload32) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store8(iter_base + 10, payload32.0.to_int()) - mbt_ffi_store8(iter_base + 11, payload32.1.to_int()) - mbt_ffi_store8(iter_base + 12, payload32.2.to_int()) - mbt_ffi_store8(iter_base + 13, payload32.3.to_int()) - - () - } - Ipv6(payload33) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store16(iter_base + 10, payload33.0.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 12, payload33.1.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 14, payload33.2.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 16, payload33.3.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 18, payload33.4.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 20, payload33.5.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 22, payload33.6.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 24, payload33.7.reinterpret_as_int()) - - () - } - } - - () - } - Cidr(payload34) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload34 { - Ipv4(payload35) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store8(iter_base + 10, payload35.0.to_int()) - mbt_ffi_store8(iter_base + 11, payload35.1.to_int()) - mbt_ffi_store8(iter_base + 12, payload35.2.to_int()) - mbt_ffi_store8(iter_base + 13, payload35.3.to_int()) - - () - } - Ipv6(payload36) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store16(iter_base + 10, payload36.0.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 12, payload36.1.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 14, payload36.2.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 16, payload36.3.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 18, payload36.4.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 20, payload36.5.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 22, payload36.6.reinterpret_as_int()) - mbt_ffi_store16(iter_base + 24, payload36.7.reinterpret_as_int()) - - () - } - } - - () - } - Macaddr(payload37) => { - mbt_ffi_store8(iter_base + 0, 25) - mbt_ffi_store8(iter_base + 8, payload37.octets.0.to_int()) - mbt_ffi_store8(iter_base + 9, payload37.octets.1.to_int()) - mbt_ffi_store8(iter_base + 10, payload37.octets.2.to_int()) - mbt_ffi_store8(iter_base + 11, payload37.octets.3.to_int()) - mbt_ffi_store8(iter_base + 12, payload37.octets.4.to_int()) - mbt_ffi_store8(iter_base + 13, payload37.octets.5.to_int()) - - () - } - Bit(payload38) => { - mbt_ffi_store8(iter_base + 0, 26) - - let address = mbt_ffi_malloc(payload38.length() * 1) - for index = 0; index < payload38.length(); index = index + 1 { - let iter_elem : Bool = payload38[index] - let iter_base = address + index * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload38.length()) - mbt_ffi_store32(iter_base + 8, address) - cleanup_list.push(address) - - () - } - Varbit(payload39) => { - mbt_ffi_store8(iter_base + 0, 27) - - let address40 = mbt_ffi_malloc(payload39.length() * 1) - for index41 = 0; index41 < payload39.length(); index41 = index41 + 1 { - let iter_elem : Bool = payload39[index41] - let iter_base = address40 + index41 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload39.length()) - mbt_ffi_store32(iter_base + 8, address40) - cleanup_list.push(address40) - - () - } - Int4range(payload42) => { - mbt_ffi_store8(iter_base + 0, 28) - - match payload42.start { - Included(payload43) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload43) - - () - } - Excluded(payload44) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload44) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload42.end { - Included(payload46) => { - mbt_ffi_store8(iter_base + 16, 0) - mbt_ffi_store32(iter_base + 20, payload46) - - () - } - Excluded(payload47) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload47) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 16, 2) - - () - } - } - - () - } - Int8range(payload49) => { - mbt_ffi_store8(iter_base + 0, 29) - - match payload49.start { - Included(payload50) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store64(iter_base + 16, payload50) - - () - } - Excluded(payload51) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store64(iter_base + 16, payload51) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload49.end { - Included(payload53) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload53) - - () - } - Excluded(payload54) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload54) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 24, 2) - - () - } - } - - () - } - Numrange(payload56) => { - mbt_ffi_store8(iter_base + 0, 30) - - match payload56.start { - Included(payload57) => { - mbt_ffi_store8(iter_base + 8, 0) - - let ptr58 = mbt_ffi_str2ptr(payload57) - mbt_ffi_store32(iter_base + 16, payload57.length()) - mbt_ffi_store32(iter_base + 12, ptr58) - cleanup_list.push(ptr58) - - () - } - Excluded(payload59) => { - mbt_ffi_store8(iter_base + 8, 1) - - let ptr60 = mbt_ffi_str2ptr(payload59) - mbt_ffi_store32(iter_base + 16, payload59.length()) - mbt_ffi_store32(iter_base + 12, ptr60) - cleanup_list.push(ptr60) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload56.end { - Included(payload62) => { - mbt_ffi_store8(iter_base + 20, 0) - - let ptr63 = mbt_ffi_str2ptr(payload62) - mbt_ffi_store32(iter_base + 28, payload62.length()) - mbt_ffi_store32(iter_base + 24, ptr63) - cleanup_list.push(ptr63) - - () - } - Excluded(payload64) => { - mbt_ffi_store8(iter_base + 20, 1) - - let ptr65 = mbt_ffi_str2ptr(payload64) - mbt_ffi_store32(iter_base + 28, payload64.length()) - mbt_ffi_store32(iter_base + 24, ptr65) - cleanup_list.push(ptr65) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 20, 2) - - () - } - } - - () - } - Tsrange(payload67) => { - mbt_ffi_store8(iter_base + 0, 31) - - match payload67.start { - Included(payload68) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload68.date.year) - mbt_ffi_store8(iter_base + 16, payload68.date.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload68.date.day.to_int()) - mbt_ffi_store8(iter_base + 20, payload68.time.hour.to_int()) - mbt_ffi_store8(iter_base + 21, payload68.time.minute.to_int()) - mbt_ffi_store8(iter_base + 22, payload68.time.second.to_int()) - mbt_ffi_store32( - iter_base + 24, - payload68.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload69) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload69.date.year) - mbt_ffi_store8(iter_base + 16, payload69.date.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload69.date.day.to_int()) - mbt_ffi_store8(iter_base + 20, payload69.time.hour.to_int()) - mbt_ffi_store8(iter_base + 21, payload69.time.minute.to_int()) - mbt_ffi_store8(iter_base + 22, payload69.time.second.to_int()) - mbt_ffi_store32( - iter_base + 24, - payload69.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload67.end { - Included(payload71) => { - mbt_ffi_store8(iter_base + 28, 0) - mbt_ffi_store32(iter_base + 32, payload71.date.year) - mbt_ffi_store8(iter_base + 36, payload71.date.month.to_int()) - mbt_ffi_store8(iter_base + 37, payload71.date.day.to_int()) - mbt_ffi_store8(iter_base + 40, payload71.time.hour.to_int()) - mbt_ffi_store8(iter_base + 41, payload71.time.minute.to_int()) - mbt_ffi_store8(iter_base + 42, payload71.time.second.to_int()) - mbt_ffi_store32( - iter_base + 44, - payload71.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Excluded(payload72) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload72.date.year) - mbt_ffi_store8(iter_base + 36, payload72.date.month.to_int()) - mbt_ffi_store8(iter_base + 37, payload72.date.day.to_int()) - mbt_ffi_store8(iter_base + 40, payload72.time.hour.to_int()) - mbt_ffi_store8(iter_base + 41, payload72.time.minute.to_int()) - mbt_ffi_store8(iter_base + 42, payload72.time.second.to_int()) - mbt_ffi_store32( - iter_base + 44, - payload72.time.nanosecond.reinterpret_as_int(), - ) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 28, 2) - - () - } - } - - () - } - Tstzrange(payload74) => { - mbt_ffi_store8(iter_base + 0, 32) - - match payload74.start { - Included(payload75) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload75.timestamp.date.year) - mbt_ffi_store8( - iter_base + 16, - payload75.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 17, - payload75.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 20, - payload75.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 21, - payload75.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 22, - payload75.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 24, - payload75.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 28, payload75.offset) - - () - } - Excluded(payload76) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload76.timestamp.date.year) - mbt_ffi_store8( - iter_base + 16, - payload76.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 17, - payload76.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 20, - payload76.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 21, - payload76.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 22, - payload76.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 24, - payload76.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 28, payload76.offset) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload74.end { - Included(payload78) => { - mbt_ffi_store8(iter_base + 32, 0) - mbt_ffi_store32(iter_base + 36, payload78.timestamp.date.year) - mbt_ffi_store8( - iter_base + 40, - payload78.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 41, - payload78.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 44, - payload78.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 45, - payload78.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 46, - payload78.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 48, - payload78.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 52, payload78.offset) - - () - } - Excluded(payload79) => { - mbt_ffi_store8(iter_base + 32, 1) - mbt_ffi_store32(iter_base + 36, payload79.timestamp.date.year) - mbt_ffi_store8( - iter_base + 40, - payload79.timestamp.date.month.to_int(), - ) - mbt_ffi_store8( - iter_base + 41, - payload79.timestamp.date.day.to_int(), - ) - mbt_ffi_store8( - iter_base + 44, - payload79.timestamp.time.hour.to_int(), - ) - mbt_ffi_store8( - iter_base + 45, - payload79.timestamp.time.minute.to_int(), - ) - mbt_ffi_store8( - iter_base + 46, - payload79.timestamp.time.second.to_int(), - ) - mbt_ffi_store32( - iter_base + 48, - payload79.timestamp.time.nanosecond.reinterpret_as_int(), - ) - mbt_ffi_store32(iter_base + 52, payload79.offset) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 32, 2) - - () - } - } - - () - } - Daterange(payload81) => { - mbt_ffi_store8(iter_base + 0, 33) - - match payload81.start { - Included(payload82) => { - mbt_ffi_store8(iter_base + 8, 0) - mbt_ffi_store32(iter_base + 12, payload82.year) - mbt_ffi_store8(iter_base + 16, payload82.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload82.day.to_int()) - - () - } - Excluded(payload83) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload83.year) - mbt_ffi_store8(iter_base + 16, payload83.month.to_int()) - mbt_ffi_store8(iter_base + 17, payload83.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 8, 2) - - () - } - } - - match payload81.end { - Included(payload85) => { - mbt_ffi_store8(iter_base + 20, 0) - mbt_ffi_store32(iter_base + 24, payload85.year) - mbt_ffi_store8(iter_base + 28, payload85.month.to_int()) - mbt_ffi_store8(iter_base + 29, payload85.day.to_int()) - - () - } - Excluded(payload86) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload86.year) - mbt_ffi_store8(iter_base + 28, payload86.month.to_int()) - mbt_ffi_store8(iter_base + 29, payload86.day.to_int()) - - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 20, 2) - - () - } - } - - () - } - Money(payload88) => { - mbt_ffi_store8(iter_base + 0, 34) - mbt_ffi_store64(iter_base + 8, payload88) + let ptr121 = mbt_ffi_float_array2ptr(payload120) - () - } - Oid(payload89) => { - mbt_ffi_store8(iter_base + 0, 35) - mbt_ffi_store32(iter_base + 8, payload89.reinterpret_as_int()) + mbt_ffi_store32((iter_base) + 12, payload120.length()) + mbt_ffi_store32((iter_base) + 8, ptr121) + cleanup_list.push(ptr121) - () - } - Enumeration(payload90) => { - mbt_ffi_store8(iter_base + 0, 36) + () + } + Sparsevec(payload122) => { + mbt_ffi_store8((iter_base) + 0, (44)) + mbt_ffi_store32((iter_base) + 8, (payload122).dim) - let ptr91 = mbt_ffi_str2ptr(payload90.name) - mbt_ffi_store32(iter_base + 12, payload90.name.length()) - mbt_ffi_store32(iter_base + 8, ptr91) + let ptr123 = mbt_ffi_int_array2ptr((payload122).indices) - let ptr92 = mbt_ffi_str2ptr(payload90.value) - mbt_ffi_store32(iter_base + 20, payload90.value.length()) - mbt_ffi_store32(iter_base + 16, ptr92) - cleanup_list.push(ptr91) - cleanup_list.push(ptr92) + mbt_ffi_store32((iter_base) + 16, (payload122).indices.length()) + mbt_ffi_store32((iter_base) + 12, ptr123) - () - } - Composite(payload93) => { - mbt_ffi_store8(iter_base + 0, 37) - - let ptr94 = mbt_ffi_str2ptr(payload93.name) - mbt_ffi_store32(iter_base + 12, payload93.name.length()) - mbt_ffi_store32(iter_base + 8, ptr94) - - let address96 = mbt_ffi_malloc(payload93.values.length() * 4) - for index97 = 0 - index97 < payload93.values.length() - index97 = index97 + 1 { - let iter_elem : LazyDbValue = payload93.values[index97] - let iter_base = address96 + index97 * 4 - - let LazyDbValue(handle95) = iter_elem - mbt_ffi_store32(iter_base + 0, handle95) - } - mbt_ffi_store32(iter_base + 20, payload93.values.length()) - mbt_ffi_store32(iter_base + 16, address96) - cleanup_list.push(ptr94) - cleanup_list.push(address96) - - () - } - Domain(payload98) => { - mbt_ffi_store8(iter_base + 0, 38) + let ptr124 = mbt_ffi_float_array2ptr((payload122).values) - let ptr99 = mbt_ffi_str2ptr(payload98.name) - mbt_ffi_store32(iter_base + 12, payload98.name.length()) - mbt_ffi_store32(iter_base + 8, ptr99) + mbt_ffi_store32((iter_base) + 24, (payload122).values.length()) + mbt_ffi_store32((iter_base) + 20, ptr124) + cleanup_list.push(ptr123) + cleanup_list.push(ptr124) - let LazyDbValue(handle100) = payload98.value - mbt_ffi_store32(iter_base + 16, handle100) - cleanup_list.push(ptr99) + () + } + } - () - } - Array(payload101) => { - mbt_ffi_store8(iter_base + 0, 39) - - let address103 = mbt_ffi_malloc(payload101.length() * 4) - for index104 = 0 - index104 < payload101.length() - index104 = index104 + 1 { - let iter_elem : LazyDbValue = payload101[index104] - let iter_base = address103 + index104 * 4 - - let LazyDbValue(handle102) = iter_elem - mbt_ffi_store32(iter_base + 0, handle102) - } - mbt_ffi_store32(iter_base + 12, payload101.length()) - mbt_ffi_store32(iter_base + 8, address103) - cleanup_list.push(address103) - - () } - Range(payload105) => { - mbt_ffi_store8(iter_base + 0, 40) + let return_area = mbt_ffi_malloc(24) + wasmImportMethodDbTransactionExecute(handle, ptr, statement.length(), address125, (params).length(), return_area); - let ptr106 = mbt_ffi_str2ptr(payload105.name) - mbt_ffi_store32(iter_base + 12, payload105.name.length()) - mbt_ffi_store32(iter_base + 8, ptr106) + let lifted131 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - match payload105.value.start { - Included(payload107) => { - mbt_ffi_store8(iter_base + 16, 0) + Result::Ok((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + 1 => { - let LazyDbValue(handle108) = payload107 - mbt_ffi_store32(iter_base + 20, handle108) + let lifted = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - () - } - Excluded(payload109) => { - mbt_ffi_store8(iter_base + 16, 1) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let LazyDbValue(handle110) = payload109 - mbt_ffi_store32(iter_base + 20, handle110) + Error_::ConnectionFailure(result) + } + 1 => { - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 16, 2) + let result127 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - () - } - } + Error_::QueryParameterFailure(result127) + } + 2 => { - match payload105.value.end { - Included(payload112) => { - mbt_ffi_store8(iter_base + 24, 0) + let result128 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let LazyDbValue(handle113) = payload112 - mbt_ffi_store32(iter_base + 28, handle113) + Error_::QueryExecutionFailure(result128) + } + 3 => { - () - } - Excluded(payload114) => { - mbt_ffi_store8(iter_base + 24, 1) + let result129 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let LazyDbValue(handle115) = payload114 - mbt_ffi_store32(iter_base + 28, handle115) + Error_::QueryResponseFailure(result129) + } + 4 => { - () - } - Unbounded => { - mbt_ffi_store8(iter_base + 24, 2) + let result130 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - () - } - } - cleanup_list.push(ptr106) + Error_::Other(result130) + } + _ => panic() + } - () + Result::Err(lifted) + } + _ => panic() } - Null => { - mbt_ffi_store8(iter_base + 0, 41) + let ret = lifted131 + mbt_ffi_free(ptr) + mbt_ffi_free(address125) + mbt_ffi_free(return_area) - () - } - Vector(payload118) => { - mbt_ffi_store8(iter_base + 0, 42) + cleanup_list.each(mbt_ffi_free) + return ret - let ptr119 = mbt_ffi_float_array2ptr(payload118) +} +///| +pub fn DbTransaction::commit(self : DbTransaction) -> Result[Unit, Error_] { - mbt_ffi_store32(iter_base + 12, payload118.length()) - mbt_ffi_store32(iter_base + 8, ptr119) - cleanup_list.push(ptr119) + let DbTransaction(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbTransactionCommit(handle, return_area); - () - } - Halfvec(payload120) => { - mbt_ffi_store8(iter_base + 0, 43) + let lifted4 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - let ptr121 = mbt_ffi_float_array2ptr(payload120) + Result::Ok(()) + } + 1 => { - mbt_ffi_store32(iter_base + 12, payload120.length()) - mbt_ffi_store32(iter_base + 8, ptr121) - cleanup_list.push(ptr121) + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - () - } - Sparsevec(payload122) => { - mbt_ffi_store8(iter_base + 0, 44) - mbt_ffi_store32(iter_base + 8, payload122.dim) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr123 = mbt_ffi_int_array2ptr(payload122.indices) + Error_::ConnectionFailure(result) + } + 1 => { - mbt_ffi_store32(iter_base + 16, payload122.indices.length()) - mbt_ffi_store32(iter_base + 12, ptr123) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr124 = mbt_ffi_float_array2ptr(payload122.values) + Error_::QueryParameterFailure(result0) + } + 2 => { - mbt_ffi_store32(iter_base + 24, payload122.values.length()) - mbt_ffi_store32(iter_base + 20, ptr124) - cleanup_list.push(ptr123) - cleanup_list.push(ptr124) + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - } - } - let return_area = mbt_ffi_malloc(24) - wasmImportMethodDbTransactionExecute( - handle, - ptr, - statement.length(), - address125, - params.length(), - return_area, - ) - - let lifted131 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 8) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result127 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryParameterFailure(result127) - } - 2 => { - let result128 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryExecutionFailure(result128) - } - 3 => { - let result129 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::QueryResponseFailure(result129) - } - 4 => { - let result130 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - - Error_::Other(result130) - } - _ => panic() - } + Error_::QueryExecutionFailure(result1) + } + 3 => { - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted131 - mbt_ffi_free(ptr) - mbt_ffi_free(address125) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) -///| -pub fn DbTransaction::commit(self : DbTransaction) -> Result[Unit, Error_] { - let DbTransaction(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbTransactionCommit(handle, return_area) - - let lifted4 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result0) - } - 2 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result1) - } - 3 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result2) - } - 4 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result3) - } - _ => panic() + Error_::QueryResponseFailure(result2) + } + 4 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result3) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted4 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted4 - mbt_ffi_free(return_area) - return ret } - ///| pub fn DbTransaction::rollback(self : DbTransaction) -> Result[Unit, Error_] { - let DbTransaction(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodDbTransactionRollback(handle, return_area) - - let lifted4 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryParameterFailure(result0) - } - 2 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryExecutionFailure(result1) - } - 3 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::QueryResponseFailure(result2) - } - 4 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result3) - } - _ => panic() + + let DbTransaction(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodDbTransactionRollback(handle, return_area); + + let lifted4 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryParameterFailure(result0) + } + 2 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryExecutionFailure(result1) + } + 3 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::QueryResponseFailure(result2) + } + 4 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result3) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted4 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted4 - mbt_ffi_free(return_area) - return ret } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/rdbms/types/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/rdbms/types/ffi.mbt index 01e5518ad5..821232033b 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/rdbms/types/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/rdbms/types/ffi.mbt @@ -1 +1,2 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! + diff --git a/sdks/moonbit/golem_sdk/interface/golem/rdbms/types/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/rdbms/types/top.mbt index 8bf134c3d6..9af9a241c7 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/rdbms/types/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/rdbms/types/top.mbt @@ -1,51 +1,35 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| pub(all) struct Uuid { - high_bits : UInt64 - low_bits : UInt64 + high_bits : UInt64; low_bits : UInt64 } derive(Show, Eq) - ///| pub(all) enum IpAddress { - Ipv4((Byte, Byte, Byte, Byte)) - Ipv6((UInt, UInt, UInt, UInt, UInt, UInt, UInt, UInt)) + Ipv4((Byte, Byte, Byte, Byte)) + Ipv6((UInt, UInt, UInt, UInt, UInt, UInt, UInt, UInt)) } derive(Show, Eq) - ///| pub(all) struct MacAddress { - octets : (Byte, Byte, Byte, Byte, Byte, Byte) + octets : (Byte, Byte, Byte, Byte, Byte, Byte) } derive(Show, Eq) - ///| pub(all) struct Date { - year : Int - month : Byte - day : Byte + year : Int; month : Byte; day : Byte } derive(Show, Eq) - ///| pub(all) struct Time { - hour : Byte - minute : Byte - second : Byte - nanosecond : UInt + hour : Byte; minute : Byte; second : Byte; nanosecond : UInt } derive(Show, Eq) - ///| pub(all) struct Timestamp { - date : Date - time : Time + date : Date; time : Time } derive(Show, Eq) - ///| pub(all) struct Timestamptz { - timestamp : Timestamp - offset : Int + timestamp : Timestamp; offset : Int } derive(Show, Eq) - ///| pub(all) struct Timetz { - time : Time - offset : Int + time : Time; offset : Int } derive(Show, Eq) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/secrets/reveal/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/secrets/reveal/ffi.mbt index bb54c724ae..343dfb8fc7 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/secrets/reveal/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/secrets/reveal/ffi.mbt @@ -1,86 +1,78 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! +fn wasmImportReveal(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int) = "golem:secrets/reveal@0.1.0" "reveal" + ///| -fn wasmImportReveal( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, -) = "golem:secrets/reveal@0.1.0" "reveal" +extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_s) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_u) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_s) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| #owned(str) extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = - #|(func (param i32) (result f64) local.get 0 f64.load) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = +#|(func (param i32) (result f32) local.get 0 f32.load) ///| -extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_s) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_s) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = +#|(func (param i32) (result f64) local.get 0 f64.load) -///| -extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = - #|(func (param i32) (result f32) local.get 0 f32.load) diff --git a/sdks/moonbit/golem_sdk/interface/golem/secrets/reveal/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/secrets/reveal/top.mbt index b579e1596d..2b66fc5c57 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/secrets/reveal/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/secrets/reveal/top.mbt @@ -1,2740 +1,2567 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Unpack a secret resource to its inner typed value. `expected` is the /// guest's inner-type graph; the host validates it against the secret's /// pinned inner type and returns the stored value as a schema-value-tree. -pub fn reveal( - s : @types.Secret, - expected : @types.SchemaGraph, -) -> Result[@types.SchemaValueTree, @types0.SecretError] { - let cleanup_list : Array[Int] = [] - - let @types.Secret(handle) = s - - let address357 = mbt_ffi_malloc(expected.type_nodes.length() * 144) - for index358 = 0 - index358 < expected.type_nodes.length() - index358 = index358 + 1 { - let iter_elem : @types.SchemaTypeNode = expected.type_nodes[index358] - let iter_base = address357 + index358 * 144 - - match iter_elem.body { - RefType(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store32(iter_base + 8, payload) - - () - } - BoolType => { - mbt_ffi_store8(iter_base + 0, 1) - - () - } - S8Type(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) - - match payload1 { - None => { - mbt_ffi_store8(iter_base + 8, 0) +pub fn reveal(s : @types.Secret, expected : @types.SchemaGraph) -> Result[@types.SchemaValueTree, @types0.SecretError] { + let cleanup_list : Array[Int] = [] - () - } - Some(payload3) => { - mbt_ffi_store8(iter_base + 8, 1) + let @types.Secret(handle) = s - match payload3.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let address358 = mbt_ffi_malloc(((expected).type_nodes).length() * 144); + for index359 = 0; index359 < ((expected).type_nodes).length(); index359 = index359 + 1 { + let iter_elem : @types.SchemaTypeNode = ((expected).type_nodes)[(index359)] + let iter_base = address358 + (index359 * 144); - () - } - Some(payload5) => { - mbt_ffi_store8(iter_base + 16, 1) + match (iter_elem).body { + RefType(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store32((iter_base) + 8, payload) - match payload5 { - Signed(payload6) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload6) - - () - } - Unsigned(payload7) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload7.reinterpret_as_int64(), - ) - - () + () } - FloatBits(payload8) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload8.reinterpret_as_int64(), - ) - - () - } - } + BoolType => { + mbt_ffi_store8((iter_base) + 0, (1)) - () - } - } - - match payload3.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload10) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload10 { - Signed(payload11) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload11) - - () + () } - Unsigned(payload12) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload12.reinterpret_as_int64(), - ) - - () + S8Type(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + + match (payload1) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload3).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload5) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload5 { + Signed(payload6) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload6) + + () + } + Unsigned(payload7) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload7).reinterpret_as_int64()) + + () + } + FloatBits(payload8) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload8).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload3).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload10) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload10 { + Signed(payload11) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload11) + + () + } + Unsigned(payload12) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload12).reinterpret_as_int64()) + + () + } + FloatBits(payload13) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload13).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload3).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload15) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr = mbt_ffi_str2ptr(payload15) + mbt_ffi_store32((iter_base) + 72, payload15.length()) + mbt_ffi_store32((iter_base) + 68, ptr) + cleanup_list.push(ptr) + + () + } + } + + () + } + } + + () } - FloatBits(payload13) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload13.reinterpret_as_int64(), - ) - - () - } - } - - () - } - } - - match payload3.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload15) => { - mbt_ffi_store8(iter_base + 64, 1) - - let ptr = mbt_ffi_str2ptr(payload15) - mbt_ffi_store32(iter_base + 72, payload15.length()) - mbt_ffi_store32(iter_base + 68, ptr) - cleanup_list.push(ptr) - - () - } - } - - () - } - } - - () - } - S16Type(payload16) => { - mbt_ffi_store8(iter_base + 0, 3) - - match payload16 { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload18) => { - mbt_ffi_store8(iter_base + 8, 1) - - match payload18.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload20) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload20 { - Signed(payload21) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload21) - - () + S16Type(payload16) => { + mbt_ffi_store8((iter_base) + 0, (3)) + + match (payload16) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload18) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload18).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload20) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload20 { + Signed(payload21) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload21) + + () + } + Unsigned(payload22) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload22).reinterpret_as_int64()) + + () + } + FloatBits(payload23) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload23).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload18).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload25) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload25 { + Signed(payload26) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload26) + + () + } + Unsigned(payload27) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload27).reinterpret_as_int64()) + + () + } + FloatBits(payload28) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload28).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload18).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload30) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr31 = mbt_ffi_str2ptr(payload30) + mbt_ffi_store32((iter_base) + 72, payload30.length()) + mbt_ffi_store32((iter_base) + 68, ptr31) + cleanup_list.push(ptr31) + + () + } + } + + () + } + } + + () } - Unsigned(payload22) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload22.reinterpret_as_int64(), - ) - - () + S32Type(payload32) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + match (payload32) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload34) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload34).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload36) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload36 { + Signed(payload37) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload37) + + () + } + Unsigned(payload38) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload38).reinterpret_as_int64()) + + () + } + FloatBits(payload39) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload39).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload34).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload41) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload41 { + Signed(payload42) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload42) + + () + } + Unsigned(payload43) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload43).reinterpret_as_int64()) + + () + } + FloatBits(payload44) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload44).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload34).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload46) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr47 = mbt_ffi_str2ptr(payload46) + mbt_ffi_store32((iter_base) + 72, payload46.length()) + mbt_ffi_store32((iter_base) + 68, ptr47) + cleanup_list.push(ptr47) + + () + } + } + + () + } + } + + () } - FloatBits(payload23) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload23.reinterpret_as_int64(), - ) - - () + S64Type(payload48) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + match (payload48) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload50) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload50).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload52) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload52 { + Signed(payload53) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload53) + + () + } + Unsigned(payload54) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload54).reinterpret_as_int64()) + + () + } + FloatBits(payload55) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload55).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload50).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload57) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload57 { + Signed(payload58) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload58) + + () + } + Unsigned(payload59) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload59).reinterpret_as_int64()) + + () + } + FloatBits(payload60) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload60).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload50).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload62) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr63 = mbt_ffi_str2ptr(payload62) + mbt_ffi_store32((iter_base) + 72, payload62.length()) + mbt_ffi_store32((iter_base) + 68, ptr63) + cleanup_list.push(ptr63) + + () + } + } + + () + } + } + + () } - } - - () - } - } - - match payload18.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload25) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload25 { - Signed(payload26) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload26) - - () + U8Type(payload64) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + match (payload64) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload66) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload66).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload68) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload68 { + Signed(payload69) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload69) + + () + } + Unsigned(payload70) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload70).reinterpret_as_int64()) + + () + } + FloatBits(payload71) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload71).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload66).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload73) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload73 { + Signed(payload74) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload74) + + () + } + Unsigned(payload75) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload75).reinterpret_as_int64()) + + () + } + FloatBits(payload76) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload76).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload66).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload78) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr79 = mbt_ffi_str2ptr(payload78) + mbt_ffi_store32((iter_base) + 72, payload78.length()) + mbt_ffi_store32((iter_base) + 68, ptr79) + cleanup_list.push(ptr79) + + () + } + } + + () + } + } + + () } - Unsigned(payload27) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload27.reinterpret_as_int64(), - ) - - () + U16Type(payload80) => { + mbt_ffi_store8((iter_base) + 0, (7)) + + match (payload80) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload82) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload82).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload84) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload84 { + Signed(payload85) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload85) + + () + } + Unsigned(payload86) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload86).reinterpret_as_int64()) + + () + } + FloatBits(payload87) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload87).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload82).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload89) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload89 { + Signed(payload90) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload90) + + () + } + Unsigned(payload91) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload91).reinterpret_as_int64()) + + () + } + FloatBits(payload92) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload92).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload82).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload94) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr95 = mbt_ffi_str2ptr(payload94) + mbt_ffi_store32((iter_base) + 72, payload94.length()) + mbt_ffi_store32((iter_base) + 68, ptr95) + cleanup_list.push(ptr95) + + () + } + } + + () + } + } + + () } - FloatBits(payload28) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload28.reinterpret_as_int64(), - ) - - () + U32Type(payload96) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + match (payload96) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload98) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload98).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload100) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload100 { + Signed(payload101) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload101) + + () + } + Unsigned(payload102) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload102).reinterpret_as_int64()) + + () + } + FloatBits(payload103) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload103).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload98).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload105) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload105 { + Signed(payload106) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload106) + + () + } + Unsigned(payload107) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload107).reinterpret_as_int64()) + + () + } + FloatBits(payload108) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload108).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload98).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload110) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr111 = mbt_ffi_str2ptr(payload110) + mbt_ffi_store32((iter_base) + 72, payload110.length()) + mbt_ffi_store32((iter_base) + 68, ptr111) + cleanup_list.push(ptr111) + + () + } + } + + () + } + } + + () } - } - - () - } - } - - match payload18.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload30) => { - mbt_ffi_store8(iter_base + 64, 1) - - let ptr31 = mbt_ffi_str2ptr(payload30) - mbt_ffi_store32(iter_base + 72, payload30.length()) - mbt_ffi_store32(iter_base + 68, ptr31) - cleanup_list.push(ptr31) - - () - } - } - - () - } - } - - () - } - S32Type(payload32) => { - mbt_ffi_store8(iter_base + 0, 4) - - match payload32 { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload34) => { - mbt_ffi_store8(iter_base + 8, 1) - - match payload34.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload36) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload36 { - Signed(payload37) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload37) - - () + U64Type(payload112) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + match (payload112) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload114) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload114).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload116) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload116 { + Signed(payload117) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload117) + + () + } + Unsigned(payload118) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload118).reinterpret_as_int64()) + + () + } + FloatBits(payload119) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload119).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload114).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload121) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload121 { + Signed(payload122) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload122) + + () + } + Unsigned(payload123) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload123).reinterpret_as_int64()) + + () + } + FloatBits(payload124) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload124).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload114).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload126) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr127 = mbt_ffi_str2ptr(payload126) + mbt_ffi_store32((iter_base) + 72, payload126.length()) + mbt_ffi_store32((iter_base) + 68, ptr127) + cleanup_list.push(ptr127) + + () + } + } + + () + } + } + + () } - Unsigned(payload38) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload38.reinterpret_as_int64(), - ) - - () + F32Type(payload128) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + match (payload128) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload130) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload130).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload132) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload132 { + Signed(payload133) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload133) + + () + } + Unsigned(payload134) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload134).reinterpret_as_int64()) + + () + } + FloatBits(payload135) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload135).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload130).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload137) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload137 { + Signed(payload138) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload138) + + () + } + Unsigned(payload139) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload139).reinterpret_as_int64()) + + () + } + FloatBits(payload140) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload140).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload130).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload142) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr143 = mbt_ffi_str2ptr(payload142) + mbt_ffi_store32((iter_base) + 72, payload142.length()) + mbt_ffi_store32((iter_base) + 68, ptr143) + cleanup_list.push(ptr143) + + () + } + } + + () + } + } + + () } - FloatBits(payload39) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload39.reinterpret_as_int64(), - ) - - () + F64Type(payload144) => { + mbt_ffi_store8((iter_base) + 0, (11)) + + match (payload144) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload146) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload146).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload148) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload148 { + Signed(payload149) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload149) + + () + } + Unsigned(payload150) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload150).reinterpret_as_int64()) + + () + } + FloatBits(payload151) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload151).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload146).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload153) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload153 { + Signed(payload154) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload154) + + () + } + Unsigned(payload155) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload155).reinterpret_as_int64()) + + () + } + FloatBits(payload156) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload156).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload146).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload158) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr159 = mbt_ffi_str2ptr(payload158) + mbt_ffi_store32((iter_base) + 72, payload158.length()) + mbt_ffi_store32((iter_base) + 68, ptr159) + cleanup_list.push(ptr159) + + () + } + } + + () + } + } + + () } - } - - () - } - } - - match payload34.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload41) => { - mbt_ffi_store8(iter_base + 40, 1) + CharType => { + mbt_ffi_store8((iter_base) + 0, (12)) - match payload41 { - Signed(payload42) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload42) - - () - } - Unsigned(payload43) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload43.reinterpret_as_int64(), - ) - - () + () } - FloatBits(payload44) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload44.reinterpret_as_int64(), - ) - - () - } - } + StringType => { + mbt_ffi_store8((iter_base) + 0, (13)) - () - } - } - - match payload34.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload46) => { - mbt_ffi_store8(iter_base + 64, 1) - - let ptr47 = mbt_ffi_str2ptr(payload46) - mbt_ffi_store32(iter_base + 72, payload46.length()) - mbt_ffi_store32(iter_base + 68, ptr47) - cleanup_list.push(ptr47) - - () - } - } - - () - } - } - - () - } - S64Type(payload48) => { - mbt_ffi_store8(iter_base + 0, 5) - - match payload48 { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload50) => { - mbt_ffi_store8(iter_base + 8, 1) - - match payload50.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload52) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload52 { - Signed(payload53) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload53) - - () + () } - Unsigned(payload54) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload54.reinterpret_as_int64(), - ) - - () + RecordType(payload162) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let address181 = mbt_ffi_malloc((payload162).length() * 68); + for index182 = 0; index182 < (payload162).length(); index182 = index182 + 1 { + let iter_elem : @types.NamedFieldType = (payload162)[(index182)] + let iter_base = address181 + (index182 * 68); + + let ptr163 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr163) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload165) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr166 = mbt_ffi_str2ptr(payload165) + mbt_ffi_store32((iter_base) + 20, payload165.length()) + mbt_ffi_store32((iter_base) + 16, ptr166) + cleanup_list.push(ptr166) + + () + } + } + + let address = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index = 0; index < (((iter_elem).metadata).aliases).length(); index = index + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index)] + let iter_base = address + (index * 8); + + let ptr167 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr167) + cleanup_list.push(ptr167) + + } + mbt_ffi_store32((iter_base) + 28, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 24, address) + + let address169 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index170 = 0; index170 < (((iter_elem).metadata).examples).length(); index170 = index170 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index170)] + let iter_base = address169 + (index170 * 8); + + let ptr168 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr168) + cleanup_list.push(ptr168) + + } + mbt_ffi_store32((iter_base) + 36, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 32, address169) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload172) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + let ptr173 = mbt_ffi_str2ptr(payload172) + mbt_ffi_store32((iter_base) + 48, payload172.length()) + mbt_ffi_store32((iter_base) + 44, ptr173) + cleanup_list.push(ptr173) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 52, (0)) + + () + } + Some(payload175) => { + mbt_ffi_store8((iter_base) + 52, (1)) + + match payload175 { + Multimodal => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 56, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 56, (2)) + + () + } + Other(payload179) => { + mbt_ffi_store8((iter_base) + 56, (3)) + + let ptr180 = mbt_ffi_str2ptr(payload179) + mbt_ffi_store32((iter_base) + 64, payload179.length()) + mbt_ffi_store32((iter_base) + 60, ptr180) + cleanup_list.push(ptr180) + + () + } + } + + () + } + } + cleanup_list.push(ptr163) + cleanup_list.push(address) + cleanup_list.push(address169) + + } + mbt_ffi_store32((iter_base) + 12, (payload162).length()) + mbt_ffi_store32((iter_base) + 8, address181) + cleanup_list.push(address181) + + () } - FloatBits(payload55) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload55.reinterpret_as_int64(), - ) - - () + VariantType(payload183) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let address206 = mbt_ffi_malloc((payload183).length() * 72); + for index207 = 0; index207 < (payload183).length(); index207 = index207 + 1 { + let iter_elem : @types.VariantCaseType = (payload183)[(index207)] + let iter_base = address206 + (index207 * 72); + + let ptr184 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr184) + + match ((iter_elem).payload) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload186) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload186) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload188) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr189 = mbt_ffi_str2ptr(payload188) + mbt_ffi_store32((iter_base) + 24, payload188.length()) + mbt_ffi_store32((iter_base) + 20, ptr189) + cleanup_list.push(ptr189) + + () + } + } + + let address191 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index192 = 0; index192 < (((iter_elem).metadata).aliases).length(); index192 = index192 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index192)] + let iter_base = address191 + (index192 * 8); + + let ptr190 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr190) + cleanup_list.push(ptr190) + + } + mbt_ffi_store32((iter_base) + 32, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 28, address191) + + let address194 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index195 = 0; index195 < (((iter_elem).metadata).examples).length(); index195 = index195 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index195)] + let iter_base = address194 + (index195 * 8); + + let ptr193 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr193) + cleanup_list.push(ptr193) + + } + mbt_ffi_store32((iter_base) + 40, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 36, address194) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 44, (0)) + + () + } + Some(payload197) => { + mbt_ffi_store8((iter_base) + 44, (1)) + + let ptr198 = mbt_ffi_str2ptr(payload197) + mbt_ffi_store32((iter_base) + 52, payload197.length()) + mbt_ffi_store32((iter_base) + 48, ptr198) + cleanup_list.push(ptr198) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload200) => { + mbt_ffi_store8((iter_base) + 56, (1)) + + match payload200 { + Multimodal => { + mbt_ffi_store8((iter_base) + 60, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 60, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 60, (2)) + + () + } + Other(payload204) => { + mbt_ffi_store8((iter_base) + 60, (3)) + + let ptr205 = mbt_ffi_str2ptr(payload204) + mbt_ffi_store32((iter_base) + 68, payload204.length()) + mbt_ffi_store32((iter_base) + 64, ptr205) + cleanup_list.push(ptr205) + + () + } + } + + () + } + } + cleanup_list.push(ptr184) + cleanup_list.push(address191) + cleanup_list.push(address194) + + } + mbt_ffi_store32((iter_base) + 12, (payload183).length()) + mbt_ffi_store32((iter_base) + 8, address206) + cleanup_list.push(address206) + + () } - } - - () - } - } + EnumType(payload208) => { + mbt_ffi_store8((iter_base) + 0, (16)) - match payload50.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let address210 = mbt_ffi_malloc((payload208).length() * 8); + for index211 = 0; index211 < (payload208).length(); index211 = index211 + 1 { + let iter_elem : String = (payload208)[(index211)] + let iter_base = address210 + (index211 * 8); - () - } - Some(payload57) => { - mbt_ffi_store8(iter_base + 40, 1) + let ptr209 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr209) + cleanup_list.push(ptr209) - match payload57 { - Signed(payload58) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload58) + } + mbt_ffi_store32((iter_base) + 12, (payload208).length()) + mbt_ffi_store32((iter_base) + 8, address210) + cleanup_list.push(address210) - () - } - Unsigned(payload59) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload59.reinterpret_as_int64(), - ) - - () + () } - FloatBits(payload60) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload60.reinterpret_as_int64(), - ) - - () - } - } - - () - } - } - - match payload50.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload62) => { - mbt_ffi_store8(iter_base + 64, 1) - - let ptr63 = mbt_ffi_str2ptr(payload62) - mbt_ffi_store32(iter_base + 72, payload62.length()) - mbt_ffi_store32(iter_base + 68, ptr63) - cleanup_list.push(ptr63) - - () - } - } + FlagsType(payload212) => { + mbt_ffi_store8((iter_base) + 0, (17)) - () - } - } + let address214 = mbt_ffi_malloc((payload212).length() * 8); + for index215 = 0; index215 < (payload212).length(); index215 = index215 + 1 { + let iter_elem : String = (payload212)[(index215)] + let iter_base = address214 + (index215 * 8); - () - } - U8Type(payload64) => { - mbt_ffi_store8(iter_base + 0, 6) - - match payload64 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr213 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr213) + cleanup_list.push(ptr213) - () - } - Some(payload66) => { - mbt_ffi_store8(iter_base + 8, 1) + } + mbt_ffi_store32((iter_base) + 12, (payload212).length()) + mbt_ffi_store32((iter_base) + 8, address214) + cleanup_list.push(address214) - match payload66.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + TupleType(payload216) => { + mbt_ffi_store8((iter_base) + 0, (18)) - () - } - Some(payload68) => { - mbt_ffi_store8(iter_base + 16, 1) + let address217 = mbt_ffi_malloc((payload216).length() * 4); + for index218 = 0; index218 < (payload216).length(); index218 = index218 + 1 { + let iter_elem : Int = (payload216)[(index218)] + let iter_base = address217 + (index218 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - match payload68 { - Signed(payload69) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload69) + } + mbt_ffi_store32((iter_base) + 12, (payload216).length()) + mbt_ffi_store32((iter_base) + 8, address217) + cleanup_list.push(address217) - () - } - Unsigned(payload70) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload70.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload71) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload71.reinterpret_as_int64(), - ) - - () + () } - } + ListType(payload219) => { + mbt_ffi_store8((iter_base) + 0, (19)) + mbt_ffi_store32((iter_base) + 8, payload219) - () - } - } - - match payload66.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + FixedListType(payload220) => { + mbt_ffi_store8((iter_base) + 0, (20)) + mbt_ffi_store32((iter_base) + 8, (payload220).element) + mbt_ffi_store32((iter_base) + 12, ((payload220).length).reinterpret_as_int()) - () - } - Some(payload73) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + MapType(payload221) => { + mbt_ffi_store8((iter_base) + 0, (21)) + mbt_ffi_store32((iter_base) + 8, (payload221).key) + mbt_ffi_store32((iter_base) + 12, (payload221).value) - match payload73 { - Signed(payload74) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload74) + () + } + OptionType(payload222) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store32((iter_base) + 8, payload222) - () + () } - Unsigned(payload75) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload75.reinterpret_as_int64(), - ) - - () + ResultType(payload223) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match ((payload223).ok) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload225) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload225) + + () + } + } + + match ((payload223).err) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload227) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload227) + + () + } + } + + () } - FloatBits(payload76) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload76.reinterpret_as_int64(), - ) - - () + TextType(payload228) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match ((payload228).languages) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload230) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address232 = mbt_ffi_malloc((payload230).length() * 8); + for index233 = 0; index233 < (payload230).length(); index233 = index233 + 1 { + let iter_elem : String = (payload230)[(index233)] + let iter_base = address232 + (index233 * 8); + + let ptr231 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr231) + cleanup_list.push(ptr231) + + } + mbt_ffi_store32((iter_base) + 16, (payload230).length()) + mbt_ffi_store32((iter_base) + 12, address232) + cleanup_list.push(address232) + + () + } + } + + match ((payload228).min_length) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload235) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload235).reinterpret_as_int()) + + () + } + } + + match ((payload228).max_length) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload237) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload237).reinterpret_as_int()) + + () + } + } + + match ((payload228).regex) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload239) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr240 = mbt_ffi_str2ptr(payload239) + mbt_ffi_store32((iter_base) + 44, payload239.length()) + mbt_ffi_store32((iter_base) + 40, ptr240) + cleanup_list.push(ptr240) + + () + } + } + + () } - } - - () - } - } - - match payload66.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload78) => { - mbt_ffi_store8(iter_base + 64, 1) - - let ptr79 = mbt_ffi_str2ptr(payload78) - mbt_ffi_store32(iter_base + 72, payload78.length()) - mbt_ffi_store32(iter_base + 68, ptr79) - cleanup_list.push(ptr79) - - () - } - } - - () - } - } - - () - } - U16Type(payload80) => { - mbt_ffi_store8(iter_base + 0, 7) - - match payload80 { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload82) => { - mbt_ffi_store8(iter_base + 8, 1) - - match payload82.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload84) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload84 { - Signed(payload85) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload85) - - () + BinaryType(payload241) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + match ((payload241).mime_types) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload243) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address245 = mbt_ffi_malloc((payload243).length() * 8); + for index246 = 0; index246 < (payload243).length(); index246 = index246 + 1 { + let iter_elem : String = (payload243)[(index246)] + let iter_base = address245 + (index246 * 8); + + let ptr244 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr244) + cleanup_list.push(ptr244) + + } + mbt_ffi_store32((iter_base) + 16, (payload243).length()) + mbt_ffi_store32((iter_base) + 12, address245) + cleanup_list.push(address245) + + () + } + } + + match ((payload241).min_bytes) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload248) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload248).reinterpret_as_int()) + + () + } + } + + match ((payload241).max_bytes) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload250) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload250).reinterpret_as_int()) + + () + } + } + + () } - Unsigned(payload86) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload86.reinterpret_as_int64(), - ) - - () + PathType(payload251) => { + mbt_ffi_store8((iter_base) + 0, (26)) + mbt_ffi_store8((iter_base) + 8, (payload251).direction.ordinal()) + mbt_ffi_store8((iter_base) + 9, (payload251).kind.ordinal()) + + match ((payload251).allowed_mime_types) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload253) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let address255 = mbt_ffi_malloc((payload253).length() * 8); + for index256 = 0; index256 < (payload253).length(); index256 = index256 + 1 { + let iter_elem : String = (payload253)[(index256)] + let iter_base = address255 + (index256 * 8); + + let ptr254 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr254) + cleanup_list.push(ptr254) + + } + mbt_ffi_store32((iter_base) + 20, (payload253).length()) + mbt_ffi_store32((iter_base) + 16, address255) + cleanup_list.push(address255) + + () + } + } + + match ((payload251).allowed_extensions) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload258) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let address260 = mbt_ffi_malloc((payload258).length() * 8); + for index261 = 0; index261 < (payload258).length(); index261 = index261 + 1 { + let iter_elem : String = (payload258)[(index261)] + let iter_base = address260 + (index261 * 8); + + let ptr259 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr259) + cleanup_list.push(ptr259) + + } + mbt_ffi_store32((iter_base) + 32, (payload258).length()) + mbt_ffi_store32((iter_base) + 28, address260) + cleanup_list.push(address260) + + () + } + } + + () } - FloatBits(payload87) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload87.reinterpret_as_int64(), - ) - - () + UrlType(payload262) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + match ((payload262).allowed_schemes) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload264) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address266 = mbt_ffi_malloc((payload264).length() * 8); + for index267 = 0; index267 < (payload264).length(); index267 = index267 + 1 { + let iter_elem : String = (payload264)[(index267)] + let iter_base = address266 + (index267 * 8); + + let ptr265 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr265) + cleanup_list.push(ptr265) + + } + mbt_ffi_store32((iter_base) + 16, (payload264).length()) + mbt_ffi_store32((iter_base) + 12, address266) + cleanup_list.push(address266) + + () + } + } + + match ((payload262).allowed_hosts) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload269) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let address271 = mbt_ffi_malloc((payload269).length() * 8); + for index272 = 0; index272 < (payload269).length(); index272 = index272 + 1 { + let iter_elem : String = (payload269)[(index272)] + let iter_base = address271 + (index272 * 8); + + let ptr270 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr270) + cleanup_list.push(ptr270) + + } + mbt_ffi_store32((iter_base) + 28, (payload269).length()) + mbt_ffi_store32((iter_base) + 24, address271) + cleanup_list.push(address271) + + () + } + } + + () } - } + DatetimeType => { + mbt_ffi_store8((iter_base) + 0, (28)) - () - } - } - - match payload82.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload89) => { - mbt_ffi_store8(iter_base + 40, 1) - - match payload89 { - Signed(payload90) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload90) + () + } + DurationType => { + mbt_ffi_store8((iter_base) + 0, (29)) - () + () } - Unsigned(payload91) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload91.reinterpret_as_int64(), - ) - - () + QuantityType(payload275) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr276 = mbt_ffi_str2ptr((payload275).base_unit) + mbt_ffi_store32((iter_base) + 12, (payload275).base_unit.length()) + mbt_ffi_store32((iter_base) + 8, ptr276) + + let address278 = mbt_ffi_malloc(((payload275).allowed_suffixes).length() * 8); + for index279 = 0; index279 < ((payload275).allowed_suffixes).length(); index279 = index279 + 1 { + let iter_elem : String = ((payload275).allowed_suffixes)[(index279)] + let iter_base = address278 + (index279 * 8); + + let ptr277 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr277) + cleanup_list.push(ptr277) + + } + mbt_ffi_store32((iter_base) + 20, ((payload275).allowed_suffixes).length()) + mbt_ffi_store32((iter_base) + 16, address278) + + match ((payload275).min) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload281) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload281).mantissa) + mbt_ffi_store32((iter_base) + 40, (payload281).scale) + + let ptr282 = mbt_ffi_str2ptr((payload281).unit) + mbt_ffi_store32((iter_base) + 48, (payload281).unit.length()) + mbt_ffi_store32((iter_base) + 44, ptr282) + cleanup_list.push(ptr282) + + () + } + } + + match ((payload275).max) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload284) => { + mbt_ffi_store8((iter_base) + 56, (1)) + mbt_ffi_store64((iter_base) + 64, (payload284).mantissa) + mbt_ffi_store32((iter_base) + 72, (payload284).scale) + + let ptr285 = mbt_ffi_str2ptr((payload284).unit) + mbt_ffi_store32((iter_base) + 80, (payload284).unit.length()) + mbt_ffi_store32((iter_base) + 76, ptr285) + cleanup_list.push(ptr285) + + () + } + } + cleanup_list.push(ptr276) + cleanup_list.push(address278) + + () } - FloatBits(payload92) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload92.reinterpret_as_int64(), - ) - - () + UnionType(payload286) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let address322 = mbt_ffi_malloc(((payload286).branches).length() * 92); + for index323 = 0; index323 < ((payload286).branches).length(); index323 = index323 + 1 { + let iter_elem : @types.UnionBranch = ((payload286).branches)[(index323)] + let iter_base = address322 + (index323 * 92); + + let ptr287 = mbt_ffi_str2ptr((iter_elem).tag) + mbt_ffi_store32((iter_base) + 4, (iter_elem).tag.length()) + mbt_ffi_store32((iter_base) + 0, ptr287) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (iter_elem).discriminator { + Prefix(payload288) => { + mbt_ffi_store8((iter_base) + 12, (0)) + + let ptr289 = mbt_ffi_str2ptr(payload288) + mbt_ffi_store32((iter_base) + 20, payload288.length()) + mbt_ffi_store32((iter_base) + 16, ptr289) + cleanup_list.push(ptr289) + + () + } + Suffix(payload290) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr291 = mbt_ffi_str2ptr(payload290) + mbt_ffi_store32((iter_base) + 20, payload290.length()) + mbt_ffi_store32((iter_base) + 16, ptr291) + cleanup_list.push(ptr291) + + () + } + Contains(payload292) => { + mbt_ffi_store8((iter_base) + 12, (2)) + + let ptr293 = mbt_ffi_str2ptr(payload292) + mbt_ffi_store32((iter_base) + 20, payload292.length()) + mbt_ffi_store32((iter_base) + 16, ptr293) + cleanup_list.push(ptr293) + + () + } + Regex(payload294) => { + mbt_ffi_store8((iter_base) + 12, (3)) + + let ptr295 = mbt_ffi_str2ptr(payload294) + mbt_ffi_store32((iter_base) + 20, payload294.length()) + mbt_ffi_store32((iter_base) + 16, ptr295) + cleanup_list.push(ptr295) + + () + } + FieldEquals(payload296) => { + mbt_ffi_store8((iter_base) + 12, (4)) + + let ptr297 = mbt_ffi_str2ptr((payload296).field_name) + mbt_ffi_store32((iter_base) + 20, (payload296).field_name.length()) + mbt_ffi_store32((iter_base) + 16, ptr297) + + match ((payload296).literal) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload299) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let ptr300 = mbt_ffi_str2ptr(payload299) + mbt_ffi_store32((iter_base) + 32, payload299.length()) + mbt_ffi_store32((iter_base) + 28, ptr300) + cleanup_list.push(ptr300) + + () + } + } + cleanup_list.push(ptr297) + + () + } + FieldAbsent(payload301) => { + mbt_ffi_store8((iter_base) + 12, (5)) + + let ptr302 = mbt_ffi_str2ptr(payload301) + mbt_ffi_store32((iter_base) + 20, payload301.length()) + mbt_ffi_store32((iter_base) + 16, ptr302) + cleanup_list.push(ptr302) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload304) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr305 = mbt_ffi_str2ptr(payload304) + mbt_ffi_store32((iter_base) + 44, payload304.length()) + mbt_ffi_store32((iter_base) + 40, ptr305) + cleanup_list.push(ptr305) + + () + } + } + + let address307 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index308 = 0; index308 < (((iter_elem).metadata).aliases).length(); index308 = index308 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index308)] + let iter_base = address307 + (index308 * 8); + + let ptr306 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr306) + cleanup_list.push(ptr306) + + } + mbt_ffi_store32((iter_base) + 52, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 48, address307) + + let address310 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index311 = 0; index311 < (((iter_elem).metadata).examples).length(); index311 = index311 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index311)] + let iter_base = address310 + (index311 * 8); + + let ptr309 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr309) + cleanup_list.push(ptr309) + + } + mbt_ffi_store32((iter_base) + 60, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 56, address310) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload313) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr314 = mbt_ffi_str2ptr(payload313) + mbt_ffi_store32((iter_base) + 72, payload313.length()) + mbt_ffi_store32((iter_base) + 68, ptr314) + cleanup_list.push(ptr314) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 76, (0)) + + () + } + Some(payload316) => { + mbt_ffi_store8((iter_base) + 76, (1)) + + match payload316 { + Multimodal => { + mbt_ffi_store8((iter_base) + 80, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 80, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 80, (2)) + + () + } + Other(payload320) => { + mbt_ffi_store8((iter_base) + 80, (3)) + + let ptr321 = mbt_ffi_str2ptr(payload320) + mbt_ffi_store32((iter_base) + 88, payload320.length()) + mbt_ffi_store32((iter_base) + 84, ptr321) + cleanup_list.push(ptr321) + + () + } + } + + () + } + } + cleanup_list.push(ptr287) + cleanup_list.push(address307) + cleanup_list.push(address310) + + } + mbt_ffi_store32((iter_base) + 12, ((payload286).branches).length()) + mbt_ffi_store32((iter_base) + 8, address322) + cleanup_list.push(address322) + + () } - } - - () - } - } + SecretType(payload324) => { + mbt_ffi_store8((iter_base) + 0, (32)) + mbt_ffi_store32((iter_base) + 8, (payload324).inner) - match payload82.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match ((payload324).category) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - Some(payload94) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + Some(payload326) => { + mbt_ffi_store8((iter_base) + 12, (1)) - let ptr95 = mbt_ffi_str2ptr(payload94) - mbt_ffi_store32(iter_base + 72, payload94.length()) - mbt_ffi_store32(iter_base + 68, ptr95) - cleanup_list.push(ptr95) + let ptr327 = mbt_ffi_str2ptr(payload326) + mbt_ffi_store32((iter_base) + 20, payload326.length()) + mbt_ffi_store32((iter_base) + 16, ptr327) + cleanup_list.push(ptr327) - () - } - } + () + } + } - () - } - } - - () - } - U32Type(payload96) => { - mbt_ffi_store8(iter_base + 0, 8) - - match payload96 { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload98) => { - mbt_ffi_store8(iter_base + 8, 1) - - match payload98.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload100) => { - mbt_ffi_store8(iter_base + 16, 1) - - match payload100 { - Signed(payload101) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload101) - - () + () } - Unsigned(payload102) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload102.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload103) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload103.reinterpret_as_int64(), - ) - - () - } - } + QuotaTokenType(payload328) => { + mbt_ffi_store8((iter_base) + 0, (33)) - () - } - } + match ((payload328).resource_name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload98.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + Some(payload330) => { + mbt_ffi_store8((iter_base) + 8, (1)) - () - } - Some(payload105) => { - mbt_ffi_store8(iter_base + 40, 1) + let ptr331 = mbt_ffi_str2ptr(payload330) + mbt_ffi_store32((iter_base) + 16, payload330.length()) + mbt_ffi_store32((iter_base) + 12, ptr331) + cleanup_list.push(ptr331) - match payload105 { - Signed(payload106) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload106) + () + } + } - () - } - Unsigned(payload107) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload107.reinterpret_as_int64(), - ) - - () + () } - FloatBits(payload108) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload108.reinterpret_as_int64(), - ) - - () - } - } - - () - } - } - - match payload98.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + PermissionCardType(payload332) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store8((iter_base) + 8, (if (payload332).polymorphic { 1 } else { 0 })) - () - } - Some(payload110) => { - mbt_ffi_store8(iter_base + 64, 1) - - let ptr111 = mbt_ffi_str2ptr(payload110) - mbt_ffi_store32(iter_base + 72, payload110.length()) - mbt_ffi_store32(iter_base + 68, ptr111) - cleanup_list.push(ptr111) - - () - } - } + () + } + FutureType(payload333) => { + mbt_ffi_store8((iter_base) + 0, (35)) - () - } - } + match (payload333) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - U64Type(payload112) => { - mbt_ffi_store8(iter_base + 0, 9) + () + } + Some(payload335) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload335) - match payload112 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + } - () - } - Some(payload114) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + StreamType(payload336) => { + mbt_ffi_store8((iter_base) + 0, (36)) - match payload114.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + match (payload336) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - Some(payload116) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + Some(payload338) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload338) - match payload116 { - Signed(payload117) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload117) + () + } + } - () - } - Unsigned(payload118) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload118.reinterpret_as_int64(), - ) - - () + () } - FloatBits(payload119) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload119.reinterpret_as_int64(), - ) - - () - } - } - - () - } } - match payload114.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 88, (0)) - () - } - Some(payload121) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + Some(payload340) => { + mbt_ffi_store8((iter_base) + 88, (1)) - match payload121 { - Signed(payload122) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload122) + let ptr341 = mbt_ffi_str2ptr(payload340) + mbt_ffi_store32((iter_base) + 96, payload340.length()) + mbt_ffi_store32((iter_base) + 92, ptr341) + cleanup_list.push(ptr341) - () - } - Unsigned(payload123) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload123.reinterpret_as_int64(), - ) - - () + () } - FloatBits(payload124) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload124.reinterpret_as_int64(), - ) - - () - } - } - - () - } } - match payload114.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let address343 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index344 = 0; index344 < (((iter_elem).metadata).aliases).length(); index344 = index344 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index344)] + let iter_base = address343 + (index344 * 8); - () - } - Some(payload126) => { - mbt_ffi_store8(iter_base + 64, 1) + let ptr342 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr342) + cleanup_list.push(ptr342) - let ptr127 = mbt_ffi_str2ptr(payload126) - mbt_ffi_store32(iter_base + 72, payload126.length()) - mbt_ffi_store32(iter_base + 68, ptr127) - cleanup_list.push(ptr127) - - () - } } + mbt_ffi_store32((iter_base) + 104, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 100, address343) - () - } - } - - () - } - F32Type(payload128) => { - mbt_ffi_store8(iter_base + 0, 10) + let address346 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index347 = 0; index347 < (((iter_elem).metadata).examples).length(); index347 = index347 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index347)] + let iter_base = address346 + (index347 * 8); - match payload128 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr345 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr345) + cleanup_list.push(ptr345) - () - } - Some(payload130) => { - mbt_ffi_store8(iter_base + 8, 1) + } + mbt_ffi_store32((iter_base) + 112, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 108, address346) - match payload130.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 116, (0)) - () - } - Some(payload132) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + Some(payload349) => { + mbt_ffi_store8((iter_base) + 116, (1)) - match payload132 { - Signed(payload133) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload133) + let ptr350 = mbt_ffi_str2ptr(payload349) + mbt_ffi_store32((iter_base) + 124, payload349.length()) + mbt_ffi_store32((iter_base) + 120, ptr350) + cleanup_list.push(ptr350) - () - } - Unsigned(payload134) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload134.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload135) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload135.reinterpret_as_int64(), - ) - - () + () } - } - - () - } } - match payload130.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload137) => { - mbt_ffi_store8(iter_base + 40, 1) + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 128, (0)) - match payload137 { - Signed(payload138) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload138) - - () - } - Unsigned(payload139) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload139.reinterpret_as_int64(), - ) - - () + () } - FloatBits(payload140) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload140.reinterpret_as_int64(), - ) - - () + Some(payload352) => { + mbt_ffi_store8((iter_base) + 128, (1)) + + match payload352 { + Multimodal => { + mbt_ffi_store8((iter_base) + 132, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 132, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 132, (2)) + + () + } + Other(payload356) => { + mbt_ffi_store8((iter_base) + 132, (3)) + + let ptr357 = mbt_ffi_str2ptr(payload356) + mbt_ffi_store32((iter_base) + 140, payload356.length()) + mbt_ffi_store32((iter_base) + 136, ptr357) + cleanup_list.push(ptr357) + + () + } + } + + () } - } - - () - } } + cleanup_list.push(address343) + cleanup_list.push(address346) - match payload130.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload142) => { - mbt_ffi_store8(iter_base + 64, 1) - - let ptr143 = mbt_ffi_str2ptr(payload142) - mbt_ffi_store32(iter_base + 72, payload142.length()) - mbt_ffi_store32(iter_base + 68, ptr143) - cleanup_list.push(ptr143) - - () - } - } - - () - } - } - - () } - F64Type(payload144) => { - mbt_ffi_store8(iter_base + 0, 11) - - match payload144 { - None => { - mbt_ffi_store8(iter_base + 8, 0) - () - } - Some(payload146) => { - mbt_ffi_store8(iter_base + 8, 1) + let address364 = mbt_ffi_malloc(((expected).defs).length() * 24); + for index365 = 0; index365 < ((expected).defs).length(); index365 = index365 + 1 { + let iter_elem : @types.SchemaTypeDef = ((expected).defs)[(index365)] + let iter_base = address364 + (index365 * 24); - match payload146.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let ptr360 = mbt_ffi_str2ptr((iter_elem).id) + mbt_ffi_store32((iter_base) + 4, (iter_elem).id.length()) + mbt_ffi_store32((iter_base) + 0, ptr360) - () - } - Some(payload148) => { - mbt_ffi_store8(iter_base + 16, 1) + match ((iter_elem).name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload148 { - Signed(payload149) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload149) - - () - } - Unsigned(payload150) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload150.reinterpret_as_int64(), - ) - - () + () } - FloatBits(payload151) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload151.reinterpret_as_int64(), - ) - - () - } - } - - () - } - } - - match payload146.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload153) => { - mbt_ffi_store8(iter_base + 40, 1) + Some(payload362) => { + mbt_ffi_store8((iter_base) + 8, (1)) - match payload153 { - Signed(payload154) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload154) + let ptr363 = mbt_ffi_str2ptr(payload362) + mbt_ffi_store32((iter_base) + 16, payload362.length()) + mbt_ffi_store32((iter_base) + 12, ptr363) + cleanup_list.push(ptr363) - () + () } - Unsigned(payload155) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload155.reinterpret_as_int64(), - ) - - () - } - FloatBits(payload156) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload156.reinterpret_as_int64(), - ) - - () - } - } - - () - } } + mbt_ffi_store32((iter_base) + 20, (iter_elem).body) + cleanup_list.push(ptr360) - match payload146.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload158) => { - mbt_ffi_store8(iter_base + 64, 1) - - let ptr159 = mbt_ffi_str2ptr(payload158) - mbt_ffi_store32(iter_base + 72, payload158.length()) - mbt_ffi_store32(iter_base + 68, ptr159) - cleanup_list.push(ptr159) - - () - } - } - - () - } - } - - () } - CharType => { - mbt_ffi_store8(iter_base + 0, 12) + let return_area = mbt_ffi_malloc(16) + wasmImportReveal(handle, address358, ((expected).type_nodes).length(), address364, ((expected).defs).length(), (expected).root, return_area); - () - } - StringType => { - mbt_ffi_store8(iter_base + 0, 13) + let lifted398 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { - () - } - RecordType(payload162) => { - mbt_ffi_store8(iter_base + 0, 14) - - let address181 = mbt_ffi_malloc(payload162.length() * 68) - for index182 = 0 - index182 < payload162.length() - index182 = index182 + 1 { - let iter_elem : @types.NamedFieldType = payload162[index182] - let iter_base = address181 + index182 * 68 - - let ptr163 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr163) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload165) => { - mbt_ffi_store8(iter_base + 12, 1) + let array392 : Array[@types.SchemaValueNode] = []; + for index393 = 0; index393 < (mbt_ffi_load32((return_area) + 8)); index393 = index393 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index393 * 32) - let ptr166 = mbt_ffi_str2ptr(payload165) - mbt_ffi_store32(iter_base + 20, payload165.length()) - mbt_ffi_store32(iter_base + 16, ptr166) - cleanup_list.push(ptr166) + let lifted391 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - } - - let address = mbt_ffi_malloc(iter_elem.metadata.aliases.length() * 8) - for index = 0 - index < iter_elem.metadata.aliases.length() - index = index + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index] - let iter_base = address + index * 8 - - let ptr167 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr167) - cleanup_list.push(ptr167) - } - mbt_ffi_store32(iter_base + 28, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 24, address) - - let address169 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index170 = 0 - index170 < iter_elem.metadata.examples.length() - index170 = index170 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index170] - let iter_base = address169 + index170 * 8 - - let ptr168 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr168) - cleanup_list.push(ptr168) - } - mbt_ffi_store32(iter_base + 36, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 32, address169) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload172) => { - mbt_ffi_store8(iter_base + 40, 1) + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - let ptr173 = mbt_ffi_str2ptr(payload172) - mbt_ffi_store32(iter_base + 48, payload172.length()) - mbt_ffi_store32(iter_base + 44, ptr173) - cleanup_list.push(ptr173) + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - () - } - } + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 52, 0) + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - () - } - Some(payload175) => { - mbt_ffi_store8(iter_base + 52, 1) - - match payload175 { - Multimodal => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 56, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 56, 2) - - () - } - Other(payload179) => { - mbt_ffi_store8(iter_base + 56, 3) - - let ptr180 = mbt_ffi_str2ptr(payload179) - mbt_ffi_store32(iter_base + 64, payload179.length()) - mbt_ffi_store32(iter_base + 60, ptr180) - cleanup_list.push(ptr180) - - () - } - } - - () - } - } - cleanup_list.push(ptr163) - cleanup_list.push(address) - cleanup_list.push(address169) - } - mbt_ffi_store32(iter_base + 12, payload162.length()) - mbt_ffi_store32(iter_base + 8, address181) - cleanup_list.push(address181) - - () - } - VariantType(payload183) => { - mbt_ffi_store8(iter_base + 0, 15) + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - let address206 = mbt_ffi_malloc(payload183.length() * 72) - for index207 = 0 - index207 < payload183.length() - index207 = index207 + 1 { - let iter_elem : @types.VariantCaseType = payload183[index207] - let iter_base = address206 + index207 * 72 + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - let ptr184 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr184) + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - match iter_elem.payload { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - () - } - Some(payload186) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload186) + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - () - } - } + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - () - } - Some(payload188) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - let ptr189 = mbt_ffi_str2ptr(payload188) - mbt_ffi_store32(iter_base + 24, payload188.length()) - mbt_ffi_store32(iter_base + 20, ptr189) - cleanup_list.push(ptr189) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } - - let address191 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index192 = 0 - index192 < iter_elem.metadata.aliases.length() - index192 = index192 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index192] - let iter_base = address191 + index192 * 8 - - let ptr190 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr190) - cleanup_list.push(ptr190) - } - mbt_ffi_store32(iter_base + 32, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 28, address191) - - let address194 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index195 = 0 - index195 < iter_elem.metadata.examples.length() - index195 = index195 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index195] - let iter_base = address194 + index195 * 8 - - let ptr193 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr193) - cleanup_list.push(ptr193) - } - mbt_ffi_store32(iter_base + 40, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 36, address194) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 44, 0) - - () - } - Some(payload197) => { - mbt_ffi_store8(iter_base + 44, 1) + @types.SchemaValueNode::StringValue(result) + } + 13 => { - let ptr198 = mbt_ffi_str2ptr(payload197) - mbt_ffi_store32(iter_base + 52, payload197.length()) - mbt_ffi_store32(iter_base + 48, ptr198) - cleanup_list.push(ptr198) + let array : Array[Int] = []; + for index366 = 0; index366 < (mbt_ffi_load32((iter_base) + 12)); index366 = index366 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index366 * 4) - () - } - } + array.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 56, 0) + @types.SchemaValueNode::RecordValue(array) + } + 14 => { - () - } - Some(payload200) => { - mbt_ffi_store8(iter_base + 56, 1) - - match payload200 { - Multimodal => { - mbt_ffi_store8(iter_base + 60, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 60, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 60, 2) - - () - } - Other(payload204) => { - mbt_ffi_store8(iter_base + 60, 3) - - let ptr205 = mbt_ffi_str2ptr(payload204) - mbt_ffi_store32(iter_base + 68, payload204.length()) - mbt_ffi_store32(iter_base + 64, ptr205) - cleanup_list.push(ptr205) - - () - } - } - - () - } - } - cleanup_list.push(ptr184) - cleanup_list.push(address191) - cleanup_list.push(address194) - } - mbt_ffi_store32(iter_base + 12, payload183.length()) - mbt_ffi_store32(iter_base + 8, address206) - cleanup_list.push(address206) - - () - } - EnumType(payload208) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address210 = mbt_ffi_malloc(payload208.length() * 8) - for index211 = 0 - index211 < payload208.length() - index211 = index211 + 1 { - let iter_elem : String = payload208[index211] - let iter_base = address210 + index211 * 8 - - let ptr209 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr209) - cleanup_list.push(ptr209) - } - mbt_ffi_store32(iter_base + 12, payload208.length()) - mbt_ffi_store32(iter_base + 8, address210) - cleanup_list.push(address210) - - () - } - FlagsType(payload212) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address214 = mbt_ffi_malloc(payload212.length() * 8) - for index215 = 0 - index215 < payload212.length() - index215 = index215 + 1 { - let iter_elem : String = payload212[index215] - let iter_base = address214 + index215 * 8 - - let ptr213 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr213) - cleanup_list.push(ptr213) - } - mbt_ffi_store32(iter_base + 12, payload212.length()) - mbt_ffi_store32(iter_base + 8, address214) - cleanup_list.push(address214) - - () - } - TupleType(payload216) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address217 = mbt_ffi_malloc(payload216.length() * 4) - for index218 = 0 - index218 < payload216.length() - index218 = index218 + 1 { - let iter_elem : Int = payload216[index218] - let iter_base = address217 + index218 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload216.length()) - mbt_ffi_store32(iter_base + 8, address217) - cleanup_list.push(address217) - - () - } - ListType(payload219) => { - mbt_ffi_store8(iter_base + 0, 19) - mbt_ffi_store32(iter_base + 8, payload219) + let lifted : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - FixedListType(payload220) => { - mbt_ffi_store8(iter_base + 0, 20) - mbt_ffi_store32(iter_base + 8, payload220.element) - mbt_ffi_store32(iter_base + 12, payload220.length.reinterpret_as_int()) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - () - } - MapType(payload221) => { - mbt_ffi_store8(iter_base + 0, 21) - mbt_ffi_store32(iter_base + 8, payload221.key) - mbt_ffi_store32(iter_base + 12, payload221.value) + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted}) + } + 15 => { - () - } - OptionType(payload222) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store32(iter_base + 8, payload222) + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - () - } - ResultType(payload223) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload223.ok { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload225) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload225) - - () - } - } - - match payload223.err { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload227) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload227) - - () - } - } - - () - } - TextType(payload228) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload228.languages { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload230) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address232 = mbt_ffi_malloc(payload230.length() * 8) - for index233 = 0 - index233 < payload230.length() - index233 = index233 + 1 { - let iter_elem : String = payload230[index233] - let iter_base = address232 + index233 * 8 - - let ptr231 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr231) - cleanup_list.push(ptr231) - } - mbt_ffi_store32(iter_base + 16, payload230.length()) - mbt_ffi_store32(iter_base + 12, address232) - cleanup_list.push(address232) - - () - } - } - - match payload228.min_length { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload235) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload235.reinterpret_as_int()) - - () - } - } - - match payload228.max_length { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload237) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload237.reinterpret_as_int()) - - () - } - } - - match payload228.regex { - None => { - mbt_ffi_store8(iter_base + 36, 0) - - () - } - Some(payload239) => { - mbt_ffi_store8(iter_base + 36, 1) - - let ptr240 = mbt_ffi_str2ptr(payload239) - mbt_ffi_store32(iter_base + 44, payload239.length()) - mbt_ffi_store32(iter_base + 40, ptr240) - cleanup_list.push(ptr240) - - () - } - } - - () - } - BinaryType(payload241) => { - mbt_ffi_store8(iter_base + 0, 25) - - match payload241.mime_types { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload243) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address245 = mbt_ffi_malloc(payload243.length() * 8) - for index246 = 0 - index246 < payload243.length() - index246 = index246 + 1 { - let iter_elem : String = payload243[index246] - let iter_base = address245 + index246 * 8 - - let ptr244 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr244) - cleanup_list.push(ptr244) - } - mbt_ffi_store32(iter_base + 16, payload243.length()) - mbt_ffi_store32(iter_base + 12, address245) - cleanup_list.push(address245) - - () - } - } - - match payload241.min_bytes { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload248) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload248.reinterpret_as_int()) - - () - } - } - - match payload241.max_bytes { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload250) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload250.reinterpret_as_int()) - - () - } - } - - () - } - PathType(payload251) => { - mbt_ffi_store8(iter_base + 0, 26) - mbt_ffi_store8(iter_base + 8, payload251.direction.ordinal()) - mbt_ffi_store8(iter_base + 9, payload251.kind.ordinal()) - - match payload251.allowed_mime_types { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload253) => { - mbt_ffi_store8(iter_base + 12, 1) - - let address255 = mbt_ffi_malloc(payload253.length() * 8) - for index256 = 0 - index256 < payload253.length() - index256 = index256 + 1 { - let iter_elem : String = payload253[index256] - let iter_base = address255 + index256 * 8 - - let ptr254 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr254) - cleanup_list.push(ptr254) - } - mbt_ffi_store32(iter_base + 20, payload253.length()) - mbt_ffi_store32(iter_base + 16, address255) - cleanup_list.push(address255) - - () - } - } - - match payload251.allowed_extensions { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload258) => { - mbt_ffi_store8(iter_base + 24, 1) - - let address260 = mbt_ffi_malloc(payload258.length() * 8) - for index261 = 0 - index261 < payload258.length() - index261 = index261 + 1 { - let iter_elem : String = payload258[index261] - let iter_base = address260 + index261 * 8 - - let ptr259 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr259) - cleanup_list.push(ptr259) - } - mbt_ffi_store32(iter_base + 32, payload258.length()) - mbt_ffi_store32(iter_base + 28, address260) - cleanup_list.push(address260) + let array367 : Array[Bool] = []; + for index368 = 0; index368 < (mbt_ffi_load32((iter_base) + 12)); index368 = index368 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index368 * 1) - () - } - } + array367.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - UrlType(payload262) => { - mbt_ffi_store8(iter_base + 0, 27) - - match payload262.allowed_schemes { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload264) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address266 = mbt_ffi_malloc(payload264.length() * 8) - for index267 = 0 - index267 < payload264.length() - index267 = index267 + 1 { - let iter_elem : String = payload264[index267] - let iter_base = address266 + index267 * 8 - - let ptr265 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr265) - cleanup_list.push(ptr265) - } - mbt_ffi_store32(iter_base + 16, payload264.length()) - mbt_ffi_store32(iter_base + 12, address266) - cleanup_list.push(address266) - - () - } - } - - match payload262.allowed_hosts { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload269) => { - mbt_ffi_store8(iter_base + 20, 1) - - let address271 = mbt_ffi_malloc(payload269.length() * 8) - for index272 = 0 - index272 < payload269.length() - index272 = index272 + 1 { - let iter_elem : String = payload269[index272] - let iter_base = address271 + index272 * 8 - - let ptr270 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr270) - cleanup_list.push(ptr270) - } - mbt_ffi_store32(iter_base + 28, payload269.length()) - mbt_ffi_store32(iter_base + 24, address271) - cleanup_list.push(address271) + @types.SchemaValueNode::FlagsValue(array367) + } + 17 => { - () - } - } + let array369 : Array[Int] = []; + for index370 = 0; index370 < (mbt_ffi_load32((iter_base) + 12)); index370 = index370 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index370 * 4) - () - } - DatetimeType => { - mbt_ffi_store8(iter_base + 0, 28) + array369.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - DurationType => { - mbt_ffi_store8(iter_base + 0, 29) + @types.SchemaValueNode::TupleValue(array369) + } + 18 => { - () - } - QuantityType(payload275) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr276 = mbt_ffi_str2ptr(payload275.base_unit) - mbt_ffi_store32(iter_base + 12, payload275.base_unit.length()) - mbt_ffi_store32(iter_base + 8, ptr276) - - let address278 = mbt_ffi_malloc( - payload275.allowed_suffixes.length() * 8, - ) - for index279 = 0 - index279 < payload275.allowed_suffixes.length() - index279 = index279 + 1 { - let iter_elem : String = payload275.allowed_suffixes[index279] - let iter_base = address278 + index279 * 8 - - let ptr277 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr277) - cleanup_list.push(ptr277) - } - mbt_ffi_store32(iter_base + 20, payload275.allowed_suffixes.length()) - mbt_ffi_store32(iter_base + 16, address278) - - match payload275.min { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload281) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload281.mantissa) - mbt_ffi_store32(iter_base + 40, payload281.scale) - - let ptr282 = mbt_ffi_str2ptr(payload281.unit) - mbt_ffi_store32(iter_base + 48, payload281.unit.length()) - mbt_ffi_store32(iter_base + 44, ptr282) - cleanup_list.push(ptr282) - - () - } - } - - match payload275.max { - None => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - Some(payload284) => { - mbt_ffi_store8(iter_base + 56, 1) - mbt_ffi_store64(iter_base + 64, payload284.mantissa) - mbt_ffi_store32(iter_base + 72, payload284.scale) - - let ptr285 = mbt_ffi_str2ptr(payload284.unit) - mbt_ffi_store32(iter_base + 80, payload284.unit.length()) - mbt_ffi_store32(iter_base + 76, ptr285) - cleanup_list.push(ptr285) - - () - } - } - cleanup_list.push(ptr276) - cleanup_list.push(address278) - - () - } - UnionType(payload286) => { - mbt_ffi_store8(iter_base + 0, 31) - - let address322 = mbt_ffi_malloc(payload286.branches.length() * 92) - for index323 = 0 - index323 < payload286.branches.length() - index323 = index323 + 1 { - let iter_elem : @types.UnionBranch = payload286.branches[index323] - let iter_base = address322 + index323 * 92 - - let ptr287 = mbt_ffi_str2ptr(iter_elem.tag) - mbt_ffi_store32(iter_base + 4, iter_elem.tag.length()) - mbt_ffi_store32(iter_base + 0, ptr287) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.discriminator { - Prefix(payload288) => { - mbt_ffi_store8(iter_base + 12, 0) - - let ptr289 = mbt_ffi_str2ptr(payload288) - mbt_ffi_store32(iter_base + 20, payload288.length()) - mbt_ffi_store32(iter_base + 16, ptr289) - cleanup_list.push(ptr289) - - () - } - Suffix(payload290) => { - mbt_ffi_store8(iter_base + 12, 1) + let array371 : Array[Int] = []; + for index372 = 0; index372 < (mbt_ffi_load32((iter_base) + 12)); index372 = index372 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index372 * 4) - let ptr291 = mbt_ffi_str2ptr(payload290) - mbt_ffi_store32(iter_base + 20, payload290.length()) - mbt_ffi_store32(iter_base + 16, ptr291) - cleanup_list.push(ptr291) + array371.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Contains(payload292) => { - mbt_ffi_store8(iter_base + 12, 2) + @types.SchemaValueNode::ListValue(array371) + } + 19 => { - let ptr293 = mbt_ffi_str2ptr(payload292) - mbt_ffi_store32(iter_base + 20, payload292.length()) - mbt_ffi_store32(iter_base + 16, ptr293) - cleanup_list.push(ptr293) + let array373 : Array[Int] = []; + for index374 = 0; index374 < (mbt_ffi_load32((iter_base) + 12)); index374 = index374 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index374 * 4) - () - } - Regex(payload294) => { - mbt_ffi_store8(iter_base + 12, 3) + array373.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let ptr295 = mbt_ffi_str2ptr(payload294) - mbt_ffi_store32(iter_base + 20, payload294.length()) - mbt_ffi_store32(iter_base + 16, ptr295) - cleanup_list.push(ptr295) + @types.SchemaValueNode::FixedListValue(array373) + } + 20 => { - () - } - FieldEquals(payload296) => { - mbt_ffi_store8(iter_base + 12, 4) + let array375 : Array[@types.MapEntry] = []; + for index376 = 0; index376 < (mbt_ffi_load32((iter_base) + 12)); index376 = index376 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index376 * 8) - let ptr297 = mbt_ffi_str2ptr(payload296.field_name) - mbt_ffi_store32(iter_base + 20, payload296.field_name.length()) - mbt_ffi_store32(iter_base + 16, ptr297) + array375.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload296.literal { - None => { - mbt_ffi_store8(iter_base + 24, 0) + @types.SchemaValueNode::MapValue(array375) + } + 21 => { - () - } - Some(payload299) => { - mbt_ffi_store8(iter_base + 24, 1) + let lifted377 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let ptr300 = mbt_ffi_str2ptr(payload299) - mbt_ffi_store32(iter_base + 32, payload299.length()) - mbt_ffi_store32(iter_base + 28, ptr300) - cleanup_list.push(ptr300) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - () - } - } - cleanup_list.push(ptr297) + @types.SchemaValueNode::OptionValue(lifted377) + } + 22 => { - () - } - FieldAbsent(payload301) => { - mbt_ffi_store8(iter_base + 12, 5) + let lifted380 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - let ptr302 = mbt_ffi_str2ptr(payload301) - mbt_ffi_store32(iter_base + 20, payload301.length()) - mbt_ffi_store32(iter_base + 16, ptr302) - cleanup_list.push(ptr302) + let lifted378 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 36, 0) + @types.ResultValuePayload::OkValue(lifted378) + } + 1 => { - () - } - Some(payload304) => { - mbt_ffi_store8(iter_base + 36, 1) + let lifted379 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let ptr305 = mbt_ffi_str2ptr(payload304) - mbt_ffi_store32(iter_base + 44, payload304.length()) - mbt_ffi_store32(iter_base + 40, ptr305) - cleanup_list.push(ptr305) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - () - } - } - - let address307 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index308 = 0 - index308 < iter_elem.metadata.aliases.length() - index308 = index308 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index308] - let iter_base = address307 + index308 * 8 - - let ptr306 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr306) - cleanup_list.push(ptr306) - } - mbt_ffi_store32(iter_base + 52, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 48, address307) - - let address310 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index311 = 0 - index311 < iter_elem.metadata.examples.length() - index311 = index311 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index311] - let iter_base = address310 + index311 * 8 - - let ptr309 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr309) - cleanup_list.push(ptr309) - } - mbt_ffi_store32(iter_base + 60, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 56, address310) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload313) => { - mbt_ffi_store8(iter_base + 64, 1) + @types.ResultValuePayload::ErrValue(lifted379) + } + _ => panic() + } - let ptr314 = mbt_ffi_str2ptr(payload313) - mbt_ffi_store32(iter_base + 72, payload313.length()) - mbt_ffi_store32(iter_base + 68, ptr314) - cleanup_list.push(ptr314) + @types.SchemaValueNode::ResultValue(lifted380) + } + 23 => { - () - } - } + let result381 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 76, 0) + let lifted383 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload316) => { - mbt_ffi_store8(iter_base + 76, 1) - - match payload316 { - Multimodal => { - mbt_ffi_store8(iter_base + 80, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 80, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 80, 2) - - () - } - Other(payload320) => { - mbt_ffi_store8(iter_base + 80, 3) - - let ptr321 = mbt_ffi_str2ptr(payload320) - mbt_ffi_store32(iter_base + 88, payload320.length()) - mbt_ffi_store32(iter_base + 84, ptr321) - cleanup_list.push(ptr321) - - () - } - } - - () - } - } - cleanup_list.push(ptr287) - cleanup_list.push(address307) - cleanup_list.push(address310) - } - mbt_ffi_store32(iter_base + 12, payload286.branches.length()) - mbt_ffi_store32(iter_base + 8, address322) - cleanup_list.push(address322) - - () - } - SecretType(payload324) => { - mbt_ffi_store8(iter_base + 0, 32) - mbt_ffi_store32(iter_base + 8, payload324.inner) + let result382 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - match payload324.category { - None => { - mbt_ffi_store8(iter_base + 12, 0) + Option::Some(result382) + } + _ => panic() + } - () - } - Some(payload326) => { - mbt_ffi_store8(iter_base + 12, 1) + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result381, language : lifted383}) + } + 24 => { - let ptr327 = mbt_ffi_str2ptr(payload326) - mbt_ffi_store32(iter_base + 20, payload326.length()) - mbt_ffi_store32(iter_base + 16, ptr327) - cleanup_list.push(ptr327) + let result384 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } + let lifted386 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - QuotaTokenType(payload328) => { - mbt_ffi_store8(iter_base + 0, 33) + let result385 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - match payload328.resource_name { - None => { - mbt_ffi_store8(iter_base + 8, 0) + Option::Some(result385) + } + _ => panic() + } - () - } - Some(payload330) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result384, mime_type : lifted386}) + } + 25 => { - let ptr331 = mbt_ffi_str2ptr(payload330) - mbt_ffi_store32(iter_base + 16, payload330.length()) - mbt_ffi_store32(iter_base + 12, ptr331) - cleanup_list.push(ptr331) + let result387 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } + @types.SchemaValueNode::PathValue(result387) + } + 26 => { - () - } - FutureType(payload332) => { - mbt_ffi_store8(iter_base + 0, 34) + let result388 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload332 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::UrlValue(result388) + } + 27 => { - () - } - Some(payload334) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload334) + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - () - } - } + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - () - } - StreamType(payload335) => { - mbt_ffi_store8(iter_base + 0, 35) + let result389 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - match payload335 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result389}) + } + 30 => { - () - } - Some(payload337) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload337) + let result390 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result390, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - () - } - } + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 88, 0) + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - () - } - Some(payload339) => { - mbt_ffi_store8(iter_base + 88, 1) + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } - let ptr340 = mbt_ffi_str2ptr(payload339) - mbt_ffi_store32(iter_base + 96, payload339.length()) - mbt_ffi_store32(iter_base + 92, ptr340) - cleanup_list.push(ptr340) - - () - } - } - - let address342 = mbt_ffi_malloc(iter_elem.metadata.aliases.length() * 8) - for index343 = 0 - index343 < iter_elem.metadata.aliases.length() - index343 = index343 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index343] - let iter_base = address342 + index343 * 8 - - let ptr341 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr341) - cleanup_list.push(ptr341) - } - mbt_ffi_store32(iter_base + 104, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 100, address342) - - let address345 = mbt_ffi_malloc(iter_elem.metadata.examples.length() * 8) - for index346 = 0 - index346 < iter_elem.metadata.examples.length() - index346 = index346 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index346] - let iter_base = address345 + index346 * 8 - - let ptr344 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr344) - cleanup_list.push(ptr344) - } - mbt_ffi_store32(iter_base + 112, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 108, address345) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 116, 0) - - () - } - Some(payload348) => { - mbt_ffi_store8(iter_base + 116, 1) - - let ptr349 = mbt_ffi_str2ptr(payload348) - mbt_ffi_store32(iter_base + 124, payload348.length()) - mbt_ffi_store32(iter_base + 120, ptr349) - cleanup_list.push(ptr349) - - () - } - } + array392.push(lifted391) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 128, 0) + Result::Ok(@types.SchemaValueTree::{value_nodes : array392, root : mbt_ffi_load32((return_area) + 12)}) + } + 1 => { - () - } - Some(payload351) => { - mbt_ffi_store8(iter_base + 128, 1) - - match payload351 { - Multimodal => { - mbt_ffi_store8(iter_base + 132, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 132, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 132, 2) - - () - } - Other(payload355) => { - mbt_ffi_store8(iter_base + 132, 3) - - let ptr356 = mbt_ffi_str2ptr(payload355) - mbt_ffi_store32(iter_base + 140, payload355.length()) - mbt_ffi_store32(iter_base + 136, ptr356) - cleanup_list.push(ptr356) - - () - } - } - - () - } - } - cleanup_list.push(address342) - cleanup_list.push(address345) - } + let lifted397 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - let address363 = mbt_ffi_malloc(expected.defs.length() * 24) - for index364 = 0; index364 < expected.defs.length(); index364 = index364 + 1 { - let iter_elem : @types.SchemaTypeDef = expected.defs[index364] - let iter_base = address363 + index364 * 24 + let result394 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let ptr359 = mbt_ffi_str2ptr(iter_elem.id) - mbt_ffi_store32(iter_base + 4, iter_elem.id.length()) - mbt_ffi_store32(iter_base + 0, ptr359) + @types0.SecretError::Unavailable(result394) + } + 1 => { - match iter_elem.name { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let result395 = mbt_ffi_ptr2bytes(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - Some(payload361) => { - mbt_ffi_store8(iter_base + 8, 1) + @types0.SecretError::VersionNotFound(@types0.SecretVersion::{bytes : result395}) + } + 2 => { - let ptr362 = mbt_ffi_str2ptr(payload361) - mbt_ffi_store32(iter_base + 16, payload361.length()) - mbt_ffi_store32(iter_base + 12, ptr362) - cleanup_list.push(ptr362) + let result396 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - () - } - } - mbt_ffi_store32(iter_base + 20, iter_elem.body) - cleanup_list.push(ptr359) - } - let return_area = mbt_ffi_malloc(16) - wasmImportReveal( - handle, - address357, - expected.type_nodes.length(), - address363, - expected.defs.length(), - expected.root, - return_area, - ) - - let lifted397 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array391 : Array[@types.SchemaValueNode] = [] - for index392 = 0 - index392 < mbt_ffi_load32(return_area + 8) - index392 = index392 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index392 * 32 - - let lifted390 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8).land(0xFFFF).reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result) - } - 13 => { - let array : Array[Int] = [] - for index365 = 0 - index365 < mbt_ffi_load32(iter_base + 12) - index365 = index365 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index365 * 4 - - array.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array) - } - 14 => { - let lifted : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array366 : Array[Bool] = [] - for index367 = 0 - index367 < mbt_ffi_load32(iter_base + 12) - index367 = index367 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index367 * 1 - - array366.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array366) - } - 17 => { - let array368 : Array[Int] = [] - for index369 = 0 - index369 < mbt_ffi_load32(iter_base + 12) - index369 = index369 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index369 * 4 - - array368.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array368) - } - 18 => { - let array370 : Array[Int] = [] - for index371 = 0 - index371 < mbt_ffi_load32(iter_base + 12) - index371 = index371 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index371 * 4 - - array370.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array370) - } - 19 => { - let array372 : Array[Int] = [] - for index373 = 0 - index373 < mbt_ffi_load32(iter_base + 12) - index373 = index373 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index373 * 4 - - array372.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array372) - } - 20 => { - let array374 : Array[@types.MapEntry] = [] - for index375 = 0 - index375 < mbt_ffi_load32(iter_base + 12) - index375 = index375 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index375 * 8 - - array374.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array374) - } - 21 => { - let lifted376 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted376) - } - 22 => { - let lifted379 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted377 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted377) - } - 1 => { - let lifted378 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted378) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted379) - } - 23 => { - let result380 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted382 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result381 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result381) - } - _ => panic() - } + @types0.SecretError::Internal(result396) + } + _ => panic() + } - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result380, - language: lifted382, - }) - } - 24 => { - let result383 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted385 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result384 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result384) - } - _ => panic() + Result::Err(lifted397) } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result383, - mime_type: lifted385, - }) - } - 25 => { - let result386 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result386) - } - 26 => { - let result387 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result387) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result388 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result388, - }) - } - 30 => { - let result389 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result389, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } - - array391.push(lifted390) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Result::Ok(@types.SchemaValueTree::{ - value_nodes: array391, - root: mbt_ffi_load32(return_area + 12), - }) - } - 1 => { - let lifted396 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result393 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - @types0.SecretError::Unavailable(result393) - } - 1 => { - let result394 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - @types0.SecretError::VersionNotFound(@types0.SecretVersion::{ - bytes: result394, - }) - } - 2 => { - let result395 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - @types0.SecretError::Internal(result395) - } - _ => panic() + _ => panic() } + let ret = lifted398 + mbt_ffi_free(address358) + mbt_ffi_free(address364) + mbt_ffi_free(return_area) + + cleanup_list.each(mbt_ffi_free) + return ret - Result::Err(lifted396) - } - _ => panic() - } - let ret = lifted397 - mbt_ffi_free(address357) - mbt_ffi_free(address363) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/secrets/types/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/secrets/types/ffi.mbt index 505300eb72..89835b12bd 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/secrets/types/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/secrets/types/ffi.mbt @@ -1,44 +1,43 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| -fn wasmImportId(p0 : Int, p1 : Int) = "golem:secrets/types@0.1.0" "id" +fn wasmImportId(p0 : Int, p1 : Int) = "golem:secrets/types@0.1.0" "id" + +fn wasmImportMetadata(p0 : Int, p1 : Int) = "golem:secrets/types@0.1.0" "metadata" ///| -fn wasmImportMetadata(p0 : Int, p1 : Int) = "golem:secrets/types@0.1.0" "metadata" +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) -///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) diff --git a/sdks/moonbit/golem_sdk/interface/golem/secrets/types/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/secrets/types/top.mbt index 8b7b079f7c..0370bbb459 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/secrets/types/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/secrets/types/top.mbt @@ -1,5 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// The opaque handle to a sensitive value is defined in /// `golem:core/types` so it can travel inside a `schema-value-tree` as an @@ -15,114 +14,94 @@ /// `secret-id`, never plaintext. /// Stable, opaque identifier scoped to the deployment. pub(all) struct SecretId { - bytes : FixedArray[Byte] + bytes : FixedArray[Byte] } derive(Show, Eq) - ///| /// A secret-store-assigned, monotonic version identifier. The /// secret-store backend defines the ordering and the format; /// the type-tree treats it as opaque. pub(all) struct SecretVersion { - bytes : FixedArray[Byte] + bytes : FixedArray[Byte] } derive(Show, Eq) - ///| pub(all) struct SecretMetadata { - config_key : Array[String]? - version : SecretVersion? - resolved_at : @system-clock.Instant - category : String? + config_key : Array[String]?; version : SecretVersion?; resolved_at : @system-clock.Instant; category : String? } derive(Show, Eq) - ///| /// Errors common to operations on secrets. pub(all) suberror SecretError { - Unavailable(String) - VersionNotFound(SecretVersion) - Internal(String) + Unavailable(String) + VersionNotFound(SecretVersion) + Internal(String) } derive(Show, Eq) - ///| /// Stable opaque identifier. Comparing equal across two `secret` handles /// means "same secret material, same version" — useful for caching and audit /// correlation. Safe to log, oplog, and emit in traces. pub fn id(s : @types.Secret) -> SecretId { - let @types.Secret(handle) = s - let return_area = mbt_ffi_malloc(8) - wasmImportId(handle, return_area) - - let result = mbt_ffi_ptr2bytes( - mbt_ffi_load32(return_area + 0), - mbt_ffi_load32(return_area + 4), - ) - let ret = SecretId::{ bytes: result } - mbt_ffi_free(return_area) - return ret -} + let @types.Secret(handle) = s + let return_area = mbt_ffi_malloc(8) + wasmImportId(handle, return_area); + + let result = mbt_ffi_ptr2bytes(mbt_ffi_load32((return_area) + 0), mbt_ffi_load32((return_area) + 4)) + let ret = SecretId::{bytes : result} + mbt_ffi_free(return_area) + return ret + +} ///| /// Immutable metadata captured at resolve-time. Includes the config-key /// path, the resolved version, and the resolution timestamp. No plaintext. pub fn metadata(s : @types.Secret) -> SecretMetadata { - let @types.Secret(handle) = s - let return_area = mbt_ffi_malloc(56) - wasmImportMetadata(handle, return_area) - - let lifted : Array[String]? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let array : Array[String] = [] - for index = 0; index < mbt_ffi_load32(return_area + 8); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index * 8 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result) + + let @types.Secret(handle) = s + let return_area = mbt_ffi_malloc(56) + wasmImportMetadata(handle, return_area); + + let lifted : Array[String]? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 8)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index * 8) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) + + Option::Some(array) + } + _ => panic() + } + + let lifted1 : SecretVersion? = match mbt_ffi_load8_u((return_area) + 12) { + 0 => Option::None + 1 => { + + let result0 = mbt_ffi_ptr2bytes(mbt_ffi_load32((return_area) + 16), mbt_ffi_load32((return_area) + 20)) + + Option::Some(SecretVersion::{bytes : result0}) + } + _ => panic() } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Option::Some(array) - } - _ => panic() - } - - let lifted1 : SecretVersion? = match mbt_ffi_load8_u(return_area + 12) { - 0 => Option::None - 1 => { - let result0 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(return_area + 16), - mbt_ffi_load32(return_area + 20), - ) - - Option::Some(SecretVersion::{ bytes: result0 }) - } - _ => panic() - } - - let lifted3 : String? = match mbt_ffi_load8_u(return_area + 40) { - 0 => Option::None - 1 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 44), - mbt_ffi_load32(return_area + 48), - ) - - Option::Some(result2) - } - _ => panic() - } - let ret = SecretMetadata::{ - config_key: lifted, - version: lifted1, - resolved_at: @system-clock.Instant::{ - seconds: mbt_ffi_load64(return_area + 24), - nanoseconds: mbt_ffi_load32(return_area + 32).reinterpret_as_uint(), - }, - category: lifted3, - } - mbt_ffi_free(return_area) - return ret + + let lifted3 : String? = match mbt_ffi_load8_u((return_area) + 40) { + 0 => Option::None + 1 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 44), mbt_ffi_load32((return_area) + 48)) + + Option::Some(result2) + } + _ => panic() + } + let ret = SecretMetadata::{config_key : lifted, version : lifted1, resolved_at : @system-clock.Instant::{seconds : mbt_ffi_load64((return_area) + 24), nanoseconds : (mbt_ffi_load32((return_area) + 32)).reinterpret_as_uint()}, category : lifted3} + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/tool/common/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/tool/common/ffi.mbt index 01e5518ad5..821232033b 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/tool/common/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/tool/common/ffi.mbt @@ -1 +1,2 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! + diff --git a/sdks/moonbit/golem_sdk/interface/golem/tool/common/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/tool/common/top.mbt index 66692dc41f..67bc3d2617 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/tool/common/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/tool/common/top.mbt @@ -1,5 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Behavioral hints surfaced to MCP and other LLM-facing /// surfaces. All four follow the MCP convention. When absent @@ -7,324 +6,212 @@ /// (`destructive: true`, `open-world: true`, `read-only: false`, /// `idempotent: false`), per MCP guidance. pub(all) struct CommandAnnotations { - read_only : Bool - destructive : Bool - idempotent : Bool - open_world : Bool + read_only : Bool; destructive : Bool; idempotent : Bool; open_world : Bool } derive(Show, Eq) - ///| /// Resolution policy for a repeated key in a `repeatable-map` option. pub(all) enum DuplicateKeyPolicy { - REJECT - LAST_WINS + REJECT; LAST_WINS } derive(Show, Eq) -///| pub fn DuplicateKeyPolicy::ordinal(self : DuplicateKeyPolicy) -> Int { - match self { - REJECT => 0 - LAST_WINS => 1 - } + match self { + REJECT => 0 + LAST_WINS => 1 + } } -///| pub fn DuplicateKeyPolicy::from(self : Int) -> DuplicateKeyPolicy { - match self { - 0 => REJECT - 1 => LAST_WINS - _ => panic() - } + match self { + 0 => REJECT + 1 => LAST_WINS + _ => panic() + } } - ///| pub(all) enum Repetition { - Repeated - Delimited(Char) - Either(Char) + Repeated + Delimited(Char) + Either(Char) } derive(Show, Eq) - ///| pub(all) struct RepeatableListShape { - repetition : Repetition - item_type : Int + repetition : Repetition; item_type : Int } derive(Show, Eq) - ///| pub(all) struct RepeatableMapShape { - repetition : Repetition - map_type : Int - duplicate_key_policy : DuplicateKeyPolicy + repetition : Repetition; map_type : Int; duplicate_key_policy : DuplicateKeyPolicy } derive(Show, Eq) - ///| pub(all) enum OptionShape { - Scalar(Int) - OptionalScalar(Int) - RepeatableList(RepeatableListShape) - RepeatableMap(RepeatableMapShape) + Scalar(Int) + OptionalScalar(Int) + RepeatableList(RepeatableListShape) + RepeatableMap(RepeatableMapShape) } derive(Show, Eq) - ///| pub(all) struct BoolFlagShape { - default : Bool - negatable : Bool + default : Bool; negatable : Bool } derive(Show, Eq) - ///| pub(all) enum FlagShape { - BoolFlag(BoolFlagShape) - CountFlag(UInt?) + BoolFlag(BoolFlagShape) + CountFlag(UInt?) } derive(Show, Eq) - ///| pub(all) struct ValueIsRef { - name : String - value : @types.SchemaValueTree + name : String; value : @types.SchemaValueTree } derive(Show, Eq) - ///| /// Constraints pub(all) enum Ref { - Present(String) - ValueIs(ValueIsRef) + Present(String) + ValueIs(ValueIsRef) } derive(Show, Eq) - ///| pub(all) struct RefGroup { - refs : Array[Ref] + refs : Array[Ref] } derive(Show, Eq) - ///| pub(all) enum Quantifier { - ALL - ANY + ALL; ANY } derive(Show, Eq) -///| pub fn Quantifier::ordinal(self : Quantifier) -> Int { - match self { - ALL => 0 - ANY => 1 - } + match self { + ALL => 0 + ANY => 1 + } } -///| pub fn Quantifier::from(self : Int) -> Quantifier { - match self { - 0 => ALL - 1 => ANY - _ => panic() - } + match self { + 0 => ALL + 1 => ANY + _ => panic() + } } - ///| pub(all) struct ImpliesC { - lhs_quant : Quantifier - lhs : Array[Ref] - rhs_quant : Quantifier - rhs : Array[Ref] + lhs_quant : Quantifier; lhs : Array[Ref]; rhs_quant : Quantifier; rhs : Array[Ref] } derive(Show, Eq) - ///| pub(all) struct ForbidsC { - lhs_quant : Quantifier - lhs : Array[Ref] - rhs : Array[Ref] + lhs_quant : Quantifier; lhs : Array[Ref]; rhs : Array[Ref] } derive(Show, Eq) - ///| pub(all) enum Constraint { - RequiresAll(Array[Ref]) - AllOrNone(Array[Ref]) - RequiresAny(Array[Ref]) - MutexGroups(Array[RefGroup]) - Implies(ImpliesC) - Forbids(ForbidsC) + RequiresAll(Array[Ref]) + AllOrNone(Array[Ref]) + RequiresAny(Array[Ref]) + MutexGroups(Array[RefGroup]) + Implies(ImpliesC) + Forbids(ForbidsC) } derive(Show, Eq) - ///| pub(all) suberror ErrorKind { - USAGE_ERROR - RUNTIME_ERROR + USAGE_ERROR; RUNTIME_ERROR } derive(Show, Eq) -///| pub fn ErrorKind::ordinal(self : ErrorKind) -> Int { - match self { - USAGE_ERROR => 0 - RUNTIME_ERROR => 1 - } + match self { + USAGE_ERROR => 0 + RUNTIME_ERROR => 1 + } } -///| pub fn ErrorKind::from(self : Int) -> ErrorKind { - match self { - 0 => USAGE_ERROR - 1 => RUNTIME_ERROR - _ => panic() - } + match self { + 0 => USAGE_ERROR + 1 => RUNTIME_ERROR + _ => panic() + } } - ///| pub(all) struct Example { - title : String - body : String + title : String; body : String } derive(Show, Eq) - ///| /// Documentation, examples pub(all) struct Doc { - summary : String - description : String - examples : Array[Example] + summary : String; description : String; examples : Array[Example] } derive(Show, Eq) - ///| pub(all) struct Positional { - name : String - doc : Doc - value_name : String? - type_ : Int - default : @types.SchemaValueTree? - required : Bool - accepts_stdio : Bool + name : String; doc : Doc; value_name : String?; type_ : Int; default : @types.SchemaValueTree?; required : Bool; accepts_stdio : Bool } derive(Show, Eq) - ///| pub(all) struct TailPositional { - name : String - doc : Doc - value_name : String? - item_type : Int - min : UInt - max : UInt? - separator : String? - verbatim : Bool - accepts_stdio : Bool + name : String; doc : Doc; value_name : String?; item_type : Int; min : UInt; max : UInt?; separator : String?; verbatim : Bool; accepts_stdio : Bool } derive(Show, Eq) - ///| /// Positionals (variadic only at the tail, structurally) pub(all) struct Positionals { - fixed : Array[Positional] - tail : TailPositional? + fixed : Array[Positional]; tail : TailPositional? } derive(Show, Eq) - ///| /// Options and flags pub(all) struct OptionSpec { - long : String - short : Char? - aliases : Array[String] - doc : Doc - value_name : String? - shape : OptionShape - default : @types.SchemaValueTree? - required : Bool - env_var : String? + long : String; short : Char?; aliases : Array[String]; doc : Doc; value_name : String?; shape : OptionShape; default : @types.SchemaValueTree?; required : Bool; env_var : String? } derive(Show, Eq) - ///| pub(all) struct FlagSpec { - long : String - short : Char? - aliases : Array[String] - doc : Doc - shape : FlagShape - env_var : String? + long : String; short : Char?; aliases : Array[String]; doc : Doc; shape : FlagShape; env_var : String? } derive(Show, Eq) - ///| pub(all) struct Globals { - options : Array[OptionSpec] - flags : Array[FlagSpec] + options : Array[OptionSpec]; flags : Array[FlagSpec] } derive(Show, Eq) - ///| /// Streams, structured results, errors pub(all) struct StreamSpec { - doc : Doc - mime : Array[String] - required : Bool + doc : Doc; mime : Array[String]; required : Bool } derive(Show, Eq) - ///| pub(all) struct Formatter { - name : String - doc : Doc + name : String; doc : Doc } derive(Show, Eq) - ///| pub(all) struct ResultSpec { - type_ : Int - doc : Doc - formatters : Array[Formatter] - default_formatter : String + type_ : Int; doc : Doc; formatters : Array[Formatter]; default_formatter : String } derive(Show, Eq) - ///| pub(all) struct ErrorCase { - name : String - doc : Doc - kind : ErrorKind - exit_code : Byte - payload : Int? + name : String; doc : Doc; kind : ErrorKind; exit_code : Byte; payload : Int? } derive(Show, Eq) - ///| pub(all) struct CommandBody { - positionals : Positionals - options : Array[OptionSpec] - flags : Array[FlagSpec] - constraints : Array[Constraint] - stdin : StreamSpec? - stdout : StreamSpec? - result : ResultSpec? - errors : Array[ErrorCase] - annotations : CommandAnnotations? + positionals : Positionals; options : Array[OptionSpec]; flags : Array[FlagSpec]; constraints : Array[Constraint]; stdin : StreamSpec?; stdout : StreamSpec?; result : ResultSpec?; errors : Array[ErrorCase]; annotations : CommandAnnotations? } derive(Show, Eq) - ///| /// A command may dispatch to subcommands, run its own body, or both. /// Globals declared here apply to this command's own body and to /// every descendant subcommand body (recursive globals — "this level /// and downward"). pub(all) struct CommandNode { - name : String - aliases : Array[String] - doc : Doc - globals : Globals - subcommands : Array[Int] - body : CommandBody? + name : String; aliases : Array[String]; doc : Doc; globals : Globals; subcommands : Array[Int]; body : CommandBody? } derive(Show, Eq) - ///| pub(all) struct CommandTree { - nodes : Array[CommandNode] + nodes : Array[CommandNode] } derive(Show, Eq) - ///| /// Top level pub(all) struct Tool { - version : String - commands : CommandTree - schema : @types.SchemaGraph + version : String; commands : CommandTree; schema : @types.SchemaGraph } derive(Show, Eq) - ///| /// Invocation contract — shared between guest and host pub(all) suberror ToolError { - InvalidToolName(String) - InvalidCommandPath(Array[String]) - InvalidInput(String) - ConstraintViolation(String) - InvalidResult(String) - CustomError(@types.TypedSchemaValue) + InvalidToolName(String) + InvalidCommandPath(Array[String]) + InvalidInput(String) + ConstraintViolation(String) + InvalidResult(String) + CustomError(@types.TypedSchemaValue) } derive(Show, Eq) - ///| pub(all) struct InvocationResult { - result : @types.TypedSchemaValue? - stdout : @async-core.Stream[Byte]? + result : @types.TypedSchemaValue?; stdout : @async-core.Stream[Byte]? } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/tool/host/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/tool/host/ffi.mbt index 6b4f0a9c84..ce6165a253 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/tool/host/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/tool/host/ffi.mbt @@ -1,2216 +1,1804 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropToolRpc(resource : Int) = "golem:tool/host@0.1.0" "[resource-drop]tool-rpc" -///| fn wasmImportResourceDropFutureInvokeResult(resource : Int) = "golem:tool/host@0.1.0" "[resource-drop]future-invoke-result" -///| -fn wasmImportGetAllTools(p0 : Int) = "golem:tool/host@0.1.0" "get-all-tools" +fn wasmImportGetAllTools(p0 : Int) = "golem:tool/host@0.1.0" "get-all-tools" -///| -fn wasmImportGetTool(p0 : Int, p1 : Int, p2 : Int) = "golem:tool/host@0.1.0" "get-tool" +fn wasmImportGetTool(p0 : Int, p1 : Int, p2 : Int) = "golem:tool/host@0.1.0" "get-tool" -///| fn wasmImportConstructorToolRpc(p0 : Int, p1 : Int) -> Int = "golem:tool/host@0.1.0" "[constructor]tool-rpc" -///| fn wasmImportMethodToolRpcInvokeAndAwait(p0 : Int, p1 : Int) -> Int = "golem:tool/host@0.1.0" "[async-lower][method]tool-rpc.invoke-and-await" -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-read-0][method]tool-rpc.invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-read-0][method]tool-rpc.invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0CancelRead(handle : Int) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-read-0][method]tool-rpc.invoke-and-await" -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0CancelRead( - handle : Int, -) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-read-0][method]tool-rpc.invoke-and-await" - -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropReadable( - handle : Int, -) = "golem:tool/host@0.1.0" "[stream-drop-readable-0][method]tool-rpc.invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropReadable(handle : Int) = "golem:tool/host@0.1.0" "[stream-drop-readable-0][method]tool-rpc.invoke-and-await" -///| fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0New() -> UInt64 = "golem:tool/host@0.1.0" "[stream-new-0][method]tool-rpc.invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Write(handle : Int, buffer_ptr : Int, length : Int) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-write-0][method]tool-rpc.invoke-and-await" -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Write( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-write-0][method]tool-rpc.invoke-and-await" - -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0CancelWrite( - handle : Int, -) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-write-0][method]tool-rpc.invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0CancelWrite(handle : Int) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-write-0][method]tool-rpc.invoke-and-await" -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropWritable( - handle : Int, -) = "golem:tool/host@0.1.0" "[stream-drop-writable-0][method]tool-rpc.invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropWritable(handle : Int) = "golem:tool/host@0.1.0" "[stream-drop-writable-0][method]tool-rpc.invoke-and-await" -///| -fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Commit( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| -fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Lower( - value : Byte, - ptr : Int, -) -> Unit { - mbt_ffi_store8(ptr + 0, value.to_int()) +fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Lower(value : Byte, ptr : Int) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).to_int()) + } -///| fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource::finish_read( - self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource::wait_for_read_cleanup( - self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource::cancel_active_read( - self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource::close( - self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropReadable(self.handle) } -///| fn WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource::close_sync( - self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - if wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamRejectPrepared( - self.handle, - ) { - self.closed = true - return - } + if wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamRejectPrepared(self.handle) { + self.closed = true + return + } - self.closed = true - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropReadable( - self.handle, - ) + self.closed = true + wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropReadable(self.handle) } -///| async fn WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource::read( - self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource, - count : Int, +self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) + } + let values = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) + if end { + self.close() + } + Some(values) +} + +fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| priv struct WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducer { - stream : @async-core.Stream[Byte] - writer : Int + stream : @async-core.Stream[Byte] + writer : Int } -///| -let wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducers : Map[ - Int, - WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducer, -] = Map([]) +let wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducers : Map[Int, WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducer] = Map([]) -///| -fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamRejectPrepared( - handle : Int, -) -> Bool { - guard wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return false - } - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducers.remove( - handle, - ) - let writer = prepared.writer - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropReadable( - handle, - ) - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropWritable( - writer, - ) - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( - () => { - prepared.stream.reject((value : Byte) => { - let ptr = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Malloc( - 1, - ) - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Lower( - value, ptr, - ) - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Reject( - ptr, 0, 1, - ) - mbt_ffi_free(ptr) - }) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - }) - true +fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamRejectPrepared(handle : Int) -> Bool { + guard wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducers.get(handle) is Some(prepared) else { + return false + } + wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducers.remove(handle) + let writer = prepared.writer + wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropReadable(handle) + wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropWritable(writer) + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + prepared.stream.reject((value : Byte) => { + let ptr = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Malloc(1) + wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Lower(value, ptr) + wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + }) + true } -///| -fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamCommit( - handle : Int, -) -> Unit { - guard wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return - } - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducers.remove( - handle, - ) - let stream = prepared.stream - let writer = prepared.writer - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let producer = stream.take_producer() - @async-core.spawn_component_task_current(async fn() { - let writer_closed = Ref(false) - let writer_lock = @async-core.Mutex() - let close_writer = fn() -> Unit { - if !writer_closed.val { - writer_closed.val = true - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropWritable( - writer, - ) - } - } - let close_writer_serialized = async fn() -> Unit { - writer_lock.acquire() - defer writer_lock.release() - close_writer() - } - let cleanup_value = fn(value : Byte) -> Unit { - let ptr = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Malloc(1) - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Lower(value, ptr) - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Reject(ptr, 0, 1) - mbt_ffi_free(ptr) - } - let sink = @async-core.Sink::from_callbacks( - (data : ArrayView[Byte]) => { - writer_lock.acquire() - defer writer_lock.release() - if writer_closed.val || data.length() == 0 { - return 0 - } - let data_len = if data.length() < 64 { data.length() } else { 64 } - let ptr = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Malloc( - data_len, - ) - for i in 0.. Unit { - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Commit( - ptr, 0, transferred, - ) - if transferred < data_len { - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Reject( - ptr, - transferred, - data_len - transferred, +fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamCommit(handle : Int) -> Unit { + guard wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducers.get(handle) is Some(prepared) else { + return + } + wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducers.remove(handle) + let stream = prepared.stream + let writer = prepared.writer + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let producer = stream.take_producer() + @async-core.spawn_component_task_current(async fn() { + let writer_closed = Ref(false) + let writer_lock = @async-core.Mutex() + let close_writer = fn() -> Unit { + if !writer_closed.val { + writer_closed.val = true + wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0DropWritable(writer) + } + } + let close_writer_serialized = async fn() -> Unit { + writer_lock.acquire() + defer writer_lock.release() + close_writer() + } + let cleanup_value = fn(value : Byte) -> Unit { + let ptr = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Malloc(1) + wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Lower(value, ptr) + wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + } + let sink = @async-core.Sink::from_callbacks( + (data : ArrayView[Byte]) => { + writer_lock.acquire() + defer writer_lock.release() + if writer_closed.val || data.length() == 0 { + return 0 + } + let data_len = if data.length() < 64 { + data.length() + } else { + 64 + } + let ptr = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Malloc(data_len) + for i in 0.. Unit { + wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Commit(ptr, 0, transferred) + if transferred < data_len { + wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Reject( + ptr, + transferred, + data_len - transferred, + ) + } + mbt_ffi_free(ptr) + } + let mut total = 0 + let mut dropped = false + while total < data_len { + let (progress, end) = @async-core.suspend_for_stream_write( + writer, + wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Write( + writer, + ptr + total * 1, + data_len - total, + ), + ) catch { + _ => { + total = total + @async-core.cancel_stream_write( + writer, + () => wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0CancelWrite(writer), + ) + settle_staging(total) + close_writer() + return data_len + } + } + total = total + progress + if end { + dropped = true + break + } + } + settle_staging(total) + if dropped { + close_writer() + } + // The canonical writer accepted `total`; generated cleanup + // consumed the rest of this staging window. + data_len + }, + () => close_writer_serialized(), + () => !writer_closed.val, + Some(cleanup_value), ) - } - mbt_ffi_free(ptr) - } - let mut total = 0 - let mut dropped = false - while total < data_len { - let (progress, end) = @async-core.suspend_for_stream_write( - writer, - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0Write( - writer, - ptr + total * 1, - data_len - total, - ), - ) catch { - _ => { - total = total + - @async-core.cancel_stream_write(writer, () => { - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0CancelWrite( - writer, - ) - }) - settle_staging(total) - close_writer() - return data_len + let relay_source = producer is None + let run_producer = async fn() -> Unit { + match producer { + Some(producer) => { + producer(sink) + sink.close() + } + None => + for ;; { + match stream.read(64) { + Some(data) => + if !sink.write_all(data[:]) { + stream.reject(cleanup_value) + return + } + None => { + sink.close() + return + } + } + } + } } - } - total = total + progress - if end { - dropped = true - break - } - } - settle_staging(total) - if dropped { - close_writer() - } - // The canonical writer accepted `total`; generated cleanup - // consumed the rest of this staging window. - data_len - }, - () => close_writer_serialized(), - () => !writer_closed.val, - Some(cleanup_value), - ) - let relay_source = producer is None - let run_producer = async fn() -> Unit { - match producer { - Some(producer) => { - producer(sink) - sink.close() - } - None => - for ;; { - match stream.read(64) { - Some(data) => - if !sink.write_all(data[:]) { - stream.reject(cleanup_value) - return - } - None => { - sink.close() - return - } + run_producer() catch { + _ => + if relay_source { + @async-core.protect_from_cancel( + () => stream.reject(cleanup_value), + resume_on_cancel=true, + ) catch { + _ => () + } + } } - } - } - } - run_producer() catch { - _ => - if relay_source { - @async-core.protect_from_cancel( - () => stream.reject(cleanup_value), + // A retained Sink may still own an in-flight canonical write after its + // producer returns. Do not drop the writable endpoint until that write + // has reached a terminal event and released its staging buffer. + @async-core.protect_from_cancel( + () => close_writer_serialized(), resume_on_cancel=true, - ) catch { - _ => () - } - } - } - // A retained Sink may still own an in-flight canonical write after its - // producer returns. Do not drop the writable endpoint until that write - // has reached a terminal event and released its staging buffer. - @async-core.protect_from_cancel( - () => close_writer_serialized(), - resume_on_cancel=true, - ) - }) + ) + }) } -///| -fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamLower( - stream : @async-core.Stream[Byte], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let pair = wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducers.set( - reader, - { stream, writer }, - ) - reader +fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamLower(stream : @async-core.Stream[Byte]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let pair = wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream0New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamProducers.set(reader, { stream, writer }) + reader } -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-read-0][method]tool-rpc.invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-read-0][method]tool-rpc.invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1CancelRead(handle : Int) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-read-0][method]tool-rpc.invoke-and-await" -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1CancelRead( - handle : Int, -) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-read-0][method]tool-rpc.invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1DropReadable(handle : Int) = "golem:tool/host@0.1.0" "[stream-drop-readable-0][method]tool-rpc.invoke-and-await" -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1DropReadable( - handle : Int, -) = "golem:tool/host@0.1.0" "[stream-drop-readable-0][method]tool-rpc.invoke-and-await" - -///| -fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource::finish_read( - self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource::wait_for_read_cleanup( - self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource::cancel_active_read( - self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource::close( - self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1DropReadable(self.handle) } -///| fn WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource::close_sync( - self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1DropReadable( - self.handle, - ) + self.closed = true + wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1DropReadable(self.handle) } -///| async fn WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource::read( - self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource, - count : Int, +self : WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportGolemToolHost010MethodToolRpcInvokeAndAwaitStream1DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) } + let values = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) + if end { + self.close() + } + Some(values) +} + +fn wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| -fn wasmImportMethodToolRpcInvoke( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, - p7 : Int, - p8 : Int, - p9 : Int, - p10 : Int, - p11 : Int, - p12 : Int, - p13 : Int, -) = "golem:tool/host@0.1.0" "[method]tool-rpc.invoke" +fn wasmImportMethodToolRpcInvoke(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int, p7 : Int, p8 : Int, p9 : Int, p10 : Int, p11 : Int, p12 : Int, p13 : Int) = "golem:tool/host@0.1.0" "[method]tool-rpc.invoke" -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-read-0][method]tool-rpc.invoke" +fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-read-0][method]tool-rpc.invoke" +fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0CancelRead(handle : Int) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-read-0][method]tool-rpc.invoke" -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0CancelRead( - handle : Int, -) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-read-0][method]tool-rpc.invoke" +fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropReadable(handle : Int) = "golem:tool/host@0.1.0" "[stream-drop-readable-0][method]tool-rpc.invoke" -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropReadable( - handle : Int, -) = "golem:tool/host@0.1.0" "[stream-drop-readable-0][method]tool-rpc.invoke" - -///| fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0New() -> UInt64 = "golem:tool/host@0.1.0" "[stream-new-0][method]tool-rpc.invoke" +fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0Write(handle : Int, buffer_ptr : Int, length : Int) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-write-0][method]tool-rpc.invoke" -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0Write( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-write-0][method]tool-rpc.invoke" - -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0CancelWrite( - handle : Int, -) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-write-0][method]tool-rpc.invoke" +fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0CancelWrite(handle : Int) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-write-0][method]tool-rpc.invoke" -///| -fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropWritable( - handle : Int, -) = "golem:tool/host@0.1.0" "[stream-drop-writable-0][method]tool-rpc.invoke" +fn wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropWritable(handle : Int) = "golem:tool/host@0.1.0" "[stream-drop-writable-0][method]tool-rpc.invoke" -///| fn wasmGolemToolHost010MethodToolRpcInvokeStream0Malloc(length : Int) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmGolemToolHost010MethodToolRpcInvokeStream0Commit( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmGolemToolHost010MethodToolRpcInvokeStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| -fn wasmGolemToolHost010MethodToolRpcInvokeStream0Lower( - value : Byte, - ptr : Int, -) -> Unit { - mbt_ffi_store8(ptr + 0, value.to_int()) +fn wasmGolemToolHost010MethodToolRpcInvokeStream0Lower(value : Byte, ptr : Int) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).to_int()) + } -///| fn wasmGolemToolHost010MethodToolRpcInvokeStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource::finish_read( - self : WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource::wait_for_read_cleanup( - self : WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource::cancel_active_read( - self : WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportGolemToolHost010MethodToolRpcInvokeStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmGolemToolHost010MethodToolRpcInvokeStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportGolemToolHost010MethodToolRpcInvokeStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmGolemToolHost010MethodToolRpcInvokeStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource::close( - self : WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropReadable(self.handle) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropReadable(self.handle) } -///| fn WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource::close_sync( - self : WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - if wasmGolemToolHost010MethodToolRpcInvokeStream0StreamRejectPrepared( - self.handle, - ) { - self.closed = true - return - } + if wasmGolemToolHost010MethodToolRpcInvokeStream0StreamRejectPrepared(self.handle) { + self.closed = true + return + } - self.closed = true - wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropReadable(self.handle) + self.closed = true + wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropReadable(self.handle) } -///| async fn WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource::read( - self : WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource, - count : Int, +self : WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmGolemToolHost010MethodToolRpcInvokeStream0Malloc(read_count) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportGolemToolHost010MethodToolRpcInvokeStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmGolemToolHost010MethodToolRpcInvokeStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportGolemToolHost010MethodToolRpcInvokeStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) + } + let values = wasmGolemToolHost010MethodToolRpcInvokeStream0ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmGolemToolHost010MethodToolRpcInvokeStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmGolemToolHost010MethodToolRpcInvokeStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) + if end { + self.close() + } + Some(values) +} + +fn wasmGolemToolHost010MethodToolRpcInvokeStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmGolemToolHost010MethodToolRpcInvokeStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| priv struct WasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducer { - stream : @async-core.Stream[Byte] - writer : Int + stream : @async-core.Stream[Byte] + writer : Int } -///| -let wasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducers : Map[ - Int, - WasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducer, -] = Map([]) +let wasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducers : Map[Int, WasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducer] = Map([]) -///| -fn wasmGolemToolHost010MethodToolRpcInvokeStream0StreamRejectPrepared( - handle : Int, -) -> Bool { - guard wasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return false - } - wasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducers.remove(handle) - let writer = prepared.writer - wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropReadable(handle) - wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropWritable(writer) - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( - () => { - prepared.stream.reject((value : Byte) => { - let ptr = wasmGolemToolHost010MethodToolRpcInvokeStream0Malloc(1) - wasmGolemToolHost010MethodToolRpcInvokeStream0Lower(value, ptr) - wasmGolemToolHost010MethodToolRpcInvokeStream0Reject(ptr, 0, 1) - mbt_ffi_free(ptr) - }) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - }) - true +fn wasmGolemToolHost010MethodToolRpcInvokeStream0StreamRejectPrepared(handle : Int) -> Bool { + guard wasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducers.get(handle) is Some(prepared) else { + return false + } + wasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducers.remove(handle) + let writer = prepared.writer + wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropReadable(handle) + wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropWritable(writer) + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + prepared.stream.reject((value : Byte) => { + let ptr = wasmGolemToolHost010MethodToolRpcInvokeStream0Malloc(1) + wasmGolemToolHost010MethodToolRpcInvokeStream0Lower(value, ptr) + wasmGolemToolHost010MethodToolRpcInvokeStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + }) + true } -///| -fn wasmGolemToolHost010MethodToolRpcInvokeStream0StreamCommit( - handle : Int, -) -> Unit { - guard wasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return - } - wasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducers.remove(handle) - let stream = prepared.stream - let writer = prepared.writer - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let producer = stream.take_producer() - @async-core.spawn_component_task_current(async fn() { - let writer_closed = Ref(false) - let writer_lock = @async-core.Mutex() - let close_writer = fn() -> Unit { - if !writer_closed.val { - writer_closed.val = true - wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropWritable(writer) - } - } - let close_writer_serialized = async fn() -> Unit { - writer_lock.acquire() - defer writer_lock.release() - close_writer() - } - let cleanup_value = fn(value : Byte) -> Unit { - let ptr = wasmGolemToolHost010MethodToolRpcInvokeStream0Malloc(1) - wasmGolemToolHost010MethodToolRpcInvokeStream0Lower(value, ptr) - wasmGolemToolHost010MethodToolRpcInvokeStream0Reject(ptr, 0, 1) - mbt_ffi_free(ptr) - } - let sink = @async-core.Sink::from_callbacks( - (data : ArrayView[Byte]) => { - writer_lock.acquire() - defer writer_lock.release() - if writer_closed.val || data.length() == 0 { - return 0 - } - let data_len = if data.length() < 64 { data.length() } else { 64 } - let ptr = wasmGolemToolHost010MethodToolRpcInvokeStream0Malloc(data_len) - for i in 0.. Unit { - wasmGolemToolHost010MethodToolRpcInvokeStream0Commit( - ptr, 0, transferred, - ) - if transferred < data_len { - wasmGolemToolHost010MethodToolRpcInvokeStream0Reject( - ptr, - transferred, - data_len - transferred, +fn wasmGolemToolHost010MethodToolRpcInvokeStream0StreamCommit(handle : Int) -> Unit { + guard wasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducers.get(handle) is Some(prepared) else { + return + } + wasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducers.remove(handle) + let stream = prepared.stream + let writer = prepared.writer + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let producer = stream.take_producer() + @async-core.spawn_component_task_current(async fn() { + let writer_closed = Ref(false) + let writer_lock = @async-core.Mutex() + let close_writer = fn() -> Unit { + if !writer_closed.val { + writer_closed.val = true + wasmImportGolemToolHost010MethodToolRpcInvokeStream0DropWritable(writer) + } + } + let close_writer_serialized = async fn() -> Unit { + writer_lock.acquire() + defer writer_lock.release() + close_writer() + } + let cleanup_value = fn(value : Byte) -> Unit { + let ptr = wasmGolemToolHost010MethodToolRpcInvokeStream0Malloc(1) + wasmGolemToolHost010MethodToolRpcInvokeStream0Lower(value, ptr) + wasmGolemToolHost010MethodToolRpcInvokeStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + } + let sink = @async-core.Sink::from_callbacks( + (data : ArrayView[Byte]) => { + writer_lock.acquire() + defer writer_lock.release() + if writer_closed.val || data.length() == 0 { + return 0 + } + let data_len = if data.length() < 64 { + data.length() + } else { + 64 + } + let ptr = wasmGolemToolHost010MethodToolRpcInvokeStream0Malloc(data_len) + for i in 0.. Unit { + wasmGolemToolHost010MethodToolRpcInvokeStream0Commit(ptr, 0, transferred) + if transferred < data_len { + wasmGolemToolHost010MethodToolRpcInvokeStream0Reject( + ptr, + transferred, + data_len - transferred, + ) + } + mbt_ffi_free(ptr) + } + let mut total = 0 + let mut dropped = false + while total < data_len { + let (progress, end) = @async-core.suspend_for_stream_write( + writer, + wasmImportGolemToolHost010MethodToolRpcInvokeStream0Write( + writer, + ptr + total * 1, + data_len - total, + ), + ) catch { + _ => { + total = total + @async-core.cancel_stream_write( + writer, + () => wasmImportGolemToolHost010MethodToolRpcInvokeStream0CancelWrite(writer), + ) + settle_staging(total) + close_writer() + return data_len + } + } + total = total + progress + if end { + dropped = true + break + } + } + settle_staging(total) + if dropped { + close_writer() + } + // The canonical writer accepted `total`; generated cleanup + // consumed the rest of this staging window. + data_len + }, + () => close_writer_serialized(), + () => !writer_closed.val, + Some(cleanup_value), ) - } - mbt_ffi_free(ptr) - } - let mut total = 0 - let mut dropped = false - while total < data_len { - let (progress, end) = @async-core.suspend_for_stream_write( - writer, - wasmImportGolemToolHost010MethodToolRpcInvokeStream0Write( - writer, - ptr + total * 1, - data_len - total, - ), - ) catch { - _ => { - total = total + - @async-core.cancel_stream_write(writer, () => { - wasmImportGolemToolHost010MethodToolRpcInvokeStream0CancelWrite( - writer, - ) - }) - settle_staging(total) - close_writer() - return data_len + let relay_source = producer is None + let run_producer = async fn() -> Unit { + match producer { + Some(producer) => { + producer(sink) + sink.close() + } + None => + for ;; { + match stream.read(64) { + Some(data) => + if !sink.write_all(data[:]) { + stream.reject(cleanup_value) + return + } + None => { + sink.close() + return + } + } + } + } } - } - total = total + progress - if end { - dropped = true - break - } - } - settle_staging(total) - if dropped { - close_writer() - } - // The canonical writer accepted `total`; generated cleanup - // consumed the rest of this staging window. - data_len - }, - () => close_writer_serialized(), - () => !writer_closed.val, - Some(cleanup_value), - ) - let relay_source = producer is None - let run_producer = async fn() -> Unit { - match producer { - Some(producer) => { - producer(sink) - sink.close() - } - None => - for ;; { - match stream.read(64) { - Some(data) => - if !sink.write_all(data[:]) { - stream.reject(cleanup_value) - return - } - None => { - sink.close() - return - } + run_producer() catch { + _ => + if relay_source { + @async-core.protect_from_cancel( + () => stream.reject(cleanup_value), + resume_on_cancel=true, + ) catch { + _ => () + } + } } - } - } - } - run_producer() catch { - _ => - if relay_source { - @async-core.protect_from_cancel( - () => stream.reject(cleanup_value), + // A retained Sink may still own an in-flight canonical write after its + // producer returns. Do not drop the writable endpoint until that write + // has reached a terminal event and released its staging buffer. + @async-core.protect_from_cancel( + () => close_writer_serialized(), resume_on_cancel=true, - ) catch { - _ => () - } - } - } - // A retained Sink may still own an in-flight canonical write after its - // producer returns. Do not drop the writable endpoint until that write - // has reached a terminal event and released its staging buffer. - @async-core.protect_from_cancel( - () => close_writer_serialized(), - resume_on_cancel=true, - ) - }) + ) + }) } -///| -fn wasmGolemToolHost010MethodToolRpcInvokeStream0StreamLower( - stream : @async-core.Stream[Byte], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let pair = wasmImportGolemToolHost010MethodToolRpcInvokeStream0New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducers.set(reader, { - stream, - writer, - }) - reader +fn wasmGolemToolHost010MethodToolRpcInvokeStream0StreamLower(stream : @async-core.Stream[Byte]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let pair = wasmImportGolemToolHost010MethodToolRpcInvokeStream0New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmGolemToolHost010MethodToolRpcInvokeStream0StreamProducers.set(reader, { stream, writer }) + reader } -///| -fn wasmImportMethodToolRpcAsyncInvokeAndAwait( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, - p7 : Int, - p8 : Int, - p9 : Int, - p10 : Int, - p11 : Int, - p12 : Int, -) -> Int = "golem:tool/host@0.1.0" "[method]tool-rpc.async-invoke-and-await" +fn wasmImportMethodToolRpcAsyncInvokeAndAwait(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int, p7 : Int, p8 : Int, p9 : Int, p10 : Int, p11 : Int, p12 : Int) -> Int = "golem:tool/host@0.1.0" "[method]tool-rpc.async-invoke-and-await" -///| -fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-read-0][method]tool-rpc.async-invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-read-0][method]tool-rpc.async-invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0CancelRead(handle : Int) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-read-0][method]tool-rpc.async-invoke-and-await" -///| -fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0CancelRead( - handle : Int, -) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-read-0][method]tool-rpc.async-invoke-and-await" - -///| -fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropReadable( - handle : Int, -) = "golem:tool/host@0.1.0" "[stream-drop-readable-0][method]tool-rpc.async-invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropReadable(handle : Int) = "golem:tool/host@0.1.0" "[stream-drop-readable-0][method]tool-rpc.async-invoke-and-await" -///| fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0New() -> UInt64 = "golem:tool/host@0.1.0" "[stream-new-0][method]tool-rpc.async-invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Write(handle : Int, buffer_ptr : Int, length : Int) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-write-0][method]tool-rpc.async-invoke-and-await" -///| -fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Write( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-write-0][method]tool-rpc.async-invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0CancelWrite(handle : Int) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-write-0][method]tool-rpc.async-invoke-and-await" -///| -fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0CancelWrite( - handle : Int, -) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-write-0][method]tool-rpc.async-invoke-and-await" +fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropWritable(handle : Int) = "golem:tool/host@0.1.0" "[stream-drop-writable-0][method]tool-rpc.async-invoke-and-await" -///| -fn wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropWritable( - handle : Int, -) = "golem:tool/host@0.1.0" "[stream-drop-writable-0][method]tool-rpc.async-invoke-and-await" - -///| -fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Commit( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| -fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Lower( - value : Byte, - ptr : Int, -) -> Unit { - mbt_ffi_store8(ptr + 0, value.to_int()) +fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Lower(value : Byte, ptr : Int) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).to_int()) + } -///| fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource::finish_read( - self : WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource::wait_for_read_cleanup( - self : WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource::cancel_active_read( - self : WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource::close( - self : WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropReadable(self.handle) } -///| fn WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource::close_sync( - self : WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource, +self : WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - if wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamRejectPrepared( - self.handle, - ) { - self.closed = true - return - } + if wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamRejectPrepared(self.handle) { + self.closed = true + return + } - self.closed = true - wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropReadable( - self.handle, - ) + self.closed = true + wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropReadable(self.handle) } -///| async fn WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource::read( - self : WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource, - count : Int, +self : WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) } + let values = wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) + if end { + self.close() + } + Some(values) +} + +fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| priv struct WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducer { - stream : @async-core.Stream[Byte] - writer : Int + stream : @async-core.Stream[Byte] + writer : Int } -///| -let wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducers : Map[ - Int, - WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducer, -] = Map([]) +let wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducers : Map[Int, WasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducer] = Map([]) -///| -fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamRejectPrepared( - handle : Int, -) -> Bool { - guard wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return false - } - wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducers.remove( - handle, - ) - let writer = prepared.writer - wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropReadable( - handle, - ) - wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropWritable( - writer, - ) - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( - () => { - prepared.stream.reject((value : Byte) => { - let ptr = wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Malloc( - 1, - ) - wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Lower( - value, ptr, - ) - wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Reject( - ptr, 0, 1, - ) - mbt_ffi_free(ptr) - }) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - }) - true +fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamRejectPrepared(handle : Int) -> Bool { + guard wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducers.get(handle) is Some(prepared) else { + return false + } + wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducers.remove(handle) + let writer = prepared.writer + wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropReadable(handle) + wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropWritable(writer) + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + prepared.stream.reject((value : Byte) => { + let ptr = wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Malloc(1) + wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Lower(value, ptr) + wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + }) + true } -///| -fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamCommit( - handle : Int, -) -> Unit { - guard wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return - } - wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducers.remove( - handle, - ) - let stream = prepared.stream - let writer = prepared.writer - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let producer = stream.take_producer() - @async-core.spawn_component_task_current(async fn() { - let writer_closed = Ref(false) - let writer_lock = @async-core.Mutex() - let close_writer = fn() -> Unit { - if !writer_closed.val { - writer_closed.val = true - wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropWritable( - writer, - ) - } - } - let close_writer_serialized = async fn() -> Unit { - writer_lock.acquire() - defer writer_lock.release() - close_writer() - } - let cleanup_value = fn(value : Byte) -> Unit { - let ptr = wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Malloc( - 1, - ) - wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Lower( - value, ptr, - ) - wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Reject( - ptr, 0, 1, - ) - mbt_ffi_free(ptr) - } - let sink = @async-core.Sink::from_callbacks( - (data : ArrayView[Byte]) => { - writer_lock.acquire() - defer writer_lock.release() - if writer_closed.val || data.length() == 0 { - return 0 - } - let data_len = if data.length() < 64 { data.length() } else { 64 } - let ptr = wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Malloc( - data_len, - ) - for i in 0.. Unit { - wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Commit( - ptr, 0, transferred, - ) - if transferred < data_len { - wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Reject( - ptr, - transferred, - data_len - transferred, +fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamCommit(handle : Int) -> Unit { + guard wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducers.get(handle) is Some(prepared) else { + return + } + wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducers.remove(handle) + let stream = prepared.stream + let writer = prepared.writer + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let producer = stream.take_producer() + @async-core.spawn_component_task_current(async fn() { + let writer_closed = Ref(false) + let writer_lock = @async-core.Mutex() + let close_writer = fn() -> Unit { + if !writer_closed.val { + writer_closed.val = true + wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0DropWritable(writer) + } + } + let close_writer_serialized = async fn() -> Unit { + writer_lock.acquire() + defer writer_lock.release() + close_writer() + } + let cleanup_value = fn(value : Byte) -> Unit { + let ptr = wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Malloc(1) + wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Lower(value, ptr) + wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + } + let sink = @async-core.Sink::from_callbacks( + (data : ArrayView[Byte]) => { + writer_lock.acquire() + defer writer_lock.release() + if writer_closed.val || data.length() == 0 { + return 0 + } + let data_len = if data.length() < 64 { + data.length() + } else { + 64 + } + let ptr = wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Malloc(data_len) + for i in 0.. Unit { + wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Commit(ptr, 0, transferred) + if transferred < data_len { + wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Reject( + ptr, + transferred, + data_len - transferred, + ) + } + mbt_ffi_free(ptr) + } + let mut total = 0 + let mut dropped = false + while total < data_len { + let (progress, end) = @async-core.suspend_for_stream_write( + writer, + wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Write( + writer, + ptr + total * 1, + data_len - total, + ), + ) catch { + _ => { + total = total + @async-core.cancel_stream_write( + writer, + () => wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0CancelWrite(writer), + ) + settle_staging(total) + close_writer() + return data_len + } + } + total = total + progress + if end { + dropped = true + break + } + } + settle_staging(total) + if dropped { + close_writer() + } + // The canonical writer accepted `total`; generated cleanup + // consumed the rest of this staging window. + data_len + }, + () => close_writer_serialized(), + () => !writer_closed.val, + Some(cleanup_value), ) - } - mbt_ffi_free(ptr) - } - let mut total = 0 - let mut dropped = false - while total < data_len { - let (progress, end) = @async-core.suspend_for_stream_write( - writer, - wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0Write( - writer, - ptr + total * 1, - data_len - total, - ), - ) catch { - _ => { - total = total + - @async-core.cancel_stream_write(writer, () => { - wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0CancelWrite( - writer, - ) - }) - settle_staging(total) - close_writer() - return data_len + let relay_source = producer is None + let run_producer = async fn() -> Unit { + match producer { + Some(producer) => { + producer(sink) + sink.close() + } + None => + for ;; { + match stream.read(64) { + Some(data) => + if !sink.write_all(data[:]) { + stream.reject(cleanup_value) + return + } + None => { + sink.close() + return + } + } + } + } } - } - total = total + progress - if end { - dropped = true - break - } - } - settle_staging(total) - if dropped { - close_writer() - } - // The canonical writer accepted `total`; generated cleanup - // consumed the rest of this staging window. - data_len - }, - () => close_writer_serialized(), - () => !writer_closed.val, - Some(cleanup_value), - ) - let relay_source = producer is None - let run_producer = async fn() -> Unit { - match producer { - Some(producer) => { - producer(sink) - sink.close() - } - None => - for ;; { - match stream.read(64) { - Some(data) => - if !sink.write_all(data[:]) { - stream.reject(cleanup_value) - return - } - None => { - sink.close() - return - } + run_producer() catch { + _ => + if relay_source { + @async-core.protect_from_cancel( + () => stream.reject(cleanup_value), + resume_on_cancel=true, + ) catch { + _ => () + } + } } - } - } - } - run_producer() catch { - _ => - if relay_source { - @async-core.protect_from_cancel( - () => stream.reject(cleanup_value), + // A retained Sink may still own an in-flight canonical write after its + // producer returns. Do not drop the writable endpoint until that write + // has reached a terminal event and released its staging buffer. + @async-core.protect_from_cancel( + () => close_writer_serialized(), resume_on_cancel=true, - ) catch { - _ => () - } - } - } - // A retained Sink may still own an in-flight canonical write after its - // producer returns. Do not drop the writable endpoint until that write - // has reached a terminal event and released its staging buffer. - @async-core.protect_from_cancel( - () => close_writer_serialized(), - resume_on_cancel=true, - ) - }) + ) + }) } -///| -fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamLower( - stream : @async-core.Stream[Byte], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let pair = wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducers.set( - reader, - { stream, writer }, - ) - reader +fn wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamLower(stream : @async-core.Stream[Byte]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let pair = wasmImportGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamProducers.set(reader, { stream, writer }) + reader } -///| fn wasmImportMethodFutureInvokeResultGet(p0 : Int, p1 : Int) -> Int = "golem:tool/host@0.1.0" "[async-lower][method]future-invoke-result.get" -///| -fn wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-read-0][method]future-invoke-result.get" +fn wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "golem:tool/host@0.1.0" "[async-lower][stream-read-0][method]future-invoke-result.get" +fn wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0CancelRead(handle : Int) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-read-0][method]future-invoke-result.get" -///| -fn wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0CancelRead( - handle : Int, -) -> Int = "golem:tool/host@0.1.0" "[stream-cancel-read-0][method]future-invoke-result.get" +fn wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0DropReadable(handle : Int) = "golem:tool/host@0.1.0" "[stream-drop-readable-0][method]future-invoke-result.get" -///| -fn wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0DropReadable( - handle : Int, -) = "golem:tool/host@0.1.0" "[stream-drop-readable-0][method]future-invoke-result.get" - -///| -fn wasmGolemToolHost010MethodFutureInvokeResultGetStream0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmGolemToolHost010MethodFutureInvokeResultGetStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmGolemToolHost010MethodFutureInvokeResultGetStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmGolemToolHost010MethodFutureInvokeResultGetStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource::finish_read( - self : WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource, +self : WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource::wait_for_read_cleanup( - self : WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource, +self : WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource::cancel_active_read( - self : WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource, +self : WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmGolemToolHost010MethodFutureInvokeResultGetStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmGolemToolHost010MethodFutureInvokeResultGetStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource::close( - self : WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource, +self : WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0DropReadable(self.handle) } -///| fn WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource::close_sync( - self : WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource, +self : WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0DropReadable( - self.handle, - ) + self.closed = true + wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0DropReadable(self.handle) } -///| async fn WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource::read( - self : WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource, - count : Int, +self : WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmGolemToolHost010MethodFutureInvokeResultGetStream0Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmGolemToolHost010MethodFutureInvokeResultGetStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportGolemToolHost010MethodFutureInvokeResultGetStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) } + let values = wasmGolemToolHost010MethodFutureInvokeResultGetStream0ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmGolemToolHost010MethodFutureInvokeResultGetStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) + if end { + self.close() + } + Some(values) +} + +fn wasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| -fn wasmImportMethodFutureInvokeResultCancel(p0 : Int) = "golem:tool/host@0.1.0" "[method]future-invoke-result.cancel" +fn wasmImportMethodFutureInvokeResultCancel(p0 : Int) = "golem:tool/host@0.1.0" "[method]future-invoke-result.cancel" ///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = +#|(func (param i32) (result f64) local.get 0 f64.load) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_s) ///| -extern "wasm" fn mbt_ffi_loadf64(offset : Int) -> Double = - #|(func (param i32) (result f64) local.get 0 f64.load) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend8_s) +extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = +#|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) ///| -extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.extend16_s) +#owned(bytes) +extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| -#owned(bytes) -extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_s) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = - #|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_extend8(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend8_s) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_extend16(value : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.extend16_s) ///| -extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = - #|(func (param i32) (result f32) local.get 0 f32.load) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) ///| -extern "wasm" fn mbt_ffi_load16(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_s) +extern "wasm" fn mbt_ffi_storef64(offset : Int, value : Double) = +#|(func (param i32) (param f64) local.get 0 local.get 1 f64.store) ///| -extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +extern "wasm" fn mbt_ffi_load8(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_s) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +extern "wasm" fn mbt_ffi_loadf32(offset : Int) -> Float = +#|(func (param i32) (result f32) local.get 0 f32.load) ///| -extern "wasm" fn mbt_ffi_storef32(offset : Int, value : Float) = - #|(func (param i32) (param f32) local.get 0 local.get 1 f32.store) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_u) + diff --git a/sdks/moonbit/golem_sdk/interface/golem/tool/host/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/tool/host/top.mbt index ac3c483bba..c7ce41cb94 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/tool/host/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/tool/host/top.mbt @@ -1,5 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// A tool registered in the environment, addressable by name from /// any agent or other tool. `definition` carries the full metadata; @@ -10,39 +9,32 @@ /// `mcp.imports` (§5.7.2), or the runtime itself (a synthesized /// component-id) for host-implemented privileged tools (§4.6). pub(all) struct RegisteredTool { - definition : @common.Tool - implemented_by : @types.ComponentId + definition : @common.Tool; implemented_by : @types.ComponentId } derive(Show, Eq) - ///| pub(all) suberror RpcError { - ProtocolError(String) - Denied(String) - NotFound(String) - RemoteInternalError(String) - RemoteToolError(@common.ToolError) + ProtocolError(String) + Denied(String) + NotFound(String) + RemoteInternalError(String) + RemoteToolError(@common.ToolError) } derive(Show, Eq) - ///| pub(all) struct ToolRpc(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn ToolRpc::drop(self : ToolRpc) -> Unit { - let ToolRpc(resource) = self - wasmImportResourceDropToolRpc(resource) + let ToolRpc(resource) = self + wasmImportResourceDropToolRpc(resource) } - ///| pub(all) struct FutureInvokeResult(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn FutureInvokeResult::drop(self : FutureInvokeResult) -> Unit { - let FutureInvokeResult(resource) = self - wasmImportResourceDropFutureInvokeResult(resource) + let FutureInvokeResult(resource) = self + wasmImportResourceDropFutureInvokeResult(resource) } - ///| /// Returns every tool **the calling agent has access to** in /// the current environment, per the manifest's per-env and @@ -56,37897 +48,34818 @@ pub fn FutureInvokeResult::drop(self : FutureInvokeResult) -> Unit { /// want a stable ordering should sort by /// `definition.commands.nodes[0].name`. pub fn get_all_tools() -> Array[RegisteredTool] { - let return_area = mbt_ffi_malloc(8) - wasmImportGetAllTools(return_area) - - let array750 : Array[RegisteredTool] = [] - for index751 = 0 - index751 < mbt_ffi_load32(return_area + 4) - index751 = index751 + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index751 * 56 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let array545 : Array[@common.CommandNode] = [] - for index546 = 0 - index546 < mbt_ffi_load32(iter_base + 12) - index546 = index546 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index546 * 324 - - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - let array : Array[String] = [] - for index = 0; index < mbt_ffi_load32(iter_base + 12); index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index * 8 + let return_area = mbt_ffi_malloc(8) + wasmImportGetAllTools(return_area); - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array750 : Array[RegisteredTool] = []; + for index751 = 0; index751 < (mbt_ffi_load32((return_area) + 4)); index751 = index751 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index751 * 56) - array.push(result1) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let array545 : Array[@common.CommandNode] = []; + for index546 = 0; index546 < (mbt_ffi_load32((iter_base) + 12)); index546 = index546 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index546 * 324) - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array6 : Array[@common.Example] = [] - for index7 = 0 - index7 < mbt_ffi_load32(iter_base + 36) - index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index7 * 16 + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index * 8) - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + array.push(result1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - array6.push(@common.Example::{ title: result4, body: result5 }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let array57 : Array[@common.OptionSpec] = [] - for index58 = 0 - index58 < mbt_ffi_load32(iter_base + 44) - index58 = index58 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index58 * 112 - - let result8 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted : Char? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(Int::unsafe_to_char(mbt_ffi_load32(iter_base + 12))) - _ => panic() - } - - let array10 : Array[String] = [] - for index11 = 0 - index11 < mbt_ffi_load32(iter_base + 20) - index11 = index11 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index11 * 8 - - let result9 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array10.push(result9) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let result12 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let result13 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array16 : Array[@common.Example] = [] - for index17 = 0 - index17 < mbt_ffi_load32(iter_base + 44) - index17 = index17 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index17 * 16 - - let result14 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array16.push(@common.Example::{ title: result14, body: result15 }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let lifted19 : String? = match mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - Option::Some(result18) - } - _ => panic() - } - - let lifted22 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @common.OptionShape::Scalar(mbt_ffi_load32(iter_base + 64)) - 1 => - @common.OptionShape::OptionalScalar(mbt_ffi_load32(iter_base + 64)) - 2 => { - let lifted20 = match mbt_ffi_load8_u(iter_base + 64) { - 0 => @common.Repetition::Repeated - 1 => - @common.Repetition::Delimited( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - 2 => - @common.Repetition::Either( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - _ => panic() - } + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - @common.OptionShape::RepeatableList(@common.RepeatableListShape::{ - repetition: lifted20, - item_type: mbt_ffi_load32(iter_base + 72), - }) - } - 3 => { - let lifted21 = match mbt_ffi_load8_u(iter_base + 64) { - 0 => @common.Repetition::Repeated - 1 => - @common.Repetition::Delimited( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - 2 => - @common.Repetition::Either( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - _ => panic() - } + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - @common.OptionShape::RepeatableMap(@common.RepeatableMapShape::{ - repetition: lifted21, - map_type: mbt_ffi_load32(iter_base + 72), - duplicate_key_policy: @common.DuplicateKeyPolicy::from( - mbt_ffi_load8_u(iter_base + 76), - ), - }) - } - _ => panic() - } - - let lifted54 : @types.SchemaValueTree? = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => Option::None - 1 => { - let array52 : Array[@types.SchemaValueNode] = [] - for index53 = 0 - index53 < mbt_ffi_load32(iter_base + 88) - index53 = index53 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 84) + index53 * 32 - - let lifted51 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result23) - } - 13 => { - let array24 : Array[Int] = [] - for index25 = 0 - index25 < mbt_ffi_load32(iter_base + 12) - index25 = index25 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index25 * 4 - - array24.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array24) - } - 14 => { - let lifted26 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted26, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array27 : Array[Bool] = [] - for index28 = 0 - index28 < mbt_ffi_load32(iter_base + 12) - index28 = index28 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index28 * 1 - - array27.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array27) - } - 17 => { - let array29 : Array[Int] = [] - for index30 = 0 - index30 < mbt_ffi_load32(iter_base + 12) - index30 = index30 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index30 * 4 - - array29.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array29) - } - 18 => { - let array31 : Array[Int] = [] - for index32 = 0 - index32 < mbt_ffi_load32(iter_base + 12) - index32 = index32 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index32 * 4 - - array31.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array31) - } - 19 => { - let array33 : Array[Int] = [] - for index34 = 0 - index34 < mbt_ffi_load32(iter_base + 12) - index34 = index34 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index34 * 4 - - array33.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array33) - } - 20 => { - let array35 : Array[@types.MapEntry] = [] - for index36 = 0 - index36 < mbt_ffi_load32(iter_base + 12) - index36 = index36 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index36 * 8 - - array35.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array35) - } - 21 => { - let lifted37 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted37) - } - 22 => { - let lifted40 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted38 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let array6 : Array[@common.Example] = []; + for index7 = 0; index7 < (mbt_ffi_load32((iter_base) + 36)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index7 * 16) - @types.ResultValuePayload::OkValue(lifted38) - } - 1 => { - let lifted39 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted39) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted40) - } - 23 => { - let result41 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted43 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result42 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result42) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result41, - language: lifted43, - }) - } - 24 => { - let result44 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted46 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result45 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result45) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result44, - mime_type: lifted46, - }) - } - 25 => { - let result47 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result47) - } - 26 => { - let result48 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result48) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result49 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result49, - }) - } - 30 => { - let result50 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result50, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } - - array52.push(lifted51) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - - Option::Some(@types.SchemaValueTree::{ - value_nodes: array52, - root: mbt_ffi_load32(iter_base + 92), - }) - } - _ => panic() - } - - let lifted56 : String? = match mbt_ffi_load8_u(iter_base + 100) { - 0 => Option::None - 1 => { - let result55 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 104), - mbt_ffi_load32(iter_base + 108), - ) - - Option::Some(result55) - } - _ => panic() - } - - array57.push(@common.OptionSpec::{ - long: result8, - short: lifted, - aliases: array10, - doc: @common.Doc::{ - summary: result12, - description: result13, - examples: array16, - }, - value_name: lifted19, - shape: lifted22, - default: lifted54, - required: mbt_ffi_load8_u(iter_base + 96) != 0, - env_var: lifted56, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let array74 : Array[@common.FlagSpec] = [] - for index75 = 0 - index75 < mbt_ffi_load32(iter_base + 52) - index75 = index75 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index75 * 72 - - let result59 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted60 : Char? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(Int::unsafe_to_char(mbt_ffi_load32(iter_base + 12))) - _ => panic() - } - - let array62 : Array[String] = [] - for index63 = 0 - index63 < mbt_ffi_load32(iter_base + 20) - index63 = index63 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index63 * 8 - - let result61 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array62.push(result61) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let result64 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let result65 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array68 : Array[@common.Example] = [] - for index69 = 0 - index69 < mbt_ffi_load32(iter_base + 44) - index69 = index69 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index69 * 16 - - let result66 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result67 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array68.push(@common.Example::{ title: result66, body: result67 }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let lifted71 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @common.FlagShape::BoolFlag(@common.BoolFlagShape::{ - default: mbt_ffi_load8_u(iter_base + 52) != 0, - negatable: mbt_ffi_load8_u(iter_base + 53) != 0, - }) - 1 => { - let lifted70 : UInt? = match mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 56).reinterpret_as_uint(), - ) - _ => panic() - } + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @common.FlagShape::CountFlag(lifted70) - } - _ => panic() - } - - let lifted73 : String? = match mbt_ffi_load8_u(iter_base + 60) { - 0 => Option::None - 1 => { - let result72 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - Option::Some(result72) - } - _ => panic() - } - - array74.push(@common.FlagSpec::{ - long: result59, - short: lifted60, - aliases: array62, - doc: @common.Doc::{ - summary: result64, - description: result65, - examples: array68, - }, - shape: lifted71, - env_var: lifted73, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let array76 : Array[Int] = [] - for index77 = 0 - index77 < mbt_ffi_load32(iter_base + 60) - index77 = index77 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index77 * 4 + array6.push(@common.Example::{title : result4, body : result5}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - array76.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted544 : @common.CommandBody? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let array119 : Array[@common.Positional] = [] - for index120 = 0 - index120 < mbt_ffi_load32(iter_base + 72) - index120 = index120 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + index120 * 68 - - let result78 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result79 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result80 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let array83 : Array[@common.Example] = [] - for index84 = 0 - index84 < mbt_ffi_load32(iter_base + 28) - index84 = index84 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index84 * 16 - - let result81 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result82 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array83.push(@common.Example::{ title: result81, body: result82 }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let lifted86 : String? = match mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result85 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result85) - } - _ => panic() - } + let array57 : Array[@common.OptionSpec] = []; + for index58 = 0; index58 < (mbt_ffi_load32((iter_base) + 44)); index58 = index58 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index58 * 112) - let lifted118 : @types.SchemaValueTree? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => { - let array116 : Array[@types.SchemaValueNode] = [] - for index117 = 0 - index117 < mbt_ffi_load32(iter_base + 56) - index117 = index117 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 52) + index117 * 32 - - let lifted115 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result87 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result87) - } - 13 => { - let array88 : Array[Int] = [] - for index89 = 0 - index89 < mbt_ffi_load32(iter_base + 12) - index89 = index89 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index89 * 4 - - array88.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array88) - } - 14 => { - let lifted90 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted90, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array91 : Array[Bool] = [] - for index92 = 0 - index92 < mbt_ffi_load32(iter_base + 12) - index92 = index92 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index92 * 1 - - array91.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array91) - } - 17 => { - let array93 : Array[Int] = [] - for index94 = 0 - index94 < mbt_ffi_load32(iter_base + 12) - index94 = index94 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index94 * 4 - - array93.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array93) - } - 18 => { - let array95 : Array[Int] = [] - for index96 = 0 - index96 < mbt_ffi_load32(iter_base + 12) - index96 = index96 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index96 * 4 - - array95.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array95) - } - 19 => { - let array97 : Array[Int] = [] - for index98 = 0 - index98 < mbt_ffi_load32(iter_base + 12) - index98 = index98 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index98 * 4 - - array97.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array97) - } - 20 => { - let array99 : Array[@types.MapEntry] = [] - for index100 = 0 - index100 < mbt_ffi_load32(iter_base + 12) - index100 = index100 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index100 * 8 - - array99.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array99) - } - 21 => { - let lifted101 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result8 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaValueNode::OptionValue(lifted101) - } - 22 => { - let lifted104 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted102 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let lifted : Char? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.ResultValuePayload::OkValue(lifted102) + Option::Some(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() } - 1 => { - let lifted103 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - @types.ResultValuePayload::ErrValue(lifted103) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted104) - } - 23 => { - let result105 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted107 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result106 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + let array10 : Array[String] = []; + for index11 = 0; index11 < (mbt_ffi_load32((iter_base) + 20)); index11 = index11 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index11 * 8) - Option::Some(result106) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result105, - language: lifted107, - }) - } - 24 => { - let result108 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted110 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result109 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + let result9 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(result109) + array10.push(result9) } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result108, - mime_type: lifted110, - }) - } - 25 => { - let result111 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result111) - } - 26 => { - let result112 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result112) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result113 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result113, - }) - } - 30 => { - let result114 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result114, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array116.push(lifted115) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - - Option::Some(@types.SchemaValueTree::{ - value_nodes: array116, - root: mbt_ffi_load32(iter_base + 60), - }) - } - _ => panic() - } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - array119.push(@common.Positional::{ - name: result78, - doc: @common.Doc::{ - summary: result79, - description: result80, - examples: array83, - }, - value_name: lifted86, - type_: mbt_ffi_load32(iter_base + 44), - default: lifted118, - required: mbt_ffi_load8_u(iter_base + 64) != 0, - accepts_stdio: mbt_ffi_load8_u(iter_base + 65) != 0, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - let lifted133 : @common.TailPositional? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let result121 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 80), - mbt_ffi_load32(iter_base + 84), - ) - - let result122 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 88), - mbt_ffi_load32(iter_base + 92), - ) - - let result123 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 96), - mbt_ffi_load32(iter_base + 100), - ) - - let array126 : Array[@common.Example] = [] - for index127 = 0 - index127 < mbt_ffi_load32(iter_base + 108) - index127 = index127 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 104) + index127 * 16 - - let result124 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result125 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array126.push(@common.Example::{ - title: result124, - body: result125, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 104)) - - let lifted129 : String? = match mbt_ffi_load8_u(iter_base + 112) { - 0 => Option::None - 1 => { - let result128 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 116), - mbt_ffi_load32(iter_base + 120), - ) - - Option::Some(result128) - } - _ => panic() - } - - let lifted130 : UInt? = match mbt_ffi_load8_u(iter_base + 132) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 136).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted132 : String? = match mbt_ffi_load8_u(iter_base + 140) { - 0 => Option::None - 1 => { - let result131 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 144), - mbt_ffi_load32(iter_base + 148), - ) - - Option::Some(result131) - } - _ => panic() - } - - Option::Some(@common.TailPositional::{ - name: result121, - doc: @common.Doc::{ - summary: result122, - description: result123, - examples: array126, - }, - value_name: lifted129, - item_type: mbt_ffi_load32(iter_base + 124), - min: mbt_ffi_load32(iter_base + 128).reinterpret_as_uint(), - max: lifted130, - separator: lifted132, - verbatim: mbt_ffi_load8_u(iter_base + 152) != 0, - accepts_stdio: mbt_ffi_load8_u(iter_base + 153) != 0, - }) - } - _ => panic() - } - - let array184 : Array[@common.OptionSpec] = [] - for index185 = 0 - index185 < mbt_ffi_load32(iter_base + 160) - index185 = index185 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 156) + index185 * 112 - - let result134 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted135 : Char? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 12)), - ) - _ => panic() - } + let result12 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) - let array137 : Array[String] = [] - for index138 = 0 - index138 < mbt_ffi_load32(iter_base + 20) - index138 = index138 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index138 * 8 + let result13 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) - let result136 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array16 : Array[@common.Example] = []; + for index17 = 0; index17 < (mbt_ffi_load32((iter_base) + 44)); index17 = index17 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index17 * 16) - array137.push(result136) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let result139 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let result140 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array143 : Array[@common.Example] = [] - for index144 = 0 - index144 < mbt_ffi_load32(iter_base + 44) - index144 = index144 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index144 * 16 - - let result141 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result142 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array143.push(@common.Example::{ - title: result141, - body: result142, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let lifted146 : String? = match mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => { - let result145 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - Option::Some(result145) - } - _ => panic() - } + let result14 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted149 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @common.OptionShape::Scalar(mbt_ffi_load32(iter_base + 64)) - 1 => - @common.OptionShape::OptionalScalar( - mbt_ffi_load32(iter_base + 64), - ) - 2 => { - let lifted147 = match mbt_ffi_load8_u(iter_base + 64) { - 0 => @common.Repetition::Repeated - 1 => - @common.Repetition::Delimited( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - 2 => - @common.Repetition::Either( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - _ => panic() - } - - @common.OptionShape::RepeatableList(@common.RepeatableListShape::{ - repetition: lifted147, - item_type: mbt_ffi_load32(iter_base + 72), - }) - } - 3 => { - let lifted148 = match mbt_ffi_load8_u(iter_base + 64) { - 0 => @common.Repetition::Repeated - 1 => - @common.Repetition::Delimited( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - 2 => - @common.Repetition::Either( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - _ => panic() - } - - @common.OptionShape::RepeatableMap(@common.RepeatableMapShape::{ - repetition: lifted148, - map_type: mbt_ffi_load32(iter_base + 72), - duplicate_key_policy: @common.DuplicateKeyPolicy::from( - mbt_ffi_load8_u(iter_base + 76), - ), - }) - } - _ => panic() - } + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let lifted181 : @types.SchemaValueTree? = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => Option::None - 1 => { - let array179 : Array[@types.SchemaValueNode] = [] - for index180 = 0 - index180 < mbt_ffi_load32(iter_base + 88) - index180 = index180 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 84) + index180 * 32 - - let lifted178 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result150) - } - 13 => { - let array151 : Array[Int] = [] - for index152 = 0 - index152 < mbt_ffi_load32(iter_base + 12) - index152 = index152 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index152 * 4 - - array151.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array151) - } - 14 => { - let lifted153 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted153, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array154 : Array[Bool] = [] - for index155 = 0 - index155 < mbt_ffi_load32(iter_base + 12) - index155 = index155 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index155 * 1 - - array154.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array154) - } - 17 => { - let array156 : Array[Int] = [] - for index157 = 0 - index157 < mbt_ffi_load32(iter_base + 12) - index157 = index157 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index157 * 4 - - array156.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array156) - } - 18 => { - let array158 : Array[Int] = [] - for index159 = 0 - index159 < mbt_ffi_load32(iter_base + 12) - index159 = index159 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index159 * 4 - - array158.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array158) - } - 19 => { - let array160 : Array[Int] = [] - for index161 = 0 - index161 < mbt_ffi_load32(iter_base + 12) - index161 = index161 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index161 * 4 - - array160.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array160) - } - 20 => { - let array162 : Array[@types.MapEntry] = [] - for index163 = 0 - index163 < mbt_ffi_load32(iter_base + 12) - index163 = index163 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index163 * 8 - - array162.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array162) - } - 21 => { - let lifted164 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + array16.push(@common.Example::{title : result14, body : result15}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - @types.SchemaValueNode::OptionValue(lifted164) - } - 22 => { - let lifted167 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted165 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let lifted19 : String? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { - @types.ResultValuePayload::OkValue(lifted165) - } - 1 => { - let lifted166 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) - @types.ResultValuePayload::ErrValue(lifted166) + Option::Some(result18) + } + _ => panic() } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted167) - } - 23 => { - let result168 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted170 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result169 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - Option::Some(result169) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result168, - language: lifted170, - }) - } - 24 => { - let result171 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted173 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result172 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + let lifted22 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { - Option::Some(result172) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result171, - mime_type: lifted173, - }) - } - 25 => { - let result174 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result174) - } - 26 => { - let result175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result175) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result176 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result176, - }) - } - 30 => { - let result177 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result177, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array179.push(lifted178) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - - Option::Some(@types.SchemaValueTree::{ - value_nodes: array179, - root: mbt_ffi_load32(iter_base + 92), - }) - } - _ => panic() - } + @common.OptionShape::Scalar(mbt_ffi_load32((iter_base) + 64)) + } + 1 => { - let lifted183 : String? = match mbt_ffi_load8_u(iter_base + 100) { - 0 => Option::None - 1 => { - let result182 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 104), - mbt_ffi_load32(iter_base + 108), - ) - - Option::Some(result182) - } - _ => panic() - } + @common.OptionShape::OptionalScalar(mbt_ffi_load32((iter_base) + 64)) + } + 2 => { - array184.push(@common.OptionSpec::{ - long: result134, - short: lifted135, - aliases: array137, - doc: @common.Doc::{ - summary: result139, - description: result140, - examples: array143, - }, - value_name: lifted146, - shape: lifted149, - default: lifted181, - required: mbt_ffi_load8_u(iter_base + 96) != 0, - env_var: lifted183, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 156)) - - let array201 : Array[@common.FlagSpec] = [] - for index202 = 0 - index202 < mbt_ffi_load32(iter_base + 168) - index202 = index202 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 164) + index202 * 72 - - let result186 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted187 : Char? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 12)), - ) - _ => panic() - } + let lifted20 = match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => { - let array189 : Array[String] = [] - for index190 = 0 - index190 < mbt_ffi_load32(iter_base + 20) - index190 = index190 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index190 * 8 + @common.Repetition::Repeated + } + 1 => { - let result188 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @common.Repetition::Delimited(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + 2 => { - array189.push(result188) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let result191 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let result192 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array195 : Array[@common.Example] = [] - for index196 = 0 - index196 < mbt_ffi_load32(iter_base + 44) - index196 = index196 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index196 * 16 - - let result193 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result194 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array195.push(@common.Example::{ - title: result193, - body: result194, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let lifted198 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @common.FlagShape::BoolFlag(@common.BoolFlagShape::{ - default: mbt_ffi_load8_u(iter_base + 52) != 0, - negatable: mbt_ffi_load8_u(iter_base + 53) != 0, - }) - 1 => { - let lifted197 : UInt? = match mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 56).reinterpret_as_uint(), - ) - _ => panic() - } + @common.Repetition::Either(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + _ => panic() + } - @common.FlagShape::CountFlag(lifted197) - } - _ => panic() - } + @common.OptionShape::RepeatableList(@common.RepeatableListShape::{repetition : lifted20, item_type : mbt_ffi_load32((iter_base) + 72)}) + } + 3 => { - let lifted200 : String? = match mbt_ffi_load8_u(iter_base + 60) { - 0 => Option::None - 1 => { - let result199 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - Option::Some(result199) - } - _ => panic() - } + let lifted21 = match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => { - array201.push(@common.FlagSpec::{ - long: result186, - short: lifted187, - aliases: array189, - doc: @common.Doc::{ - summary: result191, - description: result192, - examples: array195, - }, - shape: lifted198, - env_var: lifted200, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 164)) - - let array494 : Array[@common.Constraint] = [] - for index495 = 0 - index495 < mbt_ffi_load32(iter_base + 176) - index495 = index495 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 172) + index495 * 28 - - let lifted493 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let array237 : Array[@common.Ref] = [] - for index238 = 0 - index238 < mbt_ffi_load32(iter_base + 8) - index238 = index238 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index238 * 24 - - let lifted236 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result203 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result203) - } - 1 => { - let result204 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array234 : Array[@types.SchemaValueNode] = [] - for index235 = 0 - index235 < mbt_ffi_load32(iter_base + 16) - index235 = index235 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index235 * 32 - - let lifted233 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result205 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result205) - } - 13 => { - let array206 : Array[Int] = [] - for index207 = 0 - index207 < mbt_ffi_load32(iter_base + 12) - index207 = index207 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index207 * 4 - - array206.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array206) - } - 14 => { - let lifted208 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted208, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array209 : Array[Bool] = [] - for index210 = 0 - index210 < mbt_ffi_load32(iter_base + 12) - index210 = index210 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index210 * 1 - - array209.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array209) - } - 17 => { - let array211 : Array[Int] = [] - for index212 = 0 - index212 < mbt_ffi_load32(iter_base + 12) - index212 = index212 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index212 * 4 - - array211.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array211) - } - 18 => { - let array213 : Array[Int] = [] - for index214 = 0 - index214 < mbt_ffi_load32(iter_base + 12) - index214 = index214 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index214 * 4 - - array213.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array213) - } - 19 => { - let array215 : Array[Int] = [] - for index216 = 0 - index216 < mbt_ffi_load32(iter_base + 12) - index216 = index216 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index216 * 4 - - array215.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array215) - } - 20 => { - let array217 : Array[@types.MapEntry] = [] - for index218 = 0 - index218 < mbt_ffi_load32(iter_base + 12) - index218 = index218 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index218 * 8 - - array217.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array217) - } - 21 => { - let lifted219 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @common.Repetition::Repeated + } + 1 => { - @types.SchemaValueNode::OptionValue(lifted219) - } - 22 => { - let lifted222 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted220 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @common.Repetition::Delimited(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + 2 => { - @types.ResultValuePayload::OkValue(lifted220) - } - 1 => { - let lifted221 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @common.Repetition::Either(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + _ => panic() + } - @types.ResultValuePayload::ErrValue(lifted221) + @common.OptionShape::RepeatableMap(@common.RepeatableMapShape::{repetition : lifted21, map_type : mbt_ffi_load32((iter_base) + 72), duplicate_key_policy : @common.DuplicateKeyPolicy::from(mbt_ffi_load8_u((iter_base) + 76))}) } _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted222) - } - 23 => { - let result223 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted225 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result224 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + } - Option::Some(result224) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result223, - language: lifted225, - }) - } - 24 => { - let result226 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted228 : String? = match - mbt_ffi_load8_u(iter_base + 16) { + let lifted54 : @types.SchemaValueTree? = match mbt_ffi_load8_u((iter_base) + 80) { 0 => Option::None 1 => { - let result227 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - Option::Some(result227) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result226, - mime_type: lifted228, - }) - } - 25 => { - let result229 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result229) - } - 26 => { - let result230 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result230) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result231 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result231, - }) - } - 30 => { - let result232 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result232, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array234.push(lifted233) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result204, - value: @types.SchemaValueTree::{ - value_nodes: array234, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array237.push(lifted236) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - @common.Constraint::RequiresAll(array237) - } - 1 => { - let array273 : Array[@common.Ref] = [] - for index274 = 0 - index274 < mbt_ffi_load32(iter_base + 8) - index274 = index274 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index274 * 24 - - let lifted272 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result239 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result239) - } - 1 => { - let result240 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array270 : Array[@types.SchemaValueNode] = [] - for index271 = 0 - index271 < mbt_ffi_load32(iter_base + 16) - index271 = index271 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index271 * 32 - - let lifted269 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result241 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result241) - } - 13 => { - let array242 : Array[Int] = [] - for index243 = 0 - index243 < mbt_ffi_load32(iter_base + 12) - index243 = index243 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index243 * 4 - - array242.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array242) - } - 14 => { - let lifted244 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted244, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array245 : Array[Bool] = [] - for index246 = 0 - index246 < mbt_ffi_load32(iter_base + 12) - index246 = index246 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index246 * 1 - - array245.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array245) - } - 17 => { - let array247 : Array[Int] = [] - for index248 = 0 - index248 < mbt_ffi_load32(iter_base + 12) - index248 = index248 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index248 * 4 - - array247.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array247) - } - 18 => { - let array249 : Array[Int] = [] - for index250 = 0 - index250 < mbt_ffi_load32(iter_base + 12) - index250 = index250 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index250 * 4 - - array249.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array249) - } - 19 => { - let array251 : Array[Int] = [] - for index252 = 0 - index252 < mbt_ffi_load32(iter_base + 12) - index252 = index252 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index252 * 4 - - array251.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array251) - } - 20 => { - let array253 : Array[@types.MapEntry] = [] - for index254 = 0 - index254 < mbt_ffi_load32(iter_base + 12) - index254 = index254 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index254 * 8 - - array253.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array253) - } - 21 => { - let lifted255 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let array52 : Array[@types.SchemaValueNode] = []; + for index53 = 0; index53 < (mbt_ffi_load32((iter_base) + 88)); index53 = index53 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 84)) + (index53 * 32) - @types.SchemaValueNode::OptionValue(lifted255) - } - 22 => { - let lifted258 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted256 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let lifted51 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - @types.ResultValuePayload::OkValue(lifted256) - } - 1 => { - let lifted257 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - @types.ResultValuePayload::ErrValue(lifted257) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted258) - } - 23 => { - let result259 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted261 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result260 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - Option::Some(result260) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result259, - language: lifted261, - }) - } - 24 => { - let result262 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted264 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result263 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - Option::Some(result263) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result262, - mime_type: lifted264, - }) - } - 25 => { - let result265 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result265) - } - 26 => { - let result266 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result266) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result267 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result267, - }) - } - 30 => { - let result268 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result268, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array270.push(lifted269) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result240, - value: @types.SchemaValueTree::{ - value_nodes: array270, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array273.push(lifted272) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - @common.Constraint::AllOrNone(array273) - } - 2 => { - let array309 : Array[@common.Ref] = [] - for index310 = 0 - index310 < mbt_ffi_load32(iter_base + 8) - index310 = index310 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index310 * 24 - - let lifted308 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result275 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result275) - } - 1 => { - let result276 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array306 : Array[@types.SchemaValueNode] = [] - for index307 = 0 - index307 < mbt_ffi_load32(iter_base + 16) - index307 = index307 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index307 * 32 - - let lifted305 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result277 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result277) - } - 13 => { - let array278 : Array[Int] = [] - for index279 = 0 - index279 < mbt_ffi_load32(iter_base + 12) - index279 = index279 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index279 * 4 - - array278.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array278) - } - 14 => { - let lifted280 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted280, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array281 : Array[Bool] = [] - for index282 = 0 - index282 < mbt_ffi_load32(iter_base + 12) - index282 = index282 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index282 * 1 - - array281.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array281) - } - 17 => { - let array283 : Array[Int] = [] - for index284 = 0 - index284 < mbt_ffi_load32(iter_base + 12) - index284 = index284 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index284 * 4 - - array283.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array283) - } - 18 => { - let array285 : Array[Int] = [] - for index286 = 0 - index286 < mbt_ffi_load32(iter_base + 12) - index286 = index286 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index286 * 4 - - array285.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array285) - } - 19 => { - let array287 : Array[Int] = [] - for index288 = 0 - index288 < mbt_ffi_load32(iter_base + 12) - index288 = index288 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index288 * 4 - - array287.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array287) - } - 20 => { - let array289 : Array[@types.MapEntry] = [] - for index290 = 0 - index290 < mbt_ffi_load32(iter_base + 12) - index290 = index290 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index290 * 8 - - array289.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array289) - } - 21 => { - let lifted291 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - @types.SchemaValueNode::OptionValue(lifted291) - } - 22 => { - let lifted294 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted292 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - @types.ResultValuePayload::OkValue(lifted292) - } - 1 => { - let lifted293 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - @types.ResultValuePayload::ErrValue(lifted293) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted294) - } - 23 => { - let result295 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted297 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result296 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - Option::Some(result296) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result295, - language: lifted297, - }) - } - 24 => { - let result298 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted300 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result299 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - Option::Some(result299) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result298, - mime_type: lifted300, - }) - } - 25 => { - let result301 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result301) - } - 26 => { - let result302 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result302) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result303 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result303, - }) - } - 30 => { - let result304 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result304, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array306.push(lifted305) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result276, - value: @types.SchemaValueTree::{ - value_nodes: array306, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array309.push(lifted308) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - @common.Constraint::RequiresAny(array309) - } - 3 => { - let array347 : Array[@common.RefGroup] = [] - for index348 = 0 - index348 < mbt_ffi_load32(iter_base + 8) - index348 = index348 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index348 * 8 - - let array345 : Array[@common.Ref] = [] - for index346 = 0 - index346 < mbt_ffi_load32(iter_base + 4) - index346 = index346 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index346 * 24 - - let lifted344 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result311 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result311) - } - 1 => { - let result312 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array342 : Array[@types.SchemaValueNode] = [] - for index343 = 0 - index343 < mbt_ffi_load32(iter_base + 16) - index343 = index343 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index343 * 32 - - let lifted341 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char( - mbt_ffi_load32(iter_base + 8), - ), - ) - 12 => { - let result313 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result313) - } - 13 => { - let array314 : Array[Int] = [] - for index315 = 0 - index315 < mbt_ffi_load32(iter_base + 12) - index315 = index315 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index315 * 4 - - array314.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array314) - } - 14 => { - let lifted316 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted316, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array317 : Array[Bool] = [] - for index318 = 0 - index318 < mbt_ffi_load32(iter_base + 12) - index318 = index318 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index318 * 1 - - array317.push( - mbt_ffi_load8_u(iter_base + 0) != 0, - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array317) - } - 17 => { - let array319 : Array[Int] = [] - for index320 = 0 - index320 < mbt_ffi_load32(iter_base + 12) - index320 = index320 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index320 * 4 - - array319.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array319) - } - 18 => { - let array321 : Array[Int] = [] - for index322 = 0 - index322 < mbt_ffi_load32(iter_base + 12) - index322 = index322 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index322 * 4 - - array321.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array321) - } - 19 => { - let array323 : Array[Int] = [] - for index324 = 0 - index324 < mbt_ffi_load32(iter_base + 12) - index324 = index324 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index324 * 4 - - array323.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array323) - } - 20 => { - let array325 : Array[@types.MapEntry] = [] - for index326 = 0 - index326 < mbt_ffi_load32(iter_base + 12) - index326 = index326 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index326 * 8 - - array325.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array325) - } - 21 => { - let lifted327 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted327) - } - 22 => { - let lifted330 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted328 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - @types.ResultValuePayload::OkValue(lifted328) - } - 1 => { - let lifted329 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted329) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted330) - } - 23 => { - let result331 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted333 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result332 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result332) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result331, - language: lifted333, - }) - } - 24 => { - let result334 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted336 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result335 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result335) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result334, - mime_type: lifted336, - }) - } - 25 => { - let result337 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result337) - } - 26 => { - let result338 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result338) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result339 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result339, - }) - } - 30 => { - let result340 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result340, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array342.push(lifted341) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result312, - value: @types.SchemaValueTree::{ - value_nodes: array342, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array345.push(lifted344) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array347.push(@common.RefGroup::{ refs: array345 }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - @common.Constraint::MutexGroups(array347) - } - 4 => { - let array383 : Array[@common.Ref] = [] - for index384 = 0 - index384 < mbt_ffi_load32(iter_base + 12) - index384 = index384 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index384 * 24 - - let lifted382 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result349 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result349) - } - 1 => { - let result350 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array380 : Array[@types.SchemaValueNode] = [] - for index381 = 0 - index381 < mbt_ffi_load32(iter_base + 16) - index381 = index381 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index381 * 32 - - let lifted379 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result351 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result351) - } - 13 => { - let array352 : Array[Int] = [] - for index353 = 0 - index353 < mbt_ffi_load32(iter_base + 12) - index353 = index353 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index353 * 4 - - array352.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array352) - } - 14 => { - let lifted354 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted354, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array355 : Array[Bool] = [] - for index356 = 0 - index356 < mbt_ffi_load32(iter_base + 12) - index356 = index356 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index356 * 1 - - array355.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array355) - } - 17 => { - let array357 : Array[Int] = [] - for index358 = 0 - index358 < mbt_ffi_load32(iter_base + 12) - index358 = index358 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index358 * 4 - - array357.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array357) - } - 18 => { - let array359 : Array[Int] = [] - for index360 = 0 - index360 < mbt_ffi_load32(iter_base + 12) - index360 = index360 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index360 * 4 - - array359.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array359) - } - 19 => { - let array361 : Array[Int] = [] - for index362 = 0 - index362 < mbt_ffi_load32(iter_base + 12) - index362 = index362 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index362 * 4 - - array361.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array361) - } - 20 => { - let array363 : Array[@types.MapEntry] = [] - for index364 = 0 - index364 < mbt_ffi_load32(iter_base + 12) - index364 = index364 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index364 * 8 - - array363.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array363) - } - 21 => { - let lifted365 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - @types.SchemaValueNode::OptionValue(lifted365) - } - 22 => { - let lifted368 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted366 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - @types.ResultValuePayload::OkValue(lifted366) - } - 1 => { - let lifted367 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - @types.ResultValuePayload::ErrValue(lifted367) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted368) - } - 23 => { - let result369 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted371 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result370 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(result370) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result369, - language: lifted371, - }) - } - 24 => { - let result372 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted374 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result373 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.SchemaValueNode::StringValue(result23) + } + 13 => { - Option::Some(result373) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result372, - mime_type: lifted374, - }) - } - 25 => { - let result375 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result375) - } - 26 => { - let result376 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result376) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result377 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result377, - }) - } - 30 => { - let result378 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result378, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array380.push(lifted379) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result350, - value: @types.SchemaValueTree::{ - value_nodes: array380, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array383.push(lifted382) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - let array419 : Array[@common.Ref] = [] - for index420 = 0 - index420 < mbt_ffi_load32(iter_base + 24) - index420 = index420 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + index420 * 24 - - let lifted418 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result385 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result385) - } - 1 => { - let result386 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array416 : Array[@types.SchemaValueNode] = [] - for index417 = 0 - index417 < mbt_ffi_load32(iter_base + 16) - index417 = index417 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index417 * 32 - - let lifted415 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result387 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result387) - } - 13 => { - let array388 : Array[Int] = [] - for index389 = 0 - index389 < mbt_ffi_load32(iter_base + 12) - index389 = index389 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index389 * 4 - - array388.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array388) - } - 14 => { - let lifted390 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted390, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array391 : Array[Bool] = [] - for index392 = 0 - index392 < mbt_ffi_load32(iter_base + 12) - index392 = index392 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index392 * 1 - - array391.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array391) - } - 17 => { - let array393 : Array[Int] = [] - for index394 = 0 - index394 < mbt_ffi_load32(iter_base + 12) - index394 = index394 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index394 * 4 - - array393.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array393) - } - 18 => { - let array395 : Array[Int] = [] - for index396 = 0 - index396 < mbt_ffi_load32(iter_base + 12) - index396 = index396 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index396 * 4 - - array395.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array395) - } - 19 => { - let array397 : Array[Int] = [] - for index398 = 0 - index398 < mbt_ffi_load32(iter_base + 12) - index398 = index398 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index398 * 4 - - array397.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array397) - } - 20 => { - let array399 : Array[@types.MapEntry] = [] - for index400 = 0 - index400 < mbt_ffi_load32(iter_base + 12) - index400 = index400 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index400 * 8 - - array399.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array399) - } - 21 => { - let lifted401 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let array24 : Array[Int] = []; + for index25 = 0; index25 < (mbt_ffi_load32((iter_base) + 12)); index25 = index25 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index25 * 4) - @types.SchemaValueNode::OptionValue(lifted401) - } - 22 => { - let lifted404 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted402 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + array24.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.ResultValuePayload::OkValue(lifted402) - } - 1 => { - let lifted403 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::RecordValue(array24) + } + 14 => { - @types.ResultValuePayload::ErrValue(lifted403) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted404) - } - 23 => { - let result405 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted407 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result406 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + let lifted26 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(result406) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result405, - language: lifted407, - }) - } - 24 => { - let result408 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted410 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result409 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - Option::Some(result409) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result408, - mime_type: lifted410, - }) - } - 25 => { - let result411 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result411) - } - 26 => { - let result412 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result412) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result413 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result413, - }) - } - 30 => { - let result414 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result414, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array416.push(lifted415) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result386, - value: @types.SchemaValueTree::{ - value_nodes: array416, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array419.push(lifted418) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - @common.Constraint::Implies(@common.ImpliesC::{ - lhs_quant: @common.Quantifier::from( - mbt_ffi_load8_u(iter_base + 4), - ), - lhs: array383, - rhs_quant: @common.Quantifier::from( - mbt_ffi_load8_u(iter_base + 16), - ), - rhs: array419, - }) - } - 5 => { - let array455 : Array[@common.Ref] = [] - for index456 = 0 - index456 < mbt_ffi_load32(iter_base + 12) - index456 = index456 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index456 * 24 - - let lifted454 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result421 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result421) - } - 1 => { - let result422 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array452 : Array[@types.SchemaValueNode] = [] - for index453 = 0 - index453 < mbt_ffi_load32(iter_base + 16) - index453 = index453 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index453 * 32 - - let lifted451 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result423 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result423) - } - 13 => { - let array424 : Array[Int] = [] - for index425 = 0 - index425 < mbt_ffi_load32(iter_base + 12) - index425 = index425 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index425 * 4 - - array424.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array424) - } - 14 => { - let lifted426 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted426, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array427 : Array[Bool] = [] - for index428 = 0 - index428 < mbt_ffi_load32(iter_base + 12) - index428 = index428 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index428 * 1 - - array427.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array427) - } - 17 => { - let array429 : Array[Int] = [] - for index430 = 0 - index430 < mbt_ffi_load32(iter_base + 12) - index430 = index430 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index430 * 4 - - array429.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array429) - } - 18 => { - let array431 : Array[Int] = [] - for index432 = 0 - index432 < mbt_ffi_load32(iter_base + 12) - index432 = index432 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index432 * 4 - - array431.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array431) - } - 19 => { - let array433 : Array[Int] = [] - for index434 = 0 - index434 < mbt_ffi_load32(iter_base + 12) - index434 = index434 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index434 * 4 - - array433.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array433) - } - 20 => { - let array435 : Array[@types.MapEntry] = [] - for index436 = 0 - index436 < mbt_ffi_load32(iter_base + 12) - index436 = index436 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index436 * 8 - - array435.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array435) - } - 21 => { - let lifted437 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted26}) + } + 15 => { - @types.SchemaValueNode::OptionValue(lifted437) - } - 22 => { - let lifted440 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted438 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - @types.ResultValuePayload::OkValue(lifted438) - } - 1 => { - let lifted439 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let array27 : Array[Bool] = []; + for index28 = 0; index28 < (mbt_ffi_load32((iter_base) + 12)); index28 = index28 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index28 * 1) - @types.ResultValuePayload::ErrValue(lifted439) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted440) - } - 23 => { - let result441 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted443 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result442 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + array27.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(result442) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result441, - language: lifted443, - }) - } - 24 => { - let result444 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted446 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result445 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.SchemaValueNode::FlagsValue(array27) + } + 17 => { - Option::Some(result445) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result444, - mime_type: lifted446, - }) - } - 25 => { - let result447 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result447) - } - 26 => { - let result448 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result448) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result449 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result449, - }) - } - 30 => { - let result450 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result450, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array452.push(lifted451) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result422, - value: @types.SchemaValueTree::{ - value_nodes: array452, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array455.push(lifted454) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - let array491 : Array[@common.Ref] = [] - for index492 = 0 - index492 < mbt_ffi_load32(iter_base + 20) - index492 = index492 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index492 * 24 - - let lifted490 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result457 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result457) - } - 1 => { - let result458 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array488 : Array[@types.SchemaValueNode] = [] - for index489 = 0 - index489 < mbt_ffi_load32(iter_base + 16) - index489 = index489 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index489 * 32 - - let lifted487 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result459 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result459) - } - 13 => { - let array460 : Array[Int] = [] - for index461 = 0 - index461 < mbt_ffi_load32(iter_base + 12) - index461 = index461 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index461 * 4 - - array460.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array460) - } - 14 => { - let lifted462 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted462, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array463 : Array[Bool] = [] - for index464 = 0 - index464 < mbt_ffi_load32(iter_base + 12) - index464 = index464 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index464 * 1 - - array463.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array463) - } - 17 => { - let array465 : Array[Int] = [] - for index466 = 0 - index466 < mbt_ffi_load32(iter_base + 12) - index466 = index466 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index466 * 4 - - array465.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array465) - } - 18 => { - let array467 : Array[Int] = [] - for index468 = 0 - index468 < mbt_ffi_load32(iter_base + 12) - index468 = index468 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index468 * 4 - - array467.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array467) - } - 19 => { - let array469 : Array[Int] = [] - for index470 = 0 - index470 < mbt_ffi_load32(iter_base + 12) - index470 = index470 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index470 * 4 - - array469.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array469) - } - 20 => { - let array471 : Array[@types.MapEntry] = [] - for index472 = 0 - index472 < mbt_ffi_load32(iter_base + 12) - index472 = index472 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index472 * 8 - - array471.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array471) - } - 21 => { - let lifted473 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let array29 : Array[Int] = []; + for index30 = 0; index30 < (mbt_ffi_load32((iter_base) + 12)); index30 = index30 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index30 * 4) - @types.SchemaValueNode::OptionValue(lifted473) - } - 22 => { - let lifted476 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted474 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + array29.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.ResultValuePayload::OkValue(lifted474) - } - 1 => { - let lifted475 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaValueNode::TupleValue(array29) + } + 18 => { - @types.ResultValuePayload::ErrValue(lifted475) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted476) - } - 23 => { - let result477 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted479 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result478 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + let array31 : Array[Int] = []; + for index32 = 0; index32 < (mbt_ffi_load32((iter_base) + 12)); index32 = index32 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index32 * 4) - Option::Some(result478) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result477, - language: lifted479, - }) - } - 24 => { - let result480 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted482 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result481 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + array31.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(result481) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result480, - mime_type: lifted482, - }) - } - 25 => { - let result483 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result483) - } - 26 => { - let result484 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result484) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result485 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result485, - }) - } - 30 => { - let result486 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result486, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array488.push(lifted487) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result458, - value: @types.SchemaValueTree::{ - value_nodes: array488, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array491.push(lifted490) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - @common.Constraint::Forbids(@common.ForbidsC::{ - lhs_quant: @common.Quantifier::from( - mbt_ffi_load8_u(iter_base + 4), - ), - lhs: array455, - rhs: array491, - }) - } - _ => panic() - } + @types.SchemaValueNode::ListValue(array31) + } + 19 => { - array494.push(lifted493) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 172)) + let array33 : Array[Int] = []; + for index34 = 0; index34 < (mbt_ffi_load32((iter_base) + 12)); index34 = index34 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index34 * 4) - let lifted505 : @common.StreamSpec? = match - mbt_ffi_load8_u(iter_base + 180) { - 0 => Option::None - 1 => { - let result496 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 184), - mbt_ffi_load32(iter_base + 188), - ) - - let result497 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 192), - mbt_ffi_load32(iter_base + 196), - ) - - let array500 : Array[@common.Example] = [] - for index501 = 0 - index501 < mbt_ffi_load32(iter_base + 204) - index501 = index501 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 200) + index501 * 16 - - let result498 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result499 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array500.push(@common.Example::{ - title: result498, - body: result499, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 200)) - - let array503 : Array[String] = [] - for index504 = 0 - index504 < mbt_ffi_load32(iter_base + 212) - index504 = index504 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 208) + index504 * 8 - - let result502 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array503.push(result502) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 208)) - - Option::Some(@common.StreamSpec::{ - doc: @common.Doc::{ - summary: result496, - description: result497, - examples: array500, - }, - mime: array503, - required: mbt_ffi_load8_u(iter_base + 216) != 0, - }) - } - _ => panic() - } + array33.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted515 : @common.StreamSpec? = match - mbt_ffi_load8_u(iter_base + 220) { - 0 => Option::None - 1 => { - let result506 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 224), - mbt_ffi_load32(iter_base + 228), - ) - - let result507 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 232), - mbt_ffi_load32(iter_base + 236), - ) - - let array510 : Array[@common.Example] = [] - for index511 = 0 - index511 < mbt_ffi_load32(iter_base + 244) - index511 = index511 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 240) + index511 * 16 - - let result508 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result509 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array510.push(@common.Example::{ - title: result508, - body: result509, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 240)) - - let array513 : Array[String] = [] - for index514 = 0 - index514 < mbt_ffi_load32(iter_base + 252) - index514 = index514 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 248) + index514 * 8 - - let result512 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array513.push(result512) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 248)) - - Option::Some(@common.StreamSpec::{ - doc: @common.Doc::{ - summary: result506, - description: result507, - examples: array510, - }, - mime: array513, - required: mbt_ffi_load8_u(iter_base + 256) != 0, - }) - } - _ => panic() - } + @types.SchemaValueNode::FixedListValue(array33) + } + 20 => { - let lifted532 : @common.ResultSpec? = match - mbt_ffi_load8_u(iter_base + 260) { - 0 => Option::None - 1 => { - let result516 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 268), - mbt_ffi_load32(iter_base + 272), - ) - - let result517 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 276), - mbt_ffi_load32(iter_base + 280), - ) - - let array520 : Array[@common.Example] = [] - for index521 = 0 - index521 < mbt_ffi_load32(iter_base + 288) - index521 = index521 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 284) + index521 * 16 - - let result518 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result519 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array520.push(@common.Example::{ - title: result518, - body: result519, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 284)) - - let array529 : Array[@common.Formatter] = [] - for index530 = 0 - index530 < mbt_ffi_load32(iter_base + 296) - index530 = index530 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 292) + index530 * 32 - - let result522 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result523 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result524 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let array527 : Array[@common.Example] = [] - for index528 = 0 - index528 < mbt_ffi_load32(iter_base + 28) - index528 = index528 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index528 * 16 - - let result525 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result526 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array527.push(@common.Example::{ - title: result525, - body: result526, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - array529.push(@common.Formatter::{ - name: result522, - doc: @common.Doc::{ - summary: result523, - description: result524, - examples: array527, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 292)) - - let result531 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 300), - mbt_ffi_load32(iter_base + 304), - ) - - Option::Some(@common.ResultSpec::{ - type_: mbt_ffi_load32(iter_base + 264), - doc: @common.Doc::{ - summary: result516, - description: result517, - examples: array520, - }, - formatters: array529, - default_formatter: result531, - }) - } - _ => panic() - } - - let array541 : Array[@common.ErrorCase] = [] - for index542 = 0 - index542 < mbt_ffi_load32(iter_base + 312) - index542 = index542 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 308) + index542 * 44 - - let result533 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result534 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result535 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let array538 : Array[@common.Example] = [] - for index539 = 0 - index539 < mbt_ffi_load32(iter_base + 28) - index539 = index539 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index539 * 16 - - let result536 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result537 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array538.push(@common.Example::{ - title: result536, - body: result537, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + let array35 : Array[@types.MapEntry] = []; + for index36 = 0; index36 < (mbt_ffi_load32((iter_base) + 12)); index36 = index36 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index36 * 8) - let lifted540 : Int? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } + array35.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - array541.push(@common.ErrorCase::{ - name: result533, - doc: @common.Doc::{ - summary: result534, - description: result535, - examples: array538, - }, - kind: @common.ErrorKind::from(mbt_ffi_load8_u(iter_base + 32)), - exit_code: mbt_ffi_load8_u(iter_base + 33).to_byte(), - payload: lifted540, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 308)) - - let lifted543 : @common.CommandAnnotations? = match - mbt_ffi_load8_u(iter_base + 316) { - 0 => Option::None - 1 => - Option::Some(@common.CommandAnnotations::{ - read_only: mbt_ffi_load8_u(iter_base + 317) != 0, - destructive: mbt_ffi_load8_u(iter_base + 318) != 0, - idempotent: mbt_ffi_load8_u(iter_base + 319) != 0, - open_world: mbt_ffi_load8_u(iter_base + 320) != 0, - }) - _ => panic() - } - - Option::Some(@common.CommandBody::{ - positionals: @common.Positionals::{ - fixed: array119, - tail: lifted133, - }, - options: array184, - flags: array201, - constraints: array494, - stdin: lifted505, - stdout: lifted515, - result: lifted532, - errors: array541, - annotations: lifted543, - }) - } - _ => panic() - } + @types.SchemaValueNode::MapValue(array35) + } + 21 => { - array545.push(@common.CommandNode::{ - name: result0, - aliases: array, - doc: @common.Doc::{ - summary: result2, - description: result3, - examples: array6, - }, - globals: @common.Globals::{ options: array57, flags: array74 }, - subcommands: array76, - body: lifted544, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - let array743 : Array[@types.SchemaTypeNode] = [] - for index744 = 0 - index744 < mbt_ffi_load32(iter_base + 20) - index744 = index744 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index744 * 144 - - let lifted729 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted553 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted548 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted547 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted547) - } - _ => panic() - } - - let lifted550 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted549 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted549) - } - _ => panic() - } - - let lifted552 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result551 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result551) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted548, - max: lifted550, - unit: lifted552, - }) - } - _ => panic() - } + let lifted37 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::S8Type(lifted553) - } - 3 => { - let lifted560 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted555 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted554 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted554) - } - _ => panic() - } - - let lifted557 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted556 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted556) - } - _ => panic() - } - - let lifted559 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result558 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result558) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted555, - max: lifted557, - unit: lifted559, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - @types.SchemaTypeBody::S16Type(lifted560) - } - 4 => { - let lifted567 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted562 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted561 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted561) - } - _ => panic() - } - - let lifted564 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted563 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted563) - } - _ => panic() - } - - let lifted566 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result565 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result565) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted562, - max: lifted564, - unit: lifted566, - }) - } - _ => panic() - } + @types.SchemaValueNode::OptionValue(lifted37) + } + 22 => { - @types.SchemaTypeBody::S32Type(lifted567) - } - 5 => { - let lifted574 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted569 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted568 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted568) - } - _ => panic() - } - - let lifted571 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted570 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted570) - } - _ => panic() - } - - let lifted573 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result572 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result572) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted569, - max: lifted571, - unit: lifted573, - }) - } - _ => panic() - } + let lifted40 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - @types.SchemaTypeBody::S64Type(lifted574) - } - 6 => { - let lifted581 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted576 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted575 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted575) - } - _ => panic() - } - - let lifted578 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted577 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted577) - } - _ => panic() - } - - let lifted580 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result579 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result579) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted576, - max: lifted578, - unit: lifted580, - }) - } - _ => panic() - } + let lifted38 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::U8Type(lifted581) - } - 7 => { - let lifted588 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted583 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted582 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted582) - } - _ => panic() - } - - let lifted585 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted584 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted584) - } - _ => panic() - } - - let lifted587 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result586 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result586) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted583, - max: lifted585, - unit: lifted587, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - @types.SchemaTypeBody::U16Type(lifted588) - } - 8 => { - let lifted595 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { + @types.ResultValuePayload::OkValue(lifted38) + } + 1 => { + + let lifted39 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted39) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted40) + } + 23 => { + + let result41 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted43 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result42 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result42) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result41, language : lifted43}) + } + 24 => { + + let result44 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted46 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result45 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result45) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result44, mime_type : lifted46}) + } + 25 => { + + let result47 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result47) + } + 26 => { + + let result48 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result48) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result49 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result49}) + } + 30 => { + + let result50 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result50, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array52.push(lifted51) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + Option::Some(@types.SchemaValueTree::{value_nodes : array52, root : mbt_ffi_load32((iter_base) + 92)}) + } + _ => panic() + } + + let lifted56 : String? = match mbt_ffi_load8_u((iter_base) + 100) { + 0 => Option::None + 1 => { + + let result55 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 104), mbt_ffi_load32((iter_base) + 108)) + + Option::Some(result55) + } + _ => panic() + } + + array57.push(@common.OptionSpec::{long : result8, short : lifted, aliases : array10, doc : @common.Doc::{summary : result12, description : result13, examples : array16}, value_name : lifted19, shape : lifted22, default : lifted54, required : (mbt_ffi_load8_u((iter_base) + 96) != 0), env_var : lifted56}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let array74 : Array[@common.FlagSpec] = []; + for index75 = 0; index75 < (mbt_ffi_load32((iter_base) + 52)); index75 = index75 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index75 * 72) + + let result59 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted60 : Char? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } + + let array62 : Array[String] = []; + for index63 = 0; index63 < (mbt_ffi_load32((iter_base) + 20)); index63 = index63 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index63 * 8) + + let result61 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array62.push(result61) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let result64 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let result65 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let array68 : Array[@common.Example] = []; + for index69 = 0; index69 < (mbt_ffi_load32((iter_base) + 44)); index69 = index69 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index69 * 16) + + let result66 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result67 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array68.push(@common.Example::{title : result66, body : result67}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let lifted71 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @common.FlagShape::BoolFlag(@common.BoolFlagShape::{default : (mbt_ffi_load8_u((iter_base) + 52) != 0), negatable : (mbt_ffi_load8_u((iter_base) + 53) != 0)}) + } + 1 => { + + let lifted70 : UInt? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 56)).reinterpret_as_uint()) + } + _ => panic() + } + + @common.FlagShape::CountFlag(lifted70) + } + _ => panic() + } + + let lifted73 : String? = match mbt_ffi_load8_u((iter_base) + 60) { + 0 => Option::None + 1 => { + + let result72 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + Option::Some(result72) + } + _ => panic() + } + + array74.push(@common.FlagSpec::{long : result59, short : lifted60, aliases : array62, doc : @common.Doc::{summary : result64, description : result65, examples : array68}, shape : lifted71, env_var : lifted73}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array76 : Array[Int] = []; + for index77 = 0; index77 < (mbt_ffi_load32((iter_base) + 60)); index77 = index77 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index77 * 4) + + array76.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted544 : @common.CommandBody? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let array119 : Array[@common.Positional] = []; + for index120 = 0; index120 < (mbt_ffi_load32((iter_base) + 72)); index120 = index120 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index120 * 68) + + let result78 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result79 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result80 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let array83 : Array[@common.Example] = []; + for index84 = 0; index84 < (mbt_ffi_load32((iter_base) + 28)); index84 = index84 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index84 * 16) + + let result81 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result82 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array83.push(@common.Example::{title : result81, body : result82}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let lifted86 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result85 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result85) + } + _ => panic() + } + + let lifted118 : @types.SchemaValueTree? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + let array116 : Array[@types.SchemaValueNode] = []; + for index117 = 0; index117 < (mbt_ffi_load32((iter_base) + 56)); index117 = index117 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 52)) + (index117 * 32) + + let lifted115 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result87 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result87) + } + 13 => { + + let array88 : Array[Int] = []; + for index89 = 0; index89 < (mbt_ffi_load32((iter_base) + 12)); index89 = index89 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index89 * 4) + + array88.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array88) + } + 14 => { + + let lifted90 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted90}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array91 : Array[Bool] = []; + for index92 = 0; index92 < (mbt_ffi_load32((iter_base) + 12)); index92 = index92 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index92 * 1) + + array91.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array91) + } + 17 => { + + let array93 : Array[Int] = []; + for index94 = 0; index94 < (mbt_ffi_load32((iter_base) + 12)); index94 = index94 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index94 * 4) + + array93.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array93) + } + 18 => { + + let array95 : Array[Int] = []; + for index96 = 0; index96 < (mbt_ffi_load32((iter_base) + 12)); index96 = index96 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index96 * 4) + + array95.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array95) + } + 19 => { + + let array97 : Array[Int] = []; + for index98 = 0; index98 < (mbt_ffi_load32((iter_base) + 12)); index98 = index98 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index98 * 4) + + array97.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array97) + } + 20 => { + + let array99 : Array[@types.MapEntry] = []; + for index100 = 0; index100 < (mbt_ffi_load32((iter_base) + 12)); index100 = index100 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index100 * 8) + + array99.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array99) + } + 21 => { + + let lifted101 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted101) + } + 22 => { + + let lifted104 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted102 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted102) + } + 1 => { + + let lifted103 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted103) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted104) + } + 23 => { + + let result105 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted107 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result106 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result106) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result105, language : lifted107}) + } + 24 => { + + let result108 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted110 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result109 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result109) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result108, mime_type : lifted110}) + } + 25 => { + + let result111 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result111) + } + 26 => { + + let result112 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result112) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result113 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result113}) + } + 30 => { + + let result114 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result114, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array116.push(lifted115) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + Option::Some(@types.SchemaValueTree::{value_nodes : array116, root : mbt_ffi_load32((iter_base) + 60)}) + } + _ => panic() + } + + array119.push(@common.Positional::{name : result78, doc : @common.Doc::{summary : result79, description : result80, examples : array83}, value_name : lifted86, type_ : mbt_ffi_load32((iter_base) + 44), default : lifted118, required : (mbt_ffi_load8_u((iter_base) + 64) != 0), accepts_stdio : (mbt_ffi_load8_u((iter_base) + 65) != 0)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + let lifted133 : @common.TailPositional? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let result121 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 80), mbt_ffi_load32((iter_base) + 84)) + + let result122 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 88), mbt_ffi_load32((iter_base) + 92)) + + let result123 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 96), mbt_ffi_load32((iter_base) + 100)) + + let array126 : Array[@common.Example] = []; + for index127 = 0; index127 < (mbt_ffi_load32((iter_base) + 108)); index127 = index127 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 104)) + (index127 * 16) + + let result124 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result125 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array126.push(@common.Example::{title : result124, body : result125}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 104)) + + let lifted129 : String? = match mbt_ffi_load8_u((iter_base) + 112) { + 0 => Option::None + 1 => { + + let result128 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 116), mbt_ffi_load32((iter_base) + 120)) + + Option::Some(result128) + } + _ => panic() + } + + let lifted130 : UInt? = match mbt_ffi_load8_u((iter_base) + 132) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 136)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted132 : String? = match mbt_ffi_load8_u((iter_base) + 140) { + 0 => Option::None + 1 => { + + let result131 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 144), mbt_ffi_load32((iter_base) + 148)) + + Option::Some(result131) + } + _ => panic() + } + + Option::Some(@common.TailPositional::{name : result121, doc : @common.Doc::{summary : result122, description : result123, examples : array126}, value_name : lifted129, item_type : mbt_ffi_load32((iter_base) + 124), min : (mbt_ffi_load32((iter_base) + 128)).reinterpret_as_uint(), max : lifted130, separator : lifted132, verbatim : (mbt_ffi_load8_u((iter_base) + 152) != 0), accepts_stdio : (mbt_ffi_load8_u((iter_base) + 153) != 0)}) + } + _ => panic() + } + + let array184 : Array[@common.OptionSpec] = []; + for index185 = 0; index185 < (mbt_ffi_load32((iter_base) + 160)); index185 = index185 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 156)) + (index185 * 112) + + let result134 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted135 : Char? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } + + let array137 : Array[String] = []; + for index138 = 0; index138 < (mbt_ffi_load32((iter_base) + 20)); index138 = index138 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index138 * 8) + + let result136 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array137.push(result136) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let result139 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let result140 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let array143 : Array[@common.Example] = []; + for index144 = 0; index144 < (mbt_ffi_load32((iter_base) + 44)); index144 = index144 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index144 * 16) + + let result141 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result142 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array143.push(@common.Example::{title : result141, body : result142}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let lifted146 : String? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + let result145 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) + + Option::Some(result145) + } + _ => panic() + } + + let lifted149 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @common.OptionShape::Scalar(mbt_ffi_load32((iter_base) + 64)) + } + 1 => { + + @common.OptionShape::OptionalScalar(mbt_ffi_load32((iter_base) + 64)) + } + 2 => { + + let lifted147 = match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => { + + @common.Repetition::Repeated + } + 1 => { + + @common.Repetition::Delimited(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + 2 => { + + @common.Repetition::Either(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + _ => panic() + } + + @common.OptionShape::RepeatableList(@common.RepeatableListShape::{repetition : lifted147, item_type : mbt_ffi_load32((iter_base) + 72)}) + } + 3 => { + + let lifted148 = match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => { + + @common.Repetition::Repeated + } + 1 => { + + @common.Repetition::Delimited(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + 2 => { + + @common.Repetition::Either(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + _ => panic() + } + + @common.OptionShape::RepeatableMap(@common.RepeatableMapShape::{repetition : lifted148, map_type : mbt_ffi_load32((iter_base) + 72), duplicate_key_policy : @common.DuplicateKeyPolicy::from(mbt_ffi_load8_u((iter_base) + 76))}) + } + _ => panic() + } + + let lifted181 : @types.SchemaValueTree? = match mbt_ffi_load8_u((iter_base) + 80) { + 0 => Option::None + 1 => { + + let array179 : Array[@types.SchemaValueNode] = []; + for index180 = 0; index180 < (mbt_ffi_load32((iter_base) + 88)); index180 = index180 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 84)) + (index180 * 32) + + let lifted178 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result150) + } + 13 => { + + let array151 : Array[Int] = []; + for index152 = 0; index152 < (mbt_ffi_load32((iter_base) + 12)); index152 = index152 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index152 * 4) + + array151.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array151) + } + 14 => { + + let lifted153 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted153}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array154 : Array[Bool] = []; + for index155 = 0; index155 < (mbt_ffi_load32((iter_base) + 12)); index155 = index155 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index155 * 1) + + array154.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array154) + } + 17 => { + + let array156 : Array[Int] = []; + for index157 = 0; index157 < (mbt_ffi_load32((iter_base) + 12)); index157 = index157 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index157 * 4) + + array156.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array156) + } + 18 => { + + let array158 : Array[Int] = []; + for index159 = 0; index159 < (mbt_ffi_load32((iter_base) + 12)); index159 = index159 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index159 * 4) + + array158.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array158) + } + 19 => { + + let array160 : Array[Int] = []; + for index161 = 0; index161 < (mbt_ffi_load32((iter_base) + 12)); index161 = index161 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index161 * 4) + + array160.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array160) + } + 20 => { + + let array162 : Array[@types.MapEntry] = []; + for index163 = 0; index163 < (mbt_ffi_load32((iter_base) + 12)); index163 = index163 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index163 * 8) + + array162.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array162) + } + 21 => { + + let lifted164 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted164) + } + 22 => { + + let lifted167 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted165 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted165) + } + 1 => { + + let lifted166 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted166) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted167) + } + 23 => { + + let result168 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted170 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result169 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result169) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result168, language : lifted170}) + } + 24 => { + + let result171 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted173 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result172 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result172) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result171, mime_type : lifted173}) + } + 25 => { + + let result174 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result174) + } + 26 => { + + let result175 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result175) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result176 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result176}) + } + 30 => { + + let result177 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result177, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array179.push(lifted178) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + Option::Some(@types.SchemaValueTree::{value_nodes : array179, root : mbt_ffi_load32((iter_base) + 92)}) + } + _ => panic() + } + + let lifted183 : String? = match mbt_ffi_load8_u((iter_base) + 100) { + 0 => Option::None + 1 => { + + let result182 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 104), mbt_ffi_load32((iter_base) + 108)) + + Option::Some(result182) + } + _ => panic() + } + + array184.push(@common.OptionSpec::{long : result134, short : lifted135, aliases : array137, doc : @common.Doc::{summary : result139, description : result140, examples : array143}, value_name : lifted146, shape : lifted149, default : lifted181, required : (mbt_ffi_load8_u((iter_base) + 96) != 0), env_var : lifted183}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 156)) + + let array201 : Array[@common.FlagSpec] = []; + for index202 = 0; index202 < (mbt_ffi_load32((iter_base) + 168)); index202 = index202 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 164)) + (index202 * 72) + + let result186 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted187 : Char? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } + + let array189 : Array[String] = []; + for index190 = 0; index190 < (mbt_ffi_load32((iter_base) + 20)); index190 = index190 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index190 * 8) + + let result188 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array189.push(result188) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let result191 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let result192 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let array195 : Array[@common.Example] = []; + for index196 = 0; index196 < (mbt_ffi_load32((iter_base) + 44)); index196 = index196 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index196 * 16) + + let result193 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result194 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array195.push(@common.Example::{title : result193, body : result194}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let lifted198 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @common.FlagShape::BoolFlag(@common.BoolFlagShape::{default : (mbt_ffi_load8_u((iter_base) + 52) != 0), negatable : (mbt_ffi_load8_u((iter_base) + 53) != 0)}) + } + 1 => { + + let lifted197 : UInt? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 56)).reinterpret_as_uint()) + } + _ => panic() + } + + @common.FlagShape::CountFlag(lifted197) + } + _ => panic() + } + + let lifted200 : String? = match mbt_ffi_load8_u((iter_base) + 60) { + 0 => Option::None + 1 => { + + let result199 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + Option::Some(result199) + } + _ => panic() + } + + array201.push(@common.FlagSpec::{long : result186, short : lifted187, aliases : array189, doc : @common.Doc::{summary : result191, description : result192, examples : array195}, shape : lifted198, env_var : lifted200}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 164)) + + let array494 : Array[@common.Constraint] = []; + for index495 = 0; index495 < (mbt_ffi_load32((iter_base) + 176)); index495 = index495 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 172)) + (index495 * 28) + + let lifted493 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let array237 : Array[@common.Ref] = []; + for index238 = 0; index238 < (mbt_ffi_load32((iter_base) + 8)); index238 = index238 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index238 * 24) + + let lifted236 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result203 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result203) + } + 1 => { + + let result204 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array234 : Array[@types.SchemaValueNode] = []; + for index235 = 0; index235 < (mbt_ffi_load32((iter_base) + 16)); index235 = index235 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index235 * 32) + + let lifted233 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result205 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result205) + } + 13 => { + + let array206 : Array[Int] = []; + for index207 = 0; index207 < (mbt_ffi_load32((iter_base) + 12)); index207 = index207 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index207 * 4) + + array206.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array206) + } + 14 => { + + let lifted208 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted208}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array209 : Array[Bool] = []; + for index210 = 0; index210 < (mbt_ffi_load32((iter_base) + 12)); index210 = index210 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index210 * 1) + + array209.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array209) + } + 17 => { + + let array211 : Array[Int] = []; + for index212 = 0; index212 < (mbt_ffi_load32((iter_base) + 12)); index212 = index212 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index212 * 4) + + array211.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array211) + } + 18 => { + + let array213 : Array[Int] = []; + for index214 = 0; index214 < (mbt_ffi_load32((iter_base) + 12)); index214 = index214 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index214 * 4) + + array213.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array213) + } + 19 => { + + let array215 : Array[Int] = []; + for index216 = 0; index216 < (mbt_ffi_load32((iter_base) + 12)); index216 = index216 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index216 * 4) + + array215.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array215) + } + 20 => { + + let array217 : Array[@types.MapEntry] = []; + for index218 = 0; index218 < (mbt_ffi_load32((iter_base) + 12)); index218 = index218 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index218 * 8) + + array217.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array217) + } + 21 => { + + let lifted219 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted219) + } + 22 => { + + let lifted222 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted220 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted220) + } + 1 => { + + let lifted221 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted221) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted222) + } + 23 => { + + let result223 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted225 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result224 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result224) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result223, language : lifted225}) + } + 24 => { + + let result226 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted228 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result227 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result227) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result226, mime_type : lifted228}) + } + 25 => { + + let result229 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result229) + } + 26 => { + + let result230 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result230) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result231 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result231}) + } + 30 => { + + let result232 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result232, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array234.push(lifted233) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result204, value : @types.SchemaValueTree::{value_nodes : array234, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array237.push(lifted236) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + @common.Constraint::RequiresAll(array237) + } + 1 => { + + let array273 : Array[@common.Ref] = []; + for index274 = 0; index274 < (mbt_ffi_load32((iter_base) + 8)); index274 = index274 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index274 * 24) + + let lifted272 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result239 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result239) + } + 1 => { + + let result240 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array270 : Array[@types.SchemaValueNode] = []; + for index271 = 0; index271 < (mbt_ffi_load32((iter_base) + 16)); index271 = index271 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index271 * 32) + + let lifted269 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result241 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result241) + } + 13 => { + + let array242 : Array[Int] = []; + for index243 = 0; index243 < (mbt_ffi_load32((iter_base) + 12)); index243 = index243 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index243 * 4) + + array242.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array242) + } + 14 => { + + let lifted244 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted244}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array245 : Array[Bool] = []; + for index246 = 0; index246 < (mbt_ffi_load32((iter_base) + 12)); index246 = index246 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index246 * 1) + + array245.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array245) + } + 17 => { + + let array247 : Array[Int] = []; + for index248 = 0; index248 < (mbt_ffi_load32((iter_base) + 12)); index248 = index248 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index248 * 4) + + array247.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array247) + } + 18 => { + + let array249 : Array[Int] = []; + for index250 = 0; index250 < (mbt_ffi_load32((iter_base) + 12)); index250 = index250 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index250 * 4) + + array249.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array249) + } + 19 => { + + let array251 : Array[Int] = []; + for index252 = 0; index252 < (mbt_ffi_load32((iter_base) + 12)); index252 = index252 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index252 * 4) + + array251.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array251) + } + 20 => { + + let array253 : Array[@types.MapEntry] = []; + for index254 = 0; index254 < (mbt_ffi_load32((iter_base) + 12)); index254 = index254 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index254 * 8) + + array253.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array253) + } + 21 => { + + let lifted255 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted255) + } + 22 => { + + let lifted258 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted256 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted256) + } + 1 => { + + let lifted257 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted257) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted258) + } + 23 => { + + let result259 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted261 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result260 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result260) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result259, language : lifted261}) + } + 24 => { + + let result262 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted264 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result263 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result263) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result262, mime_type : lifted264}) + } + 25 => { + + let result265 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result265) + } + 26 => { + + let result266 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result266) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result267 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result267}) + } + 30 => { + + let result268 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result268, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array270.push(lifted269) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result240, value : @types.SchemaValueTree::{value_nodes : array270, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array273.push(lifted272) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + @common.Constraint::AllOrNone(array273) + } + 2 => { + + let array309 : Array[@common.Ref] = []; + for index310 = 0; index310 < (mbt_ffi_load32((iter_base) + 8)); index310 = index310 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index310 * 24) + + let lifted308 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result275 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result275) + } + 1 => { + + let result276 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array306 : Array[@types.SchemaValueNode] = []; + for index307 = 0; index307 < (mbt_ffi_load32((iter_base) + 16)); index307 = index307 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index307 * 32) + + let lifted305 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result277 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result277) + } + 13 => { + + let array278 : Array[Int] = []; + for index279 = 0; index279 < (mbt_ffi_load32((iter_base) + 12)); index279 = index279 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index279 * 4) + + array278.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array278) + } + 14 => { + + let lifted280 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted280}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array281 : Array[Bool] = []; + for index282 = 0; index282 < (mbt_ffi_load32((iter_base) + 12)); index282 = index282 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index282 * 1) + + array281.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array281) + } + 17 => { + + let array283 : Array[Int] = []; + for index284 = 0; index284 < (mbt_ffi_load32((iter_base) + 12)); index284 = index284 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index284 * 4) + + array283.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array283) + } + 18 => { + + let array285 : Array[Int] = []; + for index286 = 0; index286 < (mbt_ffi_load32((iter_base) + 12)); index286 = index286 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index286 * 4) + + array285.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array285) + } + 19 => { + + let array287 : Array[Int] = []; + for index288 = 0; index288 < (mbt_ffi_load32((iter_base) + 12)); index288 = index288 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index288 * 4) + + array287.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array287) + } + 20 => { + + let array289 : Array[@types.MapEntry] = []; + for index290 = 0; index290 < (mbt_ffi_load32((iter_base) + 12)); index290 = index290 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index290 * 8) + + array289.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array289) + } + 21 => { + + let lifted291 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted291) + } + 22 => { + + let lifted294 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted292 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted292) + } + 1 => { + + let lifted293 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted293) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted294) + } + 23 => { + + let result295 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted297 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result296 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result296) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result295, language : lifted297}) + } + 24 => { + + let result298 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted300 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result299 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result299) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result298, mime_type : lifted300}) + } + 25 => { + + let result301 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result301) + } + 26 => { + + let result302 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result302) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result303 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result303}) + } + 30 => { + + let result304 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result304, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array306.push(lifted305) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result276, value : @types.SchemaValueTree::{value_nodes : array306, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array309.push(lifted308) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + @common.Constraint::RequiresAny(array309) + } + 3 => { + + let array347 : Array[@common.RefGroup] = []; + for index348 = 0; index348 < (mbt_ffi_load32((iter_base) + 8)); index348 = index348 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index348 * 8) + + let array345 : Array[@common.Ref] = []; + for index346 = 0; index346 < (mbt_ffi_load32((iter_base) + 4)); index346 = index346 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index346 * 24) + + let lifted344 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result311 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result311) + } + 1 => { + + let result312 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array342 : Array[@types.SchemaValueNode] = []; + for index343 = 0; index343 < (mbt_ffi_load32((iter_base) + 16)); index343 = index343 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index343 * 32) + + let lifted341 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result313 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result313) + } + 13 => { + + let array314 : Array[Int] = []; + for index315 = 0; index315 < (mbt_ffi_load32((iter_base) + 12)); index315 = index315 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index315 * 4) + + array314.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array314) + } + 14 => { + + let lifted316 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted316}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array317 : Array[Bool] = []; + for index318 = 0; index318 < (mbt_ffi_load32((iter_base) + 12)); index318 = index318 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index318 * 1) + + array317.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array317) + } + 17 => { + + let array319 : Array[Int] = []; + for index320 = 0; index320 < (mbt_ffi_load32((iter_base) + 12)); index320 = index320 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index320 * 4) + + array319.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array319) + } + 18 => { + + let array321 : Array[Int] = []; + for index322 = 0; index322 < (mbt_ffi_load32((iter_base) + 12)); index322 = index322 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index322 * 4) + + array321.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array321) + } + 19 => { + + let array323 : Array[Int] = []; + for index324 = 0; index324 < (mbt_ffi_load32((iter_base) + 12)); index324 = index324 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index324 * 4) + + array323.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array323) + } + 20 => { + + let array325 : Array[@types.MapEntry] = []; + for index326 = 0; index326 < (mbt_ffi_load32((iter_base) + 12)); index326 = index326 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index326 * 8) + + array325.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array325) + } + 21 => { + + let lifted327 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted327) + } + 22 => { + + let lifted330 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted328 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted328) + } + 1 => { + + let lifted329 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted329) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted330) + } + 23 => { + + let result331 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted333 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result332 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result332) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result331, language : lifted333}) + } + 24 => { + + let result334 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted336 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result335 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result335) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result334, mime_type : lifted336}) + } + 25 => { + + let result337 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result337) + } + 26 => { + + let result338 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result338) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result339 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result339}) + } + 30 => { + + let result340 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result340, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array342.push(lifted341) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result312, value : @types.SchemaValueTree::{value_nodes : array342, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array345.push(lifted344) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array347.push(@common.RefGroup::{refs : array345}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + @common.Constraint::MutexGroups(array347) + } + 4 => { + + let array383 : Array[@common.Ref] = []; + for index384 = 0; index384 < (mbt_ffi_load32((iter_base) + 12)); index384 = index384 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index384 * 24) + + let lifted382 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result349 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result349) + } + 1 => { + + let result350 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array380 : Array[@types.SchemaValueNode] = []; + for index381 = 0; index381 < (mbt_ffi_load32((iter_base) + 16)); index381 = index381 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index381 * 32) + + let lifted379 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result351 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result351) + } + 13 => { + + let array352 : Array[Int] = []; + for index353 = 0; index353 < (mbt_ffi_load32((iter_base) + 12)); index353 = index353 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index353 * 4) + + array352.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array352) + } + 14 => { + + let lifted354 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted354}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array355 : Array[Bool] = []; + for index356 = 0; index356 < (mbt_ffi_load32((iter_base) + 12)); index356 = index356 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index356 * 1) + + array355.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array355) + } + 17 => { + + let array357 : Array[Int] = []; + for index358 = 0; index358 < (mbt_ffi_load32((iter_base) + 12)); index358 = index358 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index358 * 4) + + array357.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array357) + } + 18 => { + + let array359 : Array[Int] = []; + for index360 = 0; index360 < (mbt_ffi_load32((iter_base) + 12)); index360 = index360 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index360 * 4) + + array359.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array359) + } + 19 => { + + let array361 : Array[Int] = []; + for index362 = 0; index362 < (mbt_ffi_load32((iter_base) + 12)); index362 = index362 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index362 * 4) + + array361.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array361) + } + 20 => { + + let array363 : Array[@types.MapEntry] = []; + for index364 = 0; index364 < (mbt_ffi_load32((iter_base) + 12)); index364 = index364 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index364 * 8) + + array363.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array363) + } + 21 => { + + let lifted365 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted365) + } + 22 => { + + let lifted368 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted366 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted366) + } + 1 => { + + let lifted367 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted367) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted368) + } + 23 => { + + let result369 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted371 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result370 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result370) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result369, language : lifted371}) + } + 24 => { + + let result372 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted374 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result373 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result373) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result372, mime_type : lifted374}) + } + 25 => { + + let result375 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result375) + } + 26 => { + + let result376 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result376) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result377 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result377}) + } + 30 => { + + let result378 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result378, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array380.push(lifted379) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result350, value : @types.SchemaValueTree::{value_nodes : array380, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array383.push(lifted382) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + let array419 : Array[@common.Ref] = []; + for index420 = 0; index420 < (mbt_ffi_load32((iter_base) + 24)); index420 = index420 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index420 * 24) + + let lifted418 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result385 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result385) + } + 1 => { + + let result386 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array416 : Array[@types.SchemaValueNode] = []; + for index417 = 0; index417 < (mbt_ffi_load32((iter_base) + 16)); index417 = index417 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index417 * 32) + + let lifted415 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result387 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result387) + } + 13 => { + + let array388 : Array[Int] = []; + for index389 = 0; index389 < (mbt_ffi_load32((iter_base) + 12)); index389 = index389 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index389 * 4) + + array388.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array388) + } + 14 => { + + let lifted390 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted390}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array391 : Array[Bool] = []; + for index392 = 0; index392 < (mbt_ffi_load32((iter_base) + 12)); index392 = index392 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index392 * 1) + + array391.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array391) + } + 17 => { + + let array393 : Array[Int] = []; + for index394 = 0; index394 < (mbt_ffi_load32((iter_base) + 12)); index394 = index394 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index394 * 4) + + array393.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array393) + } + 18 => { + + let array395 : Array[Int] = []; + for index396 = 0; index396 < (mbt_ffi_load32((iter_base) + 12)); index396 = index396 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index396 * 4) + + array395.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array395) + } + 19 => { + + let array397 : Array[Int] = []; + for index398 = 0; index398 < (mbt_ffi_load32((iter_base) + 12)); index398 = index398 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index398 * 4) + + array397.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array397) + } + 20 => { + + let array399 : Array[@types.MapEntry] = []; + for index400 = 0; index400 < (mbt_ffi_load32((iter_base) + 12)); index400 = index400 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index400 * 8) + + array399.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array399) + } + 21 => { + + let lifted401 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted401) + } + 22 => { + + let lifted404 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted402 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted402) + } + 1 => { + + let lifted403 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted403) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted404) + } + 23 => { + + let result405 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted407 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result406 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result406) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result405, language : lifted407}) + } + 24 => { + + let result408 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted410 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result409 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result409) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result408, mime_type : lifted410}) + } + 25 => { + + let result411 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result411) + } + 26 => { + + let result412 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result412) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result413 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result413}) + } + 30 => { + + let result414 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result414, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array416.push(lifted415) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result386, value : @types.SchemaValueTree::{value_nodes : array416, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array419.push(lifted418) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + @common.Constraint::Implies(@common.ImpliesC::{lhs_quant : @common.Quantifier::from(mbt_ffi_load8_u((iter_base) + 4)), lhs : array383, rhs_quant : @common.Quantifier::from(mbt_ffi_load8_u((iter_base) + 16)), rhs : array419}) + } + 5 => { + + let array455 : Array[@common.Ref] = []; + for index456 = 0; index456 < (mbt_ffi_load32((iter_base) + 12)); index456 = index456 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index456 * 24) + + let lifted454 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result421 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result421) + } + 1 => { + + let result422 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array452 : Array[@types.SchemaValueNode] = []; + for index453 = 0; index453 < (mbt_ffi_load32((iter_base) + 16)); index453 = index453 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index453 * 32) + + let lifted451 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result423 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result423) + } + 13 => { + + let array424 : Array[Int] = []; + for index425 = 0; index425 < (mbt_ffi_load32((iter_base) + 12)); index425 = index425 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index425 * 4) + + array424.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array424) + } + 14 => { + + let lifted426 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted426}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array427 : Array[Bool] = []; + for index428 = 0; index428 < (mbt_ffi_load32((iter_base) + 12)); index428 = index428 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index428 * 1) + + array427.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array427) + } + 17 => { + + let array429 : Array[Int] = []; + for index430 = 0; index430 < (mbt_ffi_load32((iter_base) + 12)); index430 = index430 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index430 * 4) + + array429.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array429) + } + 18 => { + + let array431 : Array[Int] = []; + for index432 = 0; index432 < (mbt_ffi_load32((iter_base) + 12)); index432 = index432 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index432 * 4) + + array431.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array431) + } + 19 => { + + let array433 : Array[Int] = []; + for index434 = 0; index434 < (mbt_ffi_load32((iter_base) + 12)); index434 = index434 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index434 * 4) + + array433.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array433) + } + 20 => { + + let array435 : Array[@types.MapEntry] = []; + for index436 = 0; index436 < (mbt_ffi_load32((iter_base) + 12)); index436 = index436 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index436 * 8) + + array435.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array435) + } + 21 => { + + let lifted437 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted437) + } + 22 => { + + let lifted440 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted438 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted438) + } + 1 => { + + let lifted439 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted439) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted440) + } + 23 => { + + let result441 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted443 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result442 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result442) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result441, language : lifted443}) + } + 24 => { + + let result444 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted446 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result445 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result445) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result444, mime_type : lifted446}) + } + 25 => { + + let result447 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result447) + } + 26 => { + + let result448 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result448) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result449 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result449}) + } + 30 => { + + let result450 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result450, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array452.push(lifted451) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result422, value : @types.SchemaValueTree::{value_nodes : array452, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array455.push(lifted454) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + let array491 : Array[@common.Ref] = []; + for index492 = 0; index492 < (mbt_ffi_load32((iter_base) + 20)); index492 = index492 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index492 * 24) + + let lifted490 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result457 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result457) + } + 1 => { + + let result458 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array488 : Array[@types.SchemaValueNode] = []; + for index489 = 0; index489 < (mbt_ffi_load32((iter_base) + 16)); index489 = index489 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index489 * 32) + + let lifted487 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result459 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result459) + } + 13 => { + + let array460 : Array[Int] = []; + for index461 = 0; index461 < (mbt_ffi_load32((iter_base) + 12)); index461 = index461 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index461 * 4) + + array460.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array460) + } + 14 => { + + let lifted462 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted462}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array463 : Array[Bool] = []; + for index464 = 0; index464 < (mbt_ffi_load32((iter_base) + 12)); index464 = index464 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index464 * 1) + + array463.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array463) + } + 17 => { + + let array465 : Array[Int] = []; + for index466 = 0; index466 < (mbt_ffi_load32((iter_base) + 12)); index466 = index466 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index466 * 4) + + array465.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array465) + } + 18 => { + + let array467 : Array[Int] = []; + for index468 = 0; index468 < (mbt_ffi_load32((iter_base) + 12)); index468 = index468 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index468 * 4) + + array467.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array467) + } + 19 => { + + let array469 : Array[Int] = []; + for index470 = 0; index470 < (mbt_ffi_load32((iter_base) + 12)); index470 = index470 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index470 * 4) + + array469.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array469) + } + 20 => { + + let array471 : Array[@types.MapEntry] = []; + for index472 = 0; index472 < (mbt_ffi_load32((iter_base) + 12)); index472 = index472 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index472 * 8) + + array471.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array471) + } + 21 => { + + let lifted473 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted473) + } + 22 => { + + let lifted476 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted474 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted474) + } + 1 => { + + let lifted475 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted475) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted476) + } + 23 => { + + let result477 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted479 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result478 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result478) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result477, language : lifted479}) + } + 24 => { + + let result480 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted482 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result481 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result481) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result480, mime_type : lifted482}) + } + 25 => { + + let result483 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result483) + } + 26 => { + + let result484 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result484) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result485 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result485}) + } + 30 => { + + let result486 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result486, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array488.push(lifted487) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result458, value : @types.SchemaValueTree::{value_nodes : array488, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array491.push(lifted490) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + @common.Constraint::Forbids(@common.ForbidsC::{lhs_quant : @common.Quantifier::from(mbt_ffi_load8_u((iter_base) + 4)), lhs : array455, rhs : array491}) + } + _ => panic() + } + + array494.push(lifted493) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 172)) + + let lifted505 : @common.StreamSpec? = match mbt_ffi_load8_u((iter_base) + 180) { + 0 => Option::None + 1 => { + + let result496 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 184), mbt_ffi_load32((iter_base) + 188)) + + let result497 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 192), mbt_ffi_load32((iter_base) + 196)) + + let array500 : Array[@common.Example] = []; + for index501 = 0; index501 < (mbt_ffi_load32((iter_base) + 204)); index501 = index501 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 200)) + (index501 * 16) + + let result498 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result499 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array500.push(@common.Example::{title : result498, body : result499}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 200)) + + let array503 : Array[String] = []; + for index504 = 0; index504 < (mbt_ffi_load32((iter_base) + 212)); index504 = index504 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 208)) + (index504 * 8) + + let result502 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array503.push(result502) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 208)) + + Option::Some(@common.StreamSpec::{doc : @common.Doc::{summary : result496, description : result497, examples : array500}, mime : array503, required : (mbt_ffi_load8_u((iter_base) + 216) != 0)}) + } + _ => panic() + } + + let lifted515 : @common.StreamSpec? = match mbt_ffi_load8_u((iter_base) + 220) { + 0 => Option::None + 1 => { + + let result506 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 224), mbt_ffi_load32((iter_base) + 228)) + + let result507 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 232), mbt_ffi_load32((iter_base) + 236)) + + let array510 : Array[@common.Example] = []; + for index511 = 0; index511 < (mbt_ffi_load32((iter_base) + 244)); index511 = index511 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 240)) + (index511 * 16) + + let result508 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result509 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array510.push(@common.Example::{title : result508, body : result509}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 240)) + + let array513 : Array[String] = []; + for index514 = 0; index514 < (mbt_ffi_load32((iter_base) + 252)); index514 = index514 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 248)) + (index514 * 8) + + let result512 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array513.push(result512) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 248)) + + Option::Some(@common.StreamSpec::{doc : @common.Doc::{summary : result506, description : result507, examples : array510}, mime : array513, required : (mbt_ffi_load8_u((iter_base) + 256) != 0)}) + } + _ => panic() + } + + let lifted532 : @common.ResultSpec? = match mbt_ffi_load8_u((iter_base) + 260) { + 0 => Option::None + 1 => { + + let result516 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 268), mbt_ffi_load32((iter_base) + 272)) + + let result517 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 276), mbt_ffi_load32((iter_base) + 280)) + + let array520 : Array[@common.Example] = []; + for index521 = 0; index521 < (mbt_ffi_load32((iter_base) + 288)); index521 = index521 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 284)) + (index521 * 16) + + let result518 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result519 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array520.push(@common.Example::{title : result518, body : result519}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 284)) + + let array529 : Array[@common.Formatter] = []; + for index530 = 0; index530 < (mbt_ffi_load32((iter_base) + 296)); index530 = index530 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 292)) + (index530 * 32) + + let result522 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result523 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result524 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let array527 : Array[@common.Example] = []; + for index528 = 0; index528 < (mbt_ffi_load32((iter_base) + 28)); index528 = index528 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index528 * 16) + + let result525 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result526 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array527.push(@common.Example::{title : result525, body : result526}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + array529.push(@common.Formatter::{name : result522, doc : @common.Doc::{summary : result523, description : result524, examples : array527}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 292)) + + let result531 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 300), mbt_ffi_load32((iter_base) + 304)) + + Option::Some(@common.ResultSpec::{type_ : mbt_ffi_load32((iter_base) + 264), doc : @common.Doc::{summary : result516, description : result517, examples : array520}, formatters : array529, default_formatter : result531}) + } + _ => panic() + } + + let array541 : Array[@common.ErrorCase] = []; + for index542 = 0; index542 < (mbt_ffi_load32((iter_base) + 312)); index542 = index542 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 308)) + (index542 * 44) + + let result533 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result534 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result535 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let array538 : Array[@common.Example] = []; + for index539 = 0; index539 < (mbt_ffi_load32((iter_base) + 28)); index539 = index539 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index539 * 16) + + let result536 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result537 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array538.push(@common.Example::{title : result536, body : result537}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let lifted540 : Int? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 40)) + } + _ => panic() + } + + array541.push(@common.ErrorCase::{name : result533, doc : @common.Doc::{summary : result534, description : result535, examples : array538}, kind : @common.ErrorKind::from(mbt_ffi_load8_u((iter_base) + 32)), exit_code : (mbt_ffi_load8_u((iter_base) + 33)).to_byte(), payload : lifted540}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 308)) + + let lifted543 : @common.CommandAnnotations? = match mbt_ffi_load8_u((iter_base) + 316) { + 0 => Option::None + 1 => { + + Option::Some(@common.CommandAnnotations::{read_only : (mbt_ffi_load8_u((iter_base) + 317) != 0), destructive : (mbt_ffi_load8_u((iter_base) + 318) != 0), idempotent : (mbt_ffi_load8_u((iter_base) + 319) != 0), open_world : (mbt_ffi_load8_u((iter_base) + 320) != 0)}) + } + _ => panic() + } + + Option::Some(@common.CommandBody::{positionals : @common.Positionals::{fixed : array119, tail : lifted133}, options : array184, flags : array201, constraints : array494, stdin : lifted505, stdout : lifted515, result : lifted532, errors : array541, annotations : lifted543}) + } + _ => panic() + } + + array545.push(@common.CommandNode::{name : result0, aliases : array, doc : @common.Doc::{summary : result2, description : result3, examples : array6}, globals : @common.Globals::{options : array57, flags : array74}, subcommands : array76, body : lifted544}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + let array743 : Array[@types.SchemaTypeNode] = []; + for index744 = 0; index744 < (mbt_ffi_load32((iter_base) + 20)); index744 = index744 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index744 * 144) + + let lifted729 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted553 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted548 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted547 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted547) + } + _ => panic() + } + + let lifted550 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted549 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted549) + } + _ => panic() + } + + let lifted552 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result551 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result551) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted548, max : lifted550, unit : lifted552}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted553) + } + 3 => { + + let lifted560 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted555 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted554 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted554) + } + _ => panic() + } + + let lifted557 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted556 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted556) + } + _ => panic() + } + + let lifted559 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result558 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result558) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted555, max : lifted557, unit : lifted559}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted560) + } + 4 => { + + let lifted567 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted562 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted561 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted561) + } + _ => panic() + } + + let lifted564 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted563 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted563) + } + _ => panic() + } + + let lifted566 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result565 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result565) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted562, max : lifted564, unit : lifted566}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted567) + } + 5 => { + + let lifted574 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted569 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted568 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted568) + } + _ => panic() + } + + let lifted571 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted570 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted570) + } + _ => panic() + } + + let lifted573 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result572 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result572) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted569, max : lifted571, unit : lifted573}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted574) + } + 6 => { + + let lifted581 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted576 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted575 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted575) + } + _ => panic() + } + + let lifted578 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted577 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted577) + } + _ => panic() + } + + let lifted580 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result579 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result579) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted576, max : lifted578, unit : lifted580}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted581) + } + 7 => { + + let lifted588 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted583 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted582 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted582) + } + _ => panic() + } + + let lifted585 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted584 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted584) + } + _ => panic() + } + + let lifted587 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result586 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result586) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted583, max : lifted585, unit : lifted587}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted588) + } + 8 => { + + let lifted595 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted590 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted589 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted589) + } + _ => panic() + } + + let lifted592 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted591 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted591) + } + _ => panic() + } + + let lifted594 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result593 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result593) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted590, max : lifted592, unit : lifted594}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted595) + } + 9 => { + + let lifted602 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted597 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted596 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted596) + } + _ => panic() + } + + let lifted599 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted598 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted598) + } + _ => panic() + } + + let lifted601 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result600 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result600) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted597, max : lifted599, unit : lifted601}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted602) + } + 10 => { + + let lifted609 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted604 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted603 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted603) + } + _ => panic() + } + + let lifted606 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted605 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted605) + } + _ => panic() + } + + let lifted608 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result607 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result607) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted604, max : lifted606, unit : lifted608}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted609) + } + 11 => { + + let lifted616 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted611 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted610 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted610) + } + _ => panic() + } + + let lifted613 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted612 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted612) + } + _ => panic() + } + + let lifted615 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result614 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result614) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted611, max : lifted613, unit : lifted615}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted616) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array631 : Array[@types.NamedFieldType] = []; + for index632 = 0; index632 < (mbt_ffi_load32((iter_base) + 12)); index632 = index632 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index632 * 68) + + let result617 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted619 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result618 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result618) + } + _ => panic() + } + + let array621 : Array[String] = []; + for index622 = 0; index622 < (mbt_ffi_load32((iter_base) + 28)); index622 = index622 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index622 * 8) + + let result620 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array621.push(result620) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array624 : Array[String] = []; + for index625 = 0; index625 < (mbt_ffi_load32((iter_base) + 36)); index625 = index625 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index625 * 8) + + let result623 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array624.push(result623) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted627 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result626 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result626) + } + _ => panic() + } + + let lifted630 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted629 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result628 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result628) + } + _ => panic() + } + + Option::Some(lifted629) + } + _ => panic() + } + + array631.push(@types.NamedFieldType::{name : result617, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted619, aliases : array621, examples : array624, deprecated : lifted627, role : lifted630}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array631) + } + 15 => { + + let array648 : Array[@types.VariantCaseType] = []; + for index649 = 0; index649 < (mbt_ffi_load32((iter_base) + 12)); index649 = index649 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index649 * 72) + + let result633 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted634 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted636 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result635 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result635) + } + _ => panic() + } + + let array638 : Array[String] = []; + for index639 = 0; index639 < (mbt_ffi_load32((iter_base) + 32)); index639 = index639 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index639 * 8) + + let result637 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array638.push(result637) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array641 : Array[String] = []; + for index642 = 0; index642 < (mbt_ffi_load32((iter_base) + 40)); index642 = index642 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index642 * 8) + + let result640 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array641.push(result640) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted644 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result643 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result643) + } + _ => panic() + } + + let lifted647 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted646 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result645 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result645) + } + _ => panic() + } + + Option::Some(lifted646) + } + _ => panic() + } + + array648.push(@types.VariantCaseType::{name : result633, payload : lifted634, metadata : @types.MetadataEnvelope::{doc : lifted636, aliases : array638, examples : array641, deprecated : lifted644, role : lifted647}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array648) + } + 16 => { + + let array651 : Array[String] = []; + for index652 = 0; index652 < (mbt_ffi_load32((iter_base) + 12)); index652 = index652 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index652 * 8) + + let result650 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array651.push(result650) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array651) + } + 17 => { + + let array654 : Array[String] = []; + for index655 = 0; index655 < (mbt_ffi_load32((iter_base) + 12)); index655 = index655 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index655 * 8) + + let result653 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array654.push(result653) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array654) + } + 18 => { + + let array656 : Array[Int] = []; + for index657 = 0; index657 < (mbt_ffi_load32((iter_base) + 12)); index657 = index657 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index657 * 4) + + array656.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array656) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted658 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted659 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted658, err : lifted659}) + } + 24 => { + + let lifted663 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array661 : Array[String] = []; + for index662 = 0; index662 < (mbt_ffi_load32((iter_base) + 16)); index662 = index662 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index662 * 8) + + let result660 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array661.push(result660) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array661) + } + _ => panic() + } + + let lifted664 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted665 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted667 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result666 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result666) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted663, min_length : lifted664, max_length : lifted665, regex : lifted667}) + } + 25 => { + + let lifted671 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array669 : Array[String] = []; + for index670 = 0; index670 < (mbt_ffi_load32((iter_base) + 16)); index670 = index670 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index670 * 8) + + let result668 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array669.push(result668) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array669) + } + _ => panic() + } + + let lifted672 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted673 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted671, min_bytes : lifted672, max_bytes : lifted673}) + } + 26 => { + + let lifted677 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array675 : Array[String] = []; + for index676 = 0; index676 < (mbt_ffi_load32((iter_base) + 20)); index676 = index676 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index676 * 8) + + let result674 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array675.push(result674) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array675) + } + _ => panic() + } + + let lifted681 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array679 : Array[String] = []; + for index680 = 0; index680 < (mbt_ffi_load32((iter_base) + 32)); index680 = index680 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index680 * 8) + + let result678 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array679.push(result678) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array679) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted677, allowed_extensions : lifted681}) + } + 27 => { + + let lifted685 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array683 : Array[String] = []; + for index684 = 0; index684 < (mbt_ffi_load32((iter_base) + 16)); index684 = index684 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index684 * 8) + + let result682 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array683.push(result682) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array683) + } + _ => panic() + } + + let lifted689 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array687 : Array[String] = []; + for index688 = 0; index688 < (mbt_ffi_load32((iter_base) + 28)); index688 = index688 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index688 * 8) + + let result686 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array687.push(result686) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array687) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted685, allowed_hosts : lifted689}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result690 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array692 : Array[String] = []; + for index693 = 0; index693 < (mbt_ffi_load32((iter_base) + 20)); index693 = index693 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index693 * 8) + + let result691 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array692.push(result691) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted695 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result694 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result694}) + } + _ => panic() + } + + let lifted697 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result696 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result696}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result690, allowed_suffixes : array692, min : lifted695, max : lifted697}) + } + 31 => { + + let array721 : Array[@types.UnionBranch] = []; + for index722 = 0; index722 < (mbt_ffi_load32((iter_base) + 12)); index722 = index722 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index722 * 92) + + let result698 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted707 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result699 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result699) + } + 1 => { + + let result700 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result700) + } + 2 => { + + let result701 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result701) + } + 3 => { + + let result702 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result702) + } + 4 => { + + let result703 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted705 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result704 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result704) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result703, literal : lifted705}) + } + 5 => { + + let result706 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result706) + } + _ => panic() + } + + let lifted709 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result708 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result708) + } + _ => panic() + } + + let array711 : Array[String] = []; + for index712 = 0; index712 < (mbt_ffi_load32((iter_base) + 52)); index712 = index712 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index712 * 8) + + let result710 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array711.push(result710) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array714 : Array[String] = []; + for index715 = 0; index715 < (mbt_ffi_load32((iter_base) + 60)); index715 = index715 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index715 * 8) + + let result713 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array714.push(result713) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted717 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result716 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result716) + } + _ => panic() + } + + let lifted720 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted719 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result718 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result718) + } + _ => panic() + } + + Option::Some(lifted719) + } + _ => panic() + } + + array721.push(@types.UnionBranch::{tag : result698, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted707, metadata : @types.MetadataEnvelope::{doc : lifted709, aliases : array711, examples : array714, deprecated : lifted717, role : lifted720}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array721}) + } + 32 => { + + let lifted724 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result723 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result723) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted724}) + } + 33 => { + + let lifted726 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result725 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result725) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted726}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted727 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted727) + } + 36 => { + + let lifted728 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted728) + } + _ => panic() + } + + let lifted731 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result730 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result730) + } + _ => panic() + } + + let array733 : Array[String] = []; + for index734 = 0; index734 < (mbt_ffi_load32((iter_base) + 104)); index734 = index734 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index734 * 8) + + let result732 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array733.push(result732) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array736 : Array[String] = []; + for index737 = 0; index737 < (mbt_ffi_load32((iter_base) + 112)); index737 = index737 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index737 * 8) + + let result735 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array736.push(result735) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted739 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result738 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result738) + } + _ => panic() + } + + let lifted742 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted741 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result740 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result740) + } + _ => panic() + } + + Option::Some(lifted741) + } + _ => panic() + } + + array743.push(@types.SchemaTypeNode::{body : lifted729, metadata : @types.MetadataEnvelope::{doc : lifted731, aliases : array733, examples : array736, deprecated : lifted739, role : lifted742}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let array748 : Array[@types.SchemaTypeDef] = []; + for index749 = 0; index749 < (mbt_ffi_load32((iter_base) + 28)); index749 = index749 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index749 * 24) + + let result745 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted747 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result746 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result746) + } + _ => panic() + } + + array748.push(@types.SchemaTypeDef::{id : result745, name : lifted747, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + array750.push(RegisteredTool::{definition : @common.Tool::{version : result, commands : @common.CommandTree::{nodes : array545}, schema : @types.SchemaGraph::{type_nodes : array743, defs : array748, root : mbt_ffi_load32((iter_base) + 32)}}, implemented_by : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((iter_base) + 40)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((iter_base) + 48)).reinterpret_as_uint64()}}}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array750 + mbt_ffi_free(return_area) + return ret + +} +///| +/// Returns the registered tool with the given name iff the +/// calling agent has access to it (per the same per-env and +/// per-agent binding rules as `get-all-tools`). Returns `none` +/// either if the tool is not registered or if the calling agent +/// has no binding for it; the two cases are not distinguished. +pub fn get_tool(name : String) -> RegisteredTool? { + + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(64) + wasmImportGetTool(ptr, name.length(), return_area); + + let lifted750 : RegisteredTool? = match mbt_ffi_load8_u((return_area) + 0) { 0 => Option::None 1 => { - let lifted590 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted589 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted589) - } - _ => panic() - } - - let lifted592 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted591 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted591) - } - _ => panic() - } - - let lifted594 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result593 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result593) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted590, - max: lifted592, - unit: lifted594, - }) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + let array545 : Array[@common.CommandNode] = []; + for index546 = 0; index546 < (mbt_ffi_load32((return_area) + 20)); index546 = index546 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 16)) + (index546 * 324) + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 12)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index * 8) + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let array6 : Array[@common.Example] = []; + for index7 = 0; index7 < (mbt_ffi_load32((iter_base) + 36)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index7 * 16) + + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array6.push(@common.Example::{title : result4, body : result5}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let array57 : Array[@common.OptionSpec] = []; + for index58 = 0; index58 < (mbt_ffi_load32((iter_base) + 44)); index58 = index58 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index58 * 112) + + let result8 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted : Char? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } + + let array10 : Array[String] = []; + for index11 = 0; index11 < (mbt_ffi_load32((iter_base) + 20)); index11 = index11 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index11 * 8) + + let result9 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array10.push(result9) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let result12 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let result13 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let array16 : Array[@common.Example] = []; + for index17 = 0; index17 < (mbt_ffi_load32((iter_base) + 44)); index17 = index17 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index17 * 16) + + let result14 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array16.push(@common.Example::{title : result14, body : result15}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let lifted19 : String? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + let result18 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) + + Option::Some(result18) + } + _ => panic() + } + + let lifted22 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @common.OptionShape::Scalar(mbt_ffi_load32((iter_base) + 64)) + } + 1 => { + + @common.OptionShape::OptionalScalar(mbt_ffi_load32((iter_base) + 64)) + } + 2 => { + + let lifted20 = match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => { + + @common.Repetition::Repeated + } + 1 => { + + @common.Repetition::Delimited(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + 2 => { + + @common.Repetition::Either(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + _ => panic() + } + + @common.OptionShape::RepeatableList(@common.RepeatableListShape::{repetition : lifted20, item_type : mbt_ffi_load32((iter_base) + 72)}) + } + 3 => { + + let lifted21 = match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => { + + @common.Repetition::Repeated + } + 1 => { + + @common.Repetition::Delimited(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + 2 => { + + @common.Repetition::Either(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + _ => panic() + } + + @common.OptionShape::RepeatableMap(@common.RepeatableMapShape::{repetition : lifted21, map_type : mbt_ffi_load32((iter_base) + 72), duplicate_key_policy : @common.DuplicateKeyPolicy::from(mbt_ffi_load8_u((iter_base) + 76))}) + } + _ => panic() + } + + let lifted54 : @types.SchemaValueTree? = match mbt_ffi_load8_u((iter_base) + 80) { + 0 => Option::None + 1 => { + + let array52 : Array[@types.SchemaValueNode] = []; + for index53 = 0; index53 < (mbt_ffi_load32((iter_base) + 88)); index53 = index53 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 84)) + (index53 * 32) + + let lifted51 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result23) + } + 13 => { + + let array24 : Array[Int] = []; + for index25 = 0; index25 < (mbt_ffi_load32((iter_base) + 12)); index25 = index25 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index25 * 4) + + array24.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array24) + } + 14 => { + + let lifted26 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted26}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array27 : Array[Bool] = []; + for index28 = 0; index28 < (mbt_ffi_load32((iter_base) + 12)); index28 = index28 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index28 * 1) + + array27.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array27) + } + 17 => { + + let array29 : Array[Int] = []; + for index30 = 0; index30 < (mbt_ffi_load32((iter_base) + 12)); index30 = index30 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index30 * 4) + + array29.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array29) + } + 18 => { + + let array31 : Array[Int] = []; + for index32 = 0; index32 < (mbt_ffi_load32((iter_base) + 12)); index32 = index32 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index32 * 4) + + array31.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array31) + } + 19 => { + + let array33 : Array[Int] = []; + for index34 = 0; index34 < (mbt_ffi_load32((iter_base) + 12)); index34 = index34 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index34 * 4) + + array33.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array33) + } + 20 => { + + let array35 : Array[@types.MapEntry] = []; + for index36 = 0; index36 < (mbt_ffi_load32((iter_base) + 12)); index36 = index36 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index36 * 8) + + array35.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array35) + } + 21 => { + + let lifted37 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted37) + } + 22 => { + + let lifted40 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted38 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted38) + } + 1 => { + + let lifted39 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted39) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted40) + } + 23 => { + + let result41 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted43 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result42 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result42) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result41, language : lifted43}) + } + 24 => { + + let result44 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted46 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result45 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result45) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result44, mime_type : lifted46}) + } + 25 => { + + let result47 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result47) + } + 26 => { + + let result48 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result48) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result49 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result49}) + } + 30 => { + + let result50 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result50, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array52.push(lifted51) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + Option::Some(@types.SchemaValueTree::{value_nodes : array52, root : mbt_ffi_load32((iter_base) + 92)}) + } + _ => panic() + } + + let lifted56 : String? = match mbt_ffi_load8_u((iter_base) + 100) { + 0 => Option::None + 1 => { + + let result55 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 104), mbt_ffi_load32((iter_base) + 108)) + + Option::Some(result55) + } + _ => panic() + } + + array57.push(@common.OptionSpec::{long : result8, short : lifted, aliases : array10, doc : @common.Doc::{summary : result12, description : result13, examples : array16}, value_name : lifted19, shape : lifted22, default : lifted54, required : (mbt_ffi_load8_u((iter_base) + 96) != 0), env_var : lifted56}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let array74 : Array[@common.FlagSpec] = []; + for index75 = 0; index75 < (mbt_ffi_load32((iter_base) + 52)); index75 = index75 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index75 * 72) + + let result59 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted60 : Char? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } + + let array62 : Array[String] = []; + for index63 = 0; index63 < (mbt_ffi_load32((iter_base) + 20)); index63 = index63 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index63 * 8) + + let result61 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array62.push(result61) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let result64 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let result65 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let array68 : Array[@common.Example] = []; + for index69 = 0; index69 < (mbt_ffi_load32((iter_base) + 44)); index69 = index69 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index69 * 16) + + let result66 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result67 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array68.push(@common.Example::{title : result66, body : result67}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let lifted71 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @common.FlagShape::BoolFlag(@common.BoolFlagShape::{default : (mbt_ffi_load8_u((iter_base) + 52) != 0), negatable : (mbt_ffi_load8_u((iter_base) + 53) != 0)}) + } + 1 => { + + let lifted70 : UInt? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 56)).reinterpret_as_uint()) + } + _ => panic() + } + + @common.FlagShape::CountFlag(lifted70) + } + _ => panic() + } + + let lifted73 : String? = match mbt_ffi_load8_u((iter_base) + 60) { + 0 => Option::None + 1 => { + + let result72 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + Option::Some(result72) + } + _ => panic() + } + + array74.push(@common.FlagSpec::{long : result59, short : lifted60, aliases : array62, doc : @common.Doc::{summary : result64, description : result65, examples : array68}, shape : lifted71, env_var : lifted73}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array76 : Array[Int] = []; + for index77 = 0; index77 < (mbt_ffi_load32((iter_base) + 60)); index77 = index77 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index77 * 4) + + array76.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted544 : @common.CommandBody? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let array119 : Array[@common.Positional] = []; + for index120 = 0; index120 < (mbt_ffi_load32((iter_base) + 72)); index120 = index120 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 68)) + (index120 * 68) + + let result78 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result79 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result80 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let array83 : Array[@common.Example] = []; + for index84 = 0; index84 < (mbt_ffi_load32((iter_base) + 28)); index84 = index84 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index84 * 16) + + let result81 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result82 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array83.push(@common.Example::{title : result81, body : result82}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let lifted86 : String? = match mbt_ffi_load8_u((iter_base) + 32) { + 0 => Option::None + 1 => { + + let result85 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 36), mbt_ffi_load32((iter_base) + 40)) + + Option::Some(result85) + } + _ => panic() + } + + let lifted118 : @types.SchemaValueTree? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + let array116 : Array[@types.SchemaValueNode] = []; + for index117 = 0; index117 < (mbt_ffi_load32((iter_base) + 56)); index117 = index117 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 52)) + (index117 * 32) + + let lifted115 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result87 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result87) + } + 13 => { + + let array88 : Array[Int] = []; + for index89 = 0; index89 < (mbt_ffi_load32((iter_base) + 12)); index89 = index89 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index89 * 4) + + array88.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array88) + } + 14 => { + + let lifted90 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted90}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array91 : Array[Bool] = []; + for index92 = 0; index92 < (mbt_ffi_load32((iter_base) + 12)); index92 = index92 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index92 * 1) + + array91.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array91) + } + 17 => { + + let array93 : Array[Int] = []; + for index94 = 0; index94 < (mbt_ffi_load32((iter_base) + 12)); index94 = index94 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index94 * 4) + + array93.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array93) + } + 18 => { + + let array95 : Array[Int] = []; + for index96 = 0; index96 < (mbt_ffi_load32((iter_base) + 12)); index96 = index96 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index96 * 4) + + array95.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array95) + } + 19 => { + + let array97 : Array[Int] = []; + for index98 = 0; index98 < (mbt_ffi_load32((iter_base) + 12)); index98 = index98 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index98 * 4) + + array97.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array97) + } + 20 => { + + let array99 : Array[@types.MapEntry] = []; + for index100 = 0; index100 < (mbt_ffi_load32((iter_base) + 12)); index100 = index100 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index100 * 8) + + array99.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array99) + } + 21 => { + + let lifted101 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted101) + } + 22 => { + + let lifted104 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted102 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted102) + } + 1 => { + + let lifted103 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted103) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted104) + } + 23 => { + + let result105 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted107 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result106 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result106) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result105, language : lifted107}) + } + 24 => { + + let result108 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted110 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result109 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result109) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result108, mime_type : lifted110}) + } + 25 => { + + let result111 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result111) + } + 26 => { + + let result112 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result112) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result113 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result113}) + } + 30 => { + + let result114 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result114, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array116.push(lifted115) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 52)) + + Option::Some(@types.SchemaValueTree::{value_nodes : array116, root : mbt_ffi_load32((iter_base) + 60)}) + } + _ => panic() + } + + array119.push(@common.Positional::{name : result78, doc : @common.Doc::{summary : result79, description : result80, examples : array83}, value_name : lifted86, type_ : mbt_ffi_load32((iter_base) + 44), default : lifted118, required : (mbt_ffi_load8_u((iter_base) + 64) != 0), accepts_stdio : (mbt_ffi_load8_u((iter_base) + 65) != 0)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + let lifted133 : @common.TailPositional? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let result121 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 80), mbt_ffi_load32((iter_base) + 84)) + + let result122 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 88), mbt_ffi_load32((iter_base) + 92)) + + let result123 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 96), mbt_ffi_load32((iter_base) + 100)) + + let array126 : Array[@common.Example] = []; + for index127 = 0; index127 < (mbt_ffi_load32((iter_base) + 108)); index127 = index127 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 104)) + (index127 * 16) + + let result124 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result125 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array126.push(@common.Example::{title : result124, body : result125}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 104)) + + let lifted129 : String? = match mbt_ffi_load8_u((iter_base) + 112) { + 0 => Option::None + 1 => { + + let result128 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 116), mbt_ffi_load32((iter_base) + 120)) + + Option::Some(result128) + } + _ => panic() + } + + let lifted130 : UInt? = match mbt_ffi_load8_u((iter_base) + 132) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 136)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted132 : String? = match mbt_ffi_load8_u((iter_base) + 140) { + 0 => Option::None + 1 => { + + let result131 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 144), mbt_ffi_load32((iter_base) + 148)) + + Option::Some(result131) + } + _ => panic() + } + + Option::Some(@common.TailPositional::{name : result121, doc : @common.Doc::{summary : result122, description : result123, examples : array126}, value_name : lifted129, item_type : mbt_ffi_load32((iter_base) + 124), min : (mbt_ffi_load32((iter_base) + 128)).reinterpret_as_uint(), max : lifted130, separator : lifted132, verbatim : (mbt_ffi_load8_u((iter_base) + 152) != 0), accepts_stdio : (mbt_ffi_load8_u((iter_base) + 153) != 0)}) + } + _ => panic() + } + + let array184 : Array[@common.OptionSpec] = []; + for index185 = 0; index185 < (mbt_ffi_load32((iter_base) + 160)); index185 = index185 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 156)) + (index185 * 112) + + let result134 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted135 : Char? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } + + let array137 : Array[String] = []; + for index138 = 0; index138 < (mbt_ffi_load32((iter_base) + 20)); index138 = index138 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index138 * 8) + + let result136 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array137.push(result136) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let result139 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let result140 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let array143 : Array[@common.Example] = []; + for index144 = 0; index144 < (mbt_ffi_load32((iter_base) + 44)); index144 = index144 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index144 * 16) + + let result141 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result142 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array143.push(@common.Example::{title : result141, body : result142}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let lifted146 : String? = match mbt_ffi_load8_u((iter_base) + 48) { + 0 => Option::None + 1 => { + + let result145 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 52), mbt_ffi_load32((iter_base) + 56)) + + Option::Some(result145) + } + _ => panic() + } + + let lifted149 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @common.OptionShape::Scalar(mbt_ffi_load32((iter_base) + 64)) + } + 1 => { + + @common.OptionShape::OptionalScalar(mbt_ffi_load32((iter_base) + 64)) + } + 2 => { + + let lifted147 = match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => { + + @common.Repetition::Repeated + } + 1 => { + + @common.Repetition::Delimited(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + 2 => { + + @common.Repetition::Either(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + _ => panic() + } + + @common.OptionShape::RepeatableList(@common.RepeatableListShape::{repetition : lifted147, item_type : mbt_ffi_load32((iter_base) + 72)}) + } + 3 => { + + let lifted148 = match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => { + + @common.Repetition::Repeated + } + 1 => { + + @common.Repetition::Delimited(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + 2 => { + + @common.Repetition::Either(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 68))) + } + _ => panic() + } + + @common.OptionShape::RepeatableMap(@common.RepeatableMapShape::{repetition : lifted148, map_type : mbt_ffi_load32((iter_base) + 72), duplicate_key_policy : @common.DuplicateKeyPolicy::from(mbt_ffi_load8_u((iter_base) + 76))}) + } + _ => panic() + } + + let lifted181 : @types.SchemaValueTree? = match mbt_ffi_load8_u((iter_base) + 80) { + 0 => Option::None + 1 => { + + let array179 : Array[@types.SchemaValueNode] = []; + for index180 = 0; index180 < (mbt_ffi_load32((iter_base) + 88)); index180 = index180 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 84)) + (index180 * 32) + + let lifted178 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result150) + } + 13 => { + + let array151 : Array[Int] = []; + for index152 = 0; index152 < (mbt_ffi_load32((iter_base) + 12)); index152 = index152 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index152 * 4) + + array151.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array151) + } + 14 => { + + let lifted153 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted153}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array154 : Array[Bool] = []; + for index155 = 0; index155 < (mbt_ffi_load32((iter_base) + 12)); index155 = index155 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index155 * 1) + + array154.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array154) + } + 17 => { + + let array156 : Array[Int] = []; + for index157 = 0; index157 < (mbt_ffi_load32((iter_base) + 12)); index157 = index157 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index157 * 4) + + array156.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array156) + } + 18 => { + + let array158 : Array[Int] = []; + for index159 = 0; index159 < (mbt_ffi_load32((iter_base) + 12)); index159 = index159 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index159 * 4) + + array158.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array158) + } + 19 => { + + let array160 : Array[Int] = []; + for index161 = 0; index161 < (mbt_ffi_load32((iter_base) + 12)); index161 = index161 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index161 * 4) + + array160.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array160) + } + 20 => { + + let array162 : Array[@types.MapEntry] = []; + for index163 = 0; index163 < (mbt_ffi_load32((iter_base) + 12)); index163 = index163 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index163 * 8) + + array162.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array162) + } + 21 => { + + let lifted164 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted164) + } + 22 => { + + let lifted167 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted165 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted165) + } + 1 => { + + let lifted166 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted166) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted167) + } + 23 => { + + let result168 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted170 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result169 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result169) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result168, language : lifted170}) + } + 24 => { + + let result171 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted173 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result172 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result172) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result171, mime_type : lifted173}) + } + 25 => { + + let result174 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result174) + } + 26 => { + + let result175 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result175) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result176 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result176}) + } + 30 => { + + let result177 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result177, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array179.push(lifted178) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + Option::Some(@types.SchemaValueTree::{value_nodes : array179, root : mbt_ffi_load32((iter_base) + 92)}) + } + _ => panic() + } + + let lifted183 : String? = match mbt_ffi_load8_u((iter_base) + 100) { + 0 => Option::None + 1 => { + + let result182 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 104), mbt_ffi_load32((iter_base) + 108)) + + Option::Some(result182) + } + _ => panic() + } + + array184.push(@common.OptionSpec::{long : result134, short : lifted135, aliases : array137, doc : @common.Doc::{summary : result139, description : result140, examples : array143}, value_name : lifted146, shape : lifted149, default : lifted181, required : (mbt_ffi_load8_u((iter_base) + 96) != 0), env_var : lifted183}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 156)) + + let array201 : Array[@common.FlagSpec] = []; + for index202 = 0; index202 < (mbt_ffi_load32((iter_base) + 168)); index202 = index202 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 164)) + (index202 * 72) + + let result186 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted187 : Char? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 12))) + } + _ => panic() + } + + let array189 : Array[String] = []; + for index190 = 0; index190 < (mbt_ffi_load32((iter_base) + 20)); index190 = index190 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index190 * 8) + + let result188 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array189.push(result188) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let result191 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 24), mbt_ffi_load32((iter_base) + 28)) + + let result192 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 32), mbt_ffi_load32((iter_base) + 36)) + + let array195 : Array[@common.Example] = []; + for index196 = 0; index196 < (mbt_ffi_load32((iter_base) + 44)); index196 = index196 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 40)) + (index196 * 16) + + let result193 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result194 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array195.push(@common.Example::{title : result193, body : result194}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + let lifted198 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @common.FlagShape::BoolFlag(@common.BoolFlagShape::{default : (mbt_ffi_load8_u((iter_base) + 52) != 0), negatable : (mbt_ffi_load8_u((iter_base) + 53) != 0)}) + } + 1 => { + + let lifted197 : UInt? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 56)).reinterpret_as_uint()) + } + _ => panic() + } + + @common.FlagShape::CountFlag(lifted197) + } + _ => panic() + } + + let lifted200 : String? = match mbt_ffi_load8_u((iter_base) + 60) { + 0 => Option::None + 1 => { + + let result199 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + Option::Some(result199) + } + _ => panic() + } + + array201.push(@common.FlagSpec::{long : result186, short : lifted187, aliases : array189, doc : @common.Doc::{summary : result191, description : result192, examples : array195}, shape : lifted198, env_var : lifted200}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 164)) + + let array494 : Array[@common.Constraint] = []; + for index495 = 0; index495 < (mbt_ffi_load32((iter_base) + 176)); index495 = index495 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 172)) + (index495 * 28) + + let lifted493 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let array237 : Array[@common.Ref] = []; + for index238 = 0; index238 < (mbt_ffi_load32((iter_base) + 8)); index238 = index238 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index238 * 24) + + let lifted236 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result203 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result203) + } + 1 => { + + let result204 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array234 : Array[@types.SchemaValueNode] = []; + for index235 = 0; index235 < (mbt_ffi_load32((iter_base) + 16)); index235 = index235 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index235 * 32) + + let lifted233 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result205 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result205) + } + 13 => { + + let array206 : Array[Int] = []; + for index207 = 0; index207 < (mbt_ffi_load32((iter_base) + 12)); index207 = index207 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index207 * 4) + + array206.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array206) + } + 14 => { + + let lifted208 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted208}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array209 : Array[Bool] = []; + for index210 = 0; index210 < (mbt_ffi_load32((iter_base) + 12)); index210 = index210 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index210 * 1) + + array209.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array209) + } + 17 => { + + let array211 : Array[Int] = []; + for index212 = 0; index212 < (mbt_ffi_load32((iter_base) + 12)); index212 = index212 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index212 * 4) + + array211.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array211) + } + 18 => { + + let array213 : Array[Int] = []; + for index214 = 0; index214 < (mbt_ffi_load32((iter_base) + 12)); index214 = index214 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index214 * 4) + + array213.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array213) + } + 19 => { + + let array215 : Array[Int] = []; + for index216 = 0; index216 < (mbt_ffi_load32((iter_base) + 12)); index216 = index216 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index216 * 4) + + array215.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array215) + } + 20 => { + + let array217 : Array[@types.MapEntry] = []; + for index218 = 0; index218 < (mbt_ffi_load32((iter_base) + 12)); index218 = index218 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index218 * 8) + + array217.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array217) + } + 21 => { + + let lifted219 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted219) + } + 22 => { + + let lifted222 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted220 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted220) + } + 1 => { + + let lifted221 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted221) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted222) + } + 23 => { + + let result223 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted225 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result224 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result224) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result223, language : lifted225}) + } + 24 => { + + let result226 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted228 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result227 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result227) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result226, mime_type : lifted228}) + } + 25 => { + + let result229 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result229) + } + 26 => { + + let result230 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result230) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result231 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result231}) + } + 30 => { + + let result232 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result232, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array234.push(lifted233) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result204, value : @types.SchemaValueTree::{value_nodes : array234, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array237.push(lifted236) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + @common.Constraint::RequiresAll(array237) + } + 1 => { + + let array273 : Array[@common.Ref] = []; + for index274 = 0; index274 < (mbt_ffi_load32((iter_base) + 8)); index274 = index274 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index274 * 24) + + let lifted272 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result239 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result239) + } + 1 => { + + let result240 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array270 : Array[@types.SchemaValueNode] = []; + for index271 = 0; index271 < (mbt_ffi_load32((iter_base) + 16)); index271 = index271 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index271 * 32) + + let lifted269 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result241 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result241) + } + 13 => { + + let array242 : Array[Int] = []; + for index243 = 0; index243 < (mbt_ffi_load32((iter_base) + 12)); index243 = index243 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index243 * 4) + + array242.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array242) + } + 14 => { + + let lifted244 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted244}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array245 : Array[Bool] = []; + for index246 = 0; index246 < (mbt_ffi_load32((iter_base) + 12)); index246 = index246 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index246 * 1) + + array245.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array245) + } + 17 => { + + let array247 : Array[Int] = []; + for index248 = 0; index248 < (mbt_ffi_load32((iter_base) + 12)); index248 = index248 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index248 * 4) + + array247.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array247) + } + 18 => { + + let array249 : Array[Int] = []; + for index250 = 0; index250 < (mbt_ffi_load32((iter_base) + 12)); index250 = index250 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index250 * 4) + + array249.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array249) + } + 19 => { + + let array251 : Array[Int] = []; + for index252 = 0; index252 < (mbt_ffi_load32((iter_base) + 12)); index252 = index252 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index252 * 4) + + array251.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array251) + } + 20 => { + + let array253 : Array[@types.MapEntry] = []; + for index254 = 0; index254 < (mbt_ffi_load32((iter_base) + 12)); index254 = index254 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index254 * 8) + + array253.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array253) + } + 21 => { + + let lifted255 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted255) + } + 22 => { + + let lifted258 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted256 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted256) + } + 1 => { + + let lifted257 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted257) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted258) + } + 23 => { + + let result259 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted261 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result260 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result260) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result259, language : lifted261}) + } + 24 => { + + let result262 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted264 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result263 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result263) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result262, mime_type : lifted264}) + } + 25 => { + + let result265 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result265) + } + 26 => { + + let result266 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result266) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result267 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result267}) + } + 30 => { + + let result268 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result268, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array270.push(lifted269) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result240, value : @types.SchemaValueTree::{value_nodes : array270, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array273.push(lifted272) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + @common.Constraint::AllOrNone(array273) + } + 2 => { + + let array309 : Array[@common.Ref] = []; + for index310 = 0; index310 < (mbt_ffi_load32((iter_base) + 8)); index310 = index310 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index310 * 24) + + let lifted308 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result275 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result275) + } + 1 => { + + let result276 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array306 : Array[@types.SchemaValueNode] = []; + for index307 = 0; index307 < (mbt_ffi_load32((iter_base) + 16)); index307 = index307 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index307 * 32) + + let lifted305 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result277 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result277) + } + 13 => { + + let array278 : Array[Int] = []; + for index279 = 0; index279 < (mbt_ffi_load32((iter_base) + 12)); index279 = index279 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index279 * 4) + + array278.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array278) + } + 14 => { + + let lifted280 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted280}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array281 : Array[Bool] = []; + for index282 = 0; index282 < (mbt_ffi_load32((iter_base) + 12)); index282 = index282 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index282 * 1) + + array281.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array281) + } + 17 => { + + let array283 : Array[Int] = []; + for index284 = 0; index284 < (mbt_ffi_load32((iter_base) + 12)); index284 = index284 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index284 * 4) + + array283.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array283) + } + 18 => { + + let array285 : Array[Int] = []; + for index286 = 0; index286 < (mbt_ffi_load32((iter_base) + 12)); index286 = index286 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index286 * 4) + + array285.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array285) + } + 19 => { + + let array287 : Array[Int] = []; + for index288 = 0; index288 < (mbt_ffi_load32((iter_base) + 12)); index288 = index288 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index288 * 4) + + array287.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array287) + } + 20 => { + + let array289 : Array[@types.MapEntry] = []; + for index290 = 0; index290 < (mbt_ffi_load32((iter_base) + 12)); index290 = index290 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index290 * 8) + + array289.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array289) + } + 21 => { + + let lifted291 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted291) + } + 22 => { + + let lifted294 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted292 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted292) + } + 1 => { + + let lifted293 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted293) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted294) + } + 23 => { + + let result295 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted297 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result296 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result296) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result295, language : lifted297}) + } + 24 => { + + let result298 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted300 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result299 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result299) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result298, mime_type : lifted300}) + } + 25 => { + + let result301 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result301) + } + 26 => { + + let result302 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result302) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result303 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result303}) + } + 30 => { + + let result304 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result304, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array306.push(lifted305) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result276, value : @types.SchemaValueTree::{value_nodes : array306, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array309.push(lifted308) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + @common.Constraint::RequiresAny(array309) + } + 3 => { + + let array347 : Array[@common.RefGroup] = []; + for index348 = 0; index348 < (mbt_ffi_load32((iter_base) + 8)); index348 = index348 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 4)) + (index348 * 8) + + let array345 : Array[@common.Ref] = []; + for index346 = 0; index346 < (mbt_ffi_load32((iter_base) + 4)); index346 = index346 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 0)) + (index346 * 24) + + let lifted344 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result311 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result311) + } + 1 => { + + let result312 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array342 : Array[@types.SchemaValueNode] = []; + for index343 = 0; index343 < (mbt_ffi_load32((iter_base) + 16)); index343 = index343 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index343 * 32) + + let lifted341 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result313 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result313) + } + 13 => { + + let array314 : Array[Int] = []; + for index315 = 0; index315 < (mbt_ffi_load32((iter_base) + 12)); index315 = index315 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index315 * 4) + + array314.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array314) + } + 14 => { + + let lifted316 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted316}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array317 : Array[Bool] = []; + for index318 = 0; index318 < (mbt_ffi_load32((iter_base) + 12)); index318 = index318 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index318 * 1) + + array317.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array317) + } + 17 => { + + let array319 : Array[Int] = []; + for index320 = 0; index320 < (mbt_ffi_load32((iter_base) + 12)); index320 = index320 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index320 * 4) + + array319.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array319) + } + 18 => { + + let array321 : Array[Int] = []; + for index322 = 0; index322 < (mbt_ffi_load32((iter_base) + 12)); index322 = index322 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index322 * 4) + + array321.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array321) + } + 19 => { + + let array323 : Array[Int] = []; + for index324 = 0; index324 < (mbt_ffi_load32((iter_base) + 12)); index324 = index324 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index324 * 4) + + array323.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array323) + } + 20 => { + + let array325 : Array[@types.MapEntry] = []; + for index326 = 0; index326 < (mbt_ffi_load32((iter_base) + 12)); index326 = index326 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index326 * 8) + + array325.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array325) + } + 21 => { + + let lifted327 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted327) + } + 22 => { + + let lifted330 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted328 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted328) + } + 1 => { + + let lifted329 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted329) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted330) + } + 23 => { + + let result331 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted333 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result332 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result332) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result331, language : lifted333}) + } + 24 => { + + let result334 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted336 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result335 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result335) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result334, mime_type : lifted336}) + } + 25 => { + + let result337 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result337) + } + 26 => { + + let result338 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result338) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result339 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result339}) + } + 30 => { + + let result340 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result340, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array342.push(lifted341) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result312, value : @types.SchemaValueTree::{value_nodes : array342, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array345.push(lifted344) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + array347.push(@common.RefGroup::{refs : array345}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 4)) + + @common.Constraint::MutexGroups(array347) + } + 4 => { + + let array383 : Array[@common.Ref] = []; + for index384 = 0; index384 < (mbt_ffi_load32((iter_base) + 12)); index384 = index384 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index384 * 24) + + let lifted382 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result349 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result349) + } + 1 => { + + let result350 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array380 : Array[@types.SchemaValueNode] = []; + for index381 = 0; index381 < (mbt_ffi_load32((iter_base) + 16)); index381 = index381 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index381 * 32) + + let lifted379 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result351 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result351) + } + 13 => { + + let array352 : Array[Int] = []; + for index353 = 0; index353 < (mbt_ffi_load32((iter_base) + 12)); index353 = index353 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index353 * 4) + + array352.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array352) + } + 14 => { + + let lifted354 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted354}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array355 : Array[Bool] = []; + for index356 = 0; index356 < (mbt_ffi_load32((iter_base) + 12)); index356 = index356 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index356 * 1) + + array355.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array355) + } + 17 => { + + let array357 : Array[Int] = []; + for index358 = 0; index358 < (mbt_ffi_load32((iter_base) + 12)); index358 = index358 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index358 * 4) + + array357.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array357) + } + 18 => { + + let array359 : Array[Int] = []; + for index360 = 0; index360 < (mbt_ffi_load32((iter_base) + 12)); index360 = index360 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index360 * 4) + + array359.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array359) + } + 19 => { + + let array361 : Array[Int] = []; + for index362 = 0; index362 < (mbt_ffi_load32((iter_base) + 12)); index362 = index362 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index362 * 4) + + array361.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array361) + } + 20 => { + + let array363 : Array[@types.MapEntry] = []; + for index364 = 0; index364 < (mbt_ffi_load32((iter_base) + 12)); index364 = index364 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index364 * 8) + + array363.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array363) + } + 21 => { + + let lifted365 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted365) + } + 22 => { + + let lifted368 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted366 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted366) + } + 1 => { + + let lifted367 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted367) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted368) + } + 23 => { + + let result369 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted371 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result370 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result370) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result369, language : lifted371}) + } + 24 => { + + let result372 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted374 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result373 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result373) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result372, mime_type : lifted374}) + } + 25 => { + + let result375 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result375) + } + 26 => { + + let result376 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result376) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result377 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result377}) + } + 30 => { + + let result378 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result378, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array380.push(lifted379) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result350, value : @types.SchemaValueTree::{value_nodes : array380, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array383.push(lifted382) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + let array419 : Array[@common.Ref] = []; + for index420 = 0; index420 < (mbt_ffi_load32((iter_base) + 24)); index420 = index420 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 20)) + (index420 * 24) + + let lifted418 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result385 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result385) + } + 1 => { + + let result386 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array416 : Array[@types.SchemaValueNode] = []; + for index417 = 0; index417 < (mbt_ffi_load32((iter_base) + 16)); index417 = index417 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index417 * 32) + + let lifted415 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result387 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result387) + } + 13 => { + + let array388 : Array[Int] = []; + for index389 = 0; index389 < (mbt_ffi_load32((iter_base) + 12)); index389 = index389 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index389 * 4) + + array388.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array388) + } + 14 => { + + let lifted390 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted390}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array391 : Array[Bool] = []; + for index392 = 0; index392 < (mbt_ffi_load32((iter_base) + 12)); index392 = index392 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index392 * 1) + + array391.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array391) + } + 17 => { + + let array393 : Array[Int] = []; + for index394 = 0; index394 < (mbt_ffi_load32((iter_base) + 12)); index394 = index394 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index394 * 4) + + array393.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array393) + } + 18 => { + + let array395 : Array[Int] = []; + for index396 = 0; index396 < (mbt_ffi_load32((iter_base) + 12)); index396 = index396 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index396 * 4) + + array395.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array395) + } + 19 => { + + let array397 : Array[Int] = []; + for index398 = 0; index398 < (mbt_ffi_load32((iter_base) + 12)); index398 = index398 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index398 * 4) + + array397.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array397) + } + 20 => { + + let array399 : Array[@types.MapEntry] = []; + for index400 = 0; index400 < (mbt_ffi_load32((iter_base) + 12)); index400 = index400 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index400 * 8) + + array399.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array399) + } + 21 => { + + let lifted401 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted401) + } + 22 => { + + let lifted404 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted402 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted402) + } + 1 => { + + let lifted403 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted403) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted404) + } + 23 => { + + let result405 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted407 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result406 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result406) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result405, language : lifted407}) + } + 24 => { + + let result408 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted410 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result409 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result409) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result408, mime_type : lifted410}) + } + 25 => { + + let result411 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result411) + } + 26 => { + + let result412 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result412) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result413 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result413}) + } + 30 => { + + let result414 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result414, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array416.push(lifted415) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result386, value : @types.SchemaValueTree::{value_nodes : array416, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array419.push(lifted418) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + @common.Constraint::Implies(@common.ImpliesC::{lhs_quant : @common.Quantifier::from(mbt_ffi_load8_u((iter_base) + 4)), lhs : array383, rhs_quant : @common.Quantifier::from(mbt_ffi_load8_u((iter_base) + 16)), rhs : array419}) + } + 5 => { + + let array455 : Array[@common.Ref] = []; + for index456 = 0; index456 < (mbt_ffi_load32((iter_base) + 12)); index456 = index456 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index456 * 24) + + let lifted454 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result421 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result421) + } + 1 => { + + let result422 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array452 : Array[@types.SchemaValueNode] = []; + for index453 = 0; index453 < (mbt_ffi_load32((iter_base) + 16)); index453 = index453 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index453 * 32) + + let lifted451 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result423 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result423) + } + 13 => { + + let array424 : Array[Int] = []; + for index425 = 0; index425 < (mbt_ffi_load32((iter_base) + 12)); index425 = index425 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index425 * 4) + + array424.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array424) + } + 14 => { + + let lifted426 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted426}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array427 : Array[Bool] = []; + for index428 = 0; index428 < (mbt_ffi_load32((iter_base) + 12)); index428 = index428 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index428 * 1) + + array427.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array427) + } + 17 => { + + let array429 : Array[Int] = []; + for index430 = 0; index430 < (mbt_ffi_load32((iter_base) + 12)); index430 = index430 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index430 * 4) + + array429.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array429) + } + 18 => { + + let array431 : Array[Int] = []; + for index432 = 0; index432 < (mbt_ffi_load32((iter_base) + 12)); index432 = index432 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index432 * 4) + + array431.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array431) + } + 19 => { + + let array433 : Array[Int] = []; + for index434 = 0; index434 < (mbt_ffi_load32((iter_base) + 12)); index434 = index434 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index434 * 4) + + array433.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array433) + } + 20 => { + + let array435 : Array[@types.MapEntry] = []; + for index436 = 0; index436 < (mbt_ffi_load32((iter_base) + 12)); index436 = index436 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index436 * 8) + + array435.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array435) + } + 21 => { + + let lifted437 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted437) + } + 22 => { + + let lifted440 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted438 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted438) + } + 1 => { + + let lifted439 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted439) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted440) + } + 23 => { + + let result441 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted443 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result442 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result442) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result441, language : lifted443}) + } + 24 => { + + let result444 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted446 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result445 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result445) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result444, mime_type : lifted446}) + } + 25 => { + + let result447 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result447) + } + 26 => { + + let result448 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result448) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result449 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result449}) + } + 30 => { + + let result450 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result450, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array452.push(lifted451) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result422, value : @types.SchemaValueTree::{value_nodes : array452, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array455.push(lifted454) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + let array491 : Array[@common.Ref] = []; + for index492 = 0; index492 < (mbt_ffi_load32((iter_base) + 20)); index492 = index492 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index492 * 24) + + let lifted490 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + let result457 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + @common.Ref::Present(result457) + } + 1 => { + + let result458 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + let array488 : Array[@types.SchemaValueNode] = []; + for index489 = 0; index489 < (mbt_ffi_load32((iter_base) + 16)); index489 = index489 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index489 * 32) + + let lifted487 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result459 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result459) + } + 13 => { + + let array460 : Array[Int] = []; + for index461 = 0; index461 < (mbt_ffi_load32((iter_base) + 12)); index461 = index461 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index461 * 4) + + array460.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array460) + } + 14 => { + + let lifted462 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted462}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array463 : Array[Bool] = []; + for index464 = 0; index464 < (mbt_ffi_load32((iter_base) + 12)); index464 = index464 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index464 * 1) + + array463.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array463) + } + 17 => { + + let array465 : Array[Int] = []; + for index466 = 0; index466 < (mbt_ffi_load32((iter_base) + 12)); index466 = index466 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index466 * 4) + + array465.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array465) + } + 18 => { + + let array467 : Array[Int] = []; + for index468 = 0; index468 < (mbt_ffi_load32((iter_base) + 12)); index468 = index468 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index468 * 4) + + array467.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array467) + } + 19 => { + + let array469 : Array[Int] = []; + for index470 = 0; index470 < (mbt_ffi_load32((iter_base) + 12)); index470 = index470 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index470 * 4) + + array469.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array469) + } + 20 => { + + let array471 : Array[@types.MapEntry] = []; + for index472 = 0; index472 < (mbt_ffi_load32((iter_base) + 12)); index472 = index472 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index472 * 8) + + array471.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array471) + } + 21 => { + + let lifted473 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted473) + } + 22 => { + + let lifted476 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted474 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted474) + } + 1 => { + + let lifted475 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted475) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted476) + } + 23 => { + + let result477 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted479 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result478 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result478) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result477, language : lifted479}) + } + 24 => { + + let result480 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted482 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result481 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result481) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result480, mime_type : lifted482}) + } + 25 => { + + let result483 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result483) + } + 26 => { + + let result484 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result484) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result485 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result485}) + } + 30 => { + + let result486 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result486, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array488.push(lifted487) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + @common.Ref::ValueIs(@common.ValueIsRef::{name : result458, value : @types.SchemaValueTree::{value_nodes : array488, root : mbt_ffi_load32((iter_base) + 20)}}) + } + _ => panic() + } + + array491.push(lifted490) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + @common.Constraint::Forbids(@common.ForbidsC::{lhs_quant : @common.Quantifier::from(mbt_ffi_load8_u((iter_base) + 4)), lhs : array455, rhs : array491}) + } + _ => panic() + } + + array494.push(lifted493) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 172)) + + let lifted505 : @common.StreamSpec? = match mbt_ffi_load8_u((iter_base) + 180) { + 0 => Option::None + 1 => { + + let result496 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 184), mbt_ffi_load32((iter_base) + 188)) + + let result497 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 192), mbt_ffi_load32((iter_base) + 196)) + + let array500 : Array[@common.Example] = []; + for index501 = 0; index501 < (mbt_ffi_load32((iter_base) + 204)); index501 = index501 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 200)) + (index501 * 16) + + let result498 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result499 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array500.push(@common.Example::{title : result498, body : result499}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 200)) + + let array503 : Array[String] = []; + for index504 = 0; index504 < (mbt_ffi_load32((iter_base) + 212)); index504 = index504 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 208)) + (index504 * 8) + + let result502 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array503.push(result502) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 208)) + + Option::Some(@common.StreamSpec::{doc : @common.Doc::{summary : result496, description : result497, examples : array500}, mime : array503, required : (mbt_ffi_load8_u((iter_base) + 216) != 0)}) + } + _ => panic() + } + + let lifted515 : @common.StreamSpec? = match mbt_ffi_load8_u((iter_base) + 220) { + 0 => Option::None + 1 => { + + let result506 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 224), mbt_ffi_load32((iter_base) + 228)) + + let result507 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 232), mbt_ffi_load32((iter_base) + 236)) + + let array510 : Array[@common.Example] = []; + for index511 = 0; index511 < (mbt_ffi_load32((iter_base) + 244)); index511 = index511 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 240)) + (index511 * 16) + + let result508 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result509 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array510.push(@common.Example::{title : result508, body : result509}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 240)) + + let array513 : Array[String] = []; + for index514 = 0; index514 < (mbt_ffi_load32((iter_base) + 252)); index514 = index514 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 248)) + (index514 * 8) + + let result512 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array513.push(result512) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 248)) + + Option::Some(@common.StreamSpec::{doc : @common.Doc::{summary : result506, description : result507, examples : array510}, mime : array513, required : (mbt_ffi_load8_u((iter_base) + 256) != 0)}) + } + _ => panic() + } + + let lifted532 : @common.ResultSpec? = match mbt_ffi_load8_u((iter_base) + 260) { + 0 => Option::None + 1 => { + + let result516 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 268), mbt_ffi_load32((iter_base) + 272)) + + let result517 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 276), mbt_ffi_load32((iter_base) + 280)) + + let array520 : Array[@common.Example] = []; + for index521 = 0; index521 < (mbt_ffi_load32((iter_base) + 288)); index521 = index521 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 284)) + (index521 * 16) + + let result518 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result519 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array520.push(@common.Example::{title : result518, body : result519}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 284)) + + let array529 : Array[@common.Formatter] = []; + for index530 = 0; index530 < (mbt_ffi_load32((iter_base) + 296)); index530 = index530 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 292)) + (index530 * 32) + + let result522 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result523 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result524 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let array527 : Array[@common.Example] = []; + for index528 = 0; index528 < (mbt_ffi_load32((iter_base) + 28)); index528 = index528 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index528 * 16) + + let result525 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result526 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array527.push(@common.Example::{title : result525, body : result526}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + array529.push(@common.Formatter::{name : result522, doc : @common.Doc::{summary : result523, description : result524, examples : array527}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 292)) + + let result531 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 300), mbt_ffi_load32((iter_base) + 304)) + + Option::Some(@common.ResultSpec::{type_ : mbt_ffi_load32((iter_base) + 264), doc : @common.Doc::{summary : result516, description : result517, examples : array520}, formatters : array529, default_formatter : result531}) + } + _ => panic() + } + + let array541 : Array[@common.ErrorCase] = []; + for index542 = 0; index542 < (mbt_ffi_load32((iter_base) + 312)); index542 = index542 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 308)) + (index542 * 44) + + let result533 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result534 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let result535 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let array538 : Array[@common.Example] = []; + for index539 = 0; index539 < (mbt_ffi_load32((iter_base) + 28)); index539 = index539 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index539 * 16) + + let result536 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result537 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array538.push(@common.Example::{title : result536, body : result537}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let lifted540 : Int? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 40)) + } + _ => panic() + } + + array541.push(@common.ErrorCase::{name : result533, doc : @common.Doc::{summary : result534, description : result535, examples : array538}, kind : @common.ErrorKind::from(mbt_ffi_load8_u((iter_base) + 32)), exit_code : (mbt_ffi_load8_u((iter_base) + 33)).to_byte(), payload : lifted540}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 308)) + + let lifted543 : @common.CommandAnnotations? = match mbt_ffi_load8_u((iter_base) + 316) { + 0 => Option::None + 1 => { + + Option::Some(@common.CommandAnnotations::{read_only : (mbt_ffi_load8_u((iter_base) + 317) != 0), destructive : (mbt_ffi_load8_u((iter_base) + 318) != 0), idempotent : (mbt_ffi_load8_u((iter_base) + 319) != 0), open_world : (mbt_ffi_load8_u((iter_base) + 320) != 0)}) + } + _ => panic() + } + + Option::Some(@common.CommandBody::{positionals : @common.Positionals::{fixed : array119, tail : lifted133}, options : array184, flags : array201, constraints : array494, stdin : lifted505, stdout : lifted515, result : lifted532, errors : array541, annotations : lifted543}) + } + _ => panic() + } + + array545.push(@common.CommandNode::{name : result0, aliases : array, doc : @common.Doc::{summary : result2, description : result3, examples : array6}, globals : @common.Globals::{options : array57, flags : array74}, subcommands : array76, body : lifted544}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 16)) + + let array743 : Array[@types.SchemaTypeNode] = []; + for index744 = 0; index744 < (mbt_ffi_load32((return_area) + 28)); index744 = index744 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 24)) + (index744 * 144) + + let lifted729 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted553 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted548 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted547 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted547) + } + _ => panic() + } + + let lifted550 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted549 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted549) + } + _ => panic() + } + + let lifted552 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result551 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result551) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted548, max : lifted550, unit : lifted552}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted553) + } + 3 => { + + let lifted560 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted555 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted554 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted554) + } + _ => panic() + } + + let lifted557 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted556 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted556) + } + _ => panic() + } + + let lifted559 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result558 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result558) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted555, max : lifted557, unit : lifted559}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted560) + } + 4 => { + + let lifted567 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted562 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted561 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted561) + } + _ => panic() + } + + let lifted564 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted563 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted563) + } + _ => panic() + } + + let lifted566 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result565 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result565) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted562, max : lifted564, unit : lifted566}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted567) + } + 5 => { + + let lifted574 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted569 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted568 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted568) + } + _ => panic() + } + + let lifted571 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted570 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted570) + } + _ => panic() + } + + let lifted573 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result572 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result572) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted569, max : lifted571, unit : lifted573}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted574) + } + 6 => { + + let lifted581 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted576 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted575 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted575) + } + _ => panic() + } + + let lifted578 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted577 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted577) + } + _ => panic() + } + + let lifted580 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result579 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result579) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted576, max : lifted578, unit : lifted580}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted581) + } + 7 => { + + let lifted588 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted583 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted582 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted582) + } + _ => panic() + } + + let lifted585 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted584 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted584) + } + _ => panic() + } + + let lifted587 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result586 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result586) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted583, max : lifted585, unit : lifted587}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted588) + } + 8 => { + + let lifted595 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted590 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted589 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted589) + } + _ => panic() + } + + let lifted592 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted591 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted591) + } + _ => panic() + } + + let lifted594 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result593 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result593) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted590, max : lifted592, unit : lifted594}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted595) + } + 9 => { + + let lifted602 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted597 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted596 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted596) + } + _ => panic() + } + + let lifted599 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted598 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted598) + } + _ => panic() + } + + let lifted601 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result600 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result600) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted597, max : lifted599, unit : lifted601}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted602) + } + 10 => { + + let lifted609 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted604 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted603 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted603) + } + _ => panic() + } + + let lifted606 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted605 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted605) + } + _ => panic() + } + + let lifted608 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result607 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result607) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted604, max : lifted606, unit : lifted608}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted609) + } + 11 => { + + let lifted616 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted611 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted610 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted610) + } + _ => panic() + } + + let lifted613 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted612 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted612) + } + _ => panic() + } + + let lifted615 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result614 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result614) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted611, max : lifted613, unit : lifted615}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted616) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array631 : Array[@types.NamedFieldType] = []; + for index632 = 0; index632 < (mbt_ffi_load32((iter_base) + 12)); index632 = index632 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index632 * 68) + + let result617 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted619 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result618 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result618) + } + _ => panic() + } + + let array621 : Array[String] = []; + for index622 = 0; index622 < (mbt_ffi_load32((iter_base) + 28)); index622 = index622 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index622 * 8) + + let result620 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array621.push(result620) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array624 : Array[String] = []; + for index625 = 0; index625 < (mbt_ffi_load32((iter_base) + 36)); index625 = index625 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index625 * 8) + + let result623 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array624.push(result623) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted627 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result626 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result626) + } + _ => panic() + } + + let lifted630 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted629 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result628 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result628) + } + _ => panic() + } + + Option::Some(lifted629) + } + _ => panic() + } + + array631.push(@types.NamedFieldType::{name : result617, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted619, aliases : array621, examples : array624, deprecated : lifted627, role : lifted630}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array631) + } + 15 => { + + let array648 : Array[@types.VariantCaseType] = []; + for index649 = 0; index649 < (mbt_ffi_load32((iter_base) + 12)); index649 = index649 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index649 * 72) + + let result633 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted634 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted636 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result635 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result635) + } + _ => panic() + } + + let array638 : Array[String] = []; + for index639 = 0; index639 < (mbt_ffi_load32((iter_base) + 32)); index639 = index639 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index639 * 8) + + let result637 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array638.push(result637) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array641 : Array[String] = []; + for index642 = 0; index642 < (mbt_ffi_load32((iter_base) + 40)); index642 = index642 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index642 * 8) + + let result640 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array641.push(result640) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted644 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result643 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result643) + } + _ => panic() + } + + let lifted647 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted646 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result645 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result645) + } + _ => panic() + } + + Option::Some(lifted646) + } + _ => panic() + } + + array648.push(@types.VariantCaseType::{name : result633, payload : lifted634, metadata : @types.MetadataEnvelope::{doc : lifted636, aliases : array638, examples : array641, deprecated : lifted644, role : lifted647}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array648) + } + 16 => { + + let array651 : Array[String] = []; + for index652 = 0; index652 < (mbt_ffi_load32((iter_base) + 12)); index652 = index652 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index652 * 8) + + let result650 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array651.push(result650) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array651) + } + 17 => { + + let array654 : Array[String] = []; + for index655 = 0; index655 < (mbt_ffi_load32((iter_base) + 12)); index655 = index655 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index655 * 8) + + let result653 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array654.push(result653) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array654) + } + 18 => { + + let array656 : Array[Int] = []; + for index657 = 0; index657 < (mbt_ffi_load32((iter_base) + 12)); index657 = index657 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index657 * 4) + + array656.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array656) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted658 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted659 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted658, err : lifted659}) + } + 24 => { + + let lifted663 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array661 : Array[String] = []; + for index662 = 0; index662 < (mbt_ffi_load32((iter_base) + 16)); index662 = index662 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index662 * 8) + + let result660 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array661.push(result660) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array661) + } + _ => panic() + } + + let lifted664 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted665 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted667 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result666 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result666) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted663, min_length : lifted664, max_length : lifted665, regex : lifted667}) + } + 25 => { + + let lifted671 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array669 : Array[String] = []; + for index670 = 0; index670 < (mbt_ffi_load32((iter_base) + 16)); index670 = index670 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index670 * 8) + + let result668 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array669.push(result668) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array669) + } + _ => panic() + } + + let lifted672 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted673 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted671, min_bytes : lifted672, max_bytes : lifted673}) + } + 26 => { + + let lifted677 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array675 : Array[String] = []; + for index676 = 0; index676 < (mbt_ffi_load32((iter_base) + 20)); index676 = index676 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index676 * 8) + + let result674 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array675.push(result674) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array675) + } + _ => panic() + } + + let lifted681 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array679 : Array[String] = []; + for index680 = 0; index680 < (mbt_ffi_load32((iter_base) + 32)); index680 = index680 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index680 * 8) + + let result678 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array679.push(result678) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array679) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted677, allowed_extensions : lifted681}) + } + 27 => { + + let lifted685 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array683 : Array[String] = []; + for index684 = 0; index684 < (mbt_ffi_load32((iter_base) + 16)); index684 = index684 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index684 * 8) + + let result682 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array683.push(result682) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array683) + } + _ => panic() + } + + let lifted689 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array687 : Array[String] = []; + for index688 = 0; index688 < (mbt_ffi_load32((iter_base) + 28)); index688 = index688 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index688 * 8) + + let result686 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array687.push(result686) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array687) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted685, allowed_hosts : lifted689}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result690 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array692 : Array[String] = []; + for index693 = 0; index693 < (mbt_ffi_load32((iter_base) + 20)); index693 = index693 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index693 * 8) + + let result691 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array692.push(result691) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted695 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result694 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result694}) + } + _ => panic() + } + + let lifted697 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result696 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result696}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result690, allowed_suffixes : array692, min : lifted695, max : lifted697}) + } + 31 => { + + let array721 : Array[@types.UnionBranch] = []; + for index722 = 0; index722 < (mbt_ffi_load32((iter_base) + 12)); index722 = index722 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index722 * 92) + + let result698 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted707 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result699 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result699) + } + 1 => { + + let result700 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result700) + } + 2 => { + + let result701 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result701) + } + 3 => { + + let result702 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result702) + } + 4 => { + + let result703 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted705 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result704 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result704) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result703, literal : lifted705}) + } + 5 => { + + let result706 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result706) + } + _ => panic() + } + + let lifted709 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result708 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result708) + } + _ => panic() + } + + let array711 : Array[String] = []; + for index712 = 0; index712 < (mbt_ffi_load32((iter_base) + 52)); index712 = index712 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index712 * 8) + + let result710 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array711.push(result710) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array714 : Array[String] = []; + for index715 = 0; index715 < (mbt_ffi_load32((iter_base) + 60)); index715 = index715 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index715 * 8) + + let result713 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array714.push(result713) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted717 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result716 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result716) + } + _ => panic() + } + + let lifted720 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted719 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result718 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result718) + } + _ => panic() + } + + Option::Some(lifted719) + } + _ => panic() + } + + array721.push(@types.UnionBranch::{tag : result698, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted707, metadata : @types.MetadataEnvelope::{doc : lifted709, aliases : array711, examples : array714, deprecated : lifted717, role : lifted720}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array721}) + } + 32 => { + + let lifted724 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result723 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result723) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted724}) + } + 33 => { + + let lifted726 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result725 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result725) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted726}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted727 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted727) + } + 36 => { + + let lifted728 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted728) + } + _ => panic() + } + + let lifted731 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result730 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result730) + } + _ => panic() + } + + let array733 : Array[String] = []; + for index734 = 0; index734 < (mbt_ffi_load32((iter_base) + 104)); index734 = index734 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index734 * 8) + + let result732 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array733.push(result732) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array736 : Array[String] = []; + for index737 = 0; index737 < (mbt_ffi_load32((iter_base) + 112)); index737 = index737 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index737 * 8) + + let result735 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array736.push(result735) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted739 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result738 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result738) + } + _ => panic() + } + + let lifted742 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted741 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result740 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result740) + } + _ => panic() + } + + Option::Some(lifted741) + } + _ => panic() + } + + array743.push(@types.SchemaTypeNode::{body : lifted729, metadata : @types.MetadataEnvelope::{doc : lifted731, aliases : array733, examples : array736, deprecated : lifted739, role : lifted742}}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 24)) + + let array748 : Array[@types.SchemaTypeDef] = []; + for index749 = 0; index749 < (mbt_ffi_load32((return_area) + 36)); index749 = index749 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 32)) + (index749 * 24) + + let result745 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted747 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result746 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result746) + } + _ => panic() + } + + array748.push(@types.SchemaTypeDef::{id : result745, name : lifted747, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 32)) + + Option::Some(RegisteredTool::{definition : @common.Tool::{version : result, commands : @common.CommandTree::{nodes : array545}, schema : @types.SchemaGraph::{type_nodes : array743, defs : array748, root : mbt_ffi_load32((return_area) + 40)}}, implemented_by : @types.ComponentId::{uuid : @types.Uuid::{high_bits : (mbt_ffi_load64((return_area) + 48)).reinterpret_as_uint64(), low_bits : (mbt_ffi_load64((return_area) + 56)).reinterpret_as_uint64()}}}) + } + _ => panic() + } + let ret = lifted750 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} +///| +pub fn ToolRpc::tool_rpc(tool_name : String) -> ToolRpc { + + let ptr = mbt_ffi_str2ptr(tool_name) + let result : Int = wasmImportConstructorToolRpc(ptr, tool_name.length()); + let ret = ToolRpc::ToolRpc(result) + mbt_ffi_free(ptr) + return ret + +} +///| +pub async fn ToolRpc::invoke_and_await(self : ToolRpc, command_path : Array[String], input : @types.TypedSchemaValue, stdin : @async-core.Stream[Byte]?) -> Result[@common.InvocationResult, RpcError] { + + let lower_ptr : Int = mbt_ffi_malloc(52) + defer mbt_ffi_free(lower_ptr) + + let ToolRpc(handle) = self + mbt_ffi_store32((lower_ptr + 0) + 0, handle) + + let address = mbt_ffi_malloc((command_path).length() * 8); + for index = 0; index < (command_path).length(); index = index + 1 { + let iter_elem : String = (command_path)[(index)] + let iter_base = address + (index * 8); + + let ptr = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr) + + } + mbt_ffi_store32((lower_ptr + 4) + 4, (command_path).length()) + mbt_ffi_store32((lower_ptr + 4) + 0, address) + + let address358 = mbt_ffi_malloc((((input).graph).type_nodes).length() * 144); + for index359 = 0; index359 < (((input).graph).type_nodes).length(); index359 = index359 + 1 { + let iter_elem : @types.SchemaTypeNode = (((input).graph).type_nodes)[(index359)] + let iter_base = address358 + (index359 * 144); + + match (iter_elem).body { + RefType(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store32((iter_base) + 8, payload) + + () + } + BoolType => { + mbt_ffi_store8((iter_base) + 0, (1)) + + () + } + S8Type(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + + match (payload1) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload3).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload5) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload5 { + Signed(payload6) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload6) + + () + } + Unsigned(payload7) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload7).reinterpret_as_int64()) + + () + } + FloatBits(payload8) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload8).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload3).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload10) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload10 { + Signed(payload11) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload11) + + () + } + Unsigned(payload12) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload12).reinterpret_as_int64()) + + () + } + FloatBits(payload13) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload13).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload3).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload15) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr = mbt_ffi_str2ptr(payload15) + mbt_ffi_store32((iter_base) + 72, payload15.length()) + mbt_ffi_store32((iter_base) + 68, ptr) + + () + } + } + + () + } + } + + () + } + S16Type(payload16) => { + mbt_ffi_store8((iter_base) + 0, (3)) + + match (payload16) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload18) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload18).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload20) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload20 { + Signed(payload21) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload21) + + () + } + Unsigned(payload22) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload22).reinterpret_as_int64()) + + () + } + FloatBits(payload23) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload23).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload18).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload25) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload25 { + Signed(payload26) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload26) + + () + } + Unsigned(payload27) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload27).reinterpret_as_int64()) + + () + } + FloatBits(payload28) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload28).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload18).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload30) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr31 = mbt_ffi_str2ptr(payload30) + mbt_ffi_store32((iter_base) + 72, payload30.length()) + mbt_ffi_store32((iter_base) + 68, ptr31) + + () + } + } + + () + } + } + + () + } + S32Type(payload32) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + match (payload32) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload34) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload34).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload36) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload36 { + Signed(payload37) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload37) + + () + } + Unsigned(payload38) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload38).reinterpret_as_int64()) + + () + } + FloatBits(payload39) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload39).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload34).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload41) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload41 { + Signed(payload42) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload42) + + () + } + Unsigned(payload43) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload43).reinterpret_as_int64()) + + () + } + FloatBits(payload44) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload44).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload34).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload46) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr47 = mbt_ffi_str2ptr(payload46) + mbt_ffi_store32((iter_base) + 72, payload46.length()) + mbt_ffi_store32((iter_base) + 68, ptr47) + + () + } + } + + () + } + } + + () + } + S64Type(payload48) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + match (payload48) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload50) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload50).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload52) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload52 { + Signed(payload53) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload53) + + () + } + Unsigned(payload54) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload54).reinterpret_as_int64()) + + () + } + FloatBits(payload55) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload55).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload50).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload57) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload57 { + Signed(payload58) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload58) + + () + } + Unsigned(payload59) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload59).reinterpret_as_int64()) + + () + } + FloatBits(payload60) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload60).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload50).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload62) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr63 = mbt_ffi_str2ptr(payload62) + mbt_ffi_store32((iter_base) + 72, payload62.length()) + mbt_ffi_store32((iter_base) + 68, ptr63) + + () + } + } + + () + } + } + + () + } + U8Type(payload64) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + match (payload64) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload66) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload66).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload68) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload68 { + Signed(payload69) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload69) + + () + } + Unsigned(payload70) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload70).reinterpret_as_int64()) + + () + } + FloatBits(payload71) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload71).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload66).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload73) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload73 { + Signed(payload74) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload74) + + () + } + Unsigned(payload75) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload75).reinterpret_as_int64()) + + () + } + FloatBits(payload76) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload76).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload66).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload78) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr79 = mbt_ffi_str2ptr(payload78) + mbt_ffi_store32((iter_base) + 72, payload78.length()) + mbt_ffi_store32((iter_base) + 68, ptr79) + + () + } + } + + () + } + } + + () + } + U16Type(payload80) => { + mbt_ffi_store8((iter_base) + 0, (7)) + + match (payload80) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload82) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload82).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload84) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload84 { + Signed(payload85) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload85) + + () + } + Unsigned(payload86) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload86).reinterpret_as_int64()) + + () + } + FloatBits(payload87) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload87).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload82).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload89) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload89 { + Signed(payload90) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload90) + + () + } + Unsigned(payload91) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload91).reinterpret_as_int64()) + + () + } + FloatBits(payload92) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload92).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload82).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload94) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr95 = mbt_ffi_str2ptr(payload94) + mbt_ffi_store32((iter_base) + 72, payload94.length()) + mbt_ffi_store32((iter_base) + 68, ptr95) + + () + } + } + + () + } + } + + () + } + U32Type(payload96) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + match (payload96) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload98) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload98).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload100) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload100 { + Signed(payload101) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload101) + + () + } + Unsigned(payload102) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload102).reinterpret_as_int64()) + + () + } + FloatBits(payload103) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload103).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload98).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload105) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload105 { + Signed(payload106) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload106) + + () + } + Unsigned(payload107) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload107).reinterpret_as_int64()) + + () + } + FloatBits(payload108) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload108).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload98).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload110) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr111 = mbt_ffi_str2ptr(payload110) + mbt_ffi_store32((iter_base) + 72, payload110.length()) + mbt_ffi_store32((iter_base) + 68, ptr111) + + () + } + } + + () + } + } + + () + } + U64Type(payload112) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + match (payload112) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload114) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload114).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload116) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload116 { + Signed(payload117) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload117) + + () + } + Unsigned(payload118) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload118).reinterpret_as_int64()) + + () + } + FloatBits(payload119) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload119).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload114).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload121) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload121 { + Signed(payload122) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload122) + + () + } + Unsigned(payload123) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload123).reinterpret_as_int64()) + + () + } + FloatBits(payload124) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload124).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload114).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload126) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr127 = mbt_ffi_str2ptr(payload126) + mbt_ffi_store32((iter_base) + 72, payload126.length()) + mbt_ffi_store32((iter_base) + 68, ptr127) + + () + } + } + + () + } + } + + () + } + F32Type(payload128) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + match (payload128) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload130) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload130).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload132) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload132 { + Signed(payload133) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload133) + + () + } + Unsigned(payload134) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload134).reinterpret_as_int64()) + + () + } + FloatBits(payload135) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload135).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload130).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload137) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload137 { + Signed(payload138) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload138) + + () + } + Unsigned(payload139) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload139).reinterpret_as_int64()) + + () + } + FloatBits(payload140) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload140).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload130).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload142) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr143 = mbt_ffi_str2ptr(payload142) + mbt_ffi_store32((iter_base) + 72, payload142.length()) + mbt_ffi_store32((iter_base) + 68, ptr143) + + () + } + } + + () + } + } + + () + } + F64Type(payload144) => { + mbt_ffi_store8((iter_base) + 0, (11)) + + match (payload144) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload146) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload146).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload148) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload148 { + Signed(payload149) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload149) + + () + } + Unsigned(payload150) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload150).reinterpret_as_int64()) + + () + } + FloatBits(payload151) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload151).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload146).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload153) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload153 { + Signed(payload154) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload154) + + () + } + Unsigned(payload155) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload155).reinterpret_as_int64()) + + () + } + FloatBits(payload156) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload156).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload146).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload158) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr159 = mbt_ffi_str2ptr(payload158) + mbt_ffi_store32((iter_base) + 72, payload158.length()) + mbt_ffi_store32((iter_base) + 68, ptr159) + + () + } + } + + () + } + } + + () + } + CharType => { + mbt_ffi_store8((iter_base) + 0, (12)) + + () + } + StringType => { + mbt_ffi_store8((iter_base) + 0, (13)) + + () + } + RecordType(payload162) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let address181 = mbt_ffi_malloc((payload162).length() * 68); + for index182 = 0; index182 < (payload162).length(); index182 = index182 + 1 { + let iter_elem : @types.NamedFieldType = (payload162)[(index182)] + let iter_base = address181 + (index182 * 68); + + let ptr163 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr163) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload165) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr166 = mbt_ffi_str2ptr(payload165) + mbt_ffi_store32((iter_base) + 20, payload165.length()) + mbt_ffi_store32((iter_base) + 16, ptr166) + + () + } + } + + let address = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index = 0; index < (((iter_elem).metadata).aliases).length(); index = index + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index)] + let iter_base = address + (index * 8); + + let ptr167 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr167) + + } + mbt_ffi_store32((iter_base) + 28, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 24, address) + + let address169 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index170 = 0; index170 < (((iter_elem).metadata).examples).length(); index170 = index170 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index170)] + let iter_base = address169 + (index170 * 8); + + let ptr168 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr168) + + } + mbt_ffi_store32((iter_base) + 36, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 32, address169) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload172) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + let ptr173 = mbt_ffi_str2ptr(payload172) + mbt_ffi_store32((iter_base) + 48, payload172.length()) + mbt_ffi_store32((iter_base) + 44, ptr173) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 52, (0)) + + () + } + Some(payload175) => { + mbt_ffi_store8((iter_base) + 52, (1)) + + match payload175 { + Multimodal => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 56, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 56, (2)) + + () + } + Other(payload179) => { + mbt_ffi_store8((iter_base) + 56, (3)) + + let ptr180 = mbt_ffi_str2ptr(payload179) + mbt_ffi_store32((iter_base) + 64, payload179.length()) + mbt_ffi_store32((iter_base) + 60, ptr180) + + () + } + } + + () + } + } + + } + mbt_ffi_store32((iter_base) + 12, (payload162).length()) + mbt_ffi_store32((iter_base) + 8, address181) + + () + } + VariantType(payload183) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let address206 = mbt_ffi_malloc((payload183).length() * 72); + for index207 = 0; index207 < (payload183).length(); index207 = index207 + 1 { + let iter_elem : @types.VariantCaseType = (payload183)[(index207)] + let iter_base = address206 + (index207 * 72); + + let ptr184 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr184) + + match ((iter_elem).payload) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload186) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload186) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload188) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr189 = mbt_ffi_str2ptr(payload188) + mbt_ffi_store32((iter_base) + 24, payload188.length()) + mbt_ffi_store32((iter_base) + 20, ptr189) + + () + } + } + + let address191 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index192 = 0; index192 < (((iter_elem).metadata).aliases).length(); index192 = index192 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index192)] + let iter_base = address191 + (index192 * 8); + + let ptr190 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr190) + + } + mbt_ffi_store32((iter_base) + 32, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 28, address191) + + let address194 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index195 = 0; index195 < (((iter_elem).metadata).examples).length(); index195 = index195 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index195)] + let iter_base = address194 + (index195 * 8); + + let ptr193 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr193) + + } + mbt_ffi_store32((iter_base) + 40, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 36, address194) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 44, (0)) + + () + } + Some(payload197) => { + mbt_ffi_store8((iter_base) + 44, (1)) + + let ptr198 = mbt_ffi_str2ptr(payload197) + mbt_ffi_store32((iter_base) + 52, payload197.length()) + mbt_ffi_store32((iter_base) + 48, ptr198) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload200) => { + mbt_ffi_store8((iter_base) + 56, (1)) + + match payload200 { + Multimodal => { + mbt_ffi_store8((iter_base) + 60, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 60, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 60, (2)) + + () + } + Other(payload204) => { + mbt_ffi_store8((iter_base) + 60, (3)) + + let ptr205 = mbt_ffi_str2ptr(payload204) + mbt_ffi_store32((iter_base) + 68, payload204.length()) + mbt_ffi_store32((iter_base) + 64, ptr205) + + () + } + } + + () + } + } + + } + mbt_ffi_store32((iter_base) + 12, (payload183).length()) + mbt_ffi_store32((iter_base) + 8, address206) + + () + } + EnumType(payload208) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address210 = mbt_ffi_malloc((payload208).length() * 8); + for index211 = 0; index211 < (payload208).length(); index211 = index211 + 1 { + let iter_elem : String = (payload208)[(index211)] + let iter_base = address210 + (index211 * 8); + + let ptr209 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr209) + + } + mbt_ffi_store32((iter_base) + 12, (payload208).length()) + mbt_ffi_store32((iter_base) + 8, address210) + + () + } + FlagsType(payload212) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address214 = mbt_ffi_malloc((payload212).length() * 8); + for index215 = 0; index215 < (payload212).length(); index215 = index215 + 1 { + let iter_elem : String = (payload212)[(index215)] + let iter_base = address214 + (index215 * 8); + + let ptr213 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr213) + + } + mbt_ffi_store32((iter_base) + 12, (payload212).length()) + mbt_ffi_store32((iter_base) + 8, address214) + + () + } + TupleType(payload216) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address217 = mbt_ffi_malloc((payload216).length() * 4); + for index218 = 0; index218 < (payload216).length(); index218 = index218 + 1 { + let iter_elem : Int = (payload216)[(index218)] + let iter_base = address217 + (index218 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload216).length()) + mbt_ffi_store32((iter_base) + 8, address217) + + () + } + ListType(payload219) => { + mbt_ffi_store8((iter_base) + 0, (19)) + mbt_ffi_store32((iter_base) + 8, payload219) + + () + } + FixedListType(payload220) => { + mbt_ffi_store8((iter_base) + 0, (20)) + mbt_ffi_store32((iter_base) + 8, (payload220).element) + mbt_ffi_store32((iter_base) + 12, ((payload220).length).reinterpret_as_int()) + + () + } + MapType(payload221) => { + mbt_ffi_store8((iter_base) + 0, (21)) + mbt_ffi_store32((iter_base) + 8, (payload221).key) + mbt_ffi_store32((iter_base) + 12, (payload221).value) + + () + } + OptionType(payload222) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store32((iter_base) + 8, payload222) + + () + } + ResultType(payload223) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match ((payload223).ok) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload225) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload225) + + () + } + } + + match ((payload223).err) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload227) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload227) + + () + } + } + + () + } + TextType(payload228) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match ((payload228).languages) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload230) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address232 = mbt_ffi_malloc((payload230).length() * 8); + for index233 = 0; index233 < (payload230).length(); index233 = index233 + 1 { + let iter_elem : String = (payload230)[(index233)] + let iter_base = address232 + (index233 * 8); + + let ptr231 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr231) + + } + mbt_ffi_store32((iter_base) + 16, (payload230).length()) + mbt_ffi_store32((iter_base) + 12, address232) + + () + } + } + + match ((payload228).min_length) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload235) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload235).reinterpret_as_int()) + + () + } + } + + match ((payload228).max_length) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload237) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload237).reinterpret_as_int()) + + () + } + } + + match ((payload228).regex) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload239) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr240 = mbt_ffi_str2ptr(payload239) + mbt_ffi_store32((iter_base) + 44, payload239.length()) + mbt_ffi_store32((iter_base) + 40, ptr240) + + () + } + } + + () + } + BinaryType(payload241) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + match ((payload241).mime_types) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload243) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address245 = mbt_ffi_malloc((payload243).length() * 8); + for index246 = 0; index246 < (payload243).length(); index246 = index246 + 1 { + let iter_elem : String = (payload243)[(index246)] + let iter_base = address245 + (index246 * 8); + + let ptr244 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr244) + + } + mbt_ffi_store32((iter_base) + 16, (payload243).length()) + mbt_ffi_store32((iter_base) + 12, address245) + + () + } + } + + match ((payload241).min_bytes) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload248) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload248).reinterpret_as_int()) + + () + } + } + + match ((payload241).max_bytes) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload250) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload250).reinterpret_as_int()) + + () + } + } + + () + } + PathType(payload251) => { + mbt_ffi_store8((iter_base) + 0, (26)) + mbt_ffi_store8((iter_base) + 8, (payload251).direction.ordinal()) + mbt_ffi_store8((iter_base) + 9, (payload251).kind.ordinal()) + + match ((payload251).allowed_mime_types) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload253) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let address255 = mbt_ffi_malloc((payload253).length() * 8); + for index256 = 0; index256 < (payload253).length(); index256 = index256 + 1 { + let iter_elem : String = (payload253)[(index256)] + let iter_base = address255 + (index256 * 8); + + let ptr254 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr254) + + } + mbt_ffi_store32((iter_base) + 20, (payload253).length()) + mbt_ffi_store32((iter_base) + 16, address255) + + () + } + } + + match ((payload251).allowed_extensions) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload258) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let address260 = mbt_ffi_malloc((payload258).length() * 8); + for index261 = 0; index261 < (payload258).length(); index261 = index261 + 1 { + let iter_elem : String = (payload258)[(index261)] + let iter_base = address260 + (index261 * 8); + + let ptr259 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr259) + + } + mbt_ffi_store32((iter_base) + 32, (payload258).length()) + mbt_ffi_store32((iter_base) + 28, address260) + + () + } + } + + () + } + UrlType(payload262) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + match ((payload262).allowed_schemes) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload264) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address266 = mbt_ffi_malloc((payload264).length() * 8); + for index267 = 0; index267 < (payload264).length(); index267 = index267 + 1 { + let iter_elem : String = (payload264)[(index267)] + let iter_base = address266 + (index267 * 8); + + let ptr265 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr265) + + } + mbt_ffi_store32((iter_base) + 16, (payload264).length()) + mbt_ffi_store32((iter_base) + 12, address266) + + () + } + } + + match ((payload262).allowed_hosts) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload269) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let address271 = mbt_ffi_malloc((payload269).length() * 8); + for index272 = 0; index272 < (payload269).length(); index272 = index272 + 1 { + let iter_elem : String = (payload269)[(index272)] + let iter_base = address271 + (index272 * 8); + + let ptr270 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr270) + + } + mbt_ffi_store32((iter_base) + 28, (payload269).length()) + mbt_ffi_store32((iter_base) + 24, address271) + + () + } + } + + () + } + DatetimeType => { + mbt_ffi_store8((iter_base) + 0, (28)) + + () + } + DurationType => { + mbt_ffi_store8((iter_base) + 0, (29)) + + () + } + QuantityType(payload275) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr276 = mbt_ffi_str2ptr((payload275).base_unit) + mbt_ffi_store32((iter_base) + 12, (payload275).base_unit.length()) + mbt_ffi_store32((iter_base) + 8, ptr276) + + let address278 = mbt_ffi_malloc(((payload275).allowed_suffixes).length() * 8); + for index279 = 0; index279 < ((payload275).allowed_suffixes).length(); index279 = index279 + 1 { + let iter_elem : String = ((payload275).allowed_suffixes)[(index279)] + let iter_base = address278 + (index279 * 8); + + let ptr277 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr277) + + } + mbt_ffi_store32((iter_base) + 20, ((payload275).allowed_suffixes).length()) + mbt_ffi_store32((iter_base) + 16, address278) + + match ((payload275).min) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload281) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload281).mantissa) + mbt_ffi_store32((iter_base) + 40, (payload281).scale) + + let ptr282 = mbt_ffi_str2ptr((payload281).unit) + mbt_ffi_store32((iter_base) + 48, (payload281).unit.length()) + mbt_ffi_store32((iter_base) + 44, ptr282) + + () + } + } + + match ((payload275).max) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload284) => { + mbt_ffi_store8((iter_base) + 56, (1)) + mbt_ffi_store64((iter_base) + 64, (payload284).mantissa) + mbt_ffi_store32((iter_base) + 72, (payload284).scale) + + let ptr285 = mbt_ffi_str2ptr((payload284).unit) + mbt_ffi_store32((iter_base) + 80, (payload284).unit.length()) + mbt_ffi_store32((iter_base) + 76, ptr285) + + () + } + } + + () + } + UnionType(payload286) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let address322 = mbt_ffi_malloc(((payload286).branches).length() * 92); + for index323 = 0; index323 < ((payload286).branches).length(); index323 = index323 + 1 { + let iter_elem : @types.UnionBranch = ((payload286).branches)[(index323)] + let iter_base = address322 + (index323 * 92); + + let ptr287 = mbt_ffi_str2ptr((iter_elem).tag) + mbt_ffi_store32((iter_base) + 4, (iter_elem).tag.length()) + mbt_ffi_store32((iter_base) + 0, ptr287) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (iter_elem).discriminator { + Prefix(payload288) => { + mbt_ffi_store8((iter_base) + 12, (0)) + + let ptr289 = mbt_ffi_str2ptr(payload288) + mbt_ffi_store32((iter_base) + 20, payload288.length()) + mbt_ffi_store32((iter_base) + 16, ptr289) + + () + } + Suffix(payload290) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr291 = mbt_ffi_str2ptr(payload290) + mbt_ffi_store32((iter_base) + 20, payload290.length()) + mbt_ffi_store32((iter_base) + 16, ptr291) + + () + } + Contains(payload292) => { + mbt_ffi_store8((iter_base) + 12, (2)) + + let ptr293 = mbt_ffi_str2ptr(payload292) + mbt_ffi_store32((iter_base) + 20, payload292.length()) + mbt_ffi_store32((iter_base) + 16, ptr293) + + () + } + Regex(payload294) => { + mbt_ffi_store8((iter_base) + 12, (3)) + + let ptr295 = mbt_ffi_str2ptr(payload294) + mbt_ffi_store32((iter_base) + 20, payload294.length()) + mbt_ffi_store32((iter_base) + 16, ptr295) + + () + } + FieldEquals(payload296) => { + mbt_ffi_store8((iter_base) + 12, (4)) + + let ptr297 = mbt_ffi_str2ptr((payload296).field_name) + mbt_ffi_store32((iter_base) + 20, (payload296).field_name.length()) + mbt_ffi_store32((iter_base) + 16, ptr297) + + match ((payload296).literal) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload299) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let ptr300 = mbt_ffi_str2ptr(payload299) + mbt_ffi_store32((iter_base) + 32, payload299.length()) + mbt_ffi_store32((iter_base) + 28, ptr300) + + () + } + } + + () + } + FieldAbsent(payload301) => { + mbt_ffi_store8((iter_base) + 12, (5)) + + let ptr302 = mbt_ffi_str2ptr(payload301) + mbt_ffi_store32((iter_base) + 20, payload301.length()) + mbt_ffi_store32((iter_base) + 16, ptr302) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload304) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr305 = mbt_ffi_str2ptr(payload304) + mbt_ffi_store32((iter_base) + 44, payload304.length()) + mbt_ffi_store32((iter_base) + 40, ptr305) + + () + } + } + + let address307 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index308 = 0; index308 < (((iter_elem).metadata).aliases).length(); index308 = index308 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index308)] + let iter_base = address307 + (index308 * 8); + + let ptr306 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr306) + + } + mbt_ffi_store32((iter_base) + 52, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 48, address307) + + let address310 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index311 = 0; index311 < (((iter_elem).metadata).examples).length(); index311 = index311 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index311)] + let iter_base = address310 + (index311 * 8); + + let ptr309 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr309) + + } + mbt_ffi_store32((iter_base) + 60, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 56, address310) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload313) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr314 = mbt_ffi_str2ptr(payload313) + mbt_ffi_store32((iter_base) + 72, payload313.length()) + mbt_ffi_store32((iter_base) + 68, ptr314) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 76, (0)) + + () + } + Some(payload316) => { + mbt_ffi_store8((iter_base) + 76, (1)) + + match payload316 { + Multimodal => { + mbt_ffi_store8((iter_base) + 80, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 80, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 80, (2)) + + () + } + Other(payload320) => { + mbt_ffi_store8((iter_base) + 80, (3)) + + let ptr321 = mbt_ffi_str2ptr(payload320) + mbt_ffi_store32((iter_base) + 88, payload320.length()) + mbt_ffi_store32((iter_base) + 84, ptr321) + + () + } + } + + () + } + } + + } + mbt_ffi_store32((iter_base) + 12, ((payload286).branches).length()) + mbt_ffi_store32((iter_base) + 8, address322) + + () + } + SecretType(payload324) => { + mbt_ffi_store8((iter_base) + 0, (32)) + mbt_ffi_store32((iter_base) + 8, (payload324).inner) + + match ((payload324).category) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload326) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr327 = mbt_ffi_str2ptr(payload326) + mbt_ffi_store32((iter_base) + 20, payload326.length()) + mbt_ffi_store32((iter_base) + 16, ptr327) + + () + } + } + + () + } + QuotaTokenType(payload328) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + match ((payload328).resource_name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload330) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr331 = mbt_ffi_str2ptr(payload330) + mbt_ffi_store32((iter_base) + 16, payload330.length()) + mbt_ffi_store32((iter_base) + 12, ptr331) + + () + } + } + + () + } + PermissionCardType(payload332) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store8((iter_base) + 8, (if (payload332).polymorphic { 1 } else { 0 })) + + () + } + FutureType(payload333) => { + mbt_ffi_store8((iter_base) + 0, (35)) + + match (payload333) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload335) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload335) + + () + } + } + + () + } + StreamType(payload336) => { + mbt_ffi_store8((iter_base) + 0, (36)) + + match (payload336) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload338) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload338) + + () + } + } + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 88, (0)) + + () + } + Some(payload340) => { + mbt_ffi_store8((iter_base) + 88, (1)) + + let ptr341 = mbt_ffi_str2ptr(payload340) + mbt_ffi_store32((iter_base) + 96, payload340.length()) + mbt_ffi_store32((iter_base) + 92, ptr341) + + () + } + } + + let address343 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index344 = 0; index344 < (((iter_elem).metadata).aliases).length(); index344 = index344 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index344)] + let iter_base = address343 + (index344 * 8); + + let ptr342 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr342) + + } + mbt_ffi_store32((iter_base) + 104, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 100, address343) + + let address346 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index347 = 0; index347 < (((iter_elem).metadata).examples).length(); index347 = index347 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index347)] + let iter_base = address346 + (index347 * 8); + + let ptr345 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr345) + + } + mbt_ffi_store32((iter_base) + 112, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 108, address346) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 116, (0)) + + () + } + Some(payload349) => { + mbt_ffi_store8((iter_base) + 116, (1)) + + let ptr350 = mbt_ffi_str2ptr(payload349) + mbt_ffi_store32((iter_base) + 124, payload349.length()) + mbt_ffi_store32((iter_base) + 120, ptr350) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 128, (0)) + + () + } + Some(payload352) => { + mbt_ffi_store8((iter_base) + 128, (1)) + + match payload352 { + Multimodal => { + mbt_ffi_store8((iter_base) + 132, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 132, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 132, (2)) + + () + } + Other(payload356) => { + mbt_ffi_store8((iter_base) + 132, (3)) + + let ptr357 = mbt_ffi_str2ptr(payload356) + mbt_ffi_store32((iter_base) + 140, payload356.length()) + mbt_ffi_store32((iter_base) + 136, ptr357) + + () + } + } + + () + } + } + + } + mbt_ffi_store32((lower_ptr + 12) + 4, (((input).graph).type_nodes).length()) + mbt_ffi_store32((lower_ptr + 12) + 0, address358) + + let address364 = mbt_ffi_malloc((((input).graph).defs).length() * 24); + for index365 = 0; index365 < (((input).graph).defs).length(); index365 = index365 + 1 { + let iter_elem : @types.SchemaTypeDef = (((input).graph).defs)[(index365)] + let iter_base = address364 + (index365 * 24); + + let ptr360 = mbt_ffi_str2ptr((iter_elem).id) + mbt_ffi_store32((iter_base) + 4, (iter_elem).id.length()) + mbt_ffi_store32((iter_base) + 0, ptr360) + + match ((iter_elem).name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload362) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr363 = mbt_ffi_str2ptr(payload362) + mbt_ffi_store32((iter_base) + 16, payload362.length()) + mbt_ffi_store32((iter_base) + 12, ptr363) + + () + } + } + mbt_ffi_store32((iter_base) + 20, (iter_elem).body) + + } + mbt_ffi_store32((lower_ptr + 12) + 12, (((input).graph).defs).length()) + mbt_ffi_store32((lower_ptr + 12) + 8, address364) + mbt_ffi_store32((lower_ptr + 12) + 16, ((input).graph).root) + + let address437 = mbt_ffi_malloc((((input).value).value_nodes).length() * 32); + for index438 = 0; index438 < (((input).value).value_nodes).length(); index438 = index438 + 1 { + let iter_elem : @types.SchemaValueNode = (((input).value).value_nodes)[(index438)] + let iter_base = address437 + (index438 * 32); + + match iter_elem { + BoolValue(payload366) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload366 { 1 } else { 0 })) + + () + } + S8Value(payload367) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload367)) + + () + } + S16Value(payload368) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload368)) + + () + } + S32Value(payload369) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload369) + + () + } + S64Value(payload370) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload370) + + () + } + U8Value(payload371) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload371).to_int()) + + () + } + U16Value(payload372) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload372).reinterpret_as_int()) + + () + } + U32Value(payload373) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload373).reinterpret_as_int()) + + () + } + U64Value(payload374) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload374).reinterpret_as_int64()) + + () + } + F32Value(payload375) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload375) + + () + } + F64Value(payload376) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload376) + + () + } + CharValue(payload377) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload377).to_int()) + + () + } + StringValue(payload378) => { + mbt_ffi_store8((iter_base) + 0, (12)) + + let ptr379 = mbt_ffi_str2ptr(payload378) + mbt_ffi_store32((iter_base) + 12, payload378.length()) + mbt_ffi_store32((iter_base) + 8, ptr379) + + () + } + RecordValue(payload380) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let address381 = mbt_ffi_malloc((payload380).length() * 4); + for index382 = 0; index382 < (payload380).length(); index382 = index382 + 1 { + let iter_elem : Int = (payload380)[(index382)] + let iter_base = address381 + (index382 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload380).length()) + mbt_ffi_store32((iter_base) + 8, address381) + + () + } + VariantValue(payload383) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload383).case).reinterpret_as_int()) + + match ((payload383).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload385) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload385) + + () + } + } + + () + } + EnumValue(payload386) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload386).reinterpret_as_int()) + + () + } + FlagsValue(payload387) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address388 = mbt_ffi_malloc((payload387).length() * 1); + for index389 = 0; index389 < (payload387).length(); index389 = index389 + 1 { + let iter_elem : Bool = (payload387)[(index389)] + let iter_base = address388 + (index389 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload387).length()) + mbt_ffi_store32((iter_base) + 8, address388) + + () + } + TupleValue(payload390) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address391 = mbt_ffi_malloc((payload390).length() * 4); + for index392 = 0; index392 < (payload390).length(); index392 = index392 + 1 { + let iter_elem : Int = (payload390)[(index392)] + let iter_base = address391 + (index392 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload390).length()) + mbt_ffi_store32((iter_base) + 8, address391) + + () + } + ListValue(payload393) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address394 = mbt_ffi_malloc((payload393).length() * 4); + for index395 = 0; index395 < (payload393).length(); index395 = index395 + 1 { + let iter_elem : Int = (payload393)[(index395)] + let iter_base = address394 + (index395 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload393).length()) + mbt_ffi_store32((iter_base) + 8, address394) + + () + } + FixedListValue(payload396) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address397 = mbt_ffi_malloc((payload396).length() * 4); + for index398 = 0; index398 < (payload396).length(); index398 = index398 + 1 { + let iter_elem : Int = (payload396)[(index398)] + let iter_base = address397 + (index398 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload396).length()) + mbt_ffi_store32((iter_base) + 8, address397) + + () + } + MapValue(payload399) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let address400 = mbt_ffi_malloc((payload399).length() * 8); + for index401 = 0; index401 < (payload399).length(); index401 = index401 + 1 { + let iter_elem : @types.MapEntry = (payload399)[(index401)] + let iter_base = address400 + (index401 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload399).length()) + mbt_ffi_store32((iter_base) + 8, address400) + + () + } + OptionValue(payload402) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + match (payload402) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload404) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload404) + + () + } + } + + () + } + ResultValue(payload405) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload405 { + OkValue(payload406) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload406) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload408) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload408) + + () + } + } + + () + } + ErrValue(payload409) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload409) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload411) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload411) + + () + } + } + + () + } + } + + () + } + TextValue(payload412) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr413 = mbt_ffi_str2ptr((payload412).text) + mbt_ffi_store32((iter_base) + 12, (payload412).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr413) + + match ((payload412).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload415) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr416 = mbt_ffi_str2ptr(payload415) + mbt_ffi_store32((iter_base) + 24, payload415.length()) + mbt_ffi_store32((iter_base) + 20, ptr416) + + () + } + } + + () + } + BinaryValue(payload417) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr418 = mbt_ffi_bytes2ptr((payload417).bytes) + + mbt_ffi_store32((iter_base) + 12, (payload417).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr418) + + match ((payload417).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload420) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr421 = mbt_ffi_str2ptr(payload420) + mbt_ffi_store32((iter_base) + 24, payload420.length()) + mbt_ffi_store32((iter_base) + 20, ptr421) + + () + } + } + + () + } + PathValue(payload422) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr423 = mbt_ffi_str2ptr(payload422) + mbt_ffi_store32((iter_base) + 12, payload422.length()) + mbt_ffi_store32((iter_base) + 8, ptr423) + + () + } + UrlValue(payload424) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr425 = mbt_ffi_str2ptr(payload424) + mbt_ffi_store32((iter_base) + 12, payload424.length()) + mbt_ffi_store32((iter_base) + 8, ptr425) + + () + } + DatetimeValue(payload426) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload426).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload426).nanoseconds).reinterpret_as_int()) + + () + } + DurationValue(payload427) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload427).nanoseconds) + + () + } + QuantityValueNode(payload428) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload428).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload428).scale) + + let ptr429 = mbt_ffi_str2ptr((payload428).unit) + mbt_ffi_store32((iter_base) + 24, (payload428).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr429) + + () + } + UnionValue(payload430) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr431 = mbt_ffi_str2ptr((payload430).tag) + mbt_ffi_store32((iter_base) + 12, (payload430).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr431) + mbt_ffi_store32((iter_base) + 16, (payload430).body) + + () + } + SecretValue(payload432) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let @types.Secret(handle) = payload432 + mbt_ffi_store32((iter_base) + 8, handle) + + () + } + QuotaTokenHandle(payload433) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let @types.QuotaToken(handle434) = payload433 + mbt_ffi_store32((iter_base) + 8, handle434) + + () + } + PermissionCardHandle(payload435) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let @types.PermissionCard(handle436) = payload435 + mbt_ffi_store32((iter_base) + 8, handle436) + + () + } + } + + } + mbt_ffi_store32((lower_ptr + 12) + 24, (((input).value).value_nodes).length()) + mbt_ffi_store32((lower_ptr + 12) + 20, address437) + mbt_ffi_store32((lower_ptr + 12) + 28, ((input).value).root) + + match (stdin) { + None => { + mbt_ffi_store8((lower_ptr + 44) + 0, (0)) + + () + } + Some(payload0) => { + mbt_ffi_store8((lower_ptr + 44) + 0, (1)) + mbt_ffi_store32((lower_ptr + 44) + 4, wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamLower(payload0)) + + () + } + } + + let result_ptr = mbt_ffi_malloc(48 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodToolRpcInvokeAndAwait(lower_ptr, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + + for index = 0; index < (mbt_ffi_load32((lower_ptr) + 8)); index = index + 1 { + let iter_base = (mbt_ffi_load32((lower_ptr) + 4)) + (index * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 4)) + + for index20 = 0; index20 < (mbt_ffi_load32((lower_ptr) + 16)); index20 = index20 + 1 { + let iter_base = (mbt_ffi_load32((lower_ptr) + 12)) + (index20 * 144) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 3 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 5 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 7 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 8 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 9 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 10 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 11 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 12 => () + 13 => () + 14 => { + + for index2 = 0; index2 < (mbt_ffi_load32((iter_base) + 12)); index2 = index2 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index0 = 0; index0 < (mbt_ffi_load32((iter_base) + 28)); index0 = index0 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index0 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index1 = 0; index1 < (mbt_ffi_load32((iter_base) + 36)); index1 = index1 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index5 = 0; index5 < (mbt_ffi_load32((iter_base) + 12)); index5 = index5 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index5 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index3 = 0; index3 < (mbt_ffi_load32((iter_base) + 32)); index3 = index3 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index3 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index4 = 0; index4 < (mbt_ffi_load32((iter_base) + 40)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index4 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 16 => { + + for index6 = 0; index6 < (mbt_ffi_load32((iter_base) + 12)); index6 = index6 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index6 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + + for index7 = 0; index7 < (mbt_ffi_load32((iter_base) + 12)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index7 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 16)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index8 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + } + 25 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index9 = 0; index9 < (mbt_ffi_load32((iter_base) + 16)); index9 = index9 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index9 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 26 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 20)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index10 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + + for index11 = 0; index11 < (mbt_ffi_load32((iter_base) + 32)); index11 = index11 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index11 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 27 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index12 = 0; index12 < (mbt_ffi_load32((iter_base) + 16)); index12 = index12 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index12 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { + + for index13 = 0; index13 < (mbt_ffi_load32((iter_base) + 28)); index13 = index13 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index13 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index14 = 0; index14 < (mbt_ffi_load32((iter_base) + 20)); index14 = index14 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index14 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + } + _ => panic() + } + + } + 31 => { + + for index17 = 0; index17 < (mbt_ffi_load32((iter_base) + 12)); index17 = index17 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index17 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index15 = 0; index15 < (mbt_ffi_load32((iter_base) + 52)); index15 = index15 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index15 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index16 = 0; index16 < (mbt_ffi_load32((iter_base) + 60)); index16 = index16 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index16 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index18 = 0; index18 < (mbt_ffi_load32((iter_base) + 104)); index18 = index18 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index18 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index19 = 0; index19 < (mbt_ffi_load32((iter_base) + 112)); index19 = index19 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index19 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 12)) + + for index21 = 0; index21 < (mbt_ffi_load32((lower_ptr) + 24)); index21 = index21 + 1 { + let iter_base = (mbt_ffi_load32((lower_ptr) + 20)) + (index21 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 20)) + + for index22 = 0; index22 < (mbt_ffi_load32((lower_ptr) + 36)); index22 = index22 + 1 { + let iter_base = (mbt_ffi_load32((lower_ptr) + 32)) + (index22 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => { + @types.Secret::Secret(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 32 => { + @types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 33 => { + @types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8)).drop() + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 32)) + + match (mbt_ffi_load8_u((lower_ptr) + 44)) { + 0 => () + 1 => { + let result = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamLift(mbt_ffi_load32((lower_ptr) + 48)) + result.drop_sync() + + } + _ => panic() + } + + } else { + + for index = 0; index < (mbt_ffi_load32((lower_ptr) + 8)); index = index + 1 { + let iter_base = (mbt_ffi_load32((lower_ptr) + 4)) + (index * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 4)) + + for index20 = 0; index20 < (mbt_ffi_load32((lower_ptr) + 16)); index20 = index20 + 1 { + let iter_base = (mbt_ffi_load32((lower_ptr) + 12)) + (index20 * 144) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 3 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 5 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 7 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 8 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 9 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 10 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 11 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 12 => () + 13 => () + 14 => { + + for index2 = 0; index2 < (mbt_ffi_load32((iter_base) + 12)); index2 = index2 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index2 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index0 = 0; index0 < (mbt_ffi_load32((iter_base) + 28)); index0 = index0 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index0 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index1 = 0; index1 < (mbt_ffi_load32((iter_base) + 36)); index1 = index1 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index1 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index5 = 0; index5 < (mbt_ffi_load32((iter_base) + 12)); index5 = index5 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index5 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index3 = 0; index3 < (mbt_ffi_load32((iter_base) + 32)); index3 = index3 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index3 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index4 = 0; index4 < (mbt_ffi_load32((iter_base) + 40)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index4 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 16 => { + + for index6 = 0; index6 < (mbt_ffi_load32((iter_base) + 12)); index6 = index6 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index6 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + + for index7 = 0; index7 < (mbt_ffi_load32((iter_base) + 12)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index7 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 16)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index8 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + } + 25 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index9 = 0; index9 < (mbt_ffi_load32((iter_base) + 16)); index9 = index9 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index9 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 26 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 20)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index10 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + + for index11 = 0; index11 < (mbt_ffi_load32((iter_base) + 32)); index11 = index11 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index11 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 27 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index12 = 0; index12 < (mbt_ffi_load32((iter_base) + 16)); index12 = index12 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index12 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { + + for index13 = 0; index13 < (mbt_ffi_load32((iter_base) + 28)); index13 = index13 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index13 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index14 = 0; index14 < (mbt_ffi_load32((iter_base) + 20)); index14 = index14 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index14 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + } + _ => panic() + } + + } + 31 => { + + for index17 = 0; index17 < (mbt_ffi_load32((iter_base) + 12)); index17 = index17 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index17 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index15 = 0; index15 < (mbt_ffi_load32((iter_base) + 52)); index15 = index15 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index15 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index16 = 0; index16 < (mbt_ffi_load32((iter_base) + 60)); index16 = index16 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index16 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index18 = 0; index18 < (mbt_ffi_load32((iter_base) + 104)); index18 = index18 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index18 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index19 = 0; index19 < (mbt_ffi_load32((iter_base) + 112)); index19 = index19 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index19 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 12)) + + for index21 = 0; index21 < (mbt_ffi_load32((lower_ptr) + 24)); index21 = index21 + 1 { + let iter_base = (mbt_ffi_load32((lower_ptr) + 20)) + (index21 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 20)) + + for index22 = 0; index22 < (mbt_ffi_load32((lower_ptr) + 36)); index22 = index22 + 1 { + let iter_base = (mbt_ffi_load32((lower_ptr) + 32)) + (index22 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => () + 32 => () + 33 => () + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 32)) + + match (mbt_ffi_load8_u((lower_ptr) + 44)) { + 0 => () + 1 => { + wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamCommit(mbt_ffi_load32((lower_ptr) + 48)) + + } + _ => panic() + } + + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => { + + for index19 = 0; index19 < (mbt_ffi_load32((result_ptr) + 12)); index19 = index19 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 8)) + (index19 * 144) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 3 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 5 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 7 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 8 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 9 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 10 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 11 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 12 => () + 13 => () + 14 => { + + for index1 = 0; index1 < (mbt_ffi_load32((iter_base) + 12)); index1 = index1 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index = 0; index < (mbt_ffi_load32((iter_base) + 28)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index0 = 0; index0 < (mbt_ffi_load32((iter_base) + 36)); index0 = index0 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index0 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index4 = 0; index4 < (mbt_ffi_load32((iter_base) + 12)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index4 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index2 = 0; index2 < (mbt_ffi_load32((iter_base) + 32)); index2 = index2 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index3 = 0; index3 < (mbt_ffi_load32((iter_base) + 40)); index3 = index3 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index3 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 16 => { + + for index5 = 0; index5 < (mbt_ffi_load32((iter_base) + 12)); index5 = index5 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index5 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + + for index6 = 0; index6 < (mbt_ffi_load32((iter_base) + 12)); index6 = index6 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index6 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index7 = 0; index7 < (mbt_ffi_load32((iter_base) + 16)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index7 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + } + 25 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 16)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index8 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 26 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + + for index9 = 0; index9 < (mbt_ffi_load32((iter_base) + 20)); index9 = index9 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index9 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 32)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index10 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 27 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index11 = 0; index11 < (mbt_ffi_load32((iter_base) + 16)); index11 = index11 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index11 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { + + for index12 = 0; index12 < (mbt_ffi_load32((iter_base) + 28)); index12 = index12 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index12 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index13 = 0; index13 < (mbt_ffi_load32((iter_base) + 20)); index13 = index13 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index13 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + } + _ => panic() + } + + } + 31 => { + + for index16 = 0; index16 < (mbt_ffi_load32((iter_base) + 12)); index16 = index16 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index16 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index14 = 0; index14 < (mbt_ffi_load32((iter_base) + 52)); index14 = index14 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index14 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index15 = 0; index15 < (mbt_ffi_load32((iter_base) + 60)); index15 = index15 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index15 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index17 = 0; index17 < (mbt_ffi_load32((iter_base) + 104)); index17 = index17 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index17 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index18 = 0; index18 < (mbt_ffi_load32((iter_base) + 112)); index18 = index18 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index18 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + for index20 = 0; index20 < (mbt_ffi_load32((result_ptr) + 20)); index20 = index20 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 16)) + (index20 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 16)) + + for index21 = 0; index21 < (mbt_ffi_load32((result_ptr) + 32)); index21 = index21 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 28)) + (index21 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => { + @types.Secret::Secret(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 32 => { + @types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 33 => { + @types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8)).drop() + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 28)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((result_ptr) + 40)) { + 0 => () + 1 => { + let result = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamLift(mbt_ffi_load32((result_ptr) + 44)) + result.drop_sync() + + } + _ => panic() + } + + } + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 4 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + 1 => { + + for index22 = 0; index22 < (mbt_ffi_load32((result_ptr) + 16)); index22 = index22 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 12)) + (index22 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + 5 => { + + for index43 = 0; index43 < (mbt_ffi_load32((result_ptr) + 16)); index43 = index43 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 12)) + (index43 * 144) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 3 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 5 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 7 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 8 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 9 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 10 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 11 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 12 => () + 13 => () + 14 => { + + for index25 = 0; index25 < (mbt_ffi_load32((iter_base) + 12)); index25 = index25 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index25 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index23 = 0; index23 < (mbt_ffi_load32((iter_base) + 28)); index23 = index23 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index23 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index24 = 0; index24 < (mbt_ffi_load32((iter_base) + 36)); index24 = index24 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index24 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index28 = 0; index28 < (mbt_ffi_load32((iter_base) + 12)); index28 = index28 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index28 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index26 = 0; index26 < (mbt_ffi_load32((iter_base) + 32)); index26 = index26 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index26 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index27 = 0; index27 < (mbt_ffi_load32((iter_base) + 40)); index27 = index27 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index27 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 16 => { + + for index29 = 0; index29 < (mbt_ffi_load32((iter_base) + 12)); index29 = index29 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index29 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + + for index30 = 0; index30 < (mbt_ffi_load32((iter_base) + 12)); index30 = index30 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index30 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index31 = 0; index31 < (mbt_ffi_load32((iter_base) + 16)); index31 = index31 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index31 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + } + 25 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index32 = 0; index32 < (mbt_ffi_load32((iter_base) + 16)); index32 = index32 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index32 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 26 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + + for index33 = 0; index33 < (mbt_ffi_load32((iter_base) + 20)); index33 = index33 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index33 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + + for index34 = 0; index34 < (mbt_ffi_load32((iter_base) + 32)); index34 = index34 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index34 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 27 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + for index35 = 0; index35 < (mbt_ffi_load32((iter_base) + 16)); index35 = index35 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index35 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { + + for index36 = 0; index36 < (mbt_ffi_load32((iter_base) + 28)); index36 = index36 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index36 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + for index37 = 0; index37 < (mbt_ffi_load32((iter_base) + 20)); index37 = index37 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index37 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) + + } + _ => panic() + } + + } + 31 => { + + for index40 = 0; index40 < (mbt_ffi_load32((iter_base) + 12)); index40 = index40 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index40 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index38 = 0; index38 < (mbt_ffi_load32((iter_base) + 52)); index38 = index38 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index38 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index39 = 0; index39 < (mbt_ffi_load32((iter_base) + 60)); index39 = index39 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index39 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index41 = 0; index41 < (mbt_ffi_load32((iter_base) + 104)); index41 = index41 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index41 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index42 = 0; index42 < (mbt_ffi_load32((iter_base) + 112)); index42 = index42 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index42 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + for index44 = 0; index44 < (mbt_ffi_load32((result_ptr) + 24)); index44 = index44 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 20)) + (index44 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) + + for index45 = 0; index45 < (mbt_ffi_load32((result_ptr) + 36)); index45 = index45 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 32)) + (index45 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => { + @types.Secret::Secret(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 32 => { + @types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 33 => { + @types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8)).drop() + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 32)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted480 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + let lifted230 : @types.TypedSchemaValue? = match mbt_ffi_load8_u((result_ptr) + 4) { + 0 => Option::None + 1 => { + + let array192 : Array[@types.SchemaTypeNode] = []; + for index193 = 0; index193 < (mbt_ffi_load32((result_ptr) + 12)); index193 = index193 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 8)) + (index193 * 144) + + let lifted178 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted4 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted0 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted) + } + _ => panic() + } + + let lifted2 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted1 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted1) + } + _ => panic() + } + + let lifted3 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted0, max : lifted2, unit : lifted3}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted4) + } + 3 => { + + let lifted11 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted6 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted5 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted5) + } + _ => panic() + } + + let lifted8 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted7 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted7) + } + _ => panic() + } + + let lifted10 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result9 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result9) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted6, max : lifted8, unit : lifted10}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted11) + } + 4 => { + + let lifted18 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted13 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted12 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted12) + } + _ => panic() + } + + let lifted15 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted14 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted14) + } + _ => panic() + } + + let lifted17 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result16 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result16) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted13, max : lifted15, unit : lifted17}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted18) + } + 5 => { + + let lifted25 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted20 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted19 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted19) + } + _ => panic() + } + + let lifted22 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted21 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted21) + } + _ => panic() + } + + let lifted24 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result23) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted20, max : lifted22, unit : lifted24}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted25) + } + 6 => { + + let lifted32 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted27 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted26 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted26) + } + _ => panic() + } + + let lifted29 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted28 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted28) + } + _ => panic() + } + + let lifted31 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result30 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result30) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted27, max : lifted29, unit : lifted31}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted32) + } + 7 => { + + let lifted39 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted34 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted33 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted33) + } + _ => panic() + } + + let lifted36 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted35 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted35) + } + _ => panic() + } + + let lifted38 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result37 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result37) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted34, max : lifted36, unit : lifted38}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted39) + } + 8 => { + + let lifted46 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted41 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted40 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted40) + } + _ => panic() + } + + let lifted43 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted42 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted42) + } + _ => panic() + } + + let lifted45 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result44 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result44) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted41, max : lifted43, unit : lifted45}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted46) + } + 9 => { + + let lifted53 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted48 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted47 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted47) + } + _ => panic() + } + + let lifted50 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted49 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted49) + } + _ => panic() + } + + let lifted52 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result51 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result51) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted48, max : lifted50, unit : lifted52}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted53) + } + 10 => { + + let lifted60 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted55 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted54 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted54) + } + _ => panic() + } + + let lifted57 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted56 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted56) + } + _ => panic() + } + + let lifted59 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result58 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result58) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted55, max : lifted57, unit : lifted59}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted60) + } + 11 => { + + let lifted67 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted62 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted61 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted61) + } + _ => panic() + } + + let lifted64 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted63 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted63) + } + _ => panic() + } + + let lifted66 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result65 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result65) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted62, max : lifted64, unit : lifted66}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted67) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array80 : Array[@types.NamedFieldType] = []; + for index81 = 0; index81 < (mbt_ffi_load32((iter_base) + 12)); index81 = index81 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index81 * 68) + + let result68 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted70 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result69 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result69) + } + _ => panic() + } + + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 28)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index * 8) + + let result71 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result71) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array73 : Array[String] = []; + for index74 = 0; index74 < (mbt_ffi_load32((iter_base) + 36)); index74 = index74 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index74 * 8) + + let result72 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array73.push(result72) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted76 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result75 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result75) + } + _ => panic() + } + + let lifted79 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted78 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result77 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result77) + } + _ => panic() + } + + Option::Some(lifted78) + } + _ => panic() + } + + array80.push(@types.NamedFieldType::{name : result68, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted70, aliases : array, examples : array73, deprecated : lifted76, role : lifted79}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array80) + } + 15 => { + + let array97 : Array[@types.VariantCaseType] = []; + for index98 = 0; index98 < (mbt_ffi_load32((iter_base) + 12)); index98 = index98 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index98 * 72) + + let result82 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted83 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted85 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result84 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result84) + } + _ => panic() + } + + let array87 : Array[String] = []; + for index88 = 0; index88 < (mbt_ffi_load32((iter_base) + 32)); index88 = index88 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index88 * 8) + + let result86 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array87.push(result86) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array90 : Array[String] = []; + for index91 = 0; index91 < (mbt_ffi_load32((iter_base) + 40)); index91 = index91 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index91 * 8) + + let result89 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array90.push(result89) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted93 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result92 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result92) + } + _ => panic() + } + + let lifted96 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted95 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result94 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result94) + } + _ => panic() + } + + Option::Some(lifted95) + } + _ => panic() + } + + array97.push(@types.VariantCaseType::{name : result82, payload : lifted83, metadata : @types.MetadataEnvelope::{doc : lifted85, aliases : array87, examples : array90, deprecated : lifted93, role : lifted96}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array97) + } + 16 => { + + let array100 : Array[String] = []; + for index101 = 0; index101 < (mbt_ffi_load32((iter_base) + 12)); index101 = index101 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index101 * 8) + + let result99 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array100.push(result99) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array100) + } + 17 => { + + let array103 : Array[String] = []; + for index104 = 0; index104 < (mbt_ffi_load32((iter_base) + 12)); index104 = index104 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index104 * 8) + + let result102 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array103.push(result102) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array103) + } + 18 => { + + let array105 : Array[Int] = []; + for index106 = 0; index106 < (mbt_ffi_load32((iter_base) + 12)); index106 = index106 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index106 * 4) + + array105.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array105) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted107 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted108 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted107, err : lifted108}) + } + 24 => { + + let lifted112 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array110 : Array[String] = []; + for index111 = 0; index111 < (mbt_ffi_load32((iter_base) + 16)); index111 = index111 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index111 * 8) + + let result109 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array110.push(result109) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array110) + } + _ => panic() + } + + let lifted113 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted114 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted116 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result115 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result115) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted112, min_length : lifted113, max_length : lifted114, regex : lifted116}) + } + 25 => { + + let lifted120 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array118 : Array[String] = []; + for index119 = 0; index119 < (mbt_ffi_load32((iter_base) + 16)); index119 = index119 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index119 * 8) + + let result117 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array118.push(result117) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array118) + } + _ => panic() + } + + let lifted121 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted122 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted120, min_bytes : lifted121, max_bytes : lifted122}) + } + 26 => { + + let lifted126 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array124 : Array[String] = []; + for index125 = 0; index125 < (mbt_ffi_load32((iter_base) + 20)); index125 = index125 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index125 * 8) + + let result123 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array124.push(result123) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array124) + } + _ => panic() + } + + let lifted130 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array128 : Array[String] = []; + for index129 = 0; index129 < (mbt_ffi_load32((iter_base) + 32)); index129 = index129 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index129 * 8) + + let result127 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array128.push(result127) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array128) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted126, allowed_extensions : lifted130}) + } + 27 => { + + let lifted134 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array132 : Array[String] = []; + for index133 = 0; index133 < (mbt_ffi_load32((iter_base) + 16)); index133 = index133 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index133 * 8) + + let result131 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array132.push(result131) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array132) + } + _ => panic() + } + + let lifted138 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array136 : Array[String] = []; + for index137 = 0; index137 < (mbt_ffi_load32((iter_base) + 28)); index137 = index137 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index137 * 8) + + let result135 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array136.push(result135) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array136) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted134, allowed_hosts : lifted138}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result139 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array141 : Array[String] = []; + for index142 = 0; index142 < (mbt_ffi_load32((iter_base) + 20)); index142 = index142 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index142 * 8) + + let result140 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array141.push(result140) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted144 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result143 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result143}) + } + _ => panic() + } + + let lifted146 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result145 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result145}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result139, allowed_suffixes : array141, min : lifted144, max : lifted146}) + } + 31 => { + + let array170 : Array[@types.UnionBranch] = []; + for index171 = 0; index171 < (mbt_ffi_load32((iter_base) + 12)); index171 = index171 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index171 * 92) + + let result147 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted156 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result148 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result148) + } + 1 => { + + let result149 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result149) + } + 2 => { + + let result150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result150) + } + 3 => { + + let result151 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result151) + } + 4 => { + + let result152 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted154 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result153) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result152, literal : lifted154}) + } + 5 => { + + let result155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result155) + } + _ => panic() + } + + let lifted158 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result157 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result157) + } + _ => panic() + } + + let array160 : Array[String] = []; + for index161 = 0; index161 < (mbt_ffi_load32((iter_base) + 52)); index161 = index161 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index161 * 8) + + let result159 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array160.push(result159) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array163 : Array[String] = []; + for index164 = 0; index164 < (mbt_ffi_load32((iter_base) + 60)); index164 = index164 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index164 * 8) + + let result162 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array163.push(result162) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted166 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result165 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result165) + } + _ => panic() + } + + let lifted169 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted168 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result167 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result167) + } + _ => panic() + } + + Option::Some(lifted168) + } + _ => panic() + } + + array170.push(@types.UnionBranch::{tag : result147, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted156, metadata : @types.MetadataEnvelope::{doc : lifted158, aliases : array160, examples : array163, deprecated : lifted166, role : lifted169}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array170}) + } + 32 => { + + let lifted173 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result172 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result172) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted173}) + } + 33 => { + + let lifted175 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result174 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result174) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted175}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted176 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted176) + } + 36 => { + + let lifted177 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted177) + } + _ => panic() + } + + let lifted180 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result179 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result179) + } + _ => panic() + } + + let array182 : Array[String] = []; + for index183 = 0; index183 < (mbt_ffi_load32((iter_base) + 104)); index183 = index183 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index183 * 8) + + let result181 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array182.push(result181) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array185 : Array[String] = []; + for index186 = 0; index186 < (mbt_ffi_load32((iter_base) + 112)); index186 = index186 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index186 * 8) + + let result184 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array185.push(result184) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted188 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result187 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result187) + } + _ => panic() + } + + let lifted191 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted190 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result189 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result189) + } + _ => panic() + } + + Option::Some(lifted190) + } + _ => panic() + } + + array192.push(@types.SchemaTypeNode::{body : lifted178, metadata : @types.MetadataEnvelope::{doc : lifted180, aliases : array182, examples : array185, deprecated : lifted188, role : lifted191}}) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + let array197 : Array[@types.SchemaTypeDef] = []; + for index198 = 0; index198 < (mbt_ffi_load32((result_ptr) + 20)); index198 = index198 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 16)) + (index198 * 24) + + let result194 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted196 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result195 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result195) + } + _ => panic() + } + + array197.push(@types.SchemaTypeDef::{id : result194, name : lifted196, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 16)) + + let array228 : Array[@types.SchemaValueNode] = []; + for index229 = 0; index229 < (mbt_ffi_load32((result_ptr) + 32)); index229 = index229 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 28)) + (index229 * 32) + + let lifted227 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result199 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result199) + } + 13 => { + + let array200 : Array[Int] = []; + for index201 = 0; index201 < (mbt_ffi_load32((iter_base) + 12)); index201 = index201 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index201 * 4) + + array200.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array200) + } + 14 => { + + let lifted202 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted202}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array203 : Array[Bool] = []; + for index204 = 0; index204 < (mbt_ffi_load32((iter_base) + 12)); index204 = index204 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index204 * 1) + + array203.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array203) + } + 17 => { + + let array205 : Array[Int] = []; + for index206 = 0; index206 < (mbt_ffi_load32((iter_base) + 12)); index206 = index206 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index206 * 4) + + array205.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array205) + } + 18 => { + + let array207 : Array[Int] = []; + for index208 = 0; index208 < (mbt_ffi_load32((iter_base) + 12)); index208 = index208 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index208 * 4) + + array207.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array207) + } + 19 => { + + let array209 : Array[Int] = []; + for index210 = 0; index210 < (mbt_ffi_load32((iter_base) + 12)); index210 = index210 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index210 * 4) + + array209.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array209) + } + 20 => { + + let array211 : Array[@types.MapEntry] = []; + for index212 = 0; index212 < (mbt_ffi_load32((iter_base) + 12)); index212 = index212 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index212 * 8) + + array211.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array211) + } + 21 => { + + let lifted213 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted213) + } + 22 => { + + let lifted216 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted214 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted214) + } + 1 => { + + let lifted215 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted215) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted216) + } + 23 => { + + let result217 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted219 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result218 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result218) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result217, language : lifted219}) + } + 24 => { + + let result220 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted222 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result221 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result221) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result220, mime_type : lifted222}) + } + 25 => { + + let result223 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result223) + } + 26 => { + + let result224 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result224) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result225 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result225}) + } + 30 => { + + let result226 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result226, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array228.push(lifted227) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 28)) + + Option::Some(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array192, defs : array197, root : mbt_ffi_load32((result_ptr) + 24)}, value : @types.SchemaValueTree::{value_nodes : array228, root : mbt_ffi_load32((result_ptr) + 36)}}) + } + _ => panic() + } + + let lifted232 : @async-core.Stream[Byte]? = match mbt_ffi_load8_u((result_ptr) + 40) { + 0 => Option::None + 1 => { + let result231 = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamLift(mbt_ffi_load32((result_ptr) + 44)) + + Option::Some(result231) + } + _ => panic() + } + + Result::Ok(@common.InvocationResult::{result : lifted230, stdout : lifted232}) + } + 1 => { + + let lifted479 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + let result233 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + RpcError::ProtocolError(result233) + } + 1 => { + + let result234 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + RpcError::Denied(result234) + } + 2 => { + + let result235 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + RpcError::NotFound(result235) + } + 3 => { + + let result236 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + RpcError::RemoteInternalError(result236) + } + 4 => { + + let lifted478 = match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { + + let result237 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + @common.ToolError::InvalidToolName(result237) + } + 1 => { + + let array239 : Array[String] = []; + for index240 = 0; index240 < (mbt_ffi_load32((result_ptr) + 16)); index240 = index240 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 12)) + (index240 * 8) + + let result238 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array239.push(result238) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + @common.ToolError::InvalidCommandPath(array239) + } + 2 => { + + let result241 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + @common.ToolError::InvalidInput(result241) + } + 3 => { + + let result242 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + @common.ToolError::ConstraintViolation(result242) + } + 4 => { + + let result243 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + @common.ToolError::InvalidResult(result243) + } + 5 => { + + let array440 : Array[@types.SchemaTypeNode] = []; + for index441 = 0; index441 < (mbt_ffi_load32((result_ptr) + 16)); index441 = index441 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 12)) + (index441 * 144) + + let lifted426 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { + + @types.SchemaTypeBody::BoolType + } + 2 => { + + let lifted250 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted245 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted244 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted244) + } + _ => panic() + } + + let lifted247 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted246 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted246) + } + _ => panic() + } + + let lifted249 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result248 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result248) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted245, max : lifted247, unit : lifted249}) + } + _ => panic() + } + + @types.SchemaTypeBody::S8Type(lifted250) + } + 3 => { + + let lifted257 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted252 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted251 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted251) + } + _ => panic() + } + + let lifted254 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted253 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted253) + } + _ => panic() + } + + let lifted256 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result255 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result255) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted252, max : lifted254, unit : lifted256}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted257) + } + 4 => { + + let lifted264 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted259 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted258 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted258) + } + _ => panic() + } + + let lifted261 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted260 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted260) + } + _ => panic() + } + + let lifted263 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result262 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result262) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted259, max : lifted261, unit : lifted263}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted264) + } + 5 => { + + let lifted271 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted266 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted265 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted265) + } + _ => panic() + } + + let lifted268 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted267 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted267) + } + _ => panic() + } + + let lifted270 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result269 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result269) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted266, max : lifted268, unit : lifted270}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted271) + } + 6 => { + + let lifted278 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted273 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted272 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted272) + } + _ => panic() + } + + let lifted275 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted274 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted274) + } + _ => panic() + } + + let lifted277 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result276 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result276) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted273, max : lifted275, unit : lifted277}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted278) + } + 7 => { + + let lifted285 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted280 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted279 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted279) + } + _ => panic() + } + + let lifted282 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted281 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted281) + } + _ => panic() + } + + let lifted284 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result283 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result283) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted280, max : lifted282, unit : lifted284}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted285) + } + 8 => { + + let lifted292 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted287 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted286 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted286) + } + _ => panic() + } + + let lifted289 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted288 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted288) + } + _ => panic() + } + + let lifted291 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result290 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result290) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted287, max : lifted289, unit : lifted291}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted292) + } + 9 => { + + let lifted299 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted294 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted293 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted293) + } + _ => panic() + } + + let lifted296 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted295 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted295) + } + _ => panic() + } + + let lifted298 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result297 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result297) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted294, max : lifted296, unit : lifted298}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted299) + } + 10 => { + + let lifted306 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted301 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted300 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted300) + } + _ => panic() + } + + let lifted303 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted302 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted302) + } + _ => panic() + } + + let lifted305 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result304 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result304) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted301, max : lifted303, unit : lifted305}) + } + _ => panic() + } + + @types.SchemaTypeBody::F32Type(lifted306) + } + 11 => { + + let lifted313 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted308 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted307 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted307) + } + _ => panic() + } + + let lifted310 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted309 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted309) + } + _ => panic() + } + + let lifted312 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result311 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result311) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted308, max : lifted310, unit : lifted312}) + } + _ => panic() + } + + @types.SchemaTypeBody::F64Type(lifted313) + } + 12 => { + + @types.SchemaTypeBody::CharType + } + 13 => { + + @types.SchemaTypeBody::StringType + } + 14 => { + + let array328 : Array[@types.NamedFieldType] = []; + for index329 = 0; index329 < (mbt_ffi_load32((iter_base) + 12)); index329 = index329 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index329 * 68) + + let result314 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted316 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result315 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result315) + } + _ => panic() + } + + let array318 : Array[String] = []; + for index319 = 0; index319 < (mbt_ffi_load32((iter_base) + 28)); index319 = index319 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index319 * 8) + + let result317 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array318.push(result317) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array321 : Array[String] = []; + for index322 = 0; index322 < (mbt_ffi_load32((iter_base) + 36)); index322 = index322 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index322 * 8) + + let result320 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array321.push(result320) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted324 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result323 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result323) + } + _ => panic() + } + + let lifted327 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted326 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result325 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result325) + } + _ => panic() + } + + Option::Some(lifted326) + } + _ => panic() + } + + array328.push(@types.NamedFieldType::{name : result314, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted316, aliases : array318, examples : array321, deprecated : lifted324, role : lifted327}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array328) + } + 15 => { + + let array345 : Array[@types.VariantCaseType] = []; + for index346 = 0; index346 < (mbt_ffi_load32((iter_base) + 12)); index346 = index346 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index346 * 72) + + let result330 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted331 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted333 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result332 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result332) + } + _ => panic() + } + + let array335 : Array[String] = []; + for index336 = 0; index336 < (mbt_ffi_load32((iter_base) + 32)); index336 = index336 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index336 * 8) + + let result334 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array335.push(result334) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array338 : Array[String] = []; + for index339 = 0; index339 < (mbt_ffi_load32((iter_base) + 40)); index339 = index339 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index339 * 8) + + let result337 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array338.push(result337) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted341 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result340 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result340) + } + _ => panic() + } + + let lifted344 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let lifted343 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result342 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) + + @types.Role::Other(result342) + } + _ => panic() + } + + Option::Some(lifted343) + } + _ => panic() + } + + array345.push(@types.VariantCaseType::{name : result330, payload : lifted331, metadata : @types.MetadataEnvelope::{doc : lifted333, aliases : array335, examples : array338, deprecated : lifted341, role : lifted344}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::VariantType(array345) + } + 16 => { + + let array348 : Array[String] = []; + for index349 = 0; index349 < (mbt_ffi_load32((iter_base) + 12)); index349 = index349 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index349 * 8) + + let result347 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array348.push(result347) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::EnumType(array348) + } + 17 => { + + let array351 : Array[String] = []; + for index352 = 0; index352 < (mbt_ffi_load32((iter_base) + 12)); index352 = index352 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index352 * 8) + + let result350 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array351.push(result350) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::FlagsType(array351) + } + 18 => { + + let array353 : Array[Int] = []; + for index354 = 0; index354 < (mbt_ffi_load32((iter_base) + 12)); index354 = index354 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index354 * 4) + + array353.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array353) + } + 19 => { + + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { + + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { + + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { + + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { + + let lifted355 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted356 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } + + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted355, err : lifted356}) + } + 24 => { + + let lifted360 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array358 : Array[String] = []; + for index359 = 0; index359 < (mbt_ffi_load32((iter_base) + 16)); index359 = index359 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index359 * 8) + + let result357 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array358.push(result357) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array358) + } + _ => panic() + } + + let lifted361 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted362 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted364 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result363 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result363) + } + _ => panic() + } + + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted360, min_length : lifted361, max_length : lifted362, regex : lifted364}) + } + 25 => { + + let lifted368 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array366 : Array[String] = []; + for index367 = 0; index367 < (mbt_ffi_load32((iter_base) + 16)); index367 = index367 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index367 * 8) + + let result365 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array366.push(result365) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array366) + } + _ => panic() + } + + let lifted369 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } + + let lifted370 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted368, min_bytes : lifted369, max_bytes : lifted370}) + } + 26 => { + + let lifted374 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let array372 : Array[String] = []; + for index373 = 0; index373 < (mbt_ffi_load32((iter_base) + 20)); index373 = index373 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index373 * 8) + + let result371 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array372.push(result371) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + Option::Some(array372) + } + _ => panic() + } + + let lifted378 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let array376 : Array[String] = []; + for index377 = 0; index377 < (mbt_ffi_load32((iter_base) + 32)); index377 = index377 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index377 * 8) + + let result375 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array376.push(result375) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + Option::Some(array376) + } + _ => panic() + } + + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted374, allowed_extensions : lifted378}) + } + 27 => { + + let lifted382 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let array380 : Array[String] = []; + for index381 = 0; index381 < (mbt_ffi_load32((iter_base) + 16)); index381 = index381 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index381 * 8) + + let result379 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array380.push(result379) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + Option::Some(array380) + } + _ => panic() + } + + let lifted386 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { + + let array384 : Array[String] = []; + for index385 = 0; index385 < (mbt_ffi_load32((iter_base) + 28)); index385 = index385 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index385 * 8) + + let result383 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array384.push(result383) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + Option::Some(array384) + } + _ => panic() + } + + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted382, allowed_hosts : lifted386}) + } + 28 => { + + @types.SchemaTypeBody::DatetimeType + } + 29 => { + + @types.SchemaTypeBody::DurationType + } + 30 => { + + let result387 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let array389 : Array[String] = []; + for index390 = 0; index390 < (mbt_ffi_load32((iter_base) + 20)); index390 = index390 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index390 * 8) + + let result388 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array389.push(result388) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + let lifted392 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result391 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result391}) + } + _ => panic() + } + + let lifted394 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { + + let result393 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) + + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result393}) + } + _ => panic() + } + + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result387, allowed_suffixes : array389, min : lifted392, max : lifted394}) + } + 31 => { + + let array418 : Array[@types.UnionBranch] = []; + for index419 = 0; index419 < (mbt_ffi_load32((iter_base) + 12)); index419 = index419 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index419 * 92) + + let result395 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted404 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + + let result396 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Prefix(result396) + } + 1 => { + + let result397 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Suffix(result397) + } + 2 => { + + let result398 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Contains(result398) + } + 3 => { + + let result399 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::Regex(result399) + } + 4 => { + + let result400 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + let lifted402 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { + + let result401 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) + + Option::Some(result401) + } + _ => panic() + } + + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result400, literal : lifted402}) + } + 5 => { + + let result403 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + @types.DiscriminatorRule::FieldAbsent(result403) + } + _ => panic() + } + + let lifted406 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { + + let result405 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) + + Option::Some(result405) + } + _ => panic() + } + + let array408 : Array[String] = []; + for index409 = 0; index409 < (mbt_ffi_load32((iter_base) + 52)); index409 = index409 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index409 * 8) + + let result407 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array408.push(result407) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array411 : Array[String] = []; + for index412 = 0; index412 < (mbt_ffi_load32((iter_base) + 60)); index412 = index412 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index412 * 8) + + let result410 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array411.push(result410) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + let lifted414 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result413 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result413) + } + _ => panic() + } + + let lifted417 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { + + let lifted416 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result415 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) + + @types.Role::Other(result415) + } + _ => panic() + } + + Option::Some(lifted416) + } + _ => panic() + } + + array418.push(@types.UnionBranch::{tag : result395, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted404, metadata : @types.MetadataEnvelope::{doc : lifted406, aliases : array408, examples : array411, deprecated : lifted414, role : lifted417}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array418}) + } + 32 => { + + let lifted421 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + let result420 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result420) + } + _ => panic() + } + + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted421}) + } + 33 => { + + let lifted423 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result422 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result422) + } + _ => panic() + } + + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted423}) + } + 34 => { + + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { + + let lifted424 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::FutureType(lifted424) + } + 36 => { + + let lifted425 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaTypeBody::StreamType(lifted425) + } + _ => panic() + } + + let lifted428 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result427 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) + + Option::Some(result427) + } + _ => panic() + } + + let array430 : Array[String] = []; + for index431 = 0; index431 < (mbt_ffi_load32((iter_base) + 104)); index431 = index431 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index431 * 8) + + let result429 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array430.push(result429) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + let array433 : Array[String] = []; + for index434 = 0; index434 < (mbt_ffi_load32((iter_base) + 112)); index434 = index434 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index434 * 8) + + let result432 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array433.push(result432) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + let lifted436 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { + + let result435 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) + + Option::Some(result435) + } + _ => panic() + } + + let lifted439 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { + + let lifted438 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result437 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) + + @types.Role::Other(result437) + } + _ => panic() + } + + Option::Some(lifted438) + } + _ => panic() + } + + array440.push(@types.SchemaTypeNode::{body : lifted426, metadata : @types.MetadataEnvelope::{doc : lifted428, aliases : array430, examples : array433, deprecated : lifted436, role : lifted439}}) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + let array445 : Array[@types.SchemaTypeDef] = []; + for index446 = 0; index446 < (mbt_ffi_load32((result_ptr) + 24)); index446 = index446 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 20)) + (index446 * 24) + + let result442 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted444 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let result443 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) + + Option::Some(result443) + } + _ => panic() + } + + array445.push(@types.SchemaTypeDef::{id : result442, name : lifted444, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) + + let array476 : Array[@types.SchemaValueNode] = []; + for index477 = 0; index477 < (mbt_ffi_load32((result_ptr) + 36)); index477 = index477 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 32)) + (index477 * 32) + + let lifted475 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { + + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { + + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { + + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { + + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { + + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { + + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { + + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { + + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { + + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { + + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { + + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { + + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { + + let result447 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::StringValue(result447) + } + 13 => { + + let array448 : Array[Int] = []; + for index449 = 0; index449 < (mbt_ffi_load32((iter_base) + 12)); index449 = index449 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index449 * 4) + + array448.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::RecordValue(array448) + } + 14 => { + + let lifted450 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted450}) + } + 15 => { + + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { + + let array451 : Array[Bool] = []; + for index452 = 0; index452 < (mbt_ffi_load32((iter_base) + 12)); index452 = index452 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index452 * 1) + + array451.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FlagsValue(array451) + } + 17 => { + + let array453 : Array[Int] = []; + for index454 = 0; index454 < (mbt_ffi_load32((iter_base) + 12)); index454 = index454 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index454 * 4) + + array453.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::TupleValue(array453) + } + 18 => { + + let array455 : Array[Int] = []; + for index456 = 0; index456 < (mbt_ffi_load32((iter_base) + 12)); index456 = index456 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index456 * 4) + + array455.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::ListValue(array455) + } + 19 => { + + let array457 : Array[Int] = []; + for index458 = 0; index458 < (mbt_ffi_load32((iter_base) + 12)); index458 = index458 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index458 * 4) + + array457.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::FixedListValue(array457) + } + 20 => { + + let array459 : Array[@types.MapEntry] = []; + for index460 = 0; index460 < (mbt_ffi_load32((iter_base) + 12)); index460 = index460 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index460 * 8) + + array459.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaValueNode::MapValue(array459) + } + 21 => { + + let lifted461 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + @types.SchemaValueNode::OptionValue(lifted461) + } + 22 => { + + let lifted464 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { + + let lifted462 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::OkValue(lifted462) + } + 1 => { + + let lifted463 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } + + @types.ResultValuePayload::ErrValue(lifted463) + } + _ => panic() + } + + @types.SchemaValueNode::ResultValue(lifted464) + } + 23 => { + + let result465 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted467 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result466 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result466) + } + _ => panic() + } + + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result465, language : lifted467}) + } + 24 => { + + let result468 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + let lifted470 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result469 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result469) + } + _ => panic() + } + + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result468, mime_type : lifted470}) + } + 25 => { + + let result471 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result471) + } + 26 => { + + let result472 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result472) + } + 27 => { + + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result473 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result473}) + } + 30 => { + + let result474 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result474, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array476.push(lifted475) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 32)) + + @common.ToolError::CustomError(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array440, defs : array445, root : mbt_ffi_load32((result_ptr) + 28)}, value : @types.SchemaValueTree::{value_nodes : array476, root : mbt_ffi_load32((result_ptr) + 40)}}) + } + _ => panic() + } + + RpcError::RemoteToolError(lifted478) + } + _ => panic() + } + + Result::Err(lifted479) + } + _ => panic() + } + + lifted480 + +} +///| +pub fn ToolRpc::invoke(self : ToolRpc, command_path : Array[String], input : @types.TypedSchemaValue, stdin : @async-core.Stream[Byte]?) -> Result[Unit, RpcError] { + let cleanup_list : Array[Int] = [] + + let ToolRpc(handle) = self + + let address = mbt_ffi_malloc((command_path).length() * 8); + for index = 0; index < (command_path).length(); index = index + 1 { + let iter_elem : String = (command_path)[(index)] + let iter_base = address + (index * 8); + + let ptr = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr) + cleanup_list.push(ptr) + + } + + let address361 = mbt_ffi_malloc((((input).graph).type_nodes).length() * 144); + for index362 = 0; index362 < (((input).graph).type_nodes).length(); index362 = index362 + 1 { + let iter_elem : @types.SchemaTypeNode = (((input).graph).type_nodes)[(index362)] + let iter_base = address361 + (index362 * 144); + + match (iter_elem).body { + RefType(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store32((iter_base) + 8, payload) + + () + } + BoolType => { + mbt_ffi_store8((iter_base) + 0, (1)) + + () + } + S8Type(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) + + match (payload1) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload3) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload3).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload5) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload5 { + Signed(payload6) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload6) + + () + } + Unsigned(payload7) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload7).reinterpret_as_int64()) + + () + } + FloatBits(payload8) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload8).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload3).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload10) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload10 { + Signed(payload11) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload11) + + () + } + Unsigned(payload12) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload12).reinterpret_as_int64()) + + () + } + FloatBits(payload13) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload13).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload3).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload15) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr16 = mbt_ffi_str2ptr(payload15) + mbt_ffi_store32((iter_base) + 72, payload15.length()) + mbt_ffi_store32((iter_base) + 68, ptr16) + cleanup_list.push(ptr16) + + () + } + } + + () + } + } + + () + } + S16Type(payload17) => { + mbt_ffi_store8((iter_base) + 0, (3)) + + match (payload17) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload19) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload19).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload21) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload21 { + Signed(payload22) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload22) + + () + } + Unsigned(payload23) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload23).reinterpret_as_int64()) + + () + } + FloatBits(payload24) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload24).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload19).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload26) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload26 { + Signed(payload27) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload27) + + () + } + Unsigned(payload28) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload28).reinterpret_as_int64()) + + () + } + FloatBits(payload29) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload29).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload19).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload31) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr32 = mbt_ffi_str2ptr(payload31) + mbt_ffi_store32((iter_base) + 72, payload31.length()) + mbt_ffi_store32((iter_base) + 68, ptr32) + cleanup_list.push(ptr32) + + () + } + } + + () + } + } + + () + } + S32Type(payload33) => { + mbt_ffi_store8((iter_base) + 0, (4)) + + match (payload33) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload35) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload35).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload37) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload37 { + Signed(payload38) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload38) + + () + } + Unsigned(payload39) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload39).reinterpret_as_int64()) + + () + } + FloatBits(payload40) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload40).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload35).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload42) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload42 { + Signed(payload43) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload43) + + () + } + Unsigned(payload44) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload44).reinterpret_as_int64()) + + () + } + FloatBits(payload45) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload45).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload35).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload47) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr48 = mbt_ffi_str2ptr(payload47) + mbt_ffi_store32((iter_base) + 72, payload47.length()) + mbt_ffi_store32((iter_base) + 68, ptr48) + cleanup_list.push(ptr48) + + () + } + } + + () + } + } + + () + } + S64Type(payload49) => { + mbt_ffi_store8((iter_base) + 0, (5)) + + match (payload49) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload51) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload51).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload53) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload53 { + Signed(payload54) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload54) + + () + } + Unsigned(payload55) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload55).reinterpret_as_int64()) + + () + } + FloatBits(payload56) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload56).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload51).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload58) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload58 { + Signed(payload59) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload59) + + () + } + Unsigned(payload60) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload60).reinterpret_as_int64()) + + () + } + FloatBits(payload61) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload61).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload51).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload63) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr64 = mbt_ffi_str2ptr(payload63) + mbt_ffi_store32((iter_base) + 72, payload63.length()) + mbt_ffi_store32((iter_base) + 68, ptr64) + cleanup_list.push(ptr64) + + () + } + } + + () + } + } + + () + } + U8Type(payload65) => { + mbt_ffi_store8((iter_base) + 0, (6)) + + match (payload65) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload67) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload67).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload69) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload69 { + Signed(payload70) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload70) + + () + } + Unsigned(payload71) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload71).reinterpret_as_int64()) + + () + } + FloatBits(payload72) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload72).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload67).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload74) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload74 { + Signed(payload75) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload75) + + () + } + Unsigned(payload76) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload76).reinterpret_as_int64()) + + () + } + FloatBits(payload77) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload77).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload67).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload79) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr80 = mbt_ffi_str2ptr(payload79) + mbt_ffi_store32((iter_base) + 72, payload79.length()) + mbt_ffi_store32((iter_base) + 68, ptr80) + cleanup_list.push(ptr80) + + () + } + } + + () + } + } + + () + } + U16Type(payload81) => { + mbt_ffi_store8((iter_base) + 0, (7)) + + match (payload81) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload83) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload83).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload85) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload85 { + Signed(payload86) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload86) + + () + } + Unsigned(payload87) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload87).reinterpret_as_int64()) + + () + } + FloatBits(payload88) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload88).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload83).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload90) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload90 { + Signed(payload91) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload91) + + () + } + Unsigned(payload92) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload92).reinterpret_as_int64()) + + () + } + FloatBits(payload93) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload93).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload83).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload95) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr96 = mbt_ffi_str2ptr(payload95) + mbt_ffi_store32((iter_base) + 72, payload95.length()) + mbt_ffi_store32((iter_base) + 68, ptr96) + cleanup_list.push(ptr96) + + () + } + } + + () + } + } + + () + } + U32Type(payload97) => { + mbt_ffi_store8((iter_base) + 0, (8)) + + match (payload97) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload99) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload99).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload101) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload101 { + Signed(payload102) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload102) + + () + } + Unsigned(payload103) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload103).reinterpret_as_int64()) + + () + } + FloatBits(payload104) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload104).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload99).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload106) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload106 { + Signed(payload107) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload107) + + () + } + Unsigned(payload108) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload108).reinterpret_as_int64()) + + () + } + FloatBits(payload109) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload109).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload99).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload111) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr112 = mbt_ffi_str2ptr(payload111) + mbt_ffi_store32((iter_base) + 72, payload111.length()) + mbt_ffi_store32((iter_base) + 68, ptr112) + cleanup_list.push(ptr112) + + () + } + } + + () + } + } + + () + } + U64Type(payload113) => { + mbt_ffi_store8((iter_base) + 0, (9)) + + match (payload113) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload115) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload115).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload117) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload117 { + Signed(payload118) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload118) + + () + } + Unsigned(payload119) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload119).reinterpret_as_int64()) + + () + } + FloatBits(payload120) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload120).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload115).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload122) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload122 { + Signed(payload123) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload123) + + () + } + Unsigned(payload124) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload124).reinterpret_as_int64()) + + () + } + FloatBits(payload125) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload125).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload115).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload127) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr128 = mbt_ffi_str2ptr(payload127) + mbt_ffi_store32((iter_base) + 72, payload127.length()) + mbt_ffi_store32((iter_base) + 68, ptr128) + cleanup_list.push(ptr128) + + () + } + } + + () + } + } + + () + } + F32Type(payload129) => { + mbt_ffi_store8((iter_base) + 0, (10)) + + match (payload129) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload131) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload131).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload133) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload133 { + Signed(payload134) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload134) + + () + } + Unsigned(payload135) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload135).reinterpret_as_int64()) + + () + } + FloatBits(payload136) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload136).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload131).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload138) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload138 { + Signed(payload139) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload139) + + () + } + Unsigned(payload140) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload140).reinterpret_as_int64()) + + () + } + FloatBits(payload141) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload141).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload131).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload143) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr144 = mbt_ffi_str2ptr(payload143) + mbt_ffi_store32((iter_base) + 72, payload143.length()) + mbt_ffi_store32((iter_base) + 68, ptr144) + cleanup_list.push(ptr144) + + () + } + } + + () + } + } + + () + } + F64Type(payload145) => { + mbt_ffi_store8((iter_base) + 0, (11)) + + match (payload145) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload147) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload147).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload149) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload149 { + Signed(payload150) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload150) + + () + } + Unsigned(payload151) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload151).reinterpret_as_int64()) + + () + } + FloatBits(payload152) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload152).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload147).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload154) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload154 { + Signed(payload155) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload155) + + () + } + Unsigned(payload156) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload156).reinterpret_as_int64()) + + () + } + FloatBits(payload157) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload157).reinterpret_as_int64()) + + () + } + } + + () + } + } + + match ((payload147).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload159) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr160 = mbt_ffi_str2ptr(payload159) + mbt_ffi_store32((iter_base) + 72, payload159.length()) + mbt_ffi_store32((iter_base) + 68, ptr160) + cleanup_list.push(ptr160) + + () + } + } + + () + } + } + + () + } + CharType => { + mbt_ffi_store8((iter_base) + 0, (12)) + + () + } + StringType => { + mbt_ffi_store8((iter_base) + 0, (13)) + + () + } + RecordType(payload163) => { + mbt_ffi_store8((iter_base) + 0, (14)) + + let address184 = mbt_ffi_malloc((payload163).length() * 68); + for index185 = 0; index185 < (payload163).length(); index185 = index185 + 1 { + let iter_elem : @types.NamedFieldType = (payload163)[(index185)] + let iter_base = address184 + (index185 * 68); + + let ptr164 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr164) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload166) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr167 = mbt_ffi_str2ptr(payload166) + mbt_ffi_store32((iter_base) + 20, payload166.length()) + mbt_ffi_store32((iter_base) + 16, ptr167) + cleanup_list.push(ptr167) + + () + } + } + + let address169 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index170 = 0; index170 < (((iter_elem).metadata).aliases).length(); index170 = index170 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index170)] + let iter_base = address169 + (index170 * 8); + + let ptr168 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr168) + cleanup_list.push(ptr168) + + } + mbt_ffi_store32((iter_base) + 28, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 24, address169) + + let address172 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index173 = 0; index173 < (((iter_elem).metadata).examples).length(); index173 = index173 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index173)] + let iter_base = address172 + (index173 * 8); + + let ptr171 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr171) + cleanup_list.push(ptr171) + + } + mbt_ffi_store32((iter_base) + 36, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 32, address172) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload175) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + let ptr176 = mbt_ffi_str2ptr(payload175) + mbt_ffi_store32((iter_base) + 48, payload175.length()) + mbt_ffi_store32((iter_base) + 44, ptr176) + cleanup_list.push(ptr176) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 52, (0)) + + () + } + Some(payload178) => { + mbt_ffi_store8((iter_base) + 52, (1)) + + match payload178 { + Multimodal => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 56, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 56, (2)) + + () + } + Other(payload182) => { + mbt_ffi_store8((iter_base) + 56, (3)) + + let ptr183 = mbt_ffi_str2ptr(payload182) + mbt_ffi_store32((iter_base) + 64, payload182.length()) + mbt_ffi_store32((iter_base) + 60, ptr183) + cleanup_list.push(ptr183) + + () + } + } + + () + } + } + cleanup_list.push(ptr164) + cleanup_list.push(address169) + cleanup_list.push(address172) + + } + mbt_ffi_store32((iter_base) + 12, (payload163).length()) + mbt_ffi_store32((iter_base) + 8, address184) + cleanup_list.push(address184) + + () + } + VariantType(payload186) => { + mbt_ffi_store8((iter_base) + 0, (15)) + + let address209 = mbt_ffi_malloc((payload186).length() * 72); + for index210 = 0; index210 < (payload186).length(); index210 = index210 + 1 { + let iter_elem : @types.VariantCaseType = (payload186)[(index210)] + let iter_base = address209 + (index210 * 72); + + let ptr187 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr187) + + match ((iter_elem).payload) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload189) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload189) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload191) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr192 = mbt_ffi_str2ptr(payload191) + mbt_ffi_store32((iter_base) + 24, payload191.length()) + mbt_ffi_store32((iter_base) + 20, ptr192) + cleanup_list.push(ptr192) + + () + } + } + + let address194 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index195 = 0; index195 < (((iter_elem).metadata).aliases).length(); index195 = index195 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index195)] + let iter_base = address194 + (index195 * 8); + + let ptr193 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr193) + cleanup_list.push(ptr193) + + } + mbt_ffi_store32((iter_base) + 32, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 28, address194) + + let address197 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index198 = 0; index198 < (((iter_elem).metadata).examples).length(); index198 = index198 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index198)] + let iter_base = address197 + (index198 * 8); + + let ptr196 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr196) + cleanup_list.push(ptr196) + + } + mbt_ffi_store32((iter_base) + 40, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 36, address197) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 44, (0)) + + () + } + Some(payload200) => { + mbt_ffi_store8((iter_base) + 44, (1)) + + let ptr201 = mbt_ffi_str2ptr(payload200) + mbt_ffi_store32((iter_base) + 52, payload200.length()) + mbt_ffi_store32((iter_base) + 48, ptr201) + cleanup_list.push(ptr201) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload203) => { + mbt_ffi_store8((iter_base) + 56, (1)) + + match payload203 { + Multimodal => { + mbt_ffi_store8((iter_base) + 60, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 60, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 60, (2)) + + () + } + Other(payload207) => { + mbt_ffi_store8((iter_base) + 60, (3)) + + let ptr208 = mbt_ffi_str2ptr(payload207) + mbt_ffi_store32((iter_base) + 68, payload207.length()) + mbt_ffi_store32((iter_base) + 64, ptr208) + cleanup_list.push(ptr208) + + () + } + } + + () + } + } + cleanup_list.push(ptr187) + cleanup_list.push(address194) + cleanup_list.push(address197) + + } + mbt_ffi_store32((iter_base) + 12, (payload186).length()) + mbt_ffi_store32((iter_base) + 8, address209) + cleanup_list.push(address209) + + () + } + EnumType(payload211) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address213 = mbt_ffi_malloc((payload211).length() * 8); + for index214 = 0; index214 < (payload211).length(); index214 = index214 + 1 { + let iter_elem : String = (payload211)[(index214)] + let iter_base = address213 + (index214 * 8); + + let ptr212 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr212) + cleanup_list.push(ptr212) + + } + mbt_ffi_store32((iter_base) + 12, (payload211).length()) + mbt_ffi_store32((iter_base) + 8, address213) + cleanup_list.push(address213) + + () + } + FlagsType(payload215) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address217 = mbt_ffi_malloc((payload215).length() * 8); + for index218 = 0; index218 < (payload215).length(); index218 = index218 + 1 { + let iter_elem : String = (payload215)[(index218)] + let iter_base = address217 + (index218 * 8); + + let ptr216 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr216) + cleanup_list.push(ptr216) + + } + mbt_ffi_store32((iter_base) + 12, (payload215).length()) + mbt_ffi_store32((iter_base) + 8, address217) + cleanup_list.push(address217) + + () + } + TupleType(payload219) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address220 = mbt_ffi_malloc((payload219).length() * 4); + for index221 = 0; index221 < (payload219).length(); index221 = index221 + 1 { + let iter_elem : Int = (payload219)[(index221)] + let iter_base = address220 + (index221 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload219).length()) + mbt_ffi_store32((iter_base) + 8, address220) + cleanup_list.push(address220) + + () + } + ListType(payload222) => { + mbt_ffi_store8((iter_base) + 0, (19)) + mbt_ffi_store32((iter_base) + 8, payload222) + + () + } + FixedListType(payload223) => { + mbt_ffi_store8((iter_base) + 0, (20)) + mbt_ffi_store32((iter_base) + 8, (payload223).element) + mbt_ffi_store32((iter_base) + 12, ((payload223).length).reinterpret_as_int()) + + () + } + MapType(payload224) => { + mbt_ffi_store8((iter_base) + 0, (21)) + mbt_ffi_store32((iter_base) + 8, (payload224).key) + mbt_ffi_store32((iter_base) + 12, (payload224).value) + + () + } + OptionType(payload225) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store32((iter_base) + 8, payload225) + + () + } + ResultType(payload226) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + match ((payload226).ok) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload228) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload228) + + () + } + } + + match ((payload226).err) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload230) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload230) + + () + } + } + + () + } + TextType(payload231) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + match ((payload231).languages) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload233) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address235 = mbt_ffi_malloc((payload233).length() * 8); + for index236 = 0; index236 < (payload233).length(); index236 = index236 + 1 { + let iter_elem : String = (payload233)[(index236)] + let iter_base = address235 + (index236 * 8); + + let ptr234 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr234) + cleanup_list.push(ptr234) + + } + mbt_ffi_store32((iter_base) + 16, (payload233).length()) + mbt_ffi_store32((iter_base) + 12, address235) + cleanup_list.push(address235) + + () + } + } + + match ((payload231).min_length) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload238) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload238).reinterpret_as_int()) + + () + } + } + + match ((payload231).max_length) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload240) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload240).reinterpret_as_int()) + + () + } + } + + match ((payload231).regex) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload242) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr243 = mbt_ffi_str2ptr(payload242) + mbt_ffi_store32((iter_base) + 44, payload242.length()) + mbt_ffi_store32((iter_base) + 40, ptr243) + cleanup_list.push(ptr243) + + () + } + } + + () + } + BinaryType(payload244) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + match ((payload244).mime_types) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload246) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address248 = mbt_ffi_malloc((payload246).length() * 8); + for index249 = 0; index249 < (payload246).length(); index249 = index249 + 1 { + let iter_elem : String = (payload246)[(index249)] + let iter_base = address248 + (index249 * 8); + + let ptr247 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr247) + cleanup_list.push(ptr247) + + } + mbt_ffi_store32((iter_base) + 16, (payload246).length()) + mbt_ffi_store32((iter_base) + 12, address248) + cleanup_list.push(address248) + + () + } + } + + match ((payload244).min_bytes) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload251) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload251).reinterpret_as_int()) + + () + } + } + + match ((payload244).max_bytes) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) + + () + } + Some(payload253) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload253).reinterpret_as_int()) + + () + } + } + + () + } + PathType(payload254) => { + mbt_ffi_store8((iter_base) + 0, (26)) + mbt_ffi_store8((iter_base) + 8, (payload254).direction.ordinal()) + mbt_ffi_store8((iter_base) + 9, (payload254).kind.ordinal()) + + match ((payload254).allowed_mime_types) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload256) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let address258 = mbt_ffi_malloc((payload256).length() * 8); + for index259 = 0; index259 < (payload256).length(); index259 = index259 + 1 { + let iter_elem : String = (payload256)[(index259)] + let iter_base = address258 + (index259 * 8); + + let ptr257 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr257) + cleanup_list.push(ptr257) + + } + mbt_ffi_store32((iter_base) + 20, (payload256).length()) + mbt_ffi_store32((iter_base) + 16, address258) + cleanup_list.push(address258) + + () + } + } + + match ((payload254).allowed_extensions) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload261) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let address263 = mbt_ffi_malloc((payload261).length() * 8); + for index264 = 0; index264 < (payload261).length(); index264 = index264 + 1 { + let iter_elem : String = (payload261)[(index264)] + let iter_base = address263 + (index264 * 8); + + let ptr262 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr262) + cleanup_list.push(ptr262) + + } + mbt_ffi_store32((iter_base) + 32, (payload261).length()) + mbt_ffi_store32((iter_base) + 28, address263) + cleanup_list.push(address263) + + () + } + } + + () + } + UrlType(payload265) => { + mbt_ffi_store8((iter_base) + 0, (27)) + + match ((payload265).allowed_schemes) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload267) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let address269 = mbt_ffi_malloc((payload267).length() * 8); + for index270 = 0; index270 < (payload267).length(); index270 = index270 + 1 { + let iter_elem : String = (payload267)[(index270)] + let iter_base = address269 + (index270 * 8); + + let ptr268 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr268) + cleanup_list.push(ptr268) + + } + mbt_ffi_store32((iter_base) + 16, (payload267).length()) + mbt_ffi_store32((iter_base) + 12, address269) + cleanup_list.push(address269) + + () + } + } + + match ((payload265).allowed_hosts) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) + + () + } + Some(payload272) => { + mbt_ffi_store8((iter_base) + 20, (1)) + + let address274 = mbt_ffi_malloc((payload272).length() * 8); + for index275 = 0; index275 < (payload272).length(); index275 = index275 + 1 { + let iter_elem : String = (payload272)[(index275)] + let iter_base = address274 + (index275 * 8); + + let ptr273 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr273) + cleanup_list.push(ptr273) + + } + mbt_ffi_store32((iter_base) + 28, (payload272).length()) + mbt_ffi_store32((iter_base) + 24, address274) + cleanup_list.push(address274) + + () + } + } + + () + } + DatetimeType => { + mbt_ffi_store8((iter_base) + 0, (28)) + + () + } + DurationType => { + mbt_ffi_store8((iter_base) + 0, (29)) + + () + } + QuantityType(payload278) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr279 = mbt_ffi_str2ptr((payload278).base_unit) + mbt_ffi_store32((iter_base) + 12, (payload278).base_unit.length()) + mbt_ffi_store32((iter_base) + 8, ptr279) + + let address281 = mbt_ffi_malloc(((payload278).allowed_suffixes).length() * 8); + for index282 = 0; index282 < ((payload278).allowed_suffixes).length(); index282 = index282 + 1 { + let iter_elem : String = ((payload278).allowed_suffixes)[(index282)] + let iter_base = address281 + (index282 * 8); + + let ptr280 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr280) + cleanup_list.push(ptr280) + + } + mbt_ffi_store32((iter_base) + 20, ((payload278).allowed_suffixes).length()) + mbt_ffi_store32((iter_base) + 16, address281) + + match ((payload278).min) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload284) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload284).mantissa) + mbt_ffi_store32((iter_base) + 40, (payload284).scale) + + let ptr285 = mbt_ffi_str2ptr((payload284).unit) + mbt_ffi_store32((iter_base) + 48, (payload284).unit.length()) + mbt_ffi_store32((iter_base) + 44, ptr285) + cleanup_list.push(ptr285) + + () + } + } + + match ((payload278).max) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + Some(payload287) => { + mbt_ffi_store8((iter_base) + 56, (1)) + mbt_ffi_store64((iter_base) + 64, (payload287).mantissa) + mbt_ffi_store32((iter_base) + 72, (payload287).scale) + + let ptr288 = mbt_ffi_str2ptr((payload287).unit) + mbt_ffi_store32((iter_base) + 80, (payload287).unit.length()) + mbt_ffi_store32((iter_base) + 76, ptr288) + cleanup_list.push(ptr288) + + () + } + } + cleanup_list.push(ptr279) + cleanup_list.push(address281) + + () + } + UnionType(payload289) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let address325 = mbt_ffi_malloc(((payload289).branches).length() * 92); + for index326 = 0; index326 < ((payload289).branches).length(); index326 = index326 + 1 { + let iter_elem : @types.UnionBranch = ((payload289).branches)[(index326)] + let iter_base = address325 + (index326 * 92); + + let ptr290 = mbt_ffi_str2ptr((iter_elem).tag) + mbt_ffi_store32((iter_base) + 4, (iter_elem).tag.length()) + mbt_ffi_store32((iter_base) + 0, ptr290) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) + + match (iter_elem).discriminator { + Prefix(payload291) => { + mbt_ffi_store8((iter_base) + 12, (0)) + + let ptr292 = mbt_ffi_str2ptr(payload291) + mbt_ffi_store32((iter_base) + 20, payload291.length()) + mbt_ffi_store32((iter_base) + 16, ptr292) + cleanup_list.push(ptr292) + + () + } + Suffix(payload293) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr294 = mbt_ffi_str2ptr(payload293) + mbt_ffi_store32((iter_base) + 20, payload293.length()) + mbt_ffi_store32((iter_base) + 16, ptr294) + cleanup_list.push(ptr294) + + () + } + Contains(payload295) => { + mbt_ffi_store8((iter_base) + 12, (2)) + + let ptr296 = mbt_ffi_str2ptr(payload295) + mbt_ffi_store32((iter_base) + 20, payload295.length()) + mbt_ffi_store32((iter_base) + 16, ptr296) + cleanup_list.push(ptr296) + + () + } + Regex(payload297) => { + mbt_ffi_store8((iter_base) + 12, (3)) + + let ptr298 = mbt_ffi_str2ptr(payload297) + mbt_ffi_store32((iter_base) + 20, payload297.length()) + mbt_ffi_store32((iter_base) + 16, ptr298) + cleanup_list.push(ptr298) + + () + } + FieldEquals(payload299) => { + mbt_ffi_store8((iter_base) + 12, (4)) + + let ptr300 = mbt_ffi_str2ptr((payload299).field_name) + mbt_ffi_store32((iter_base) + 20, (payload299).field_name.length()) + mbt_ffi_store32((iter_base) + 16, ptr300) + + match ((payload299).literal) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) + + () + } + Some(payload302) => { + mbt_ffi_store8((iter_base) + 24, (1)) + + let ptr303 = mbt_ffi_str2ptr(payload302) + mbt_ffi_store32((iter_base) + 32, payload302.length()) + mbt_ffi_store32((iter_base) + 28, ptr303) + cleanup_list.push(ptr303) + + () + } + } + cleanup_list.push(ptr300) + + () + } + FieldAbsent(payload304) => { + mbt_ffi_store8((iter_base) + 12, (5)) + + let ptr305 = mbt_ffi_str2ptr(payload304) + mbt_ffi_store32((iter_base) + 20, payload304.length()) + mbt_ffi_store32((iter_base) + 16, ptr305) + cleanup_list.push(ptr305) + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) + + () + } + Some(payload307) => { + mbt_ffi_store8((iter_base) + 36, (1)) + + let ptr308 = mbt_ffi_str2ptr(payload307) + mbt_ffi_store32((iter_base) + 44, payload307.length()) + mbt_ffi_store32((iter_base) + 40, ptr308) + cleanup_list.push(ptr308) + + () + } + } + + let address310 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index311 = 0; index311 < (((iter_elem).metadata).aliases).length(); index311 = index311 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index311)] + let iter_base = address310 + (index311 * 8); + + let ptr309 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr309) + cleanup_list.push(ptr309) + + } + mbt_ffi_store32((iter_base) + 52, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 48, address310) + + let address313 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index314 = 0; index314 < (((iter_elem).metadata).examples).length(); index314 = index314 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index314)] + let iter_base = address313 + (index314 * 8); + + let ptr312 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr312) + cleanup_list.push(ptr312) + + } + mbt_ffi_store32((iter_base) + 60, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 56, address313) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) + + () + } + Some(payload316) => { + mbt_ffi_store8((iter_base) + 64, (1)) + + let ptr317 = mbt_ffi_str2ptr(payload316) + mbt_ffi_store32((iter_base) + 72, payload316.length()) + mbt_ffi_store32((iter_base) + 68, ptr317) + cleanup_list.push(ptr317) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 76, (0)) + + () + } + Some(payload319) => { + mbt_ffi_store8((iter_base) + 76, (1)) + + match payload319 { + Multimodal => { + mbt_ffi_store8((iter_base) + 80, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 80, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 80, (2)) + + () + } + Other(payload323) => { + mbt_ffi_store8((iter_base) + 80, (3)) + + let ptr324 = mbt_ffi_str2ptr(payload323) + mbt_ffi_store32((iter_base) + 88, payload323.length()) + mbt_ffi_store32((iter_base) + 84, ptr324) + cleanup_list.push(ptr324) + + () + } + } + + () + } + } + cleanup_list.push(ptr290) + cleanup_list.push(address310) + cleanup_list.push(address313) + + } + mbt_ffi_store32((iter_base) + 12, ((payload289).branches).length()) + mbt_ffi_store32((iter_base) + 8, address325) + cleanup_list.push(address325) + + () + } + SecretType(payload327) => { + mbt_ffi_store8((iter_base) + 0, (32)) + mbt_ffi_store32((iter_base) + 8, (payload327).inner) + + match ((payload327).category) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload329) => { + mbt_ffi_store8((iter_base) + 12, (1)) + + let ptr330 = mbt_ffi_str2ptr(payload329) + mbt_ffi_store32((iter_base) + 20, payload329.length()) + mbt_ffi_store32((iter_base) + 16, ptr330) + cleanup_list.push(ptr330) + + () + } + } + + () + } + QuotaTokenType(payload331) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + match ((payload331).resource_name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload333) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr334 = mbt_ffi_str2ptr(payload333) + mbt_ffi_store32((iter_base) + 16, payload333.length()) + mbt_ffi_store32((iter_base) + 12, ptr334) + cleanup_list.push(ptr334) + + () + } + } + + () + } + PermissionCardType(payload335) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store8((iter_base) + 8, (if (payload335).polymorphic { 1 } else { 0 })) + + () + } + FutureType(payload336) => { + mbt_ffi_store8((iter_base) + 0, (35)) + + match (payload336) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload338) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload338) + + () + } + } + + () + } + StreamType(payload339) => { + mbt_ffi_store8((iter_base) + 0, (36)) + + match (payload339) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload341) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload341) + + () + } + } + + () + } + } + + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 88, (0)) + + () + } + Some(payload343) => { + mbt_ffi_store8((iter_base) + 88, (1)) + + let ptr344 = mbt_ffi_str2ptr(payload343) + mbt_ffi_store32((iter_base) + 96, payload343.length()) + mbt_ffi_store32((iter_base) + 92, ptr344) + cleanup_list.push(ptr344) + + () + } + } + + let address346 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index347 = 0; index347 < (((iter_elem).metadata).aliases).length(); index347 = index347 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index347)] + let iter_base = address346 + (index347 * 8); + + let ptr345 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr345) + cleanup_list.push(ptr345) + + } + mbt_ffi_store32((iter_base) + 104, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 100, address346) + + let address349 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index350 = 0; index350 < (((iter_elem).metadata).examples).length(); index350 = index350 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index350)] + let iter_base = address349 + (index350 * 8); + + let ptr348 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr348) + cleanup_list.push(ptr348) + + } + mbt_ffi_store32((iter_base) + 112, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 108, address349) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 116, (0)) + + () + } + Some(payload352) => { + mbt_ffi_store8((iter_base) + 116, (1)) + + let ptr353 = mbt_ffi_str2ptr(payload352) + mbt_ffi_store32((iter_base) + 124, payload352.length()) + mbt_ffi_store32((iter_base) + 120, ptr353) + cleanup_list.push(ptr353) + + () + } + } + + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 128, (0)) + + () + } + Some(payload355) => { + mbt_ffi_store8((iter_base) + 128, (1)) + + match payload355 { + Multimodal => { + mbt_ffi_store8((iter_base) + 132, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 132, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 132, (2)) + + () + } + Other(payload359) => { + mbt_ffi_store8((iter_base) + 132, (3)) + + let ptr360 = mbt_ffi_str2ptr(payload359) + mbt_ffi_store32((iter_base) + 140, payload359.length()) + mbt_ffi_store32((iter_base) + 136, ptr360) + cleanup_list.push(ptr360) + + () + } + } + + () + } + } + cleanup_list.push(address346) + cleanup_list.push(address349) + + } + + let address367 = mbt_ffi_malloc((((input).graph).defs).length() * 24); + for index368 = 0; index368 < (((input).graph).defs).length(); index368 = index368 + 1 { + let iter_elem : @types.SchemaTypeDef = (((input).graph).defs)[(index368)] + let iter_base = address367 + (index368 * 24); + + let ptr363 = mbt_ffi_str2ptr((iter_elem).id) + mbt_ffi_store32((iter_base) + 4, (iter_elem).id.length()) + mbt_ffi_store32((iter_base) + 0, ptr363) + + match ((iter_elem).name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload365) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + let ptr366 = mbt_ffi_str2ptr(payload365) + mbt_ffi_store32((iter_base) + 16, payload365.length()) + mbt_ffi_store32((iter_base) + 12, ptr366) + cleanup_list.push(ptr366) + + () + } + } + mbt_ffi_store32((iter_base) + 20, (iter_elem).body) + cleanup_list.push(ptr363) + + } + + let address441 = mbt_ffi_malloc((((input).value).value_nodes).length() * 32); + for index442 = 0; index442 < (((input).value).value_nodes).length(); index442 = index442 + 1 { + let iter_elem : @types.SchemaValueNode = (((input).value).value_nodes)[(index442)] + let iter_base = address441 + (index442 * 32); + + match iter_elem { + BoolValue(payload369) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload369 { 1 } else { 0 })) + + () + } + S8Value(payload370) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload370)) + + () + } + S16Value(payload371) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload371)) + + () + } + S32Value(payload372) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload372) + + () + } + S64Value(payload373) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload373) + + () + } + U8Value(payload374) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload374).to_int()) + + () + } + U16Value(payload375) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload375).reinterpret_as_int()) + + () + } + U32Value(payload376) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload376).reinterpret_as_int()) + + () + } + U64Value(payload377) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload377).reinterpret_as_int64()) + + () + } + F32Value(payload378) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload378) + + () + } + F64Value(payload379) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload379) + + () + } + CharValue(payload380) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload380).to_int()) + + () + } + StringValue(payload381) => { + mbt_ffi_store8((iter_base) + 0, (12)) + + let ptr382 = mbt_ffi_str2ptr(payload381) + mbt_ffi_store32((iter_base) + 12, payload381.length()) + mbt_ffi_store32((iter_base) + 8, ptr382) + cleanup_list.push(ptr382) + + () + } + RecordValue(payload383) => { + mbt_ffi_store8((iter_base) + 0, (13)) + + let address384 = mbt_ffi_malloc((payload383).length() * 4); + for index385 = 0; index385 < (payload383).length(); index385 = index385 + 1 { + let iter_elem : Int = (payload383)[(index385)] + let iter_base = address384 + (index385 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload383).length()) + mbt_ffi_store32((iter_base) + 8, address384) + cleanup_list.push(address384) + + () + } + VariantValue(payload386) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload386).case).reinterpret_as_int()) + + match ((payload386).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload388) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload388) + + () + } + } + + () + } + EnumValue(payload389) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload389).reinterpret_as_int()) + + () + } + FlagsValue(payload390) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address391 = mbt_ffi_malloc((payload390).length() * 1); + for index392 = 0; index392 < (payload390).length(); index392 = index392 + 1 { + let iter_elem : Bool = (payload390)[(index392)] + let iter_base = address391 + (index392 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) + + } + mbt_ffi_store32((iter_base) + 12, (payload390).length()) + mbt_ffi_store32((iter_base) + 8, address391) + cleanup_list.push(address391) + + () + } + TupleValue(payload393) => { + mbt_ffi_store8((iter_base) + 0, (17)) + + let address394 = mbt_ffi_malloc((payload393).length() * 4); + for index395 = 0; index395 < (payload393).length(); index395 = index395 + 1 { + let iter_elem : Int = (payload393)[(index395)] + let iter_base = address394 + (index395 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload393).length()) + mbt_ffi_store32((iter_base) + 8, address394) + cleanup_list.push(address394) + + () + } + ListValue(payload396) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address397 = mbt_ffi_malloc((payload396).length() * 4); + for index398 = 0; index398 < (payload396).length(); index398 = index398 + 1 { + let iter_elem : Int = (payload396)[(index398)] + let iter_base = address397 + (index398 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload396).length()) + mbt_ffi_store32((iter_base) + 8, address397) + cleanup_list.push(address397) + + () + } + FixedListValue(payload399) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address400 = mbt_ffi_malloc((payload399).length() * 4); + for index401 = 0; index401 < (payload399).length(); index401 = index401 + 1 { + let iter_elem : Int = (payload399)[(index401)] + let iter_base = address400 + (index401 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) + + } + mbt_ffi_store32((iter_base) + 12, (payload399).length()) + mbt_ffi_store32((iter_base) + 8, address400) + cleanup_list.push(address400) + + () + } + MapValue(payload402) => { + mbt_ffi_store8((iter_base) + 0, (20)) + + let address403 = mbt_ffi_malloc((payload402).length() * 8); + for index404 = 0; index404 < (payload402).length(); index404 = index404 + 1 { + let iter_elem : @types.MapEntry = (payload402)[(index404)] + let iter_base = address403 + (index404 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) + + } + mbt_ffi_store32((iter_base) + 12, (payload402).length()) + mbt_ffi_store32((iter_base) + 8, address403) + cleanup_list.push(address403) + + () + } + OptionValue(payload405) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + match (payload405) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) + + () + } + Some(payload407) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload407) + + () + } + } + + () + } + ResultValue(payload408) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload408 { + OkValue(payload409) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload409) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload411) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload411) + + () + } + } + + () + } + ErrValue(payload412) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload412) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload414) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload414) + + () + } + } + + () + } + } + + () + } + TextValue(payload415) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr416 = mbt_ffi_str2ptr((payload415).text) + mbt_ffi_store32((iter_base) + 12, (payload415).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr416) + + match ((payload415).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload418) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr419 = mbt_ffi_str2ptr(payload418) + mbt_ffi_store32((iter_base) + 24, payload418.length()) + mbt_ffi_store32((iter_base) + 20, ptr419) + cleanup_list.push(ptr419) + + () + } + } + cleanup_list.push(ptr416) + + () + } + BinaryValue(payload420) => { + mbt_ffi_store8((iter_base) + 0, (24)) + + let ptr421 = mbt_ffi_bytes2ptr((payload420).bytes) + + mbt_ffi_store32((iter_base) + 12, (payload420).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr421) + + match ((payload420).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload423) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + let ptr424 = mbt_ffi_str2ptr(payload423) + mbt_ffi_store32((iter_base) + 24, payload423.length()) + mbt_ffi_store32((iter_base) + 20, ptr424) + cleanup_list.push(ptr424) + + () + } + } + cleanup_list.push(ptr421) + + () + } + PathValue(payload425) => { + mbt_ffi_store8((iter_base) + 0, (25)) + + let ptr426 = mbt_ffi_str2ptr(payload425) + mbt_ffi_store32((iter_base) + 12, payload425.length()) + mbt_ffi_store32((iter_base) + 8, ptr426) + cleanup_list.push(ptr426) + + () + } + UrlValue(payload427) => { + mbt_ffi_store8((iter_base) + 0, (26)) + + let ptr428 = mbt_ffi_str2ptr(payload427) + mbt_ffi_store32((iter_base) + 12, payload427.length()) + mbt_ffi_store32((iter_base) + 8, ptr428) + cleanup_list.push(ptr428) + + () + } + DatetimeValue(payload429) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload429).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload429).nanoseconds).reinterpret_as_int()) + + () + } + DurationValue(payload430) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload430).nanoseconds) + + () + } + QuantityValueNode(payload431) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload431).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload431).scale) + + let ptr432 = mbt_ffi_str2ptr((payload431).unit) + mbt_ffi_store32((iter_base) + 24, (payload431).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr432) + cleanup_list.push(ptr432) + + () + } + UnionValue(payload433) => { + mbt_ffi_store8((iter_base) + 0, (30)) + + let ptr434 = mbt_ffi_str2ptr((payload433).tag) + mbt_ffi_store32((iter_base) + 12, (payload433).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr434) + mbt_ffi_store32((iter_base) + 16, (payload433).body) + cleanup_list.push(ptr434) + + () + } + SecretValue(payload435) => { + mbt_ffi_store8((iter_base) + 0, (31)) + + let @types.Secret(handle436) = payload435 + mbt_ffi_store32((iter_base) + 8, handle436) + + () + } + QuotaTokenHandle(payload437) => { + mbt_ffi_store8((iter_base) + 0, (32)) + + let @types.QuotaToken(handle438) = payload437 + mbt_ffi_store32((iter_base) + 8, handle438) + + () + } + PermissionCardHandle(payload439) => { + mbt_ffi_store8((iter_base) + 0, (33)) + + let @types.PermissionCard(handle440) = payload439 + mbt_ffi_store32((iter_base) + 8, handle440) + + () + } + } + + } + + let (lowered, lowered445) = match (stdin) { + None => { + + ((0), 0) + } + Some(payload444) => { + + ((1), wasmGolemToolHost010MethodToolRpcInvokeStream0StreamLower(payload444)) + } + } + let return_area = mbt_ffi_malloc(44) + let lower_arg = handle + let lower_arg446 = address + let lower_arg447 = (command_path).length() + let lower_arg448 = address361 + let lower_arg449 = (((input).graph).type_nodes).length() + let lower_arg450 = address367 + let lower_arg451 = (((input).graph).defs).length() + let lower_arg452 = ((input).graph).root + let lower_arg453 = address441 + let lower_arg454 = (((input).value).value_nodes).length() + let lower_arg455 = ((input).value).root + let lower_arg456 = lowered + let lower_arg457 = lowered445 + let lower_arg458 = return_area + wasmImportMethodToolRpcInvoke(lower_arg, lower_arg446, lower_arg447, lower_arg448, lower_arg449, lower_arg450, lower_arg451, lower_arg452, lower_arg453, lower_arg454, lower_arg455, lower_arg456, lower_arg457, lower_arg458); + + for index462 = 0; index462 < (lower_arg449); index462 = index462 + 1 { + let iter_base = (lower_arg448) + (index462 * 144) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } + + } + _ => panic() + } + + } + 3 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } + + } + _ => panic() + } + + } + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } + + } + _ => panic() + } + + } + 5 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } + + } + _ => panic() + } + + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } + + } + _ => panic() + } + + } + 7 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } + + } + _ => panic() + } + + } + 8 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } + + } + _ => panic() + } + + } + 9 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } + + } + _ => panic() + } + + } + 10 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } + + } + _ => panic() + } + + } + 11 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } + + } + _ => panic() + } + + } + 12 => () + 13 => () + 14 => { + + for index459 = 0; index459 < (mbt_ffi_load32((iter_base) + 12)); index459 = index459 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index459 * 68) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => () + _ => panic() + } + + } + _ => panic() + } + + } + + } + 15 => { + + for index460 = 0; index460 < (mbt_ffi_load32((iter_base) + 12)); index460 = index460 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index460 * 72) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => () + _ => panic() + } + + } + _ => panic() + } + + } + + } + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => () + _ => panic() + } + + } + 25 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => () + _ => panic() + } + + } + 26 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => () + _ => panic() + } + + } + 27 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => () + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + _ => panic() + } + + } + 31 => { + + for index461 = 0; index461 < (mbt_ffi_load32((iter_base) + 12)); index461 = index461 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index461 * 92) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => { + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => () + _ => panic() + } + + } + 5 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => () + _ => panic() + } + + } + _ => panic() + } + + } + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => () + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => () + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() } - _ => panic() - } - @types.SchemaTypeBody::U32Type(lifted595) - } - 9 => { - let lifted602 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted597 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted596 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted596) - } - _ => panic() - } - - let lifted599 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted598 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted598) - } - _ => panic() - } - - let lifted601 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result600 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result600) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted597, - max: lifted599, - unit: lifted601, - }) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => () + _ => panic() + } + + } + _ => panic() + } + + } + + for index463 = 0; index463 < (lower_arg451); index463 = index463 + 1 { + let iter_base = (lower_arg450) + (index463 * 24) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => () + _ => panic() + } + + } + + for index464 = 0; index464 < (lower_arg454); index464 = index464 + 1 { + let iter_base = (lower_arg453) + (index464 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => { + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => () + _ => panic() + } - @types.SchemaTypeBody::U64Type(lifted602) - } - 10 => { - let lifted609 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted604 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted603 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted603) - } - _ => panic() - } - - let lifted606 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted605 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted605) - } - _ => panic() - } - - let lifted608 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result607 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result607) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted604, - max: lifted606, - unit: lifted608, - }) + } + 24 => { + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => () + _ => panic() + } + + } + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + _ => panic() } - _ => panic() - } - @types.SchemaTypeBody::F32Type(lifted609) - } - 11 => { - let lifted616 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None + } + + match (lower_arg456) { + 0 => () 1 => { - let lifted611 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted610 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted610) - } - _ => panic() - } - - let lifted613 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted612 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted612) - } - _ => panic() - } - - let lifted615 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result614 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result614) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted611, - max: lifted613, - unit: lifted615, - }) + wasmGolemToolHost010MethodToolRpcInvokeStream0StreamCommit(lower_arg457) + } _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted616) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array631 : Array[@types.NamedFieldType] = [] - for index632 = 0 - index632 < mbt_ffi_load32(iter_base + 12) - index632 = index632 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index632 * 68 - - let result617 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted619 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result618 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result618) - } - _ => panic() + } + + let lifted710 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) } + 1 => { - let array621 : Array[String] = [] - for index622 = 0 - index622 < mbt_ffi_load32(iter_base + 28) - index622 = index622 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index622 * 8 + let lifted709 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { - let result620 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result465 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - array621.push(result620) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + RpcError::ProtocolError(result465) + } + 1 => { - let array624 : Array[String] = [] - for index625 = 0 - index625 < mbt_ffi_load32(iter_base + 36) - index625 = index625 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index625 * 8 + let result466 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let result623 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + RpcError::Denied(result466) + } + 2 => { - array624.push(result623) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted627 : String? = match mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result626 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result626) - } - _ => panic() - } + let result467 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - let lifted630 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted629 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result628 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + RpcError::NotFound(result467) + } + 3 => { - @types.Role::Other(result628) - } - _ => panic() - } + let result468 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) - Option::Some(lifted629) - } - _ => panic() - } + RpcError::RemoteInternalError(result468) + } + 4 => { - array631.push(@types.NamedFieldType::{ - name: result617, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted619, - aliases: array621, - examples: array624, - deprecated: lifted627, - role: lifted630, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array631) - } - 15 => { - let array648 : Array[@types.VariantCaseType] = [] - for index649 = 0 - index649 < mbt_ffi_load32(iter_base + 12) - index649 = index649 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index649 * 72 - - let result633 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted634 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted708 = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { - let lifted636 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result635 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result635) - } - _ => panic() - } + let result469 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let array638 : Array[String] = [] - for index639 = 0 - index639 < mbt_ffi_load32(iter_base + 32) - index639 = index639 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index639 * 8 + @common.ToolError::InvalidToolName(result469) + } + 1 => { - let result637 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let array : Array[String] = []; + for index471 = 0; index471 < (mbt_ffi_load32((return_area) + 16)); index471 = index471 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 12)) + (index471 * 8) - array638.push(result637) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let result470 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let array641 : Array[String] = [] - for index642 = 0 - index642 < mbt_ffi_load32(iter_base + 40) - index642 = index642 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index642 * 8 + array.push(result470) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 12)) - let result640 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @common.ToolError::InvalidCommandPath(array) + } + 2 => { - array641.push(result640) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted644 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result643 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result643) - } - _ => panic() - } + let result472 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let lifted647 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted646 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result645 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + @common.ToolError::InvalidInput(result472) + } + 3 => { - @types.Role::Other(result645) - } - _ => panic() - } + let result473 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - Option::Some(lifted646) - } - _ => panic() - } + @common.ToolError::ConstraintViolation(result473) + } + 4 => { - array648.push(@types.VariantCaseType::{ - name: result633, - payload: lifted634, - metadata: @types.MetadataEnvelope::{ - doc: lifted636, - aliases: array638, - examples: array641, - deprecated: lifted644, - role: lifted647, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array648) - } - 16 => { - let array651 : Array[String] = [] - for index652 = 0 - index652 < mbt_ffi_load32(iter_base + 12) - index652 = index652 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index652 * 8 - - let result650 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array651.push(result650) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array651) - } - 17 => { - let array654 : Array[String] = [] - for index655 = 0 - index655 < mbt_ffi_load32(iter_base + 12) - index655 = index655 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index655 * 8 - - let result653 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array654.push(result653) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array654) - } - 18 => { - let array656 : Array[Int] = [] - for index657 = 0 - index657 < mbt_ffi_load32(iter_base + 12) - index657 = index657 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index657 * 4 - - array656.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array656) - } - 19 => @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted658 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result474 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) - let lifted659 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted658, - err: lifted659, - }) - } - 24 => { - let lifted663 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array661 : Array[String] = [] - for index662 = 0 - index662 < mbt_ffi_load32(iter_base + 16) - index662 = index662 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index662 * 8 - - let result660 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array661.push(result660) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array661) - } - _ => panic() - } + @common.ToolError::InvalidResult(result474) + } + 5 => { - let lifted664 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 24).reinterpret_as_uint()) - _ => panic() - } + let array670 : Array[@types.SchemaTypeNode] = []; + for index671 = 0; index671 < (mbt_ffi_load32((return_area) + 16)); index671 = index671 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 12)) + (index671 * 144) - let lifted665 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 32).reinterpret_as_uint()) - _ => panic() - } + let lifted656 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let lifted667 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result666 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { - Option::Some(result666) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted663, - min_length: lifted664, - max_length: lifted665, - regex: lifted667, - }) - } - 25 => { - let lifted671 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array669 : Array[String] = [] - for index670 = 0 - index670 < mbt_ffi_load32(iter_base + 16) - index670 = index670 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index670 * 8 - - let result668 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array669.push(result668) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array669) - } - _ => panic() - } + @types.SchemaTypeBody::BoolType + } + 2 => { - let lifted672 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 24).reinterpret_as_uint()) - _ => panic() - } + let lifted480 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted673 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 32).reinterpret_as_uint()) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted671, - min_bytes: lifted672, - max_bytes: lifted673, - }) - } - 26 => { - let lifted677 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array675 : Array[String] = [] - for index676 = 0 - index676 < mbt_ffi_load32(iter_base + 20) - index676 = index676 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index676 * 8 - - let result674 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array675.push(result674) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array675) - } - _ => panic() - } + let lifted475 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted681 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array679 : Array[String] = [] - for index680 = 0 - index680 < mbt_ffi_load32(iter_base + 32) - index680 = index680 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index680 * 8 - - let result678 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array679.push(result678) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array679) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted677, - allowed_extensions: lifted681, - }) - } - 27 => { - let lifted685 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array683 : Array[String] = [] - for index684 = 0 - index684 < mbt_ffi_load32(iter_base + 16) - index684 = index684 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index684 * 8 - - let result682 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array683.push(result682) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array683) - } - _ => panic() - } + let lifted = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let lifted689 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array687 : Array[String] = [] - for index688 = 0 - index688 < mbt_ffi_load32(iter_base + 28) - index688 = index688 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index688 * 8 - - let result686 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array687.push(result686) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array687) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted685, - allowed_hosts: lifted689, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result690 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array692 : Array[String] = [] - for index693 = 0 - index693 < mbt_ffi_load32(iter_base + 20) - index693 = index693 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index693 * 8 - - let result691 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array692.push(result691) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted695 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result694 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result694, - }) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let lifted697 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result696 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result696, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result690, - allowed_suffixes: array692, - min: lifted695, - max: lifted697, - }) - } - 31 => { - let array721 : Array[@types.UnionBranch] = [] - for index722 = 0 - index722 < mbt_ffi_load32(iter_base + 12) - index722 = index722 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index722 * 92 - - let result698 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted707 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result699 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result699) - } - 1 => { - let result700 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result700) - } - 2 => { - let result701 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result701) - } - 3 => { - let result702 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result702) - } - 4 => { - let result703 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted705 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result704 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(result704) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result703, - literal: lifted705, - }) - } - 5 => { - let result706 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result706) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted709 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result708 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result708) - } - _ => panic() - } + Option::Some(lifted) + } + _ => panic() + } - let array711 : Array[String] = [] - for index712 = 0 - index712 < mbt_ffi_load32(iter_base + 52) - index712 = index712 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index712 * 8 + let lifted477 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - let result710 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted476 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - array711.push(result710) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - let array714 : Array[String] = [] - for index715 = 0 - index715 < mbt_ffi_load32(iter_base + 60) - index715 = index715 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index715 * 8 + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - let result713 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - array714.push(result713) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted717 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result716 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result716) - } - _ => panic() - } + Option::Some(lifted476) + } + _ => panic() + } - let lifted720 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted719 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result718 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + let lifted479 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - @types.Role::Other(result718) - } - _ => panic() - } + let result478 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - Option::Some(lifted719) - } - _ => panic() - } + Option::Some(result478) + } + _ => panic() + } - array721.push(@types.UnionBranch::{ - tag: result698, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted707, - metadata: @types.MetadataEnvelope::{ - doc: lifted709, - aliases: array711, - examples: array714, - deprecated: lifted717, - role: lifted720, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array721, - }) - } - 32 => { - let lifted724 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result723 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + Option::Some(@types.NumericRestrictions::{min : lifted475, max : lifted477, unit : lifted479}) + } + _ => panic() + } - Option::Some(result723) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted724, - }) - } - 33 => { - let lifted726 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result725 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + @types.SchemaTypeBody::S8Type(lifted480) + } + 3 => { - Option::Some(result725) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted726, - }) - } - 34 => { - let lifted727 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted487 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::FutureType(lifted727) - } - 35 => { - let lifted728 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let lifted482 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::StreamType(lifted728) - } - _ => panic() - } + let lifted481 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let lifted731 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result730 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result730) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let array733 : Array[String] = [] - for index734 = 0 - index734 < mbt_ffi_load32(iter_base + 104) - index734 = index734 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index734 * 8 + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted481) + } + _ => panic() + } + + let lifted484 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted483 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted483) + } + _ => panic() + } + + let lifted486 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result485 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result485) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted482, max : lifted484, unit : lifted486}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted487) + } + 4 => { + + let lifted494 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted489 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted488 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted488) + } + _ => panic() + } + + let lifted491 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted490 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted490) + } + _ => panic() + } + + let lifted493 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result492 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result492) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted489, max : lifted491, unit : lifted493}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted494) + } + 5 => { + + let lifted501 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted496 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted495 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted495) + } + _ => panic() + } + + let lifted498 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted497 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted497) + } + _ => panic() + } + + let lifted500 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result499 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result499) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted496, max : lifted498, unit : lifted500}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted501) + } + 6 => { + + let lifted508 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted503 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted502 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted502) + } + _ => panic() + } + + let lifted505 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted504 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted504) + } + _ => panic() + } + + let lifted507 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result506 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result506) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted503, max : lifted505, unit : lifted507}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted508) + } + 7 => { + + let lifted515 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted510 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted509 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted509) + } + _ => panic() + } + + let lifted512 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted511 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted511) + } + _ => panic() + } + + let lifted514 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result513 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result513) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted510, max : lifted512, unit : lifted514}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted515) + } + 8 => { + + let lifted522 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted517 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted516 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted516) + } + _ => panic() + } + + let lifted519 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted518 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted518) + } + _ => panic() + } + + let lifted521 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result520 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result520) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted517, max : lifted519, unit : lifted521}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted522) + } + 9 => { + + let lifted529 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted524 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted523 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted523) + } + _ => panic() + } + + let lifted526 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted525 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted525) + } + _ => panic() + } + + let lifted528 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result527 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result527) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted524, max : lifted526, unit : lifted528}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted529) + } + 10 => { + + let lifted536 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted531 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted530 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted530) + } + _ => panic() + } + + let lifted533 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted532 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted532) + } + _ => panic() + } + + let lifted535 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result534 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result534) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted531, max : lifted533, unit : lifted535}) + } + _ => panic() + } - let result732 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::F32Type(lifted536) + } + 11 => { - array733.push(result732) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let lifted543 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let array736 : Array[String] = [] - for index737 = 0 - index737 < mbt_ffi_load32(iter_base + 112) - index737 = index737 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index737 * 8 + let lifted538 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let result735 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted537 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - array736.push(result735) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted739 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result738 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result738) - } - _ => panic() - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let lifted742 : @types.Role? = match mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted741 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result740 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result740) - } - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(lifted741) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - array743.push(@types.SchemaTypeNode::{ - body: lifted729, - metadata: @types.MetadataEnvelope::{ - doc: lifted731, - aliases: array733, - examples: array736, - deprecated: lifted739, - role: lifted742, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let array748 : Array[@types.SchemaTypeDef] = [] - for index749 = 0 - index749 < mbt_ffi_load32(iter_base + 28) - index749 = index749 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index749 * 24 - - let result745 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + Option::Some(lifted537) + } + _ => panic() + } - let lifted747 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result746 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result746) - } - _ => panic() - } + let lifted540 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - array748.push(@types.SchemaTypeDef::{ - id: result745, - name: lifted747, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - array750.push(RegisteredTool::{ - definition: @common.Tool::{ - version: result, - commands: @common.CommandTree::{ nodes: array545 }, - schema: @types.SchemaGraph::{ - type_nodes: array743, - defs: array748, - root: mbt_ffi_load32(iter_base + 32), - }, - }, - implemented_by: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(iter_base + 40).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(iter_base + 48).reinterpret_as_uint64(), - }, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array750 - mbt_ffi_free(return_area) - return ret -} + let lifted539 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { -///| -/// Returns the registered tool with the given name iff the -/// calling agent has access to it (per the same per-env and -/// per-agent binding rules as `get-all-tools`). Returns `none` -/// either if the tool is not registered or if the calling agent -/// has no binding for it; the two cases are not distinguished. -pub fn get_tool(name : String) -> RegisteredTool? { - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(64) - wasmImportGetTool(ptr, name.length(), return_area) - - let lifted750 : RegisteredTool? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - let array545 : Array[@common.CommandNode] = [] - for index546 = 0 - index546 < mbt_ffi_load32(return_area + 20) - index546 = index546 + 1 { - let iter_base = mbt_ffi_load32(return_area + 16) + index546 * 324 - - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let array : Array[String] = [] - for index = 0; index < mbt_ffi_load32(iter_base + 12); index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index * 8 - - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result1) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let array6 : Array[@common.Example] = [] - for index7 = 0 - index7 < mbt_ffi_load32(iter_base + 36) - index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index7 * 16 - - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array6.push(@common.Example::{ title: result4, body: result5 }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let array57 : Array[@common.OptionSpec] = [] - for index58 = 0 - index58 < mbt_ffi_load32(iter_base + 44) - index58 = index58 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index58 * 112 - - let result8 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted : Char? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some(Int::unsafe_to_char(mbt_ffi_load32(iter_base + 12))) - _ => panic() - } - - let array10 : Array[String] = [] - for index11 = 0 - index11 < mbt_ffi_load32(iter_base + 20) - index11 = index11 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index11 * 8 - - let result9 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array10.push(result9) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let result12 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let result13 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array16 : Array[@common.Example] = [] - for index17 = 0 - index17 < mbt_ffi_load32(iter_base + 44) - index17 = index17 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index17 * 16 - - let result14 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array16.push(@common.Example::{ title: result14, body: result15 }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let lifted19 : String? = match mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => { - let result18 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - Option::Some(result18) - } - _ => panic() - } - - let lifted22 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @common.OptionShape::Scalar(mbt_ffi_load32(iter_base + 64)) - 1 => - @common.OptionShape::OptionalScalar( - mbt_ffi_load32(iter_base + 64), - ) - 2 => { - let lifted20 = match mbt_ffi_load8_u(iter_base + 64) { - 0 => @common.Repetition::Repeated - 1 => - @common.Repetition::Delimited( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - 2 => - @common.Repetition::Either( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - _ => panic() - } - - @common.OptionShape::RepeatableList(@common.RepeatableListShape::{ - repetition: lifted20, - item_type: mbt_ffi_load32(iter_base + 72), - }) - } - 3 => { - let lifted21 = match mbt_ffi_load8_u(iter_base + 64) { - 0 => @common.Repetition::Repeated - 1 => - @common.Repetition::Delimited( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - 2 => - @common.Repetition::Either( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - _ => panic() - } - - @common.OptionShape::RepeatableMap(@common.RepeatableMapShape::{ - repetition: lifted21, - map_type: mbt_ffi_load32(iter_base + 72), - duplicate_key_policy: @common.DuplicateKeyPolicy::from( - mbt_ffi_load8_u(iter_base + 76), - ), - }) - } - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let lifted54 : @types.SchemaValueTree? = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => Option::None - 1 => { - let array52 : Array[@types.SchemaValueNode] = [] - for index53 = 0 - index53 < mbt_ffi_load32(iter_base + 88) - index53 = index53 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 84) + index53 * 32 - - let lifted51 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result23) - } - 13 => { - let array24 : Array[Int] = [] - for index25 = 0 - index25 < mbt_ffi_load32(iter_base + 12) - index25 = index25 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index25 * 4 - - array24.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array24) - } - 14 => { - let lifted26 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted26, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array27 : Array[Bool] = [] - for index28 = 0 - index28 < mbt_ffi_load32(iter_base + 12) - index28 = index28 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index28 * 1 - - array27.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array27) - } - 17 => { - let array29 : Array[Int] = [] - for index30 = 0 - index30 < mbt_ffi_load32(iter_base + 12) - index30 = index30 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index30 * 4 - - array29.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array29) - } - 18 => { - let array31 : Array[Int] = [] - for index32 = 0 - index32 < mbt_ffi_load32(iter_base + 12) - index32 = index32 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index32 * 4 - - array31.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array31) - } - 19 => { - let array33 : Array[Int] = [] - for index34 = 0 - index34 < mbt_ffi_load32(iter_base + 12) - index34 = index34 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index34 * 4 - - array33.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array33) - } - 20 => { - let array35 : Array[@types.MapEntry] = [] - for index36 = 0 - index36 < mbt_ffi_load32(iter_base + 12) - index36 = index36 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index36 * 8 - - array35.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array35) - } - 21 => { - let lifted37 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted37) - } - 22 => { - let lifted40 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted38 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted38) - } - 1 => { - let lifted39 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted39) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted40) - } - 23 => { - let result41 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted43 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result42 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result42) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result41, - language: lifted43, - }) - } - 24 => { - let result44 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted46 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result45 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result45) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result44, - mime_type: lifted46, - }) - } - 25 => { - let result47 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Option::Some(lifted539) + } + _ => panic() + } - @types.SchemaValueNode::PathValue(result47) - } - 26 => { - let result48 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result48) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result49 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result49, - }) - } - 30 => { - let result50 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result50, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + let lifted542 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - array52.push(lifted51) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) + let result541 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - Option::Some(@types.SchemaValueTree::{ - value_nodes: array52, - root: mbt_ffi_load32(iter_base + 92), - }) - } - _ => panic() - } + Option::Some(result541) + } + _ => panic() + } - let lifted56 : String? = match mbt_ffi_load8_u(iter_base + 100) { - 0 => Option::None - 1 => { - let result55 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 104), - mbt_ffi_load32(iter_base + 108), - ) + Option::Some(@types.NumericRestrictions::{min : lifted538, max : lifted540, unit : lifted542}) + } + _ => panic() + } - Option::Some(result55) - } - _ => panic() - } - - array57.push(@common.OptionSpec::{ - long: result8, - short: lifted, - aliases: array10, - doc: @common.Doc::{ - summary: result12, - description: result13, - examples: array16, - }, - value_name: lifted19, - shape: lifted22, - default: lifted54, - required: mbt_ffi_load8_u(iter_base + 96) != 0, - env_var: lifted56, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let array74 : Array[@common.FlagSpec] = [] - for index75 = 0 - index75 < mbt_ffi_load32(iter_base + 52) - index75 = index75 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index75 * 72 - - let result59 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted60 : Char? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some(Int::unsafe_to_char(mbt_ffi_load32(iter_base + 12))) - _ => panic() - } - - let array62 : Array[String] = [] - for index63 = 0 - index63 < mbt_ffi_load32(iter_base + 20) - index63 = index63 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index63 * 8 - - let result61 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array62.push(result61) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let result64 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let result65 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array68 : Array[@common.Example] = [] - for index69 = 0 - index69 < mbt_ffi_load32(iter_base + 44) - index69 = index69 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index69 * 16 - - let result66 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result67 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array68.push(@common.Example::{ title: result66, body: result67 }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let lifted71 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @common.FlagShape::BoolFlag(@common.BoolFlagShape::{ - default: mbt_ffi_load8_u(iter_base + 52) != 0, - negatable: mbt_ffi_load8_u(iter_base + 53) != 0, - }) - 1 => { - let lifted70 : UInt? = match mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 56).reinterpret_as_uint(), - ) - _ => panic() - } - - @common.FlagShape::CountFlag(lifted70) - } - _ => panic() - } + @types.SchemaTypeBody::F64Type(lifted543) + } + 12 => { - let lifted73 : String? = match mbt_ffi_load8_u(iter_base + 60) { - 0 => Option::None - 1 => { - let result72 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + @types.SchemaTypeBody::CharType + } + 13 => { - Option::Some(result72) - } - _ => panic() - } - - array74.push(@common.FlagSpec::{ - long: result59, - short: lifted60, - aliases: array62, - doc: @common.Doc::{ - summary: result64, - description: result65, - examples: array68, - }, - shape: lifted71, - env_var: lifted73, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array76 : Array[Int] = [] - for index77 = 0 - index77 < mbt_ffi_load32(iter_base + 60) - index77 = index77 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index77 * 4 - - array76.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted544 : @common.CommandBody? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let array119 : Array[@common.Positional] = [] - for index120 = 0 - index120 < mbt_ffi_load32(iter_base + 72) - index120 = index120 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 68) + index120 * 68 - - let result78 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result79 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result80 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let array83 : Array[@common.Example] = [] - for index84 = 0 - index84 < mbt_ffi_load32(iter_base + 28) - index84 = index84 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index84 * 16 - - let result81 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result82 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array83.push(@common.Example::{ - title: result81, - body: result82, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let lifted86 : String? = match mbt_ffi_load8_u(iter_base + 32) { - 0 => Option::None - 1 => { - let result85 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 36), - mbt_ffi_load32(iter_base + 40), - ) - - Option::Some(result85) - } - _ => panic() - } - - let lifted118 : @types.SchemaValueTree? = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => { - let array116 : Array[@types.SchemaValueNode] = [] - for index117 = 0 - index117 < mbt_ffi_load32(iter_base + 56) - index117 = index117 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 52) + - index117 * 32 - - let lifted115 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result87 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result87) - } - 13 => { - let array88 : Array[Int] = [] - for index89 = 0 - index89 < mbt_ffi_load32(iter_base + 12) - index89 = index89 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index89 * 4 - - array88.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array88) - } - 14 => { - let lifted90 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted90, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array91 : Array[Bool] = [] - for index92 = 0 - index92 < mbt_ffi_load32(iter_base + 12) - index92 = index92 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index92 * 1 - - array91.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array91) - } - 17 => { - let array93 : Array[Int] = [] - for index94 = 0 - index94 < mbt_ffi_load32(iter_base + 12) - index94 = index94 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index94 * 4 - - array93.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array93) - } - 18 => { - let array95 : Array[Int] = [] - for index96 = 0 - index96 < mbt_ffi_load32(iter_base + 12) - index96 = index96 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index96 * 4 - - array95.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array95) - } - 19 => { - let array97 : Array[Int] = [] - for index98 = 0 - index98 < mbt_ffi_load32(iter_base + 12) - index98 = index98 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index98 * 4 - - array97.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array97) - } - 20 => { - let array99 : Array[@types.MapEntry] = [] - for index100 = 0 - index100 < mbt_ffi_load32(iter_base + 12) - index100 = index100 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index100 * 8 - - array99.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array99) - } - 21 => { - let lifted101 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted101) - } - 22 => { - let lifted104 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted102 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.SchemaTypeBody::StringType + } + 14 => { - @types.ResultValuePayload::OkValue(lifted102) - } - 1 => { - let lifted103 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted103) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted104) - } - 23 => { - let result105 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted107 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result106 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result106) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result105, - language: lifted107, - }) - } - 24 => { - let result108 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted110 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result109 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result109) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result108, - mime_type: lifted110, - }) - } - 25 => { - let result111 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result111) - } - 26 => { - let result112 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result112) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result113 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result113, - }) - } - 30 => { - let result114 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result114, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array116.push(lifted115) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 52)) - - Option::Some(@types.SchemaValueTree::{ - value_nodes: array116, - root: mbt_ffi_load32(iter_base + 60), - }) - } - _ => panic() - } - - array119.push(@common.Positional::{ - name: result78, - doc: @common.Doc::{ - summary: result79, - description: result80, - examples: array83, - }, - value_name: lifted86, - type_: mbt_ffi_load32(iter_base + 44), - default: lifted118, - required: mbt_ffi_load8_u(iter_base + 64) != 0, - accepts_stdio: mbt_ffi_load8_u(iter_base + 65) != 0, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - - let lifted133 : @common.TailPositional? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let result121 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 80), - mbt_ffi_load32(iter_base + 84), - ) - - let result122 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 88), - mbt_ffi_load32(iter_base + 92), - ) - - let result123 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 96), - mbt_ffi_load32(iter_base + 100), - ) - - let array126 : Array[@common.Example] = [] - for index127 = 0 - index127 < mbt_ffi_load32(iter_base + 108) - index127 = index127 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 104) + - index127 * 16 - - let result124 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result125 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array126.push(@common.Example::{ - title: result124, - body: result125, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 104)) - - let lifted129 : String? = match - mbt_ffi_load8_u(iter_base + 112) { - 0 => Option::None - 1 => { - let result128 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 116), - mbt_ffi_load32(iter_base + 120), - ) + let array558 : Array[@types.NamedFieldType] = []; + for index559 = 0; index559 < (mbt_ffi_load32((iter_base) + 12)); index559 = index559 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index559 * 68) - Option::Some(result128) - } - _ => panic() - } - - let lifted130 : UInt? = match mbt_ffi_load8_u(iter_base + 132) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 136).reinterpret_as_uint(), - ) - _ => panic() - } + let result544 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted132 : String? = match - mbt_ffi_load8_u(iter_base + 140) { - 0 => Option::None - 1 => { - let result131 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 144), - mbt_ffi_load32(iter_base + 148), - ) + let lifted546 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(result131) - } - _ => panic() - } - - Option::Some(@common.TailPositional::{ - name: result121, - doc: @common.Doc::{ - summary: result122, - description: result123, - examples: array126, - }, - value_name: lifted129, - item_type: mbt_ffi_load32(iter_base + 124), - min: mbt_ffi_load32(iter_base + 128).reinterpret_as_uint(), - max: lifted130, - separator: lifted132, - verbatim: mbt_ffi_load8_u(iter_base + 152) != 0, - accepts_stdio: mbt_ffi_load8_u(iter_base + 153) != 0, - }) - } - _ => panic() - } + let result545 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) + + Option::Some(result545) + } + _ => panic() + } + + let array548 : Array[String] = []; + for index549 = 0; index549 < (mbt_ffi_load32((iter_base) + 28)); index549 = index549 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index549 * 8) + + let result547 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array548.push(result547) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + let array551 : Array[String] = []; + for index552 = 0; index552 < (mbt_ffi_load32((iter_base) + 36)); index552 = index552 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index552 * 8) + + let result550 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array551.push(result550) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) + + let lifted554 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let result553 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) + + Option::Some(result553) + } + _ => panic() + } + + let lifted557 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { + + let lifted556 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { + + @types.Role::Multimodal + } + 1 => { + + @types.Role::UnstructuredText + } + 2 => { + + @types.Role::UnstructuredBinary + } + 3 => { + + let result555 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) + + @types.Role::Other(result555) + } + _ => panic() + } + + Option::Some(lifted556) + } + _ => panic() + } + + array558.push(@types.NamedFieldType::{name : result544, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted546, aliases : array548, examples : array551, deprecated : lifted554, role : lifted557}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::RecordType(array558) + } + 15 => { + + let array575 : Array[@types.VariantCaseType] = []; + for index576 = 0; index576 < (mbt_ffi_load32((iter_base) + 12)); index576 = index576 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index576 * 72) + + let result560 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted561 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } + + let lifted563 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let result562 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + Option::Some(result562) + } + _ => panic() + } + + let array565 : Array[String] = []; + for index566 = 0; index566 < (mbt_ffi_load32((iter_base) + 32)); index566 = index566 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index566 * 8) + + let result564 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array565.push(result564) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + let array568 : Array[String] = []; + for index569 = 0; index569 < (mbt_ffi_load32((iter_base) + 40)); index569 = index569 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index569 * 8) + + let result567 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array568.push(result567) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + let lifted571 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { + + let result570 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) + + Option::Some(result570) + } + _ => panic() + } + + let lifted574 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - let array184 : Array[@common.OptionSpec] = [] - for index185 = 0 - index185 < mbt_ffi_load32(iter_base + 160) - index185 = index185 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 156) + index185 * 112 - - let result134 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted135 : Char? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 12)), - ) - _ => panic() - } - - let array137 : Array[String] = [] - for index138 = 0 - index138 < mbt_ffi_load32(iter_base + 20) - index138 = index138 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index138 * 8 - - let result136 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array137.push(result136) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let result139 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let result140 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array143 : Array[@common.Example] = [] - for index144 = 0 - index144 < mbt_ffi_load32(iter_base + 44) - index144 = index144 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index144 * 16 - - let result141 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result142 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array143.push(@common.Example::{ - title: result141, - body: result142, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let lifted146 : String? = match mbt_ffi_load8_u(iter_base + 48) { - 0 => Option::None - 1 => { - let result145 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 52), - mbt_ffi_load32(iter_base + 56), - ) - - Option::Some(result145) - } - _ => panic() - } - - let lifted149 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @common.OptionShape::Scalar(mbt_ffi_load32(iter_base + 64)) - 1 => - @common.OptionShape::OptionalScalar( - mbt_ffi_load32(iter_base + 64), - ) - 2 => { - let lifted147 = match mbt_ffi_load8_u(iter_base + 64) { - 0 => @common.Repetition::Repeated - 1 => - @common.Repetition::Delimited( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - 2 => - @common.Repetition::Either( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - _ => panic() - } - - @common.OptionShape::RepeatableList(@common.RepeatableListShape::{ - repetition: lifted147, - item_type: mbt_ffi_load32(iter_base + 72), - }) - } - 3 => { - let lifted148 = match mbt_ffi_load8_u(iter_base + 64) { - 0 => @common.Repetition::Repeated - 1 => - @common.Repetition::Delimited( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - 2 => - @common.Repetition::Either( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 68)), - ) - _ => panic() - } - - @common.OptionShape::RepeatableMap(@common.RepeatableMapShape::{ - repetition: lifted148, - map_type: mbt_ffi_load32(iter_base + 72), - duplicate_key_policy: @common.DuplicateKeyPolicy::from( - mbt_ffi_load8_u(iter_base + 76), - ), - }) - } - _ => panic() - } - - let lifted181 : @types.SchemaValueTree? = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => Option::None - 1 => { - let array179 : Array[@types.SchemaValueNode] = [] - for index180 = 0 - index180 < mbt_ffi_load32(iter_base + 88) - index180 = index180 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 84) + - index180 * 32 - - let lifted178 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result150) - } - 13 => { - let array151 : Array[Int] = [] - for index152 = 0 - index152 < mbt_ffi_load32(iter_base + 12) - index152 = index152 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index152 * 4 - - array151.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array151) - } - 14 => { - let lifted153 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted153, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array154 : Array[Bool] = [] - for index155 = 0 - index155 < mbt_ffi_load32(iter_base + 12) - index155 = index155 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index155 * 1 - - array154.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array154) - } - 17 => { - let array156 : Array[Int] = [] - for index157 = 0 - index157 < mbt_ffi_load32(iter_base + 12) - index157 = index157 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index157 * 4 - - array156.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array156) - } - 18 => { - let array158 : Array[Int] = [] - for index159 = 0 - index159 < mbt_ffi_load32(iter_base + 12) - index159 = index159 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index159 * 4 - - array158.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array158) - } - 19 => { - let array160 : Array[Int] = [] - for index161 = 0 - index161 < mbt_ffi_load32(iter_base + 12) - index161 = index161 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index161 * 4 - - array160.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array160) - } - 20 => { - let array162 : Array[@types.MapEntry] = [] - for index163 = 0 - index163 < mbt_ffi_load32(iter_base + 12) - index163 = index163 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index163 * 8 - - array162.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array162) - } - 21 => { - let lifted164 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted164) - } - 22 => { - let lifted167 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted165 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let lifted573 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { - @types.ResultValuePayload::OkValue(lifted165) - } - 1 => { - let lifted166 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted166) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted167) - } - 23 => { - let result168 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted170 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result169 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result169) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result168, - language: lifted170, - }) - } - 24 => { - let result171 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted173 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result172 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result172) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result171, - mime_type: lifted173, - }) - } - 25 => { - let result174 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result174) - } - 26 => { - let result175 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result175) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result176 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result176, - }) - } - 30 => { - let result177 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result177, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array179.push(lifted178) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - - Option::Some(@types.SchemaValueTree::{ - value_nodes: array179, - root: mbt_ffi_load32(iter_base + 92), - }) - } - _ => panic() - } - - let lifted183 : String? = match mbt_ffi_load8_u(iter_base + 100) { - 0 => Option::None - 1 => { - let result182 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 104), - mbt_ffi_load32(iter_base + 108), - ) - - Option::Some(result182) - } - _ => panic() - } - - array184.push(@common.OptionSpec::{ - long: result134, - short: lifted135, - aliases: array137, - doc: @common.Doc::{ - summary: result139, - description: result140, - examples: array143, - }, - value_name: lifted146, - shape: lifted149, - default: lifted181, - required: mbt_ffi_load8_u(iter_base + 96) != 0, - env_var: lifted183, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 156)) - - let array201 : Array[@common.FlagSpec] = [] - for index202 = 0 - index202 < mbt_ffi_load32(iter_base + 168) - index202 = index202 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 164) + index202 * 72 - - let result186 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted187 : Char? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 12)), - ) - _ => panic() - } - - let array189 : Array[String] = [] - for index190 = 0 - index190 < mbt_ffi_load32(iter_base + 20) - index190 = index190 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index190 * 8 - - let result188 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array189.push(result188) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let result191 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 24), - mbt_ffi_load32(iter_base + 28), - ) - - let result192 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 32), - mbt_ffi_load32(iter_base + 36), - ) - - let array195 : Array[@common.Example] = [] - for index196 = 0 - index196 < mbt_ffi_load32(iter_base + 44) - index196 = index196 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 40) + index196 * 16 - - let result193 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result194 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array195.push(@common.Example::{ - title: result193, - body: result194, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - - let lifted198 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @common.FlagShape::BoolFlag(@common.BoolFlagShape::{ - default: mbt_ffi_load8_u(iter_base + 52) != 0, - negatable: mbt_ffi_load8_u(iter_base + 53) != 0, - }) - 1 => { - let lifted197 : UInt? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 56).reinterpret_as_uint(), - ) - _ => panic() - } - - @common.FlagShape::CountFlag(lifted197) - } - _ => panic() - } - - let lifted200 : String? = match mbt_ffi_load8_u(iter_base + 60) { - 0 => Option::None - 1 => { - let result199 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - Option::Some(result199) - } - _ => panic() - } - - array201.push(@common.FlagSpec::{ - long: result186, - short: lifted187, - aliases: array189, - doc: @common.Doc::{ - summary: result191, - description: result192, - examples: array195, - }, - shape: lifted198, - env_var: lifted200, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 164)) - - let array494 : Array[@common.Constraint] = [] - for index495 = 0 - index495 < mbt_ffi_load32(iter_base + 176) - index495 = index495 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 172) + index495 * 28 - - let lifted493 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let array237 : Array[@common.Ref] = [] - for index238 = 0 - index238 < mbt_ffi_load32(iter_base + 8) - index238 = index238 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + - index238 * 24 - - let lifted236 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result203 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result203) - } - 1 => { - let result204 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array234 : Array[@types.SchemaValueNode] = [] - for index235 = 0 - index235 < mbt_ffi_load32(iter_base + 16) - index235 = index235 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index235 * 32 - - let lifted233 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char( - mbt_ffi_load32(iter_base + 8), - ), - ) - 12 => { - let result205 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result205) - } - 13 => { - let array206 : Array[Int] = [] - for index207 = 0 - index207 < mbt_ffi_load32(iter_base + 12) - index207 = index207 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index207 * 4 - - array206.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array206) - } - 14 => { - let lifted208 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted208, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array209 : Array[Bool] = [] - for index210 = 0 - index210 < mbt_ffi_load32(iter_base + 12) - index210 = index210 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index210 * 1 - - array209.push( - mbt_ffi_load8_u(iter_base + 0) != 0, - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array209) - } - 17 => { - let array211 : Array[Int] = [] - for index212 = 0 - index212 < mbt_ffi_load32(iter_base + 12) - index212 = index212 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index212 * 4 - - array211.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array211) - } - 18 => { - let array213 : Array[Int] = [] - for index214 = 0 - index214 < mbt_ffi_load32(iter_base + 12) - index214 = index214 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index214 * 4 - - array213.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array213) - } - 19 => { - let array215 : Array[Int] = [] - for index216 = 0 - index216 < mbt_ffi_load32(iter_base + 12) - index216 = index216 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index216 * 4 - - array215.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array215) - } - 20 => { - let array217 : Array[@types.MapEntry] = [] - for index218 = 0 - index218 < mbt_ffi_load32(iter_base + 12) - index218 = index218 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index218 * 8 - - array217.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array217) - } - 21 => { - let lifted219 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted219) - } - 22 => { - let lifted222 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted220 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - @types.ResultValuePayload::OkValue(lifted220) - } - 1 => { - let lifted221 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted221) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted222) - } - 23 => { - let result223 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted225 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result224 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result224) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result223, - language: lifted225, - }) - } - 24 => { - let result226 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted228 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result227 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result227) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result226, - mime_type: lifted228, - }) - } - 25 => { - let result229 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result229) - } - 26 => { - let result230 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result230) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result231 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result231, - }) - } - 30 => { - let result232 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result232, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array234.push(lifted233) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result204, - value: @types.SchemaValueTree::{ - value_nodes: array234, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array237.push(lifted236) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - @common.Constraint::RequiresAll(array237) - } - 1 => { - let array273 : Array[@common.Ref] = [] - for index274 = 0 - index274 < mbt_ffi_load32(iter_base + 8) - index274 = index274 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + - index274 * 24 - - let lifted272 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result239 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result239) - } - 1 => { - let result240 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array270 : Array[@types.SchemaValueNode] = [] - for index271 = 0 - index271 < mbt_ffi_load32(iter_base + 16) - index271 = index271 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index271 * 32 - - let lifted269 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char( - mbt_ffi_load32(iter_base + 8), - ), - ) - 12 => { - let result241 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result241) - } - 13 => { - let array242 : Array[Int] = [] - for index243 = 0 - index243 < mbt_ffi_load32(iter_base + 12) - index243 = index243 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index243 * 4 - - array242.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array242) - } - 14 => { - let lifted244 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted244, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array245 : Array[Bool] = [] - for index246 = 0 - index246 < mbt_ffi_load32(iter_base + 12) - index246 = index246 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index246 * 1 - - array245.push( - mbt_ffi_load8_u(iter_base + 0) != 0, - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array245) - } - 17 => { - let array247 : Array[Int] = [] - for index248 = 0 - index248 < mbt_ffi_load32(iter_base + 12) - index248 = index248 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index248 * 4 - - array247.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array247) - } - 18 => { - let array249 : Array[Int] = [] - for index250 = 0 - index250 < mbt_ffi_load32(iter_base + 12) - index250 = index250 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index250 * 4 - - array249.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array249) - } - 19 => { - let array251 : Array[Int] = [] - for index252 = 0 - index252 < mbt_ffi_load32(iter_base + 12) - index252 = index252 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index252 * 4 - - array251.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array251) - } - 20 => { - let array253 : Array[@types.MapEntry] = [] - for index254 = 0 - index254 < mbt_ffi_load32(iter_base + 12) - index254 = index254 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index254 * 8 - - array253.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array253) - } - 21 => { - let lifted255 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted255) - } - 22 => { - let lifted258 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted256 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - @types.ResultValuePayload::OkValue(lifted256) - } - 1 => { - let lifted257 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted257) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted258) - } - 23 => { - let result259 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted261 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result260 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result260) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result259, - language: lifted261, - }) - } - 24 => { - let result262 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted264 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result263 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result263) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result262, - mime_type: lifted264, - }) - } - 25 => { - let result265 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result265) - } - 26 => { - let result266 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result266) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result267 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result267, - }) - } - 30 => { - let result268 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result268, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array270.push(lifted269) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result240, - value: @types.SchemaValueTree::{ - value_nodes: array270, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array273.push(lifted272) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - @common.Constraint::AllOrNone(array273) - } - 2 => { - let array309 : Array[@common.Ref] = [] - for index310 = 0 - index310 < mbt_ffi_load32(iter_base + 8) - index310 = index310 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + - index310 * 24 - - let lifted308 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result275 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result275) - } - 1 => { - let result276 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array306 : Array[@types.SchemaValueNode] = [] - for index307 = 0 - index307 < mbt_ffi_load32(iter_base + 16) - index307 = index307 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index307 * 32 - - let lifted305 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char( - mbt_ffi_load32(iter_base + 8), - ), - ) - 12 => { - let result277 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result277) - } - 13 => { - let array278 : Array[Int] = [] - for index279 = 0 - index279 < mbt_ffi_load32(iter_base + 12) - index279 = index279 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index279 * 4 - - array278.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array278) - } - 14 => { - let lifted280 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted280, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array281 : Array[Bool] = [] - for index282 = 0 - index282 < mbt_ffi_load32(iter_base + 12) - index282 = index282 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index282 * 1 - - array281.push( - mbt_ffi_load8_u(iter_base + 0) != 0, - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array281) - } - 17 => { - let array283 : Array[Int] = [] - for index284 = 0 - index284 < mbt_ffi_load32(iter_base + 12) - index284 = index284 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index284 * 4 - - array283.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array283) - } - 18 => { - let array285 : Array[Int] = [] - for index286 = 0 - index286 < mbt_ffi_load32(iter_base + 12) - index286 = index286 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index286 * 4 - - array285.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array285) - } - 19 => { - let array287 : Array[Int] = [] - for index288 = 0 - index288 < mbt_ffi_load32(iter_base + 12) - index288 = index288 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index288 * 4 - - array287.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array287) - } - 20 => { - let array289 : Array[@types.MapEntry] = [] - for index290 = 0 - index290 < mbt_ffi_load32(iter_base + 12) - index290 = index290 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index290 * 8 - - array289.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array289) - } - 21 => { - let lifted291 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted291) - } - 22 => { - let lifted294 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted292 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - @types.ResultValuePayload::OkValue(lifted292) - } - 1 => { - let lifted293 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted293) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted294) - } - 23 => { - let result295 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted297 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result296 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result296) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result295, - language: lifted297, - }) - } - 24 => { - let result298 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted300 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result299 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result299) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result298, - mime_type: lifted300, - }) - } - 25 => { - let result301 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result301) - } - 26 => { - let result302 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result302) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result303 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result303, - }) - } - 30 => { - let result304 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result304, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array306.push(lifted305) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result276, - value: @types.SchemaValueTree::{ - value_nodes: array306, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array309.push(lifted308) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - @common.Constraint::RequiresAny(array309) - } - 3 => { - let array347 : Array[@common.RefGroup] = [] - for index348 = 0 - index348 < mbt_ffi_load32(iter_base + 8) - index348 = index348 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 4) + index348 * 8 - - let array345 : Array[@common.Ref] = [] - for index346 = 0 - index346 < mbt_ffi_load32(iter_base + 4) - index346 = index346 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 0) + - index346 * 24 - - let lifted344 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result311 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) + let result572 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) - @common.Ref::Present(result311) - } - 1 => { - let result312 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array342 : Array[@types.SchemaValueNode] = [] - for index343 = 0 - index343 < mbt_ffi_load32(iter_base + 16) - index343 = index343 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index343 * 32 - - let lifted341 = match - mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char( - mbt_ffi_load32(iter_base + 8), - ), - ) - 12 => { - let result313 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + @types.Role::Other(result572) + } + _ => panic() + } - @types.SchemaValueNode::StringValue(result313) - } - 13 => { - let array314 : Array[Int] = [] - for index315 = 0 - index315 < mbt_ffi_load32(iter_base + 12) - index315 = index315 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index315 * 4 + Option::Some(lifted573) + } + _ => panic() + } - array314.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + array575.push(@types.VariantCaseType::{name : result560, payload : lifted561, metadata : @types.MetadataEnvelope::{doc : lifted563, aliases : array565, examples : array568, deprecated : lifted571, role : lifted574}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.SchemaValueNode::RecordValue(array314) - } - 14 => { - let lifted316 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted316, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array317 : Array[Bool] = [] - for index318 = 0 - index318 < mbt_ffi_load32(iter_base + 12) - index318 = index318 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index318 * 1 + @types.SchemaTypeBody::VariantType(array575) + } + 16 => { - array317.push( - mbt_ffi_load8_u(iter_base + 0) != 0, - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let array578 : Array[String] = []; + for index579 = 0; index579 < (mbt_ffi_load32((iter_base) + 12)); index579 = index579 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index579 * 8) - @types.SchemaValueNode::FlagsValue(array317) - } - 17 => { - let array319 : Array[Int] = [] - for index320 = 0 - index320 < mbt_ffi_load32(iter_base + 12) - index320 = index320 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index320 * 4 + let result577 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array319.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + array578.push(result577) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.SchemaValueNode::TupleValue(array319) - } - 18 => { - let array321 : Array[Int] = [] - for index322 = 0 - index322 < mbt_ffi_load32(iter_base + 12) - index322 = index322 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index322 * 4 + @types.SchemaTypeBody::EnumType(array578) + } + 17 => { - array321.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let array581 : Array[String] = []; + for index582 = 0; index582 < (mbt_ffi_load32((iter_base) + 12)); index582 = index582 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index582 * 8) - @types.SchemaValueNode::ListValue(array321) - } - 19 => { - let array323 : Array[Int] = [] - for index324 = 0 - index324 < mbt_ffi_load32(iter_base + 12) - index324 = index324 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index324 * 4 + let result580 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - array323.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + array581.push(result580) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.SchemaValueNode::FixedListValue(array323) - } - 20 => { - let array325 : Array[@types.MapEntry] = [] - for index326 = 0 - index326 < mbt_ffi_load32(iter_base + 12) - index326 = index326 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index326 * 8 - - array325.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array325) - } - 21 => { - let lifted327 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaTypeBody::FlagsType(array581) + } + 18 => { - @types.SchemaValueNode::OptionValue(lifted327) - } - 22 => { - let lifted330 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted328 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } - - @types.ResultValuePayload::OkValue( - lifted328, - ) - } - 1 => { - let lifted329 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } - - @types.ResultValuePayload::ErrValue( - lifted329, - ) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted330) - } - 23 => { - let result331 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted333 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result332 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result332) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result331, - language: lifted333, - }) - } - 24 => { - let result334 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted336 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result335 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result335) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result334, - mime_type: lifted336, - }) - } - 25 => { - let result337 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + let array583 : Array[Int] = []; + for index584 = 0; index584 < (mbt_ffi_load32((iter_base) + 12)); index584 = index584 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index584 * 4) - @types.SchemaValueNode::PathValue(result337) - } - 26 => { - let result338 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result338) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result339 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + array583.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result339, - }) - } - 30 => { - let result340 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result340, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } + @types.SchemaTypeBody::TupleType(array583) + } + 19 => { - array342.push(lifted341) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result312, - value: @types.SchemaValueTree::{ - value_nodes: array342, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array345.push(lifted344) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - array347.push(@common.RefGroup::{ refs: array345 }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 4)) - - @common.Constraint::MutexGroups(array347) - } - 4 => { - let array383 : Array[@common.Ref] = [] - for index384 = 0 - index384 < mbt_ffi_load32(iter_base + 12) - index384 = index384 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index384 * 24 - - let lifted382 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result349 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result349) - } - 1 => { - let result350 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array380 : Array[@types.SchemaValueNode] = [] - for index381 = 0 - index381 < mbt_ffi_load32(iter_base + 16) - index381 = index381 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index381 * 32 - - let lifted379 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char( - mbt_ffi_load32(iter_base + 8), - ), - ) - 12 => { - let result351 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result351) - } - 13 => { - let array352 : Array[Int] = [] - for index353 = 0 - index353 < mbt_ffi_load32(iter_base + 12) - index353 = index353 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index353 * 4 - - array352.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array352) - } - 14 => { - let lifted354 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted354, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array355 : Array[Bool] = [] - for index356 = 0 - index356 < mbt_ffi_load32(iter_base + 12) - index356 = index356 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index356 * 1 - - array355.push( - mbt_ffi_load8_u(iter_base + 0) != 0, - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array355) - } - 17 => { - let array357 : Array[Int] = [] - for index358 = 0 - index358 < mbt_ffi_load32(iter_base + 12) - index358 = index358 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index358 * 4 - - array357.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array357) - } - 18 => { - let array359 : Array[Int] = [] - for index360 = 0 - index360 < mbt_ffi_load32(iter_base + 12) - index360 = index360 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index360 * 4 - - array359.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array359) - } - 19 => { - let array361 : Array[Int] = [] - for index362 = 0 - index362 < mbt_ffi_load32(iter_base + 12) - index362 = index362 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index362 * 4 - - array361.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array361) - } - 20 => { - let array363 : Array[@types.MapEntry] = [] - for index364 = 0 - index364 < mbt_ffi_load32(iter_base + 12) - index364 = index364 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index364 * 8 - - array363.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array363) - } - 21 => { - let lifted365 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted365) - } - 22 => { - let lifted368 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted366 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { - @types.ResultValuePayload::OkValue(lifted366) - } - 1 => { - let lifted367 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted367) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted368) - } - 23 => { - let result369 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted371 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result370 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result370) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result369, - language: lifted371, - }) - } - 24 => { - let result372 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted374 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result373 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result373) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result372, - mime_type: lifted374, - }) - } - 25 => { - let result375 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result375) - } - 26 => { - let result376 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result376) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result377 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result377, - }) - } - 30 => { - let result378 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result378, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array380.push(lifted379) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result350, - value: @types.SchemaValueTree::{ - value_nodes: array380, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array383.push(lifted382) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - let array419 : Array[@common.Ref] = [] - for index420 = 0 - index420 < mbt_ffi_load32(iter_base + 24) - index420 = index420 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 20) + - index420 * 24 - - let lifted418 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result385 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result385) - } - 1 => { - let result386 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array416 : Array[@types.SchemaValueNode] = [] - for index417 = 0 - index417 < mbt_ffi_load32(iter_base + 16) - index417 = index417 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index417 * 32 - - let lifted415 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char( - mbt_ffi_load32(iter_base + 8), - ), - ) - 12 => { - let result387 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result387) - } - 13 => { - let array388 : Array[Int] = [] - for index389 = 0 - index389 < mbt_ffi_load32(iter_base + 12) - index389 = index389 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index389 * 4 - - array388.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array388) - } - 14 => { - let lifted390 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted390, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array391 : Array[Bool] = [] - for index392 = 0 - index392 < mbt_ffi_load32(iter_base + 12) - index392 = index392 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index392 * 1 - - array391.push( - mbt_ffi_load8_u(iter_base + 0) != 0, - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array391) - } - 17 => { - let array393 : Array[Int] = [] - for index394 = 0 - index394 < mbt_ffi_load32(iter_base + 12) - index394 = index394 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index394 * 4 - - array393.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array393) - } - 18 => { - let array395 : Array[Int] = [] - for index396 = 0 - index396 < mbt_ffi_load32(iter_base + 12) - index396 = index396 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index396 * 4 - - array395.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array395) - } - 19 => { - let array397 : Array[Int] = [] - for index398 = 0 - index398 < mbt_ffi_load32(iter_base + 12) - index398 = index398 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index398 * 4 - - array397.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array397) - } - 20 => { - let array399 : Array[@types.MapEntry] = [] - for index400 = 0 - index400 < mbt_ffi_load32(iter_base + 12) - index400 = index400 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index400 * 8 - - array399.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array399) - } - 21 => { - let lifted401 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted401) - } - 22 => { - let lifted404 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted402 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { - @types.ResultValuePayload::OkValue(lifted402) - } - 1 => { - let lifted403 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted403) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted404) - } - 23 => { - let result405 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted407 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result406 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result406) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result405, - language: lifted407, - }) - } - 24 => { - let result408 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted410 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result409 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result409) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result408, - mime_type: lifted410, - }) - } - 25 => { - let result411 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result411) - } - 26 => { - let result412 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result412) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result413 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result413, - }) - } - 30 => { - let result414 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result414, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array416.push(lifted415) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result386, - value: @types.SchemaValueTree::{ - value_nodes: array416, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array419.push(lifted418) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - - @common.Constraint::Implies(@common.ImpliesC::{ - lhs_quant: @common.Quantifier::from( - mbt_ffi_load8_u(iter_base + 4), - ), - lhs: array383, - rhs_quant: @common.Quantifier::from( - mbt_ffi_load8_u(iter_base + 16), - ), - rhs: array419, - }) - } - 5 => { - let array455 : Array[@common.Ref] = [] - for index456 = 0 - index456 < mbt_ffi_load32(iter_base + 12) - index456 = index456 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index456 * 24 - - let lifted454 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result421 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result421) - } - 1 => { - let result422 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array452 : Array[@types.SchemaValueNode] = [] - for index453 = 0 - index453 < mbt_ffi_load32(iter_base + 16) - index453 = index453 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index453 * 32 - - let lifted451 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char( - mbt_ffi_load32(iter_base + 8), - ), - ) - 12 => { - let result423 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result423) - } - 13 => { - let array424 : Array[Int] = [] - for index425 = 0 - index425 < mbt_ffi_load32(iter_base + 12) - index425 = index425 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index425 * 4 - - array424.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array424) - } - 14 => { - let lifted426 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted426, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array427 : Array[Bool] = [] - for index428 = 0 - index428 < mbt_ffi_load32(iter_base + 12) - index428 = index428 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index428 * 1 - - array427.push( - mbt_ffi_load8_u(iter_base + 0) != 0, - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array427) - } - 17 => { - let array429 : Array[Int] = [] - for index430 = 0 - index430 < mbt_ffi_load32(iter_base + 12) - index430 = index430 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index430 * 4 - - array429.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array429) - } - 18 => { - let array431 : Array[Int] = [] - for index432 = 0 - index432 < mbt_ffi_load32(iter_base + 12) - index432 = index432 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index432 * 4 - - array431.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array431) - } - 19 => { - let array433 : Array[Int] = [] - for index434 = 0 - index434 < mbt_ffi_load32(iter_base + 12) - index434 = index434 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index434 * 4 - - array433.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array433) - } - 20 => { - let array435 : Array[@types.MapEntry] = [] - for index436 = 0 - index436 < mbt_ffi_load32(iter_base + 12) - index436 = index436 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index436 * 8 - - array435.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array435) - } - 21 => { - let lifted437 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted437) - } - 22 => { - let lifted440 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted438 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { - @types.ResultValuePayload::OkValue(lifted438) - } - 1 => { - let lifted439 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted439) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted440) - } - 23 => { - let result441 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted443 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result442 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result442) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result441, - language: lifted443, - }) - } - 24 => { - let result444 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted446 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result445 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result445) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result444, - mime_type: lifted446, - }) - } - 25 => { - let result447 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result447) - } - 26 => { - let result448 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result448) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result449 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result449, - }) - } - 30 => { - let result450 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result450, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array452.push(lifted451) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result422, - value: @types.SchemaValueTree::{ - value_nodes: array452, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array455.push(lifted454) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - let array491 : Array[@common.Ref] = [] - for index492 = 0 - index492 < mbt_ffi_load32(iter_base + 20) - index492 = index492 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index492 * 24 - - let lifted490 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => { - let result457 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - @common.Ref::Present(result457) - } - 1 => { - let result458 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) - - let array488 : Array[@types.SchemaValueNode] = [] - for index489 = 0 - index489 < mbt_ffi_load32(iter_base + 16) - index489 = index489 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index489 * 32 - - let lifted487 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char( - mbt_ffi_load32(iter_base + 8), - ), - ) - 12 => { - let result459 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result459) - } - 13 => { - let array460 : Array[Int] = [] - for index461 = 0 - index461 < mbt_ffi_load32(iter_base + 12) - index461 = index461 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index461 * 4 - - array460.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array460) - } - 14 => { - let lifted462 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted462, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array463 : Array[Bool] = [] - for index464 = 0 - index464 < mbt_ffi_load32(iter_base + 12) - index464 = index464 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index464 * 1 - - array463.push( - mbt_ffi_load8_u(iter_base + 0) != 0, - ) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array463) - } - 17 => { - let array465 : Array[Int] = [] - for index466 = 0 - index466 < mbt_ffi_load32(iter_base + 12) - index466 = index466 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index466 * 4 - - array465.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array465) - } - 18 => { - let array467 : Array[Int] = [] - for index468 = 0 - index468 < mbt_ffi_load32(iter_base + 12) - index468 = index468 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index468 * 4 - - array467.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array467) - } - 19 => { - let array469 : Array[Int] = [] - for index470 = 0 - index470 < mbt_ffi_load32(iter_base + 12) - index470 = index470 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index470 * 4 - - array469.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array469) - } - 20 => { - let array471 : Array[@types.MapEntry] = [] - for index472 = 0 - index472 < mbt_ffi_load32(iter_base + 12) - index472 = index472 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index472 * 8 - - array471.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array471) - } - 21 => { - let lifted473 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted473) - } - 22 => { - let lifted476 = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted474 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } + let lifted585 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.ResultValuePayload::OkValue(lifted474) - } - 1 => { - let lifted475 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 16), - ) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted475) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted476) - } - 23 => { - let result477 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted479 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result478 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result478) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result477, - language: lifted479, - }) - } - 24 => { - let result480 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted482 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result481 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result481) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result480, - mime_type: lifted482, - }) - } - 25 => { - let result483 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result483) - } - 26 => { - let result484 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result484) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result485 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result485, - }) - } - 30 => { - let result486 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result486, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret( - mbt_ffi_load32(iter_base + 8), - ), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array488.push(lifted487) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - @common.Ref::ValueIs(@common.ValueIsRef::{ - name: result458, - value: @types.SchemaValueTree::{ - value_nodes: array488, - root: mbt_ffi_load32(iter_base + 20), - }, - }) - } - _ => panic() - } - - array491.push(lifted490) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - @common.Constraint::Forbids(@common.ForbidsC::{ - lhs_quant: @common.Quantifier::from( - mbt_ffi_load8_u(iter_base + 4), - ), - lhs: array455, - rhs: array491, - }) - } - _ => panic() - } - - array494.push(lifted493) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 172)) - - let lifted505 : @common.StreamSpec? = match - mbt_ffi_load8_u(iter_base + 180) { - 0 => Option::None - 1 => { - let result496 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 184), - mbt_ffi_load32(iter_base + 188), - ) - - let result497 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 192), - mbt_ffi_load32(iter_base + 196), - ) - - let array500 : Array[@common.Example] = [] - for index501 = 0 - index501 < mbt_ffi_load32(iter_base + 204) - index501 = index501 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 200) + - index501 * 16 - - let result498 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result499 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array500.push(@common.Example::{ - title: result498, - body: result499, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 200)) - - let array503 : Array[String] = [] - for index504 = 0 - index504 < mbt_ffi_load32(iter_base + 212) - index504 = index504 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 208) + index504 * 8 - - let result502 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array503.push(result502) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 208)) - - Option::Some(@common.StreamSpec::{ - doc: @common.Doc::{ - summary: result496, - description: result497, - examples: array500, - }, - mime: array503, - required: mbt_ffi_load8_u(iter_base + 216) != 0, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - let lifted515 : @common.StreamSpec? = match - mbt_ffi_load8_u(iter_base + 220) { - 0 => Option::None - 1 => { - let result506 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 224), - mbt_ffi_load32(iter_base + 228), - ) - - let result507 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 232), - mbt_ffi_load32(iter_base + 236), - ) - - let array510 : Array[@common.Example] = [] - for index511 = 0 - index511 < mbt_ffi_load32(iter_base + 244) - index511 = index511 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 240) + - index511 * 16 - - let result508 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result509 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array510.push(@common.Example::{ - title: result508, - body: result509, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 240)) - - let array513 : Array[String] = [] - for index514 = 0 - index514 < mbt_ffi_load32(iter_base + 252) - index514 = index514 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 248) + index514 * 8 - - let result512 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array513.push(result512) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 248)) - - Option::Some(@common.StreamSpec::{ - doc: @common.Doc::{ - summary: result506, - description: result507, - examples: array510, - }, - mime: array513, - required: mbt_ffi_load8_u(iter_base + 256) != 0, - }) - } - _ => panic() - } + let lifted586 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted532 : @common.ResultSpec? = match - mbt_ffi_load8_u(iter_base + 260) { - 0 => Option::None - 1 => { - let result516 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 268), - mbt_ffi_load32(iter_base + 272), - ) - - let result517 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 276), - mbt_ffi_load32(iter_base + 280), - ) - - let array520 : Array[@common.Example] = [] - for index521 = 0 - index521 < mbt_ffi_load32(iter_base + 288) - index521 = index521 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 284) + - index521 * 16 - - let result518 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result519 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array520.push(@common.Example::{ - title: result518, - body: result519, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 284)) - - let array529 : Array[@common.Formatter] = [] - for index530 = 0 - index530 < mbt_ffi_load32(iter_base + 296) - index530 = index530 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 292) + - index530 * 32 - - let result522 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result523 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result524 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let array527 : Array[@common.Example] = [] - for index528 = 0 - index528 < mbt_ffi_load32(iter_base + 28) - index528 = index528 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index528 * 16 - - let result525 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result526 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array527.push(@common.Example::{ - title: result525, - body: result526, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - array529.push(@common.Formatter::{ - name: result522, - doc: @common.Doc::{ - summary: result523, - description: result524, - examples: array527, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 292)) - - let result531 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 300), - mbt_ffi_load32(iter_base + 304), - ) - - Option::Some(@common.ResultSpec::{ - type_: mbt_ffi_load32(iter_base + 264), - doc: @common.Doc::{ - summary: result516, - description: result517, - examples: array520, - }, - formatters: array529, - default_formatter: result531, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } - let array541 : Array[@common.ErrorCase] = [] - for index542 = 0 - index542 < mbt_ffi_load32(iter_base + 312) - index542 = index542 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 308) + index542 * 44 - - let result533 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result534 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let result535 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let array538 : Array[@common.Example] = [] - for index539 = 0 - index539 < mbt_ffi_load32(iter_base + 28) - index539 = index539 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index539 * 16 - - let result536 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result537 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array538.push(@common.Example::{ - title: result536, - body: result537, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let lifted540 : Int? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - - array541.push(@common.ErrorCase::{ - name: result533, - doc: @common.Doc::{ - summary: result534, - description: result535, - examples: array538, - }, - kind: @common.ErrorKind::from(mbt_ffi_load8_u(iter_base + 32)), - exit_code: mbt_ffi_load8_u(iter_base + 33).to_byte(), - payload: lifted540, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 308)) - - let lifted543 : @common.CommandAnnotations? = match - mbt_ffi_load8_u(iter_base + 316) { - 0 => Option::None - 1 => - Option::Some(@common.CommandAnnotations::{ - read_only: mbt_ffi_load8_u(iter_base + 317) != 0, - destructive: mbt_ffi_load8_u(iter_base + 318) != 0, - idempotent: mbt_ffi_load8_u(iter_base + 319) != 0, - open_world: mbt_ffi_load8_u(iter_base + 320) != 0, - }) - _ => panic() - } + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted585, err : lifted586}) + } + 24 => { - Option::Some(@common.CommandBody::{ - positionals: @common.Positionals::{ - fixed: array119, - tail: lifted133, - }, - options: array184, - flags: array201, - constraints: array494, - stdin: lifted505, - stdout: lifted515, - result: lifted532, - errors: array541, - annotations: lifted543, - }) - } - _ => panic() - } - - array545.push(@common.CommandNode::{ - name: result0, - aliases: array, - doc: @common.Doc::{ - summary: result2, - description: result3, - examples: array6, - }, - globals: @common.Globals::{ options: array57, flags: array74 }, - subcommands: array76, - body: lifted544, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 16)) - - let array743 : Array[@types.SchemaTypeNode] = [] - for index744 = 0 - index744 < mbt_ffi_load32(return_area + 28) - index744 = index744 + 1 { - let iter_base = mbt_ffi_load32(return_area + 24) + index744 * 144 - - let lifted729 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted553 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted548 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted547 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted547) - } - _ => panic() - } + let lifted590 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted550 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted549 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted549) - } - _ => panic() - } + let array588 : Array[String] = []; + for index589 = 0; index589 < (mbt_ffi_load32((iter_base) + 16)); index589 = index589 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index589 * 8) - let lifted552 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result551 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let result587 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(result551) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted548, - max: lifted550, - unit: lifted552, - }) - } - _ => panic() - } + array588.push(result587) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - @types.SchemaTypeBody::S8Type(lifted553) - } - 3 => { - let lifted560 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted555 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted554 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted554) - } - _ => panic() - } + Option::Some(array588) + } + _ => panic() + } - let lifted557 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted556 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted556) - } - _ => panic() - } + let lifted591 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - let lifted559 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result558 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - Option::Some(result558) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted555, - max: lifted557, - unit: lifted559, - }) - } - _ => panic() - } + let lifted592 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::S16Type(lifted560) - } - 4 => { - let lifted567 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted562 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted561 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted561) - } - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - let lifted564 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted563 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted563) - } - _ => panic() - } + let lifted594 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - let lifted566 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result565 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let result593 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - Option::Some(result565) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted562, - max: lifted564, - unit: lifted566, - }) - } - _ => panic() - } + Option::Some(result593) + } + _ => panic() + } - @types.SchemaTypeBody::S32Type(lifted567) - } - 5 => { - let lifted574 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted569 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted568 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted568) - } - _ => panic() - } + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted590, min_length : lifted591, max_length : lifted592, regex : lifted594}) + } + 25 => { - let lifted571 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted570 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted570) - } - _ => panic() - } + let lifted598 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted573 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result572 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let array596 : Array[String] = []; + for index597 = 0; index597 < (mbt_ffi_load32((iter_base) + 16)); index597 = index597 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index597 * 8) - Option::Some(result572) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted569, - max: lifted571, - unit: lifted573, - }) - } - _ => panic() - } + let result595 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::S64Type(lifted574) - } - 6 => { - let lifted581 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted576 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted575 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted575) - } - _ => panic() - } + array596.push(result595) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let lifted578 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted577 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted577) - } - _ => panic() - } + Option::Some(array596) + } + _ => panic() + } - let lifted580 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result579 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted599 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - Option::Some(result579) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted576, - max: lifted578, - unit: lifted580, - }) - } - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - @types.SchemaTypeBody::U8Type(lifted581) - } - 7 => { - let lifted588 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted583 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted582 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted582) - } - _ => panic() - } + let lifted600 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - let lifted585 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted584 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted584) - } - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - let lifted587 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result586 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted598, min_bytes : lifted599, max_bytes : lifted600}) + } + 26 => { - Option::Some(result586) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted583, - max: lifted585, - unit: lifted587, - }) - } - _ => panic() - } + let lifted604 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::U16Type(lifted588) - } - 8 => { - let lifted595 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted590 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted589 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted589) - } - _ => panic() - } + let array602 : Array[String] = []; + for index603 = 0; index603 < (mbt_ffi_load32((iter_base) + 20)); index603 = index603 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index603 * 8) - let lifted592 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted591 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted591) - } - _ => panic() - } + let result601 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted594 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result593 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + array602.push(result601) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - Option::Some(result593) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted590, - max: lifted592, - unit: lifted594, - }) - } - _ => panic() - } + Option::Some(array602) + } + _ => panic() + } - @types.SchemaTypeBody::U32Type(lifted595) - } - 9 => { - let lifted602 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted597 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted596 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted596) - } - _ => panic() - } + let lifted608 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let lifted599 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted598 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted598) - } - _ => panic() - } + let array606 : Array[String] = []; + for index607 = 0; index607 < (mbt_ffi_load32((iter_base) + 32)); index607 = index607 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index607 * 8) - let lifted601 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result600 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let result605 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(result600) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted597, - max: lifted599, - unit: lifted601, - }) - } - _ => panic() - } + array606.push(result605) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - @types.SchemaTypeBody::U64Type(lifted602) - } - 10 => { - let lifted609 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted604 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted603 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted603) - } - _ => panic() - } + Option::Some(array606) + } + _ => panic() + } - let lifted606 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted605 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted605) - } - _ => panic() - } + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted604, allowed_extensions : lifted608}) + } + 27 => { - let lifted608 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result607 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted612 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(result607) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted604, - max: lifted606, - unit: lifted608, - }) - } - _ => panic() - } + let array610 : Array[String] = []; + for index611 = 0; index611 < (mbt_ffi_load32((iter_base) + 16)); index611 = index611 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index611 * 8) - @types.SchemaTypeBody::F32Type(lifted609) - } - 11 => { - let lifted616 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted611 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted610 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted610) - } - _ => panic() - } + let result609 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted613 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted612 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted612) - } - _ => panic() - } + array610.push(result609) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let lifted615 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result614 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(array610) + } + _ => panic() + } - Option::Some(result614) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted611, - max: lifted613, - unit: lifted615, - }) - } - _ => panic() - } + let lifted616 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::F64Type(lifted616) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array631 : Array[@types.NamedFieldType] = [] - for index632 = 0 - index632 < mbt_ffi_load32(iter_base + 12) - index632 = index632 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index632 * 68 - - let result617 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted619 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result618 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result618) - } - _ => panic() - } - - let array621 : Array[String] = [] - for index622 = 0 - index622 < mbt_ffi_load32(iter_base + 28) - index622 = index622 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index622 * 8 - - let result620 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array621.push(result620) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array624 : Array[String] = [] - for index625 = 0 - index625 < mbt_ffi_load32(iter_base + 36) - index625 = index625 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index625 * 8 - - let result623 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array624.push(result623) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted627 : String? = match mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result626 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result626) - } - _ => panic() - } - - let lifted630 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted629 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result628 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result628) - } - _ => panic() - } - - Option::Some(lifted629) - } - _ => panic() - } - - array631.push(@types.NamedFieldType::{ - name: result617, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted619, - aliases: array621, - examples: array624, - deprecated: lifted627, - role: lifted630, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array631) - } - 15 => { - let array648 : Array[@types.VariantCaseType] = [] - for index649 = 0 - index649 < mbt_ffi_load32(iter_base + 12) - index649 = index649 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index649 * 72 - - let result633 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted634 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted636 : String? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result635 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result635) - } - _ => panic() - } - - let array638 : Array[String] = [] - for index639 = 0 - index639 < mbt_ffi_load32(iter_base + 32) - index639 = index639 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index639 * 8 - - let result637 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array638.push(result637) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array641 : Array[String] = [] - for index642 = 0 - index642 < mbt_ffi_load32(iter_base + 40) - index642 = index642 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index642 * 8 - - let result640 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array641.push(result640) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted644 : String? = match mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result643 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result643) - } - _ => panic() - } - - let lifted647 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted646 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result645 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result645) - } - _ => panic() - } - - Option::Some(lifted646) - } - _ => panic() - } - - array648.push(@types.VariantCaseType::{ - name: result633, - payload: lifted634, - metadata: @types.MetadataEnvelope::{ - doc: lifted636, - aliases: array638, - examples: array641, - deprecated: lifted644, - role: lifted647, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array648) - } - 16 => { - let array651 : Array[String] = [] - for index652 = 0 - index652 < mbt_ffi_load32(iter_base + 12) - index652 = index652 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index652 * 8 - - let result650 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array651.push(result650) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array651) - } - 17 => { - let array654 : Array[String] = [] - for index655 = 0 - index655 < mbt_ffi_load32(iter_base + 12) - index655 = index655 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index655 * 8 - - let result653 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array654.push(result653) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array654) - } - 18 => { - let array656 : Array[Int] = [] - for index657 = 0 - index657 < mbt_ffi_load32(iter_base + 12) - index657 = index657 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index657 * 4 - - array656.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array656) - } - 19 => @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted658 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let array614 : Array[String] = []; + for index615 = 0; index615 < (mbt_ffi_load32((iter_base) + 28)); index615 = index615 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index615 * 8) - let lifted659 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + let result613 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted658, - err: lifted659, - }) - } - 24 => { - let lifted663 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array661 : Array[String] = [] - for index662 = 0 - index662 < mbt_ffi_load32(iter_base + 16) - index662 = index662 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index662 * 8 - - let result660 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array661.push(result660) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array661) - } - _ => panic() - } + array614.push(result613) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - let lifted664 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + Option::Some(array614) + } + _ => panic() + } - let lifted665 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted612, allowed_hosts : lifted616}) + } + 28 => { - let lifted667 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result666 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result666) - } - _ => panic() - } + @types.SchemaTypeBody::DatetimeType + } + 29 => { - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted663, - min_length: lifted664, - max_length: lifted665, - regex: lifted667, - }) - } - 25 => { - let lifted671 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array669 : Array[String] = [] - for index670 = 0 - index670 < mbt_ffi_load32(iter_base + 16) - index670 = index670 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index670 * 8 - - let result668 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array669.push(result668) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array669) - } - _ => panic() - } + @types.SchemaTypeBody::DurationType + } + 30 => { - let lifted672 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } + let result617 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let lifted673 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + let array619 : Array[String] = []; + for index620 = 0; index620 < (mbt_ffi_load32((iter_base) + 20)); index620 = index620 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index620 * 8) - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted671, - min_bytes: lifted672, - max_bytes: lifted673, - }) - } - 26 => { - let lifted677 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array675 : Array[String] = [] - for index676 = 0 - index676 < mbt_ffi_load32(iter_base + 20) - index676 = index676 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index676 * 8 - - let result674 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array675.push(result674) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array675) - } - _ => panic() - } + let result618 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted681 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array679 : Array[String] = [] - for index680 = 0 - index680 < mbt_ffi_load32(iter_base + 32) - index680 = index680 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index680 * 8 - - let result678 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array679.push(result678) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array679) - } - _ => panic() - } + array619.push(result618) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted677, - allowed_extensions: lifted681, - }) - } - 27 => { - let lifted685 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array683 : Array[String] = [] - for index684 = 0 - index684 < mbt_ffi_load32(iter_base + 16) - index684 = index684 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index684 * 8 - - let result682 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array683.push(result682) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array683) - } - _ => panic() - } + let lifted622 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let lifted689 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array687 : Array[String] = [] - for index688 = 0 - index688 < mbt_ffi_load32(iter_base + 28) - index688 = index688 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index688 * 8 - - let result686 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array687.push(result686) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array687) - } - _ => panic() - } + let result621 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted685, - allowed_hosts: lifted689, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result690 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array692 : Array[String] = [] - for index693 = 0 - index693 < mbt_ffi_load32(iter_base + 20) - index693 = index693 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index693 * 8 - - let result691 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array692.push(result691) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted695 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result694 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result694, - }) - } - _ => panic() - } + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result621}) + } + _ => panic() + } - let lifted697 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result696 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result696, - }) - } - _ => panic() - } + let lifted624 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result690, - allowed_suffixes: array692, - min: lifted695, - max: lifted697, - }) - } - 31 => { - let array721 : Array[@types.UnionBranch] = [] - for index722 = 0 - index722 < mbt_ffi_load32(iter_base + 12) - index722 = index722 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index722 * 92 - - let result698 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted707 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result699 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result699) - } - 1 => { - let result700 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result700) - } - 2 => { - let result701 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result701) - } - 3 => { - let result702 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result702) - } - 4 => { - let result703 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted705 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result704 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result704) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result703, - literal: lifted705, - }) - } - 5 => { - let result706 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result706) - } - _ => panic() - } - - let lifted709 : String? = match mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result708 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result708) - } - _ => panic() - } - - let array711 : Array[String] = [] - for index712 = 0 - index712 < mbt_ffi_load32(iter_base + 52) - index712 = index712 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index712 * 8 - - let result710 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array711.push(result710) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array714 : Array[String] = [] - for index715 = 0 - index715 < mbt_ffi_load32(iter_base + 60) - index715 = index715 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index715 * 8 - - let result713 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array714.push(result713) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted717 : String? = match mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result716 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result716) - } - _ => panic() - } - - let lifted720 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted719 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result718 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result718) - } - _ => panic() - } - - Option::Some(lifted719) - } - _ => panic() - } - - array721.push(@types.UnionBranch::{ - tag: result698, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted707, - metadata: @types.MetadataEnvelope::{ - doc: lifted709, - aliases: array711, - examples: array714, - deprecated: lifted717, - role: lifted720, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array721, - }) - } - 32 => { - let lifted724 : String? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result723 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result723) - } - _ => panic() - } + let result623 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted724, - }) - } - 33 => { - let lifted726 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result725 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result725) - } - _ => panic() - } + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result623}) + } + _ => panic() + } - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted726, - }) - } - 34 => { - let lifted727 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result617, allowed_suffixes : array619, min : lifted622, max : lifted624}) + } + 31 => { - @types.SchemaTypeBody::FutureType(lifted727) - } - 35 => { - let lifted728 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let array648 : Array[@types.UnionBranch] = []; + for index649 = 0; index649 < (mbt_ffi_load32((iter_base) + 12)); index649 = index649 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index649 * 92) - @types.SchemaTypeBody::StreamType(lifted728) - } - _ => panic() - } - - let lifted731 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result730 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result730) - } - _ => panic() - } - - let array733 : Array[String] = [] - for index734 = 0 - index734 < mbt_ffi_load32(iter_base + 104) - index734 = index734 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index734 * 8 - - let result732 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array733.push(result732) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array736 : Array[String] = [] - for index737 = 0 - index737 < mbt_ffi_load32(iter_base + 112) - index737 = index737 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index737 * 8 - - let result735 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array736.push(result735) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted739 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result738 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result738) - } - _ => panic() - } - - let lifted742 : @types.Role? = match mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted741 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result740 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result740) - } - _ => panic() - } + let result625 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted741) - } - _ => panic() - } - - array743.push(@types.SchemaTypeNode::{ - body: lifted729, - metadata: @types.MetadataEnvelope::{ - doc: lifted731, - aliases: array733, - examples: array736, - deprecated: lifted739, - role: lifted742, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 24)) - - let array748 : Array[@types.SchemaTypeDef] = [] - for index749 = 0 - index749 < mbt_ffi_load32(return_area + 36) - index749 = index749 + 1 { - let iter_base = mbt_ffi_load32(return_area + 32) + index749 * 24 - - let result745 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted747 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result746 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result746) - } - _ => panic() - } - - array748.push(@types.SchemaTypeDef::{ - id: result745, - name: lifted747, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 32)) - - Option::Some(RegisteredTool::{ - definition: @common.Tool::{ - version: result, - commands: @common.CommandTree::{ nodes: array545 }, - schema: @types.SchemaGraph::{ - type_nodes: array743, - defs: array748, - root: mbt_ffi_load32(return_area + 40), - }, - }, - implemented_by: @types.ComponentId::{ - uuid: @types.Uuid::{ - high_bits: mbt_ffi_load64(return_area + 48).reinterpret_as_uint64(), - low_bits: mbt_ffi_load64(return_area + 56).reinterpret_as_uint64(), - }, - }, - }) - } - _ => panic() - } - let ret = lifted750 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + let lifted634 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { -///| -pub fn ToolRpc::tool_rpc(tool_name : String) -> ToolRpc { - let ptr = mbt_ffi_str2ptr(tool_name) - let result : Int = wasmImportConstructorToolRpc(ptr, tool_name.length()) - let ret = ToolRpc::ToolRpc(result) - mbt_ffi_free(ptr) - return ret -} + let result626 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) -///| -pub async fn ToolRpc::invoke_and_await( - self : ToolRpc, - command_path : Array[String], - input : @types.TypedSchemaValue, - stdin : @async-core.Stream[Byte]?, -) -> Result[@common.InvocationResult, RpcError] { - let lower_ptr : Int = mbt_ffi_malloc(52) - defer mbt_ffi_free(lower_ptr) - - let ToolRpc(handle) = self - mbt_ffi_store32(lower_ptr + 0 + 0, handle) - - let address = mbt_ffi_malloc(command_path.length() * 8) - for index = 0; index < command_path.length(); index = index + 1 { - let iter_elem : String = command_path[index] - let iter_base = address + index * 8 - - let ptr = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr) - } - mbt_ffi_store32(lower_ptr + 4 + 4, command_path.length()) - mbt_ffi_store32(lower_ptr + 4 + 0, address) - - let address357 = mbt_ffi_malloc(input.graph.type_nodes.length() * 144) - for index358 = 0 - index358 < input.graph.type_nodes.length() - index358 = index358 + 1 { - let iter_elem : @types.SchemaTypeNode = input.graph.type_nodes[index358] - let iter_base = address357 + index358 * 144 - - match iter_elem.body { - RefType(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store32(iter_base + 8, payload) - - () - } - BoolType => { - mbt_ffi_store8(iter_base + 0, 1) + @types.DiscriminatorRule::Prefix(result626) + } + 1 => { - () - } - S8Type(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) + let result627 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match payload1 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.DiscriminatorRule::Suffix(result627) + } + 2 => { - () - } - Some(payload3) => { - mbt_ffi_store8(iter_base + 8, 1) + let result628 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match payload3.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.DiscriminatorRule::Contains(result628) + } + 3 => { - () - } - Some(payload5) => { - mbt_ffi_store8(iter_base + 16, 1) + let result629 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match payload5 { - Signed(payload6) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload6) + @types.DiscriminatorRule::Regex(result629) + } + 4 => { - () - } - Unsigned(payload7) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload7.reinterpret_as_int64(), - ) + let result630 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - FloatBits(payload8) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload8.reinterpret_as_int64(), - ) + let lifted632 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - () - } - } + let result631 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - () - } - } + Option::Some(result631) + } + _ => panic() + } - match payload3.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result630, literal : lifted632}) + } + 5 => { - () - } - Some(payload10) => { - mbt_ffi_store8(iter_base + 40, 1) + let result633 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match payload10 { - Signed(payload11) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload11) + @types.DiscriminatorRule::FieldAbsent(result633) + } + _ => panic() + } - () - } - Unsigned(payload12) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload12.reinterpret_as_int64(), - ) + let lifted636 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - () - } - FloatBits(payload13) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload13.reinterpret_as_int64(), - ) + let result635 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - () - } - } + Option::Some(result635) + } + _ => panic() + } - () - } - } + let array638 : Array[String] = []; + for index639 = 0; index639 < (mbt_ffi_load32((iter_base) + 52)); index639 = index639 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index639 * 8) - match payload3.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let result637 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload15) => { - mbt_ffi_store8(iter_base + 64, 1) + array638.push(result637) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - let ptr = mbt_ffi_str2ptr(payload15) - mbt_ffi_store32(iter_base + 72, payload15.length()) - mbt_ffi_store32(iter_base + 68, ptr) + let array641 : Array[String] = []; + for index642 = 0; index642 < (mbt_ffi_load32((iter_base) + 60)); index642 = index642 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index642 * 8) - () - } - } + let result640 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - } + array641.push(result640) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - () - } - S16Type(payload16) => { - mbt_ffi_store8(iter_base + 0, 3) + let lifted644 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - match payload16 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let result643 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - () - } - Some(payload18) => { - mbt_ffi_store8(iter_base + 8, 1) + Option::Some(result643) + } + _ => panic() + } - match payload18.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted647 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - () - } - Some(payload20) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted646 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { - match payload20 { - Signed(payload21) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload21) + @types.Role::Multimodal + } + 1 => { - () - } - Unsigned(payload22) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload22.reinterpret_as_int64(), - ) + @types.Role::UnstructuredText + } + 2 => { - () - } - FloatBits(payload23) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload23.reinterpret_as_int64(), - ) + @types.Role::UnstructuredBinary + } + 3 => { - () - } - } + let result645 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - () - } - } + @types.Role::Other(result645) + } + _ => panic() + } - match payload18.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + Option::Some(lifted646) + } + _ => panic() + } - () - } - Some(payload25) => { - mbt_ffi_store8(iter_base + 40, 1) + array648.push(@types.UnionBranch::{tag : result625, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted634, metadata : @types.MetadataEnvelope::{doc : lifted636, aliases : array638, examples : array641, deprecated : lifted644, role : lifted647}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload25 { - Signed(payload26) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload26) + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array648}) + } + 32 => { - () - } - Unsigned(payload27) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload27.reinterpret_as_int64(), - ) + let lifted651 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - FloatBits(payload28) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload28.reinterpret_as_int64(), - ) + let result650 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - } + Option::Some(result650) + } + _ => panic() + } - () - } - } + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted651}) + } + 33 => { - match payload18.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted653 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - Some(payload30) => { - mbt_ffi_store8(iter_base + 64, 1) + let result652 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - let ptr31 = mbt_ffi_str2ptr(payload30) - mbt_ffi_store32(iter_base + 72, payload30.length()) - mbt_ffi_store32(iter_base + 68, ptr31) + Option::Some(result652) + } + _ => panic() + } - () - } - } + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted653}) + } + 34 => { - () - } - } + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - () - } - S32Type(payload32) => { - mbt_ffi_store8(iter_base + 0, 4) + let lifted654 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload32 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - () - } - Some(payload34) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaTypeBody::FutureType(lifted654) + } + 36 => { - match payload34.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted655 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - Some(payload36) => { - mbt_ffi_store8(iter_base + 16, 1) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - match payload36 { - Signed(payload37) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload37) + @types.SchemaTypeBody::StreamType(lifted655) + } + _ => panic() + } - () - } - Unsigned(payload38) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload38.reinterpret_as_int64(), - ) + let lifted658 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { - () - } - FloatBits(payload39) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload39.reinterpret_as_int64(), - ) + let result657 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - () - } - } + Option::Some(result657) + } + _ => panic() + } - () - } - } + let array660 : Array[String] = []; + for index661 = 0; index661 < (mbt_ffi_load32((iter_base) + 104)); index661 = index661 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index661 * 8) - match payload34.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let result659 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload41) => { - mbt_ffi_store8(iter_base + 40, 1) + array660.push(result659) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - match payload41 { - Signed(payload42) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload42) + let array663 : Array[String] = []; + for index664 = 0; index664 < (mbt_ffi_load32((iter_base) + 112)); index664 = index664 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index664 * 8) - () - } - Unsigned(payload43) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload43.reinterpret_as_int64(), - ) + let result662 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - FloatBits(payload44) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload44.reinterpret_as_int64(), - ) + array663.push(result662) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - () - } - } + let lifted666 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - () - } - } + let result665 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - match payload34.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + Option::Some(result665) + } + _ => panic() + } - () - } - Some(payload46) => { - mbt_ffi_store8(iter_base + 64, 1) + let lifted669 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - let ptr47 = mbt_ffi_str2ptr(payload46) - mbt_ffi_store32(iter_base + 72, payload46.length()) - mbt_ffi_store32(iter_base + 68, ptr47) + let lifted668 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - () - } - } + @types.Role::Multimodal + } + 1 => { - () - } - } + @types.Role::UnstructuredText + } + 2 => { - () - } - S64Type(payload48) => { - mbt_ffi_store8(iter_base + 0, 5) + @types.Role::UnstructuredBinary + } + 3 => { - match payload48 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let result667 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - () - } - Some(payload50) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.Role::Other(result667) + } + _ => panic() + } - match payload50.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + Option::Some(lifted668) + } + _ => panic() + } - () - } - Some(payload52) => { - mbt_ffi_store8(iter_base + 16, 1) + array670.push(@types.SchemaTypeNode::{body : lifted656, metadata : @types.MetadataEnvelope::{doc : lifted658, aliases : array660, examples : array663, deprecated : lifted666, role : lifted669}}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 12)) - match payload52 { - Signed(payload53) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload53) + let array675 : Array[@types.SchemaTypeDef] = []; + for index676 = 0; index676 < (mbt_ffi_load32((return_area) + 24)); index676 = index676 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 20)) + (index676 * 24) - () - } - Unsigned(payload54) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload54.reinterpret_as_int64(), - ) + let result672 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - FloatBits(payload55) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload55.reinterpret_as_int64(), - ) + let lifted674 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - } + let result673 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - () - } - } + Option::Some(result673) + } + _ => panic() + } - match payload50.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + array675.push(@types.SchemaTypeDef::{id : result672, name : lifted674, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 20)) - () - } - Some(payload57) => { - mbt_ffi_store8(iter_base + 40, 1) + let array706 : Array[@types.SchemaValueNode] = []; + for index707 = 0; index707 < (mbt_ffi_load32((return_area) + 36)); index707 = index707 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 32)) + (index707 * 32) - match payload57 { - Signed(payload58) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload58) + let lifted705 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - Unsigned(payload59) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload59.reinterpret_as_int64(), - ) + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - () - } - FloatBits(payload60) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload60.reinterpret_as_int64(), - ) + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - () - } - } + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - () - } - } + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - match payload50.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - () - } - Some(payload62) => { - mbt_ffi_store8(iter_base + 64, 1) + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - let ptr63 = mbt_ffi_str2ptr(payload62) - mbt_ffi_store32(iter_base + 72, payload62.length()) - mbt_ffi_store32(iter_base + 68, ptr63) + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - () - } - } + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - () - } - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - () - } - U8Type(payload64) => { - mbt_ffi_store8(iter_base + 0, 6) + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - match payload64 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - () - } - Some(payload66) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - match payload66.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let result677 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Some(payload68) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.SchemaValueNode::StringValue(result677) + } + 13 => { - match payload68 { - Signed(payload69) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload69) + let array678 : Array[Int] = []; + for index679 = 0; index679 < (mbt_ffi_load32((iter_base) + 12)); index679 = index679 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index679 * 4) - () - } - Unsigned(payload70) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload70.reinterpret_as_int64(), - ) + array678.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - FloatBits(payload71) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload71.reinterpret_as_int64(), - ) + @types.SchemaValueNode::RecordValue(array678) + } + 14 => { - () - } - } + let lifted680 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - match payload66.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted680}) + } + 15 => { - () - } - Some(payload73) => { - mbt_ffi_store8(iter_base + 40, 1) + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - match payload73 { - Signed(payload74) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload74) + let array681 : Array[Bool] = []; + for index682 = 0; index682 < (mbt_ffi_load32((iter_base) + 12)); index682 = index682 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index682 * 1) - () - } - Unsigned(payload75) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload75.reinterpret_as_int64(), - ) + array681.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - FloatBits(payload76) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload76.reinterpret_as_int64(), - ) + @types.SchemaValueNode::FlagsValue(array681) + } + 17 => { - () - } - } + let array683 : Array[Int] = []; + for index684 = 0; index684 < (mbt_ffi_load32((iter_base) + 12)); index684 = index684 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index684 * 4) - () - } - } + array683.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload66.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + @types.SchemaValueNode::TupleValue(array683) + } + 18 => { - () - } - Some(payload78) => { - mbt_ffi_store8(iter_base + 64, 1) + let array685 : Array[Int] = []; + for index686 = 0; index686 < (mbt_ffi_load32((iter_base) + 12)); index686 = index686 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index686 * 4) - let ptr79 = mbt_ffi_str2ptr(payload78) - mbt_ffi_store32(iter_base + 72, payload78.length()) - mbt_ffi_store32(iter_base + 68, ptr79) + array685.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } + @types.SchemaValueNode::ListValue(array685) + } + 19 => { - () - } - } + let array687 : Array[Int] = []; + for index688 = 0; index688 < (mbt_ffi_load32((iter_base) + 12)); index688 = index688 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index688 * 4) - () - } - U16Type(payload80) => { - mbt_ffi_store8(iter_base + 0, 7) + array687.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload80 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::FixedListValue(array687) + } + 20 => { - () - } - Some(payload82) => { - mbt_ffi_store8(iter_base + 8, 1) + let array689 : Array[@types.MapEntry] = []; + for index690 = 0; index690 < (mbt_ffi_load32((iter_base) + 12)); index690 = index690 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index690 * 8) - match payload82.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + array689.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Some(payload84) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.SchemaValueNode::MapValue(array689) + } + 21 => { - match payload84 { - Signed(payload85) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload85) + let lifted691 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - Unsigned(payload86) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload86.reinterpret_as_int64(), - ) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - () - } - FloatBits(payload87) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload87.reinterpret_as_int64(), - ) + @types.SchemaValueNode::OptionValue(lifted691) + } + 22 => { - () - } - } + let lifted694 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - () - } - } + let lifted692 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - match payload82.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - () - } - Some(payload89) => { - mbt_ffi_store8(iter_base + 40, 1) + @types.ResultValuePayload::OkValue(lifted692) + } + 1 => { - match payload89 { - Signed(payload90) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload90) + let lifted693 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - Unsigned(payload91) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload91.reinterpret_as_int64(), - ) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - () - } - FloatBits(payload92) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload92.reinterpret_as_int64(), - ) + @types.ResultValuePayload::ErrValue(lifted693) + } + _ => panic() + } - () - } - } + @types.SchemaValueNode::ResultValue(lifted694) + } + 23 => { - () - } - } + let result695 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload82.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted697 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload94) => { - mbt_ffi_store8(iter_base + 64, 1) + let result696 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let ptr95 = mbt_ffi_str2ptr(payload94) - mbt_ffi_store32(iter_base + 72, payload94.length()) - mbt_ffi_store32(iter_base + 68, ptr95) + Option::Some(result696) + } + _ => panic() + } - () - } - } + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result695, language : lifted697}) + } + 24 => { - () - } - } + let result698 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - U32Type(payload96) => { - mbt_ffi_store8(iter_base + 0, 8) + let lifted700 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - match payload96 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let result699 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - Some(payload98) => { - mbt_ffi_store8(iter_base + 8, 1) + Option::Some(result699) + } + _ => panic() + } - match payload98.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result698, mime_type : lifted700}) + } + 25 => { - () - } - Some(payload100) => { - mbt_ffi_store8(iter_base + 16, 1) + let result701 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload100 { - Signed(payload101) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload101) + @types.SchemaValueNode::PathValue(result701) + } + 26 => { - () - } - Unsigned(payload102) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload102.reinterpret_as_int64(), - ) + let result702 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - FloatBits(payload103) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload103.reinterpret_as_int64(), - ) + @types.SchemaValueNode::UrlValue(result702) + } + 27 => { - () - } - } + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - () - } - } + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - match payload98.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let result703 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - Some(payload105) => { - mbt_ffi_store8(iter_base + 40, 1) + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result703}) + } + 30 => { - match payload105 { - Signed(payload106) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload106) + let result704 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Unsigned(payload107) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload107.reinterpret_as_int64(), - ) + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result704, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - () - } - FloatBits(payload108) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload108.reinterpret_as_int64(), - ) + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - () - } - } + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - () - } - } + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } - match payload98.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + array706.push(lifted705) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 32)) - () - } - Some(payload110) => { - mbt_ffi_store8(iter_base + 64, 1) + @common.ToolError::CustomError(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array670, defs : array675, root : mbt_ffi_load32((return_area) + 28)}, value : @types.SchemaValueTree::{value_nodes : array706, root : mbt_ffi_load32((return_area) + 40)}}) + } + _ => panic() + } - let ptr111 = mbt_ffi_str2ptr(payload110) - mbt_ffi_store32(iter_base + 72, payload110.length()) - mbt_ffi_store32(iter_base + 68, ptr111) + RpcError::RemoteToolError(lifted708) + } + _ => panic() + } - () - } + Result::Err(lifted709) } + _ => panic() + } + let ret = lifted710 + mbt_ffi_free(address) + mbt_ffi_free(address361) + mbt_ffi_free(address367) + mbt_ffi_free(address441) + mbt_ffi_free(return_area) - () - } - } + cleanup_list.each(mbt_ffi_free) + return ret - () - } - U64Type(payload112) => { - mbt_ffi_store8(iter_base + 0, 9) +} +///| +pub fn ToolRpc::async_invoke_and_await(self : ToolRpc, command_path : Array[String], input : @types.TypedSchemaValue, stdin : @async-core.Stream[Byte]?) -> FutureInvokeResult { + let cleanup_list : Array[Int] = [] - match payload112 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ToolRpc(handle) = self - () - } - Some(payload114) => { - mbt_ffi_store8(iter_base + 8, 1) + let address = mbt_ffi_malloc((command_path).length() * 8); + for index = 0; index < (command_path).length(); index = index + 1 { + let iter_elem : String = (command_path)[(index)] + let iter_base = address + (index * 8); - match payload114.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let ptr = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr) + cleanup_list.push(ptr) - () - } - Some(payload116) => { - mbt_ffi_store8(iter_base + 16, 1) + } - match payload116 { - Signed(payload117) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload117) + let address361 = mbt_ffi_malloc((((input).graph).type_nodes).length() * 144); + for index362 = 0; index362 < (((input).graph).type_nodes).length(); index362 = index362 + 1 { + let iter_elem : @types.SchemaTypeNode = (((input).graph).type_nodes)[(index362)] + let iter_base = address361 + (index362 * 144); - () - } - Unsigned(payload118) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload118.reinterpret_as_int64(), - ) + match (iter_elem).body { + RefType(payload) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store32((iter_base) + 8, payload) - () + () } - FloatBits(payload119) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload119.reinterpret_as_int64(), - ) + BoolType => { + mbt_ffi_store8((iter_base) + 0, (1)) - () + () } - } - - () - } - } - - match payload114.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + S8Type(payload1) => { + mbt_ffi_store8((iter_base) + 0, (2)) - () - } - Some(payload121) => { - mbt_ffi_store8(iter_base + 40, 1) + match (payload1) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload121 { - Signed(payload122) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload122) + () + } + Some(payload3) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload3).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload5) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload5 { + Signed(payload6) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload6) + + () + } + Unsigned(payload7) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload7).reinterpret_as_int64()) + + () + } + FloatBits(payload8) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload8).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - Unsigned(payload123) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload123.reinterpret_as_int64(), - ) + match ((payload3).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload10) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload10 { + Signed(payload11) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload11) + + () + } + Unsigned(payload12) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload12).reinterpret_as_int64()) + + () + } + FloatBits(payload13) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload13).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - FloatBits(payload124) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload124.reinterpret_as_int64(), - ) + match ((payload3).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) - () - } - } + () + } + Some(payload15) => { + mbt_ffi_store8((iter_base) + 64, (1)) - () - } - } + let ptr16 = mbt_ffi_str2ptr(payload15) + mbt_ffi_store32((iter_base) + 72, payload15.length()) + mbt_ffi_store32((iter_base) + 68, ptr16) + cleanup_list.push(ptr16) - match payload114.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + () + } + } - () - } - Some(payload126) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + } - let ptr127 = mbt_ffi_str2ptr(payload126) - mbt_ffi_store32(iter_base + 72, payload126.length()) - mbt_ffi_store32(iter_base + 68, ptr127) + () + } + S16Type(payload17) => { + mbt_ffi_store8((iter_base) + 0, (3)) - () - } - } + match (payload17) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - } + () + } + Some(payload19) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload19).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload21) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload21 { + Signed(payload22) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload22) + + () + } + Unsigned(payload23) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload23).reinterpret_as_int64()) + + () + } + FloatBits(payload24) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload24).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - F32Type(payload128) => { - mbt_ffi_store8(iter_base + 0, 10) + match ((payload19).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload26) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload26 { + Signed(payload27) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload27) + + () + } + Unsigned(payload28) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload28).reinterpret_as_int64()) + + () + } + FloatBits(payload29) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload29).reinterpret_as_int64()) + + () + } + } + + () + } + } - match payload128 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match ((payload19).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) - () - } - Some(payload130) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + Some(payload31) => { + mbt_ffi_store8((iter_base) + 64, (1)) - match payload130.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let ptr32 = mbt_ffi_str2ptr(payload31) + mbt_ffi_store32((iter_base) + 72, payload31.length()) + mbt_ffi_store32((iter_base) + 68, ptr32) + cleanup_list.push(ptr32) - () - } - Some(payload132) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + } - match payload132 { - Signed(payload133) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload133) + () + } + } - () + () } - Unsigned(payload134) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload134.reinterpret_as_int64(), - ) + S32Type(payload33) => { + mbt_ffi_store8((iter_base) + 0, (4)) - () - } - FloatBits(payload135) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload135.reinterpret_as_int64(), - ) + match (payload33) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - } + () + } + Some(payload35) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload35).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload37) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload37 { + Signed(payload38) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload38) + + () + } + Unsigned(payload39) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload39).reinterpret_as_int64()) + + () + } + FloatBits(payload40) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload40).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - } + match ((payload35).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload42) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload42 { + Signed(payload43) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload43) + + () + } + Unsigned(payload44) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload44).reinterpret_as_int64()) + + () + } + FloatBits(payload45) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload45).reinterpret_as_int64()) + + () + } + } + + () + } + } - match payload130.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match ((payload35).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) - () - } - Some(payload137) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + Some(payload47) => { + mbt_ffi_store8((iter_base) + 64, (1)) - match payload137 { - Signed(payload138) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload138) + let ptr48 = mbt_ffi_str2ptr(payload47) + mbt_ffi_store32((iter_base) + 72, payload47.length()) + mbt_ffi_store32((iter_base) + 68, ptr48) + cleanup_list.push(ptr48) - () - } - Unsigned(payload139) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload139.reinterpret_as_int64(), - ) + () + } + } - () - } - FloatBits(payload140) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload140.reinterpret_as_int64(), - ) + () + } + } - () + () } - } - - () - } - } + S64Type(payload49) => { + mbt_ffi_store8((iter_base) + 0, (5)) - match payload130.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match (payload49) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - Some(payload142) => { - mbt_ffi_store8(iter_base + 64, 1) - - let ptr143 = mbt_ffi_str2ptr(payload142) - mbt_ffi_store32(iter_base + 72, payload142.length()) - mbt_ffi_store32(iter_base + 68, ptr143) + () + } + Some(payload51) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload51).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload53) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload53 { + Signed(payload54) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload54) + + () + } + Unsigned(payload55) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload55).reinterpret_as_int64()) + + () + } + FloatBits(payload56) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload56).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - } + match ((payload51).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload58) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload58 { + Signed(payload59) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload59) + + () + } + Unsigned(payload60) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload60).reinterpret_as_int64()) + + () + } + FloatBits(payload61) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload61).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - } + match ((payload51).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) - () - } - F64Type(payload144) => { - mbt_ffi_store8(iter_base + 0, 11) + () + } + Some(payload63) => { + mbt_ffi_store8((iter_base) + 64, (1)) - match payload144 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let ptr64 = mbt_ffi_str2ptr(payload63) + mbt_ffi_store32((iter_base) + 72, payload63.length()) + mbt_ffi_store32((iter_base) + 68, ptr64) + cleanup_list.push(ptr64) - () - } - Some(payload146) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + } - match payload146.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + } - () - } - Some(payload148) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + U8Type(payload65) => { + mbt_ffi_store8((iter_base) + 0, (6)) - match payload148 { - Signed(payload149) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload149) + match (payload65) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - Unsigned(payload150) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload150.reinterpret_as_int64(), - ) + () + } + Some(payload67) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload67).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload69) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload69 { + Signed(payload70) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload70) + + () + } + Unsigned(payload71) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload71).reinterpret_as_int64()) + + () + } + FloatBits(payload72) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload72).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - FloatBits(payload151) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload151.reinterpret_as_int64(), - ) + match ((payload67).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload74) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload74 { + Signed(payload75) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload75) + + () + } + Unsigned(payload76) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload76).reinterpret_as_int64()) + + () + } + FloatBits(payload77) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload77).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - } + match ((payload67).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) - () - } - } + () + } + Some(payload79) => { + mbt_ffi_store8((iter_base) + 64, (1)) - match payload146.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let ptr80 = mbt_ffi_str2ptr(payload79) + mbt_ffi_store32((iter_base) + 72, payload79.length()) + mbt_ffi_store32((iter_base) + 68, ptr80) + cleanup_list.push(ptr80) - () - } - Some(payload153) => { - mbt_ffi_store8(iter_base + 40, 1) + () + } + } - match payload153 { - Signed(payload154) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload154) + () + } + } - () + () } - Unsigned(payload155) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload155.reinterpret_as_int64(), - ) + U16Type(payload81) => { + mbt_ffi_store8((iter_base) + 0, (7)) - () - } - FloatBits(payload156) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload156.reinterpret_as_int64(), - ) + match (payload81) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - } + () + } + Some(payload83) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload83).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload85) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload85 { + Signed(payload86) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload86) + + () + } + Unsigned(payload87) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload87).reinterpret_as_int64()) + + () + } + FloatBits(payload88) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload88).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - } + match ((payload83).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload90) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload90 { + Signed(payload91) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload91) + + () + } + Unsigned(payload92) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload92).reinterpret_as_int64()) + + () + } + FloatBits(payload93) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload93).reinterpret_as_int64()) + + () + } + } + + () + } + } - match payload146.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match ((payload83).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) - () - } - Some(payload158) => { - mbt_ffi_store8(iter_base + 64, 1) + () + } + Some(payload95) => { + mbt_ffi_store8((iter_base) + 64, (1)) - let ptr159 = mbt_ffi_str2ptr(payload158) - mbt_ffi_store32(iter_base + 72, payload158.length()) - mbt_ffi_store32(iter_base + 68, ptr159) + let ptr96 = mbt_ffi_str2ptr(payload95) + mbt_ffi_store32((iter_base) + 72, payload95.length()) + mbt_ffi_store32((iter_base) + 68, ptr96) + cleanup_list.push(ptr96) - () - } - } + () + } + } - () - } - } + () + } + } - () - } - CharType => { - mbt_ffi_store8(iter_base + 0, 12) + () + } + U32Type(payload97) => { + mbt_ffi_store8((iter_base) + 0, (8)) - () - } - StringType => { - mbt_ffi_store8(iter_base + 0, 13) + match (payload97) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - RecordType(payload162) => { - mbt_ffi_store8(iter_base + 0, 14) - - let address181 = mbt_ffi_malloc(payload162.length() * 68) - for index182 = 0 - index182 < payload162.length() - index182 = index182 + 1 { - let iter_elem : @types.NamedFieldType = payload162[index182] - let iter_base = address181 + index182 * 68 - - let ptr163 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr163) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 12, 0) + () + } + Some(payload99) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload99).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload101) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload101 { + Signed(payload102) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload102) + + () + } + Unsigned(payload103) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload103).reinterpret_as_int64()) + + () + } + FloatBits(payload104) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload104).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - Some(payload165) => { - mbt_ffi_store8(iter_base + 12, 1) + match ((payload99).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload106) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload106 { + Signed(payload107) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload107) + + () + } + Unsigned(payload108) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload108).reinterpret_as_int64()) + + () + } + FloatBits(payload109) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload109).reinterpret_as_int64()) + + () + } + } + + () + } + } - let ptr166 = mbt_ffi_str2ptr(payload165) - mbt_ffi_store32(iter_base + 20, payload165.length()) - mbt_ffi_store32(iter_base + 16, ptr166) + match ((payload99).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) - () - } - } - - let address = mbt_ffi_malloc(iter_elem.metadata.aliases.length() * 8) - for index = 0 - index < iter_elem.metadata.aliases.length() - index = index + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index] - let iter_base = address + index * 8 - - let ptr167 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr167) - } - mbt_ffi_store32(iter_base + 28, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 24, address) - - let address169 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index170 = 0 - index170 < iter_elem.metadata.examples.length() - index170 = index170 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index170] - let iter_base = address169 + index170 * 8 - - let ptr168 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr168) - } - mbt_ffi_store32(iter_base + 36, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 32, address169) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 40, 0) + () + } + Some(payload111) => { + mbt_ffi_store8((iter_base) + 64, (1)) - () - } - Some(payload172) => { - mbt_ffi_store8(iter_base + 40, 1) + let ptr112 = mbt_ffi_str2ptr(payload111) + mbt_ffi_store32((iter_base) + 72, payload111.length()) + mbt_ffi_store32((iter_base) + 68, ptr112) + cleanup_list.push(ptr112) - let ptr173 = mbt_ffi_str2ptr(payload172) - mbt_ffi_store32(iter_base + 48, payload172.length()) - mbt_ffi_store32(iter_base + 44, ptr173) + () + } + } - () - } - } + () + } + } - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 52, 0) + () + } + U64Type(payload113) => { + mbt_ffi_store8((iter_base) + 0, (9)) - () - } - Some(payload175) => { - mbt_ffi_store8(iter_base + 52, 1) + match (payload113) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - match payload175 { - Multimodal => { - mbt_ffi_store8(iter_base + 56, 0) + () + } + Some(payload115) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload115).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload117) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload117 { + Signed(payload118) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload118) + + () + } + Unsigned(payload119) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload119).reinterpret_as_int64()) + + () + } + FloatBits(payload120) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload120).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 56, 1) + match ((payload115).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload122) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload122 { + Signed(payload123) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload123) + + () + } + Unsigned(payload124) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload124).reinterpret_as_int64()) + + () + } + FloatBits(payload125) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload125).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 56, 2) + match ((payload115).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) - () - } - Other(payload179) => { - mbt_ffi_store8(iter_base + 56, 3) + () + } + Some(payload127) => { + mbt_ffi_store8((iter_base) + 64, (1)) - let ptr180 = mbt_ffi_str2ptr(payload179) - mbt_ffi_store32(iter_base + 64, payload179.length()) - mbt_ffi_store32(iter_base + 60, ptr180) + let ptr128 = mbt_ffi_str2ptr(payload127) + mbt_ffi_store32((iter_base) + 72, payload127.length()) + mbt_ffi_store32((iter_base) + 68, ptr128) + cleanup_list.push(ptr128) - () - } - } + () + } + } - () - } - } - } - mbt_ffi_store32(iter_base + 12, payload162.length()) - mbt_ffi_store32(iter_base + 8, address181) + () + } + } - () - } - VariantType(payload183) => { - mbt_ffi_store8(iter_base + 0, 15) + () + } + F32Type(payload129) => { + mbt_ffi_store8((iter_base) + 0, (10)) - let address206 = mbt_ffi_malloc(payload183.length() * 72) - for index207 = 0 - index207 < payload183.length() - index207 = index207 + 1 { - let iter_elem : @types.VariantCaseType = payload183[index207] - let iter_base = address206 + index207 * 72 + match (payload129) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - let ptr184 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr184) + () + } + Some(payload131) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload131).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload133) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload133 { + Signed(payload134) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload134) + + () + } + Unsigned(payload135) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload135).reinterpret_as_int64()) + + () + } + FloatBits(payload136) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload136).reinterpret_as_int64()) + + () + } + } + + () + } + } - match iter_elem.payload { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match ((payload131).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload138) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload138 { + Signed(payload139) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload139) + + () + } + Unsigned(payload140) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload140).reinterpret_as_int64()) + + () + } + FloatBits(payload141) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload141).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - Some(payload186) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload186) + match ((payload131).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) - () - } - } + () + } + Some(payload143) => { + mbt_ffi_store8((iter_base) + 64, (1)) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let ptr144 = mbt_ffi_str2ptr(payload143) + mbt_ffi_store32((iter_base) + 72, payload143.length()) + mbt_ffi_store32((iter_base) + 68, ptr144) + cleanup_list.push(ptr144) - () - } - Some(payload188) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + } - let ptr189 = mbt_ffi_str2ptr(payload188) - mbt_ffi_store32(iter_base + 24, payload188.length()) - mbt_ffi_store32(iter_base + 20, ptr189) + () + } + } - () - } - } - - let address191 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index192 = 0 - index192 < iter_elem.metadata.aliases.length() - index192 = index192 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index192] - let iter_base = address191 + index192 * 8 - - let ptr190 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr190) - } - mbt_ffi_store32(iter_base + 32, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 28, address191) - - let address194 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index195 = 0 - index195 < iter_elem.metadata.examples.length() - index195 = index195 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index195] - let iter_base = address194 + index195 * 8 - - let ptr193 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr193) - } - mbt_ffi_store32(iter_base + 40, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 36, address194) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 44, 0) + () + } + F64Type(payload145) => { + mbt_ffi_store8((iter_base) + 0, (11)) - () - } - Some(payload197) => { - mbt_ffi_store8(iter_base + 44, 1) + match (payload145) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - let ptr198 = mbt_ffi_str2ptr(payload197) - mbt_ffi_store32(iter_base + 52, payload197.length()) - mbt_ffi_store32(iter_base + 48, ptr198) + () + } + Some(payload147) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match ((payload147).min) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) + + () + } + Some(payload149) => { + mbt_ffi_store8((iter_base) + 16, (1)) + + match payload149 { + Signed(payload150) => { + mbt_ffi_store8((iter_base) + 24, (0)) + mbt_ffi_store64((iter_base) + 32, payload150) + + () + } + Unsigned(payload151) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload151).reinterpret_as_int64()) + + () + } + FloatBits(payload152) => { + mbt_ffi_store8((iter_base) + 24, (2)) + mbt_ffi_store64((iter_base) + 32, (payload152).reinterpret_as_int64()) + + () + } + } + + () + } + } - () - } - } + match ((payload147).max) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) + + () + } + Some(payload154) => { + mbt_ffi_store8((iter_base) + 40, (1)) + + match payload154 { + Signed(payload155) => { + mbt_ffi_store8((iter_base) + 48, (0)) + mbt_ffi_store64((iter_base) + 56, payload155) + + () + } + Unsigned(payload156) => { + mbt_ffi_store8((iter_base) + 48, (1)) + mbt_ffi_store64((iter_base) + 56, (payload156).reinterpret_as_int64()) + + () + } + FloatBits(payload157) => { + mbt_ffi_store8((iter_base) + 48, (2)) + mbt_ffi_store64((iter_base) + 56, (payload157).reinterpret_as_int64()) + + () + } + } + + () + } + } - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 56, 0) + match ((payload147).unit) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) - () - } - Some(payload200) => { - mbt_ffi_store8(iter_base + 56, 1) + () + } + Some(payload159) => { + mbt_ffi_store8((iter_base) + 64, (1)) - match payload200 { - Multimodal => { - mbt_ffi_store8(iter_base + 60, 0) + let ptr160 = mbt_ffi_str2ptr(payload159) + mbt_ffi_store32((iter_base) + 72, payload159.length()) + mbt_ffi_store32((iter_base) + 68, ptr160) + cleanup_list.push(ptr160) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 60, 1) + () + } + } - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 60, 2) + () + } + } - () - } - Other(payload204) => { - mbt_ffi_store8(iter_base + 60, 3) + () + } + CharType => { + mbt_ffi_store8((iter_base) + 0, (12)) - let ptr205 = mbt_ffi_str2ptr(payload204) - mbt_ffi_store32(iter_base + 68, payload204.length()) - mbt_ffi_store32(iter_base + 64, ptr205) + () + } + StringType => { + mbt_ffi_store8((iter_base) + 0, (13)) - () - } - } + () + } + RecordType(payload163) => { + mbt_ffi_store8((iter_base) + 0, (14)) - () - } - } - } - mbt_ffi_store32(iter_base + 12, payload183.length()) - mbt_ffi_store32(iter_base + 8, address206) + let address184 = mbt_ffi_malloc((payload163).length() * 68); + for index185 = 0; index185 < (payload163).length(); index185 = index185 + 1 { + let iter_elem : @types.NamedFieldType = (payload163)[(index185)] + let iter_base = address184 + (index185 * 68); - () - } - EnumType(payload208) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address210 = mbt_ffi_malloc(payload208.length() * 8) - for index211 = 0 - index211 < payload208.length() - index211 = index211 + 1 { - let iter_elem : String = payload208[index211] - let iter_base = address210 + index211 * 8 - - let ptr209 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr209) - } - mbt_ffi_store32(iter_base + 12, payload208.length()) - mbt_ffi_store32(iter_base + 8, address210) - - () - } - FlagsType(payload212) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address214 = mbt_ffi_malloc(payload212.length() * 8) - for index215 = 0 - index215 < payload212.length() - index215 = index215 + 1 { - let iter_elem : String = payload212[index215] - let iter_base = address214 + index215 * 8 - - let ptr213 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr213) - } - mbt_ffi_store32(iter_base + 12, payload212.length()) - mbt_ffi_store32(iter_base + 8, address214) - - () - } - TupleType(payload216) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address217 = mbt_ffi_malloc(payload216.length() * 4) - for index218 = 0 - index218 < payload216.length() - index218 = index218 + 1 { - let iter_elem : Int = payload216[index218] - let iter_base = address217 + index218 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload216.length()) - mbt_ffi_store32(iter_base + 8, address217) - - () - } - ListType(payload219) => { - mbt_ffi_store8(iter_base + 0, 19) - mbt_ffi_store32(iter_base + 8, payload219) + let ptr164 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr164) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) - () - } - FixedListType(payload220) => { - mbt_ffi_store8(iter_base + 0, 20) - mbt_ffi_store32(iter_base + 8, payload220.element) - mbt_ffi_store32(iter_base + 12, payload220.length.reinterpret_as_int()) + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - MapType(payload221) => { - mbt_ffi_store8(iter_base + 0, 21) - mbt_ffi_store32(iter_base + 8, payload221.key) - mbt_ffi_store32(iter_base + 12, payload221.value) + () + } + Some(payload166) => { + mbt_ffi_store8((iter_base) + 12, (1)) - () - } - OptionType(payload222) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store32(iter_base + 8, payload222) + let ptr167 = mbt_ffi_str2ptr(payload166) + mbt_ffi_store32((iter_base) + 20, payload166.length()) + mbt_ffi_store32((iter_base) + 16, ptr167) + cleanup_list.push(ptr167) - () - } - ResultType(payload223) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload223.ok { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload225) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload225) - - () - } - } - - match payload223.err { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload227) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload227) - - () - } - } - - () - } - TextType(payload228) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload228.languages { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload230) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address232 = mbt_ffi_malloc(payload230.length() * 8) - for index233 = 0 - index233 < payload230.length() - index233 = index233 + 1 { - let iter_elem : String = payload230[index233] - let iter_base = address232 + index233 * 8 - - let ptr231 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr231) - } - mbt_ffi_store32(iter_base + 16, payload230.length()) - mbt_ffi_store32(iter_base + 12, address232) - - () - } - } - - match payload228.min_length { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload235) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload235.reinterpret_as_int()) - - () - } - } - - match payload228.max_length { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload237) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload237.reinterpret_as_int()) - - () - } - } - - match payload228.regex { - None => { - mbt_ffi_store8(iter_base + 36, 0) - - () - } - Some(payload239) => { - mbt_ffi_store8(iter_base + 36, 1) - - let ptr240 = mbt_ffi_str2ptr(payload239) - mbt_ffi_store32(iter_base + 44, payload239.length()) - mbt_ffi_store32(iter_base + 40, ptr240) - - () - } - } - - () - } - BinaryType(payload241) => { - mbt_ffi_store8(iter_base + 0, 25) - - match payload241.mime_types { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload243) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address245 = mbt_ffi_malloc(payload243.length() * 8) - for index246 = 0 - index246 < payload243.length() - index246 = index246 + 1 { - let iter_elem : String = payload243[index246] - let iter_base = address245 + index246 * 8 - - let ptr244 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr244) - } - mbt_ffi_store32(iter_base + 16, payload243.length()) - mbt_ffi_store32(iter_base + 12, address245) - - () - } - } - - match payload241.min_bytes { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload248) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload248.reinterpret_as_int()) - - () - } - } - - match payload241.max_bytes { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload250) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload250.reinterpret_as_int()) - - () - } - } - - () - } - PathType(payload251) => { - mbt_ffi_store8(iter_base + 0, 26) - mbt_ffi_store8(iter_base + 8, payload251.direction.ordinal()) - mbt_ffi_store8(iter_base + 9, payload251.kind.ordinal()) - - match payload251.allowed_mime_types { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload253) => { - mbt_ffi_store8(iter_base + 12, 1) - - let address255 = mbt_ffi_malloc(payload253.length() * 8) - for index256 = 0 - index256 < payload253.length() - index256 = index256 + 1 { - let iter_elem : String = payload253[index256] - let iter_base = address255 + index256 * 8 - - let ptr254 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr254) - } - mbt_ffi_store32(iter_base + 20, payload253.length()) - mbt_ffi_store32(iter_base + 16, address255) - - () - } - } - - match payload251.allowed_extensions { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload258) => { - mbt_ffi_store8(iter_base + 24, 1) - - let address260 = mbt_ffi_malloc(payload258.length() * 8) - for index261 = 0 - index261 < payload258.length() - index261 = index261 + 1 { - let iter_elem : String = payload258[index261] - let iter_base = address260 + index261 * 8 - - let ptr259 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr259) - } - mbt_ffi_store32(iter_base + 32, payload258.length()) - mbt_ffi_store32(iter_base + 28, address260) + () + } + } - () - } - } + let address169 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index170 = 0; index170 < (((iter_elem).metadata).aliases).length(); index170 = index170 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index170)] + let iter_base = address169 + (index170 * 8); - () - } - UrlType(payload262) => { - mbt_ffi_store8(iter_base + 0, 27) - - match payload262.allowed_schemes { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload264) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address266 = mbt_ffi_malloc(payload264.length() * 8) - for index267 = 0 - index267 < payload264.length() - index267 = index267 + 1 { - let iter_elem : String = payload264[index267] - let iter_base = address266 + index267 * 8 - - let ptr265 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr265) - } - mbt_ffi_store32(iter_base + 16, payload264.length()) - mbt_ffi_store32(iter_base + 12, address266) - - () - } - } - - match payload262.allowed_hosts { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload269) => { - mbt_ffi_store8(iter_base + 20, 1) - - let address271 = mbt_ffi_malloc(payload269.length() * 8) - for index272 = 0 - index272 < payload269.length() - index272 = index272 + 1 { - let iter_elem : String = payload269[index272] - let iter_base = address271 + index272 * 8 - - let ptr270 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr270) - } - mbt_ffi_store32(iter_base + 28, payload269.length()) - mbt_ffi_store32(iter_base + 24, address271) + let ptr168 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr168) + cleanup_list.push(ptr168) - () - } - } + } + mbt_ffi_store32((iter_base) + 28, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 24, address169) - () - } - DatetimeType => { - mbt_ffi_store8(iter_base + 0, 28) + let address172 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index173 = 0; index173 < (((iter_elem).metadata).examples).length(); index173 = index173 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index173)] + let iter_base = address172 + (index173 * 8); - () - } - DurationType => { - mbt_ffi_store8(iter_base + 0, 29) + let ptr171 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr171) + cleanup_list.push(ptr171) - () - } - QuantityType(payload275) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr276 = mbt_ffi_str2ptr(payload275.base_unit) - mbt_ffi_store32(iter_base + 12, payload275.base_unit.length()) - mbt_ffi_store32(iter_base + 8, ptr276) - - let address278 = mbt_ffi_malloc( - payload275.allowed_suffixes.length() * 8, - ) - for index279 = 0 - index279 < payload275.allowed_suffixes.length() - index279 = index279 + 1 { - let iter_elem : String = payload275.allowed_suffixes[index279] - let iter_base = address278 + index279 * 8 - - let ptr277 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr277) - } - mbt_ffi_store32(iter_base + 20, payload275.allowed_suffixes.length()) - mbt_ffi_store32(iter_base + 16, address278) - - match payload275.min { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload281) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload281.mantissa) - mbt_ffi_store32(iter_base + 40, payload281.scale) - - let ptr282 = mbt_ffi_str2ptr(payload281.unit) - mbt_ffi_store32(iter_base + 48, payload281.unit.length()) - mbt_ffi_store32(iter_base + 44, ptr282) - - () - } - } - - match payload275.max { - None => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - Some(payload284) => { - mbt_ffi_store8(iter_base + 56, 1) - mbt_ffi_store64(iter_base + 64, payload284.mantissa) - mbt_ffi_store32(iter_base + 72, payload284.scale) - - let ptr285 = mbt_ffi_str2ptr(payload284.unit) - mbt_ffi_store32(iter_base + 80, payload284.unit.length()) - mbt_ffi_store32(iter_base + 76, ptr285) - - () - } - } - - () - } - UnionType(payload286) => { - mbt_ffi_store8(iter_base + 0, 31) - - let address322 = mbt_ffi_malloc(payload286.branches.length() * 92) - for index323 = 0 - index323 < payload286.branches.length() - index323 = index323 + 1 { - let iter_elem : @types.UnionBranch = payload286.branches[index323] - let iter_base = address322 + index323 * 92 - - let ptr287 = mbt_ffi_str2ptr(iter_elem.tag) - mbt_ffi_store32(iter_base + 4, iter_elem.tag.length()) - mbt_ffi_store32(iter_base + 0, ptr287) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.discriminator { - Prefix(payload288) => { - mbt_ffi_store8(iter_base + 12, 0) - - let ptr289 = mbt_ffi_str2ptr(payload288) - mbt_ffi_store32(iter_base + 20, payload288.length()) - mbt_ffi_store32(iter_base + 16, ptr289) - - () - } - Suffix(payload290) => { - mbt_ffi_store8(iter_base + 12, 1) + } + mbt_ffi_store32((iter_base) + 36, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 32, address172) - let ptr291 = mbt_ffi_str2ptr(payload290) - mbt_ffi_store32(iter_base + 20, payload290.length()) - mbt_ffi_store32(iter_base + 16, ptr291) + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 40, (0)) - () - } - Contains(payload292) => { - mbt_ffi_store8(iter_base + 12, 2) + () + } + Some(payload175) => { + mbt_ffi_store8((iter_base) + 40, (1)) - let ptr293 = mbt_ffi_str2ptr(payload292) - mbt_ffi_store32(iter_base + 20, payload292.length()) - mbt_ffi_store32(iter_base + 16, ptr293) + let ptr176 = mbt_ffi_str2ptr(payload175) + mbt_ffi_store32((iter_base) + 48, payload175.length()) + mbt_ffi_store32((iter_base) + 44, ptr176) + cleanup_list.push(ptr176) - () - } - Regex(payload294) => { - mbt_ffi_store8(iter_base + 12, 3) + () + } + } - let ptr295 = mbt_ffi_str2ptr(payload294) - mbt_ffi_store32(iter_base + 20, payload294.length()) - mbt_ffi_store32(iter_base + 16, ptr295) + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 52, (0)) - () - } - FieldEquals(payload296) => { - mbt_ffi_store8(iter_base + 12, 4) + () + } + Some(payload178) => { + mbt_ffi_store8((iter_base) + 52, (1)) + + match payload178 { + Multimodal => { + mbt_ffi_store8((iter_base) + 56, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 56, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 56, (2)) + + () + } + Other(payload182) => { + mbt_ffi_store8((iter_base) + 56, (3)) + + let ptr183 = mbt_ffi_str2ptr(payload182) + mbt_ffi_store32((iter_base) + 64, payload182.length()) + mbt_ffi_store32((iter_base) + 60, ptr183) + cleanup_list.push(ptr183) + + () + } + } + + () + } + } + cleanup_list.push(ptr164) + cleanup_list.push(address169) + cleanup_list.push(address172) - let ptr297 = mbt_ffi_str2ptr(payload296.field_name) - mbt_ffi_store32(iter_base + 20, payload296.field_name.length()) - mbt_ffi_store32(iter_base + 16, ptr297) + } + mbt_ffi_store32((iter_base) + 12, (payload163).length()) + mbt_ffi_store32((iter_base) + 8, address184) + cleanup_list.push(address184) - match payload296.literal { - None => { - mbt_ffi_store8(iter_base + 24, 0) + () + } + VariantType(payload186) => { + mbt_ffi_store8((iter_base) + 0, (15)) - () - } - Some(payload299) => { - mbt_ffi_store8(iter_base + 24, 1) + let address209 = mbt_ffi_malloc((payload186).length() * 72); + for index210 = 0; index210 < (payload186).length(); index210 = index210 + 1 { + let iter_elem : @types.VariantCaseType = (payload186)[(index210)] + let iter_base = address209 + (index210 * 72); - let ptr300 = mbt_ffi_str2ptr(payload299) - mbt_ffi_store32(iter_base + 32, payload299.length()) - mbt_ffi_store32(iter_base + 28, ptr300) + let ptr187 = mbt_ffi_str2ptr((iter_elem).name) + mbt_ffi_store32((iter_base) + 4, (iter_elem).name.length()) + mbt_ffi_store32((iter_base) + 0, ptr187) - () - } - } + match ((iter_elem).payload) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - FieldAbsent(payload301) => { - mbt_ffi_store8(iter_base + 12, 5) + () + } + Some(payload189) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload189) - let ptr302 = mbt_ffi_str2ptr(payload301) - mbt_ffi_store32(iter_base + 20, payload301.length()) - mbt_ffi_store32(iter_base + 16, ptr302) + () + } + } - () - } - } + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 36, 0) + () + } + Some(payload191) => { + mbt_ffi_store8((iter_base) + 16, (1)) - () - } - Some(payload304) => { - mbt_ffi_store8(iter_base + 36, 1) + let ptr192 = mbt_ffi_str2ptr(payload191) + mbt_ffi_store32((iter_base) + 24, payload191.length()) + mbt_ffi_store32((iter_base) + 20, ptr192) + cleanup_list.push(ptr192) - let ptr305 = mbt_ffi_str2ptr(payload304) - mbt_ffi_store32(iter_base + 44, payload304.length()) - mbt_ffi_store32(iter_base + 40, ptr305) + () + } + } - () - } - } - - let address307 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index308 = 0 - index308 < iter_elem.metadata.aliases.length() - index308 = index308 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index308] - let iter_base = address307 + index308 * 8 - - let ptr306 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr306) - } - mbt_ffi_store32(iter_base + 52, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 48, address307) - - let address310 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index311 = 0 - index311 < iter_elem.metadata.examples.length() - index311 = index311 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index311] - let iter_base = address310 + index311 * 8 - - let ptr309 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr309) - } - mbt_ffi_store32(iter_base + 60, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 56, address310) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let address194 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index195 = 0; index195 < (((iter_elem).metadata).aliases).length(); index195 = index195 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index195)] + let iter_base = address194 + (index195 * 8); - () - } - Some(payload313) => { - mbt_ffi_store8(iter_base + 64, 1) + let ptr193 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr193) + cleanup_list.push(ptr193) - let ptr314 = mbt_ffi_str2ptr(payload313) - mbt_ffi_store32(iter_base + 72, payload313.length()) - mbt_ffi_store32(iter_base + 68, ptr314) + } + mbt_ffi_store32((iter_base) + 32, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 28, address194) - () - } - } + let address197 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index198 = 0; index198 < (((iter_elem).metadata).examples).length(); index198 = index198 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index198)] + let iter_base = address197 + (index198 * 8); - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 76, 0) + let ptr196 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr196) + cleanup_list.push(ptr196) - () - } - Some(payload316) => { - mbt_ffi_store8(iter_base + 76, 1) + } + mbt_ffi_store32((iter_base) + 40, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 36, address197) - match payload316 { - Multimodal => { - mbt_ffi_store8(iter_base + 80, 0) + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 44, (0)) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 80, 1) + () + } + Some(payload200) => { + mbt_ffi_store8((iter_base) + 44, (1)) - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 80, 2) + let ptr201 = mbt_ffi_str2ptr(payload200) + mbt_ffi_store32((iter_base) + 52, payload200.length()) + mbt_ffi_store32((iter_base) + 48, ptr201) + cleanup_list.push(ptr201) - () - } - Other(payload320) => { - mbt_ffi_store8(iter_base + 80, 3) + () + } + } - let ptr321 = mbt_ffi_str2ptr(payload320) - mbt_ffi_store32(iter_base + 88, payload320.length()) - mbt_ffi_store32(iter_base + 84, ptr321) + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) - () - } - } + () + } + Some(payload203) => { + mbt_ffi_store8((iter_base) + 56, (1)) + + match payload203 { + Multimodal => { + mbt_ffi_store8((iter_base) + 60, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 60, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 60, (2)) + + () + } + Other(payload207) => { + mbt_ffi_store8((iter_base) + 60, (3)) + + let ptr208 = mbt_ffi_str2ptr(payload207) + mbt_ffi_store32((iter_base) + 68, payload207.length()) + mbt_ffi_store32((iter_base) + 64, ptr208) + cleanup_list.push(ptr208) + + () + } + } + + () + } + } + cleanup_list.push(ptr187) + cleanup_list.push(address194) + cleanup_list.push(address197) - () - } - } - } - mbt_ffi_store32(iter_base + 12, payload286.branches.length()) - mbt_ffi_store32(iter_base + 8, address322) + } + mbt_ffi_store32((iter_base) + 12, (payload186).length()) + mbt_ffi_store32((iter_base) + 8, address209) + cleanup_list.push(address209) - () - } - SecretType(payload324) => { - mbt_ffi_store8(iter_base + 0, 32) - mbt_ffi_store32(iter_base + 8, payload324.inner) + () + } + EnumType(payload211) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address213 = mbt_ffi_malloc((payload211).length() * 8); + for index214 = 0; index214 < (payload211).length(); index214 = index214 + 1 { + let iter_elem : String = (payload211)[(index214)] + let iter_base = address213 + (index214 * 8); - match payload324.category { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let ptr212 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr212) + cleanup_list.push(ptr212) - () - } - Some(payload326) => { - mbt_ffi_store8(iter_base + 12, 1) + } + mbt_ffi_store32((iter_base) + 12, (payload211).length()) + mbt_ffi_store32((iter_base) + 8, address213) + cleanup_list.push(address213) - let ptr327 = mbt_ffi_str2ptr(payload326) - mbt_ffi_store32(iter_base + 20, payload326.length()) - mbt_ffi_store32(iter_base + 16, ptr327) + () + } + FlagsType(payload215) => { + mbt_ffi_store8((iter_base) + 0, (17)) - () - } - } + let address217 = mbt_ffi_malloc((payload215).length() * 8); + for index218 = 0; index218 < (payload215).length(); index218 = index218 + 1 { + let iter_elem : String = (payload215)[(index218)] + let iter_base = address217 + (index218 * 8); - () - } - QuotaTokenType(payload328) => { - mbt_ffi_store8(iter_base + 0, 33) + let ptr216 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr216) + cleanup_list.push(ptr216) - match payload328.resource_name { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + mbt_ffi_store32((iter_base) + 12, (payload215).length()) + mbt_ffi_store32((iter_base) + 8, address217) + cleanup_list.push(address217) - () - } - Some(payload330) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + TupleType(payload219) => { + mbt_ffi_store8((iter_base) + 0, (18)) - let ptr331 = mbt_ffi_str2ptr(payload330) - mbt_ffi_store32(iter_base + 16, payload330.length()) - mbt_ffi_store32(iter_base + 12, ptr331) + let address220 = mbt_ffi_malloc((payload219).length() * 4); + for index221 = 0; index221 < (payload219).length(); index221 = index221 + 1 { + let iter_elem : Int = (payload219)[(index221)] + let iter_base = address220 + (index221 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - () - } - } + } + mbt_ffi_store32((iter_base) + 12, (payload219).length()) + mbt_ffi_store32((iter_base) + 8, address220) + cleanup_list.push(address220) - () - } - FutureType(payload332) => { - mbt_ffi_store8(iter_base + 0, 34) + () + } + ListType(payload222) => { + mbt_ffi_store8((iter_base) + 0, (19)) + mbt_ffi_store32((iter_base) + 8, payload222) - match payload332 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + () + } + FixedListType(payload223) => { + mbt_ffi_store8((iter_base) + 0, (20)) + mbt_ffi_store32((iter_base) + 8, (payload223).element) + mbt_ffi_store32((iter_base) + 12, ((payload223).length).reinterpret_as_int()) - () - } - Some(payload334) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload334) + () + } + MapType(payload224) => { + mbt_ffi_store8((iter_base) + 0, (21)) + mbt_ffi_store32((iter_base) + 8, (payload224).key) + mbt_ffi_store32((iter_base) + 12, (payload224).value) - () - } - } + () + } + OptionType(payload225) => { + mbt_ffi_store8((iter_base) + 0, (22)) + mbt_ffi_store32((iter_base) + 8, payload225) - () - } - StreamType(payload335) => { - mbt_ffi_store8(iter_base + 0, 35) + () + } + ResultType(payload226) => { + mbt_ffi_store8((iter_base) + 0, (23)) - match payload335 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match ((payload226).ok) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - Some(payload337) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload337) + () + } + Some(payload228) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload228) - () - } - } + () + } + } - () - } - } + match ((payload226).err) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 88, 0) + () + } + Some(payload230) => { + mbt_ffi_store8((iter_base) + 16, (1)) + mbt_ffi_store32((iter_base) + 20, payload230) - () - } - Some(payload339) => { - mbt_ffi_store8(iter_base + 88, 1) + () + } + } - let ptr340 = mbt_ffi_str2ptr(payload339) - mbt_ffi_store32(iter_base + 96, payload339.length()) - mbt_ffi_store32(iter_base + 92, ptr340) + () + } + TextType(payload231) => { + mbt_ffi_store8((iter_base) + 0, (24)) - () - } - } - - let address342 = mbt_ffi_malloc(iter_elem.metadata.aliases.length() * 8) - for index343 = 0 - index343 < iter_elem.metadata.aliases.length() - index343 = index343 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index343] - let iter_base = address342 + index343 * 8 - - let ptr341 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr341) - } - mbt_ffi_store32(iter_base + 104, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 100, address342) - - let address345 = mbt_ffi_malloc(iter_elem.metadata.examples.length() * 8) - for index346 = 0 - index346 < iter_elem.metadata.examples.length() - index346 = index346 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index346] - let iter_base = address345 + index346 * 8 - - let ptr344 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr344) - } - mbt_ffi_store32(iter_base + 112, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 108, address345) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 116, 0) - - () - } - Some(payload348) => { - mbt_ffi_store8(iter_base + 116, 1) + match ((payload231).languages) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - let ptr349 = mbt_ffi_str2ptr(payload348) - mbt_ffi_store32(iter_base + 124, payload348.length()) - mbt_ffi_store32(iter_base + 120, ptr349) + () + } + Some(payload233) => { + mbt_ffi_store8((iter_base) + 8, (1)) - () - } - } + let address235 = mbt_ffi_malloc((payload233).length() * 8); + for index236 = 0; index236 < (payload233).length(); index236 = index236 + 1 { + let iter_elem : String = (payload233)[(index236)] + let iter_base = address235 + (index236 * 8); - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 128, 0) + let ptr234 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr234) + cleanup_list.push(ptr234) - () - } - Some(payload351) => { - mbt_ffi_store8(iter_base + 128, 1) + } + mbt_ffi_store32((iter_base) + 16, (payload233).length()) + mbt_ffi_store32((iter_base) + 12, address235) + cleanup_list.push(address235) - match payload351 { - Multimodal => { - mbt_ffi_store8(iter_base + 132, 0) + () + } + } - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 132, 1) + match ((payload231).min_length) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 132, 2) + () + } + Some(payload238) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload238).reinterpret_as_int()) - () - } - Other(payload355) => { - mbt_ffi_store8(iter_base + 132, 3) + () + } + } - let ptr356 = mbt_ffi_str2ptr(payload355) - mbt_ffi_store32(iter_base + 140, payload355.length()) - mbt_ffi_store32(iter_base + 136, ptr356) + match ((payload231).max_length) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) - () - } - } + () + } + Some(payload240) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload240).reinterpret_as_int()) - () - } - } - } - mbt_ffi_store32(lower_ptr + 12 + 4, input.graph.type_nodes.length()) - mbt_ffi_store32(lower_ptr + 12 + 0, address357) - - let address363 = mbt_ffi_malloc(input.graph.defs.length() * 24) - for index364 = 0 - index364 < input.graph.defs.length() - index364 = index364 + 1 { - let iter_elem : @types.SchemaTypeDef = input.graph.defs[index364] - let iter_base = address363 + index364 * 24 - - let ptr359 = mbt_ffi_str2ptr(iter_elem.id) - mbt_ffi_store32(iter_base + 4, iter_elem.id.length()) - mbt_ffi_store32(iter_base + 0, ptr359) - - match iter_elem.name { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload361) => { - mbt_ffi_store8(iter_base + 8, 1) + () + } + } - let ptr362 = mbt_ffi_str2ptr(payload361) - mbt_ffi_store32(iter_base + 16, payload361.length()) - mbt_ffi_store32(iter_base + 12, ptr362) + match ((payload231).regex) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) - () - } - } - mbt_ffi_store32(iter_base + 20, iter_elem.body) - } - mbt_ffi_store32(lower_ptr + 12 + 12, input.graph.defs.length()) - mbt_ffi_store32(lower_ptr + 12 + 8, address363) - mbt_ffi_store32(lower_ptr + 12 + 16, input.graph.root) - - let address434 = mbt_ffi_malloc(input.value.value_nodes.length() * 32) - for index435 = 0 - index435 < input.value.value_nodes.length() - index435 = index435 + 1 { - let iter_elem : @types.SchemaValueNode = input.value.value_nodes[index435] - let iter_base = address434 + index435 * 32 - - match iter_elem { - BoolValue(payload365) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload365 { 1 } else { 0 }) - - () - } - S8Value(payload366) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload366)) + () + } + Some(payload242) => { + mbt_ffi_store8((iter_base) + 36, (1)) - () - } - S16Value(payload367) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload367)) + let ptr243 = mbt_ffi_str2ptr(payload242) + mbt_ffi_store32((iter_base) + 44, payload242.length()) + mbt_ffi_store32((iter_base) + 40, ptr243) + cleanup_list.push(ptr243) - () - } - S32Value(payload368) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload368) + () + } + } - () - } - S64Value(payload369) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload369) + () + } + BinaryType(payload244) => { + mbt_ffi_store8((iter_base) + 0, (25)) - () - } - U8Value(payload370) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload370.to_int()) + match ((payload244).mime_types) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - U16Value(payload371) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload371.reinterpret_as_int()) + () + } + Some(payload246) => { + mbt_ffi_store8((iter_base) + 8, (1)) - () - } - U32Value(payload372) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload372.reinterpret_as_int()) + let address248 = mbt_ffi_malloc((payload246).length() * 8); + for index249 = 0; index249 < (payload246).length(); index249 = index249 + 1 { + let iter_elem : String = (payload246)[(index249)] + let iter_base = address248 + (index249 * 8); - () - } - U64Value(payload373) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload373.reinterpret_as_int64()) + let ptr247 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr247) + cleanup_list.push(ptr247) - () - } - F32Value(payload374) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload374) + } + mbt_ffi_store32((iter_base) + 16, (payload246).length()) + mbt_ffi_store32((iter_base) + 12, address248) + cleanup_list.push(address248) - () - } - F64Value(payload375) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload375) + () + } + } - () - } - CharValue(payload376) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload376.to_int()) + match ((payload244).min_bytes) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) - () - } - StringValue(payload377) => { - mbt_ffi_store8(iter_base + 0, 12) + () + } + Some(payload251) => { + mbt_ffi_store8((iter_base) + 20, (1)) + mbt_ffi_store32((iter_base) + 24, (payload251).reinterpret_as_int()) - let ptr378 = mbt_ffi_str2ptr(payload377) - mbt_ffi_store32(iter_base + 12, payload377.length()) - mbt_ffi_store32(iter_base + 8, ptr378) + () + } + } - () - } - RecordValue(payload379) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address380 = mbt_ffi_malloc(payload379.length() * 4) - for index381 = 0 - index381 < payload379.length() - index381 = index381 + 1 { - let iter_elem : Int = payload379[index381] - let iter_base = address380 + index381 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload379.length()) - mbt_ffi_store32(iter_base + 8, address380) - - () - } - VariantValue(payload382) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload382.case.reinterpret_as_int()) + match ((payload244).max_bytes) { + None => { + mbt_ffi_store8((iter_base) + 28, (0)) - match payload382.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + () + } + Some(payload253) => { + mbt_ffi_store8((iter_base) + 28, (1)) + mbt_ffi_store32((iter_base) + 32, (payload253).reinterpret_as_int()) - () - } - Some(payload384) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload384) + () + } + } - () - } - } + () + } + PathType(payload254) => { + mbt_ffi_store8((iter_base) + 0, (26)) + mbt_ffi_store8((iter_base) + 8, (payload254).direction.ordinal()) + mbt_ffi_store8((iter_base) + 9, (payload254).kind.ordinal()) - () - } - EnumValue(payload385) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload385.reinterpret_as_int()) + match ((payload254).allowed_mime_types) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - () - } - FlagsValue(payload386) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address387 = mbt_ffi_malloc(payload386.length() * 1) - for index388 = 0 - index388 < payload386.length() - index388 = index388 + 1 { - let iter_elem : Bool = payload386[index388] - let iter_base = address387 + index388 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload386.length()) - mbt_ffi_store32(iter_base + 8, address387) - - () - } - TupleValue(payload389) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address390 = mbt_ffi_malloc(payload389.length() * 4) - for index391 = 0 - index391 < payload389.length() - index391 = index391 + 1 { - let iter_elem : Int = payload389[index391] - let iter_base = address390 + index391 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload389.length()) - mbt_ffi_store32(iter_base + 8, address390) - - () - } - ListValue(payload392) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address393 = mbt_ffi_malloc(payload392.length() * 4) - for index394 = 0 - index394 < payload392.length() - index394 = index394 + 1 { - let iter_elem : Int = payload392[index394] - let iter_base = address393 + index394 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload392.length()) - mbt_ffi_store32(iter_base + 8, address393) - - () - } - FixedListValue(payload395) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address396 = mbt_ffi_malloc(payload395.length() * 4) - for index397 = 0 - index397 < payload395.length() - index397 = index397 + 1 { - let iter_elem : Int = payload395[index397] - let iter_base = address396 + index397 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload395.length()) - mbt_ffi_store32(iter_base + 8, address396) - - () - } - MapValue(payload398) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address399 = mbt_ffi_malloc(payload398.length() * 8) - for index400 = 0 - index400 < payload398.length() - index400 = index400 + 1 { - let iter_elem : @types.MapEntry = payload398[index400] - let iter_base = address399 + index400 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload398.length()) - mbt_ffi_store32(iter_base + 8, address399) - - () - } - OptionValue(payload401) => { - mbt_ffi_store8(iter_base + 0, 21) + () + } + Some(payload256) => { + mbt_ffi_store8((iter_base) + 12, (1)) - match payload401 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let address258 = mbt_ffi_malloc((payload256).length() * 8); + for index259 = 0; index259 < (payload256).length(); index259 = index259 + 1 { + let iter_elem : String = (payload256)[(index259)] + let iter_base = address258 + (index259 * 8); - () - } - Some(payload403) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload403) + let ptr257 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr257) + cleanup_list.push(ptr257) - () - } - } + } + mbt_ffi_store32((iter_base) + 20, (payload256).length()) + mbt_ffi_store32((iter_base) + 16, address258) + cleanup_list.push(address258) - () - } - ResultValue(payload404) => { - mbt_ffi_store8(iter_base + 0, 22) + () + } + } - match payload404 { - OkValue(payload405) => { - mbt_ffi_store8(iter_base + 8, 0) + match ((payload254).allowed_extensions) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) - match payload405 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + () + } + Some(payload261) => { + mbt_ffi_store8((iter_base) + 24, (1)) - () - } - Some(payload407) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload407) + let address263 = mbt_ffi_malloc((payload261).length() * 8); + for index264 = 0; index264 < (payload261).length(); index264 = index264 + 1 { + let iter_elem : String = (payload261)[(index264)] + let iter_base = address263 + (index264 * 8); - () - } - } + let ptr262 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr262) + cleanup_list.push(ptr262) - () - } - ErrValue(payload408) => { - mbt_ffi_store8(iter_base + 8, 1) + } + mbt_ffi_store32((iter_base) + 32, (payload261).length()) + mbt_ffi_store32((iter_base) + 28, address263) + cleanup_list.push(address263) - match payload408 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + () + } + } - () - } - Some(payload410) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload410) + () + } + UrlType(payload265) => { + mbt_ffi_store8((iter_base) + 0, (27)) - () - } - } + match ((payload265).allowed_schemes) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - () - } - } + () + } + Some(payload267) => { + mbt_ffi_store8((iter_base) + 8, (1)) - () - } - TextValue(payload411) => { - mbt_ffi_store8(iter_base + 0, 23) + let address269 = mbt_ffi_malloc((payload267).length() * 8); + for index270 = 0; index270 < (payload267).length(); index270 = index270 + 1 { + let iter_elem : String = (payload267)[(index270)] + let iter_base = address269 + (index270 * 8); - let ptr412 = mbt_ffi_str2ptr(payload411.text) - mbt_ffi_store32(iter_base + 12, payload411.text.length()) - mbt_ffi_store32(iter_base + 8, ptr412) + let ptr268 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr268) + cleanup_list.push(ptr268) - match payload411.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + mbt_ffi_store32((iter_base) + 16, (payload267).length()) + mbt_ffi_store32((iter_base) + 12, address269) + cleanup_list.push(address269) - () - } - Some(payload414) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + } - let ptr415 = mbt_ffi_str2ptr(payload414) - mbt_ffi_store32(iter_base + 24, payload414.length()) - mbt_ffi_store32(iter_base + 20, ptr415) + match ((payload265).allowed_hosts) { + None => { + mbt_ffi_store8((iter_base) + 20, (0)) - () - } - } + () + } + Some(payload272) => { + mbt_ffi_store8((iter_base) + 20, (1)) - () - } - BinaryValue(payload416) => { - mbt_ffi_store8(iter_base + 0, 24) + let address274 = mbt_ffi_malloc((payload272).length() * 8); + for index275 = 0; index275 < (payload272).length(); index275 = index275 + 1 { + let iter_elem : String = (payload272)[(index275)] + let iter_base = address274 + (index275 * 8); - let ptr417 = mbt_ffi_bytes2ptr(payload416.bytes) + let ptr273 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr273) + cleanup_list.push(ptr273) - mbt_ffi_store32(iter_base + 12, payload416.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr417) + } + mbt_ffi_store32((iter_base) + 28, (payload272).length()) + mbt_ffi_store32((iter_base) + 24, address274) + cleanup_list.push(address274) - match payload416.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + () + } + } - () - } - Some(payload419) => { - mbt_ffi_store8(iter_base + 16, 1) + () + } + DatetimeType => { + mbt_ffi_store8((iter_base) + 0, (28)) - let ptr420 = mbt_ffi_str2ptr(payload419) - mbt_ffi_store32(iter_base + 24, payload419.length()) - mbt_ffi_store32(iter_base + 20, ptr420) + () + } + DurationType => { + mbt_ffi_store8((iter_base) + 0, (29)) - () - } - } + () + } + QuantityType(payload278) => { + mbt_ffi_store8((iter_base) + 0, (30)) - () - } - PathValue(payload421) => { - mbt_ffi_store8(iter_base + 0, 25) + let ptr279 = mbt_ffi_str2ptr((payload278).base_unit) + mbt_ffi_store32((iter_base) + 12, (payload278).base_unit.length()) + mbt_ffi_store32((iter_base) + 8, ptr279) - let ptr422 = mbt_ffi_str2ptr(payload421) - mbt_ffi_store32(iter_base + 12, payload421.length()) - mbt_ffi_store32(iter_base + 8, ptr422) + let address281 = mbt_ffi_malloc(((payload278).allowed_suffixes).length() * 8); + for index282 = 0; index282 < ((payload278).allowed_suffixes).length(); index282 = index282 + 1 { + let iter_elem : String = ((payload278).allowed_suffixes)[(index282)] + let iter_base = address281 + (index282 * 8); - () - } - UrlValue(payload423) => { - mbt_ffi_store8(iter_base + 0, 26) + let ptr280 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr280) + cleanup_list.push(ptr280) - let ptr424 = mbt_ffi_str2ptr(payload423) - mbt_ffi_store32(iter_base + 12, payload423.length()) - mbt_ffi_store32(iter_base + 8, ptr424) + } + mbt_ffi_store32((iter_base) + 20, ((payload278).allowed_suffixes).length()) + mbt_ffi_store32((iter_base) + 16, address281) - () - } - DatetimeValue(payload425) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload425.seconds) - mbt_ffi_store32( - iter_base + 16, - payload425.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload426) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload426.nanoseconds) + match ((payload278).min) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) - () - } - QuantityValueNode(payload427) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload427.mantissa) - mbt_ffi_store32(iter_base + 16, payload427.scale) + () + } + Some(payload284) => { + mbt_ffi_store8((iter_base) + 24, (1)) + mbt_ffi_store64((iter_base) + 32, (payload284).mantissa) + mbt_ffi_store32((iter_base) + 40, (payload284).scale) - let ptr428 = mbt_ffi_str2ptr(payload427.unit) - mbt_ffi_store32(iter_base + 24, payload427.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr428) + let ptr285 = mbt_ffi_str2ptr((payload284).unit) + mbt_ffi_store32((iter_base) + 48, (payload284).unit.length()) + mbt_ffi_store32((iter_base) + 44, ptr285) + cleanup_list.push(ptr285) - () - } - UnionValue(payload429) => { - mbt_ffi_store8(iter_base + 0, 30) + () + } + } - let ptr430 = mbt_ffi_str2ptr(payload429.tag) - mbt_ffi_store32(iter_base + 12, payload429.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr430) - mbt_ffi_store32(iter_base + 16, payload429.body) + match ((payload278).max) { + None => { + mbt_ffi_store8((iter_base) + 56, (0)) - () - } - SecretValue(payload431) => { - mbt_ffi_store8(iter_base + 0, 31) + () + } + Some(payload287) => { + mbt_ffi_store8((iter_base) + 56, (1)) + mbt_ffi_store64((iter_base) + 64, (payload287).mantissa) + mbt_ffi_store32((iter_base) + 72, (payload287).scale) - let @types.Secret(handle) = payload431 - mbt_ffi_store32(iter_base + 8, handle) + let ptr288 = mbt_ffi_str2ptr((payload287).unit) + mbt_ffi_store32((iter_base) + 80, (payload287).unit.length()) + mbt_ffi_store32((iter_base) + 76, ptr288) + cleanup_list.push(ptr288) - () - } - QuotaTokenHandle(payload432) => { - mbt_ffi_store8(iter_base + 0, 32) + () + } + } + cleanup_list.push(ptr279) + cleanup_list.push(address281) - let @types.QuotaToken(handle433) = payload432 - mbt_ffi_store32(iter_base + 8, handle433) + () + } + UnionType(payload289) => { + mbt_ffi_store8((iter_base) + 0, (31)) - () - } - } - } - mbt_ffi_store32(lower_ptr + 12 + 24, input.value.value_nodes.length()) - mbt_ffi_store32(lower_ptr + 12 + 20, address434) - mbt_ffi_store32(lower_ptr + 12 + 28, input.value.root) - - match stdin { - None => { - mbt_ffi_store8(lower_ptr + 44 + 0, 0) - - () - } - Some(payload0) => { - mbt_ffi_store8(lower_ptr + 44 + 0, 1) - mbt_ffi_store32( - lower_ptr + 44 + 4, - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamLower( - payload0, - ), - ) + let address325 = mbt_ffi_malloc(((payload289).branches).length() * 92); + for index326 = 0; index326 < ((payload289).branches).length(); index326 = index326 + 1 { + let iter_elem : @types.UnionBranch = ((payload289).branches)[(index326)] + let iter_base = address325 + (index326 * 92); - () - } - } - - let result_ptr = mbt_ffi_malloc(48 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodToolRpcInvokeAndAwait( - lower_ptr, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - for index = 0; index < mbt_ffi_load32(lower_ptr + 8); index = index + 1 { - let iter_base = mbt_ffi_load32(lower_ptr + 4) + index * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 4)) - - for index20 = 0 - index20 < mbt_ffi_load32(lower_ptr + 16) - index20 = index20 + 1 { - let iter_base = mbt_ffi_load32(lower_ptr + 12) + index20 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index2 = 0 - index2 < mbt_ffi_load32(iter_base + 12) - index2 = index2 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index2 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - for index0 = 0 - index0 < mbt_ffi_load32(iter_base + 28) - index0 = index0 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index0 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index1 = 0 - index1 < mbt_ffi_load32(iter_base + 36) - index1 = index1 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index1 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } + let ptr290 = mbt_ffi_str2ptr((iter_elem).tag) + mbt_ffi_store32((iter_base) + 4, (iter_elem).tag.length()) + mbt_ffi_store32((iter_base) + 0, ptr290) + mbt_ffi_store32((iter_base) + 8, (iter_elem).body) - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index5 = 0 - index5 < mbt_ffi_load32(iter_base + 12) - index5 = index5 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index5 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index3 = 0 - index3 < mbt_ffi_load32(iter_base + 32) - index3 = index3 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index3 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index4 = 0 - index4 < mbt_ffi_load32(iter_base + 40) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index4 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + match (iter_elem).discriminator { + Prefix(payload291) => { + mbt_ffi_store8((iter_base) + 12, (0)) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index6 = 0 - index6 < mbt_ffi_load32(iter_base + 12) - index6 = index6 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index6 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index7 = 0 - index7 < mbt_ffi_load32(iter_base + 12) - index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index7 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 16) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index8 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index9 = 0 - index9 < mbt_ffi_load32(iter_base + 16) - index9 = index9 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index9 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 20) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index10 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index11 = 0 - index11 < mbt_ffi_load32(iter_base + 32) - index11 = index11 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index11 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index12 = 0 - index12 < mbt_ffi_load32(iter_base + 16) - index12 = index12 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index12 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index13 = 0 - index13 < mbt_ffi_load32(iter_base + 28) - index13 = index13 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index13 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index14 = 0 - index14 < mbt_ffi_load32(iter_base + 20) - index14 = index14 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index14 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index17 = 0 - index17 < mbt_ffi_load32(iter_base + 12) - index17 = index17 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index17 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) + let ptr292 = mbt_ffi_str2ptr(payload291) + mbt_ffi_store32((iter_base) + 20, payload291.length()) + mbt_ffi_store32((iter_base) + 16, ptr292) + cleanup_list.push(ptr292) - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + () + } + Suffix(payload293) => { + mbt_ffi_store8((iter_base) + 12, (1)) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - - for index15 = 0 - index15 < mbt_ffi_load32(iter_base + 52) - index15 = index15 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index15 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - for index16 = 0 - index16 < mbt_ffi_load32(iter_base + 60) - index16 = index16 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index16 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } + let ptr294 = mbt_ffi_str2ptr(payload293) + mbt_ffi_store32((iter_base) + 20, payload293.length()) + mbt_ffi_store32((iter_base) + 16, ptr294) + cleanup_list.push(ptr294) - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } + () + } + Contains(payload295) => { + mbt_ffi_store8((iter_base) + 12, (2)) - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index18 = 0 - index18 < mbt_ffi_load32(iter_base + 104) - index18 = index18 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index18 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index19 = 0 - index19 < mbt_ffi_load32(iter_base + 112) - index19 = index19 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index19 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } + let ptr296 = mbt_ffi_str2ptr(payload295) + mbt_ffi_store32((iter_base) + 20, payload295.length()) + mbt_ffi_store32((iter_base) + 16, ptr296) + cleanup_list.push(ptr296) - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 12)) + () + } + Regex(payload297) => { + mbt_ffi_store8((iter_base) + 12, (3)) - for index21 = 0 - index21 < mbt_ffi_load32(lower_ptr + 24) - index21 = index21 + 1 { - let iter_base = mbt_ffi_load32(lower_ptr + 20) + index21 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + let ptr298 = mbt_ffi_str2ptr(payload297) + mbt_ffi_store32((iter_base) + 20, payload297.length()) + mbt_ffi_store32((iter_base) + 16, ptr298) + cleanup_list.push(ptr298) - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 20)) + () + } + FieldEquals(payload299) => { + mbt_ffi_store8((iter_base) + 12, (4)) - for index22 = 0 - index22 < mbt_ffi_load32(lower_ptr + 36) - index22 = index22 + 1 { - let iter_base = mbt_ffi_load32(lower_ptr + 32) + index22 * 32 + let ptr300 = mbt_ffi_str2ptr((payload299).field_name) + mbt_ffi_store32((iter_base) + 20, (payload299).field_name.length()) + mbt_ffi_store32((iter_base) + 16, ptr300) - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)).drop() - 32 => - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)).drop() - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 32)) - - match mbt_ffi_load8_u(lower_ptr + 44) { - 0 => () - 1 => { - let result = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamLift( - mbt_ffi_load32(lower_ptr + 48), - ) - result.drop_sync() - } - _ => panic() - } - } else { - for index = 0; index < mbt_ffi_load32(lower_ptr + 8); index = index + 1 { - let iter_base = mbt_ffi_load32(lower_ptr + 4) + index * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 4)) - - for index20 = 0 - index20 < mbt_ffi_load32(lower_ptr + 16) - index20 = index20 + 1 { - let iter_base = mbt_ffi_load32(lower_ptr + 12) + index20 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index2 = 0 - index2 < mbt_ffi_load32(iter_base + 12) - index2 = index2 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index2 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - for index0 = 0 - index0 < mbt_ffi_load32(iter_base + 28) - index0 = index0 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index0 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index1 = 0 - index1 < mbt_ffi_load32(iter_base + 36) - index1 = index1 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index1 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } + match ((payload299).literal) { + None => { + mbt_ffi_store8((iter_base) + 24, (0)) - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index5 = 0 - index5 < mbt_ffi_load32(iter_base + 12) - index5 = index5 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index5 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index3 = 0 - index3 < mbt_ffi_load32(iter_base + 32) - index3 = index3 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index3 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index4 = 0 - index4 < mbt_ffi_load32(iter_base + 40) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index4 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + () + } + Some(payload302) => { + mbt_ffi_store8((iter_base) + 24, (1)) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index6 = 0 - index6 < mbt_ffi_load32(iter_base + 12) - index6 = index6 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index6 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index7 = 0 - index7 < mbt_ffi_load32(iter_base + 12) - index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index7 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 16) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index8 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index9 = 0 - index9 < mbt_ffi_load32(iter_base + 16) - index9 = index9 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index9 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 20) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index10 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index11 = 0 - index11 < mbt_ffi_load32(iter_base + 32) - index11 = index11 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index11 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index12 = 0 - index12 < mbt_ffi_load32(iter_base + 16) - index12 = index12 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + index12 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index13 = 0 - index13 < mbt_ffi_load32(iter_base + 28) - index13 = index13 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index13 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index14 = 0 - index14 < mbt_ffi_load32(iter_base + 20) - index14 = index14 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index14 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index17 = 0 - index17 < mbt_ffi_load32(iter_base + 12) - index17 = index17 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index17 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) + let ptr303 = mbt_ffi_str2ptr(payload302) + mbt_ffi_store32((iter_base) + 32, payload302.length()) + mbt_ffi_store32((iter_base) + 28, ptr303) + cleanup_list.push(ptr303) - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + () + } + } + cleanup_list.push(ptr300) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - - for index15 = 0 - index15 < mbt_ffi_load32(iter_base + 52) - index15 = index15 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + index15 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - for index16 = 0 - index16 < mbt_ffi_load32(iter_base + 60) - index16 = index16 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + index16 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } + () + } + FieldAbsent(payload304) => { + mbt_ffi_store8((iter_base) + 12, (5)) - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } + let ptr305 = mbt_ffi_str2ptr(payload304) + mbt_ffi_store32((iter_base) + 20, payload304.length()) + mbt_ffi_store32((iter_base) + 16, ptr305) + cleanup_list.push(ptr305) - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index18 = 0 - index18 < mbt_ffi_load32(iter_base + 104) - index18 = index18 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index18 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index19 = 0 - index19 < mbt_ffi_load32(iter_base + 112) - index19 = index19 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index19 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } + () + } + } - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 12)) + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 36, (0)) - for index21 = 0 - index21 < mbt_ffi_load32(lower_ptr + 24) - index21 = index21 + 1 { - let iter_base = mbt_ffi_load32(lower_ptr + 20) + index21 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () + } + Some(payload307) => { + mbt_ffi_store8((iter_base) + 36, (1)) - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 20)) + let ptr308 = mbt_ffi_str2ptr(payload307) + mbt_ffi_store32((iter_base) + 44, payload307.length()) + mbt_ffi_store32((iter_base) + 40, ptr308) + cleanup_list.push(ptr308) - for index22 = 0 - index22 < mbt_ffi_load32(lower_ptr + 36) - index22 = index22 + 1 { - let iter_base = mbt_ffi_load32(lower_ptr + 32) + index22 * 32 + () + } + } - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => () - 32 => () - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 32)) - - match mbt_ffi_load8_u(lower_ptr + 44) { - 0 => () - 1 => - wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamCommit( - mbt_ffi_load32(lower_ptr + 48), - ) - _ => panic() - } - } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => { - for index19 = 0 - index19 < mbt_ffi_load32(result_ptr + 12) - index19 = index19 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 8) + index19 * 144 + let address310 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index311 = 0; index311 < (((iter_elem).metadata).aliases).length(); index311 = index311 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index311)] + let iter_base = address310 + (index311 * 8); - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index1 = 0 - index1 < mbt_ffi_load32(iter_base + 12) - index1 = index1 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - for index = 0 - index < mbt_ffi_load32(iter_base + 28) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index0 = 0 - index0 < mbt_ffi_load32(iter_base + 36) - index0 = index0 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index0 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } + let ptr309 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr309) + cleanup_list.push(ptr309) - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index4 = 0 - index4 < mbt_ffi_load32(iter_base + 12) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index4 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index2 = 0 - index2 < mbt_ffi_load32(iter_base + 32) - index2 = index2 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index3 = 0 - index3 < mbt_ffi_load32(iter_base + 40) - index3 = index3 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index3 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + } + mbt_ffi_store32((iter_base) + 52, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 48, address310) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index5 = 0 - index5 < mbt_ffi_load32(iter_base + 12) - index5 = index5 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index5 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index6 = 0 - index6 < mbt_ffi_load32(iter_base + 12) - index6 = index6 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index6 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index7 = 0 - index7 < mbt_ffi_load32(iter_base + 16) - index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index7 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 16) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index8 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index9 = 0 - index9 < mbt_ffi_load32(iter_base + 20) - index9 = index9 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index9 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 32) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index10 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index11 = 0 - index11 < mbt_ffi_load32(iter_base + 16) - index11 = index11 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index11 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index12 = 0 - index12 < mbt_ffi_load32(iter_base + 28) - index12 = index12 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index12 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index13 = 0 - index13 < mbt_ffi_load32(iter_base + 20) - index13 = index13 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index13 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index16 = 0 - index16 < mbt_ffi_load32(iter_base + 12) - index16 = index16 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index16 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) + let address313 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index314 = 0; index314 < (((iter_elem).metadata).examples).length(); index314 = index314 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index314)] + let iter_base = address313 + (index314 * 8); - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let ptr312 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr312) + cleanup_list.push(ptr312) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - - for index14 = 0 - index14 < mbt_ffi_load32(iter_base + 52) - index14 = index14 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index14 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - for index15 = 0 - index15 < mbt_ffi_load32(iter_base + 60) - index15 = index15 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index15 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } + } + mbt_ffi_store32((iter_base) + 60, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 56, address313) - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 64, (0)) - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index17 = 0 - index17 < mbt_ffi_load32(iter_base + 104) - index17 = index17 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index17 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index18 = 0 - index18 < mbt_ffi_load32(iter_base + 112) - index18 = index18 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index18 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } + () + } + Some(payload316) => { + mbt_ffi_store8((iter_base) + 64, (1)) - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) + let ptr317 = mbt_ffi_str2ptr(payload316) + mbt_ffi_store32((iter_base) + 72, payload316.length()) + mbt_ffi_store32((iter_base) + 68, ptr317) + cleanup_list.push(ptr317) - for index20 = 0 - index20 < mbt_ffi_load32(result_ptr + 20) - index20 = index20 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 16) + index20 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + () + } + } - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 16)) + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 76, (0)) - for index21 = 0 - index21 < mbt_ffi_load32(result_ptr + 32) - index21 = index21 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 28) + index21 * 32 + () + } + Some(payload319) => { + mbt_ffi_store8((iter_base) + 76, (1)) + + match payload319 { + Multimodal => { + mbt_ffi_store8((iter_base) + 80, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 80, (1)) + + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 80, (2)) + + () + } + Other(payload323) => { + mbt_ffi_store8((iter_base) + 80, (3)) + + let ptr324 = mbt_ffi_str2ptr(payload323) + mbt_ffi_store32((iter_base) + 88, payload323.length()) + mbt_ffi_store32((iter_base) + 84, ptr324) + cleanup_list.push(ptr324) + + () + } + } + + () + } + } + cleanup_list.push(ptr290) + cleanup_list.push(address310) + cleanup_list.push(address313) - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + } + mbt_ffi_store32((iter_base) + 12, ((payload289).branches).length()) + mbt_ffi_store32((iter_base) + 8, address325) + cleanup_list.push(address325) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } + () } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + SecretType(payload327) => { + mbt_ffi_store8((iter_base) + 0, (32)) + mbt_ffi_store32((iter_base) + 8, (payload327).inner) - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)).drop() - 32 => - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)).drop() - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 28)) - } - _ => panic() - } + match ((payload327).category) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - match mbt_ffi_load8_u(result_ptr + 40) { - 0 => () - 1 => { - let result = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream0StreamLift( - mbt_ffi_load32(result_ptr + 44), - ) - result.drop_sync() - } - _ => panic() - } - } - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 2 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 3 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 4 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 1 => { - for index22 = 0 - index22 < mbt_ffi_load32(result_ptr + 16) - index22 = index22 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 12) + - index22 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - } - 2 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 3 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 4 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 5 => { - for index43 = 0 - index43 < mbt_ffi_load32(result_ptr + 16) - index43 = index43 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 12) + - index43 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index25 = 0 - index25 < mbt_ffi_load32(iter_base + 12) - index25 = index25 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index25 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - for index23 = 0 - index23 < mbt_ffi_load32(iter_base + 28) - index23 = index23 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index23 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index24 = 0 - index24 < mbt_ffi_load32(iter_base + 36) - index24 = index24 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index24 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index28 = 0 - index28 < mbt_ffi_load32(iter_base + 12) - index28 = index28 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index28 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index26 = 0 - index26 < mbt_ffi_load32(iter_base + 32) - index26 = index26 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index26 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index27 = 0 - index27 < mbt_ffi_load32(iter_base + 40) - index27 = index27 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index27 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index29 = 0 - index29 < mbt_ffi_load32(iter_base + 12) - index29 = index29 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index29 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index30 = 0 - index30 < mbt_ffi_load32(iter_base + 12) - index30 = index30 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index30 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index31 = 0 - index31 < mbt_ffi_load32(iter_base + 16) - index31 = index31 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index31 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index32 = 0 - index32 < mbt_ffi_load32(iter_base + 16) - index32 = index32 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index32 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index33 = 0 - index33 < mbt_ffi_load32(iter_base + 20) - index33 = index33 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index33 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index34 = 0 - index34 < mbt_ffi_load32(iter_base + 32) - index34 = index34 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index34 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index35 = 0 - index35 < mbt_ffi_load32(iter_base + 16) - index35 = index35 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index35 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index36 = 0 - index36 < mbt_ffi_load32(iter_base + 28) - index36 = index36 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index36 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index37 = 0 - index37 < mbt_ffi_load32(iter_base + 20) - index37 = index37 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index37 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index40 = 0 - index40 < mbt_ffi_load32(iter_base + 12) - index40 = index40 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index40 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - - for index38 = 0 - index38 < mbt_ffi_load32(iter_base + 52) - index38 = index38 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index38 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - for index39 = 0 - index39 < mbt_ffi_load32(iter_base + 60) - index39 = index39 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index39 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index41 = 0 - index41 < mbt_ffi_load32(iter_base + 104) - index41 = index41 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index41 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index42 = 0 - index42 < mbt_ffi_load32(iter_base + 112) - index42 = index42 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index42 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - - for index44 = 0 - index44 < mbt_ffi_load32(result_ptr + 24) - index44 = index44 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 20) + - index44 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - - for index45 = 0 - index45 < mbt_ffi_load32(result_ptr + 36) - index45 = index45 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 32) + - index45 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)).drop() - 32 => - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ).drop() - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 32)) - } - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted480 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - let lifted230 : @types.TypedSchemaValue? = match - mbt_ffi_load8_u(result_ptr + 4) { - 0 => Option::None - 1 => { - let array192 : Array[@types.SchemaTypeNode] = [] - for index193 = 0 - index193 < mbt_ffi_load32(result_ptr + 12) - index193 = index193 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 8) + index193 * 144 - - let lifted178 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted4 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted0 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted) - } - _ => panic() - } - - let lifted2 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted1) - } - _ => panic() - } - - let lifted3 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted0, - max: lifted2, - unit: lifted3, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted4) - } - 3 => { - let lifted11 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted6 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted5 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted5) - } - _ => panic() - } - - let lifted8 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted7 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted7) - } - _ => panic() - } - - let lifted10 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result9 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result9) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted6, - max: lifted8, - unit: lifted10, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted11) - } - 4 => { - let lifted18 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted13 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted12 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted12) - } - _ => panic() - } - - let lifted15 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted14 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted14) - } - _ => panic() - } - - let lifted17 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result16 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result16) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted13, - max: lifted15, - unit: lifted17, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted18) - } - 5 => { - let lifted25 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted20 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted19 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted19) - } - _ => panic() - } - - let lifted22 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted21 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted21) - } - _ => panic() - } - - let lifted24 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result23) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted20, - max: lifted22, - unit: lifted24, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted25) - } - 6 => { - let lifted32 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted27 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted26 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted26) - } - _ => panic() - } - - let lifted29 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted28 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted28) - } - _ => panic() - } - - let lifted31 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result30 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result30) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted27, - max: lifted29, - unit: lifted31, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted32) - } - 7 => { - let lifted39 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted34 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted33 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted33) - } - _ => panic() - } - - let lifted36 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted35 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted35) - } - _ => panic() - } - - let lifted38 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result37 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result37) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted34, - max: lifted36, - unit: lifted38, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted39) - } - 8 => { - let lifted46 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted41 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted40 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted40) - } - _ => panic() - } - - let lifted43 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted42 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted42) - } - _ => panic() - } - - let lifted45 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result44 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result44) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted41, - max: lifted43, - unit: lifted45, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted46) - } - 9 => { - let lifted53 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted48 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted47 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted47) - } - _ => panic() - } - - let lifted50 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted49 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted49) - } - _ => panic() - } - - let lifted52 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result51 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result51) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted48, - max: lifted50, - unit: lifted52, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted53) - } - 10 => { - let lifted60 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted55 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted54 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted54) - } - _ => panic() - } - - let lifted57 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted56 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted56) - } - _ => panic() - } - - let lifted59 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result58 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result58) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted55, - max: lifted57, - unit: lifted59, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted60) - } - 11 => { - let lifted67 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted62 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted61 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted61) - } - _ => panic() - } - - let lifted64 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted63 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted63) - } - _ => panic() - } - - let lifted66 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result65 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result65) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted62, - max: lifted64, - unit: lifted66, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted67) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array80 : Array[@types.NamedFieldType] = [] - for index81 = 0 - index81 < mbt_ffi_load32(iter_base + 12) - index81 = index81 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index81 * 68 - - let result68 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted70 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result69 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result69) - } - _ => panic() - } - - let array : Array[String] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 28) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index * 8 - - let result71 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result71) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array73 : Array[String] = [] - for index74 = 0 - index74 < mbt_ffi_load32(iter_base + 36) - index74 = index74 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index74 * 8 - - let result72 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array73.push(result72) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted76 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result75 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result75) - } - _ => panic() - } - - let lifted79 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted78 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result77 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + () + } + Some(payload329) => { + mbt_ffi_store8((iter_base) + 12, (1)) - @types.Role::Other(result77) - } - _ => panic() - } - - Option::Some(lifted78) - } - _ => panic() - } - - array80.push(@types.NamedFieldType::{ - name: result68, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted70, - aliases: array, - examples: array73, - deprecated: lifted76, - role: lifted79, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array80) - } - 15 => { - let array97 : Array[@types.VariantCaseType] = [] - for index98 = 0 - index98 < mbt_ffi_load32(iter_base + 12) - index98 = index98 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index98 * 72 - - let result82 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted83 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted85 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result84 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result84) - } - _ => panic() - } - - let array87 : Array[String] = [] - for index88 = 0 - index88 < mbt_ffi_load32(iter_base + 32) - index88 = index88 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index88 * 8 - - let result86 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array87.push(result86) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array90 : Array[String] = [] - for index91 = 0 - index91 < mbt_ffi_load32(iter_base + 40) - index91 = index91 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index91 * 8 - - let result89 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array90.push(result89) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted93 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result92 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result92) - } - _ => panic() - } - - let lifted96 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted95 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result94 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let ptr330 = mbt_ffi_str2ptr(payload329) + mbt_ffi_store32((iter_base) + 20, payload329.length()) + mbt_ffi_store32((iter_base) + 16, ptr330) + cleanup_list.push(ptr330) - @types.Role::Other(result94) + () + } } - _ => panic() - } - - Option::Some(lifted95) - } - _ => panic() - } - - array97.push(@types.VariantCaseType::{ - name: result82, - payload: lifted83, - metadata: @types.MetadataEnvelope::{ - doc: lifted85, - aliases: array87, - examples: array90, - deprecated: lifted93, - role: lifted96, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array97) - } - 16 => { - let array100 : Array[String] = [] - for index101 = 0 - index101 < mbt_ffi_load32(iter_base + 12) - index101 = index101 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index101 * 8 - - let result99 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array100.push(result99) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array100) - } - 17 => { - let array103 : Array[String] = [] - for index104 = 0 - index104 < mbt_ffi_load32(iter_base + 12) - index104 = index104 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index104 * 8 - - let result102 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array103.push(result102) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array103) - } - 18 => { - let array105 : Array[Int] = [] - for index106 = 0 - index106 < mbt_ffi_load32(iter_base + 12) - index106 = index106 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index106 * 4 - - array105.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array105) - } - 19 => - @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted107 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - let lifted108 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted107, - err: lifted108, - }) - } - 24 => { - let lifted112 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array110 : Array[String] = [] - for index111 = 0 - index111 < mbt_ffi_load32(iter_base + 16) - index111 = index111 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index111 * 8 + () + } + QuotaTokenType(payload331) => { + mbt_ffi_store8((iter_base) + 0, (33)) - let result109 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + match ((payload331).resource_name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - array110.push(result109) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + () + } + Some(payload333) => { + mbt_ffi_store8((iter_base) + 8, (1)) - Option::Some(array110) - } - _ => panic() - } - - let lifted113 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted114 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + let ptr334 = mbt_ffi_str2ptr(payload333) + mbt_ffi_store32((iter_base) + 16, payload333.length()) + mbt_ffi_store32((iter_base) + 12, ptr334) + cleanup_list.push(ptr334) - let lifted116 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result115 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + () + } + } - Option::Some(result115) + () } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted112, - min_length: lifted113, - max_length: lifted114, - regex: lifted116, - }) - } - 25 => { - let lifted120 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array118 : Array[String] = [] - for index119 = 0 - index119 < mbt_ffi_load32(iter_base + 16) - index119 = index119 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index119 * 8 + PermissionCardType(payload335) => { + mbt_ffi_store8((iter_base) + 0, (34)) + mbt_ffi_store8((iter_base) + 8, (if (payload335).polymorphic { 1 } else { 0 })) + + () + } + FutureType(payload336) => { + mbt_ffi_store8((iter_base) + 0, (35)) + + match (payload336) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - let result117 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + () + } + Some(payload338) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload338) - array118.push(result117) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + () + } + } - Option::Some(array118) + () } - _ => panic() - } - - let lifted121 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted122 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted120, - min_bytes: lifted121, - max_bytes: lifted122, - }) - } - 26 => { - let lifted126 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array124 : Array[String] = [] - for index125 = 0 - index125 < mbt_ffi_load32(iter_base + 20) - index125 = index125 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index125 * 8 + StreamType(payload339) => { + mbt_ffi_store8((iter_base) + 0, (36)) + + match (payload339) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - let result123 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + () + } + Some(payload341) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload341) - array124.push(result123) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) + () + } + } - Option::Some(array124) + () } - _ => panic() - } + } - let lifted130 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array128 : Array[String] = [] - for index129 = 0 - index129 < mbt_ffi_load32(iter_base + 32) - index129 = index129 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index129 * 8 + match (((iter_elem).metadata).doc) { + None => { + mbt_ffi_store8((iter_base) + 88, (0)) - let result127 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + () + } + Some(payload343) => { + mbt_ffi_store8((iter_base) + 88, (1)) - array128.push(result127) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let ptr344 = mbt_ffi_str2ptr(payload343) + mbt_ffi_store32((iter_base) + 96, payload343.length()) + mbt_ffi_store32((iter_base) + 92, ptr344) + cleanup_list.push(ptr344) - Option::Some(array128) + () } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted126, - allowed_extensions: lifted130, - }) - } - 27 => { - let lifted134 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array132 : Array[String] = [] - for index133 = 0 - index133 < mbt_ffi_load32(iter_base + 16) - index133 = index133 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index133 * 8 + } - let result131 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let address346 = mbt_ffi_malloc((((iter_elem).metadata).aliases).length() * 8); + for index347 = 0; index347 < (((iter_elem).metadata).aliases).length(); index347 = index347 + 1 { + let iter_elem : String = (((iter_elem).metadata).aliases)[(index347)] + let iter_base = address346 + (index347 * 8); - array132.push(result131) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + let ptr345 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr345) + cleanup_list.push(ptr345) - Option::Some(array132) - } - _ => panic() - } + } + mbt_ffi_store32((iter_base) + 104, (((iter_elem).metadata).aliases).length()) + mbt_ffi_store32((iter_base) + 100, address346) - let lifted138 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array136 : Array[String] = [] - for index137 = 0 - index137 < mbt_ffi_load32(iter_base + 28) - index137 = index137 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index137 * 8 + let address349 = mbt_ffi_malloc((((iter_elem).metadata).examples).length() * 8); + for index350 = 0; index350 < (((iter_elem).metadata).examples).length(); index350 = index350 + 1 { + let iter_elem : String = (((iter_elem).metadata).examples)[(index350)] + let iter_base = address349 + (index350 * 8); - let result135 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let ptr348 = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr348) + cleanup_list.push(ptr348) - array136.push(result135) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + } + mbt_ffi_store32((iter_base) + 112, (((iter_elem).metadata).examples).length()) + mbt_ffi_store32((iter_base) + 108, address349) + + match (((iter_elem).metadata).deprecated) { + None => { + mbt_ffi_store8((iter_base) + 116, (0)) - Option::Some(array136) + () } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted134, - allowed_hosts: lifted138, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result139 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array141 : Array[String] = [] - for index142 = 0 - index142 < mbt_ffi_load32(iter_base + 20) - index142 = index142 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index142 * 8 - - let result140 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array141.push(result140) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted144 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result143 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) + Some(payload352) => { + mbt_ffi_store8((iter_base) + 116, (1)) - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result143, - }) + let ptr353 = mbt_ffi_str2ptr(payload352) + mbt_ffi_store32((iter_base) + 124, payload352.length()) + mbt_ffi_store32((iter_base) + 120, ptr353) + cleanup_list.push(ptr353) + + () } - _ => panic() - } + } - let lifted146 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result145 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) + match (((iter_elem).metadata).role) { + None => { + mbt_ffi_store8((iter_base) + 128, (0)) - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result145, - }) + () } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result139, - allowed_suffixes: array141, - min: lifted144, - max: lifted146, - }) - } - 31 => { - let array170 : Array[@types.UnionBranch] = [] - for index171 = 0 - index171 < mbt_ffi_load32(iter_base + 12) - index171 = index171 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index171 * 92 - - let result147 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted156 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result148 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result148) - } - 1 => { - let result149 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result149) - } - 2 => { - let result150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result150) - } - 3 => { - let result151 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result151) - } - 4 => { - let result152 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted154 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result153 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + Some(payload355) => { + mbt_ffi_store8((iter_base) + 128, (1)) - Option::Some(result153) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result152, - literal: lifted154, - }) - } - 5 => { - let result155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result155) - } - _ => panic() - } - - let lifted158 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result157 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result157) - } - _ => panic() - } - - let array160 : Array[String] = [] - for index161 = 0 - index161 < mbt_ffi_load32(iter_base + 52) - index161 = index161 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index161 * 8 - - let result159 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array160.push(result159) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array163 : Array[String] = [] - for index164 = 0 - index164 < mbt_ffi_load32(iter_base + 60) - index164 = index164 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index164 * 8 - - let result162 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array163.push(result162) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted166 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result165 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result165) - } - _ => panic() - } - - let lifted169 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted168 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result167 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + match payload355 { + Multimodal => { + mbt_ffi_store8((iter_base) + 132, (0)) + + () + } + UnstructuredText => { + mbt_ffi_store8((iter_base) + 132, (1)) - @types.Role::Other(result167) + () + } + UnstructuredBinary => { + mbt_ffi_store8((iter_base) + 132, (2)) + + () + } + Other(payload359) => { + mbt_ffi_store8((iter_base) + 132, (3)) + + let ptr360 = mbt_ffi_str2ptr(payload359) + mbt_ffi_store32((iter_base) + 140, payload359.length()) + mbt_ffi_store32((iter_base) + 136, ptr360) + cleanup_list.push(ptr360) + + () + } } - _ => panic() - } - - Option::Some(lifted168) - } - _ => panic() - } - - array170.push(@types.UnionBranch::{ - tag: result147, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted156, - metadata: @types.MetadataEnvelope::{ - doc: lifted158, - aliases: array160, - examples: array163, - deprecated: lifted166, - role: lifted169, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array170, - }) - } - 32 => { - let lifted173 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result172 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - Option::Some(result172) + () } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted173, - }) - } - 33 => { - let lifted175 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result174 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + } + cleanup_list.push(address346) + cleanup_list.push(address349) + + } + + let address367 = mbt_ffi_malloc((((input).graph).defs).length() * 24); + for index368 = 0; index368 < (((input).graph).defs).length(); index368 = index368 + 1 { + let iter_elem : @types.SchemaTypeDef = (((input).graph).defs)[(index368)] + let iter_base = address367 + (index368 * 24); + + let ptr363 = mbt_ffi_str2ptr((iter_elem).id) + mbt_ffi_store32((iter_base) + 4, (iter_elem).id.length()) + mbt_ffi_store32((iter_base) + 0, ptr363) + + match ((iter_elem).name) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - Option::Some(result174) + () } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted175, - }) - } - 34 => { - let lifted176 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted176) - } - 35 => { - let lifted177 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + Some(payload365) => { + mbt_ffi_store8((iter_base) + 8, (1)) - @types.SchemaTypeBody::StreamType(lifted177) - } - _ => panic() - } + let ptr366 = mbt_ffi_str2ptr(payload365) + mbt_ffi_store32((iter_base) + 16, payload365.length()) + mbt_ffi_store32((iter_base) + 12, ptr366) + cleanup_list.push(ptr366) - let lifted180 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result179 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result179) - } - _ => panic() + () + } } + mbt_ffi_store32((iter_base) + 20, (iter_elem).body) + cleanup_list.push(ptr363) - let array182 : Array[String] = [] - for index183 = 0 - index183 < mbt_ffi_load32(iter_base + 104) - index183 = index183 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index183 * 8 + } - let result181 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let address441 = mbt_ffi_malloc((((input).value).value_nodes).length() * 32); + for index442 = 0; index442 < (((input).value).value_nodes).length(); index442 = index442 + 1 { + let iter_elem : @types.SchemaValueNode = (((input).value).value_nodes)[(index442)] + let iter_base = address441 + (index442 * 32); - array182.push(result181) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + match iter_elem { + BoolValue(payload369) => { + mbt_ffi_store8((iter_base) + 0, (0)) + mbt_ffi_store8((iter_base) + 8, (if payload369 { 1 } else { 0 })) - let array185 : Array[String] = [] - for index186 = 0 - index186 < mbt_ffi_load32(iter_base + 112) - index186 = index186 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index186 * 8 + () + } + S8Value(payload370) => { + mbt_ffi_store8((iter_base) + 0, (1)) + mbt_ffi_store8((iter_base) + 8, mbt_ffi_extend8(payload370)) - let result184 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + () + } + S16Value(payload371) => { + mbt_ffi_store8((iter_base) + 0, (2)) + mbt_ffi_store16((iter_base) + 8, mbt_ffi_extend16(payload371)) - array185.push(result184) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted188 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result187 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result187) - } - _ => panic() - } + () + } + S32Value(payload372) => { + mbt_ffi_store8((iter_base) + 0, (3)) + mbt_ffi_store32((iter_base) + 8, payload372) - let lifted191 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted190 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result189 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) + () + } + S64Value(payload373) => { + mbt_ffi_store8((iter_base) + 0, (4)) + mbt_ffi_store64((iter_base) + 8, payload373) - @types.Role::Other(result189) + () } - _ => panic() - } + U8Value(payload374) => { + mbt_ffi_store8((iter_base) + 0, (5)) + mbt_ffi_store8((iter_base) + 8, (payload374).to_int()) - Option::Some(lifted190) - } - _ => panic() - } + () + } + U16Value(payload375) => { + mbt_ffi_store8((iter_base) + 0, (6)) + mbt_ffi_store16((iter_base) + 8, (payload375).reinterpret_as_int()) - array192.push(@types.SchemaTypeNode::{ - body: lifted178, - metadata: @types.MetadataEnvelope::{ - doc: lifted180, - aliases: array182, - examples: array185, - deprecated: lifted188, - role: lifted191, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - - let array197 : Array[@types.SchemaTypeDef] = [] - for index198 = 0 - index198 < mbt_ffi_load32(result_ptr + 20) - index198 = index198 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 16) + index198 * 24 - - let result194 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted196 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result195 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result195) - } - _ => panic() - } + () + } + U32Value(payload376) => { + mbt_ffi_store8((iter_base) + 0, (7)) + mbt_ffi_store32((iter_base) + 8, (payload376).reinterpret_as_int()) - array197.push(@types.SchemaTypeDef::{ - id: result194, - name: lifted196, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 16)) - - let array228 : Array[@types.SchemaValueNode] = [] - for index229 = 0 - index229 < mbt_ffi_load32(result_ptr + 32) - index229 = index229 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 28) + index229 * 32 - - let lifted227 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => - @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => - @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => - @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => - @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result199 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result199) - } - 13 => { - let array200 : Array[Int] = [] - for index201 = 0 - index201 < mbt_ffi_load32(iter_base + 12) - index201 = index201 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index201 * 4 - - array200.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array200) - } - 14 => { - let lifted202 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted202, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array203 : Array[Bool] = [] - for index204 = 0 - index204 < mbt_ffi_load32(iter_base + 12) - index204 = index204 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index204 * 1 - - array203.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array203) - } - 17 => { - let array205 : Array[Int] = [] - for index206 = 0 - index206 < mbt_ffi_load32(iter_base + 12) - index206 = index206 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index206 * 4 - - array205.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array205) - } - 18 => { - let array207 : Array[Int] = [] - for index208 = 0 - index208 < mbt_ffi_load32(iter_base + 12) - index208 = index208 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index208 * 4 - - array207.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array207) - } - 19 => { - let array209 : Array[Int] = [] - for index210 = 0 - index210 < mbt_ffi_load32(iter_base + 12) - index210 = index210 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index210 * 4 - - array209.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array209) - } - 20 => { - let array211 : Array[@types.MapEntry] = [] - for index212 = 0 - index212 < mbt_ffi_load32(iter_base + 12) - index212 = index212 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index212 * 8 - - array211.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array211) - } - 21 => { - let lifted213 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + () + } + U64Value(payload377) => { + mbt_ffi_store8((iter_base) + 0, (8)) + mbt_ffi_store64((iter_base) + 8, (payload377).reinterpret_as_int64()) - @types.SchemaValueNode::OptionValue(lifted213) - } - 22 => { - let lifted216 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted214 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + () + } + F32Value(payload378) => { + mbt_ffi_store8((iter_base) + 0, (9)) + mbt_ffi_storef32((iter_base) + 8, payload378) - @types.ResultValuePayload::OkValue(lifted214) + () } - 1 => { - let lifted215 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + F64Value(payload379) => { + mbt_ffi_store8((iter_base) + 0, (10)) + mbt_ffi_storef64((iter_base) + 8, payload379) - @types.ResultValuePayload::ErrValue(lifted215) + () } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted216) - } - 23 => { - let result217 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted219 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result218 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + CharValue(payload380) => { + mbt_ffi_store8((iter_base) + 0, (11)) + mbt_ffi_store32((iter_base) + 8, (payload380).to_int()) - Option::Some(result218) + () } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result217, - language: lifted219, - }) - } - 24 => { - let result220 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted222 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result221 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + StringValue(payload381) => { + mbt_ffi_store8((iter_base) + 0, (12)) + + let ptr382 = mbt_ffi_str2ptr(payload381) + mbt_ffi_store32((iter_base) + 12, payload381.length()) + mbt_ffi_store32((iter_base) + 8, ptr382) + cleanup_list.push(ptr382) - Option::Some(result221) + () } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result220, - mime_type: lifted222, - }) - } - 25 => { - let result223 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result223) - } - 26 => { - let result224 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result224) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result225 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result225, - }) - } - 30 => { - let result226 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result226, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } + RecordValue(payload383) => { + mbt_ffi_store8((iter_base) + 0, (13)) - array228.push(lifted227) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 28)) - - Option::Some(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array192, - defs: array197, - root: mbt_ffi_load32(result_ptr + 24), - }, - value: @types.SchemaValueTree::{ - value_nodes: array228, - root: mbt_ffi_load32(result_ptr + 36), - }, - }) - } - _ => panic() - } + let address384 = mbt_ffi_malloc((payload383).length() * 4); + for index385 = 0; index385 < (payload383).length(); index385 = index385 + 1 { + let iter_elem : Int = (payload383)[(index385)] + let iter_base = address384 + (index385 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - let lifted232 : @async-core.Stream[Byte]? = match - mbt_ffi_load8_u(result_ptr + 40) { - 0 => Option::None - 1 => { - let result231 = wasmGolemToolHost010MethodToolRpcInvokeAndAwaitStream1StreamLift( - mbt_ffi_load32(result_ptr + 44), - ) - - Option::Some(result231) - } - _ => panic() - } + } + mbt_ffi_store32((iter_base) + 12, (payload383).length()) + mbt_ffi_store32((iter_base) + 8, address384) + cleanup_list.push(address384) - Result::Ok(@common.InvocationResult::{ - result: lifted230, - stdout: lifted232, - }) - } - 1 => { - let lifted479 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => { - let result233 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - RpcError::ProtocolError(result233) - } - 1 => { - let result234 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - RpcError::Denied(result234) - } - 2 => { - let result235 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - RpcError::NotFound(result235) - } - 3 => { - let result236 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - RpcError::RemoteInternalError(result236) - } - 4 => { - let lifted478 = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => { - let result237 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + () + } + VariantValue(payload386) => { + mbt_ffi_store8((iter_base) + 0, (14)) + mbt_ffi_store32((iter_base) + 8, ((payload386).case).reinterpret_as_int()) - @common.ToolError::InvalidToolName(result237) - } - 1 => { - let array239 : Array[String] = [] - for index240 = 0 - index240 < mbt_ffi_load32(result_ptr + 16) - index240 = index240 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 12) + index240 * 8 - - let result238 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array239.push(result238) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - - @common.ToolError::InvalidCommandPath(array239) - } - 2 => { - let result241 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + match ((payload386).payload) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) - @common.ToolError::InvalidInput(result241) - } - 3 => { - let result242 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + () + } + Some(payload388) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload388) - @common.ToolError::ConstraintViolation(result242) - } - 4 => { - let result243 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + () + } + } - @common.ToolError::InvalidResult(result243) - } - 5 => { - let array440 : Array[@types.SchemaTypeNode] = [] - for index441 = 0 - index441 < mbt_ffi_load32(result_ptr + 16) - index441 = index441 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 12) + index441 * 144 - - let lifted426 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted250 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted245 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted244 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted244) - } - _ => panic() - } - - let lifted247 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted246 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + () + } + EnumValue(payload389) => { + mbt_ffi_store8((iter_base) + 0, (15)) + mbt_ffi_store32((iter_base) + 8, (payload389).reinterpret_as_int()) + + () + } + FlagsValue(payload390) => { + mbt_ffi_store8((iter_base) + 0, (16)) + + let address391 = mbt_ffi_malloc((payload390).length() * 1); + for index392 = 0; index392 < (payload390).length(); index392 = index392 + 1 { + let iter_elem : Bool = (payload390)[(index392)] + let iter_base = address391 + (index392 * 1); + mbt_ffi_store8((iter_base) + 0, (if iter_elem { 1 } else { 0 })) - Option::Some(lifted246) - } - _ => panic() } + mbt_ffi_store32((iter_base) + 12, (payload390).length()) + mbt_ffi_store32((iter_base) + 8, address391) + cleanup_list.push(address391) + + () + } + TupleValue(payload393) => { + mbt_ffi_store8((iter_base) + 0, (17)) - let lifted249 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result248 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let address394 = mbt_ffi_malloc((payload393).length() * 4); + for index395 = 0; index395 < (payload393).length(); index395 = index395 + 1 { + let iter_elem : Int = (payload393)[(index395)] + let iter_base = address394 + (index395 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - Option::Some(result248) - } - _ => panic() } + mbt_ffi_store32((iter_base) + 12, (payload393).length()) + mbt_ffi_store32((iter_base) + 8, address394) + cleanup_list.push(address394) + + () + } + ListValue(payload396) => { + mbt_ffi_store8((iter_base) + 0, (18)) + + let address397 = mbt_ffi_malloc((payload396).length() * 4); + for index398 = 0; index398 < (payload396).length(); index398 = index398 + 1 { + let iter_elem : Int = (payload396)[(index398)] + let iter_base = address397 + (index398 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - Option::Some(@types.NumericRestrictions::{ - min: lifted245, - max: lifted247, - unit: lifted249, - }) - } - _ => panic() - } + } + mbt_ffi_store32((iter_base) + 12, (payload396).length()) + mbt_ffi_store32((iter_base) + 8, address397) + cleanup_list.push(address397) - @types.SchemaTypeBody::S8Type(lifted250) + () } - 3 => { - let lifted257 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted252 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted251 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted251) - } - _ => panic() - } - - let lifted254 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted253 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + FixedListValue(payload399) => { + mbt_ffi_store8((iter_base) + 0, (19)) + + let address400 = mbt_ffi_malloc((payload399).length() * 4); + for index401 = 0; index401 < (payload399).length(); index401 = index401 + 1 { + let iter_elem : Int = (payload399)[(index401)] + let iter_base = address400 + (index401 * 4); + mbt_ffi_store32((iter_base) + 0, iter_elem) - Option::Some(lifted253) - } - _ => panic() } + mbt_ffi_store32((iter_base) + 12, (payload399).length()) + mbt_ffi_store32((iter_base) + 8, address400) + cleanup_list.push(address400) + + () + } + MapValue(payload402) => { + mbt_ffi_store8((iter_base) + 0, (20)) - let lifted256 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result255 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let address403 = mbt_ffi_malloc((payload402).length() * 8); + for index404 = 0; index404 < (payload402).length(); index404 = index404 + 1 { + let iter_elem : @types.MapEntry = (payload402)[(index404)] + let iter_base = address403 + (index404 * 8); + mbt_ffi_store32((iter_base) + 0, (iter_elem).key) + mbt_ffi_store32((iter_base) + 4, (iter_elem).value) - Option::Some(result255) - } - _ => panic() } + mbt_ffi_store32((iter_base) + 12, (payload402).length()) + mbt_ffi_store32((iter_base) + 8, address403) + cleanup_list.push(address403) + + () + } + OptionValue(payload405) => { + mbt_ffi_store8((iter_base) + 0, (21)) + + match (payload405) { + None => { + mbt_ffi_store8((iter_base) + 8, (0)) - Option::Some(@types.NumericRestrictions::{ - min: lifted252, - max: lifted254, - unit: lifted256, - }) - } - _ => panic() - } + () + } + Some(payload407) => { + mbt_ffi_store8((iter_base) + 8, (1)) + mbt_ffi_store32((iter_base) + 12, payload407) + + () + } + } - @types.SchemaTypeBody::S16Type(lifted257) + () } - 4 => { - let lifted264 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted259 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted258 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted258) - } - _ => panic() - } - - let lifted261 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted260 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + ResultValue(payload408) => { + mbt_ffi_store8((iter_base) + 0, (22)) + + match payload408 { + OkValue(payload409) => { + mbt_ffi_store8((iter_base) + 8, (0)) + + match (payload409) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload411) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload411) + + () + } + } - Option::Some(lifted260) - } - _ => panic() + () + } + ErrValue(payload412) => { + mbt_ffi_store8((iter_base) + 8, (1)) + + match (payload412) { + None => { + mbt_ffi_store8((iter_base) + 12, (0)) + + () + } + Some(payload414) => { + mbt_ffi_store8((iter_base) + 12, (1)) + mbt_ffi_store32((iter_base) + 16, payload414) + + () + } + } + + () + } } - let lifted263 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result262 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + () + } + TextValue(payload415) => { + mbt_ffi_store8((iter_base) + 0, (23)) + + let ptr416 = mbt_ffi_str2ptr((payload415).text) + mbt_ffi_store32((iter_base) + 12, (payload415).text.length()) + mbt_ffi_store32((iter_base) + 8, ptr416) - Option::Some(result262) - } - _ => panic() - } + match ((payload415).language) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - Option::Some(@types.NumericRestrictions::{ - min: lifted259, - max: lifted261, - unit: lifted263, - }) - } - _ => panic() - } + () + } + Some(payload418) => { + mbt_ffi_store8((iter_base) + 16, (1)) - @types.SchemaTypeBody::S32Type(lifted264) - } - 5 => { - let lifted271 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted266 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted265 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted265) - } - _ => panic() - } - - let lifted268 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted267 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let ptr419 = mbt_ffi_str2ptr(payload418) + mbt_ffi_store32((iter_base) + 24, payload418.length()) + mbt_ffi_store32((iter_base) + 20, ptr419) + cleanup_list.push(ptr419) - Option::Some(lifted267) - } - _ => panic() + () + } } + cleanup_list.push(ptr416) - let lifted270 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result269 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + () + } + BinaryValue(payload420) => { + mbt_ffi_store8((iter_base) + 0, (24)) - Option::Some(result269) - } - _ => panic() - } + let ptr421 = mbt_ffi_bytes2ptr((payload420).bytes) - Option::Some(@types.NumericRestrictions::{ - min: lifted266, - max: lifted268, - unit: lifted270, - }) - } - _ => panic() - } + mbt_ffi_store32((iter_base) + 12, (payload420).bytes.length()) + mbt_ffi_store32((iter_base) + 8, ptr421) - @types.SchemaTypeBody::S64Type(lifted271) - } - 6 => { - let lifted278 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted273 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted272 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted272) - } - _ => panic() - } - - let lifted275 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted274 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + match ((payload420).mime_type) { + None => { + mbt_ffi_store8((iter_base) + 16, (0)) - Option::Some(lifted274) - } - _ => panic() - } + () + } + Some(payload423) => { + mbt_ffi_store8((iter_base) + 16, (1)) - let lifted277 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result276 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let ptr424 = mbt_ffi_str2ptr(payload423) + mbt_ffi_store32((iter_base) + 24, payload423.length()) + mbt_ffi_store32((iter_base) + 20, ptr424) + cleanup_list.push(ptr424) - Option::Some(result276) - } - _ => panic() + () + } } + cleanup_list.push(ptr421) - Option::Some(@types.NumericRestrictions::{ - min: lifted273, - max: lifted275, - unit: lifted277, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted278) + () } - 7 => { - let lifted285 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted280 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted279 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted279) - } - _ => panic() - } - - let lifted282 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted281 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + PathValue(payload425) => { + mbt_ffi_store8((iter_base) + 0, (25)) - Option::Some(lifted281) - } - _ => panic() - } + let ptr426 = mbt_ffi_str2ptr(payload425) + mbt_ffi_store32((iter_base) + 12, payload425.length()) + mbt_ffi_store32((iter_base) + 8, ptr426) + cleanup_list.push(ptr426) - let lifted284 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result283 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + () + } + UrlValue(payload427) => { + mbt_ffi_store8((iter_base) + 0, (26)) - Option::Some(result283) - } - _ => panic() - } + let ptr428 = mbt_ffi_str2ptr(payload427) + mbt_ffi_store32((iter_base) + 12, payload427.length()) + mbt_ffi_store32((iter_base) + 8, ptr428) + cleanup_list.push(ptr428) - Option::Some(@types.NumericRestrictions::{ - min: lifted280, - max: lifted282, - unit: lifted284, - }) - } - _ => panic() - } + () + } + DatetimeValue(payload429) => { + mbt_ffi_store8((iter_base) + 0, (27)) + mbt_ffi_store64((iter_base) + 8, (payload429).seconds) + mbt_ffi_store32((iter_base) + 16, ((payload429).nanoseconds).reinterpret_as_int()) - @types.SchemaTypeBody::U16Type(lifted285) + () } - 8 => { - let lifted292 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted287 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted286 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted286) - } - _ => panic() - } - - let lifted289 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted288 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + DurationValue(payload430) => { + mbt_ffi_store8((iter_base) + 0, (28)) + mbt_ffi_store64((iter_base) + 8, (payload430).nanoseconds) - Option::Some(lifted288) - } - _ => panic() - } + () + } + QuantityValueNode(payload431) => { + mbt_ffi_store8((iter_base) + 0, (29)) + mbt_ffi_store64((iter_base) + 8, (payload431).mantissa) + mbt_ffi_store32((iter_base) + 16, (payload431).scale) - let lifted291 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result290 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let ptr432 = mbt_ffi_str2ptr((payload431).unit) + mbt_ffi_store32((iter_base) + 24, (payload431).unit.length()) + mbt_ffi_store32((iter_base) + 20, ptr432) + cleanup_list.push(ptr432) - Option::Some(result290) - } - _ => panic() - } + () + } + UnionValue(payload433) => { + mbt_ffi_store8((iter_base) + 0, (30)) - Option::Some(@types.NumericRestrictions::{ - min: lifted287, - max: lifted289, - unit: lifted291, - }) - } - _ => panic() - } + let ptr434 = mbt_ffi_str2ptr((payload433).tag) + mbt_ffi_store32((iter_base) + 12, (payload433).tag.length()) + mbt_ffi_store32((iter_base) + 8, ptr434) + mbt_ffi_store32((iter_base) + 16, (payload433).body) + cleanup_list.push(ptr434) - @types.SchemaTypeBody::U32Type(lifted292) + () } - 9 => { - let lifted299 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted294 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted293 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted293) - } - _ => panic() - } - - let lifted296 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted295 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + SecretValue(payload435) => { + mbt_ffi_store8((iter_base) + 0, (31)) - Option::Some(lifted295) - } - _ => panic() - } + let @types.Secret(handle436) = payload435 + mbt_ffi_store32((iter_base) + 8, handle436) - let lifted298 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result297 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + () + } + QuotaTokenHandle(payload437) => { + mbt_ffi_store8((iter_base) + 0, (32)) - Option::Some(result297) - } - _ => panic() - } + let @types.QuotaToken(handle438) = payload437 + mbt_ffi_store32((iter_base) + 8, handle438) + + () + } + PermissionCardHandle(payload439) => { + mbt_ffi_store8((iter_base) + 0, (33)) - Option::Some(@types.NumericRestrictions::{ - min: lifted294, - max: lifted296, - unit: lifted298, - }) - } - _ => panic() - } + let @types.PermissionCard(handle440) = payload439 + mbt_ffi_store32((iter_base) + 8, handle440) - @types.SchemaTypeBody::U64Type(lifted299) + () } - 10 => { - let lifted306 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted301 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted300 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted300) - } - _ => panic() - } - - let lifted303 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted302 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + } - Option::Some(lifted302) - } - _ => panic() - } + } - let lifted305 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result304 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let (lowered, lowered445) = match (stdin) { + None => { - Option::Some(result304) - } - _ => panic() - } + ((0), 0) + } + Some(payload444) => { - Option::Some(@types.NumericRestrictions::{ - min: lifted301, - max: lifted303, - unit: lifted305, - }) - } - _ => panic() - } + ((1), wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamLower(payload444)) + } + } + let lower_arg = handle + let lower_arg446 = address + let lower_arg447 = (command_path).length() + let lower_arg448 = address361 + let lower_arg449 = (((input).graph).type_nodes).length() + let lower_arg450 = address367 + let lower_arg451 = (((input).graph).defs).length() + let lower_arg452 = ((input).graph).root + let lower_arg453 = address441 + let lower_arg454 = (((input).value).value_nodes).length() + let lower_arg455 = ((input).value).root + let lower_arg456 = lowered + let lower_arg457 = lowered445 + let result : Int = wasmImportMethodToolRpcAsyncInvokeAndAwait(lower_arg, lower_arg446, lower_arg447, lower_arg448, lower_arg449, lower_arg450, lower_arg451, lower_arg452, lower_arg453, lower_arg454, lower_arg455, lower_arg456, lower_arg457); - @types.SchemaTypeBody::F32Type(lifted306) - } - 11 => { - let lifted313 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted308 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted307 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted307) - } - _ => panic() - } - - let lifted310 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted309 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + for index461 = 0; index461 < (lower_arg449); index461 = index461 + 1 { + let iter_base = (lower_arg448) + (index461 * 144) - Option::Some(lifted309) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { - let lifted312 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result311 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Option::Some(result311) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted308, - max: lifted310, - unit: lifted312, - }) - } - _ => panic() - } + } + _ => panic() + } - @types.SchemaTypeBody::F64Type(lifted313) } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array328 : Array[@types.NamedFieldType] = [] - for index329 = 0 - index329 < mbt_ffi_load32(iter_base + 12) - index329 = index329 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index329 * 68 - - let result314 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted316 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result315 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + 3 => { - Option::Some(result315) - } - _ => panic() - } - - let array318 : Array[String] = [] - for index319 = 0 - index319 < mbt_ffi_load32(iter_base + 28) - index319 = index319 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index319 * 8 - - let result317 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array318.push(result317) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array321 : Array[String] = [] - for index322 = 0 - index322 < mbt_ffi_load32(iter_base + 36) - index322 = index322 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index322 * 8 - - let result320 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array321.push(result320) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted324 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result323 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Option::Some(result323) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } - let lifted327 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted326 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result325 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result325) - } - _ => panic() - } - - Option::Some(lifted326) + } + _ => panic() } - _ => panic() - } - - array328.push(@types.NamedFieldType::{ - name: result314, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted316, - aliases: array318, - examples: array321, - deprecated: lifted324, - role: lifted327, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array328) + } - 15 => { - let array345 : Array[@types.VariantCaseType] = [] - for index346 = 0 - index346 < mbt_ffi_load32(iter_base + 12) - index346 = index346 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index346 * 72 - - let result330 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted331 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + 4 => { - let lifted333 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result332 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Option::Some(result332) - } - _ => panic() - } - - let array335 : Array[String] = [] - for index336 = 0 - index336 < mbt_ffi_load32(iter_base + 32) - index336 = index336 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index336 * 8 - - let result334 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array335.push(result334) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array338 : Array[String] = [] - for index339 = 0 - index339 < mbt_ffi_load32(iter_base + 40) - index339 = index339 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index339 * 8 - - let result337 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array338.push(result337) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted341 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result340 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } - Option::Some(result340) + } + _ => panic() } - _ => panic() - } - let lifted344 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted343 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result342 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result342) - } - _ => panic() - } - - Option::Some(lifted343) - } - _ => panic() - } - - array345.push(@types.VariantCaseType::{ - name: result330, - payload: lifted331, - metadata: @types.MetadataEnvelope::{ - doc: lifted333, - aliases: array335, - examples: array338, - deprecated: lifted341, - role: lifted344, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array345) - } - 16 => { - let array348 : Array[String] = [] - for index349 = 0 - index349 < mbt_ffi_load32(iter_base + 12) - index349 = index349 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index349 * 8 - - let result347 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array348.push(result347) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array348) - } - 17 => { - let array351 : Array[String] = [] - for index352 = 0 - index352 < mbt_ffi_load32(iter_base + 12) - index352 = index352 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index352 * 8 - - let result350 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array351.push(result350) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array351) - } - 18 => { - let array353 : Array[Int] = [] - for index354 = 0 - index354 < mbt_ffi_load32(iter_base + 12) - index354 = index354 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index354 * 4 - - array353.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array353) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted355 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted356 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted355, - err: lifted356, - }) - } - 24 => { - let lifted360 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array358 : Array[String] = [] - for index359 = 0 - index359 < mbt_ffi_load32(iter_base + 16) - index359 = index359 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index359 * 8 - - let result357 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array358.push(result357) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array358) - } - _ => panic() - } - - let lifted361 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted362 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted364 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result363 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result363) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted360, - min_length: lifted361, - max_length: lifted362, - regex: lifted364, - }) - } - 25 => { - let lifted368 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array366 : Array[String] = [] - for index367 = 0 - index367 < mbt_ffi_load32(iter_base + 16) - index367 = index367 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index367 * 8 - - let result365 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array366.push(result365) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array366) - } - _ => panic() - } - - let lifted369 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted370 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted368, - min_bytes: lifted369, - max_bytes: lifted370, - }) - } - 26 => { - let lifted374 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array372 : Array[String] = [] - for index373 = 0 - index373 < mbt_ffi_load32(iter_base + 20) - index373 = index373 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index373 * 8 - - let result371 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array372.push(result371) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array372) - } - _ => panic() - } - - let lifted378 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array376 : Array[String] = [] - for index377 = 0 - index377 < mbt_ffi_load32(iter_base + 32) - index377 = index377 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index377 * 8 - - let result375 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array376.push(result375) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array376) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted374, - allowed_extensions: lifted378, - }) } - 27 => { - let lifted382 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array380 : Array[String] = [] - for index381 = 0 - index381 < mbt_ffi_load32(iter_base + 16) - index381 = index381 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index381 * 8 - - let result379 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array380.push(result379) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array380) - } - _ => panic() - } - - let lifted386 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array384 : Array[String] = [] - for index385 = 0 - index385 < mbt_ffi_load32(iter_base + 28) - index385 = index385 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index385 * 8 - - let result383 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array384.push(result383) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array384) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted382, - allowed_hosts: lifted386, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result387 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array389 : Array[String] = [] - for index390 = 0 - index390 < mbt_ffi_load32(iter_base + 20) - index390 = index390 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index390 * 8 - - let result388 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array389.push(result388) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted392 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result391 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result391, - }) - } - _ => panic() - } - - let lifted394 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result393 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result393, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result387, - allowed_suffixes: array389, - min: lifted392, - max: lifted394, - }) - } - 31 => { - let array418 : Array[@types.UnionBranch] = [] - for index419 = 0 - index419 < mbt_ffi_load32(iter_base + 12) - index419 = index419 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index419 * 92 - - let result395 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted404 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result396 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result396) - } - 1 => { - let result397 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + 5 => { - @types.DiscriminatorRule::Suffix(result397) - } - 2 => { - let result398 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - @types.DiscriminatorRule::Contains(result398) - } - 3 => { - let result399 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } - @types.DiscriminatorRule::Regex(result399) - } - 4 => { - let result400 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted402 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result401 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result401) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result400, - literal: lifted402, - }) + } + _ => panic() } - 5 => { - let result403 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - @types.DiscriminatorRule::FieldAbsent(result403) - } - _ => panic() - } + } + 6 => { - let lifted406 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result405 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Option::Some(result405) - } - _ => panic() - } - - let array408 : Array[String] = [] - for index409 = 0 - index409 < mbt_ffi_load32(iter_base + 52) - index409 = index409 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index409 * 8 - - let result407 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array408.push(result407) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array411 : Array[String] = [] - for index412 = 0 - index412 < mbt_ffi_load32(iter_base + 60) - index412 = index412 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index412 * 8 - - let result410 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array411.push(result410) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted414 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result413 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } - Option::Some(result413) + } + _ => panic() } - _ => panic() - } - let lifted417 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted416 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result415 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result415) - } - _ => panic() - } - - Option::Some(lifted416) - } - _ => panic() - } - - array418.push(@types.UnionBranch::{ - tag: result395, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted404, - metadata: @types.MetadataEnvelope::{ - doc: lifted406, - aliases: array408, - examples: array411, - deprecated: lifted414, - role: lifted417, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array418, - }) - } - 32 => { - let lifted421 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result420 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result420) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted421, - }) - } - 33 => { - let lifted423 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result422 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result422) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted423, - }) - } - 34 => { - let lifted424 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted424) - } - 35 => { - let lifted425 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted425) } - _ => panic() - } + 7 => { - let lifted428 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result427 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Option::Some(result427) - } - _ => panic() - } - - let array430 : Array[String] = [] - for index431 = 0 - index431 < mbt_ffi_load32(iter_base + 104) - index431 = index431 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index431 * 8 - - let result429 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array430.push(result429) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array433 : Array[String] = [] - for index434 = 0 - index434 < mbt_ffi_load32(iter_base + 112) - index434 = index434 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index434 * 8 - - let result432 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array433.push(result432) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted436 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result435 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } - Option::Some(result435) - } - _ => panic() - } + } + _ => panic() + } - let lifted439 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted438 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result437 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result437) - } - _ => panic() - } - - Option::Some(lifted438) } - _ => panic() - } - - array440.push(@types.SchemaTypeNode::{ - body: lifted426, - metadata: @types.MetadataEnvelope::{ - doc: lifted428, - aliases: array430, - examples: array433, - deprecated: lifted436, - role: lifted439, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - - let array445 : Array[@types.SchemaTypeDef] = [] - for index446 = 0 - index446 < mbt_ffi_load32(result_ptr + 24) - index446 = index446 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 20) + index446 * 24 - - let result442 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted444 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result443 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + 8 => { - Option::Some(result443) - } - _ => panic() - } - - array445.push(@types.SchemaTypeDef::{ - id: result442, - name: lifted444, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - - let array476 : Array[@types.SchemaValueNode] = [] - for index477 = 0 - index477 < mbt_ffi_load32(result_ptr + 36) - index477 = index477 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 32) + index477 * 32 - - let lifted475 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result447 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result447) - } - 13 => { - let array448 : Array[Int] = [] - for index449 = 0 - index449 < mbt_ffi_load32(iter_base + 12) - index449 = index449 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index449 * 4 - - array448.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array448) - } - 14 => { - let lifted450 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted450, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array451 : Array[Bool] = [] - for index452 = 0 - index452 < mbt_ffi_load32(iter_base + 12) - index452 = index452 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index452 * 1 - - array451.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array451) - } - 17 => { - let array453 : Array[Int] = [] - for index454 = 0 - index454 < mbt_ffi_load32(iter_base + 12) - index454 = index454 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index454 * 4 - - array453.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array453) - } - 18 => { - let array455 : Array[Int] = [] - for index456 = 0 - index456 < mbt_ffi_load32(iter_base + 12) - index456 = index456 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index456 * 4 - - array455.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array455) - } - 19 => { - let array457 : Array[Int] = [] - for index458 = 0 - index458 < mbt_ffi_load32(iter_base + 12) - index458 = index458 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index458 * 4 - - array457.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array457) - } - 20 => { - let array459 : Array[@types.MapEntry] = [] - for index460 = 0 - index460 < mbt_ffi_load32(iter_base + 12) - index460 = index460 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index460 * 8 - - array459.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array459) - } - 21 => { - let lifted461 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted461) - } - 22 => { - let lifted464 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted462 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted462) - } - 1 => { - let lifted463 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted463) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted464) - } - 23 => { - let result465 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted467 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result466 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result466) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result465, - language: lifted467, - }) - } - 24 => { - let result468 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted470 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result469 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result469) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result468, - mime_type: lifted470, - }) - } - 25 => { - let result471 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } + + } + _ => panic() + } - @types.SchemaValueNode::PathValue(result471) - } - 26 => { - let result472 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result472) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result473 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result473, - }) } - 30 => { - let result474 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result474, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array476.push(lifted475) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 32)) - - @common.ToolError::CustomError(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array440, - defs: array445, - root: mbt_ffi_load32(result_ptr + 28), - }, - value: @types.SchemaValueTree::{ - value_nodes: array476, - root: mbt_ffi_load32(result_ptr + 40), - }, - }) - } - _ => panic() - } + 9 => { - RpcError::RemoteToolError(lifted478) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - Result::Err(lifted479) - } - _ => panic() - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } - lifted480 -} + } + _ => panic() + } -///| -pub fn ToolRpc::invoke( - self : ToolRpc, - command_path : Array[String], - input : @types.TypedSchemaValue, - stdin : @async-core.Stream[Byte]?, -) -> Result[Unit, RpcError] { - let cleanup_list : Array[Int] = [] - - let ToolRpc(handle) = self - - let address = mbt_ffi_malloc(command_path.length() * 8) - for index = 0; index < command_path.length(); index = index + 1 { - let iter_elem : String = command_path[index] - let iter_base = address + index * 8 - - let ptr = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr) - cleanup_list.push(ptr) - } - - let address360 = mbt_ffi_malloc(input.graph.type_nodes.length() * 144) - for index361 = 0 - index361 < input.graph.type_nodes.length() - index361 = index361 + 1 { - let iter_elem : @types.SchemaTypeNode = input.graph.type_nodes[index361] - let iter_base = address360 + index361 * 144 - - match iter_elem.body { - RefType(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store32(iter_base + 8, payload) - - () - } - BoolType => { - mbt_ffi_store8(iter_base + 0, 1) + } + 10 => { - () - } - S8Type(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload1 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } - () - } - Some(payload3) => { - mbt_ffi_store8(iter_base + 8, 1) + } + _ => panic() + } - match payload3.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + 11 => { - () - } - Some(payload5) => { - mbt_ffi_store8(iter_base + 16, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload5 { - Signed(payload6) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload6) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } - () - } - Unsigned(payload7) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload7.reinterpret_as_int64(), - ) + } + _ => panic() + } - () } - FloatBits(payload8) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload8.reinterpret_as_int64(), - ) + 12 => () + 13 => () + 14 => { - () - } - } + for index458 = 0; index458 < (mbt_ffi_load32((iter_base) + 12)); index458 = index458 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index458 * 68) - () - } - } + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => () + _ => panic() + } - match payload3.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => () + _ => panic() + } - () - } - Some(payload10) => { - mbt_ffi_store8(iter_base + 40, 1) + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { - match payload10 { - Signed(payload11) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload11) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => () + _ => panic() + } - () - } - Unsigned(payload12) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload12.reinterpret_as_int64(), - ) + } + _ => panic() + } - () - } - FloatBits(payload13) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload13.reinterpret_as_int64(), - ) + } - () } - } - - () - } - } - - match payload3.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + 15 => { - () - } - Some(payload15) => { - mbt_ffi_store8(iter_base + 64, 1) + for index459 = 0; index459 < (mbt_ffi_load32((iter_base) + 12)); index459 = index459 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index459 * 72) - let ptr16 = mbt_ffi_str2ptr(payload15) - mbt_ffi_store32(iter_base + 72, payload15.length()) - mbt_ffi_store32(iter_base + 68, ptr16) - cleanup_list.push(ptr16) + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => () + _ => panic() + } - () - } - } + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => () + _ => panic() + } - () - } - } + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { - () - } - S16Type(payload17) => { - mbt_ffi_store8(iter_base + 0, 3) + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => () + _ => panic() + } - match payload17 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + _ => panic() + } - () - } - Some(payload19) => { - mbt_ffi_store8(iter_base + 8, 1) + } - match payload19.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { - () - } - Some(payload21) => { - mbt_ffi_store8(iter_base + 16, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => () + _ => panic() + } - match payload21 { - Signed(payload22) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload22) + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => () + _ => panic() + } - () } - Unsigned(payload23) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload23.reinterpret_as_int64(), - ) + 25 => { - () - } - FloatBits(payload24) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload24.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => () + _ => panic() + } - () } - } + 26 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => () + _ => panic() + } - match payload19.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => () + _ => panic() + } - () - } - Some(payload26) => { - mbt_ffi_store8(iter_base + 40, 1) + } + 27 => { - match payload26 { - Signed(payload27) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload27) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => () + _ => panic() + } - () - } - Unsigned(payload28) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload28.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => () + _ => panic() + } - () } - FloatBits(payload29) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload29.reinterpret_as_int64(), - ) + 28 => () + 29 => () + 30 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => () + _ => panic() + } - () - } - } + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + _ => panic() + } - match payload19.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + } + 31 => { - () - } - Some(payload31) => { - mbt_ffi_store8(iter_base + 64, 1) + for index460 = 0; index460 < (mbt_ffi_load32((iter_base) + 12)); index460 = index460 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index460 * 92) - let ptr32 = mbt_ffi_str2ptr(payload31) - mbt_ffi_store32(iter_base + 72, payload31.length()) - mbt_ffi_store32(iter_base + 68, ptr32) - cleanup_list.push(ptr32) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => () + _ => panic() + } - () - } - } + } + 5 => () + _ => panic() + } - () - } - S32Type(payload33) => { - mbt_ffi_store8(iter_base + 0, 4) + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => () + _ => panic() + } - match payload33 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => () + _ => panic() + } - () - } - Some(payload35) => { - mbt_ffi_store8(iter_base + 8, 1) + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { - match payload35.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => () + _ => panic() + } - () - } - Some(payload37) => { - mbt_ffi_store8(iter_base + 16, 1) + } + _ => panic() + } - match payload37 { - Signed(payload38) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload38) + } - () } - Unsigned(payload39) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload39.reinterpret_as_int64(), - ) + 32 => { - () - } - FloatBits(payload40) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload40.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => () + _ => panic() + } - () } - } + 33 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => () + _ => panic() + } - match payload35.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + } + 34 => () + 35 => () + 36 => () + _ => panic() + } - () - } - Some(payload42) => { - mbt_ffi_store8(iter_base + 40, 1) + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => () + _ => panic() + } - match payload42 { - Signed(payload43) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload43) + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => () + _ => panic() + } - () - } - Unsigned(payload44) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload44.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { - () - } - FloatBits(payload45) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload45.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => () + _ => panic() + } - () } - } - - () - } + _ => panic() } - match payload35.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) - - () - } - Some(payload47) => { - mbt_ffi_store8(iter_base + 64, 1) + } - let ptr48 = mbt_ffi_str2ptr(payload47) - mbt_ffi_store32(iter_base + 72, payload47.length()) - mbt_ffi_store32(iter_base + 68, ptr48) - cleanup_list.push(ptr48) + for index462 = 0; index462 < (lower_arg451); index462 = index462 + 1 { + let iter_base = (lower_arg450) + (index462 * 24) - () - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => () + _ => panic() } - () - } - } - - () } - S64Type(payload49) => { - mbt_ffi_store8(iter_base + 0, 5) - match payload49 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + for index463 = 0; index463 < (lower_arg454); index463 = index463 + 1 { + let iter_base = (lower_arg453) + (index463 * 32) - () - } - Some(payload51) => { - mbt_ffi_store8(iter_base + 8, 1) + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => { - match payload51.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => () + _ => panic() + } - () - } - Some(payload53) => { - mbt_ffi_store8(iter_base + 16, 1) + } + 24 => { - match payload53 { - Signed(payload54) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload54) + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => () + _ => panic() + } - () } - Unsigned(payload55) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload55.reinterpret_as_int64(), - ) + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + _ => panic() + } - () - } - FloatBits(payload56) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload56.reinterpret_as_int64(), - ) + } - () - } - } + match (lower_arg456) { + 0 => () + 1 => { + wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamCommit(lower_arg457) - () - } } + _ => panic() + } + let ret = FutureInvokeResult::FutureInvokeResult(result) + mbt_ffi_free(address) + mbt_ffi_free(address361) + mbt_ffi_free(address367) + mbt_ffi_free(address441) - match payload51.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) - - () - } - Some(payload58) => { - mbt_ffi_store8(iter_base + 40, 1) + cleanup_list.each(mbt_ffi_free) + return ret - match payload58 { - Signed(payload59) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload59) +} +///| +pub async fn FutureInvokeResult::get(self : FutureInvokeResult) -> Result[@common.InvocationResult, RpcError] { - () - } - Unsigned(payload60) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload60.reinterpret_as_int64(), - ) + let FutureInvokeResult(handle) = self - () - } - FloatBits(payload61) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload61.reinterpret_as_int64(), - ) + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(48 * 1) + defer mbt_ffi_free(result_ptr) - () - } - } + let subtask_code = wasmImportMethodFutureInvokeResultGet(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, - () - } + fn(before_started) { + if before_started { + () + } else { + () } + } + , + fn() { - match payload51.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { - () - } - Some(payload63) => { - mbt_ffi_store8(iter_base + 64, 1) + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => { - let ptr64 = mbt_ffi_str2ptr(payload63) - mbt_ffi_store32(iter_base + 72, payload63.length()) - mbt_ffi_store32(iter_base + 68, ptr64) - cleanup_list.push(ptr64) + for index19 = 0; index19 < (mbt_ffi_load32((result_ptr) + 12)); index19 = index19 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 8)) + (index19 * 144) - () - } - } + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - U8Type(payload65) => { - mbt_ffi_store8(iter_base + 0, 6) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - match payload65 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + _ => panic() + } - () - } - Some(payload67) => { - mbt_ffi_store8(iter_base + 8, 1) + } + _ => panic() + } - match payload67.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + 3 => { - () - } - Some(payload69) => { - mbt_ffi_store8(iter_base + 16, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload69 { - Signed(payload70) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload70) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - Unsigned(payload71) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload71.reinterpret_as_int64(), - ) + } + _ => panic() + } - () - } - FloatBits(payload72) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload72.reinterpret_as_int64(), - ) + } + _ => panic() + } - () - } - } + } + 4 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload67.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - Some(payload74) => { - mbt_ffi_store8(iter_base + 40, 1) + } + _ => panic() + } - match payload74 { - Signed(payload75) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload75) + } + _ => panic() + } - () - } - Unsigned(payload76) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload76.reinterpret_as_int64(), - ) + } + 5 => { - () - } - FloatBits(payload77) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload77.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - } + } + _ => panic() + } - match payload67.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + } + _ => panic() + } - () - } - Some(payload79) => { - mbt_ffi_store8(iter_base + 64, 1) + } + 6 => { - let ptr80 = mbt_ffi_str2ptr(payload79) - mbt_ffi_store32(iter_base + 72, payload79.length()) - mbt_ffi_store32(iter_base + 68, ptr80) - cleanup_list.push(ptr80) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - } + } + _ => panic() + } - () - } - U16Type(payload81) => { - mbt_ffi_store8(iter_base + 0, 7) + } + _ => panic() + } - match payload81 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + 7 => { - () - } - Some(payload83) => { - mbt_ffi_store8(iter_base + 8, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload83.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - Some(payload85) => { - mbt_ffi_store8(iter_base + 16, 1) + } + _ => panic() + } - match payload85 { - Signed(payload86) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload86) + } + _ => panic() + } - () - } - Unsigned(payload87) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload87.reinterpret_as_int64(), - ) + } + 8 => { - () - } - FloatBits(payload88) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload88.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - } + } + _ => panic() + } - match payload83.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + } + _ => panic() + } - () - } - Some(payload90) => { - mbt_ffi_store8(iter_base + 40, 1) + } + 9 => { - match payload90 { - Signed(payload91) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload91) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Unsigned(payload92) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload92.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - FloatBits(payload93) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload93.reinterpret_as_int64(), - ) + } + _ => panic() + } - () - } - } + } + _ => panic() + } - () - } - } + } + 10 => { - match payload83.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload95) => { - mbt_ffi_store8(iter_base + 64, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr96 = mbt_ffi_str2ptr(payload95) - mbt_ffi_store32(iter_base + 72, payload95.length()) - mbt_ffi_store32(iter_base + 68, ptr96) - cleanup_list.push(ptr96) + } + _ => panic() + } - () - } - } + } + _ => panic() + } - () - } - } + } + 11 => { - () - } - U32Type(payload97) => { - mbt_ffi_store8(iter_base + 0, 8) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload97 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - Some(payload99) => { - mbt_ffi_store8(iter_base + 8, 1) + } + _ => panic() + } - match payload99.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + _ => panic() + } - () - } - Some(payload101) => { - mbt_ffi_store8(iter_base + 16, 1) + } + 12 => () + 13 => () + 14 => { + + for index1 = 0; index1 < (mbt_ffi_load32((iter_base) + 12)); index1 = index1 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index1 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index = 0; index < (mbt_ffi_load32((iter_base) + 28)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index0 = 0; index0 < (mbt_ffi_load32((iter_base) + 36)); index0 = index0 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index0 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - match payload101 { - Signed(payload102) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload102) + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - () - } - Unsigned(payload103) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload103.reinterpret_as_int64(), - ) + } + _ => panic() + } - () - } - FloatBits(payload104) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload104.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) - () - } - } + } + _ => panic() + } - match payload99.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + } + _ => panic() + } - () - } - Some(payload106) => { - mbt_ffi_store8(iter_base + 40, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index4 = 0; index4 < (mbt_ffi_load32((iter_base) + 12)); index4 = index4 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index4 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index2 = 0; index2 < (mbt_ffi_load32((iter_base) + 32)); index2 = index2 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index2 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload106 { - Signed(payload107) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload107) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index3 = 0; index3 < (mbt_ffi_load32((iter_base) + 40)); index3 = index3 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index3 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - () - } - Unsigned(payload108) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload108.reinterpret_as_int64(), - ) + } + _ => panic() + } - () - } - FloatBits(payload109) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload109.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - () - } - } + } + _ => panic() + } - match payload99.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + } + _ => panic() + } - () - } - Some(payload111) => { - mbt_ffi_store8(iter_base + 64, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let ptr112 = mbt_ffi_str2ptr(payload111) - mbt_ffi_store32(iter_base + 72, payload111.length()) - mbt_ffi_store32(iter_base + 68, ptr112) - cleanup_list.push(ptr112) + } + 16 => { - () - } - } + for index5 = 0; index5 < (mbt_ffi_load32((iter_base) + 12)); index5 = index5 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index5 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - U64Type(payload113) => { - mbt_ffi_store8(iter_base + 0, 9) + } + 17 => { - match payload113 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + for index6 = 0; index6 < (mbt_ffi_load32((iter_base) + 12)); index6 = index6 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index6 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload115) => { - mbt_ffi_store8(iter_base + 8, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload115.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Some(payload117) => { - mbt_ffi_store8(iter_base + 16, 1) + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { - match payload117 { - Signed(payload118) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload118) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Unsigned(payload119) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload119.reinterpret_as_int64(), - ) + for index7 = 0; index7 < (mbt_ffi_load32((iter_base) + 16)); index7 = index7 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index7 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - FloatBits(payload120) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload120.reinterpret_as_int64(), - ) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - } + } + _ => panic() + } - () - } - } + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - match payload115.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + } + _ => panic() + } - () - } - Some(payload122) => { - mbt_ffi_store8(iter_base + 40, 1) + } + 25 => { - match payload122 { - Signed(payload123) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload123) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Unsigned(payload124) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload124.reinterpret_as_int64(), - ) + for index8 = 0; index8 < (mbt_ffi_load32((iter_base) + 16)); index8 = index8 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index8 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - FloatBits(payload125) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload125.reinterpret_as_int64(), - ) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - } + } + _ => panic() + } - () - } - } + } + 26 => { - match payload115.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { - () - } - Some(payload127) => { - mbt_ffi_store8(iter_base + 64, 1) + for index9 = 0; index9 < (mbt_ffi_load32((iter_base) + 20)); index9 = index9 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index9 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr128 = mbt_ffi_str2ptr(payload127) - mbt_ffi_store32(iter_base + 72, payload127.length()) - mbt_ffi_store32(iter_base + 68, ptr128) - cleanup_list.push(ptr128) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - } + } + _ => panic() + } - () - } - } + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { - () - } - F32Type(payload129) => { - mbt_ffi_store8(iter_base + 0, 10) + for index10 = 0; index10 < (mbt_ffi_load32((iter_base) + 32)); index10 = index10 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index10 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload129 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () - } - Some(payload131) => { - mbt_ffi_store8(iter_base + 8, 1) + } + _ => panic() + } - match payload131.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + 27 => { - () - } - Some(payload133) => { - mbt_ffi_store8(iter_base + 16, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload133 { - Signed(payload134) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload134) + for index11 = 0; index11 < (mbt_ffi_load32((iter_base) + 16)); index11 = index11 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index11 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Unsigned(payload135) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload135.reinterpret_as_int64(), - ) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - FloatBits(payload136) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload136.reinterpret_as_int64(), - ) + } + _ => panic() + } - () - } - } + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { - () - } - } + for index12 = 0; index12 < (mbt_ffi_load32((iter_base) + 28)); index12 = index12 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index12 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload131.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - () - } - Some(payload138) => { - mbt_ffi_store8(iter_base + 40, 1) + } + _ => panic() + } - match payload138 { - Signed(payload139) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload139) + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Unsigned(payload140) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload140.reinterpret_as_int64(), - ) + for index13 = 0; index13 < (mbt_ffi_load32((iter_base) + 20)); index13 = index13 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index13 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - FloatBits(payload141) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload141.reinterpret_as_int64(), - ) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - } + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - () - } - } + } + _ => panic() + } - match payload131.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) - () - } - Some(payload143) => { - mbt_ffi_store8(iter_base + 64, 1) + } + _ => panic() + } - let ptr144 = mbt_ffi_str2ptr(payload143) - mbt_ffi_store32(iter_base + 72, payload143.length()) - mbt_ffi_store32(iter_base + 68, ptr144) - cleanup_list.push(ptr144) + } + 31 => { - () - } - } + for index16 = 0; index16 < (mbt_ffi_load32((iter_base) + 12)); index16 = index16 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index16 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - F64Type(payload145) => { - mbt_ffi_store8(iter_base + 0, 11) + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - match payload145 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - Some(payload147) => { - mbt_ffi_store8(iter_base + 8, 1) + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - match payload147.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index14 = 0; index14 < (mbt_ffi_load32((iter_base) + 52)); index14 = index14 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index14 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index15 = 0; index15 < (mbt_ffi_load32((iter_base) + 60)); index15 = index15 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index15 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index17 = 0; index17 < (mbt_ffi_load32((iter_base) + 104)); index17 = index17 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index17 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index18 = 0; index18 < (mbt_ffi_load32((iter_base) + 112)); index18 = index18 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index18 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } - () - } - Some(payload149) => { - mbt_ffi_store8(iter_base + 16, 1) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) - match payload149 { - Signed(payload150) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload150) + for index20 = 0; index20 < (mbt_ffi_load32((result_ptr) + 20)); index20 = index20 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 16)) + (index20 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Unsigned(payload151) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload151.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - FloatBits(payload152) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload152.reinterpret_as_int64(), - ) + } + _ => panic() + } - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 16)) + + for index21 = 0; index21 < (mbt_ffi_load32((result_ptr) + 32)); index21 = index21 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 28)) + (index21 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => { + @types.Secret::Secret(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 32 => { + @types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 33 => { + @types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8)).drop() + + } + _ => panic() + } - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 28)) - match payload147.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + } + _ => panic() + } - () - } - Some(payload154) => { - mbt_ffi_store8(iter_base + 40, 1) + match (mbt_ffi_load8_u((result_ptr) + 40)) { + 0 => () + 1 => { + let result = wasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamLift(mbt_ffi_load32((result_ptr) + 44)) + result.drop_sync() - match payload154 { - Signed(payload155) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload155) + } + _ => panic() + } - () } - Unsigned(payload156) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload156.reinterpret_as_int64(), - ) + 1 => { - () - } - FloatBits(payload157) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload157.reinterpret_as_int64(), - ) + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) - () - } - } + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) - () - } - } + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) - match payload147.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) - () - } - Some(payload159) => { - mbt_ffi_store8(iter_base + 64, 1) + } + 4 => { - let ptr160 = mbt_ffi_str2ptr(payload159) - mbt_ffi_store32(iter_base + 72, payload159.length()) - mbt_ffi_store32(iter_base + 68, ptr160) - cleanup_list.push(ptr160) + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) - () - } - } + } + 1 => { - () - } - } + for index22 = 0; index22 < (mbt_ffi_load32((result_ptr) + 16)); index22 = index22 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 12)) + (index22 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - CharType => { - mbt_ffi_store8(iter_base + 0, 12) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) - () - } - StringType => { - mbt_ffi_store8(iter_base + 0, 13) + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) - () - } - RecordType(payload163) => { - mbt_ffi_store8(iter_base + 0, 14) - - let address184 = mbt_ffi_malloc(payload163.length() * 68) - for index185 = 0 - index185 < payload163.length() - index185 = index185 + 1 { - let iter_elem : @types.NamedFieldType = payload163[index185] - let iter_base = address184 + index185 * 68 - - let ptr164 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr164) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 12, 0) + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) - () - } - Some(payload166) => { - mbt_ffi_store8(iter_base + 12, 1) + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) - let ptr167 = mbt_ffi_str2ptr(payload166) - mbt_ffi_store32(iter_base + 20, payload166.length()) - mbt_ffi_store32(iter_base + 16, ptr167) - cleanup_list.push(ptr167) + } + 5 => { - () - } - } - - let address169 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index170 = 0 - index170 < iter_elem.metadata.aliases.length() - index170 = index170 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index170] - let iter_base = address169 + index170 * 8 - - let ptr168 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr168) - cleanup_list.push(ptr168) - } - mbt_ffi_store32(iter_base + 28, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 24, address169) - - let address172 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index173 = 0 - index173 < iter_elem.metadata.examples.length() - index173 = index173 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index173] - let iter_base = address172 + index173 * 8 - - let ptr171 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr171) - cleanup_list.push(ptr171) - } - mbt_ffi_store32(iter_base + 36, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 32, address172) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 40, 0) + for index43 = 0; index43 < (mbt_ffi_load32((result_ptr) + 16)); index43 = index43 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 12)) + (index43 * 144) - () - } - Some(payload175) => { - mbt_ffi_store8(iter_base + 40, 1) + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => { - let ptr176 = mbt_ffi_str2ptr(payload175) - mbt_ffi_store32(iter_base + 48, payload175.length()) - mbt_ffi_store32(iter_base + 44, ptr176) - cleanup_list.push(ptr176) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 52, 0) + } + _ => panic() + } - () - } - Some(payload178) => { - mbt_ffi_store8(iter_base + 52, 1) + } + _ => panic() + } - match payload178 { - Multimodal => { - mbt_ffi_store8(iter_base + 56, 0) + } + 3 => { - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 56, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 56, 2) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - Other(payload182) => { - mbt_ffi_store8(iter_base + 56, 3) + } + _ => panic() + } - let ptr183 = mbt_ffi_str2ptr(payload182) - mbt_ffi_store32(iter_base + 64, payload182.length()) - mbt_ffi_store32(iter_base + 60, ptr183) - cleanup_list.push(ptr183) + } + _ => panic() + } - () - } - } + } + 4 => { - () - } - } - cleanup_list.push(ptr164) - cleanup_list.push(address169) - cleanup_list.push(address172) - } - mbt_ffi_store32(iter_base + 12, payload163.length()) - mbt_ffi_store32(iter_base + 8, address184) - cleanup_list.push(address184) - - () - } - VariantType(payload186) => { - mbt_ffi_store8(iter_base + 0, 15) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - let address209 = mbt_ffi_malloc(payload186.length() * 72) - for index210 = 0 - index210 < payload186.length() - index210 = index210 + 1 { - let iter_elem : @types.VariantCaseType = payload186[index210] - let iter_base = address209 + index210 * 72 + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr187 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr187) + } + _ => panic() + } - match iter_elem.payload { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + _ => panic() + } - () - } - Some(payload189) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload189) + } + 5 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 16, 0) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - Some(payload191) => { - mbt_ffi_store8(iter_base + 16, 1) + } + _ => panic() + } - let ptr192 = mbt_ffi_str2ptr(payload191) - mbt_ffi_store32(iter_base + 24, payload191.length()) - mbt_ffi_store32(iter_base + 20, ptr192) - cleanup_list.push(ptr192) + } + _ => panic() + } - () - } - } - - let address194 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index195 = 0 - index195 < iter_elem.metadata.aliases.length() - index195 = index195 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index195] - let iter_base = address194 + index195 * 8 - - let ptr193 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr193) - cleanup_list.push(ptr193) - } - mbt_ffi_store32(iter_base + 32, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 28, address194) - - let address197 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index198 = 0 - index198 < iter_elem.metadata.examples.length() - index198 = index198 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index198] - let iter_base = address197 + index198 * 8 - - let ptr196 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr196) - cleanup_list.push(ptr196) - } - mbt_ffi_store32(iter_base + 40, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 36, address197) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 44, 0) + } + 6 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Some(payload200) => { - mbt_ffi_store8(iter_base + 44, 1) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr201 = mbt_ffi_str2ptr(payload200) - mbt_ffi_store32(iter_base + 52, payload200.length()) - mbt_ffi_store32(iter_base + 48, ptr201) - cleanup_list.push(ptr201) + } + _ => panic() + } - () - } - } + } + _ => panic() + } - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 56, 0) + } + 7 => { - () - } - Some(payload203) => { - mbt_ffi_store8(iter_base + 56, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload203 { - Multimodal => { - mbt_ffi_store8(iter_base + 60, 0) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 60, 1) + } + _ => panic() + } - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 60, 2) + } + _ => panic() + } - () - } - Other(payload207) => { - mbt_ffi_store8(iter_base + 60, 3) + } + 8 => { - let ptr208 = mbt_ffi_str2ptr(payload207) - mbt_ffi_store32(iter_base + 68, payload207.length()) - mbt_ffi_store32(iter_base + 64, ptr208) - cleanup_list.push(ptr208) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - } + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - } - cleanup_list.push(ptr187) - cleanup_list.push(address194) - cleanup_list.push(address197) - } - mbt_ffi_store32(iter_base + 12, payload186.length()) - mbt_ffi_store32(iter_base + 8, address209) - cleanup_list.push(address209) - - () - } - EnumType(payload211) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address213 = mbt_ffi_malloc(payload211.length() * 8) - for index214 = 0 - index214 < payload211.length() - index214 = index214 + 1 { - let iter_elem : String = payload211[index214] - let iter_base = address213 + index214 * 8 - - let ptr212 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr212) - cleanup_list.push(ptr212) - } - mbt_ffi_store32(iter_base + 12, payload211.length()) - mbt_ffi_store32(iter_base + 8, address213) - cleanup_list.push(address213) - - () - } - FlagsType(payload215) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address217 = mbt_ffi_malloc(payload215.length() * 8) - for index218 = 0 - index218 < payload215.length() - index218 = index218 + 1 { - let iter_elem : String = payload215[index218] - let iter_base = address217 + index218 * 8 - - let ptr216 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr216) - cleanup_list.push(ptr216) - } - mbt_ffi_store32(iter_base + 12, payload215.length()) - mbt_ffi_store32(iter_base + 8, address217) - cleanup_list.push(address217) - - () - } - TupleType(payload219) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address220 = mbt_ffi_malloc(payload219.length() * 4) - for index221 = 0 - index221 < payload219.length() - index221 = index221 + 1 { - let iter_elem : Int = payload219[index221] - let iter_base = address220 + index221 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload219.length()) - mbt_ffi_store32(iter_base + 8, address220) - cleanup_list.push(address220) - - () - } - ListType(payload222) => { - mbt_ffi_store8(iter_base + 0, 19) - mbt_ffi_store32(iter_base + 8, payload222) + } + _ => panic() + } - () - } - FixedListType(payload223) => { - mbt_ffi_store8(iter_base + 0, 20) - mbt_ffi_store32(iter_base + 8, payload223.element) - mbt_ffi_store32(iter_base + 12, payload223.length.reinterpret_as_int()) + } + _ => panic() + } - () - } - MapType(payload224) => { - mbt_ffi_store8(iter_base + 0, 21) - mbt_ffi_store32(iter_base + 8, payload224.key) - mbt_ffi_store32(iter_base + 12, payload224.value) + } + 9 => { - () - } - OptionType(payload225) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store32(iter_base + 8, payload225) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - ResultType(payload226) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload226.ok { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload228) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload228) - - () - } - } - - match payload226.err { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload230) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload230) - - () - } - } - - () - } - TextType(payload231) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload231.languages { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload233) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address235 = mbt_ffi_malloc(payload233.length() * 8) - for index236 = 0 - index236 < payload233.length() - index236 = index236 + 1 { - let iter_elem : String = payload233[index236] - let iter_base = address235 + index236 * 8 - - let ptr234 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr234) - cleanup_list.push(ptr234) - } - mbt_ffi_store32(iter_base + 16, payload233.length()) - mbt_ffi_store32(iter_base + 12, address235) - cleanup_list.push(address235) - - () - } - } - - match payload231.min_length { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload238) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload238.reinterpret_as_int()) - - () - } - } - - match payload231.max_length { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload240) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload240.reinterpret_as_int()) - - () - } - } - - match payload231.regex { - None => { - mbt_ffi_store8(iter_base + 36, 0) - - () - } - Some(payload242) => { - mbt_ffi_store8(iter_base + 36, 1) - - let ptr243 = mbt_ffi_str2ptr(payload242) - mbt_ffi_store32(iter_base + 44, payload242.length()) - mbt_ffi_store32(iter_base + 40, ptr243) - cleanup_list.push(ptr243) - - () - } - } - - () - } - BinaryType(payload244) => { - mbt_ffi_store8(iter_base + 0, 25) - - match payload244.mime_types { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload246) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address248 = mbt_ffi_malloc(payload246.length() * 8) - for index249 = 0 - index249 < payload246.length() - index249 = index249 + 1 { - let iter_elem : String = payload246[index249] - let iter_base = address248 + index249 * 8 - - let ptr247 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr247) - cleanup_list.push(ptr247) - } - mbt_ffi_store32(iter_base + 16, payload246.length()) - mbt_ffi_store32(iter_base + 12, address248) - cleanup_list.push(address248) - - () - } - } - - match payload244.min_bytes { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload251) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload251.reinterpret_as_int()) - - () - } - } - - match payload244.max_bytes { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload253) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload253.reinterpret_as_int()) - - () - } - } - - () - } - PathType(payload254) => { - mbt_ffi_store8(iter_base + 0, 26) - mbt_ffi_store8(iter_base + 8, payload254.direction.ordinal()) - mbt_ffi_store8(iter_base + 9, payload254.kind.ordinal()) - - match payload254.allowed_mime_types { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload256) => { - mbt_ffi_store8(iter_base + 12, 1) - - let address258 = mbt_ffi_malloc(payload256.length() * 8) - for index259 = 0 - index259 < payload256.length() - index259 = index259 + 1 { - let iter_elem : String = payload256[index259] - let iter_base = address258 + index259 * 8 - - let ptr257 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr257) - cleanup_list.push(ptr257) - } - mbt_ffi_store32(iter_base + 20, payload256.length()) - mbt_ffi_store32(iter_base + 16, address258) - cleanup_list.push(address258) - - () - } - } - - match payload254.allowed_extensions { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload261) => { - mbt_ffi_store8(iter_base + 24, 1) - - let address263 = mbt_ffi_malloc(payload261.length() * 8) - for index264 = 0 - index264 < payload261.length() - index264 = index264 + 1 { - let iter_elem : String = payload261[index264] - let iter_base = address263 + index264 * 8 - - let ptr262 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr262) - cleanup_list.push(ptr262) - } - mbt_ffi_store32(iter_base + 32, payload261.length()) - mbt_ffi_store32(iter_base + 28, address263) - cleanup_list.push(address263) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - } + } + _ => panic() + } - () - } - UrlType(payload265) => { - mbt_ffi_store8(iter_base + 0, 27) - - match payload265.allowed_schemes { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload267) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address269 = mbt_ffi_malloc(payload267.length() * 8) - for index270 = 0 - index270 < payload267.length() - index270 = index270 + 1 { - let iter_elem : String = payload267[index270] - let iter_base = address269 + index270 * 8 - - let ptr268 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr268) - cleanup_list.push(ptr268) - } - mbt_ffi_store32(iter_base + 16, payload267.length()) - mbt_ffi_store32(iter_base + 12, address269) - cleanup_list.push(address269) - - () - } - } - - match payload265.allowed_hosts { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload272) => { - mbt_ffi_store8(iter_base + 20, 1) - - let address274 = mbt_ffi_malloc(payload272.length() * 8) - for index275 = 0 - index275 < payload272.length() - index275 = index275 + 1 { - let iter_elem : String = payload272[index275] - let iter_base = address274 + index275 * 8 - - let ptr273 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr273) - cleanup_list.push(ptr273) - } - mbt_ffi_store32(iter_base + 28, payload272.length()) - mbt_ffi_store32(iter_base + 24, address274) - cleanup_list.push(address274) + } + _ => panic() + } - () - } - } + } + 10 => { - () - } - DatetimeType => { - mbt_ffi_store8(iter_base + 0, 28) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - DurationType => { - mbt_ffi_store8(iter_base + 0, 29) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - () - } - QuantityType(payload278) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr279 = mbt_ffi_str2ptr(payload278.base_unit) - mbt_ffi_store32(iter_base + 12, payload278.base_unit.length()) - mbt_ffi_store32(iter_base + 8, ptr279) - - let address281 = mbt_ffi_malloc( - payload278.allowed_suffixes.length() * 8, - ) - for index282 = 0 - index282 < payload278.allowed_suffixes.length() - index282 = index282 + 1 { - let iter_elem : String = payload278.allowed_suffixes[index282] - let iter_base = address281 + index282 * 8 - - let ptr280 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr280) - cleanup_list.push(ptr280) - } - mbt_ffi_store32(iter_base + 20, payload278.allowed_suffixes.length()) - mbt_ffi_store32(iter_base + 16, address281) - - match payload278.min { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload284) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload284.mantissa) - mbt_ffi_store32(iter_base + 40, payload284.scale) - - let ptr285 = mbt_ffi_str2ptr(payload284.unit) - mbt_ffi_store32(iter_base + 48, payload284.unit.length()) - mbt_ffi_store32(iter_base + 44, ptr285) - cleanup_list.push(ptr285) - - () - } - } - - match payload278.max { - None => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - Some(payload287) => { - mbt_ffi_store8(iter_base + 56, 1) - mbt_ffi_store64(iter_base + 64, payload287.mantissa) - mbt_ffi_store32(iter_base + 72, payload287.scale) - - let ptr288 = mbt_ffi_str2ptr(payload287.unit) - mbt_ffi_store32(iter_base + 80, payload287.unit.length()) - mbt_ffi_store32(iter_base + 76, ptr288) - cleanup_list.push(ptr288) - - () - } - } - cleanup_list.push(ptr279) - cleanup_list.push(address281) - - () - } - UnionType(payload289) => { - mbt_ffi_store8(iter_base + 0, 31) - - let address325 = mbt_ffi_malloc(payload289.branches.length() * 92) - for index326 = 0 - index326 < payload289.branches.length() - index326 = index326 + 1 { - let iter_elem : @types.UnionBranch = payload289.branches[index326] - let iter_base = address325 + index326 * 92 - - let ptr290 = mbt_ffi_str2ptr(iter_elem.tag) - mbt_ffi_store32(iter_base + 4, iter_elem.tag.length()) - mbt_ffi_store32(iter_base + 0, ptr290) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.discriminator { - Prefix(payload291) => { - mbt_ffi_store8(iter_base + 12, 0) - - let ptr292 = mbt_ffi_str2ptr(payload291) - mbt_ffi_store32(iter_base + 20, payload291.length()) - mbt_ffi_store32(iter_base + 16, ptr292) - cleanup_list.push(ptr292) - - () - } - Suffix(payload293) => { - mbt_ffi_store8(iter_base + 12, 1) + } + _ => panic() + } - let ptr294 = mbt_ffi_str2ptr(payload293) - mbt_ffi_store32(iter_base + 20, payload293.length()) - mbt_ffi_store32(iter_base + 16, ptr294) - cleanup_list.push(ptr294) + } + _ => panic() + } - () - } - Contains(payload295) => { - mbt_ffi_store8(iter_base + 12, 2) + } + 11 => { - let ptr296 = mbt_ffi_str2ptr(payload295) - mbt_ffi_store32(iter_base + 20, payload295.length()) - mbt_ffi_store32(iter_base + 16, ptr296) - cleanup_list.push(ptr296) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - Regex(payload297) => { - mbt_ffi_store8(iter_base + 12, 3) + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) - let ptr298 = mbt_ffi_str2ptr(payload297) - mbt_ffi_store32(iter_base + 20, payload297.length()) - mbt_ffi_store32(iter_base + 16, ptr298) - cleanup_list.push(ptr298) + } + _ => panic() + } - () - } - FieldEquals(payload299) => { - mbt_ffi_store8(iter_base + 12, 4) + } + _ => panic() + } - let ptr300 = mbt_ffi_str2ptr(payload299.field_name) - mbt_ffi_store32(iter_base + 20, payload299.field_name.length()) - mbt_ffi_store32(iter_base + 16, ptr300) + } + 12 => () + 13 => () + 14 => { + + for index25 = 0; index25 < (mbt_ffi_load32((iter_base) + 12)); index25 = index25 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index25 * 68) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + for index23 = 0; index23 < (mbt_ffi_load32((iter_base) + 28)); index23 = index23 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index23 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) + + for index24 = 0; index24 < (mbt_ffi_load32((iter_base) + 36)); index24 = index24 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index24 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - match payload299.literal { - None => { - mbt_ffi_store8(iter_base + 24, 0) + match (mbt_ffi_load8_u((iter_base) + 40)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - () - } - Some(payload302) => { - mbt_ffi_store8(iter_base + 24, 1) + } + _ => panic() + } - let ptr303 = mbt_ffi_str2ptr(payload302) - mbt_ffi_store32(iter_base + 32, payload302.length()) - mbt_ffi_store32(iter_base + 28, ptr303) - cleanup_list.push(ptr303) + match (mbt_ffi_load8_u((iter_base) + 52)) { + 0 => () + 1 => { - () - } - } - cleanup_list.push(ptr300) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 60)) - () - } - FieldAbsent(payload304) => { - mbt_ffi_store8(iter_base + 12, 5) + } + _ => panic() + } - let ptr305 = mbt_ffi_str2ptr(payload304) - mbt_ffi_store32(iter_base + 20, payload304.length()) - mbt_ffi_store32(iter_base + 16, ptr305) - cleanup_list.push(ptr305) + } + _ => panic() + } - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 15 => { + + for index28 = 0; index28 < (mbt_ffi_load32((iter_base) + 12)); index28 = index28 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index28 * 72) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + for index26 = 0; index26 < (mbt_ffi_load32((iter_base) + 32)); index26 = index26 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index26 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 36, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + for index27 = 0; index27 < (mbt_ffi_load32((iter_base) + 40)); index27 = index27 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index27 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) + + match (mbt_ffi_load8_u((iter_base) + 44)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - () - } - Some(payload307) => { - mbt_ffi_store8(iter_base + 36, 1) + } + _ => panic() + } - let ptr308 = mbt_ffi_str2ptr(payload307) - mbt_ffi_store32(iter_base + 44, payload307.length()) - mbt_ffi_store32(iter_base + 40, ptr308) - cleanup_list.push(ptr308) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { - () - } - } - - let address310 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index311 = 0 - index311 < iter_elem.metadata.aliases.length() - index311 = index311 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index311] - let iter_base = address310 + index311 * 8 - - let ptr309 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr309) - cleanup_list.push(ptr309) - } - mbt_ffi_store32(iter_base + 52, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 48, address310) - - let address313 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index314 = 0 - index314 < iter_elem.metadata.examples.length() - index314 = index314 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index314] - let iter_base = address313 + index314 * 8 - - let ptr312 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr312) - cleanup_list.push(ptr312) - } - mbt_ffi_store32(iter_base + 60, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 56, address313) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 64, 0) + match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 64)) - () - } - Some(payload316) => { - mbt_ffi_store8(iter_base + 64, 1) + } + _ => panic() + } - let ptr317 = mbt_ffi_str2ptr(payload316) - mbt_ffi_store32(iter_base + 72, payload316.length()) - mbt_ffi_store32(iter_base + 68, ptr317) - cleanup_list.push(ptr317) + } + _ => panic() + } - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 76, 0) + } + 16 => { - () - } - Some(payload319) => { - mbt_ffi_store8(iter_base + 76, 1) + for index29 = 0; index29 < (mbt_ffi_load32((iter_base) + 12)); index29 = index29 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index29 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - match payload319 { - Multimodal => { - mbt_ffi_store8(iter_base + 80, 0) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 80, 1) + } + 17 => { - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 80, 2) + for index30 = 0; index30 < (mbt_ffi_load32((iter_base) + 12)); index30 = index30 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index30 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Other(payload323) => { - mbt_ffi_store8(iter_base + 80, 3) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let ptr324 = mbt_ffi_str2ptr(payload323) - mbt_ffi_store32(iter_base + 88, payload323.length()) - mbt_ffi_store32(iter_base + 84, ptr324) - cleanup_list.push(ptr324) + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } + } + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => { - () - } - } - cleanup_list.push(ptr290) - cleanup_list.push(address310) - cleanup_list.push(address313) - } - mbt_ffi_store32(iter_base + 12, payload289.branches.length()) - mbt_ffi_store32(iter_base + 8, address325) - cleanup_list.push(address325) - - () - } - SecretType(payload327) => { - mbt_ffi_store8(iter_base + 0, 32) - mbt_ffi_store32(iter_base + 8, payload327.inner) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - match payload327.category { - None => { - mbt_ffi_store8(iter_base + 12, 0) + for index31 = 0; index31 < (mbt_ffi_load32((iter_base) + 16)); index31 = index31 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index31 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - Some(payload329) => { - mbt_ffi_store8(iter_base + 12, 1) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - let ptr330 = mbt_ffi_str2ptr(payload329) - mbt_ffi_store32(iter_base + 20, payload329.length()) - mbt_ffi_store32(iter_base + 16, ptr330) - cleanup_list.push(ptr330) + } + _ => panic() + } - () - } - } + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) - () - } - QuotaTokenType(payload331) => { - mbt_ffi_store8(iter_base + 0, 33) + } + _ => panic() + } - match payload331.resource_name { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + 25 => { - () - } - Some(payload333) => { - mbt_ffi_store8(iter_base + 8, 1) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - let ptr334 = mbt_ffi_str2ptr(payload333) - mbt_ffi_store32(iter_base + 16, payload333.length()) - mbt_ffi_store32(iter_base + 12, ptr334) - cleanup_list.push(ptr334) + for index32 = 0; index32 < (mbt_ffi_load32((iter_base) + 16)); index32 = index32 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index32 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - FutureType(payload335) => { - mbt_ffi_store8(iter_base + 0, 34) + } + _ => panic() + } - match payload335 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + 26 => { - () - } - Some(payload337) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload337) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { - () - } - } + for index33 = 0; index33 < (mbt_ffi_load32((iter_base) + 20)); index33 = index33 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index33 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - StreamType(payload338) => { - mbt_ffi_store8(iter_base + 0, 35) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - match payload338 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + } + _ => panic() + } - () - } - Some(payload340) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload340) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { - () - } - } + for index34 = 0; index34 < (mbt_ffi_load32((iter_base) + 32)); index34 = index34 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index34 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - } + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 88, 0) + } + _ => panic() + } - () - } - Some(payload342) => { - mbt_ffi_store8(iter_base + 88, 1) + } + 27 => { - let ptr343 = mbt_ffi_str2ptr(payload342) - mbt_ffi_store32(iter_base + 96, payload342.length()) - mbt_ffi_store32(iter_base + 92, ptr343) - cleanup_list.push(ptr343) + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { - () - } - } - - let address345 = mbt_ffi_malloc(iter_elem.metadata.aliases.length() * 8) - for index346 = 0 - index346 < iter_elem.metadata.aliases.length() - index346 = index346 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index346] - let iter_base = address345 + index346 * 8 - - let ptr344 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr344) - cleanup_list.push(ptr344) - } - mbt_ffi_store32(iter_base + 104, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 100, address345) - - let address348 = mbt_ffi_malloc(iter_elem.metadata.examples.length() * 8) - for index349 = 0 - index349 < iter_elem.metadata.examples.length() - index349 = index349 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index349] - let iter_base = address348 + index349 * 8 - - let ptr347 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr347) - cleanup_list.push(ptr347) - } - mbt_ffi_store32(iter_base + 112, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 108, address348) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 116, 0) - - () - } - Some(payload351) => { - mbt_ffi_store8(iter_base + 116, 1) + for index35 = 0; index35 < (mbt_ffi_load32((iter_base) + 16)); index35 = index35 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index35 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr352 = mbt_ffi_str2ptr(payload351) - mbt_ffi_store32(iter_base + 124, payload351.length()) - mbt_ffi_store32(iter_base + 120, ptr352) - cleanup_list.push(ptr352) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - } + } + _ => panic() + } - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 128, 0) + match (mbt_ffi_load8_u((iter_base) + 20)) { + 0 => () + 1 => { - () - } - Some(payload354) => { - mbt_ffi_store8(iter_base + 128, 1) - - match payload354 { - Multimodal => { - mbt_ffi_store8(iter_base + 132, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 132, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 132, 2) - - () - } - Other(payload358) => { - mbt_ffi_store8(iter_base + 132, 3) - - let ptr359 = mbt_ffi_str2ptr(payload358) - mbt_ffi_store32(iter_base + 140, payload358.length()) - mbt_ffi_store32(iter_base + 136, ptr359) - cleanup_list.push(ptr359) - - () - } - } - - () - } - } - cleanup_list.push(address345) - cleanup_list.push(address348) - } - - let address366 = mbt_ffi_malloc(input.graph.defs.length() * 24) - for index367 = 0 - index367 < input.graph.defs.length() - index367 = index367 + 1 { - let iter_elem : @types.SchemaTypeDef = input.graph.defs[index367] - let iter_base = address366 + index367 * 24 - - let ptr362 = mbt_ffi_str2ptr(iter_elem.id) - mbt_ffi_store32(iter_base + 4, iter_elem.id.length()) - mbt_ffi_store32(iter_base + 0, ptr362) - - match iter_elem.name { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload364) => { - mbt_ffi_store8(iter_base + 8, 1) + for index36 = 0; index36 < (mbt_ffi_load32((iter_base) + 28)); index36 = index36 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index36 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - let ptr365 = mbt_ffi_str2ptr(payload364) - mbt_ffi_store32(iter_base + 16, payload364.length()) - mbt_ffi_store32(iter_base + 12, ptr365) - cleanup_list.push(ptr365) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - () - } - } - mbt_ffi_store32(iter_base + 20, iter_elem.body) - cleanup_list.push(ptr362) - } - - let address438 = mbt_ffi_malloc(input.value.value_nodes.length() * 32) - for index439 = 0 - index439 < input.value.value_nodes.length() - index439 = index439 + 1 { - let iter_elem : @types.SchemaValueNode = input.value.value_nodes[index439] - let iter_base = address438 + index439 * 32 - - match iter_elem { - BoolValue(payload368) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload368 { 1 } else { 0 }) - - () - } - S8Value(payload369) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload369)) + } + _ => panic() + } - () - } - S16Value(payload370) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload370)) + } + 28 => () + 29 => () + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - S32Value(payload371) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload371) + for index37 = 0; index37 < (mbt_ffi_load32((iter_base) + 20)); index37 = index37 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index37 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - S64Value(payload372) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload372) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - U8Value(payload373) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload373.to_int()) + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 44)) - () - } - U16Value(payload374) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload374.reinterpret_as_int()) + } + _ => panic() + } - () - } - U32Value(payload375) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload375.reinterpret_as_int()) + match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 76)) - () - } - U64Value(payload376) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload376.reinterpret_as_int64()) + } + _ => panic() + } - () - } - F32Value(payload377) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload377) + } + 31 => { - () - } - F64Value(payload378) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload378) + for index40 = 0; index40 < (mbt_ffi_load32((iter_base) + 12)); index40 = index40 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index40 * 92) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) - () - } - CharValue(payload379) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload379.to_int()) + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - StringValue(payload380) => { - mbt_ffi_store8(iter_base + 0, 12) + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let ptr381 = mbt_ffi_str2ptr(payload380) - mbt_ffi_store32(iter_base + 12, payload380.length()) - mbt_ffi_store32(iter_base + 8, ptr381) - cleanup_list.push(ptr381) + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - RecordValue(payload382) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address383 = mbt_ffi_malloc(payload382.length() * 4) - for index384 = 0 - index384 < payload382.length() - index384 = index384 + 1 { - let iter_elem : Int = payload382[index384] - let iter_base = address383 + index384 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload382.length()) - mbt_ffi_store32(iter_base + 8, address383) - cleanup_list.push(address383) - - () - } - VariantValue(payload385) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload385.case.reinterpret_as_int()) + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - match payload385.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + } + 4 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 36)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 40)) + + } + _ => panic() + } + + for index38 = 0; index38 < (mbt_ffi_load32((iter_base) + 52)); index38 = index38 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index38 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + for index39 = 0; index39 < (mbt_ffi_load32((iter_base) + 60)); index39 = index39 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index39 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) + + match (mbt_ffi_load8_u((iter_base) + 64)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 68)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 76)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 84)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 32 => { + + match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) + + } + _ => panic() + } + + } + 33 => { + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + 34 => () + 35 => () + 36 => () + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 88)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 92)) + + } + _ => panic() + } + + for index41 = 0; index41 < (mbt_ffi_load32((iter_base) + 104)); index41 = index41 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index41 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) + + for index42 = 0; index42 < (mbt_ffi_load32((iter_base) + 112)); index42 = index42 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index42 * 8) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) + + match (mbt_ffi_load8_u((iter_base) + 116)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 120)) + + } + _ => panic() + } + + match (mbt_ffi_load8_u((iter_base) + 128)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => () + 1 => () + 2 => () + 3 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 136)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + for index44 = 0; index44 < (mbt_ffi_load32((result_ptr) + 24)); index44 = index44 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 20)) + (index44 * 24) + mbt_ffi_free(mbt_ffi_load32((iter_base) + 0)) + + match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) + + for index45 = 0; index45 < (mbt_ffi_load32((result_ptr) + 36)); index45 = index45 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 32)) + (index45 * 32) + + match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 13 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 14 => () + 15 => () + 16 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 17 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 18 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 19 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 20 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 21 => () + 22 => () + 23 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 24 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + match (mbt_ffi_load8_u((iter_base) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + _ => panic() + } + + } + 25 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 26 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 27 => () + 28 => () + 29 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 20)) + + } + 30 => { + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + } + 31 => { + @types.Secret::Secret(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 32 => { + @types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8)).drop() + + } + 33 => { + @types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8)).drop() + + } + _ => panic() + } + + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 32)) + + } + _ => panic() + } - () - } - Some(payload387) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload387) + } + _ => panic() + } - () - } - } + } + _ => panic() + } - () - } - EnumValue(payload388) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload388.reinterpret_as_int()) + }, + ) - () - } - FlagsValue(payload389) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address390 = mbt_ffi_malloc(payload389.length() * 1) - for index391 = 0 - index391 < payload389.length() - index391 = index391 + 1 { - let iter_elem : Bool = payload389[index391] - let iter_base = address390 + index391 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload389.length()) - mbt_ffi_store32(iter_base + 8, address390) - cleanup_list.push(address390) - - () - } - TupleValue(payload392) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address393 = mbt_ffi_malloc(payload392.length() * 4) - for index394 = 0 - index394 < payload392.length() - index394 = index394 + 1 { - let iter_elem : Int = payload392[index394] - let iter_base = address393 + index394 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload392.length()) - mbt_ffi_store32(iter_base + 8, address393) - cleanup_list.push(address393) - - () - } - ListValue(payload395) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address396 = mbt_ffi_malloc(payload395.length() * 4) - for index397 = 0 - index397 < payload395.length() - index397 = index397 + 1 { - let iter_elem : Int = payload395[index397] - let iter_base = address396 + index397 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload395.length()) - mbt_ffi_store32(iter_base + 8, address396) - cleanup_list.push(address396) - - () - } - FixedListValue(payload398) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address399 = mbt_ffi_malloc(payload398.length() * 4) - for index400 = 0 - index400 < payload398.length() - index400 = index400 + 1 { - let iter_elem : Int = payload398[index400] - let iter_base = address399 + index400 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload398.length()) - mbt_ffi_store32(iter_base + 8, address399) - cleanup_list.push(address399) - - () - } - MapValue(payload401) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address402 = mbt_ffi_malloc(payload401.length() * 8) - for index403 = 0 - index403 < payload401.length() - index403 = index403 + 1 { - let iter_elem : @types.MapEntry = payload401[index403] - let iter_base = address402 + index403 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload401.length()) - mbt_ffi_store32(iter_base + 8, address402) - cleanup_list.push(address402) - - () - } - OptionValue(payload404) => { - mbt_ffi_store8(iter_base + 0, 21) + let lifted480 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { - match payload404 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let lifted230 : @types.TypedSchemaValue? = match mbt_ffi_load8_u((result_ptr) + 4) { + 0 => Option::None + 1 => { - () - } - Some(payload406) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload406) + let array192 : Array[@types.SchemaTypeNode] = []; + for index193 = 0; index193 < (mbt_ffi_load32((result_ptr) + 12)); index193 = index193 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 8)) + (index193 * 144) - () - } - } + let lifted178 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - ResultValue(payload407) => { - mbt_ffi_store8(iter_base + 0, 22) + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { - match payload407 { - OkValue(payload408) => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaTypeBody::BoolType + } + 2 => { - match payload408 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let lifted4 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - Some(payload410) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload410) + let lifted0 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - } + let lifted = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - () - } - ErrValue(payload411) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - match payload411 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - () - } - Some(payload413) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload413) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - } + Option::Some(lifted) + } + _ => panic() + } - () - } - } + let lifted2 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - TextValue(payload414) => { - mbt_ffi_store8(iter_base + 0, 23) + let lifted1 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let ptr415 = mbt_ffi_str2ptr(payload414.text) - mbt_ffi_store32(iter_base + 12, payload414.text.length()) - mbt_ffi_store32(iter_base + 8, ptr415) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - match payload414.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - () - } - Some(payload417) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - let ptr418 = mbt_ffi_str2ptr(payload417) - mbt_ffi_store32(iter_base + 24, payload417.length()) - mbt_ffi_store32(iter_base + 20, ptr418) - cleanup_list.push(ptr418) + Option::Some(lifted1) + } + _ => panic() + } - () - } - } - cleanup_list.push(ptr415) + let lifted3 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - BinaryValue(payload419) => { - mbt_ffi_store8(iter_base + 0, 24) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - let ptr420 = mbt_ffi_bytes2ptr(payload419.bytes) + Option::Some(result) + } + _ => panic() + } - mbt_ffi_store32(iter_base + 12, payload419.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr420) + Option::Some(@types.NumericRestrictions::{min : lifted0, max : lifted2, unit : lifted3}) + } + _ => panic() + } - match payload419.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaTypeBody::S8Type(lifted4) + } + 3 => { - () - } - Some(payload422) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted11 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let ptr423 = mbt_ffi_str2ptr(payload422) - mbt_ffi_store32(iter_base + 24, payload422.length()) - mbt_ffi_store32(iter_base + 20, ptr423) - cleanup_list.push(ptr423) + let lifted6 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - } - cleanup_list.push(ptr420) + let lifted5 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - () - } - PathValue(payload424) => { - mbt_ffi_store8(iter_base + 0, 25) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - let ptr425 = mbt_ffi_str2ptr(payload424) - mbt_ffi_store32(iter_base + 12, payload424.length()) - mbt_ffi_store32(iter_base + 8, ptr425) - cleanup_list.push(ptr425) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted5) + } + _ => panic() + } + + let lifted8 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted7 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted7) + } + _ => panic() + } + + let lifted10 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result9 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result9) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted6, max : lifted8, unit : lifted10}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted11) + } + 4 => { + + let lifted18 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted13 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted12 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted12) + } + _ => panic() + } + + let lifted15 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted14 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted14) + } + _ => panic() + } + + let lifted17 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result16 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result16) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted13, max : lifted15, unit : lifted17}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted18) + } + 5 => { + + let lifted25 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted20 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted19 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted19) + } + _ => panic() + } + + let lifted22 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted21 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted21) + } + _ => panic() + } + + let lifted24 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result23) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted20, max : lifted22, unit : lifted24}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted25) + } + 6 => { + + let lifted32 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted27 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted26 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted26) + } + _ => panic() + } + + let lifted29 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted28 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted28) + } + _ => panic() + } + + let lifted31 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result30 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result30) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted27, max : lifted29, unit : lifted31}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted32) + } + 7 => { + + let lifted39 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted34 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted33 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted33) + } + _ => panic() + } + + let lifted36 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted35 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted35) + } + _ => panic() + } + + let lifted38 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result37 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result37) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted34, max : lifted36, unit : lifted38}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted39) + } + 8 => { + + let lifted46 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted41 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted40 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted40) + } + _ => panic() + } + + let lifted43 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted42 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted42) + } + _ => panic() + } + + let lifted45 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result44 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result44) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted41, max : lifted43, unit : lifted45}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted46) + } + 9 => { + + let lifted53 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted48 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted47 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted47) + } + _ => panic() + } + + let lifted50 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted49 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted49) + } + _ => panic() + } + + let lifted52 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result51 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result51) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted48, max : lifted50, unit : lifted52}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted53) + } + 10 => { + + let lifted60 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted55 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted54 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted54) + } + _ => panic() + } + + let lifted57 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted56 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted56) + } + _ => panic() + } + + let lifted59 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result58 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result58) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted55, max : lifted57, unit : lifted59}) + } + _ => panic() + } - () - } - UrlValue(payload426) => { - mbt_ffi_store8(iter_base + 0, 26) + @types.SchemaTypeBody::F32Type(lifted60) + } + 11 => { - let ptr427 = mbt_ffi_str2ptr(payload426) - mbt_ffi_store32(iter_base + 12, payload426.length()) - mbt_ffi_store32(iter_base + 8, ptr427) - cleanup_list.push(ptr427) + let lifted67 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - DatetimeValue(payload428) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload428.seconds) - mbt_ffi_store32( - iter_base + 16, - payload428.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload429) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload429.nanoseconds) + let lifted62 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - QuantityValueNode(payload430) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload430.mantissa) - mbt_ffi_store32(iter_base + 16, payload430.scale) + let lifted61 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - let ptr431 = mbt_ffi_str2ptr(payload430.unit) - mbt_ffi_store32(iter_base + 24, payload430.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr431) - cleanup_list.push(ptr431) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - () - } - UnionValue(payload432) => { - mbt_ffi_store8(iter_base + 0, 30) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - let ptr433 = mbt_ffi_str2ptr(payload432.tag) - mbt_ffi_store32(iter_base + 12, payload432.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr433) - mbt_ffi_store32(iter_base + 16, payload432.body) - cleanup_list.push(ptr433) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - SecretValue(payload434) => { - mbt_ffi_store8(iter_base + 0, 31) + Option::Some(lifted61) + } + _ => panic() + } - let @types.Secret(handle435) = payload434 - mbt_ffi_store32(iter_base + 8, handle435) + let lifted64 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - QuotaTokenHandle(payload436) => { - mbt_ffi_store8(iter_base + 0, 32) + let lifted63 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - let @types.QuotaToken(handle437) = payload436 - mbt_ffi_store32(iter_base + 8, handle437) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - () - } - } - } - - let (lowered, lowered442) = match stdin { - None => (0, 0) - Some(payload441) => - (1, wasmGolemToolHost010MethodToolRpcInvokeStream0StreamLower(payload441)) - } - let return_area = mbt_ffi_malloc(44) - let lower_arg = handle - let lower_arg443 = address - let lower_arg444 = command_path.length() - let lower_arg445 = address360 - let lower_arg446 = input.graph.type_nodes.length() - let lower_arg447 = address366 - let lower_arg448 = input.graph.defs.length() - let lower_arg449 = input.graph.root - let lower_arg450 = address438 - let lower_arg451 = input.value.value_nodes.length() - let lower_arg452 = input.value.root - let lower_arg453 = lowered - let lower_arg454 = lowered442 - let lower_arg455 = return_area - wasmImportMethodToolRpcInvoke( - lower_arg, lower_arg443, lower_arg444, lower_arg445, lower_arg446, lower_arg447, - lower_arg448, lower_arg449, lower_arg450, lower_arg451, lower_arg452, lower_arg453, - lower_arg454, lower_arg455, - ) - - for index459 = 0; index459 < lower_arg446; index459 = index459 + 1 { - let iter_base = lower_arg445 + index459 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => - for index456 = 0 - index456 < mbt_ffi_load32(iter_base + 12) - index456 = index456 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index456 * 68 - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => () - _ => panic() - } + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => () - _ => panic() - } + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => () - _ => panic() - } - _ => panic() - } - } - 15 => - for index457 = 0 - index457 < mbt_ffi_load32(iter_base + 12) - index457 = index457 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index457 * 72 - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => () - _ => panic() - } + Option::Some(lifted63) + } + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => () - _ => panic() - } + let lifted66 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => () - _ => panic() - } - _ => panic() - } - } - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => () - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => () - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => () - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => () - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - _ => panic() - } - } - 31 => - for index458 = 0 - index458 < mbt_ffi_load32(iter_base + 12) - index458 = index458 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index458 * 92 + let result65 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => () - _ => panic() - } - 5 => () - _ => panic() - } + Option::Some(result65) + } + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => () - _ => panic() - } + Option::Some(@types.NumericRestrictions::{min : lifted62, max : lifted64, unit : lifted66}) + } + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } + @types.SchemaTypeBody::F64Type(lifted67) + } + 12 => { - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => () - _ => panic() - } - _ => panic() - } - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => () - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => () - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => () - _ => panic() - } - _ => panic() - } - } - - for index460 = 0; index460 < lower_arg448; index460 = index460 + 1 { - let iter_base = lower_arg447 + index460 * 24 - - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => () - _ => panic() - } - } - - for index461 = 0; index461 < lower_arg451; index461 = index461 + 1 { - let iter_base = lower_arg450 + index461 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => () - _ => panic() - } - 24 => - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => () - _ => panic() - } - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - _ => panic() - } - } - - match lower_arg453 { - 0 => () - 1 => - wasmGolemToolHost010MethodToolRpcInvokeStream0StreamCommit(lower_arg454) - _ => panic() - } - - let lifted707 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted706 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result462 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - RpcError::ProtocolError(result462) - } - 1 => { - let result463 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - RpcError::Denied(result463) - } - 2 => { - let result464 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - RpcError::NotFound(result464) - } - 3 => { - let result465 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - RpcError::RemoteInternalError(result465) - } - 4 => { - let lifted705 = match mbt_ffi_load8_u(return_area + 8) { - 0 => { - let result466 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + @types.SchemaTypeBody::CharType + } + 13 => { - @common.ToolError::InvalidToolName(result466) - } - 1 => { - let array : Array[String] = [] - for index468 = 0 - index468 < mbt_ffi_load32(return_area + 16) - index468 = index468 + 1 { - let iter_base = mbt_ffi_load32(return_area + 12) + index468 * 8 - - let result467 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result467) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 12)) - - @common.ToolError::InvalidCommandPath(array) - } - 2 => { - let result469 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + @types.SchemaTypeBody::StringType + } + 14 => { - @common.ToolError::InvalidInput(result469) - } - 3 => { - let result470 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + let array80 : Array[@types.NamedFieldType] = []; + for index81 = 0; index81 < (mbt_ffi_load32((iter_base) + 12)); index81 = index81 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index81 * 68) - @common.ToolError::ConstraintViolation(result470) - } - 4 => { - let result471 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) + let result68 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @common.ToolError::InvalidResult(result471) - } - 5 => { - let array667 : Array[@types.SchemaTypeNode] = [] - for index668 = 0 - index668 < mbt_ffi_load32(return_area + 16) - index668 = index668 + 1 { - let iter_base = mbt_ffi_load32(return_area + 12) + - index668 * 144 - - let lifted653 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted477 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted472 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted) - } - _ => panic() - } - - let lifted474 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted473 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted70 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted473) - } - _ => panic() - } + let result69 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - let lifted476 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result475 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(result69) + } + _ => panic() + } - Option::Some(result475) - } - _ => panic() - } + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((iter_base) + 28)); index = index + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index * 8) - Option::Some(@types.NumericRestrictions::{ - min: lifted472, - max: lifted474, - unit: lifted476, - }) - } - _ => panic() - } + let result71 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::S8Type(lifted477) - } - 3 => { - let lifted484 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted479 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted478 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted478) - } - _ => panic() - } - - let lifted481 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted480 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array.push(result71) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - Option::Some(lifted480) - } - _ => panic() - } + let array73 : Array[String] = []; + for index74 = 0; index74 < (mbt_ffi_load32((iter_base) + 36)); index74 = index74 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index74 * 8) - let lifted483 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result482 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let result72 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(result482) - } - _ => panic() - } + array73.push(result72) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - Option::Some(@types.NumericRestrictions::{ - min: lifted479, - max: lifted481, - unit: lifted483, - }) - } - _ => panic() - } + let lifted76 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::S16Type(lifted484) - } - 4 => { - let lifted491 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted486 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted485 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted485) - } - _ => panic() - } - - let lifted488 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted487 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result75 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - Option::Some(lifted487) - } - _ => panic() - } + Option::Some(result75) + } + _ => panic() + } - let lifted490 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result489 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted79 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { - Option::Some(result489) - } - _ => panic() - } + let lifted78 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted486, - max: lifted488, - unit: lifted490, - }) - } - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - @types.SchemaTypeBody::S32Type(lifted491) - } - 5 => { - let lifted498 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted493 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted492 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted492) - } - _ => panic() - } - - let lifted495 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted494 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - Option::Some(lifted494) - } - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - let lifted497 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result496 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let result77 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - Option::Some(result496) - } - _ => panic() - } + @types.Role::Other(result77) + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted493, - max: lifted495, - unit: lifted497, - }) - } - _ => panic() - } + Option::Some(lifted78) + } + _ => panic() + } - @types.SchemaTypeBody::S64Type(lifted498) - } - 6 => { - let lifted505 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted500 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted499 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted499) - } - _ => panic() - } - - let lifted502 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted501 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array80.push(@types.NamedFieldType::{name : result68, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted70, aliases : array, examples : array73, deprecated : lifted76, role : lifted79}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted501) - } - _ => panic() - } + @types.SchemaTypeBody::RecordType(array80) + } + 15 => { - let lifted504 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result503 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let array97 : Array[@types.VariantCaseType] = []; + for index98 = 0; index98 < (mbt_ffi_load32((iter_base) + 12)); index98 = index98 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index98 * 72) - Option::Some(result503) - } - _ => panic() - } + let result82 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(@types.NumericRestrictions::{ - min: lifted500, - max: lifted502, - unit: lifted504, - }) - } - _ => panic() - } + let lifted83 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::U8Type(lifted505) - } - 7 => { - let lifted512 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted507 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted506 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted506) - } - _ => panic() - } - - let lifted509 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted508 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted508) - } - _ => panic() - } + let lifted85 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted511 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result510 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let result84 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - Option::Some(result510) - } - _ => panic() - } + Option::Some(result84) + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted507, - max: lifted509, - unit: lifted511, - }) - } - _ => panic() - } + let array87 : Array[String] = []; + for index88 = 0; index88 < (mbt_ffi_load32((iter_base) + 32)); index88 = index88 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index88 * 8) - @types.SchemaTypeBody::U16Type(lifted512) - } - 8 => { - let lifted519 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted514 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted513 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted513) - } - _ => panic() - } - - let lifted516 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted515 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result86 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(lifted515) - } - _ => panic() - } + array87.push(result86) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let lifted518 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result517 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let array90 : Array[String] = []; + for index91 = 0; index91 < (mbt_ffi_load32((iter_base) + 40)); index91 = index91 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index91 * 8) - Option::Some(result517) - } - _ => panic() - } + let result89 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - Option::Some(@types.NumericRestrictions::{ - min: lifted514, - max: lifted516, - unit: lifted518, - }) - } - _ => panic() - } + array90.push(result89) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - @types.SchemaTypeBody::U32Type(lifted519) - } - 9 => { - let lifted526 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted521 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted520 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted520) - } - _ => panic() - } - - let lifted523 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted522 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted93 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { - Option::Some(lifted522) - } - _ => panic() - } + let result92 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - let lifted525 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result524 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(result92) + } + _ => panic() + } - Option::Some(result524) - } - _ => panic() - } + let lifted96 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted521, - max: lifted523, - unit: lifted525, - }) - } - _ => panic() - } + let lifted95 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { - @types.SchemaTypeBody::U64Type(lifted526) - } - 10 => { - let lifted533 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted528 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted527 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted527) - } - _ => panic() - } - - let lifted530 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted529 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - Option::Some(lifted529) - } - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - let lifted532 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result531 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.Role::UnstructuredBinary + } + 3 => { - Option::Some(result531) - } - _ => panic() - } + let result94 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) - Option::Some(@types.NumericRestrictions::{ - min: lifted528, - max: lifted530, - unit: lifted532, - }) - } - _ => panic() - } + @types.Role::Other(result94) + } + _ => panic() + } - @types.SchemaTypeBody::F32Type(lifted533) - } - 11 => { - let lifted540 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted535 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted534 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted534) - } - _ => panic() - } - - let lifted537 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted536 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(lifted95) + } + _ => panic() + } - Option::Some(lifted536) - } - _ => panic() - } + array97.push(@types.VariantCaseType::{name : result82, payload : lifted83, metadata : @types.MetadataEnvelope::{doc : lifted85, aliases : array87, examples : array90, deprecated : lifted93, role : lifted96}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted539 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result538 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaTypeBody::VariantType(array97) + } + 16 => { - Option::Some(result538) - } - _ => panic() - } + let array100 : Array[String] = []; + for index101 = 0; index101 < (mbt_ffi_load32((iter_base) + 12)); index101 = index101 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index101 * 8) - Option::Some(@types.NumericRestrictions::{ - min: lifted535, - max: lifted537, - unit: lifted539, - }) - } - _ => panic() - } + let result99 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.SchemaTypeBody::F64Type(lifted540) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array555 : Array[@types.NamedFieldType] = [] - for index556 = 0 - index556 < mbt_ffi_load32(iter_base + 12) - index556 = index556 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index556 * 68 - - let result541 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted543 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result542 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + array100.push(result99) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(result542) - } - _ => panic() - } - - let array545 : Array[String] = [] - for index546 = 0 - index546 < mbt_ffi_load32(iter_base + 28) - index546 = index546 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index546 * 8 - - let result544 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array545.push(result544) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array548 : Array[String] = [] - for index549 = 0 - index549 < mbt_ffi_load32(iter_base + 36) - index549 = index549 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index549 * 8 - - let result547 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array548.push(result547) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted551 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result550 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) + @types.SchemaTypeBody::EnumType(array100) + } + 17 => { - Option::Some(result550) - } - _ => panic() - } + let array103 : Array[String] = []; + for index104 = 0; index104 < (mbt_ffi_load32((iter_base) + 12)); index104 = index104 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index104 * 8) - let lifted554 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted553 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result552 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result552) - } - _ => panic() - } - - Option::Some(lifted553) - } - _ => panic() - } - - array555.push(@types.NamedFieldType::{ - name: result541, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted543, - aliases: array545, - examples: array548, - deprecated: lifted551, - role: lifted554, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array555) - } - 15 => { - let array572 : Array[@types.VariantCaseType] = [] - for index573 = 0 - index573 < mbt_ffi_load32(iter_base + 12) - index573 = index573 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index573 * 72 - - let result557 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted558 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result102 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted560 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result559 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + array103.push(result102) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(result559) - } - _ => panic() - } - - let array562 : Array[String] = [] - for index563 = 0 - index563 < mbt_ffi_load32(iter_base + 32) - index563 = index563 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index563 * 8 - - let result561 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array562.push(result561) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array565 : Array[String] = [] - for index566 = 0 - index566 < mbt_ffi_load32(iter_base + 40) - index566 = index566 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index566 * 8 - - let result564 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array565.push(result564) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted568 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result567 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) + @types.SchemaTypeBody::FlagsType(array103) + } + 18 => { - Option::Some(result567) - } - _ => panic() - } + let array105 : Array[Int] = []; + for index106 = 0; index106 < (mbt_ffi_load32((iter_base) + 12)); index106 = index106 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index106 * 4) - let lifted571 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted570 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result569 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result569) - } - _ => panic() - } - - Option::Some(lifted570) - } - _ => panic() - } - - array572.push(@types.VariantCaseType::{ - name: result557, - payload: lifted558, - metadata: @types.MetadataEnvelope::{ - doc: lifted560, - aliases: array562, - examples: array565, - deprecated: lifted568, - role: lifted571, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array572) - } - 16 => { - let array575 : Array[String] = [] - for index576 = 0 - index576 < mbt_ffi_load32(iter_base + 12) - index576 = index576 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index576 * 8 - - let result574 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array575.push(result574) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array575) - } - 17 => { - let array578 : Array[String] = [] - for index579 = 0 - index579 < mbt_ffi_load32(iter_base + 12) - index579 = index579 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index579 * 8 - - let result577 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array578.push(result577) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array578) - } - 18 => { - let array580 : Array[Int] = [] - for index581 = 0 - index581 < mbt_ffi_load32(iter_base + 12) - index581 = index581 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index581 * 4 - - array580.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array580) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted582 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted583 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted582, - err: lifted583, - }) - } - 24 => { - let lifted587 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array585 : Array[String] = [] - for index586 = 0 - index586 < mbt_ffi_load32(iter_base + 16) - index586 = index586 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index586 * 8 - - let result584 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array585.push(result584) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array585) - } - _ => panic() - } - - let lifted588 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted589 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted591 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result590 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result590) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted587, - min_length: lifted588, - max_length: lifted589, - regex: lifted591, - }) - } - 25 => { - let lifted595 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array593 : Array[String] = [] - for index594 = 0 - index594 < mbt_ffi_load32(iter_base + 16) - index594 = index594 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index594 * 8 - - let result592 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array593.push(result592) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array593) - } - _ => panic() - } - - let lifted596 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted597 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted595, - min_bytes: lifted596, - max_bytes: lifted597, - }) - } - 26 => { - let lifted601 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array599 : Array[String] = [] - for index600 = 0 - index600 < mbt_ffi_load32(iter_base + 20) - index600 = index600 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index600 * 8 - - let result598 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array599.push(result598) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array599) - } - _ => panic() - } - - let lifted605 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array603 : Array[String] = [] - for index604 = 0 - index604 < mbt_ffi_load32(iter_base + 32) - index604 = index604 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index604 * 8 - - let result602 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array603.push(result602) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array603) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted601, - allowed_extensions: lifted605, - }) - } - 27 => { - let lifted609 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array607 : Array[String] = [] - for index608 = 0 - index608 < mbt_ffi_load32(iter_base + 16) - index608 = index608 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index608 * 8 - - let result606 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array607.push(result606) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array607) - } - _ => panic() - } - - let lifted613 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array611 : Array[String] = [] - for index612 = 0 - index612 < mbt_ffi_load32(iter_base + 28) - index612 = index612 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index612 * 8 - - let result610 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array611.push(result610) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array611) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted609, - allowed_hosts: lifted613, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result614 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array616 : Array[String] = [] - for index617 = 0 - index617 < mbt_ffi_load32(iter_base + 20) - index617 = index617 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index617 * 8 - - let result615 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array616.push(result615) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted619 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result618 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result618, - }) - } - _ => panic() - } - - let lifted621 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result620 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result620, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result614, - allowed_suffixes: array616, - min: lifted619, - max: lifted621, - }) - } - 31 => { - let array645 : Array[@types.UnionBranch] = [] - for index646 = 0 - index646 < mbt_ffi_load32(iter_base + 12) - index646 = index646 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index646 * 92 - - let result622 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted631 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result623 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + array105.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) + + @types.SchemaTypeBody::TupleType(array105) + } + 19 => { - @types.DiscriminatorRule::Prefix(result623) - } - 1 => { - let result624 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { - @types.DiscriminatorRule::Suffix(result624) - } - 2 => { - let result625 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { - @types.DiscriminatorRule::Contains(result625) - } - 3 => { - let result626 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { - @types.DiscriminatorRule::Regex(result626) - } - 4 => { - let result627 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted629 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result628 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result628) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result627, - literal: lifted629, - }) - } - 5 => { - let result630 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { - @types.DiscriminatorRule::FieldAbsent(result630) - } - _ => panic() - } + let lifted107 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let lifted633 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result632 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(result632) - } - _ => panic() - } - - let array635 : Array[String] = [] - for index636 = 0 - index636 < mbt_ffi_load32(iter_base + 52) - index636 = index636 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index636 * 8 - - let result634 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array635.push(result634) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array638 : Array[String] = [] - for index639 = 0 - index639 < mbt_ffi_load32(iter_base + 60) - index639 = index639 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index639 * 8 - - let result637 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array638.push(result637) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted641 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result640 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted108 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(result640) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } - let lifted644 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted643 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result642 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result642) - } - _ => panic() - } - - Option::Some(lifted643) - } - _ => panic() - } - - array645.push(@types.UnionBranch::{ - tag: result622, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted631, - metadata: @types.MetadataEnvelope::{ - doc: lifted633, - aliases: array635, - examples: array638, - deprecated: lifted641, - role: lifted644, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array645, - }) - } - 32 => { - let lifted648 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result647 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result647) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted648, - }) - } - 33 => { - let lifted650 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result649 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result649) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted650, - }) - } - 34 => { - let lifted651 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted651) - } - 35 => { - let lifted652 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted652) - } - _ => panic() - } + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted107, err : lifted108}) + } + 24 => { - let lifted655 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result654 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) + let lifted112 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(result654) - } - _ => panic() - } - - let array657 : Array[String] = [] - for index658 = 0 - index658 < mbt_ffi_load32(iter_base + 104) - index658 = index658 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index658 * 8 - - let result656 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array657.push(result656) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array660 : Array[String] = [] - for index661 = 0 - index661 < mbt_ffi_load32(iter_base + 112) - index661 = index661 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index661 * 8 - - let result659 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array660.push(result659) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted663 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result662 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) + let array110 : Array[String] = []; + for index111 = 0; index111 < (mbt_ffi_load32((iter_base) + 16)); index111 = index111 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index111 * 8) - Option::Some(result662) - } - _ => panic() - } + let result109 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let lifted666 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted665 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result664 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result664) - } - _ => panic() - } - - Option::Some(lifted665) - } - _ => panic() - } - - array667.push(@types.SchemaTypeNode::{ - body: lifted653, - metadata: @types.MetadataEnvelope::{ - doc: lifted655, - aliases: array657, - examples: array660, - deprecated: lifted663, - role: lifted666, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 12)) - - let array672 : Array[@types.SchemaTypeDef] = [] - for index673 = 0 - index673 < mbt_ffi_load32(return_area + 24) - index673 = index673 + 1 { - let iter_base = mbt_ffi_load32(return_area + 20) + index673 * 24 - - let result669 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted671 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result670 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + array110.push(result109) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - Option::Some(result670) - } - _ => panic() - } - - array672.push(@types.SchemaTypeDef::{ - id: result669, - name: lifted671, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 20)) - - let array703 : Array[@types.SchemaValueNode] = [] - for index704 = 0 - index704 < mbt_ffi_load32(return_area + 36) - index704 = index704 + 1 { - let iter_base = mbt_ffi_load32(return_area + 32) + index704 * 32 - - let lifted702 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result674 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result674) - } - 13 => { - let array675 : Array[Int] = [] - for index676 = 0 - index676 < mbt_ffi_load32(iter_base + 12) - index676 = index676 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index676 * 4 - - array675.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array675) - } - 14 => { - let lifted677 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted677, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array678 : Array[Bool] = [] - for index679 = 0 - index679 < mbt_ffi_load32(iter_base + 12) - index679 = index679 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index679 * 1 - - array678.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array678) - } - 17 => { - let array680 : Array[Int] = [] - for index681 = 0 - index681 < mbt_ffi_load32(iter_base + 12) - index681 = index681 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index681 * 4 - - array680.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array680) - } - 18 => { - let array682 : Array[Int] = [] - for index683 = 0 - index683 < mbt_ffi_load32(iter_base + 12) - index683 = index683 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index683 * 4 - - array682.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array682) - } - 19 => { - let array684 : Array[Int] = [] - for index685 = 0 - index685 < mbt_ffi_load32(iter_base + 12) - index685 = index685 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index685 * 4 - - array684.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array684) - } - 20 => { - let array686 : Array[@types.MapEntry] = [] - for index687 = 0 - index687 < mbt_ffi_load32(iter_base + 12) - index687 = index687 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index687 * 8 - - array686.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array686) - } - 21 => { - let lifted688 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted688) - } - 22 => { - let lifted691 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted689 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted689) - } - 1 => { - let lifted690 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted690) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted691) - } - 23 => { - let result692 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted694 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result693 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result693) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result692, - language: lifted694, - }) - } - 24 => { - let result695 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted697 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result696 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result696) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result695, - mime_type: lifted697, - }) - } - 25 => { - let result698 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + Option::Some(array110) + } + _ => panic() + } - @types.SchemaValueNode::PathValue(result698) - } - 26 => { - let result699 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result699) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result700 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result700, - }) - } - 30 => { - let result701 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result701, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array703.push(lifted702) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 32)) - - @common.ToolError::CustomError(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array667, - defs: array672, - root: mbt_ffi_load32(return_area + 28), - }, - value: @types.SchemaValueTree::{ - value_nodes: array703, - root: mbt_ffi_load32(return_area + 40), - }, - }) - } - _ => panic() - } + let lifted113 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - RpcError::RemoteToolError(lifted705) - } - _ => panic() - } + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - Result::Err(lifted706) - } - _ => panic() - } - let ret = lifted707 - mbt_ffi_free(address) - mbt_ffi_free(address360) - mbt_ffi_free(address366) - mbt_ffi_free(address438) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let lifted114 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { -///| -pub fn ToolRpc::async_invoke_and_await( - self : ToolRpc, - command_path : Array[String], - input : @types.TypedSchemaValue, - stdin : @async-core.Stream[Byte]?, -) -> FutureInvokeResult { - let cleanup_list : Array[Int] = [] - - let ToolRpc(handle) = self - - let address = mbt_ffi_malloc(command_path.length() * 8) - for index = 0; index < command_path.length(); index = index + 1 { - let iter_elem : String = command_path[index] - let iter_base = address + index * 8 - - let ptr = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr) - cleanup_list.push(ptr) - } - - let address360 = mbt_ffi_malloc(input.graph.type_nodes.length() * 144) - for index361 = 0 - index361 < input.graph.type_nodes.length() - index361 = index361 + 1 { - let iter_elem : @types.SchemaTypeNode = input.graph.type_nodes[index361] - let iter_base = address360 + index361 * 144 - - match iter_elem.body { - RefType(payload) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store32(iter_base + 8, payload) - - () - } - BoolType => { - mbt_ffi_store8(iter_base + 0, 1) + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - S8Type(payload1) => { - mbt_ffi_store8(iter_base + 0, 2) + let lifted116 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - match payload1 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let result115 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - () - } - Some(payload3) => { - mbt_ffi_store8(iter_base + 8, 1) + Option::Some(result115) + } + _ => panic() + } - match payload3.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted112, min_length : lifted113, max_length : lifted114, regex : lifted116}) + } + 25 => { - () - } - Some(payload5) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted120 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload5 { - Signed(payload6) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload6) + let array118 : Array[String] = []; + for index119 = 0; index119 < (mbt_ffi_load32((iter_base) + 16)); index119 = index119 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index119 * 8) - () - } - Unsigned(payload7) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload7.reinterpret_as_int64(), - ) + let result117 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - FloatBits(payload8) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload8.reinterpret_as_int64(), - ) + array118.push(result117) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - } + Option::Some(array118) + } + _ => panic() + } - () - } - } + let lifted121 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - match payload3.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - Some(payload10) => { - mbt_ffi_store8(iter_base + 40, 1) + let lifted122 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - match payload10 { - Signed(payload11) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload11) + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - Unsigned(payload12) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload12.reinterpret_as_int64(), - ) + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted120, min_bytes : lifted121, max_bytes : lifted122}) + } + 26 => { - () - } - FloatBits(payload13) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload13.reinterpret_as_int64(), - ) + let lifted126 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - } + let array124 : Array[String] = []; + for index125 = 0; index125 < (mbt_ffi_load32((iter_base) + 20)); index125 = index125 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index125 * 8) - () - } - } + let result123 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload3.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + array124.push(result123) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - Some(payload15) => { - mbt_ffi_store8(iter_base + 64, 1) + Option::Some(array124) + } + _ => panic() + } - let ptr16 = mbt_ffi_str2ptr(payload15) - mbt_ffi_store32(iter_base + 72, payload15.length()) - mbt_ffi_store32(iter_base + 68, ptr16) - cleanup_list.push(ptr16) + let lifted130 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - () - } - } + let array128 : Array[String] = []; + for index129 = 0; index129 < (mbt_ffi_load32((iter_base) + 32)); index129 = index129 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index129 * 8) - () - } - } + let result127 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - S16Type(payload17) => { - mbt_ffi_store8(iter_base + 0, 3) + array128.push(result127) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - match payload17 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + Option::Some(array128) + } + _ => panic() + } - () - } - Some(payload19) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted126, allowed_extensions : lifted130}) + } + 27 => { - match payload19.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted134 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - Some(payload21) => { - mbt_ffi_store8(iter_base + 16, 1) + let array132 : Array[String] = []; + for index133 = 0; index133 < (mbt_ffi_load32((iter_base) + 16)); index133 = index133 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index133 * 8) - match payload21 { - Signed(payload22) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload22) + let result131 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Unsigned(payload23) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload23.reinterpret_as_int64(), - ) + array132.push(result131) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - FloatBits(payload24) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload24.reinterpret_as_int64(), - ) + Option::Some(array132) + } + _ => panic() + } - () - } - } + let lifted138 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - () - } - } + let array136 : Array[String] = []; + for index137 = 0; index137 < (mbt_ffi_load32((iter_base) + 28)); index137 = index137 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index137 * 8) - match payload19.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let result135 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload26) => { - mbt_ffi_store8(iter_base + 40, 1) + array136.push(result135) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - match payload26 { - Signed(payload27) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload27) + Option::Some(array136) + } + _ => panic() + } - () - } - Unsigned(payload28) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload28.reinterpret_as_int64(), - ) + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted134, allowed_hosts : lifted138}) + } + 28 => { - () - } - FloatBits(payload29) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload29.reinterpret_as_int64(), - ) + @types.SchemaTypeBody::DatetimeType + } + 29 => { - () - } - } + @types.SchemaTypeBody::DurationType + } + 30 => { - () - } - } + let result139 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - match payload19.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let array141 : Array[String] = []; + for index142 = 0; index142 < (mbt_ffi_load32((iter_base) + 20)); index142 = index142 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index142 * 8) - () - } - Some(payload31) => { - mbt_ffi_store8(iter_base + 64, 1) + let result140 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let ptr32 = mbt_ffi_str2ptr(payload31) - mbt_ffi_store32(iter_base + 72, payload31.length()) - mbt_ffi_store32(iter_base + 68, ptr32) - cleanup_list.push(ptr32) + array141.push(result140) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - } + let lifted144 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - () - } - } + let result143 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - () - } - S32Type(payload33) => { - mbt_ffi_store8(iter_base + 0, 4) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result143}) + } + _ => panic() + } - match payload33 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let lifted146 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - () - } - Some(payload35) => { - mbt_ffi_store8(iter_base + 8, 1) + let result145 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - match payload35.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result145}) + } + _ => panic() + } - () - } - Some(payload37) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result139, allowed_suffixes : array141, min : lifted144, max : lifted146}) + } + 31 => { - match payload37 { - Signed(payload38) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload38) + let array170 : Array[@types.UnionBranch] = []; + for index171 = 0; index171 < (mbt_ffi_load32((iter_base) + 12)); index171 = index171 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index171 * 92) - () - } - Unsigned(payload39) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload39.reinterpret_as_int64(), - ) + let result147 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - FloatBits(payload40) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload40.reinterpret_as_int64(), - ) + let lifted156 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { - () - } - } + let result148 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - } + @types.DiscriminatorRule::Prefix(result148) + } + 1 => { - match payload35.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let result149 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - Some(payload42) => { - mbt_ffi_store8(iter_base + 40, 1) + @types.DiscriminatorRule::Suffix(result149) + } + 2 => { - match payload42 { - Signed(payload43) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload43) + let result150 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - Unsigned(payload44) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload44.reinterpret_as_int64(), - ) + @types.DiscriminatorRule::Contains(result150) + } + 3 => { - () - } - FloatBits(payload45) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload45.reinterpret_as_int64(), - ) + let result151 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - } + @types.DiscriminatorRule::Regex(result151) + } + 4 => { - () - } - } + let result152 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match payload35.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted154 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - () - } - Some(payload47) => { - mbt_ffi_store8(iter_base + 64, 1) + let result153 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - let ptr48 = mbt_ffi_str2ptr(payload47) - mbt_ffi_store32(iter_base + 72, payload47.length()) - mbt_ffi_store32(iter_base + 68, ptr48) - cleanup_list.push(ptr48) + Option::Some(result153) + } + _ => panic() + } - () - } - } + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result152, literal : lifted154}) + } + 5 => { - () - } - } + let result155 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - S64Type(payload49) => { - mbt_ffi_store8(iter_base + 0, 5) + @types.DiscriminatorRule::FieldAbsent(result155) + } + _ => panic() + } - match payload49 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let lifted158 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - () - } - Some(payload51) => { - mbt_ffi_store8(iter_base + 8, 1) + let result157 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - match payload51.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + Option::Some(result157) + } + _ => panic() + } - () - } - Some(payload53) => { - mbt_ffi_store8(iter_base + 16, 1) + let array160 : Array[String] = []; + for index161 = 0; index161 < (mbt_ffi_load32((iter_base) + 52)); index161 = index161 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index161 * 8) - match payload53 { - Signed(payload54) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload54) + let result159 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Unsigned(payload55) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload55.reinterpret_as_int64(), - ) + array160.push(result159) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) - () - } - FloatBits(payload56) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload56.reinterpret_as_int64(), - ) + let array163 : Array[String] = []; + for index164 = 0; index164 < (mbt_ffi_load32((iter_base) + 60)); index164 = index164 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index164 * 8) - () - } - } + let result162 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - } + array163.push(result162) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - match payload51.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let lifted166 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - Some(payload58) => { - mbt_ffi_store8(iter_base + 40, 1) + let result165 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - match payload58 { - Signed(payload59) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload59) + Option::Some(result165) + } + _ => panic() + } - () - } - Unsigned(payload60) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload60.reinterpret_as_int64(), - ) + let lifted169 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - () - } - FloatBits(payload61) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload61.reinterpret_as_int64(), - ) + let lifted168 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { - () - } - } + @types.Role::Multimodal + } + 1 => { - () - } - } + @types.Role::UnstructuredText + } + 2 => { - match payload51.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + @types.Role::UnstructuredBinary + } + 3 => { - () - } - Some(payload63) => { - mbt_ffi_store8(iter_base + 64, 1) + let result167 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - let ptr64 = mbt_ffi_str2ptr(payload63) - mbt_ffi_store32(iter_base + 72, payload63.length()) - mbt_ffi_store32(iter_base + 68, ptr64) - cleanup_list.push(ptr64) + @types.Role::Other(result167) + } + _ => panic() + } - () - } - } + Option::Some(lifted168) + } + _ => panic() + } - () - } - } + array170.push(@types.UnionBranch::{tag : result147, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted156, metadata : @types.MetadataEnvelope::{doc : lifted158, aliases : array160, examples : array163, deprecated : lifted166, role : lifted169}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - U8Type(payload65) => { - mbt_ffi_store8(iter_base + 0, 6) + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array170}) + } + 32 => { - match payload65 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let lifted173 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - Some(payload67) => { - mbt_ffi_store8(iter_base + 8, 1) + let result172 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match payload67.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + Option::Some(result172) + } + _ => panic() + } - () - } - Some(payload69) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted173}) + } + 33 => { - match payload69 { - Signed(payload70) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload70) + let lifted175 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - Unsigned(payload71) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload71.reinterpret_as_int64(), - ) + let result174 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - () - } - FloatBits(payload72) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload72.reinterpret_as_int64(), - ) + Option::Some(result174) + } + _ => panic() + } - () - } - } + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted175}) + } + 34 => { - () - } - } + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - match payload67.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let lifted176 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - Some(payload74) => { - mbt_ffi_store8(iter_base + 40, 1) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - match payload74 { - Signed(payload75) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload75) + @types.SchemaTypeBody::FutureType(lifted176) + } + 36 => { - () - } - Unsigned(payload76) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload76.reinterpret_as_int64(), - ) + let lifted177 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - FloatBits(payload77) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload77.reinterpret_as_int64(), - ) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - () - } - } + @types.SchemaTypeBody::StreamType(lifted177) + } + _ => panic() + } - () - } - } + let lifted180 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { + + let result179 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - match payload67.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + Option::Some(result179) + } + _ => panic() + } - () - } - Some(payload79) => { - mbt_ffi_store8(iter_base + 64, 1) + let array182 : Array[String] = []; + for index183 = 0; index183 < (mbt_ffi_load32((iter_base) + 104)); index183 = index183 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index183 * 8) - let ptr80 = mbt_ffi_str2ptr(payload79) - mbt_ffi_store32(iter_base + 72, payload79.length()) - mbt_ffi_store32(iter_base + 68, ptr80) - cleanup_list.push(ptr80) + let result181 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - } + array182.push(result181) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - () - } - } + let array185 : Array[String] = []; + for index186 = 0; index186 < (mbt_ffi_load32((iter_base) + 112)); index186 = index186 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index186 * 8) - () - } - U16Type(payload81) => { - mbt_ffi_store8(iter_base + 0, 7) + let result184 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload81 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + array185.push(result184) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - () - } - Some(payload83) => { - mbt_ffi_store8(iter_base + 8, 1) + let lifted188 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - match payload83.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let result187 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - () - } - Some(payload85) => { - mbt_ffi_store8(iter_base + 16, 1) + Option::Some(result187) + } + _ => panic() + } - match payload85 { - Signed(payload86) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload86) + let lifted191 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - () - } - Unsigned(payload87) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload87.reinterpret_as_int64(), - ) + let lifted190 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - () - } - FloatBits(payload88) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload88.reinterpret_as_int64(), - ) + @types.Role::Multimodal + } + 1 => { - () - } - } + @types.Role::UnstructuredText + } + 2 => { - () - } - } + @types.Role::UnstructuredBinary + } + 3 => { - match payload83.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let result189 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - () - } - Some(payload90) => { - mbt_ffi_store8(iter_base + 40, 1) + @types.Role::Other(result189) + } + _ => panic() + } - match payload90 { - Signed(payload91) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload91) + Option::Some(lifted190) + } + _ => panic() + } - () - } - Unsigned(payload92) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload92.reinterpret_as_int64(), - ) + array192.push(@types.SchemaTypeNode::{body : lifted178, metadata : @types.MetadataEnvelope::{doc : lifted180, aliases : array182, examples : array185, deprecated : lifted188, role : lifted191}}) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) - () - } - FloatBits(payload93) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload93.reinterpret_as_int64(), - ) + let array197 : Array[@types.SchemaTypeDef] = []; + for index198 = 0; index198 < (mbt_ffi_load32((result_ptr) + 20)); index198 = index198 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 16)) + (index198 * 24) - () - } - } + let result194 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - } + let lifted196 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - match payload83.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let result195 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - () - } - Some(payload95) => { - mbt_ffi_store8(iter_base + 64, 1) + Option::Some(result195) + } + _ => panic() + } - let ptr96 = mbt_ffi_str2ptr(payload95) - mbt_ffi_store32(iter_base + 72, payload95.length()) - mbt_ffi_store32(iter_base + 68, ptr96) - cleanup_list.push(ptr96) + array197.push(@types.SchemaTypeDef::{id : result194, name : lifted196, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 16)) - () - } - } + let array228 : Array[@types.SchemaValueNode] = []; + for index229 = 0; index229 < (mbt_ffi_load32((result_ptr) + 32)); index229 = index229 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 28)) + (index229 * 32) - () - } - } + let lifted227 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - () - } - U32Type(payload97) => { - mbt_ffi_store8(iter_base + 0, 8) + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - match payload97 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - () - } - Some(payload99) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - match payload99.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - () - } - Some(payload101) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - match payload101 { - Signed(payload102) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload102) + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - () - } - Unsigned(payload103) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload103.reinterpret_as_int64(), - ) + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - () - } - FloatBits(payload104) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload104.reinterpret_as_int64(), - ) + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - () - } - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - () - } - } + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - match payload99.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - () - } - Some(payload106) => { - mbt_ffi_store8(iter_base + 40, 1) + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - match payload106 { - Signed(payload107) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload107) + let result199 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Unsigned(payload108) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload108.reinterpret_as_int64(), - ) + @types.SchemaValueNode::StringValue(result199) + } + 13 => { - () - } - FloatBits(payload109) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload109.reinterpret_as_int64(), - ) + let array200 : Array[Int] = []; + for index201 = 0; index201 < (mbt_ffi_load32((iter_base) + 12)); index201 = index201 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index201 * 4) - () - } - } + array200.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } + @types.SchemaValueNode::RecordValue(array200) + } + 14 => { - match payload99.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted202 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - Some(payload111) => { - mbt_ffi_store8(iter_base + 64, 1) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let ptr112 = mbt_ffi_str2ptr(payload111) - mbt_ffi_store32(iter_base + 72, payload111.length()) - mbt_ffi_store32(iter_base + 68, ptr112) - cleanup_list.push(ptr112) + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted202}) + } + 15 => { - () - } - } + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - () - } - } + let array203 : Array[Bool] = []; + for index204 = 0; index204 < (mbt_ffi_load32((iter_base) + 12)); index204 = index204 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index204 * 1) - () - } - U64Type(payload113) => { - mbt_ffi_store8(iter_base + 0, 9) + array203.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload113 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaValueNode::FlagsValue(array203) + } + 17 => { - () - } - Some(payload115) => { - mbt_ffi_store8(iter_base + 8, 1) + let array205 : Array[Int] = []; + for index206 = 0; index206 < (mbt_ffi_load32((iter_base) + 12)); index206 = index206 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index206 * 4) - match payload115.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + array205.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Some(payload117) => { - mbt_ffi_store8(iter_base + 16, 1) + @types.SchemaValueNode::TupleValue(array205) + } + 18 => { - match payload117 { - Signed(payload118) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload118) + let array207 : Array[Int] = []; + for index208 = 0; index208 < (mbt_ffi_load32((iter_base) + 12)); index208 = index208 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index208 * 4) - () - } - Unsigned(payload119) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload119.reinterpret_as_int64(), - ) + array207.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - FloatBits(payload120) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload120.reinterpret_as_int64(), - ) + @types.SchemaValueNode::ListValue(array207) + } + 19 => { - () - } - } + let array209 : Array[Int] = []; + for index210 = 0; index210 < (mbt_ffi_load32((iter_base) + 12)); index210 = index210 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index210 * 4) - () - } - } + array209.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload115.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @types.SchemaValueNode::FixedListValue(array209) + } + 20 => { - () - } - Some(payload122) => { - mbt_ffi_store8(iter_base + 40, 1) + let array211 : Array[@types.MapEntry] = []; + for index212 = 0; index212 < (mbt_ffi_load32((iter_base) + 12)); index212 = index212 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index212 * 8) - match payload122 { - Signed(payload123) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload123) + array211.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - Unsigned(payload124) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload124.reinterpret_as_int64(), - ) + @types.SchemaValueNode::MapValue(array211) + } + 21 => { - () - } - FloatBits(payload125) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload125.reinterpret_as_int64(), - ) + let lifted213 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - () - } - } + @types.SchemaValueNode::OptionValue(lifted213) + } + 22 => { - match payload115.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted216 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - () - } - Some(payload127) => { - mbt_ffi_store8(iter_base + 64, 1) + let lifted214 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let ptr128 = mbt_ffi_str2ptr(payload127) - mbt_ffi_store32(iter_base + 72, payload127.length()) - mbt_ffi_store32(iter_base + 68, ptr128) - cleanup_list.push(ptr128) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - () - } - } + @types.ResultValuePayload::OkValue(lifted214) + } + 1 => { - () - } - } + let lifted215 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - F32Type(payload129) => { - mbt_ffi_store8(iter_base + 0, 10) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - match payload129 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.ResultValuePayload::ErrValue(lifted215) + } + _ => panic() + } - () - } - Some(payload131) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaValueNode::ResultValue(lifted216) + } + 23 => { - match payload131.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let result217 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - Some(payload133) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted219 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - match payload133 { - Signed(payload134) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload134) + let result218 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - Unsigned(payload135) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload135.reinterpret_as_int64(), - ) + Option::Some(result218) + } + _ => panic() + } - () - } - FloatBits(payload136) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload136.reinterpret_as_int64(), - ) + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result217, language : lifted219}) + } + 24 => { - () - } - } + let result220 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - } + let lifted222 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - match payload131.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + let result221 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - () - } - Some(payload138) => { - mbt_ffi_store8(iter_base + 40, 1) + Option::Some(result221) + } + _ => panic() + } - match payload138 { - Signed(payload139) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload139) + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result220, mime_type : lifted222}) + } + 25 => { - () - } - Unsigned(payload140) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload140.reinterpret_as_int64(), - ) + let result223 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::PathValue(result223) + } + 26 => { + + let result224 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UrlValue(result224) + } + 27 => { - () + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { + + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { + + let result225 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) + + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result225}) + } + 30 => { + + let result226 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result226, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { + + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { + + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { + + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array228.push(lifted227) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 28)) + + Option::Some(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array192, defs : array197, root : mbt_ffi_load32((result_ptr) + 24)}, value : @types.SchemaValueTree::{value_nodes : array228, root : mbt_ffi_load32((result_ptr) + 36)}}) + } + _ => panic() } - FloatBits(payload141) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload141.reinterpret_as_int64(), - ) - () + let lifted232 : @async-core.Stream[Byte]? = match mbt_ffi_load8_u((result_ptr) + 40) { + 0 => Option::None + 1 => { + let result231 = wasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamLift(mbt_ffi_load32((result_ptr) + 44)) + + Option::Some(result231) + } + _ => panic() } - } - () - } + Result::Ok(@common.InvocationResult::{result : lifted230, stdout : lifted232}) } + 1 => { - match payload131.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted479 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { - () - } - Some(payload143) => { - mbt_ffi_store8(iter_base + 64, 1) + let result233 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) - let ptr144 = mbt_ffi_str2ptr(payload143) - mbt_ffi_store32(iter_base + 72, payload143.length()) - mbt_ffi_store32(iter_base + 68, ptr144) - cleanup_list.push(ptr144) + RpcError::ProtocolError(result233) + } + 1 => { - () - } - } + let result234 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) - () - } - } + RpcError::Denied(result234) + } + 2 => { - () - } - F64Type(payload145) => { - mbt_ffi_store8(iter_base + 0, 11) + let result235 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) - match payload145 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + RpcError::NotFound(result235) + } + 3 => { - () - } - Some(payload147) => { - mbt_ffi_store8(iter_base + 8, 1) + let result236 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) - match payload147.min { - None => { - mbt_ffi_store8(iter_base + 16, 0) + RpcError::RemoteInternalError(result236) + } + 4 => { - () - } - Some(payload149) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted478 = match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { - match payload149 { - Signed(payload150) => { - mbt_ffi_store8(iter_base + 24, 0) - mbt_ffi_store64(iter_base + 32, payload150) + let result237 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) - () - } - Unsigned(payload151) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64( - iter_base + 32, - payload151.reinterpret_as_int64(), - ) + @common.ToolError::InvalidToolName(result237) + } + 1 => { - () - } - FloatBits(payload152) => { - mbt_ffi_store8(iter_base + 24, 2) - mbt_ffi_store64( - iter_base + 32, - payload152.reinterpret_as_int64(), - ) + let array239 : Array[String] = []; + for index240 = 0; index240 < (mbt_ffi_load32((result_ptr) + 16)); index240 = index240 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 12)) + (index240 * 8) - () - } - } + let result238 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - } + array239.push(result238) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) - match payload147.max { - None => { - mbt_ffi_store8(iter_base + 40, 0) + @common.ToolError::InvalidCommandPath(array239) + } + 2 => { - () - } - Some(payload154) => { - mbt_ffi_store8(iter_base + 40, 1) + let result241 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) - match payload154 { - Signed(payload155) => { - mbt_ffi_store8(iter_base + 48, 0) - mbt_ffi_store64(iter_base + 56, payload155) + @common.ToolError::InvalidInput(result241) + } + 3 => { - () - } - Unsigned(payload156) => { - mbt_ffi_store8(iter_base + 48, 1) - mbt_ffi_store64( - iter_base + 56, - payload156.reinterpret_as_int64(), - ) + let result242 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) - () - } - FloatBits(payload157) => { - mbt_ffi_store8(iter_base + 48, 2) - mbt_ffi_store64( - iter_base + 56, - payload157.reinterpret_as_int64(), - ) + @common.ToolError::ConstraintViolation(result242) + } + 4 => { - () - } - } + let result243 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) - () - } - } + @common.ToolError::InvalidResult(result243) + } + 5 => { - match payload147.unit { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let array440 : Array[@types.SchemaTypeNode] = []; + for index441 = 0; index441 < (mbt_ffi_load32((result_ptr) + 16)); index441 = index441 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 12)) + (index441 * 144) - () - } - Some(payload159) => { - mbt_ffi_store8(iter_base + 64, 1) + let lifted426 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - let ptr160 = mbt_ffi_str2ptr(payload159) - mbt_ffi_store32(iter_base + 72, payload159.length()) - mbt_ffi_store32(iter_base + 68, ptr160) - cleanup_list.push(ptr160) + @types.SchemaTypeBody::RefType(mbt_ffi_load32((iter_base) + 8)) + } + 1 => { - () - } - } + @types.SchemaTypeBody::BoolType + } + 2 => { - () - } - } + let lifted250 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - CharType => { - mbt_ffi_store8(iter_base + 0, 12) + let lifted245 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - StringType => { - mbt_ffi_store8(iter_base + 0, 13) + let lifted244 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - () - } - RecordType(payload163) => { - mbt_ffi_store8(iter_base + 0, 14) - - let address184 = mbt_ffi_malloc(payload163.length() * 68) - for index185 = 0 - index185 < payload163.length() - index185 = index185 + 1 { - let iter_elem : @types.NamedFieldType = payload163[index185] - let iter_base = address184 + index185 * 68 - - let ptr164 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr164) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 12, 0) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - () - } - Some(payload166) => { - mbt_ffi_store8(iter_base + 12, 1) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - let ptr167 = mbt_ffi_str2ptr(payload166) - mbt_ffi_store32(iter_base + 20, payload166.length()) - mbt_ffi_store32(iter_base + 16, ptr167) - cleanup_list.push(ptr167) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - } - - let address169 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index170 = 0 - index170 < iter_elem.metadata.aliases.length() - index170 = index170 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index170] - let iter_base = address169 + index170 * 8 - - let ptr168 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr168) - cleanup_list.push(ptr168) - } - mbt_ffi_store32(iter_base + 28, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 24, address169) - - let address172 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index173 = 0 - index173 < iter_elem.metadata.examples.length() - index173 = index173 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index173] - let iter_base = address172 + index173 * 8 - - let ptr171 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr171) - cleanup_list.push(ptr171) - } - mbt_ffi_store32(iter_base + 36, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 32, address172) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 40, 0) + Option::Some(lifted244) + } + _ => panic() + } - () - } - Some(payload175) => { - mbt_ffi_store8(iter_base + 40, 1) + let lifted247 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - let ptr176 = mbt_ffi_str2ptr(payload175) - mbt_ffi_store32(iter_base + 48, payload175.length()) - mbt_ffi_store32(iter_base + 44, ptr176) - cleanup_list.push(ptr176) + let lifted246 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - () - } - } + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 52, 0) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - () - } - Some(payload178) => { - mbt_ffi_store8(iter_base + 52, 1) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - match payload178 { - Multimodal => { - mbt_ffi_store8(iter_base + 56, 0) + Option::Some(lifted246) + } + _ => panic() + } - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 56, 1) + let lifted249 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 56, 2) + let result248 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - () - } - Other(payload182) => { - mbt_ffi_store8(iter_base + 56, 3) + Option::Some(result248) + } + _ => panic() + } - let ptr183 = mbt_ffi_str2ptr(payload182) - mbt_ffi_store32(iter_base + 64, payload182.length()) - mbt_ffi_store32(iter_base + 60, ptr183) - cleanup_list.push(ptr183) + Option::Some(@types.NumericRestrictions::{min : lifted245, max : lifted247, unit : lifted249}) + } + _ => panic() + } - () - } - } + @types.SchemaTypeBody::S8Type(lifted250) + } + 3 => { - () - } - } - cleanup_list.push(ptr164) - cleanup_list.push(address169) - cleanup_list.push(address172) - } - mbt_ffi_store32(iter_base + 12, payload163.length()) - mbt_ffi_store32(iter_base + 8, address184) - cleanup_list.push(address184) - - () - } - VariantType(payload186) => { - mbt_ffi_store8(iter_base + 0, 15) + let lifted257 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let address209 = mbt_ffi_malloc(payload186.length() * 72) - for index210 = 0 - index210 < payload186.length() - index210 = index210 + 1 { - let iter_elem : @types.VariantCaseType = payload186[index210] - let iter_base = address209 + index210 * 72 + let lifted252 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let ptr187 = mbt_ffi_str2ptr(iter_elem.name) - mbt_ffi_store32(iter_base + 4, iter_elem.name.length()) - mbt_ffi_store32(iter_base + 0, ptr187) + let lifted251 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - match iter_elem.payload { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - () - } - Some(payload189) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload189) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted251) + } + _ => panic() + } + + let lifted254 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted253 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted253) + } + _ => panic() + } + + let lifted256 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result255 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result255) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted252, max : lifted254, unit : lifted256}) + } + _ => panic() + } + + @types.SchemaTypeBody::S16Type(lifted257) + } + 4 => { + + let lifted264 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted259 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted258 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted258) + } + _ => panic() + } + + let lifted261 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted260 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted260) + } + _ => panic() + } + + let lifted263 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result262 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result262) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted259, max : lifted261, unit : lifted263}) + } + _ => panic() + } + + @types.SchemaTypeBody::S32Type(lifted264) + } + 5 => { + + let lifted271 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted266 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted265 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted265) + } + _ => panic() + } + + let lifted268 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted267 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted267) + } + _ => panic() + } + + let lifted270 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result269 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result269) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted266, max : lifted268, unit : lifted270}) + } + _ => panic() + } + + @types.SchemaTypeBody::S64Type(lifted271) + } + 6 => { + + let lifted278 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted273 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted272 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted272) + } + _ => panic() + } + + let lifted275 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted274 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted274) + } + _ => panic() + } + + let lifted277 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result276 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result276) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted273, max : lifted275, unit : lifted277}) + } + _ => panic() + } + + @types.SchemaTypeBody::U8Type(lifted278) + } + 7 => { + + let lifted285 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted280 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted279 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted279) + } + _ => panic() + } + + let lifted282 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted281 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted281) + } + _ => panic() + } + + let lifted284 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result283 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result283) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted280, max : lifted282, unit : lifted284}) + } + _ => panic() + } + + @types.SchemaTypeBody::U16Type(lifted285) + } + 8 => { + + let lifted292 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted287 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted286 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted286) + } + _ => panic() + } + + let lifted289 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted288 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted288) + } + _ => panic() + } + + let lifted291 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result290 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result290) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted287, max : lifted289, unit : lifted291}) + } + _ => panic() + } + + @types.SchemaTypeBody::U32Type(lifted292) + } + 9 => { + + let lifted299 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted294 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted293 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted293) + } + _ => panic() + } + + let lifted296 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted295 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted295) + } + _ => panic() + } + + let lifted298 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result297 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result297) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted294, max : lifted296, unit : lifted298}) + } + _ => panic() + } + + @types.SchemaTypeBody::U64Type(lifted299) + } + 10 => { + + let lifted306 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { + + let lifted301 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { + + let lifted300 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted300) + } + _ => panic() + } + + let lifted303 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { + + let lifted302 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { + + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { + + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { + + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } + + Option::Some(lifted302) + } + _ => panic() + } + + let lifted305 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { + + let result304 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) + + Option::Some(result304) + } + _ => panic() + } + + Option::Some(@types.NumericRestrictions::{min : lifted301, max : lifted303, unit : lifted305}) + } + _ => panic() + } - () - } - } + @types.SchemaTypeBody::F32Type(lifted306) + } + 11 => { - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let lifted313 : @types.NumericRestrictions? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - Some(payload191) => { - mbt_ffi_store8(iter_base + 16, 1) + let lifted308 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let ptr192 = mbt_ffi_str2ptr(payload191) - mbt_ffi_store32(iter_base + 24, payload191.length()) - mbt_ffi_store32(iter_base + 20, ptr192) - cleanup_list.push(ptr192) + let lifted307 = match (mbt_ffi_load8_u((iter_base) + 24)) { + 0 => { - () - } - } - - let address194 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index195 = 0 - index195 < iter_elem.metadata.aliases.length() - index195 = index195 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index195] - let iter_base = address194 + index195 * 8 - - let ptr193 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr193) - cleanup_list.push(ptr193) - } - mbt_ffi_store32(iter_base + 32, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 28, address194) - - let address197 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index198 = 0 - index198 < iter_elem.metadata.examples.length() - index198 = index198 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index198] - let iter_base = address197 + index198 * 8 - - let ptr196 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr196) - cleanup_list.push(ptr196) - } - mbt_ffi_store32(iter_base + 40, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 36, address197) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 44, 0) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 32)) + } + 1 => { - () - } - Some(payload200) => { - mbt_ffi_store8(iter_base + 44, 1) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + 2 => { - let ptr201 = mbt_ffi_str2ptr(payload200) - mbt_ffi_store32(iter_base + 52, payload200.length()) - mbt_ffi_store32(iter_base + 48, ptr201) - cleanup_list.push(ptr201) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 32)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - } + Option::Some(lifted307) + } + _ => panic() + } - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 56, 0) + let lifted310 : @types.NumericBound? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - Some(payload203) => { - mbt_ffi_store8(iter_base + 56, 1) + let lifted309 = match (mbt_ffi_load8_u((iter_base) + 48)) { + 0 => { - match payload203 { - Multimodal => { - mbt_ffi_store8(iter_base + 60, 0) + @types.NumericBound::Signed(mbt_ffi_load64((iter_base) + 56)) + } + 1 => { - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 60, 1) + @types.NumericBound::Unsigned((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + 2 => { - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 60, 2) + @types.NumericBound::FloatBits((mbt_ffi_load64((iter_base) + 56)).reinterpret_as_uint64()) + } + _ => panic() + } - () - } - Other(payload207) => { - mbt_ffi_store8(iter_base + 60, 3) + Option::Some(lifted309) + } + _ => panic() + } - let ptr208 = mbt_ffi_str2ptr(payload207) - mbt_ffi_store32(iter_base + 68, payload207.length()) - mbt_ffi_store32(iter_base + 64, ptr208) - cleanup_list.push(ptr208) + let lifted312 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - () - } - } + let result311 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - () - } - } - cleanup_list.push(ptr187) - cleanup_list.push(address194) - cleanup_list.push(address197) - } - mbt_ffi_store32(iter_base + 12, payload186.length()) - mbt_ffi_store32(iter_base + 8, address209) - cleanup_list.push(address209) - - () - } - EnumType(payload211) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address213 = mbt_ffi_malloc(payload211.length() * 8) - for index214 = 0 - index214 < payload211.length() - index214 = index214 + 1 { - let iter_elem : String = payload211[index214] - let iter_base = address213 + index214 * 8 - - let ptr212 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr212) - cleanup_list.push(ptr212) - } - mbt_ffi_store32(iter_base + 12, payload211.length()) - mbt_ffi_store32(iter_base + 8, address213) - cleanup_list.push(address213) - - () - } - FlagsType(payload215) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address217 = mbt_ffi_malloc(payload215.length() * 8) - for index218 = 0 - index218 < payload215.length() - index218 = index218 + 1 { - let iter_elem : String = payload215[index218] - let iter_base = address217 + index218 * 8 - - let ptr216 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr216) - cleanup_list.push(ptr216) - } - mbt_ffi_store32(iter_base + 12, payload215.length()) - mbt_ffi_store32(iter_base + 8, address217) - cleanup_list.push(address217) - - () - } - TupleType(payload219) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address220 = mbt_ffi_malloc(payload219.length() * 4) - for index221 = 0 - index221 < payload219.length() - index221 = index221 + 1 { - let iter_elem : Int = payload219[index221] - let iter_base = address220 + index221 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload219.length()) - mbt_ffi_store32(iter_base + 8, address220) - cleanup_list.push(address220) - - () - } - ListType(payload222) => { - mbt_ffi_store8(iter_base + 0, 19) - mbt_ffi_store32(iter_base + 8, payload222) + Option::Some(result311) + } + _ => panic() + } - () - } - FixedListType(payload223) => { - mbt_ffi_store8(iter_base + 0, 20) - mbt_ffi_store32(iter_base + 8, payload223.element) - mbt_ffi_store32(iter_base + 12, payload223.length.reinterpret_as_int()) + Option::Some(@types.NumericRestrictions::{min : lifted308, max : lifted310, unit : lifted312}) + } + _ => panic() + } - () - } - MapType(payload224) => { - mbt_ffi_store8(iter_base + 0, 21) - mbt_ffi_store32(iter_base + 8, payload224.key) - mbt_ffi_store32(iter_base + 12, payload224.value) + @types.SchemaTypeBody::F64Type(lifted313) + } + 12 => { - () - } - OptionType(payload225) => { - mbt_ffi_store8(iter_base + 0, 22) - mbt_ffi_store32(iter_base + 8, payload225) + @types.SchemaTypeBody::CharType + } + 13 => { - () - } - ResultType(payload226) => { - mbt_ffi_store8(iter_base + 0, 23) - - match payload226.ok { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload228) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload228) - - () - } - } - - match payload226.err { - None => { - mbt_ffi_store8(iter_base + 16, 0) - - () - } - Some(payload230) => { - mbt_ffi_store8(iter_base + 16, 1) - mbt_ffi_store32(iter_base + 20, payload230) - - () - } - } - - () - } - TextType(payload231) => { - mbt_ffi_store8(iter_base + 0, 24) - - match payload231.languages { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload233) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address235 = mbt_ffi_malloc(payload233.length() * 8) - for index236 = 0 - index236 < payload233.length() - index236 = index236 + 1 { - let iter_elem : String = payload233[index236] - let iter_base = address235 + index236 * 8 - - let ptr234 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr234) - cleanup_list.push(ptr234) - } - mbt_ffi_store32(iter_base + 16, payload233.length()) - mbt_ffi_store32(iter_base + 12, address235) - cleanup_list.push(address235) - - () - } - } - - match payload231.min_length { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload238) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload238.reinterpret_as_int()) - - () - } - } - - match payload231.max_length { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload240) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload240.reinterpret_as_int()) - - () - } - } - - match payload231.regex { - None => { - mbt_ffi_store8(iter_base + 36, 0) - - () - } - Some(payload242) => { - mbt_ffi_store8(iter_base + 36, 1) - - let ptr243 = mbt_ffi_str2ptr(payload242) - mbt_ffi_store32(iter_base + 44, payload242.length()) - mbt_ffi_store32(iter_base + 40, ptr243) - cleanup_list.push(ptr243) - - () - } - } - - () - } - BinaryType(payload244) => { - mbt_ffi_store8(iter_base + 0, 25) - - match payload244.mime_types { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload246) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address248 = mbt_ffi_malloc(payload246.length() * 8) - for index249 = 0 - index249 < payload246.length() - index249 = index249 + 1 { - let iter_elem : String = payload246[index249] - let iter_base = address248 + index249 * 8 - - let ptr247 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr247) - cleanup_list.push(ptr247) - } - mbt_ffi_store32(iter_base + 16, payload246.length()) - mbt_ffi_store32(iter_base + 12, address248) - cleanup_list.push(address248) - - () - } - } - - match payload244.min_bytes { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload251) => { - mbt_ffi_store8(iter_base + 20, 1) - mbt_ffi_store32(iter_base + 24, payload251.reinterpret_as_int()) - - () - } - } - - match payload244.max_bytes { - None => { - mbt_ffi_store8(iter_base + 28, 0) - - () - } - Some(payload253) => { - mbt_ffi_store8(iter_base + 28, 1) - mbt_ffi_store32(iter_base + 32, payload253.reinterpret_as_int()) - - () - } - } - - () - } - PathType(payload254) => { - mbt_ffi_store8(iter_base + 0, 26) - mbt_ffi_store8(iter_base + 8, payload254.direction.ordinal()) - mbt_ffi_store8(iter_base + 9, payload254.kind.ordinal()) - - match payload254.allowed_mime_types { - None => { - mbt_ffi_store8(iter_base + 12, 0) - - () - } - Some(payload256) => { - mbt_ffi_store8(iter_base + 12, 1) - - let address258 = mbt_ffi_malloc(payload256.length() * 8) - for index259 = 0 - index259 < payload256.length() - index259 = index259 + 1 { - let iter_elem : String = payload256[index259] - let iter_base = address258 + index259 * 8 - - let ptr257 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr257) - cleanup_list.push(ptr257) - } - mbt_ffi_store32(iter_base + 20, payload256.length()) - mbt_ffi_store32(iter_base + 16, address258) - cleanup_list.push(address258) - - () - } - } - - match payload254.allowed_extensions { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload261) => { - mbt_ffi_store8(iter_base + 24, 1) - - let address263 = mbt_ffi_malloc(payload261.length() * 8) - for index264 = 0 - index264 < payload261.length() - index264 = index264 + 1 { - let iter_elem : String = payload261[index264] - let iter_base = address263 + index264 * 8 - - let ptr262 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr262) - cleanup_list.push(ptr262) - } - mbt_ffi_store32(iter_base + 32, payload261.length()) - mbt_ffi_store32(iter_base + 28, address263) - cleanup_list.push(address263) + @types.SchemaTypeBody::StringType + } + 14 => { + + let array328 : Array[@types.NamedFieldType] = []; + for index329 = 0; index329 < (mbt_ffi_load32((iter_base) + 12)); index329 = index329 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index329 * 68) + + let result314 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let lifted316 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - () - } - } + let result315 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - () - } - UrlType(payload265) => { - mbt_ffi_store8(iter_base + 0, 27) - - match payload265.allowed_schemes { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload267) => { - mbt_ffi_store8(iter_base + 8, 1) - - let address269 = mbt_ffi_malloc(payload267.length() * 8) - for index270 = 0 - index270 < payload267.length() - index270 = index270 + 1 { - let iter_elem : String = payload267[index270] - let iter_base = address269 + index270 * 8 - - let ptr268 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr268) - cleanup_list.push(ptr268) - } - mbt_ffi_store32(iter_base + 16, payload267.length()) - mbt_ffi_store32(iter_base + 12, address269) - cleanup_list.push(address269) - - () - } - } - - match payload265.allowed_hosts { - None => { - mbt_ffi_store8(iter_base + 20, 0) - - () - } - Some(payload272) => { - mbt_ffi_store8(iter_base + 20, 1) - - let address274 = mbt_ffi_malloc(payload272.length() * 8) - for index275 = 0 - index275 < payload272.length() - index275 = index275 + 1 { - let iter_elem : String = payload272[index275] - let iter_base = address274 + index275 * 8 - - let ptr273 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr273) - cleanup_list.push(ptr273) - } - mbt_ffi_store32(iter_base + 28, payload272.length()) - mbt_ffi_store32(iter_base + 24, address274) - cleanup_list.push(address274) + Option::Some(result315) + } + _ => panic() + } - () - } - } + let array318 : Array[String] = []; + for index319 = 0; index319 < (mbt_ffi_load32((iter_base) + 28)); index319 = index319 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index319 * 8) - () - } - DatetimeType => { - mbt_ffi_store8(iter_base + 0, 28) + let result317 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - DurationType => { - mbt_ffi_store8(iter_base + 0, 29) + array318.push(result317) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - () - } - QuantityType(payload278) => { - mbt_ffi_store8(iter_base + 0, 30) - - let ptr279 = mbt_ffi_str2ptr(payload278.base_unit) - mbt_ffi_store32(iter_base + 12, payload278.base_unit.length()) - mbt_ffi_store32(iter_base + 8, ptr279) - - let address281 = mbt_ffi_malloc( - payload278.allowed_suffixes.length() * 8, - ) - for index282 = 0 - index282 < payload278.allowed_suffixes.length() - index282 = index282 + 1 { - let iter_elem : String = payload278.allowed_suffixes[index282] - let iter_base = address281 + index282 * 8 - - let ptr280 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr280) - cleanup_list.push(ptr280) - } - mbt_ffi_store32(iter_base + 20, payload278.allowed_suffixes.length()) - mbt_ffi_store32(iter_base + 16, address281) - - match payload278.min { - None => { - mbt_ffi_store8(iter_base + 24, 0) - - () - } - Some(payload284) => { - mbt_ffi_store8(iter_base + 24, 1) - mbt_ffi_store64(iter_base + 32, payload284.mantissa) - mbt_ffi_store32(iter_base + 40, payload284.scale) - - let ptr285 = mbt_ffi_str2ptr(payload284.unit) - mbt_ffi_store32(iter_base + 48, payload284.unit.length()) - mbt_ffi_store32(iter_base + 44, ptr285) - cleanup_list.push(ptr285) - - () - } - } - - match payload278.max { - None => { - mbt_ffi_store8(iter_base + 56, 0) - - () - } - Some(payload287) => { - mbt_ffi_store8(iter_base + 56, 1) - mbt_ffi_store64(iter_base + 64, payload287.mantissa) - mbt_ffi_store32(iter_base + 72, payload287.scale) - - let ptr288 = mbt_ffi_str2ptr(payload287.unit) - mbt_ffi_store32(iter_base + 80, payload287.unit.length()) - mbt_ffi_store32(iter_base + 76, ptr288) - cleanup_list.push(ptr288) - - () - } - } - cleanup_list.push(ptr279) - cleanup_list.push(address281) - - () - } - UnionType(payload289) => { - mbt_ffi_store8(iter_base + 0, 31) - - let address325 = mbt_ffi_malloc(payload289.branches.length() * 92) - for index326 = 0 - index326 < payload289.branches.length() - index326 = index326 + 1 { - let iter_elem : @types.UnionBranch = payload289.branches[index326] - let iter_base = address325 + index326 * 92 - - let ptr290 = mbt_ffi_str2ptr(iter_elem.tag) - mbt_ffi_store32(iter_base + 4, iter_elem.tag.length()) - mbt_ffi_store32(iter_base + 0, ptr290) - mbt_ffi_store32(iter_base + 8, iter_elem.body) - - match iter_elem.discriminator { - Prefix(payload291) => { - mbt_ffi_store8(iter_base + 12, 0) - - let ptr292 = mbt_ffi_str2ptr(payload291) - mbt_ffi_store32(iter_base + 20, payload291.length()) - mbt_ffi_store32(iter_base + 16, ptr292) - cleanup_list.push(ptr292) - - () - } - Suffix(payload293) => { - mbt_ffi_store8(iter_base + 12, 1) + let array321 : Array[String] = []; + for index322 = 0; index322 < (mbt_ffi_load32((iter_base) + 36)); index322 = index322 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 32)) + (index322 * 8) - let ptr294 = mbt_ffi_str2ptr(payload293) - mbt_ffi_store32(iter_base + 20, payload293.length()) - mbt_ffi_store32(iter_base + 16, ptr294) - cleanup_list.push(ptr294) + let result320 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Contains(payload295) => { - mbt_ffi_store8(iter_base + 12, 2) + array321.push(result320) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 32)) - let ptr296 = mbt_ffi_str2ptr(payload295) - mbt_ffi_store32(iter_base + 20, payload295.length()) - mbt_ffi_store32(iter_base + 16, ptr296) - cleanup_list.push(ptr296) + let lifted324 : String? = match mbt_ffi_load8_u((iter_base) + 40) { + 0 => Option::None + 1 => { - () - } - Regex(payload297) => { - mbt_ffi_store8(iter_base + 12, 3) + let result323 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - let ptr298 = mbt_ffi_str2ptr(payload297) - mbt_ffi_store32(iter_base + 20, payload297.length()) - mbt_ffi_store32(iter_base + 16, ptr298) - cleanup_list.push(ptr298) + Option::Some(result323) + } + _ => panic() + } - () - } - FieldEquals(payload299) => { - mbt_ffi_store8(iter_base + 12, 4) + let lifted327 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 52) { + 0 => Option::None + 1 => { - let ptr300 = mbt_ffi_str2ptr(payload299.field_name) - mbt_ffi_store32(iter_base + 20, payload299.field_name.length()) - mbt_ffi_store32(iter_base + 16, ptr300) + let lifted326 = match (mbt_ffi_load8_u((iter_base) + 56)) { + 0 => { - match payload299.literal { - None => { - mbt_ffi_store8(iter_base + 24, 0) + @types.Role::Multimodal + } + 1 => { - () - } - Some(payload302) => { - mbt_ffi_store8(iter_base + 24, 1) + @types.Role::UnstructuredText + } + 2 => { - let ptr303 = mbt_ffi_str2ptr(payload302) - mbt_ffi_store32(iter_base + 32, payload302.length()) - mbt_ffi_store32(iter_base + 28, ptr303) - cleanup_list.push(ptr303) + @types.Role::UnstructuredBinary + } + 3 => { - () - } - } - cleanup_list.push(ptr300) + let result325 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 60), mbt_ffi_load32((iter_base) + 64)) - () - } - FieldAbsent(payload304) => { - mbt_ffi_store8(iter_base + 12, 5) + @types.Role::Other(result325) + } + _ => panic() + } - let ptr305 = mbt_ffi_str2ptr(payload304) - mbt_ffi_store32(iter_base + 20, payload304.length()) - mbt_ffi_store32(iter_base + 16, ptr305) - cleanup_list.push(ptr305) + Option::Some(lifted326) + } + _ => panic() + } - () - } - } + array328.push(@types.NamedFieldType::{name : result314, body : mbt_ffi_load32((iter_base) + 8), metadata : @types.MetadataEnvelope::{doc : lifted316, aliases : array318, examples : array321, deprecated : lifted324, role : lifted327}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 36, 0) + @types.SchemaTypeBody::RecordType(array328) + } + 15 => { - () - } - Some(payload307) => { - mbt_ffi_store8(iter_base + 36, 1) + let array345 : Array[@types.VariantCaseType] = []; + for index346 = 0; index346 < (mbt_ffi_load32((iter_base) + 12)); index346 = index346 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index346 * 72) - let ptr308 = mbt_ffi_str2ptr(payload307) - mbt_ffi_store32(iter_base + 44, payload307.length()) - mbt_ffi_store32(iter_base + 40, ptr308) - cleanup_list.push(ptr308) + let result330 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - } - - let address310 = mbt_ffi_malloc( - iter_elem.metadata.aliases.length() * 8, - ) - for index311 = 0 - index311 < iter_elem.metadata.aliases.length() - index311 = index311 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index311] - let iter_base = address310 + index311 * 8 - - let ptr309 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr309) - cleanup_list.push(ptr309) - } - mbt_ffi_store32(iter_base + 52, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 48, address310) - - let address313 = mbt_ffi_malloc( - iter_elem.metadata.examples.length() * 8, - ) - for index314 = 0 - index314 < iter_elem.metadata.examples.length() - index314 = index314 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index314] - let iter_base = address313 + index314 * 8 - - let ptr312 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr312) - cleanup_list.push(ptr312) - } - mbt_ffi_store32(iter_base + 60, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 56, address313) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 64, 0) + let lifted331 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - Some(payload316) => { - mbt_ffi_store8(iter_base + 64, 1) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - let ptr317 = mbt_ffi_str2ptr(payload316) - mbt_ffi_store32(iter_base + 72, payload316.length()) - mbt_ffi_store32(iter_base + 68, ptr317) - cleanup_list.push(ptr317) + let lifted333 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - } + let result332 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 76, 0) + Option::Some(result332) + } + _ => panic() + } - () - } - Some(payload319) => { - mbt_ffi_store8(iter_base + 76, 1) + let array335 : Array[String] = []; + for index336 = 0; index336 < (mbt_ffi_load32((iter_base) + 32)); index336 = index336 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index336 * 8) - match payload319 { - Multimodal => { - mbt_ffi_store8(iter_base + 80, 0) + let result334 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 80, 1) + array335.push(result334) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 80, 2) + let array338 : Array[String] = []; + for index339 = 0; index339 < (mbt_ffi_load32((iter_base) + 40)); index339 = index339 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 36)) + (index339 * 8) - () - } - Other(payload323) => { - mbt_ffi_store8(iter_base + 80, 3) + let result337 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let ptr324 = mbt_ffi_str2ptr(payload323) - mbt_ffi_store32(iter_base + 88, payload323.length()) - mbt_ffi_store32(iter_base + 84, ptr324) - cleanup_list.push(ptr324) + array338.push(result337) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 36)) - () - } - } + let lifted341 : String? = match mbt_ffi_load8_u((iter_base) + 44) { + 0 => Option::None + 1 => { - () - } - } - cleanup_list.push(ptr290) - cleanup_list.push(address310) - cleanup_list.push(address313) - } - mbt_ffi_store32(iter_base + 12, payload289.branches.length()) - mbt_ffi_store32(iter_base + 8, address325) - cleanup_list.push(address325) - - () - } - SecretType(payload327) => { - mbt_ffi_store8(iter_base + 0, 32) - mbt_ffi_store32(iter_base + 8, payload327.inner) + let result340 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 48), mbt_ffi_load32((iter_base) + 52)) - match payload327.category { - None => { - mbt_ffi_store8(iter_base + 12, 0) + Option::Some(result340) + } + _ => panic() + } - () - } - Some(payload329) => { - mbt_ffi_store8(iter_base + 12, 1) + let lifted344 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - let ptr330 = mbt_ffi_str2ptr(payload329) - mbt_ffi_store32(iter_base + 20, payload329.length()) - mbt_ffi_store32(iter_base + 16, ptr330) - cleanup_list.push(ptr330) + let lifted343 = match (mbt_ffi_load8_u((iter_base) + 60)) { + 0 => { - () - } - } + @types.Role::Multimodal + } + 1 => { - () - } - QuotaTokenType(payload331) => { - mbt_ffi_store8(iter_base + 0, 33) + @types.Role::UnstructuredText + } + 2 => { - match payload331.resource_name { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.Role::UnstructuredBinary + } + 3 => { - () - } - Some(payload333) => { - mbt_ffi_store8(iter_base + 8, 1) + let result342 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 64), mbt_ffi_load32((iter_base) + 68)) - let ptr334 = mbt_ffi_str2ptr(payload333) - mbt_ffi_store32(iter_base + 16, payload333.length()) - mbt_ffi_store32(iter_base + 12, ptr334) - cleanup_list.push(ptr334) + @types.Role::Other(result342) + } + _ => panic() + } - () - } - } + Option::Some(lifted343) + } + _ => panic() + } - () - } - FutureType(payload335) => { - mbt_ffi_store8(iter_base + 0, 34) + array345.push(@types.VariantCaseType::{name : result330, payload : lifted331, metadata : @types.MetadataEnvelope::{doc : lifted333, aliases : array335, examples : array338, deprecated : lifted341, role : lifted344}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload335 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaTypeBody::VariantType(array345) + } + 16 => { - () - } - Some(payload337) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload337) + let array348 : Array[String] = []; + for index349 = 0; index349 < (mbt_ffi_load32((iter_base) + 12)); index349 = index349 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index349 * 8) - () - } - } + let result347 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - StreamType(payload338) => { - mbt_ffi_store8(iter_base + 0, 35) + array348.push(result347) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match payload338 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + @types.SchemaTypeBody::EnumType(array348) + } + 17 => { - () - } - Some(payload340) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload340) + let array351 : Array[String] = []; + for index352 = 0; index352 < (mbt_ffi_load32((iter_base) + 12)); index352 = index352 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index352 * 8) - () - } - } + let result350 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - } + array351.push(result350) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - match iter_elem.metadata.doc { - None => { - mbt_ffi_store8(iter_base + 88, 0) + @types.SchemaTypeBody::FlagsType(array351) + } + 18 => { - () - } - Some(payload342) => { - mbt_ffi_store8(iter_base + 88, 1) + let array353 : Array[Int] = []; + for index354 = 0; index354 < (mbt_ffi_load32((iter_base) + 12)); index354 = index354 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index354 * 4) - let ptr343 = mbt_ffi_str2ptr(payload342) - mbt_ffi_store32(iter_base + 96, payload342.length()) - mbt_ffi_store32(iter_base + 92, ptr343) - cleanup_list.push(ptr343) + array353.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - () - } - } - - let address345 = mbt_ffi_malloc(iter_elem.metadata.aliases.length() * 8) - for index346 = 0 - index346 < iter_elem.metadata.aliases.length() - index346 = index346 + 1 { - let iter_elem : String = iter_elem.metadata.aliases[index346] - let iter_base = address345 + index346 * 8 - - let ptr344 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr344) - cleanup_list.push(ptr344) - } - mbt_ffi_store32(iter_base + 104, iter_elem.metadata.aliases.length()) - mbt_ffi_store32(iter_base + 100, address345) - - let address348 = mbt_ffi_malloc(iter_elem.metadata.examples.length() * 8) - for index349 = 0 - index349 < iter_elem.metadata.examples.length() - index349 = index349 + 1 { - let iter_elem : String = iter_elem.metadata.examples[index349] - let iter_base = address348 + index349 * 8 - - let ptr347 = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr347) - cleanup_list.push(ptr347) - } - mbt_ffi_store32(iter_base + 112, iter_elem.metadata.examples.length()) - mbt_ffi_store32(iter_base + 108, address348) - - match iter_elem.metadata.deprecated { - None => { - mbt_ffi_store8(iter_base + 116, 0) - - () - } - Some(payload351) => { - mbt_ffi_store8(iter_base + 116, 1) + @types.SchemaTypeBody::TupleType(array353) + } + 19 => { - let ptr352 = mbt_ffi_str2ptr(payload351) - mbt_ffi_store32(iter_base + 124, payload351.length()) - mbt_ffi_store32(iter_base + 120, ptr352) - cleanup_list.push(ptr352) + @types.SchemaTypeBody::ListType(mbt_ffi_load32((iter_base) + 8)) + } + 20 => { - () - } - } + @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{element : mbt_ffi_load32((iter_base) + 8), length : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint()}) + } + 21 => { - match iter_elem.metadata.role { - None => { - mbt_ffi_store8(iter_base + 128, 0) + @types.SchemaTypeBody::MapType(@types.MapSpec::{key : mbt_ffi_load32((iter_base) + 8), value : mbt_ffi_load32((iter_base) + 12)}) + } + 22 => { - () - } - Some(payload354) => { - mbt_ffi_store8(iter_base + 128, 1) - - match payload354 { - Multimodal => { - mbt_ffi_store8(iter_base + 132, 0) - - () - } - UnstructuredText => { - mbt_ffi_store8(iter_base + 132, 1) - - () - } - UnstructuredBinary => { - mbt_ffi_store8(iter_base + 132, 2) - - () - } - Other(payload358) => { - mbt_ffi_store8(iter_base + 132, 3) - - let ptr359 = mbt_ffi_str2ptr(payload358) - mbt_ffi_store32(iter_base + 140, payload358.length()) - mbt_ffi_store32(iter_base + 136, ptr359) - cleanup_list.push(ptr359) - - () - } - } - - () - } - } - cleanup_list.push(address345) - cleanup_list.push(address348) - } - - let address366 = mbt_ffi_malloc(input.graph.defs.length() * 24) - for index367 = 0 - index367 < input.graph.defs.length() - index367 = index367 + 1 { - let iter_elem : @types.SchemaTypeDef = input.graph.defs[index367] - let iter_base = address366 + index367 * 24 - - let ptr362 = mbt_ffi_str2ptr(iter_elem.id) - mbt_ffi_store32(iter_base + 4, iter_elem.id.length()) - mbt_ffi_store32(iter_base + 0, ptr362) - - match iter_elem.name { - None => { - mbt_ffi_store8(iter_base + 8, 0) - - () - } - Some(payload364) => { - mbt_ffi_store8(iter_base + 8, 1) + @types.SchemaTypeBody::OptionType(mbt_ffi_load32((iter_base) + 8)) + } + 23 => { - let ptr365 = mbt_ffi_str2ptr(payload364) - mbt_ffi_store32(iter_base + 16, payload364.length()) - mbt_ffi_store32(iter_base + 12, ptr365) - cleanup_list.push(ptr365) + let lifted355 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - } - mbt_ffi_store32(iter_base + 20, iter_elem.body) - cleanup_list.push(ptr362) - } - - let address438 = mbt_ffi_malloc(input.value.value_nodes.length() * 32) - for index439 = 0 - index439 < input.value.value_nodes.length() - index439 = index439 + 1 { - let iter_elem : @types.SchemaValueNode = input.value.value_nodes[index439] - let iter_base = address438 + index439 * 32 - - match iter_elem { - BoolValue(payload368) => { - mbt_ffi_store8(iter_base + 0, 0) - mbt_ffi_store8(iter_base + 8, if payload368 { 1 } else { 0 }) - - () - } - S8Value(payload369) => { - mbt_ffi_store8(iter_base + 0, 1) - mbt_ffi_store8(iter_base + 8, mbt_ffi_extend8(payload369)) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - () - } - S16Value(payload370) => { - mbt_ffi_store8(iter_base + 0, 2) - mbt_ffi_store16(iter_base + 8, mbt_ffi_extend16(payload370)) + let lifted356 : Int? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - () - } - S32Value(payload371) => { - mbt_ffi_store8(iter_base + 0, 3) - mbt_ffi_store32(iter_base + 8, payload371) + Option::Some(mbt_ffi_load32((iter_base) + 20)) + } + _ => panic() + } - () - } - S64Value(payload372) => { - mbt_ffi_store8(iter_base + 0, 4) - mbt_ffi_store64(iter_base + 8, payload372) + @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ok : lifted355, err : lifted356}) + } + 24 => { - () - } - U8Value(payload373) => { - mbt_ffi_store8(iter_base + 0, 5) - mbt_ffi_store8(iter_base + 8, payload373.to_int()) + let lifted360 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - U16Value(payload374) => { - mbt_ffi_store8(iter_base + 0, 6) - mbt_ffi_store16(iter_base + 8, payload374.reinterpret_as_int()) + let array358 : Array[String] = []; + for index359 = 0; index359 < (mbt_ffi_load32((iter_base) + 16)); index359 = index359 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index359 * 8) - () - } - U32Value(payload375) => { - mbt_ffi_store8(iter_base + 0, 7) - mbt_ffi_store32(iter_base + 8, payload375.reinterpret_as_int()) + let result357 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - U64Value(payload376) => { - mbt_ffi_store8(iter_base + 0, 8) - mbt_ffi_store64(iter_base + 8, payload376.reinterpret_as_int64()) + array358.push(result357) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - F32Value(payload377) => { - mbt_ffi_store8(iter_base + 0, 9) - mbt_ffi_storef32(iter_base + 8, payload377) + Option::Some(array358) + } + _ => panic() + } - () - } - F64Value(payload378) => { - mbt_ffi_store8(iter_base + 0, 10) - mbt_ffi_storef64(iter_base + 8, payload378) + let lifted361 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - () - } - CharValue(payload379) => { - mbt_ffi_store8(iter_base + 0, 11) - mbt_ffi_store32(iter_base + 8, payload379.to_int()) + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - StringValue(payload380) => { - mbt_ffi_store8(iter_base + 0, 12) + let lifted362 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - let ptr381 = mbt_ffi_str2ptr(payload380) - mbt_ffi_store32(iter_base + 12, payload380.length()) - mbt_ffi_store32(iter_base + 8, ptr381) - cleanup_list.push(ptr381) + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - RecordValue(payload382) => { - mbt_ffi_store8(iter_base + 0, 13) - - let address383 = mbt_ffi_malloc(payload382.length() * 4) - for index384 = 0 - index384 < payload382.length() - index384 = index384 + 1 { - let iter_elem : Int = payload382[index384] - let iter_base = address383 + index384 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload382.length()) - mbt_ffi_store32(iter_base + 8, address383) - cleanup_list.push(address383) - - () - } - VariantValue(payload385) => { - mbt_ffi_store8(iter_base + 0, 14) - mbt_ffi_store32(iter_base + 8, payload385.case.reinterpret_as_int()) + let lifted364 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - match payload385.payload { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let result363 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - () - } - Some(payload387) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload387) + Option::Some(result363) + } + _ => panic() + } - () - } - } + @types.SchemaTypeBody::TextType(@types.TextRestrictions::{languages : lifted360, min_length : lifted361, max_length : lifted362, regex : lifted364}) + } + 25 => { - () - } - EnumValue(payload388) => { - mbt_ffi_store8(iter_base + 0, 15) - mbt_ffi_store32(iter_base + 8, payload388.reinterpret_as_int()) + let lifted368 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - () - } - FlagsValue(payload389) => { - mbt_ffi_store8(iter_base + 0, 16) - - let address390 = mbt_ffi_malloc(payload389.length() * 1) - for index391 = 0 - index391 < payload389.length() - index391 = index391 + 1 { - let iter_elem : Bool = payload389[index391] - let iter_base = address390 + index391 * 1 - mbt_ffi_store8(iter_base + 0, if iter_elem { 1 } else { 0 }) - } - mbt_ffi_store32(iter_base + 12, payload389.length()) - mbt_ffi_store32(iter_base + 8, address390) - cleanup_list.push(address390) - - () - } - TupleValue(payload392) => { - mbt_ffi_store8(iter_base + 0, 17) - - let address393 = mbt_ffi_malloc(payload392.length() * 4) - for index394 = 0 - index394 < payload392.length() - index394 = index394 + 1 { - let iter_elem : Int = payload392[index394] - let iter_base = address393 + index394 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload392.length()) - mbt_ffi_store32(iter_base + 8, address393) - cleanup_list.push(address393) - - () - } - ListValue(payload395) => { - mbt_ffi_store8(iter_base + 0, 18) - - let address396 = mbt_ffi_malloc(payload395.length() * 4) - for index397 = 0 - index397 < payload395.length() - index397 = index397 + 1 { - let iter_elem : Int = payload395[index397] - let iter_base = address396 + index397 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload395.length()) - mbt_ffi_store32(iter_base + 8, address396) - cleanup_list.push(address396) - - () - } - FixedListValue(payload398) => { - mbt_ffi_store8(iter_base + 0, 19) - - let address399 = mbt_ffi_malloc(payload398.length() * 4) - for index400 = 0 - index400 < payload398.length() - index400 = index400 + 1 { - let iter_elem : Int = payload398[index400] - let iter_base = address399 + index400 * 4 - mbt_ffi_store32(iter_base + 0, iter_elem) - } - mbt_ffi_store32(iter_base + 12, payload398.length()) - mbt_ffi_store32(iter_base + 8, address399) - cleanup_list.push(address399) - - () - } - MapValue(payload401) => { - mbt_ffi_store8(iter_base + 0, 20) - - let address402 = mbt_ffi_malloc(payload401.length() * 8) - for index403 = 0 - index403 < payload401.length() - index403 = index403 + 1 { - let iter_elem : @types.MapEntry = payload401[index403] - let iter_base = address402 + index403 * 8 - mbt_ffi_store32(iter_base + 0, iter_elem.key) - mbt_ffi_store32(iter_base + 4, iter_elem.value) - } - mbt_ffi_store32(iter_base + 12, payload401.length()) - mbt_ffi_store32(iter_base + 8, address402) - cleanup_list.push(address402) - - () - } - OptionValue(payload404) => { - mbt_ffi_store8(iter_base + 0, 21) + let array366 : Array[String] = []; + for index367 = 0; index367 < (mbt_ffi_load32((iter_base) + 16)); index367 = index367 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index367 * 8) - match payload404 { - None => { - mbt_ffi_store8(iter_base + 8, 0) + let result365 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload406) => { - mbt_ffi_store8(iter_base + 8, 1) - mbt_ffi_store32(iter_base + 12, payload406) + array366.push(result365) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - } + Option::Some(array366) + } + _ => panic() + } - () - } - ResultValue(payload407) => { - mbt_ffi_store8(iter_base + 0, 22) + let lifted369 : UInt? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - match payload407 { - OkValue(payload408) => { - mbt_ffi_store8(iter_base + 8, 0) + Option::Some((mbt_ffi_load32((iter_base) + 24)).reinterpret_as_uint()) + } + _ => panic() + } - match payload408 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let lifted370 : UInt? = match mbt_ffi_load8_u((iter_base) + 28) { + 0 => Option::None + 1 => { - () - } - Some(payload410) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload410) + Option::Some((mbt_ffi_load32((iter_base) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - } + @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{mime_types : lifted368, min_bytes : lifted369, max_bytes : lifted370}) + } + 26 => { - () - } - ErrValue(payload411) => { - mbt_ffi_store8(iter_base + 8, 1) + let lifted374 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - match payload411 { - None => { - mbt_ffi_store8(iter_base + 12, 0) + let array372 : Array[String] = []; + for index373 = 0; index373 < (mbt_ffi_load32((iter_base) + 20)); index373 = index373 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index373 * 8) - () - } - Some(payload413) => { - mbt_ffi_store8(iter_base + 12, 1) - mbt_ffi_store32(iter_base + 16, payload413) + let result371 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - } + array372.push(result371) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - () - } - } + Option::Some(array372) + } + _ => panic() + } - () - } - TextValue(payload414) => { - mbt_ffi_store8(iter_base + 0, 23) + let lifted378 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - let ptr415 = mbt_ffi_str2ptr(payload414.text) - mbt_ffi_store32(iter_base + 12, payload414.text.length()) - mbt_ffi_store32(iter_base + 8, ptr415) + let array376 : Array[String] = []; + for index377 = 0; index377 < (mbt_ffi_load32((iter_base) + 32)); index377 = index377 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 28)) + (index377 * 8) - match payload414.language { - None => { - mbt_ffi_store8(iter_base + 16, 0) + let result375 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - Some(payload417) => { - mbt_ffi_store8(iter_base + 16, 1) + array376.push(result375) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 28)) - let ptr418 = mbt_ffi_str2ptr(payload417) - mbt_ffi_store32(iter_base + 24, payload417.length()) - mbt_ffi_store32(iter_base + 20, ptr418) - cleanup_list.push(ptr418) + Option::Some(array376) + } + _ => panic() + } - () - } - } - cleanup_list.push(ptr415) + @types.SchemaTypeBody::PathType(@types.PathSpec::{direction : @types.PathDirection::from(mbt_ffi_load8_u((iter_base) + 8)), kind : @types.PathKind::from(mbt_ffi_load8_u((iter_base) + 9)), allowed_mime_types : lifted374, allowed_extensions : lifted378}) + } + 27 => { - () - } - BinaryValue(payload419) => { - mbt_ffi_store8(iter_base + 0, 24) + let lifted382 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - let ptr420 = mbt_ffi_bytes2ptr(payload419.bytes) + let array380 : Array[String] = []; + for index381 = 0; index381 < (mbt_ffi_load32((iter_base) + 16)); index381 = index381 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 12)) + (index381 * 8) - mbt_ffi_store32(iter_base + 12, payload419.bytes.length()) - mbt_ffi_store32(iter_base + 8, ptr420) + let result379 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match payload419.mime_type { - None => { - mbt_ffi_store8(iter_base + 16, 0) + array380.push(result379) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 12)) - () - } - Some(payload422) => { - mbt_ffi_store8(iter_base + 16, 1) + Option::Some(array380) + } + _ => panic() + } - let ptr423 = mbt_ffi_str2ptr(payload422) - mbt_ffi_store32(iter_base + 24, payload422.length()) - mbt_ffi_store32(iter_base + 20, ptr423) - cleanup_list.push(ptr423) + let lifted386 : Array[String]? = match mbt_ffi_load8_u((iter_base) + 20) { + 0 => Option::None + 1 => { - () - } - } - cleanup_list.push(ptr420) + let array384 : Array[String] = []; + for index385 = 0; index385 < (mbt_ffi_load32((iter_base) + 28)); index385 = index385 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 24)) + (index385 * 8) - () - } - PathValue(payload424) => { - mbt_ffi_store8(iter_base + 0, 25) + let result383 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let ptr425 = mbt_ffi_str2ptr(payload424) - mbt_ffi_store32(iter_base + 12, payload424.length()) - mbt_ffi_store32(iter_base + 8, ptr425) - cleanup_list.push(ptr425) + array384.push(result383) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 24)) - () - } - UrlValue(payload426) => { - mbt_ffi_store8(iter_base + 0, 26) + Option::Some(array384) + } + _ => panic() + } - let ptr427 = mbt_ffi_str2ptr(payload426) - mbt_ffi_store32(iter_base + 12, payload426.length()) - mbt_ffi_store32(iter_base + 8, ptr427) - cleanup_list.push(ptr427) + @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{allowed_schemes : lifted382, allowed_hosts : lifted386}) + } + 28 => { - () - } - DatetimeValue(payload428) => { - mbt_ffi_store8(iter_base + 0, 27) - mbt_ffi_store64(iter_base + 8, payload428.seconds) - mbt_ffi_store32( - iter_base + 16, - payload428.nanoseconds.reinterpret_as_int(), - ) - - () - } - DurationValue(payload429) => { - mbt_ffi_store8(iter_base + 0, 28) - mbt_ffi_store64(iter_base + 8, payload429.nanoseconds) + @types.SchemaTypeBody::DatetimeType + } + 29 => { - () - } - QuantityValueNode(payload430) => { - mbt_ffi_store8(iter_base + 0, 29) - mbt_ffi_store64(iter_base + 8, payload430.mantissa) - mbt_ffi_store32(iter_base + 16, payload430.scale) + @types.SchemaTypeBody::DurationType + } + 30 => { - let ptr431 = mbt_ffi_str2ptr(payload430.unit) - mbt_ffi_store32(iter_base + 24, payload430.unit.length()) - mbt_ffi_store32(iter_base + 20, ptr431) - cleanup_list.push(ptr431) + let result387 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - () - } - UnionValue(payload432) => { - mbt_ffi_store8(iter_base + 0, 30) + let array389 : Array[String] = []; + for index390 = 0; index390 < (mbt_ffi_load32((iter_base) + 20)); index390 = index390 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 16)) + (index390 * 8) - let ptr433 = mbt_ffi_str2ptr(payload432.tag) - mbt_ffi_store32(iter_base + 12, payload432.tag.length()) - mbt_ffi_store32(iter_base + 8, ptr433) - mbt_ffi_store32(iter_base + 16, payload432.body) - cleanup_list.push(ptr433) + let result388 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - () - } - SecretValue(payload434) => { - mbt_ffi_store8(iter_base + 0, 31) + array389.push(result388) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 16)) - let @types.Secret(handle435) = payload434 - mbt_ffi_store32(iter_base + 8, handle435) + let lifted392 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - () - } - QuotaTokenHandle(payload436) => { - mbt_ffi_store8(iter_base + 0, 32) + let result391 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 44), mbt_ffi_load32((iter_base) + 48)) - let @types.QuotaToken(handle437) = payload436 - mbt_ffi_store32(iter_base + 8, handle437) + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 32), scale : mbt_ffi_load32((iter_base) + 40), unit : result391}) + } + _ => panic() + } - () - } - } - } - - let (lowered, lowered442) = match stdin { - None => (0, 0) - Some(payload441) => - ( - 1, - wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamLower( - payload441, - ), - ) - } - let lower_arg = handle - let lower_arg443 = address - let lower_arg444 = command_path.length() - let lower_arg445 = address360 - let lower_arg446 = input.graph.type_nodes.length() - let lower_arg447 = address366 - let lower_arg448 = input.graph.defs.length() - let lower_arg449 = input.graph.root - let lower_arg450 = address438 - let lower_arg451 = input.value.value_nodes.length() - let lower_arg452 = input.value.root - let lower_arg453 = lowered - let lower_arg454 = lowered442 - let result : Int = wasmImportMethodToolRpcAsyncInvokeAndAwait( - lower_arg, lower_arg443, lower_arg444, lower_arg445, lower_arg446, lower_arg447, - lower_arg448, lower_arg449, lower_arg450, lower_arg451, lower_arg452, lower_arg453, - lower_arg454, - ) - - for index458 = 0; index458 < lower_arg446; index458 = index458 + 1 { - let iter_base = lower_arg445 + index458 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => - for index455 = 0 - index455 < mbt_ffi_load32(iter_base + 12) - index455 = index455 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index455 * 68 - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => () - _ => panic() - } + let lifted394 : @types.QuantityValue? = match mbt_ffi_load8_u((iter_base) + 56) { + 0 => Option::None + 1 => { - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => () - _ => panic() - } + let result393 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 76), mbt_ffi_load32((iter_base) + 80)) - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => () - _ => panic() - } - _ => panic() - } - } - 15 => - for index456 = 0 - index456 < mbt_ffi_load32(iter_base + 12) - index456 = index456 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index456 * 72 - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => () - _ => panic() - } + Option::Some(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 64), scale : mbt_ffi_load32((iter_base) + 72), unit : result393}) + } + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => () - _ => panic() - } + @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{base_unit : result387, allowed_suffixes : array389, min : lifted392, max : lifted394}) + } + 31 => { - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => () - _ => panic() - } - _ => panic() - } - } - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => () - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => () - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => () - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => () - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - _ => panic() - } - } - 31 => - for index457 = 0 - index457 < mbt_ffi_load32(iter_base + 12) - index457 = index457 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index457 * 92 + let array418 : Array[@types.UnionBranch] = []; + for index419 = 0; index419 < (mbt_ffi_load32((iter_base) + 12)); index419 = index419 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index419 * 92) - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => () - _ => panic() - } - 5 => () - _ => panic() - } + let result395 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => () - _ => panic() - } + let lifted404 = match (mbt_ffi_load8_u((iter_base) + 12)) { + 0 => { - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => () - _ => panic() - } + let result396 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => () - _ => panic() - } - _ => panic() - } - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => () - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => () - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => () - _ => panic() - } - _ => panic() - } - } - - for index459 = 0; index459 < lower_arg448; index459 = index459 + 1 { - let iter_base = lower_arg447 + index459 * 24 - - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => () - _ => panic() - } - } - - for index460 = 0; index460 < lower_arg451; index460 = index460 + 1 { - let iter_base = lower_arg450 + index460 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => () - _ => panic() - } - 24 => - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => () - _ => panic() - } - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - _ => panic() - } - } - - match lower_arg453 { - 0 => () - 1 => - wasmGolemToolHost010MethodToolRpcAsyncInvokeAndAwaitStream0StreamCommit( - lower_arg454, - ) - _ => panic() - } - let ret = FutureInvokeResult::FutureInvokeResult(result) - mbt_ffi_free(address) - mbt_ffi_free(address360) - mbt_ffi_free(address366) - mbt_ffi_free(address438) - - cleanup_list.each(mbt_ffi_free) - return ret -} + @types.DiscriminatorRule::Prefix(result396) + } + 1 => { -///| -pub async fn FutureInvokeResult::get( - self : FutureInvokeResult, -) -> Result[@common.InvocationResult, RpcError] { - let FutureInvokeResult(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(48 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodFutureInvokeResultGet( - lower_arg, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => { - for index19 = 0 - index19 < mbt_ffi_load32(result_ptr + 12) - index19 = index19 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 8) + index19 * 144 + let result397 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index1 = 0 - index1 < mbt_ffi_load32(iter_base + 12) - index1 = index1 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index1 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - for index = 0 - index < mbt_ffi_load32(iter_base + 28) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index0 = 0 - index0 < mbt_ffi_load32(iter_base + 36) - index0 = index0 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index0 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } + @types.DiscriminatorRule::Suffix(result397) + } + 2 => { - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index4 = 0 - index4 < mbt_ffi_load32(iter_base + 12) - index4 = index4 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index4 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index2 = 0 - index2 < mbt_ffi_load32(iter_base + 32) - index2 = index2 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index2 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index3 = 0 - index3 < mbt_ffi_load32(iter_base + 40) - index3 = index3 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index3 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } + let result398 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index5 = 0 - index5 < mbt_ffi_load32(iter_base + 12) - index5 = index5 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index5 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index6 = 0 - index6 < mbt_ffi_load32(iter_base + 12) - index6 = index6 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index6 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index7 = 0 - index7 < mbt_ffi_load32(iter_base + 16) - index7 = index7 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index7 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index8 = 0 - index8 < mbt_ffi_load32(iter_base + 16) - index8 = index8 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index8 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index9 = 0 - index9 < mbt_ffi_load32(iter_base + 20) - index9 = index9 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index9 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index10 = 0 - index10 < mbt_ffi_load32(iter_base + 32) - index10 = index10 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index10 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index11 = 0 - index11 < mbt_ffi_load32(iter_base + 16) - index11 = index11 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index11 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index12 = 0 - index12 < mbt_ffi_load32(iter_base + 28) - index12 = index12 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index12 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index13 = 0 - index13 < mbt_ffi_load32(iter_base + 20) - index13 = index13 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index13 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index16 = 0 - index16 < mbt_ffi_load32(iter_base + 12) - index16 = index16 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index16 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) + @types.DiscriminatorRule::Contains(result398) + } + 3 => { - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + let result399 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - - for index14 = 0 - index14 < mbt_ffi_load32(iter_base + 52) - index14 = index14 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index14 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - for index15 = 0 - index15 < mbt_ffi_load32(iter_base + 60) - index15 = index15 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index15 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } + @types.DiscriminatorRule::Regex(result399) + } + 4 => { - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } + let result400 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index17 = 0 - index17 < mbt_ffi_load32(iter_base + 104) - index17 = index17 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index17 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index18 = 0 - index18 < mbt_ffi_load32(iter_base + 112) - index18 = index18 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index18 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } + let lifted402 : String? = match mbt_ffi_load8_u((iter_base) + 24) { + 0 => Option::None + 1 => { - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) + let result401 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 28), mbt_ffi_load32((iter_base) + 32)) - for index20 = 0 - index20 < mbt_ffi_load32(result_ptr + 20) - index20 = index20 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 16) + index20 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) + Option::Some(result401) + } + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 16)) + @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{field_name : result400, literal : lifted402}) + } + 5 => { - for index21 = 0 - index21 < mbt_ffi_load32(result_ptr + 32) - index21 = index21 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 28) + index21 * 32 + let result403 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + @types.DiscriminatorRule::FieldAbsent(result403) + } + _ => panic() + } - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) + let lifted406 : String? = match mbt_ffi_load8_u((iter_base) + 36) { + 0 => Option::None + 1 => { - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)).drop() - 32 => - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)).drop() - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 28)) - } - _ => panic() - } + let result405 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 40), mbt_ffi_load32((iter_base) + 44)) - match mbt_ffi_load8_u(result_ptr + 40) { - 0 => () - 1 => { - let result = wasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamLift( - mbt_ffi_load32(result_ptr + 44), - ) - result.drop_sync() - } - _ => panic() - } - } - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 2 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 3 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 4 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 1 => { - for index22 = 0 - index22 < mbt_ffi_load32(result_ptr + 16) - index22 = index22 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 12) + - index22 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - } - 2 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 3 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 4 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 5 => { - for index43 = 0 - index43 < mbt_ffi_load32(result_ptr + 16) - index43 = index43 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 12) + - index43 * 144 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 3 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 4 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 5 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 6 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 7 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 8 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 9 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 10 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 11 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - _ => panic() - } - 12 => () - 13 => () - 14 => { - for index25 = 0 - index25 < mbt_ffi_load32(iter_base + 12) - index25 = index25 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index25 * 68 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - for index23 = 0 - index23 < mbt_ffi_load32(iter_base + 28) - index23 = index23 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index23 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - for index24 = 0 - index24 < mbt_ffi_load32(iter_base + 36) - index24 = index24 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index24 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - match mbt_ffi_load8_u(iter_base + 40) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 52) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => () - 2 => () - 3 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 60)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 15 => { - for index28 = 0 - index28 < mbt_ffi_load32(iter_base + 12) - index28 = index28 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index28 * 72 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - for index26 = 0 - index26 < mbt_ffi_load32(iter_base + 32) - index26 = index26 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index26 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - for index27 = 0 - index27 < mbt_ffi_load32(iter_base + 40) - index27 = index27 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index27 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - match mbt_ffi_load8_u(iter_base + 44) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 60) { - 0 => () - 1 => () - 2 => () - 3 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 64)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 16 => { - for index29 = 0 - index29 < mbt_ffi_load32(iter_base + 12) - index29 = index29 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index29 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 17 => { - for index30 = 0 - index30 < mbt_ffi_load32(iter_base + 12) - index30 = index30 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index30 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index31 = 0 - index31 < mbt_ffi_load32(iter_base + 16) - index31 = index31 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index31 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - } - 25 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index32 = 0 - index32 < mbt_ffi_load32(iter_base + 16) - index32 = index32 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index32 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - 26 => { - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => { - for index33 = 0 - index33 < mbt_ffi_load32(iter_base + 20) - index33 = index33 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index33 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => { - for index34 = 0 - index34 < mbt_ffi_load32(iter_base + 32) - index34 = index34 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index34 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - } - _ => panic() - } - } - 27 => { - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => { - for index35 = 0 - index35 < mbt_ffi_load32(iter_base + 16) - index35 = index35 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index35 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - } - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 20) { - 0 => () - 1 => { - for index36 = 0 - index36 < mbt_ffi_load32(iter_base + 28) - index36 = index36 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index36 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - } - _ => panic() - } - } - 28 => () - 29 => () - 30 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - for index37 = 0 - index37 < mbt_ffi_load32(iter_base + 20) - index37 = index37 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index37 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 44)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 56) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 76)) - _ => panic() - } - } - 31 => { - for index40 = 0 - index40 < mbt_ffi_load32(iter_base + 12) - index40 = index40 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index40 * 92 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 12) { - 0 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 2 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - 4 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - match mbt_ffi_load8_u(iter_base + 24) { - 0 => () - 1 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - _ => panic() - } - } - 5 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 36) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 40)) - _ => panic() - } - - for index38 = 0 - index38 < mbt_ffi_load32(iter_base + 52) - index38 = index38 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index38 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - for index39 = 0 - index39 < mbt_ffi_load32(iter_base + 60) - index39 = index39 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index39 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - match mbt_ffi_load8_u(iter_base + 64) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 68)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 76) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 80) { - 0 => () - 1 => () - 2 => () - 3 => - mbt_ffi_free(mbt_ffi_load32(iter_base + 84)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - } - 32 => - match mbt_ffi_load8_u(iter_base + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - 33 => - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - 34 => () - 35 => () - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 88) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 92)) - _ => panic() - } - - for index41 = 0 - index41 < mbt_ffi_load32(iter_base + 104) - index41 = index41 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + - index41 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - for index42 = 0 - index42 < mbt_ffi_load32(iter_base + 112) - index42 = index42 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + - index42 * 8 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - match mbt_ffi_load8_u(iter_base + 116) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 120)) - _ => panic() - } - - match mbt_ffi_load8_u(iter_base + 128) { - 0 => () - 1 => - match mbt_ffi_load8_u(iter_base + 132) { - 0 => () - 1 => () - 2 => () - 3 => mbt_ffi_free(mbt_ffi_load32(iter_base + 136)) - _ => panic() - } - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - - for index44 = 0 - index44 < mbt_ffi_load32(result_ptr + 24) - index44 = index44 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 20) + - index44 * 24 - mbt_ffi_free(mbt_ffi_load32(iter_base + 0)) - - match mbt_ffi_load8_u(iter_base + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - - for index45 = 0 - index45 < mbt_ffi_load32(result_ptr + 36) - index45 = index45 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 32) + - index45 * 32 - - match mbt_ffi_load8_u(iter_base + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 13 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 14 => () - 15 => () - 16 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 17 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 18 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 19 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 20 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 21 => () - 22 => () - 23 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 24 => { - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - match mbt_ffi_load8_u(iter_base + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - } - 25 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 26 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 27 => () - 28 => () - 29 => mbt_ffi_free(mbt_ffi_load32(iter_base + 20)) - 30 => mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - 31 => - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)).drop() - 32 => - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ).drop() - _ => panic() - } - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 32)) - } - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted480 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - let lifted230 : @types.TypedSchemaValue? = match - mbt_ffi_load8_u(result_ptr + 4) { - 0 => Option::None - 1 => { - let array192 : Array[@types.SchemaTypeNode] = [] - for index193 = 0 - index193 < mbt_ffi_load32(result_ptr + 12) - index193 = index193 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 8) + index193 * 144 - - let lifted178 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => @types.SchemaTypeBody::RefType(mbt_ffi_load32(iter_base + 8)) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted4 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted0 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted) - } - _ => panic() - } - - let lifted2 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted1 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted1) - } - _ => panic() - } - - let lifted3 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted0, - max: lifted2, - unit: lifted3, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S8Type(lifted4) - } - 3 => { - let lifted11 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted6 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted5 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted5) - } - _ => panic() - } - - let lifted8 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted7 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted7) - } - _ => panic() - } - - let lifted10 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result9 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result9) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted6, - max: lifted8, - unit: lifted10, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S16Type(lifted11) - } - 4 => { - let lifted18 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted13 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted12 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted12) - } - _ => panic() - } - - let lifted15 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted14 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted14) - } - _ => panic() - } - - let lifted17 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result16 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result16) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted13, - max: lifted15, - unit: lifted17, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S32Type(lifted18) - } - 5 => { - let lifted25 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted20 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted19 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted19) - } - _ => panic() - } - - let lifted22 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted21 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted21) - } - _ => panic() - } - - let lifted24 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result23) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted20, - max: lifted22, - unit: lifted24, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::S64Type(lifted25) - } - 6 => { - let lifted32 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted27 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted26 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted26) - } - _ => panic() - } - - let lifted29 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted28 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted28) - } - _ => panic() - } - - let lifted31 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result30 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result30) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted27, - max: lifted29, - unit: lifted31, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U8Type(lifted32) - } - 7 => { - let lifted39 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted34 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted33 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted33) - } - _ => panic() - } - - let lifted36 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted35 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted35) - } - _ => panic() - } - - let lifted38 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result37 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result37) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted34, - max: lifted36, - unit: lifted38, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U16Type(lifted39) - } - 8 => { - let lifted46 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted41 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted40 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted40) - } - _ => panic() - } - - let lifted43 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted42 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted42) - } - _ => panic() - } - - let lifted45 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result44 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result44) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted41, - max: lifted43, - unit: lifted45, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U32Type(lifted46) - } - 9 => { - let lifted53 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted48 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted47 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted47) - } - _ => panic() - } - - let lifted50 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted49 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted49) - } - _ => panic() - } - - let lifted52 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result51 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result51) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted48, - max: lifted50, - unit: lifted52, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::U64Type(lifted53) - } - 10 => { - let lifted60 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted55 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted54 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted54) - } - _ => panic() - } - - let lifted57 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted56 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted56) - } - _ => panic() - } - - let lifted59 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result58 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result58) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted55, - max: lifted57, - unit: lifted59, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F32Type(lifted60) - } - 11 => { - let lifted67 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted62 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted61 = match mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted61) - } - _ => panic() - } - - let lifted64 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted63 = match mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted63) - } - _ => panic() - } - - let lifted66 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result65 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result65) - } - _ => panic() - } - - Option::Some(@types.NumericRestrictions::{ - min: lifted62, - max: lifted64, - unit: lifted66, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::F64Type(lifted67) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array80 : Array[@types.NamedFieldType] = [] - for index81 = 0 - index81 < mbt_ffi_load32(iter_base + 12) - index81 = index81 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index81 * 68 - - let result68 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted70 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result69 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result69) - } - _ => panic() - } - - let array : Array[String] = [] - for index = 0 - index < mbt_ffi_load32(iter_base + 28) - index = index + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + index * 8 - - let result71 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result71) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array73 : Array[String] = [] - for index74 = 0 - index74 < mbt_ffi_load32(iter_base + 36) - index74 = index74 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + index74 * 8 - - let result72 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array73.push(result72) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted76 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result75 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(result75) - } - _ => panic() - } - - let lifted79 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted78 = match mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result77 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) + Option::Some(result405) + } + _ => panic() + } + + let array408 : Array[String] = []; + for index409 = 0; index409 < (mbt_ffi_load32((iter_base) + 52)); index409 = index409 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 48)) + (index409 * 8) + + let result407 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array408.push(result407) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 48)) + + let array411 : Array[String] = []; + for index412 = 0; index412 < (mbt_ffi_load32((iter_base) + 60)); index412 = index412 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 56)) + (index412 * 8) - @types.Role::Other(result77) - } - _ => panic() - } - - Option::Some(lifted78) - } - _ => panic() - } - - array80.push(@types.NamedFieldType::{ - name: result68, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted70, - aliases: array, - examples: array73, - deprecated: lifted76, - role: lifted79, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array80) - } - 15 => { - let array97 : Array[@types.VariantCaseType] = [] - for index98 = 0 - index98 < mbt_ffi_load32(iter_base + 12) - index98 = index98 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index98 * 72 - - let result82 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted83 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted85 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result84 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result84) - } - _ => panic() - } - - let array87 : Array[String] = [] - for index88 = 0 - index88 < mbt_ffi_load32(iter_base + 32) - index88 = index88 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + index88 * 8 - - let result86 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array87.push(result86) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array90 : Array[String] = [] - for index91 = 0 - index91 < mbt_ffi_load32(iter_base + 40) - index91 = index91 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + index91 * 8 - - let result89 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array90.push(result89) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted93 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result92 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) - - Option::Some(result92) - } - _ => panic() - } - - let lifted96 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted95 = match mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result94 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) + let result410 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @types.Role::Other(result94) - } - _ => panic() - } - - Option::Some(lifted95) - } - _ => panic() - } - - array97.push(@types.VariantCaseType::{ - name: result82, - payload: lifted83, - metadata: @types.MetadataEnvelope::{ - doc: lifted85, - aliases: array87, - examples: array90, - deprecated: lifted93, - role: lifted96, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array97) - } - 16 => { - let array100 : Array[String] = [] - for index101 = 0 - index101 < mbt_ffi_load32(iter_base + 12) - index101 = index101 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index101 * 8 - - let result99 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array100.push(result99) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array100) - } - 17 => { - let array103 : Array[String] = [] - for index104 = 0 - index104 < mbt_ffi_load32(iter_base + 12) - index104 = index104 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index104 * 8 - - let result102 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array103.push(result102) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array103) - } - 18 => { - let array105 : Array[Int] = [] - for index106 = 0 - index106 < mbt_ffi_load32(iter_base + 12) - index106 = index106 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index106 * 4 - - array105.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array105) - } - 19 => - @types.SchemaTypeBody::ListType(mbt_ffi_load32(iter_base + 8)) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType(mbt_ffi_load32(iter_base + 8)) - 23 => { - let lifted107 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + array411.push(result410) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 56)) - let lifted108 : Int? = match mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted107, - err: lifted108, - }) - } - 24 => { - let lifted112 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array110 : Array[String] = [] - for index111 = 0 - index111 < mbt_ffi_load32(iter_base + 16) - index111 = index111 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index111 * 8 + let lifted414 : String? = match mbt_ffi_load8_u((iter_base) + 64) { + 0 => Option::None + 1 => { - let result109 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let result413 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 68), mbt_ffi_load32((iter_base) + 72)) - array110.push(result109) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + Option::Some(result413) + } + _ => panic() + } - Option::Some(array110) - } - _ => panic() - } - - let lifted113 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted114 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } + let lifted417 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 76) { + 0 => Option::None + 1 => { - let lifted116 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result115 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + let lifted416 = match (mbt_ffi_load8_u((iter_base) + 80)) { + 0 => { - Option::Some(result115) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted112, - min_length: lifted113, - max_length: lifted114, - regex: lifted116, - }) - } - 25 => { - let lifted120 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array118 : Array[String] = [] - for index119 = 0 - index119 < mbt_ffi_load32(iter_base + 16) - index119 = index119 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index119 * 8 + @types.Role::Multimodal + } + 1 => { - let result117 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.Role::UnstructuredText + } + 2 => { - array118.push(result117) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + @types.Role::UnstructuredBinary + } + 3 => { - Option::Some(array118) - } - _ => panic() - } - - let lifted121 : UInt? = match mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted122 : UInt? = match mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted120, - min_bytes: lifted121, - max_bytes: lifted122, - }) - } - 26 => { - let lifted126 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array124 : Array[String] = [] - for index125 = 0 - index125 < mbt_ffi_load32(iter_base + 20) - index125 = index125 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index125 * 8 + let result415 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 84), mbt_ffi_load32((iter_base) + 88)) - let result123 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.Role::Other(result415) + } + _ => panic() + } - array124.push(result123) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) + Option::Some(lifted416) + } + _ => panic() + } - Option::Some(array124) - } - _ => panic() - } + array418.push(@types.UnionBranch::{tag : result395, body : mbt_ffi_load32((iter_base) + 8), discriminator : lifted404, metadata : @types.MetadataEnvelope::{doc : lifted406, aliases : array408, examples : array411, deprecated : lifted414, role : lifted417}}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted130 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array128 : Array[String] = [] - for index129 = 0 - index129 < mbt_ffi_load32(iter_base + 32) - index129 = index129 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index129 * 8 + @types.SchemaTypeBody::UnionType(@types.UnionSpec::{branches : array418}) + } + 32 => { - let result127 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + let lifted421 : String? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - array128.push(result127) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) + let result420 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20)) - Option::Some(array128) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from(mbt_ffi_load8_u(iter_base + 9)), - allowed_mime_types: lifted126, - allowed_extensions: lifted130, - }) - } - 27 => { - let lifted134 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array132 : Array[String] = [] - for index133 = 0 - index133 < mbt_ffi_load32(iter_base + 16) - index133 = index133 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index133 * 8 + Option::Some(result420) + } + _ => panic() + } - let result131 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::SecretType(@types.SecretSpec::{inner : mbt_ffi_load32((iter_base) + 8), category : lifted421}) + } + 33 => { - array132.push(result131) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) + let lifted423 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(array132) - } - _ => panic() - } + let result422 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - let lifted138 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array136 : Array[String] = [] - for index137 = 0 - index137 < mbt_ffi_load32(iter_base + 28) - index137 = index137 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index137 * 8 + Option::Some(result422) + } + _ => panic() + } - let result135 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{resource_name : lifted423}) + } + 34 => { - array136.push(result135) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) + @types.SchemaTypeBody::PermissionCardType(@types.PermissionCardSpec::{polymorphic : (mbt_ffi_load8_u((iter_base) + 8) != 0)}) + } + 35 => { - Option::Some(array136) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted134, - allowed_hosts: lifted138, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result139 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array141 : Array[String] = [] - for index142 = 0 - index142 < mbt_ffi_load32(iter_base + 20) - index142 = index142 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + index142 * 8 - - let result140 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array141.push(result140) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted144 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result143 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) + let lifted424 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result143, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - let lifted146 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result145 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) + @types.SchemaTypeBody::FutureType(lifted424) + } + 36 => { - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result145, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result139, - allowed_suffixes: array141, - min: lifted144, - max: lifted146, - }) - } - 31 => { - let array170 : Array[@types.UnionBranch] = [] - for index171 = 0 - index171 < mbt_ffi_load32(iter_base + 12) - index171 = index171 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index171 * 92 - - let result147 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted156 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result148 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Prefix(result148) - } - 1 => { - let result149 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Suffix(result149) - } - 2 => { - let result150 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Contains(result150) - } - 3 => { - let result151 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::Regex(result151) - } - 4 => { - let result152 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted154 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result153 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) + let lifted425 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - Option::Some(result153) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result152, - literal: lifted154, - }) - } - 5 => { - let result155 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - @types.DiscriminatorRule::FieldAbsent(result155) - } - _ => panic() - } - - let lifted158 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result157 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result157) - } - _ => panic() - } - - let array160 : Array[String] = [] - for index161 = 0 - index161 < mbt_ffi_load32(iter_base + 52) - index161 = index161 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index161 * 8 - - let result159 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array160.push(result159) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array163 : Array[String] = [] - for index164 = 0 - index164 < mbt_ffi_load32(iter_base + 60) - index164 = index164 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index164 * 8 - - let result162 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array163.push(result162) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted166 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result165 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) - - Option::Some(result165) - } - _ => panic() - } - - let lifted169 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted168 = match mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result167 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - @types.Role::Other(result167) - } - _ => panic() - } - - Option::Some(lifted168) - } - _ => panic() - } - - array170.push(@types.UnionBranch::{ - tag: result147, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted156, - metadata: @types.MetadataEnvelope::{ - doc: lifted158, - aliases: array160, - examples: array163, - deprecated: lifted166, - role: lifted169, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array170, - }) - } - 32 => { - let lifted173 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result172 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.SchemaTypeBody::StreamType(lifted425) + } + _ => panic() + } - Option::Some(result172) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted173, - }) - } - 33 => { - let lifted175 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result174 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + let lifted428 : String? = match mbt_ffi_load8_u((iter_base) + 88) { + 0 => Option::None + 1 => { - Option::Some(result174) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted175, - }) - } - 34 => { - let lifted176 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted176) - } - 35 => { - let lifted177 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + let result427 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 92), mbt_ffi_load32((iter_base) + 96)) - @types.SchemaTypeBody::StreamType(lifted177) - } - _ => panic() - } + Option::Some(result427) + } + _ => panic() + } - let lifted180 : String? = match mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result179 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) - - Option::Some(result179) - } - _ => panic() - } + let array430 : Array[String] = []; + for index431 = 0; index431 < (mbt_ffi_load32((iter_base) + 104)); index431 = index431 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 100)) + (index431 * 8) - let array182 : Array[String] = [] - for index183 = 0 - index183 < mbt_ffi_load32(iter_base + 104) - index183 = index183 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index183 * 8 + let result429 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result181 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array430.push(result429) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 100)) - array182.push(result181) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) + let array433 : Array[String] = []; + for index434 = 0; index434 < (mbt_ffi_load32((iter_base) + 112)); index434 = index434 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 108)) + (index434 * 8) - let array185 : Array[String] = [] - for index186 = 0 - index186 < mbt_ffi_load32(iter_base + 112) - index186 = index186 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index186 * 8 + let result432 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - let result184 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) + array433.push(result432) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 108)) - array185.push(result184) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted188 : String? = match mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result187 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) - - Option::Some(result187) - } - _ => panic() - } + let lifted436 : String? = match mbt_ffi_load8_u((iter_base) + 116) { + 0 => Option::None + 1 => { - let lifted191 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted190 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result189 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) + let result435 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 120), mbt_ffi_load32((iter_base) + 124)) - @types.Role::Other(result189) - } - _ => panic() - } + Option::Some(result435) + } + _ => panic() + } - Option::Some(lifted190) - } - _ => panic() - } + let lifted439 : @types.Role? = match mbt_ffi_load8_u((iter_base) + 128) { + 0 => Option::None + 1 => { - array192.push(@types.SchemaTypeNode::{ - body: lifted178, - metadata: @types.MetadataEnvelope::{ - doc: lifted180, - aliases: array182, - examples: array185, - deprecated: lifted188, - role: lifted191, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - - let array197 : Array[@types.SchemaTypeDef] = [] - for index198 = 0 - index198 < mbt_ffi_load32(result_ptr + 20) - index198 = index198 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 16) + index198 * 24 - - let result194 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted196 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result195 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result195) - } - _ => panic() - } + let lifted438 = match (mbt_ffi_load8_u((iter_base) + 132)) { + 0 => { - array197.push(@types.SchemaTypeDef::{ - id: result194, - name: lifted196, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 16)) - - let array228 : Array[@types.SchemaValueNode] = [] - for index229 = 0 - index229 < mbt_ffi_load32(result_ptr + 32) - index229 = index229 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 28) + index229 * 32 - - let lifted227 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => @types.SchemaValueNode::S8Value(mbt_ffi_load8(iter_base + 8)) - 2 => - @types.SchemaValueNode::S16Value(mbt_ffi_load16(iter_base + 8)) - 3 => - @types.SchemaValueNode::S32Value(mbt_ffi_load32(iter_base + 8)) - 4 => - @types.SchemaValueNode::S64Value(mbt_ffi_load64(iter_base + 8)) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value(mbt_ffi_loadf32(iter_base + 8)) - 10 => - @types.SchemaValueNode::F64Value(mbt_ffi_loadf64(iter_base + 8)) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result199 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result199) - } - 13 => { - let array200 : Array[Int] = [] - for index201 = 0 - index201 < mbt_ffi_load32(iter_base + 12) - index201 = index201 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index201 * 4 - - array200.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array200) - } - 14 => { - let lifted202 : Int? = match mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted202, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array203 : Array[Bool] = [] - for index204 = 0 - index204 < mbt_ffi_load32(iter_base + 12) - index204 = index204 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index204 * 1 - - array203.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array203) - } - 17 => { - let array205 : Array[Int] = [] - for index206 = 0 - index206 < mbt_ffi_load32(iter_base + 12) - index206 = index206 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index206 * 4 - - array205.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array205) - } - 18 => { - let array207 : Array[Int] = [] - for index208 = 0 - index208 < mbt_ffi_load32(iter_base + 12) - index208 = index208 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index208 * 4 - - array207.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array207) - } - 19 => { - let array209 : Array[Int] = [] - for index210 = 0 - index210 < mbt_ffi_load32(iter_base + 12) - index210 = index210 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index210 * 4 - - array209.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array209) - } - 20 => { - let array211 : Array[@types.MapEntry] = [] - for index212 = 0 - index212 < mbt_ffi_load32(iter_base + 12) - index212 = index212 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + index212 * 8 - - array211.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array211) - } - 21 => { - let lifted213 : Int? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + @types.Role::Multimodal + } + 1 => { - @types.SchemaValueNode::OptionValue(lifted213) - } - 22 => { - let lifted216 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted214 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.Role::UnstructuredText + } + 2 => { - @types.ResultValuePayload::OkValue(lifted214) - } - 1 => { - let lifted215 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } + @types.Role::UnstructuredBinary + } + 3 => { - @types.ResultValuePayload::ErrValue(lifted215) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted216) - } - 23 => { - let result217 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted219 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result218 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + let result437 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 136), mbt_ffi_load32((iter_base) + 140)) - Option::Some(result218) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result217, - language: lifted219, - }) - } - 24 => { - let result220 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted222 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result221 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.Role::Other(result437) + } + _ => panic() + } - Option::Some(result221) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result220, - mime_type: lifted222, - }) - } - 25 => { - let result223 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::PathValue(result223) - } - 26 => { - let result224 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result224) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result225 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result225, - }) - } - 30 => { - let result226 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result226, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken(mbt_ffi_load32(iter_base + 8)), - ) - _ => panic() - } + Option::Some(lifted438) + } + _ => panic() + } - array228.push(lifted227) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 28)) - - Option::Some(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array192, - defs: array197, - root: mbt_ffi_load32(result_ptr + 24), - }, - value: @types.SchemaValueTree::{ - value_nodes: array228, - root: mbt_ffi_load32(result_ptr + 36), - }, - }) - } - _ => panic() - } + array440.push(@types.SchemaTypeNode::{body : lifted426, metadata : @types.MetadataEnvelope::{doc : lifted428, aliases : array430, examples : array433, deprecated : lifted436, role : lifted439}}) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) - let lifted232 : @async-core.Stream[Byte]? = match - mbt_ffi_load8_u(result_ptr + 40) { - 0 => Option::None - 1 => { - let result231 = wasmGolemToolHost010MethodFutureInvokeResultGetStream0StreamLift( - mbt_ffi_load32(result_ptr + 44), - ) - - Option::Some(result231) - } - _ => panic() - } + let array445 : Array[@types.SchemaTypeDef] = []; + for index446 = 0; index446 < (mbt_ffi_load32((result_ptr) + 24)); index446 = index446 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 20)) + (index446 * 24) - Result::Ok(@common.InvocationResult::{ - result: lifted230, - stdout: lifted232, - }) - } - 1 => { - let lifted479 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => { - let result233 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - RpcError::ProtocolError(result233) - } - 1 => { - let result234 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - RpcError::Denied(result234) - } - 2 => { - let result235 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - RpcError::NotFound(result235) - } - 3 => { - let result236 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - RpcError::RemoteInternalError(result236) - } - 4 => { - let lifted478 = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => { - let result237 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + let result442 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) - @common.ToolError::InvalidToolName(result237) - } - 1 => { - let array239 : Array[String] = [] - for index240 = 0 - index240 < mbt_ffi_load32(result_ptr + 16) - index240 = index240 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 12) + index240 * 8 - - let result238 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array239.push(result238) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - - @common.ToolError::InvalidCommandPath(array239) - } - 2 => { - let result241 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + let lifted444 : String? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @common.ToolError::InvalidInput(result241) - } - 3 => { - let result242 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + let result443 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 12), mbt_ffi_load32((iter_base) + 16)) - @common.ToolError::ConstraintViolation(result242) - } - 4 => { - let result243 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + Option::Some(result443) + } + _ => panic() + } - @common.ToolError::InvalidResult(result243) - } - 5 => { - let array440 : Array[@types.SchemaTypeNode] = [] - for index441 = 0 - index441 < mbt_ffi_load32(result_ptr + 16) - index441 = index441 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 12) + index441 * 144 - - let lifted426 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaTypeBody::RefType( - mbt_ffi_load32(iter_base + 8), - ) - 1 => @types.SchemaTypeBody::BoolType - 2 => { - let lifted250 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted245 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted244 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted244) - } - _ => panic() - } - - let lifted247 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted246 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array445.push(@types.SchemaTypeDef::{id : result442, name : lifted444, body : mbt_ffi_load32((iter_base) + 20)}) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) - Option::Some(lifted246) - } - _ => panic() - } + let array476 : Array[@types.SchemaValueNode] = []; + for index477 = 0; index477 < (mbt_ffi_load32((result_ptr) + 36)); index477 = index477 + 1 { + let iter_base = (mbt_ffi_load32((result_ptr) + 32)) + (index477 * 32) - let lifted249 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result248 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted475 = match (mbt_ffi_load8_u((iter_base) + 0)) { + 0 => { - Option::Some(result248) - } - _ => panic() - } + @types.SchemaValueNode::BoolValue((mbt_ffi_load8_u((iter_base) + 8) != 0)) + } + 1 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted245, - max: lifted247, - unit: lifted249, - }) - } - _ => panic() - } + @types.SchemaValueNode::S8Value((mbt_ffi_load8((iter_base) + 8))) + } + 2 => { - @types.SchemaTypeBody::S8Type(lifted250) - } - 3 => { - let lifted257 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted252 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted251 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted251) - } - _ => panic() - } - - let lifted254 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted253 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::S16Value((mbt_ffi_load16((iter_base) + 8))) + } + 3 => { - Option::Some(lifted253) - } - _ => panic() - } + @types.SchemaValueNode::S32Value(mbt_ffi_load32((iter_base) + 8)) + } + 4 => { - let lifted256 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result255 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::S64Value(mbt_ffi_load64((iter_base) + 8)) + } + 5 => { - Option::Some(result255) - } - _ => panic() - } + @types.SchemaValueNode::U8Value((mbt_ffi_load8_u((iter_base) + 8)).to_byte()) + } + 6 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted252, - max: lifted254, - unit: lifted256, - }) - } - _ => panic() - } + @types.SchemaValueNode::U16Value((mbt_ffi_load16_u((iter_base) + 8).land(0xFFFF).reinterpret_as_uint())) + } + 7 => { - @types.SchemaTypeBody::S16Type(lifted257) - } - 4 => { - let lifted264 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted259 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted258 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted258) - } - _ => panic() - } - - let lifted261 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted260 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::U32Value((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 8 => { - Option::Some(lifted260) - } - _ => panic() - } + @types.SchemaValueNode::U64Value((mbt_ffi_load64((iter_base) + 8)).reinterpret_as_uint64()) + } + 9 => { - let lifted263 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result262 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::F32Value(mbt_ffi_loadf32((iter_base) + 8)) + } + 10 => { - Option::Some(result262) - } - _ => panic() - } + @types.SchemaValueNode::F64Value(mbt_ffi_loadf64((iter_base) + 8)) + } + 11 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted259, - max: lifted261, - unit: lifted263, - }) - } - _ => panic() - } + @types.SchemaValueNode::CharValue(Int::unsafe_to_char(mbt_ffi_load32((iter_base) + 8))) + } + 12 => { - @types.SchemaTypeBody::S32Type(lifted264) - } - 5 => { - let lifted271 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted266 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted265 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted265) - } - _ => panic() - } - - let lifted268 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted267 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let result447 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(lifted267) - } - _ => panic() - } + @types.SchemaValueNode::StringValue(result447) + } + 13 => { - let lifted270 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result269 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let array448 : Array[Int] = []; + for index449 = 0; index449 < (mbt_ffi_load32((iter_base) + 12)); index449 = index449 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index449 * 4) - Option::Some(result269) - } - _ => panic() - } + array448.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(@types.NumericRestrictions::{ - min: lifted266, - max: lifted268, - unit: lifted270, - }) - } - _ => panic() - } + @types.SchemaValueNode::RecordValue(array448) + } + 14 => { - @types.SchemaTypeBody::S64Type(lifted271) - } - 6 => { - let lifted278 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted273 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted272 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted272) - } - _ => panic() - } - - let lifted275 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted274 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let lifted450 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(lifted274) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - let lifted277 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result276 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{case : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), payload : lifted450}) + } + 15 => { - Option::Some(result276) - } - _ => panic() - } + @types.SchemaValueNode::EnumValue((mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint()) + } + 16 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted273, - max: lifted275, - unit: lifted277, - }) - } - _ => panic() - } + let array451 : Array[Bool] = []; + for index452 = 0; index452 < (mbt_ffi_load32((iter_base) + 12)); index452 = index452 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index452 * 1) - @types.SchemaTypeBody::U8Type(lifted278) - } - 7 => { - let lifted285 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted280 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted279 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted279) - } - _ => panic() - } - - let lifted282 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted281 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + array451.push((mbt_ffi_load8_u((iter_base) + 0) != 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(lifted281) - } - _ => panic() - } + @types.SchemaValueNode::FlagsValue(array451) + } + 17 => { - let lifted284 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result283 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let array453 : Array[Int] = []; + for index454 = 0; index454 < (mbt_ffi_load32((iter_base) + 12)); index454 = index454 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index454 * 4) - Option::Some(result283) - } - _ => panic() - } + array453.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(@types.NumericRestrictions::{ - min: lifted280, - max: lifted282, - unit: lifted284, - }) - } - _ => panic() - } + @types.SchemaValueNode::TupleValue(array453) + } + 18 => { - @types.SchemaTypeBody::U16Type(lifted285) - } - 8 => { - let lifted292 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted287 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted286 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted286) - } - _ => panic() - } - - let lifted289 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted288 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + let array455 : Array[Int] = []; + for index456 = 0; index456 < (mbt_ffi_load32((iter_base) + 12)); index456 = index456 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index456 * 4) - Option::Some(lifted288) - } - _ => panic() - } + array455.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - let lifted291 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result290 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::ListValue(array455) + } + 19 => { - Option::Some(result290) - } - _ => panic() - } + let array457 : Array[Int] = []; + for index458 = 0; index458 < (mbt_ffi_load32((iter_base) + 12)); index458 = index458 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index458 * 4) - Option::Some(@types.NumericRestrictions::{ - min: lifted287, - max: lifted289, - unit: lifted291, - }) - } - _ => panic() - } + array457.push(mbt_ffi_load32((iter_base) + 0)) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - @types.SchemaTypeBody::U32Type(lifted292) - } - 9 => { - let lifted299 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted294 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted293 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted293) - } - _ => panic() - } - - let lifted296 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted295 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.SchemaValueNode::FixedListValue(array457) + } + 20 => { - Option::Some(lifted295) - } - _ => panic() - } + let array459 : Array[@types.MapEntry] = []; + for index460 = 0; index460 < (mbt_ffi_load32((iter_base) + 12)); index460 = index460 + 1 { + let iter_base = (mbt_ffi_load32((iter_base) + 8)) + (index460 * 8) - let lifted298 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result297 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + array459.push(@types.MapEntry::{key : mbt_ffi_load32((iter_base) + 0), value : mbt_ffi_load32((iter_base) + 4)}) + } + mbt_ffi_free(mbt_ffi_load32((iter_base) + 8)) - Option::Some(result297) - } - _ => panic() - } + @types.SchemaValueNode::MapValue(array459) + } + 21 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted294, - max: lifted296, - unit: lifted298, - }) - } - _ => panic() - } + let lifted461 : Int? = match mbt_ffi_load8_u((iter_base) + 8) { + 0 => Option::None + 1 => { - @types.SchemaTypeBody::U64Type(lifted299) - } - 10 => { - let lifted306 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted301 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted300 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted300) - } - _ => panic() - } - - let lifted303 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted302 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 12)) + } + _ => panic() + } - Option::Some(lifted302) - } - _ => panic() - } + @types.SchemaValueNode::OptionValue(lifted461) + } + 22 => { - let lifted305 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result304 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + let lifted464 = match (mbt_ffi_load8_u((iter_base) + 8)) { + 0 => { - Option::Some(result304) - } - _ => panic() - } + let lifted462 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - Option::Some(@types.NumericRestrictions::{ - min: lifted301, - max: lifted303, - unit: lifted305, - }) - } - _ => panic() - } + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - @types.SchemaTypeBody::F32Type(lifted306) - } - 11 => { - let lifted313 : @types.NumericRestrictions? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let lifted308 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let lifted307 = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 32), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 32).reinterpret_as_uint64(), - ) - _ => panic() - } - - Option::Some(lifted307) - } - _ => panic() - } - - let lifted310 : @types.NumericBound? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let lifted309 = match - mbt_ffi_load8_u(iter_base + 48) { - 0 => - @types.NumericBound::Signed( - mbt_ffi_load64(iter_base + 56), - ) - 1 => - @types.NumericBound::Unsigned( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - 2 => - @types.NumericBound::FloatBits( - mbt_ffi_load64(iter_base + 56).reinterpret_as_uint64(), - ) - _ => panic() - } + @types.ResultValuePayload::OkValue(lifted462) + } + 1 => { - Option::Some(lifted309) - } - _ => panic() - } + let lifted463 : Int? = match mbt_ffi_load8_u((iter_base) + 12) { + 0 => Option::None + 1 => { - let lifted312 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result311 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + Option::Some(mbt_ffi_load32((iter_base) + 16)) + } + _ => panic() + } - Option::Some(result311) - } - _ => panic() - } + @types.ResultValuePayload::ErrValue(lifted463) + } + _ => panic() + } - Option::Some(@types.NumericRestrictions::{ - min: lifted308, - max: lifted310, - unit: lifted312, - }) - } - _ => panic() - } + @types.SchemaValueNode::ResultValue(lifted464) + } + 23 => { - @types.SchemaTypeBody::F64Type(lifted313) - } - 12 => @types.SchemaTypeBody::CharType - 13 => @types.SchemaTypeBody::StringType - 14 => { - let array328 : Array[@types.NamedFieldType] = [] - for index329 = 0 - index329 < mbt_ffi_load32(iter_base + 12) - index329 = index329 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index329 * 68 - - let result314 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted316 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result315 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let result465 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(result315) - } - _ => panic() - } - - let array318 : Array[String] = [] - for index319 = 0 - index319 < mbt_ffi_load32(iter_base + 28) - index319 = index319 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index319 * 8 - - let result317 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array318.push(result317) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - let array321 : Array[String] = [] - for index322 = 0 - index322 < mbt_ffi_load32(iter_base + 36) - index322 = index322 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 32) + - index322 * 8 - - let result320 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array321.push(result320) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 32)) - - let lifted324 : String? = match - mbt_ffi_load8_u(iter_base + 40) { - 0 => Option::None - 1 => { - let result323 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) + let lifted467 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - Option::Some(result323) - } - _ => panic() - } + let result466 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted327 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 52) { - 0 => Option::None - 1 => { - let lifted326 = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result325 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 60), - mbt_ffi_load32(iter_base + 64), - ) - - @types.Role::Other(result325) - } - _ => panic() - } - - Option::Some(lifted326) - } - _ => panic() - } - - array328.push(@types.NamedFieldType::{ - name: result314, - body: mbt_ffi_load32(iter_base + 8), - metadata: @types.MetadataEnvelope::{ - doc: lifted316, - aliases: array318, - examples: array321, - deprecated: lifted324, - role: lifted327, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::RecordType(array328) - } - 15 => { - let array345 : Array[@types.VariantCaseType] = [] - for index346 = 0 - index346 < mbt_ffi_load32(iter_base + 12) - index346 = index346 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index346 * 72 - - let result330 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted331 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } + Option::Some(result466) + } + _ => panic() + } - let lifted333 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result332 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) + @types.SchemaValueNode::TextValue(@types.TextValuePayload::{text : result465, language : lifted467}) + } + 24 => { - Option::Some(result332) - } - _ => panic() - } - - let array335 : Array[String] = [] - for index336 = 0 - index336 < mbt_ffi_load32(iter_base + 32) - index336 = index336 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index336 * 8 - - let result334 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array335.push(result334) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - let array338 : Array[String] = [] - for index339 = 0 - index339 < mbt_ffi_load32(iter_base + 40) - index339 = index339 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 36) + - index339 * 8 - - let result337 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array338.push(result337) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 36)) - - let lifted341 : String? = match - mbt_ffi_load8_u(iter_base + 44) { - 0 => Option::None - 1 => { - let result340 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 48), - mbt_ffi_load32(iter_base + 52), - ) + let result468 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(result340) - } - _ => panic() - } + let lifted470 : String? = match mbt_ffi_load8_u((iter_base) + 16) { + 0 => Option::None + 1 => { - let lifted344 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let lifted343 = match - mbt_ffi_load8_u(iter_base + 60) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result342 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 64), - mbt_ffi_load32(iter_base + 68), - ) - - @types.Role::Other(result342) - } - _ => panic() - } - - Option::Some(lifted343) - } - _ => panic() - } - - array345.push(@types.VariantCaseType::{ - name: result330, - payload: lifted331, - metadata: @types.MetadataEnvelope::{ - doc: lifted333, - aliases: array335, - examples: array338, - deprecated: lifted341, - role: lifted344, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::VariantType(array345) - } - 16 => { - let array348 : Array[String] = [] - for index349 = 0 - index349 < mbt_ffi_load32(iter_base + 12) - index349 = index349 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index349 * 8 - - let result347 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array348.push(result347) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::EnumType(array348) - } - 17 => { - let array351 : Array[String] = [] - for index352 = 0 - index352 < mbt_ffi_load32(iter_base + 12) - index352 = index352 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index352 * 8 - - let result350 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array351.push(result350) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::FlagsType(array351) - } - 18 => { - let array353 : Array[Int] = [] - for index354 = 0 - index354 < mbt_ffi_load32(iter_base + 12) - index354 = index354 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index354 * 4 - - array353.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::TupleType(array353) - } - 19 => - @types.SchemaTypeBody::ListType( - mbt_ffi_load32(iter_base + 8), - ) - 20 => - @types.SchemaTypeBody::FixedListType(@types.FixedListSpec::{ - element: mbt_ffi_load32(iter_base + 8), - length: mbt_ffi_load32(iter_base + 12).reinterpret_as_uint(), - }) - 21 => - @types.SchemaTypeBody::MapType(@types.MapSpec::{ - key: mbt_ffi_load32(iter_base + 8), - value: mbt_ffi_load32(iter_base + 12), - }) - 22 => - @types.SchemaTypeBody::OptionType( - mbt_ffi_load32(iter_base + 8), - ) - 23 => { - let lifted355 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - let lifted356 : Int? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 20)) - _ => panic() - } - - @types.SchemaTypeBody::ResultType(@types.ResultSpec::{ - ok: lifted355, - err: lifted356, - }) - } - 24 => { - let lifted360 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array358 : Array[String] = [] - for index359 = 0 - index359 < mbt_ffi_load32(iter_base + 16) - index359 = index359 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index359 * 8 - - let result357 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array358.push(result357) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array358) - } - _ => panic() - } - - let lifted361 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted362 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted364 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result363 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) - - Option::Some(result363) - } - _ => panic() - } - - @types.SchemaTypeBody::TextType(@types.TextRestrictions::{ - languages: lifted360, - min_length: lifted361, - max_length: lifted362, - regex: lifted364, - }) - } - 25 => { - let lifted368 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array366 : Array[String] = [] - for index367 = 0 - index367 < mbt_ffi_load32(iter_base + 16) - index367 = index367 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index367 * 8 - - let result365 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array366.push(result365) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array366) - } - _ => panic() - } - - let lifted369 : UInt? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 24).reinterpret_as_uint(), - ) - _ => panic() - } - - let lifted370 : UInt? = match - mbt_ffi_load8_u(iter_base + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(iter_base + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.SchemaTypeBody::BinaryType(@types.BinaryRestrictions::{ - mime_types: lifted368, - min_bytes: lifted369, - max_bytes: lifted370, - }) - } - 26 => { - let lifted374 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let array372 : Array[String] = [] - for index373 = 0 - index373 < mbt_ffi_load32(iter_base + 20) - index373 = index373 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index373 * 8 - - let result371 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array372.push(result371) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - Option::Some(array372) - } - _ => panic() - } - - let lifted378 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let array376 : Array[String] = [] - for index377 = 0 - index377 < mbt_ffi_load32(iter_base + 32) - index377 = index377 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 28) + - index377 * 8 - - let result375 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array376.push(result375) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 28)) - - Option::Some(array376) - } - _ => panic() - } - - @types.SchemaTypeBody::PathType(@types.PathSpec::{ - direction: @types.PathDirection::from( - mbt_ffi_load8_u(iter_base + 8), - ), - kind: @types.PathKind::from( - mbt_ffi_load8_u(iter_base + 9), - ), - allowed_mime_types: lifted374, - allowed_extensions: lifted378, - }) - } - 27 => { - let lifted382 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let array380 : Array[String] = [] - for index381 = 0 - index381 < mbt_ffi_load32(iter_base + 16) - index381 = index381 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 12) + - index381 * 8 - - let result379 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array380.push(result379) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 12)) - - Option::Some(array380) - } - _ => panic() - } - - let lifted386 : Array[String]? = match - mbt_ffi_load8_u(iter_base + 20) { - 0 => Option::None - 1 => { - let array384 : Array[String] = [] - for index385 = 0 - index385 < mbt_ffi_load32(iter_base + 28) - index385 = index385 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 24) + - index385 * 8 - - let result383 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array384.push(result383) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 24)) - - Option::Some(array384) - } - _ => panic() - } - - @types.SchemaTypeBody::UrlType(@types.UrlRestrictions::{ - allowed_schemes: lifted382, - allowed_hosts: lifted386, - }) - } - 28 => @types.SchemaTypeBody::DatetimeType - 29 => @types.SchemaTypeBody::DurationType - 30 => { - let result387 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let array389 : Array[String] = [] - for index390 = 0 - index390 < mbt_ffi_load32(iter_base + 20) - index390 = index390 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 16) + - index390 * 8 - - let result388 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array389.push(result388) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 16)) - - let lifted392 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result391 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 44), - mbt_ffi_load32(iter_base + 48), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 32), - scale: mbt_ffi_load32(iter_base + 40), - unit: result391, - }) - } - _ => panic() - } - - let lifted394 : @types.QuantityValue? = match - mbt_ffi_load8_u(iter_base + 56) { - 0 => Option::None - 1 => { - let result393 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 76), - mbt_ffi_load32(iter_base + 80), - ) - - Option::Some(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 64), - scale: mbt_ffi_load32(iter_base + 72), - unit: result393, - }) - } - _ => panic() - } - - @types.SchemaTypeBody::QuantityType(@types.QuantitySpec::{ - base_unit: result387, - allowed_suffixes: array389, - min: lifted392, - max: lifted394, - }) - } - 31 => { - let array418 : Array[@types.UnionBranch] = [] - for index419 = 0 - index419 < mbt_ffi_load32(iter_base + 12) - index419 = index419 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index419 * 92 - - let result395 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted404 = match mbt_ffi_load8_u(iter_base + 12) { - 0 => { - let result396 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let result469 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - @types.DiscriminatorRule::Prefix(result396) - } - 1 => { - let result397 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + Option::Some(result469) + } + _ => panic() + } - @types.DiscriminatorRule::Suffix(result397) - } - 2 => { - let result398 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{bytes : result468, mime_type : lifted470}) + } + 25 => { - @types.DiscriminatorRule::Contains(result398) - } - 3 => { - let result399 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + let result471 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - @types.DiscriminatorRule::Regex(result399) - } - 4 => { - let result400 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - let lifted402 : String? = match - mbt_ffi_load8_u(iter_base + 24) { - 0 => Option::None - 1 => { - let result401 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 28), - mbt_ffi_load32(iter_base + 32), - ) - - Option::Some(result401) - } - _ => panic() - } - - @types.DiscriminatorRule::FieldEquals(@types.FieldDiscriminator::{ - field_name: result400, - literal: lifted402, - }) - } - 5 => { - let result403 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) + @types.SchemaValueNode::PathValue(result471) + } + 26 => { - @types.DiscriminatorRule::FieldAbsent(result403) - } - _ => panic() - } + let result472 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - let lifted406 : String? = match - mbt_ffi_load8_u(iter_base + 36) { - 0 => Option::None - 1 => { - let result405 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 40), - mbt_ffi_load32(iter_base + 44), - ) + @types.SchemaValueNode::UrlValue(result472) + } + 27 => { - Option::Some(result405) - } - _ => panic() - } - - let array408 : Array[String] = [] - for index409 = 0 - index409 < mbt_ffi_load32(iter_base + 52) - index409 = index409 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 48) + - index409 * 8 - - let result407 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array408.push(result407) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 48)) - - let array411 : Array[String] = [] - for index412 = 0 - index412 < mbt_ffi_load32(iter_base + 60) - index412 = index412 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 56) + - index412 * 8 - - let result410 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array411.push(result410) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 56)) - - let lifted414 : String? = match - mbt_ffi_load8_u(iter_base + 64) { - 0 => Option::None - 1 => { - let result413 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 68), - mbt_ffi_load32(iter_base + 72), - ) + @types.SchemaValueNode::DatetimeValue(@types.Datetime::{seconds : mbt_ffi_load64((iter_base) + 8), nanoseconds : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}) + } + 28 => { - Option::Some(result413) - } - _ => panic() - } + @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{nanoseconds : mbt_ffi_load64((iter_base) + 8)}) + } + 29 => { - let lifted417 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 76) { - 0 => Option::None - 1 => { - let lifted416 = match - mbt_ffi_load8_u(iter_base + 80) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result415 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 84), - mbt_ffi_load32(iter_base + 88), - ) - - @types.Role::Other(result415) - } - _ => panic() - } - - Option::Some(lifted416) - } - _ => panic() - } - - array418.push(@types.UnionBranch::{ - tag: result395, - body: mbt_ffi_load32(iter_base + 8), - discriminator: lifted404, - metadata: @types.MetadataEnvelope::{ - doc: lifted406, - aliases: array408, - examples: array411, - deprecated: lifted414, - role: lifted417, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaTypeBody::UnionType(@types.UnionSpec::{ - branches: array418, - }) - } - 32 => { - let lifted421 : String? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => { - let result420 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 16), - mbt_ffi_load32(iter_base + 20), - ) - - Option::Some(result420) - } - _ => panic() - } - - @types.SchemaTypeBody::SecretType(@types.SecretSpec::{ - inner: mbt_ffi_load32(iter_base + 8), - category: lifted421, - }) - } - 33 => { - let lifted423 : String? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result422 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) - - Option::Some(result422) - } - _ => panic() - } - - @types.SchemaTypeBody::QuotaTokenType(@types.QuotaTokenSpec::{ - resource_name: lifted423, - }) - } - 34 => { - let lifted424 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::FutureType(lifted424) - } - 35 => { - let lifted425 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaTypeBody::StreamType(lifted425) - } - _ => panic() - } + let result473 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 20), mbt_ffi_load32((iter_base) + 24)) - let lifted428 : String? = match - mbt_ffi_load8_u(iter_base + 88) { - 0 => Option::None - 1 => { - let result427 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 92), - mbt_ffi_load32(iter_base + 96), - ) + @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{mantissa : mbt_ffi_load64((iter_base) + 8), scale : mbt_ffi_load32((iter_base) + 16), unit : result473}) + } + 30 => { - Option::Some(result427) - } - _ => panic() - } - - let array430 : Array[String] = [] - for index431 = 0 - index431 < mbt_ffi_load32(iter_base + 104) - index431 = index431 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 100) + index431 * 8 - - let result429 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array430.push(result429) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 100)) - - let array433 : Array[String] = [] - for index434 = 0 - index434 < mbt_ffi_load32(iter_base + 112) - index434 = index434 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 108) + index434 * 8 - - let result432 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array433.push(result432) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 108)) - - let lifted436 : String? = match - mbt_ffi_load8_u(iter_base + 116) { - 0 => Option::None - 1 => { - let result435 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 120), - mbt_ffi_load32(iter_base + 124), - ) + let result474 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) - Option::Some(result435) - } - _ => panic() - } + @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{tag : result474, body : mbt_ffi_load32((iter_base) + 16)}) + } + 31 => { - let lifted439 : @types.Role? = match - mbt_ffi_load8_u(iter_base + 128) { - 0 => Option::None - 1 => { - let lifted438 = match mbt_ffi_load8_u(iter_base + 132) { - 0 => @types.Role::Multimodal - 1 => @types.Role::UnstructuredText - 2 => @types.Role::UnstructuredBinary - 3 => { - let result437 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 136), - mbt_ffi_load32(iter_base + 140), - ) - - @types.Role::Other(result437) - } - _ => panic() - } - - Option::Some(lifted438) - } - _ => panic() - } - - array440.push(@types.SchemaTypeNode::{ - body: lifted426, - metadata: @types.MetadataEnvelope::{ - doc: lifted428, - aliases: array430, - examples: array433, - deprecated: lifted436, - role: lifted439, - }, - }) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - - let array445 : Array[@types.SchemaTypeDef] = [] - for index446 = 0 - index446 < mbt_ffi_load32(result_ptr + 24) - index446 = index446 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 20) + index446 * 24 - - let result442 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let lifted444 : String? = match mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => { - let result443 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 12), - mbt_ffi_load32(iter_base + 16), - ) + @types.SchemaValueNode::SecretValue(@types.Secret::Secret(mbt_ffi_load32((iter_base) + 8))) + } + 32 => { - Option::Some(result443) - } - _ => panic() - } - - array445.push(@types.SchemaTypeDef::{ - id: result442, - name: lifted444, - body: mbt_ffi_load32(iter_base + 20), - }) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - - let array476 : Array[@types.SchemaValueNode] = [] - for index477 = 0 - index477 < mbt_ffi_load32(result_ptr + 36) - index477 = index477 + 1 { - let iter_base = mbt_ffi_load32(result_ptr + 32) + index477 * 32 - - let lifted475 = match mbt_ffi_load8_u(iter_base + 0) { - 0 => - @types.SchemaValueNode::BoolValue( - mbt_ffi_load8_u(iter_base + 8) != 0, - ) - 1 => - @types.SchemaValueNode::S8Value( - mbt_ffi_load8(iter_base + 8), - ) - 2 => - @types.SchemaValueNode::S16Value( - mbt_ffi_load16(iter_base + 8), - ) - 3 => - @types.SchemaValueNode::S32Value( - mbt_ffi_load32(iter_base + 8), - ) - 4 => - @types.SchemaValueNode::S64Value( - mbt_ffi_load64(iter_base + 8), - ) - 5 => - @types.SchemaValueNode::U8Value( - mbt_ffi_load8_u(iter_base + 8).to_byte(), - ) - 6 => - @types.SchemaValueNode::U16Value( - mbt_ffi_load16_u(iter_base + 8) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - 7 => - @types.SchemaValueNode::U32Value( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 8 => - @types.SchemaValueNode::U64Value( - mbt_ffi_load64(iter_base + 8).reinterpret_as_uint64(), - ) - 9 => - @types.SchemaValueNode::F32Value( - mbt_ffi_loadf32(iter_base + 8), - ) - 10 => - @types.SchemaValueNode::F64Value( - mbt_ffi_loadf64(iter_base + 8), - ) - 11 => - @types.SchemaValueNode::CharValue( - Int::unsafe_to_char(mbt_ffi_load32(iter_base + 8)), - ) - 12 => { - let result447 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::StringValue(result447) - } - 13 => { - let array448 : Array[Int] = [] - for index449 = 0 - index449 < mbt_ffi_load32(iter_base + 12) - index449 = index449 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index449 * 4 - - array448.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::RecordValue(array448) - } - 14 => { - let lifted450 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.SchemaValueNode::VariantValue(@types.VariantValuePayload::{ - case: mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - payload: lifted450, - }) - } - 15 => - @types.SchemaValueNode::EnumValue( - mbt_ffi_load32(iter_base + 8).reinterpret_as_uint(), - ) - 16 => { - let array451 : Array[Bool] = [] - for index452 = 0 - index452 < mbt_ffi_load32(iter_base + 12) - index452 = index452 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index452 * 1 - - array451.push(mbt_ffi_load8_u(iter_base + 0) != 0) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FlagsValue(array451) - } - 17 => { - let array453 : Array[Int] = [] - for index454 = 0 - index454 < mbt_ffi_load32(iter_base + 12) - index454 = index454 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index454 * 4 - - array453.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::TupleValue(array453) - } - 18 => { - let array455 : Array[Int] = [] - for index456 = 0 - index456 < mbt_ffi_load32(iter_base + 12) - index456 = index456 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index456 * 4 - - array455.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::ListValue(array455) - } - 19 => { - let array457 : Array[Int] = [] - for index458 = 0 - index458 < mbt_ffi_load32(iter_base + 12) - index458 = index458 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index458 * 4 - - array457.push(mbt_ffi_load32(iter_base + 0)) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::FixedListValue(array457) - } - 20 => { - let array459 : Array[@types.MapEntry] = [] - for index460 = 0 - index460 < mbt_ffi_load32(iter_base + 12) - index460 = index460 + 1 { - let iter_base = mbt_ffi_load32(iter_base + 8) + - index460 * 8 - - array459.push(@types.MapEntry::{ - key: mbt_ffi_load32(iter_base + 0), - value: mbt_ffi_load32(iter_base + 4), - }) - } - mbt_ffi_free(mbt_ffi_load32(iter_base + 8)) - - @types.SchemaValueNode::MapValue(array459) - } - 21 => { - let lifted461 : Int? = match - mbt_ffi_load8_u(iter_base + 8) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 12)) - _ => panic() - } - - @types.SchemaValueNode::OptionValue(lifted461) - } - 22 => { - let lifted464 = match mbt_ffi_load8_u(iter_base + 8) { - 0 => { - let lifted462 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::OkValue(lifted462) - } - 1 => { - let lifted463 : Int? = match - mbt_ffi_load8_u(iter_base + 12) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(iter_base + 16)) - _ => panic() - } - - @types.ResultValuePayload::ErrValue(lifted463) - } - _ => panic() - } - - @types.SchemaValueNode::ResultValue(lifted464) - } - 23 => { - let result465 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted467 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result466 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result466) - } - _ => panic() - } - - @types.SchemaValueNode::TextValue(@types.TextValuePayload::{ - text: result465, - language: lifted467, - }) - } - 24 => { - let result468 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - let lifted470 : String? = match - mbt_ffi_load8_u(iter_base + 16) { - 0 => Option::None - 1 => { - let result469 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - Option::Some(result469) - } - _ => panic() - } - - @types.SchemaValueNode::BinaryValue(@types.BinaryValuePayload::{ - bytes: result468, - mime_type: lifted470, - }) - } - 25 => { - let result471 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) + @types.SchemaValueNode::QuotaTokenHandle(@types.QuotaToken::QuotaToken(mbt_ffi_load32((iter_base) + 8))) + } + 33 => { - @types.SchemaValueNode::PathValue(result471) - } - 26 => { - let result472 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UrlValue(result472) - } - 27 => - @types.SchemaValueNode::DatetimeValue(@types.Datetime::{ - seconds: mbt_ffi_load64(iter_base + 8), - nanoseconds: mbt_ffi_load32(iter_base + 16).reinterpret_as_uint(), - }) - 28 => - @types.SchemaValueNode::DurationValue(@types.DurationValuePayload::{ - nanoseconds: mbt_ffi_load64(iter_base + 8), - }) - 29 => { - let result473 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 20), - mbt_ffi_load32(iter_base + 24), - ) - - @types.SchemaValueNode::QuantityValueNode(@types.QuantityValue::{ - mantissa: mbt_ffi_load64(iter_base + 8), - scale: mbt_ffi_load32(iter_base + 16), - unit: result473, - }) + @types.SchemaValueNode::PermissionCardHandle(@types.PermissionCard::PermissionCard(mbt_ffi_load32((iter_base) + 8))) + } + _ => panic() + } + + array476.push(lifted475) + } + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 32)) + + @common.ToolError::CustomError(@types.TypedSchemaValue::{graph : @types.SchemaGraph::{type_nodes : array440, defs : array445, root : mbt_ffi_load32((result_ptr) + 28)}, value : @types.SchemaValueTree::{value_nodes : array476, root : mbt_ffi_load32((result_ptr) + 40)}}) + } + _ => panic() + } + + RpcError::RemoteToolError(lifted478) + } + _ => panic() } - 30 => { - let result474 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - @types.SchemaValueNode::UnionValue(@types.UnionValuePayload::{ - tag: result474, - body: mbt_ffi_load32(iter_base + 16), - }) - } - 31 => - @types.SchemaValueNode::SecretValue( - @types.Secret::Secret(mbt_ffi_load32(iter_base + 8)), - ) - 32 => - @types.SchemaValueNode::QuotaTokenHandle( - @types.QuotaToken::QuotaToken( - mbt_ffi_load32(iter_base + 8), - ), - ) - _ => panic() - } - - array476.push(lifted475) - } - mbt_ffi_free(mbt_ffi_load32(result_ptr + 32)) - - @common.ToolError::CustomError(@types.TypedSchemaValue::{ - graph: @types.SchemaGraph::{ - type_nodes: array440, - defs: array445, - root: mbt_ffi_load32(result_ptr + 28), - }, - value: @types.SchemaValueTree::{ - value_nodes: array476, - root: mbt_ffi_load32(result_ptr + 40), - }, - }) + + Result::Err(lifted479) } _ => panic() - } - - RpcError::RemoteToolError(lifted478) - } - _ => panic() } - Result::Err(lifted479) - } - _ => panic() - } + lifted480 - lifted480 } - ///| pub fn FutureInvokeResult::cancel(self : FutureInvokeResult) -> Unit { - let FutureInvokeResult(handle) = self - wasmImportMethodFutureInvokeResultCancel(handle) + + let FutureInvokeResult(handle) = self + wasmImportMethodFutureInvokeResultCancel(handle); + } + diff --git a/sdks/moonbit/golem_sdk/interface/golem/websocket/client/ffi.mbt b/sdks/moonbit/golem_sdk/interface/golem/websocket/client/ffi.mbt index e3b5899e87..60a0722c7f 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/websocket/client/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/websocket/client/ffi.mbt @@ -1,95 +1,65 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropWebsocketConnection(resource : Int) = "golem:websocket/client@1.5.0" "[resource-drop]websocket-connection" -///| -fn wasmImportStaticWebsocketConnectionConnect( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "golem:websocket/client@1.5.0" "[static]websocket-connection.connect" +fn wasmImportStaticWebsocketConnectionConnect(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "golem:websocket/client@1.5.0" "[static]websocket-connection.connect" -///| -fn wasmImportMethodWebsocketConnectionSend( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, -) = "golem:websocket/client@1.5.0" "[method]websocket-connection.send" +fn wasmImportMethodWebsocketConnectionSend(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) = "golem:websocket/client@1.5.0" "[method]websocket-connection.send" -///| fn wasmImportMethodWebsocketConnectionReceive(p0 : Int, p1 : Int) -> Int = "golem:websocket/client@1.5.0" "[async-lower][method]websocket-connection.receive" -///| -fn wasmImportMethodWebsocketConnectionReceiveWithTimeout( - p0 : Int, - p1 : Int64, - p2 : Int, -) -> Int = "golem:websocket/client@1.5.0" "[async-lower][method]websocket-connection.receive-with-timeout" +fn wasmImportMethodWebsocketConnectionReceiveWithTimeout(p0 : Int, p1 : Int64, p2 : Int) -> Int = "golem:websocket/client@1.5.0" "[async-lower][method]websocket-connection.receive-with-timeout" -///| -fn wasmImportMethodWebsocketConnectionClose( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, -) = "golem:websocket/client@1.5.0" "[method]websocket-connection.close" +fn wasmImportMethodWebsocketConnectionClose(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int) = "golem:websocket/client@1.5.0" "[method]websocket-connection.close" ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| #owned(bytes) extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) + +///| +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| #owned(str) extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_u) -///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) diff --git a/sdks/moonbit/golem_sdk/interface/golem/websocket/client/top.mbt b/sdks/moonbit/golem_sdk/interface/golem/websocket/client/top.mbt index fdc7236786..e3ff287066 100644 --- a/sdks/moonbit/golem_sdk/interface/golem/websocket/client/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/golem/websocket/client/top.mbt @@ -1,684 +1,681 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| pub(all) struct CloseInfo { - code : UInt - reason : String + code : UInt; reason : String } derive(Show, Eq) - ///| pub(all) suberror Error_ { - ConnectionFailure(String) - SendFailure(String) - ReceiveFailure(String) - ProtocolError(String) - Closed(CloseInfo?) - Other(String) + ConnectionFailure(String) + SendFailure(String) + ReceiveFailure(String) + ProtocolError(String) + Closed(CloseInfo?) + Other(String) } derive(Show, Eq) - ///| /// A WebSocket message — text or binary pub(all) enum Message { - Text(String) - Binary(FixedArray[Byte]) + Text(String) + Binary(FixedArray[Byte]) } derive(Show, Eq) - ///| /// A WebSocket connection resource pub(all) struct WebsocketConnection(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn WebsocketConnection::drop(self : WebsocketConnection) -> Unit { - let WebsocketConnection(resource) = self - wasmImportResourceDropWebsocketConnection(resource) + let WebsocketConnection(resource) = self + wasmImportResourceDropWebsocketConnection(resource) } - ///| /// Connect to a WebSocket server at the given URL (ws:// or wss://) /// Optional headers for auth, subprotocols, etc. -pub fn WebsocketConnection::connect( - url : String, - headers : Array[(String, String)]?, -) -> Result[WebsocketConnection, Error_] { - let cleanup_list : Array[Int] = [] - - let ptr = mbt_ffi_str2ptr(url) - - let (lowered, lowered3, lowered4) = match headers { - None => (0, 0, 0) - Some(payload0) => { - let address = mbt_ffi_malloc(payload0.length() * 16) - for index = 0; index < payload0.length(); index = index + 1 { - let iter_elem : (String, String) = payload0[index] - let iter_base = address + index * 16 - - let ptr1 = mbt_ffi_str2ptr(iter_elem.0) - mbt_ffi_store32(iter_base + 4, iter_elem.0.length()) - mbt_ffi_store32(iter_base + 0, ptr1) - - let ptr2 = mbt_ffi_str2ptr(iter_elem.1) - mbt_ffi_store32(iter_base + 12, iter_elem.1.length()) - mbt_ffi_store32(iter_base + 8, ptr2) - cleanup_list.push(ptr1) - cleanup_list.push(ptr2) +pub fn WebsocketConnection::connect(url : String, headers : Array[(String, String)]?) -> Result[WebsocketConnection, Error_] { + let cleanup_list : Array[Int] = [] + + let ptr = mbt_ffi_str2ptr(url) + + let (lowered, lowered3, lowered4) = match (headers) { + None => { + + ((0), 0, 0) + } + Some(payload0) => { + + let address = mbt_ffi_malloc((payload0).length() * 16); + for index = 0; index < (payload0).length(); index = index + 1 { + let iter_elem : (String, String) = (payload0)[(index)] + let iter_base = address + (index * 16); + + let ptr1 = mbt_ffi_str2ptr((iter_elem).0) + mbt_ffi_store32((iter_base) + 4, (iter_elem).0.length()) + mbt_ffi_store32((iter_base) + 0, ptr1) + + let ptr2 = mbt_ffi_str2ptr((iter_elem).1) + mbt_ffi_store32((iter_base) + 12, (iter_elem).1.length()) + mbt_ffi_store32((iter_base) + 8, ptr2) + cleanup_list.push(ptr1) + cleanup_list.push(ptr2) + + } + cleanup_list.push(address) + + ((1), address, (payload0).length()) + } } - cleanup_list.push(address) - - (1, address, payload0.length()) - } - } - let return_area = mbt_ffi_malloc(24) - wasmImportStaticWebsocketConnectionConnect( - ptr, - url.length(), - lowered, - lowered3, - lowered4, - return_area, - ) - - let lifted11 = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok( - WebsocketConnection::WebsocketConnection( - mbt_ffi_load32(return_area + 4), - ), - ) - 1 => { - let lifted10 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::SendFailure(result5) - } - 2 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ReceiveFailure(result6) - } - 3 => { - let result7 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ProtocolError(result7) - } - 4 => { - let lifted : CloseInfo? = match mbt_ffi_load8_u(return_area + 8) { - 0 => Option::None + let return_area = mbt_ffi_malloc(24) + wasmImportStaticWebsocketConnectionConnect(ptr, url.length(), lowered, lowered3, lowered4, return_area); + + let lifted11 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(WebsocketConnection::WebsocketConnection(mbt_ffi_load32((return_area) + 4))) + } 1 => { - let result8 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 16), - mbt_ffi_load32(return_area + 20), - ) - - Option::Some(CloseInfo::{ - code: mbt_ffi_load16_u(return_area + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - reason: result8, - }) + + let lifted10 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::SendFailure(result5) + } + 2 => { + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ReceiveFailure(result6) + } + 3 => { + + let result7 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ProtocolError(result7) + } + 4 => { + + let lifted : CloseInfo? = match mbt_ffi_load8_u((return_area) + 8) { + 0 => Option::None + 1 => { + + let result8 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 16), mbt_ffi_load32((return_area) + 20)) + + Option::Some(CloseInfo::{code : (mbt_ffi_load16_u((return_area) + 12).land(0xFFFF).reinterpret_as_uint()), reason : result8}) + } + _ => panic() + } + + Error_::Closed(lifted) + } + 5 => { + + let result9 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result9) + } + _ => panic() + } + + Result::Err(lifted10) } _ => panic() - } - - Error_::Closed(lifted) - } - 5 => { - let result9 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result9) - } - _ => panic() } + let ret = lifted11 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) - Result::Err(lifted10) - } - _ => panic() - } - let ret = lifted11 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) + cleanup_list.each(mbt_ffi_free) + return ret - cleanup_list.each(mbt_ffi_free) - return ret } - ///| /// Send a message (text or binary) -pub fn WebsocketConnection::send( - self : WebsocketConnection, - message : Message, -) -> Result[Unit, Error_] { - let cleanup_list : Array[Int] = [] - - let WebsocketConnection(handle) = self - - let (lowered, lowered2, lowered3) = match message { - Text(payload) => { - let ptr = mbt_ffi_str2ptr(payload) - cleanup_list.push(ptr) - - (0, ptr, payload.length()) - } - Binary(payload0) => { - let ptr1 = mbt_ffi_bytes2ptr(payload0) - - cleanup_list.push(ptr1) - - (1, ptr1, payload0.length()) - } - } - let return_area = mbt_ffi_malloc(24) - wasmImportMethodWebsocketConnectionSend( - handle, lowered, lowered2, lowered3, return_area, - ) - - let lifted10 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted9 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::SendFailure(result4) - } - 2 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ReceiveFailure(result5) - } - 3 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ProtocolError(result6) - } - 4 => { - let lifted : CloseInfo? = match mbt_ffi_load8_u(return_area + 8) { - 0 => Option::None +pub fn WebsocketConnection::send(self : WebsocketConnection, message : Message) -> Result[Unit, Error_] { + let cleanup_list : Array[Int] = [] + + let WebsocketConnection(handle) = self + + let (lowered,lowered2,lowered3) = match message { + Text(payload) => { + + let ptr = mbt_ffi_str2ptr(payload) + cleanup_list.push(ptr) + + ((0), ptr, payload.length()) + } + Binary(payload0) => { + + let ptr1 = mbt_ffi_bytes2ptr(payload0) + + cleanup_list.push(ptr1) + + ((1), ptr1, payload0.length()) + } + } + let return_area = mbt_ffi_malloc(24) + wasmImportMethodWebsocketConnectionSend(handle, lowered, lowered2, lowered3, return_area); + + let lifted10 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } 1 => { - let result7 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 16), - mbt_ffi_load32(return_area + 20), - ) - - Option::Some(CloseInfo::{ - code: mbt_ffi_load16_u(return_area + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - reason: result7, - }) + + let lifted9 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::SendFailure(result4) + } + 2 => { + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ReceiveFailure(result5) + } + 3 => { + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ProtocolError(result6) + } + 4 => { + + let lifted : CloseInfo? = match mbt_ffi_load8_u((return_area) + 8) { + 0 => Option::None + 1 => { + + let result7 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 16), mbt_ffi_load32((return_area) + 20)) + + Option::Some(CloseInfo::{code : (mbt_ffi_load16_u((return_area) + 12).land(0xFFFF).reinterpret_as_uint()), reason : result7}) + } + _ => panic() + } + + Error_::Closed(lifted) + } + 5 => { + + let result8 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result8) + } + _ => panic() + } + + Result::Err(lifted9) } _ => panic() - } - - Error_::Closed(lifted) - } - 5 => { - let result8 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result8) - } - _ => panic() } + let ret = lifted10 + mbt_ffi_free(return_area) - Result::Err(lifted9) - } - _ => panic() - } - let ret = lifted10 - mbt_ffi_free(return_area) + cleanup_list.each(mbt_ffi_free) + return ret - cleanup_list.each(mbt_ffi_free) - return ret } - ///| /// Receive the next message (blocks until available) -pub async fn WebsocketConnection::receive( - self : WebsocketConnection, -) -> Result[Message, Error_] { - let WebsocketConnection(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(24 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodWebsocketConnectionReceive( - lower_arg, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - _ => panic() - } - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 2 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 3 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 4 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 16)) - _ => panic() - } - 5 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted9 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - let lifted = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - Message::Text(result) - } - 1 => { - let result0 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - Message::Binary(result0) - } - _ => panic() +pub async fn WebsocketConnection::receive(self : WebsocketConnection) -> Result[Message, Error_] { + + let WebsocketConnection(handle) = self + + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(24 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodWebsocketConnectionReceive(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { - Result::Ok(lifted) - } - 1 => { - let lifted8 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - Error_::ConnectionFailure(result1) - } - 1 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - Error_::SendFailure(result2) - } - 2 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - Error_::ReceiveFailure(result3) - } - 3 => { - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - Error_::ProtocolError(result4) - } - 4 => { - let lifted6 : CloseInfo? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + _ => panic() + } + + } + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 4 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 16)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted9 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + let lifted = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + Message::Text(result) + } + 1 => { + + let result0 = mbt_ffi_ptr2bytes(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + Message::Binary(result0) + } + _ => panic() + } + + Result::Ok(lifted) + } 1 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 16), - mbt_ffi_load32(result_ptr + 20), - ) - - Option::Some(CloseInfo::{ - code: mbt_ffi_load16_u(result_ptr + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - reason: result5, - }) + + let lifted8 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + Error_::ConnectionFailure(result1) + } + 1 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + Error_::SendFailure(result2) + } + 2 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + Error_::ReceiveFailure(result3) + } + 3 => { + + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + Error_::ProtocolError(result4) + } + 4 => { + + let lifted6 : CloseInfo? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 16), mbt_ffi_load32((result_ptr) + 20)) + + Option::Some(CloseInfo::{code : (mbt_ffi_load16_u((result_ptr) + 12).land(0xFFFF).reinterpret_as_uint()), reason : result5}) + } + _ => panic() + } + + Error_::Closed(lifted6) + } + 5 => { + + let result7 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + Error_::Other(result7) + } + _ => panic() + } + + Result::Err(lifted8) } _ => panic() - } - - Error_::Closed(lifted6) - } - 5 => { - let result7 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - Error_::Other(result7) - } - _ => panic() } - Result::Err(lifted8) - } - _ => panic() - } + lifted9 - lifted9 } - ///| /// Receive the next message with a timeout in milliseconds. /// Returns none if the timeout expires before a message arrives. -pub async fn WebsocketConnection::receive_with_timeout( - self : WebsocketConnection, - timeout_ms : UInt64, -) -> Result[Message?, Error_] { - let WebsocketConnection(handle) = self - - let lower_arg = handle - let lower_arg0 = timeout_ms.reinterpret_as_int64() - let result_ptr = mbt_ffi_malloc(24 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodWebsocketConnectionReceiveWithTimeout( - lower_arg, lower_arg0, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 2 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 3 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - 4 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 16)) - _ => panic() - } - 5 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 8)) - _ => panic() - } - _ => panic() +pub async fn WebsocketConnection::receive_with_timeout(self : WebsocketConnection, timeout_ms : UInt64) -> Result[Message?, Error_] { + + let WebsocketConnection(handle) = self + + let lower_arg = handle + let lower_arg0 = (timeout_ms).reinterpret_as_int64() + let result_ptr = mbt_ffi_malloc(24 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodWebsocketConnectionReceiveWithTimeout(lower_arg, lower_arg0, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } } - }, - ) - - let lifted10 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - let lifted1 : Message? = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(result_ptr + 8) { + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 2 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 3 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + 4 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 16)) + + } + _ => panic() + } + + } + 5 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 8)) + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted10 = match (mbt_ffi_load8_u((result_ptr) + 0)) { 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) - Message::Text(result) + let lifted1 : Message? = match mbt_ffi_load8_u((result_ptr) + 4) { + 0 => Option::None + 1 => { + + let lifted = match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Message::Text(result) + } + 1 => { + + let result0 = mbt_ffi_ptr2bytes(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Message::Binary(result0) + } + _ => panic() + } + + Option::Some(lifted) + } + _ => panic() + } + + Result::Ok(lifted1) } 1 => { - let result0 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) - Message::Binary(result0) - } - _ => panic() - } + let lifted9 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { - Option::Some(lifted) - } - _ => panic() - } + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) - Result::Ok(lifted1) - } - 1 => { - let lifted9 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - Error_::ConnectionFailure(result2) - } - 1 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - Error_::SendFailure(result3) - } - 2 => { - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - Error_::ReceiveFailure(result4) - } - 3 => { - let result5 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - Error_::ProtocolError(result5) - } - 4 => { - let lifted7 : CloseInfo? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 16), - mbt_ffi_load32(result_ptr + 20), - ) - - Option::Some(CloseInfo::{ - code: mbt_ffi_load16_u(result_ptr + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - reason: result6, - }) + Error_::ConnectionFailure(result2) + } + 1 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + Error_::SendFailure(result3) + } + 2 => { + + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + Error_::ReceiveFailure(result4) + } + 3 => { + + let result5 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + Error_::ProtocolError(result5) + } + 4 => { + + let lifted7 : CloseInfo? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 16), mbt_ffi_load32((result_ptr) + 20)) + + Option::Some(CloseInfo::{code : (mbt_ffi_load16_u((result_ptr) + 12).land(0xFFFF).reinterpret_as_uint()), reason : result6}) + } + _ => panic() + } + + Error_::Closed(lifted7) + } + 5 => { + + let result8 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 8), mbt_ffi_load32((result_ptr) + 12)) + + Error_::Other(result8) + } + _ => panic() + } + + Result::Err(lifted9) } _ => panic() - } - - Error_::Closed(lifted7) - } - 5 => { - let result8 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 8), - mbt_ffi_load32(result_ptr + 12), - ) - - Error_::Other(result8) - } - _ => panic() } - Result::Err(lifted9) - } - _ => panic() - } + lifted10 - lifted10 } - ///| /// Send a close frame with optional code and reason -pub fn WebsocketConnection::close( - self : WebsocketConnection, - code : UInt?, - reason : String?, -) -> Result[Unit, Error_] { - let cleanup_list : Array[Int] = [] - - let WebsocketConnection(handle) = self - - let (lowered, lowered1) = match code { - None => (0, 0) - Some(payload0) => (1, payload0.reinterpret_as_int()) - } - - let (lowered4, lowered5, lowered6) = match reason { - None => (0, 0, 0) - Some(payload3) => { - let ptr = mbt_ffi_str2ptr(payload3) - cleanup_list.push(ptr) - - (1, ptr, payload3.length()) - } - } - let return_area = mbt_ffi_malloc(24) - wasmImportMethodWebsocketConnectionClose( - handle, lowered, lowered1, lowered4, lowered5, lowered6, return_area, - ) - - let lifted13 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted12 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ConnectionFailure(result) - } - 1 => { - let result7 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::SendFailure(result7) - } - 2 => { - let result8 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ReceiveFailure(result8) - } - 3 => { - let result9 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::ProtocolError(result9) - } - 4 => { - let lifted : CloseInfo? = match mbt_ffi_load8_u(return_area + 8) { - 0 => Option::None +pub fn WebsocketConnection::close(self : WebsocketConnection, code : UInt?, reason : String?) -> Result[Unit, Error_] { + let cleanup_list : Array[Int] = [] + + let WebsocketConnection(handle) = self + + let (lowered, lowered1) = match (code) { + None => { + + ((0), 0) + } + Some(payload0) => { + + ((1), (payload0).reinterpret_as_int()) + } + } + + let (lowered4, lowered5, lowered6) = match (reason) { + None => { + + ((0), 0, 0) + } + Some(payload3) => { + + let ptr = mbt_ffi_str2ptr(payload3) + cleanup_list.push(ptr) + + ((1), ptr, payload3.length()) + } + } + let return_area = mbt_ffi_malloc(24) + wasmImportMethodWebsocketConnectionClose(handle, lowered, lowered1, lowered4, lowered5, lowered6, return_area); + + let lifted13 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } 1 => { - let result10 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 16), - mbt_ffi_load32(return_area + 20), - ) - - Option::Some(CloseInfo::{ - code: mbt_ffi_load16_u(return_area + 12) - .land(0xFFFF) - .reinterpret_as_uint(), - reason: result10, - }) + + let lifted12 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ConnectionFailure(result) + } + 1 => { + + let result7 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::SendFailure(result7) + } + 2 => { + + let result8 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ReceiveFailure(result8) + } + 3 => { + + let result9 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::ProtocolError(result9) + } + 4 => { + + let lifted : CloseInfo? = match mbt_ffi_load8_u((return_area) + 8) { + 0 => Option::None + 1 => { + + let result10 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 16), mbt_ffi_load32((return_area) + 20)) + + Option::Some(CloseInfo::{code : (mbt_ffi_load16_u((return_area) + 12).land(0xFFFF).reinterpret_as_uint()), reason : result10}) + } + _ => panic() + } + + Error_::Closed(lifted) + } + 5 => { + + let result11 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Other(result11) + } + _ => panic() + } + + Result::Err(lifted12) } _ => panic() - } - - Error_::Closed(lifted) - } - 5 => { - let result11 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Other(result11) - } - _ => panic() } + let ret = lifted13 + mbt_ffi_free(return_area) - Result::Err(lifted12) - } - _ => panic() - } - let ret = lifted13 - mbt_ffi_free(return_area) + cleanup_list.each(mbt_ffi_free) + return ret - cleanup_list.each(mbt_ffi_free) - return ret } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/blobstore/blobstore/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/blobstore/blobstore/ffi.mbt index cc32af6106..a6edf20c1b 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/blobstore/blobstore/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/blobstore/blobstore/ffi.mbt @@ -1,70 +1,45 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| -fn wasmImportCreateContainer(p0 : Int, p1 : Int, p2 : Int) = "wasi:blobstore/blobstore" "create-container" +fn wasmImportCreateContainer(p0 : Int, p1 : Int, p2 : Int) = "wasi:blobstore/blobstore" "create-container" -///| -fn wasmImportGetContainer(p0 : Int, p1 : Int, p2 : Int) = "wasi:blobstore/blobstore" "get-container" +fn wasmImportGetContainer(p0 : Int, p1 : Int, p2 : Int) = "wasi:blobstore/blobstore" "get-container" -///| -fn wasmImportDeleteContainer(p0 : Int, p1 : Int, p2 : Int) = "wasi:blobstore/blobstore" "delete-container" +fn wasmImportDeleteContainer(p0 : Int, p1 : Int, p2 : Int) = "wasi:blobstore/blobstore" "delete-container" -///| -fn wasmImportContainerExists(p0 : Int, p1 : Int, p2 : Int) = "wasi:blobstore/blobstore" "container-exists" +fn wasmImportContainerExists(p0 : Int, p1 : Int, p2 : Int) = "wasi:blobstore/blobstore" "container-exists" -///| -fn wasmImportCopyObject( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, - p7 : Int, - p8 : Int, -) = "wasi:blobstore/blobstore" "copy-object" +fn wasmImportCopyObject(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int, p7 : Int, p8 : Int) = "wasi:blobstore/blobstore" "copy-object" -///| -fn wasmImportMoveObject( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, - p7 : Int, - p8 : Int, -) = "wasi:blobstore/blobstore" "move-object" +fn wasmImportMoveObject(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int, p7 : Int, p8 : Int) = "wasi:blobstore/blobstore" "move-object" ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/blobstore/blobstore/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/blobstore/blobstore/top.mbt index 2ed017194b..38b7fc34ac 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/blobstore/blobstore/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/blobstore/blobstore/top.mbt @@ -1,205 +1,186 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// creates a new empty container pub fn create_container(name : String) -> Result[@container.Container, String] { - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(12) - wasmImportCreateContainer(ptr, name.length(), return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok( - @container.Container::Container(mbt_ffi_load32(return_area + 4)), - ) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(12) + wasmImportCreateContainer(ptr, name.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(@container.Container::Container(mbt_ffi_load32((return_area) + 4))) + } + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// retrieves a container by name pub fn get_container(name : String) -> Result[@container.Container, String] { - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(12) - wasmImportGetContainer(ptr, name.length(), return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok( - @container.Container::Container(mbt_ffi_load32(return_area + 4)), - ) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(12) + wasmImportGetContainer(ptr, name.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(@container.Container::Container(mbt_ffi_load32((return_area) + 4))) + } + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// deletes a container and all objects within it pub fn delete_container(name : String) -> Result[Unit, String] { - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(12) - wasmImportDeleteContainer(ptr, name.length(), return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(12) + wasmImportDeleteContainer(ptr, name.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// returns true if the container exists pub fn container_exists(name : String) -> Result[Bool, String] { - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(12) - wasmImportContainerExists(ptr, name.length(), return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load8_u(return_area + 4) != 0) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(12) + wasmImportContainerExists(ptr, name.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok((mbt_ffi_load8_u((return_area) + 4) != 0)) + } + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// copies (duplicates) an object, to the same or a different container. /// returns an error if the target container does not exist. /// overwrites destination object if it already existed. -pub fn copy_object( - src : @types.ObjectId, - dest : @types.ObjectId, -) -> Result[Unit, String] { - let ptr = mbt_ffi_str2ptr(src.container) - - let ptr0 = mbt_ffi_str2ptr(src.object) - - let ptr1 = mbt_ffi_str2ptr(dest.container) - - let ptr2 = mbt_ffi_str2ptr(dest.object) - let return_area = mbt_ffi_malloc(12) - wasmImportCopyObject( - ptr, - src.container.length(), - ptr0, - src.object.length(), - ptr1, - dest.container.length(), - ptr2, - dest.object.length(), - return_area, - ) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(ptr0) - mbt_ffi_free(ptr1) - mbt_ffi_free(ptr2) - mbt_ffi_free(return_area) - return ret -} +pub fn copy_object(src : @types.ObjectId, dest : @types.ObjectId) -> Result[Unit, String] { + + let ptr = mbt_ffi_str2ptr((src).container) + + let ptr0 = mbt_ffi_str2ptr((src).object) + + let ptr1 = mbt_ffi_str2ptr((dest).container) + + let ptr2 = mbt_ffi_str2ptr((dest).object) + let return_area = mbt_ffi_malloc(12) + wasmImportCopyObject(ptr, (src).container.length(), ptr0, (src).object.length(), ptr1, (dest).container.length(), ptr2, (dest).object.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(ptr0) + mbt_ffi_free(ptr1) + mbt_ffi_free(ptr2) + mbt_ffi_free(return_area) + return ret + +} ///| /// moves or renames an object, to the same or a different container /// returns an error if the destination container does not exist. /// overwrites destination object if it already existed. -pub fn move_object( - src : @types.ObjectId, - dest : @types.ObjectId, -) -> Result[Unit, String] { - let ptr = mbt_ffi_str2ptr(src.container) - - let ptr0 = mbt_ffi_str2ptr(src.object) - - let ptr1 = mbt_ffi_str2ptr(dest.container) - - let ptr2 = mbt_ffi_str2ptr(dest.object) - let return_area = mbt_ffi_malloc(12) - wasmImportMoveObject( - ptr, - src.container.length(), - ptr0, - src.object.length(), - ptr1, - dest.container.length(), - ptr2, - dest.object.length(), - return_area, - ) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(ptr0) - mbt_ffi_free(ptr1) - mbt_ffi_free(ptr2) - mbt_ffi_free(return_area) - return ret +pub fn move_object(src : @types.ObjectId, dest : @types.ObjectId) -> Result[Unit, String] { + + let ptr = mbt_ffi_str2ptr((src).container) + + let ptr0 = mbt_ffi_str2ptr((src).object) + + let ptr1 = mbt_ffi_str2ptr((dest).container) + + let ptr2 = mbt_ffi_str2ptr((dest).object) + let return_area = mbt_ffi_malloc(12) + wasmImportMoveObject(ptr, (src).container.length(), ptr0, (src).object.length(), ptr1, (dest).container.length(), ptr2, (dest).object.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(ptr0) + mbt_ffi_free(ptr1) + mbt_ffi_free(ptr2) + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/blobstore/container/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/blobstore/container/ffi.mbt index d3b59f1569..a85f14e01d 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/blobstore/container/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/blobstore/container/ffi.mbt @@ -1,362 +1,294 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropContainer(resource : Int) = "wasi:blobstore/container" "[resource-drop]container" -///| -fn wasmImportMethodContainerName(p0 : Int, p1 : Int) = "wasi:blobstore/container" "[method]container.name" +fn wasmImportMethodContainerName(p0 : Int, p1 : Int) = "wasi:blobstore/container" "[method]container.name" -///| -fn wasmImportMethodContainerInfo(p0 : Int, p1 : Int) = "wasi:blobstore/container" "[method]container.info" +fn wasmImportMethodContainerInfo(p0 : Int, p1 : Int) = "wasi:blobstore/container" "[method]container.info" -///| -fn wasmImportMethodContainerGetData( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int64, - p4 : Int64, - p5 : Int, -) = "wasi:blobstore/container" "[method]container.get-data" +fn wasmImportMethodContainerGetData(p0 : Int, p1 : Int, p2 : Int, p3 : Int64, p4 : Int64, p5 : Int) = "wasi:blobstore/container" "[method]container.get-data" -///| -fn wasmImportMethodContainerWriteData( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, -) = "wasi:blobstore/container" "[method]container.write-data" +fn wasmImportMethodContainerWriteData(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) = "wasi:blobstore/container" "[method]container.write-data" -///| -fn wasmImportMethodContainerListObjects(p0 : Int, p1 : Int) = "wasi:blobstore/container" "[method]container.list-objects" - -///| -fn wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:blobstore/container" "[async-lower][stream-read-0][method]container.list-objects" +fn wasmImportMethodContainerListObjects(p0 : Int, p1 : Int) = "wasi:blobstore/container" "[method]container.list-objects" -///| -fn wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0CancelRead( - handle : Int, -) -> Int = "wasi:blobstore/container" "[stream-cancel-read-0][method]container.list-objects" +fn wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:blobstore/container" "[async-lower][stream-read-0][method]container.list-objects" +fn wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0CancelRead(handle : Int) -> Int = "wasi:blobstore/container" "[stream-cancel-read-0][method]container.list-objects" -///| -fn wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0DropReadable( - handle : Int, -) = "wasi:blobstore/container" "[stream-drop-readable-0][method]container.list-objects" +fn wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0DropReadable(handle : Int) = "wasi:blobstore/container" "[stream-drop-readable-0][method]container.list-objects" -///| -fn wasmWasiBlobstoreContainerMethodContainerListObjectsStream0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(8 * length) - ptr +fn wasmWasiBlobstoreContainerMethodContainerListObjectsStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(8 * length) + ptr } -///| fn wasmWasiBlobstoreContainerMethodContainerListObjectsStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 8 - mbt_ffi_free(mbt_ffi_load32(elem_ptr + 0)) - } + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 8 + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 0)) + + } + } -///| -fn wasmWasiBlobstoreContainerMethodContainerListObjectsStream0Lift( - ptr : Int, -) -> String { - let result = mbt_ffi_ptr2str(mbt_ffi_load32(ptr + 0), mbt_ffi_load32(ptr + 4)) +fn wasmWasiBlobstoreContainerMethodContainerListObjectsStream0Lift(ptr : Int) -> String { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 0), mbt_ffi_load32((ptr) + 4)) - result + result } -///| fn wasmWasiBlobstoreContainerMethodContainerListObjectsStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[String] { - FixedArray::makei(length, index => { - let ptr = ptr + index * 8 - wasmWasiBlobstoreContainerMethodContainerListObjectsStream0Lift(ptr) - }) + + FixedArray::makei( + length, + (index) => { + let ptr = (ptr) + (index * 8) + wasmWasiBlobstoreContainerMethodContainerListObjectsStream0Lift(ptr) + } + ) + } -///| priv struct WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource::finish_read( - self : WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource, +self : WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource::wait_for_read_cleanup( - self : WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource, +self : WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource::cancel_active_read( - self : WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource, +self : WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiBlobstoreContainerMethodContainerListObjectsStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiBlobstoreContainerMethodContainerListObjectsStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource::close( - self : WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource, +self : WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0DropReadable(self.handle) } -///| fn WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource::close_sync( - self : WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource, +self : WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } - - self.closed = true - wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0DropReadable( - self.handle, - ) + if self.closed || self.reading { + return + } + + self.closed = true + wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0DropReadable(self.handle) } -///| async fn WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource::read( - self : WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource, - count : Int, +self : WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource, +count : Int, ) -> FixedArray[String]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiBlobstoreContainerMethodContainerListObjectsStream0Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiBlobstoreContainerMethodContainerListObjectsStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None + self.wait_for_read_cleanup() + self.finish_read() + return None } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiBlobstoreContainerMethodContainerListObjectsStream0DropReadable( - self.handle, - ) - } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) } + let values = wasmWasiBlobstoreContainerMethodContainerListObjectsStream0ListLift(ptr, progress) + owns_buffer = false self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiBlobstoreContainerMethodContainerListObjectsStream0ListLift( - ptr, progress, - ) - owns_buffer = false - self.finish_read() - if end { - self.close() - } - Some(values) + if end { + self.close() + } + Some(values) } -///| -fn wasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamLift( - handle : Int, -) -> @async-core.Stream[String] { - let source = WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) +fn wasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamLift(handle : Int) -> @async-core.Stream[String] { + let source = WasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| -fn wasmImportMethodContainerDeleteObject( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, -) = "wasi:blobstore/container" "[method]container.delete-object" +fn wasmImportMethodContainerDeleteObject(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:blobstore/container" "[method]container.delete-object" -///| -fn wasmImportMethodContainerDeleteObjects( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, -) = "wasi:blobstore/container" "[method]container.delete-objects" +fn wasmImportMethodContainerDeleteObjects(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:blobstore/container" "[method]container.delete-objects" -///| -fn wasmImportMethodContainerHasObject(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:blobstore/container" "[method]container.has-object" +fn wasmImportMethodContainerHasObject(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:blobstore/container" "[method]container.has-object" -///| -fn wasmImportMethodContainerObjectInfo(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:blobstore/container" "[method]container.object-info" +fn wasmImportMethodContainerObjectInfo(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:blobstore/container" "[method]container.object-info" + +fn wasmImportMethodContainerClear(p0 : Int, p1 : Int) = "wasi:blobstore/container" "[method]container.clear" ///| -fn wasmImportMethodContainerClear(p0 : Int, p1 : Int) = "wasi:blobstore/container" "[method]container.clear" +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +#|(func (param i32) (result i64) local.get 0 i64.load) -///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) diff --git a/sdks/moonbit/golem_sdk/interface/wasi/blobstore/container/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/blobstore/container/top.mbt index acbec5edba..523f3e66e0 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/blobstore/container/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/blobstore/container/top.mbt @@ -1,377 +1,319 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// this defines the `container` resource pub(all) struct Container(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Container::drop(self : Container) -> Unit { - let Container(resource) = self - wasmImportResourceDropContainer(resource) + let Container(resource) = self + wasmImportResourceDropContainer(resource) } - ///| /// returns container name pub fn Container::name(self : Container) -> Result[String, String] { - let Container(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodContainerName(handle, return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Ok(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result0) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} + let Container(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodContainerName(handle, return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Ok(result) + } + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result0) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} ///| /// returns container metadata -pub fn Container::info( - self : Container, -) -> Result[@types.ContainerMetadata, String] { - let Container(handle) = self - let return_area = mbt_ffi_malloc(24) - wasmImportMethodContainerInfo(handle, return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Result::Ok(@types.ContainerMetadata::{ - name: result, - created_at: mbt_ffi_load64(return_area + 16).reinterpret_as_uint64(), - }) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Result::Err(result0) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} +pub fn Container::info(self : Container) -> Result[@types.ContainerMetadata, String] { + + let Container(handle) = self + let return_area = mbt_ffi_malloc(24) + wasmImportMethodContainerInfo(handle, return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Result::Ok(@types.ContainerMetadata::{name : result, created_at : (mbt_ffi_load64((return_area) + 16)).reinterpret_as_uint64()}) + } + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + Result::Err(result0) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} ///| /// retrieves an object or portion of an object, as a resource. /// Start and end offsets are inclusive. /// Once a data-blob resource has been created, the underlying bytes are held by the blobstore service for the lifetime /// of the data-blob resource, even if the object they came from is later deleted. -pub fn Container::get_data( - self : Container, - name : String, - start : UInt64, - end : UInt64, -) -> Result[@types.IncomingValue, String] { - let Container(handle) = self - - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(12) - wasmImportMethodContainerGetData( - handle, - ptr, - name.length(), - start.reinterpret_as_int64(), - end.reinterpret_as_int64(), - return_area, - ) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => - Result::Ok( - @types.IncomingValue::IncomingValue(mbt_ffi_load32(return_area + 4)), - ) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} +pub fn Container::get_data(self : Container, name : String, start : UInt64, end : UInt64) -> Result[@types.IncomingValue, String] { + + let Container(handle) = self + + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(12) + wasmImportMethodContainerGetData(handle, ptr, name.length(), (start).reinterpret_as_int64(), (end).reinterpret_as_int64(), return_area); + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(@types.IncomingValue::IncomingValue(mbt_ffi_load32((return_area) + 4))) + } + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// creates or replaces an object with the data blob. -pub fn Container::write_data( - self : Container, - name : String, - data : @types.OutgoingValue, -) -> Result[Unit, String] { - let Container(handle) = self - - let ptr = mbt_ffi_str2ptr(name) - - let @types.OutgoingValue(handle0) = data - let return_area = mbt_ffi_malloc(12) - wasmImportMethodContainerWriteData( - handle, - ptr, - name.length(), - handle0, - return_area, - ) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} +pub fn Container::write_data(self : Container, name : String, data : @types.OutgoingValue) -> Result[Unit, String] { + + let Container(handle) = self + + let ptr = mbt_ffi_str2ptr(name) + + let @types.OutgoingValue(handle0) = data + let return_area = mbt_ffi_malloc(12) + wasmImportMethodContainerWriteData(handle, ptr, name.length(), handle0, return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// returns list of objects in the container. Order is undefined. -pub fn Container::list_objects( - self : Container, -) -> Result[@async-core.Stream[String], String] { - let Container(handle) = self - let return_area = mbt_ffi_malloc(12) - let lower_arg = handle - let lower_arg0 = return_area - wasmImportMethodContainerListObjects(lower_arg, lower_arg0) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = wasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamLift( - mbt_ffi_load32(return_area + 4), - ) - - Result::Ok(result) - } - 1 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result1) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} +pub fn Container::list_objects(self : Container) -> Result[@async-core.Stream[String], String] { + + let Container(handle) = self + let return_area = mbt_ffi_malloc(12) + let lower_arg = handle + let lower_arg0 = return_area + wasmImportMethodContainerListObjects(lower_arg, lower_arg0); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + let result = wasmWasiBlobstoreContainerMethodContainerListObjectsStream0StreamLift(mbt_ffi_load32((return_area) + 4)) + Result::Ok(result) + } + 1 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result1) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} ///| /// deletes object. /// does not return error if object did not exist. -pub fn Container::delete_object( - self : Container, - name : String, -) -> Result[Unit, String] { - let Container(handle) = self - - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(12) - wasmImportMethodContainerDeleteObject(handle, ptr, name.length(), return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} +pub fn Container::delete_object(self : Container, name : String) -> Result[Unit, String] { + let Container(handle) = self + + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(12) + wasmImportMethodContainerDeleteObject(handle, ptr, name.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// deletes multiple objects in the container -pub fn Container::delete_objects( - self : Container, - names : Array[String], -) -> Result[Unit, String] { - let cleanup_list : Array[Int] = [] - - let Container(handle) = self - - let address = mbt_ffi_malloc(names.length() * 8) - for index = 0; index < names.length(); index = index + 1 { - let iter_elem : String = names[index] - let iter_base = address + index * 8 - - let ptr = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr) - cleanup_list.push(ptr) - } - let return_area = mbt_ffi_malloc(12) - wasmImportMethodContainerDeleteObjects( - handle, - address, - names.length(), - return_area, - ) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(address) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} +pub fn Container::delete_objects(self : Container, names : Array[String]) -> Result[Unit, String] { + let cleanup_list : Array[Int] = [] + + let Container(handle) = self + + let address = mbt_ffi_malloc((names).length() * 8); + for index = 0; index < (names).length(); index = index + 1 { + let iter_elem : String = (names)[(index)] + let iter_base = address + (index * 8); + + let ptr = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr) + cleanup_list.push(ptr) + } + let return_area = mbt_ffi_malloc(12) + wasmImportMethodContainerDeleteObjects(handle, address, (names).length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(address) + mbt_ffi_free(return_area) + + cleanup_list.each(mbt_ffi_free) + return ret + +} ///| /// returns true if the object exists in this container -pub fn Container::has_object( - self : Container, - name : String, -) -> Result[Bool, String] { - let Container(handle) = self - - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(12) - wasmImportMethodContainerHasObject(handle, ptr, name.length(), return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load8_u(return_area + 4) != 0) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} +pub fn Container::has_object(self : Container, name : String) -> Result[Bool, String] { + + let Container(handle) = self + + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(12) + wasmImportMethodContainerHasObject(handle, ptr, name.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + Result::Ok((mbt_ffi_load8_u((return_area) + 4) != 0)) + } + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// returns metadata for the object -pub fn Container::object_info( - self : Container, - name : String, -) -> Result[@types.ObjectMetadata, String] { - let Container(handle) = self - - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(40) - wasmImportMethodContainerObjectInfo(handle, ptr, name.length(), return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 16), - mbt_ffi_load32(return_area + 20), - ) - - Result::Ok(@types.ObjectMetadata::{ - name: result, - container: result0, - created_at: mbt_ffi_load64(return_area + 24).reinterpret_as_uint64(), - size: mbt_ffi_load64(return_area + 32).reinterpret_as_uint64(), - }) - } - 1 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Result::Err(result1) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} +pub fn Container::object_info(self : Container, name : String) -> Result[@types.ObjectMetadata, String] { + + let Container(handle) = self + + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(40) + wasmImportMethodContainerObjectInfo(handle, ptr, name.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 16), mbt_ffi_load32((return_area) + 20)) + + Result::Ok(@types.ObjectMetadata::{name : result, container : result0, created_at : (mbt_ffi_load64((return_area) + 24)).reinterpret_as_uint64(), size : (mbt_ffi_load64((return_area) + 32)).reinterpret_as_uint64()}) + } + 1 => { + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Result::Err(result1) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// removes all objects within the container, leaving the container empty. pub fn Container::clear(self : Container) -> Result[Unit, String] { - let Container(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodContainerClear(handle, return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret + + let Container(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodContainerClear(handle, return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/blobstore/types/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/blobstore/types/ffi.mbt index 4215db43a1..8d94790aa1 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/blobstore/types/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/blobstore/types/ffi.mbt @@ -1,844 +1,684 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropOutgoingValue(resource : Int) = "wasi:blobstore/types" "[resource-drop]outgoing-value" -///| fn wasmImportResourceDropIncomingValue(resource : Int) = "wasi:blobstore/types" "[resource-drop]incoming-value" -///| fn wasmImportStaticOutgoingValueNewOutgoingValue() -> Int = "wasi:blobstore/types" "[static]outgoing-value.new-outgoing-value" -///| -fn wasmImportMethodOutgoingValueOutgoingValueWriteBody( - p0 : Int, - p1 : Int, -) -> Int = "wasi:blobstore/types" "[method]outgoing-value.outgoing-value-write-body" - -///| -fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:blobstore/types" "[async-lower][stream-read-0][method]outgoing-value.outgoing-value-write-body" +fn wasmImportMethodOutgoingValueOutgoingValueWriteBody(p0 : Int, p1 : Int) -> Int = "wasi:blobstore/types" "[method]outgoing-value.outgoing-value-write-body" -///| -fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0CancelRead( - handle : Int, -) -> Int = "wasi:blobstore/types" "[stream-cancel-read-0][method]outgoing-value.outgoing-value-write-body" +fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:blobstore/types" "[async-lower][stream-read-0][method]outgoing-value.outgoing-value-write-body" +fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0CancelRead(handle : Int) -> Int = "wasi:blobstore/types" "[stream-cancel-read-0][method]outgoing-value.outgoing-value-write-body" -///| -fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropReadable( - handle : Int, -) = "wasi:blobstore/types" "[stream-drop-readable-0][method]outgoing-value.outgoing-value-write-body" +fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropReadable(handle : Int) = "wasi:blobstore/types" "[stream-drop-readable-0][method]outgoing-value.outgoing-value-write-body" -///| fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0New() -> UInt64 = "wasi:blobstore/types" "[stream-new-0][method]outgoing-value.outgoing-value-write-body" +fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Write(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:blobstore/types" "[async-lower][stream-write-0][method]outgoing-value.outgoing-value-write-body" -///| -fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Write( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:blobstore/types" "[async-lower][stream-write-0][method]outgoing-value.outgoing-value-write-body" - -///| -fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0CancelWrite( - handle : Int, -) -> Int = "wasi:blobstore/types" "[stream-cancel-write-0][method]outgoing-value.outgoing-value-write-body" +fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0CancelWrite(handle : Int) -> Int = "wasi:blobstore/types" "[stream-cancel-write-0][method]outgoing-value.outgoing-value-write-body" -///| -fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropWritable( - handle : Int, -) = "wasi:blobstore/types" "[stream-drop-writable-0][method]outgoing-value.outgoing-value-write-body" +fn wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropWritable(handle : Int) = "wasi:blobstore/types" "[stream-drop-writable-0][method]outgoing-value.outgoing-value-write-body" -///| -fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Commit( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| -fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Lower( - value : Byte, - ptr : Int, -) -> Unit { - mbt_ffi_store8(ptr + 0, value.to_int()) +fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Lower(value : Byte, ptr : Int) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).to_int()) + } -///| fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource::finish_read( - self : WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource, +self : WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource::wait_for_read_cleanup( - self : WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource, +self : WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() - } - }, - resume_on_cancel=true, - ) catch { - _ => () - } + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () + } } -///| async fn WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource::cancel_active_read( - self : WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource, +self : WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource::close( - self : WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource, +self : WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropReadable(self.handle) } -///| fn WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource::close_sync( - self : WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource, +self : WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - if wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamRejectPrepared( - self.handle, - ) { - self.closed = true - return - } - - self.closed = true - wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropReadable( - self.handle, - ) + if wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamRejectPrepared(self.handle) { + self.closed = true + return + } + + self.closed = true + wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropReadable(self.handle) } -///| async fn WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource::read( - self : WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource, - count : Int, +self : WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) + } + let values = wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) + if end { + self.close() + } + Some(values) } -///| -fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) +fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| priv struct WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducer { - stream : @async-core.Stream[Byte] - writer : Int + stream : @async-core.Stream[Byte] + writer : Int } -///| -let wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducers : Map[ - Int, - WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducer, -] = Map([]) +let wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducers : Map[Int, WasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducer] = Map([]) -///| -fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamRejectPrepared( - handle : Int, -) -> Bool { - guard wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return false - } - wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducers.remove( - handle, - ) - let writer = prepared.writer - wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropReadable( - handle, - ) - wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropWritable( - writer, - ) - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( - () => { - prepared.stream.reject((value : Byte) => { - let ptr = wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Malloc( - 1, - ) - wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Lower( - value, ptr, - ) - wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Reject( - ptr, 0, 1, - ) - mbt_ffi_free(ptr) - }) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - }) - true +fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamRejectPrepared(handle : Int) -> Bool { + guard wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducers.get(handle) is Some(prepared) else { + return false + } + wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducers.remove(handle) + let writer = prepared.writer + wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropReadable(handle) + wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropWritable(writer) + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + prepared.stream.reject((value : Byte) => { + let ptr = wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Malloc(1) + wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Lower(value, ptr) + wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + }) + true } -///| -fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamCommit( - handle : Int, -) -> Unit { - guard wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return - } - wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducers.remove( - handle, - ) - let stream = prepared.stream - let writer = prepared.writer - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let producer = stream.take_producer() - @async-core.spawn_component_task_current(async fn() { - let writer_closed = Ref(false) - let writer_lock = @async-core.Mutex() - let close_writer = fn() -> Unit { - if !writer_closed.val { - writer_closed.val = true - wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropWritable( - writer, - ) - } - } - let close_writer_serialized = async fn() -> Unit { - writer_lock.acquire() - defer writer_lock.release() - close_writer() - } - let cleanup_value = fn(value : Byte) -> Unit { - let ptr = wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Malloc( - 1, - ) - wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Lower( - value, ptr, - ) - wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Reject( - ptr, 0, 1, - ) - mbt_ffi_free(ptr) - } - let sink = @async-core.Sink::from_callbacks( - (data : ArrayView[Byte]) => { - writer_lock.acquire() - defer writer_lock.release() - if writer_closed.val || data.length() == 0 { - return 0 - } - let data_len = if data.length() < 64 { data.length() } else { 64 } - let ptr = wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Malloc( - data_len, - ) - for i in 0.. Unit { - wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Commit( - ptr, 0, transferred, - ) - if transferred < data_len { - wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Reject( - ptr, - transferred, - data_len - transferred, +fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamCommit(handle : Int) -> Unit { + guard wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducers.get(handle) is Some(prepared) else { + return + } + wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducers.remove(handle) + let stream = prepared.stream + let writer = prepared.writer + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let producer = stream.take_producer() + @async-core.spawn_component_task_current(async fn() { + let writer_closed = Ref(false) + let writer_lock = @async-core.Mutex() + let close_writer = fn() -> Unit { + if !writer_closed.val { + writer_closed.val = true + wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0DropWritable(writer) + } + } + let close_writer_serialized = async fn() -> Unit { + writer_lock.acquire() + defer writer_lock.release() + close_writer() + } + let cleanup_value = fn(value : Byte) -> Unit { + let ptr = wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Malloc(1) + wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Lower(value, ptr) + wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + } + let sink = @async-core.Sink::from_callbacks( + (data : ArrayView[Byte]) => { + writer_lock.acquire() + defer writer_lock.release() + if writer_closed.val || data.length() == 0 { + return 0 + } + let data_len = if data.length() < 64 { + data.length() + } else { + 64 + } + let ptr = wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Malloc(data_len) + for i in 0.. Unit { + wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Commit(ptr, 0, transferred) + if transferred < data_len { + wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Reject( + ptr, + transferred, + data_len - transferred, + ) + } + mbt_ffi_free(ptr) + } + let mut total = 0 + let mut dropped = false + while total < data_len { + let (progress, end) = @async-core.suspend_for_stream_write( + writer, + wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Write( + writer, + ptr + total * 1, + data_len - total, + ), + ) catch { + _ => { + total = total + @async-core.cancel_stream_write( + writer, + () => wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0CancelWrite(writer), + ) + settle_staging(total) + close_writer() + return data_len + } + } + total = total + progress + if end { + dropped = true + break + } + } + settle_staging(total) + if dropped { + close_writer() + } + // The canonical writer accepted `total`; generated cleanup + // consumed the rest of this staging window. + data_len + }, + () => close_writer_serialized(), + () => !writer_closed.val, + Some(cleanup_value), ) - } - mbt_ffi_free(ptr) - } - let mut total = 0 - let mut dropped = false - while total < data_len { - let (progress, end) = @async-core.suspend_for_stream_write( - writer, - wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0Write( - writer, - ptr + total * 1, - data_len - total, - ), - ) catch { - _ => { - total = total + - @async-core.cancel_stream_write(writer, () => { - wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0CancelWrite( - writer, - ) - }) - settle_staging(total) - close_writer() - return data_len + let relay_source = producer is None + let run_producer = async fn() -> Unit { + match producer { + Some(producer) => { + producer(sink) + sink.close() + } + None => + for ;; { + match stream.read(64) { + Some(data) => + if !sink.write_all(data[:]) { + stream.reject(cleanup_value) + return + } + None => { + sink.close() + return + } + } + } + } } - } - total = total + progress - if end { - dropped = true - break - } - } - settle_staging(total) - if dropped { - close_writer() - } - // The canonical writer accepted `total`; generated cleanup - // consumed the rest of this staging window. - data_len - }, - () => close_writer_serialized(), - () => !writer_closed.val, - Some(cleanup_value), - ) - let relay_source = producer is None - let run_producer = async fn() -> Unit { - match producer { - Some(producer) => { - producer(sink) - sink.close() - } - None => - for ;; { - match stream.read(64) { - Some(data) => - if !sink.write_all(data[:]) { - stream.reject(cleanup_value) - return - } - None => { - sink.close() - return - } + run_producer() catch { + _ => + if relay_source { + @async-core.protect_from_cancel( + () => stream.reject(cleanup_value), + resume_on_cancel=true, + ) catch { + _ => () + } + } } - } - } - } - run_producer() catch { - _ => - if relay_source { - @async-core.protect_from_cancel( - () => stream.reject(cleanup_value), + // A retained Sink may still own an in-flight canonical write after its + // producer returns. Do not drop the writable endpoint until that write + // has reached a terminal event and released its staging buffer. + @async-core.protect_from_cancel( + () => close_writer_serialized(), resume_on_cancel=true, - ) catch { - _ => () - } - } - } - // A retained Sink may still own an in-flight canonical write after its - // producer returns. Do not drop the writable endpoint until that write - // has reached a terminal event and released its staging buffer. - @async-core.protect_from_cancel( - () => close_writer_serialized(), - resume_on_cancel=true, - ) - }) + ) + }) } -///| -fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamLower( - stream : @async-core.Stream[Byte], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let pair = wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducers.set( - reader, - { stream, writer }, - ) - reader +fn wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamLower(stream : @async-core.Stream[Byte]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let pair = wasmImportWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamProducers.set(reader, { stream, writer }) + reader } -///| -fn wasmImportMethodIncomingValueIncomingValueConsumeSync(p0 : Int, p1 : Int) = "wasi:blobstore/types" "[method]incoming-value.incoming-value-consume-sync" - -///| -fn wasmImportMethodIncomingValueIncomingValueConsumeAsync(p0 : Int, p1 : Int) = "wasi:blobstore/types" "[method]incoming-value.incoming-value-consume-async" +fn wasmImportMethodIncomingValueIncomingValueConsumeSync(p0 : Int, p1 : Int) = "wasi:blobstore/types" "[method]incoming-value.incoming-value-consume-sync" -///| -fn wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:blobstore/types" "[async-lower][stream-read-0][method]incoming-value.incoming-value-consume-async" +fn wasmImportMethodIncomingValueIncomingValueConsumeAsync(p0 : Int, p1 : Int) = "wasi:blobstore/types" "[method]incoming-value.incoming-value-consume-async" -///| -fn wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0CancelRead( - handle : Int, -) -> Int = "wasi:blobstore/types" "[stream-cancel-read-0][method]incoming-value.incoming-value-consume-async" +fn wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:blobstore/types" "[async-lower][stream-read-0][method]incoming-value.incoming-value-consume-async" +fn wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0CancelRead(handle : Int) -> Int = "wasi:blobstore/types" "[stream-cancel-read-0][method]incoming-value.incoming-value-consume-async" -///| -fn wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable( - handle : Int, -) = "wasi:blobstore/types" "[stream-drop-readable-0][method]incoming-value.incoming-value-consume-async" +fn wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable(handle : Int) = "wasi:blobstore/types" "[stream-drop-readable-0][method]incoming-value.incoming-value-consume-async" -///| -fn wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::finish_read( - self : WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, +self : WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::wait_for_read_cleanup( - self : WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, +self : WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() - } - }, - resume_on_cancel=true, - ) catch { - _ => () - } + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () + } } -///| async fn WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::cancel_active_read( - self : WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, +self : WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::close( - self : WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, +self : WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable(self.handle) } -///| fn WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::close_sync( - self : WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, +self : WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } - - self.closed = true - wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable( - self.handle, - ) + if self.closed || self.reading { + return + } + + self.closed = true + wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable(self.handle) } -///| async fn WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::read( - self : WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, - count : Int, +self : WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) + } + let values = wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) + if end { + self.close() + } + Some(values) } -///| -fn wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) +fn wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| fn wasmImportMethodIncomingValueSize(p0 : Int) -> Int64 = "wasi:blobstore/types" "[method]incoming-value.size" ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/blobstore/types/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/blobstore/types/top.mbt index d8410f9061..1f5efc1101 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/blobstore/types/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/blobstore/types/top.mbt @@ -1,41 +1,30 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// information about a container pub(all) struct ContainerMetadata { - name : String - created_at : UInt64 + name : String; created_at : UInt64 } derive(Show, Eq) - ///| /// information about an object pub(all) struct ObjectMetadata { - name : String - container : String - created_at : UInt64 - size : UInt64 + name : String; container : String; created_at : UInt64; size : UInt64 } derive(Show, Eq) - ///| /// identifier for an object that includes its container name pub(all) struct ObjectId { - container : String - object : String + container : String; object : String } derive(Show, Eq) - ///| /// A data blob value. The value can be of any type that can be represented /// in a byte array. /// Soon: switch to `resource value { ... }` pub(all) struct OutgoingValue(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn OutgoingValue::drop(self : OutgoingValue) -> Unit { - let OutgoingValue(resource) = self - wasmImportResourceDropOutgoingValue(resource) + let OutgoingValue(resource) = self + wasmImportResourceDropOutgoingValue(resource) } - ///| /// A incoming-value is a wrapper around a value. /// @@ -47,115 +36,105 @@ pub fn OutgoingValue::drop(self : OutgoingValue) -> Unit { /// Soon: switch to `resource incoming-value { ... }` pub(all) struct IncomingValue(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn IncomingValue::drop(self : IncomingValue) -> Unit { - let IncomingValue(resource) = self - wasmImportResourceDropIncomingValue(resource) + let IncomingValue(resource) = self + wasmImportResourceDropIncomingValue(resource) } - ///| pub fn OutgoingValue::new_outgoing_value() -> OutgoingValue { - let result : Int = wasmImportStaticOutgoingValueNewOutgoingValue() - let ret = OutgoingValue::OutgoingValue(result) - return ret -} -///| -pub fn OutgoingValue::outgoing_value_write_body( - self : OutgoingValue, - data : @async-core.Stream[Byte], -) -> Result[Unit, Unit] { - let OutgoingValue(handle) = self - let lower_arg = handle - let lower_arg0 = wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamLower( - data, - ) - let result : Int = wasmImportMethodOutgoingValueOutgoingValueWriteBody( - lower_arg, lower_arg0, - ) - wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamCommit( - lower_arg0, - ) - - let lifted = match result { - 0 => Result::Ok(()) - 1 => Result::Err(()) - _ => panic() - } - let ret = lifted - return ret -} + let result : Int = wasmImportStaticOutgoingValueNewOutgoingValue(); + let ret = OutgoingValue::OutgoingValue(result) + return ret -///| -pub fn IncomingValue::incoming_value_consume_sync( - self : IncomingValue, -) -> Result[FixedArray[Byte], String] { - let IncomingValue(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodIncomingValueIncomingValueConsumeSync(handle, return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = mbt_ffi_ptr2bytes( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Ok(result) - } - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result0) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret } +///| +pub fn OutgoingValue::outgoing_value_write_body(self : OutgoingValue, data : @async-core.Stream[Byte]) -> Result[Unit, Unit] { + + let OutgoingValue(handle) = self + let lower_arg = handle + let lower_arg0 = wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamLower(data) + let result : Int = wasmImportMethodOutgoingValueOutgoingValueWriteBody(lower_arg, lower_arg0); + wasmWasiBlobstoreTypesMethodOutgoingValueOutgoingValueWriteBodyStream0StreamCommit(lower_arg0) + let lifted = match (result) { + 0 => { + + Result::Ok(()) + } + 1 => { + + Result::Err(()) + } + _ => panic() + } + let ret = lifted + return ret + +} ///| -pub fn IncomingValue::incoming_value_consume_async( - self : IncomingValue, -) -> Result[@async-core.Stream[Byte], String] { - let IncomingValue(handle) = self - let return_area = mbt_ffi_malloc(12) - let lower_arg = handle - let lower_arg0 = return_area - wasmImportMethodIncomingValueIncomingValueConsumeAsync(lower_arg, lower_arg0) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamLift( - mbt_ffi_load32(return_area + 4), - ) - - Result::Ok(result) - } - 1 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Err(result1) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret +pub fn IncomingValue::incoming_value_consume_sync(self : IncomingValue) -> Result[FixedArray[Byte], String] { + + let IncomingValue(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodIncomingValueIncomingValueConsumeSync(handle, return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2bytes(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Ok(result) + } + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result0) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + } +///| +pub fn IncomingValue::incoming_value_consume_async(self : IncomingValue) -> Result[@async-core.Stream[Byte], String] { + + let IncomingValue(handle) = self + let return_area = mbt_ffi_malloc(12) + let lower_arg = handle + let lower_arg0 = return_area + wasmImportMethodIncomingValueIncomingValueConsumeAsync(lower_arg, lower_arg0); + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + let result = wasmWasiBlobstoreTypesMethodIncomingValueIncomingValueConsumeAsyncStream0StreamLift(mbt_ffi_load32((return_area) + 4)) + + Result::Ok(result) + } + 1 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Err(result1) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} ///| pub fn IncomingValue::size(self : IncomingValue) -> UInt64 { - let IncomingValue(handle) = self - let result : Int64 = wasmImportMethodIncomingValueSize(handle) - let ret = result.reinterpret_as_uint64() - return ret + + let IncomingValue(handle) = self + let result : Int64 = wasmImportMethodIncomingValueSize(handle); + let ret = (result).reinterpret_as_uint64() + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/cli/environment/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/cli/environment/ffi.mbt index 39a8ec6d1e..5bc9184512 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/cli/environment/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/cli/environment/ffi.mbt @@ -1,36 +1,34 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| -fn wasmImportGetEnvironment(p0 : Int) = "wasi:cli/environment@0.3.0" "get-environment" +fn wasmImportGetEnvironment(p0 : Int) = "wasi:cli/environment@0.3.0" "get-environment" -///| -fn wasmImportGetArguments(p0 : Int) = "wasi:cli/environment@0.3.0" "get-arguments" +fn wasmImportGetArguments(p0 : Int) = "wasi:cli/environment@0.3.0" "get-arguments" -///| -fn wasmImportGetInitialCwd(p0 : Int) = "wasi:cli/environment@0.3.0" "get-initial-cwd" +fn wasmImportGetInitialCwd(p0 : Int) = "wasi:cli/environment@0.3.0" "get-initial-cwd" ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/cli/environment/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/cli/environment/top.mbt index 0dc179e499..2b9991ede2 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/cli/environment/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/cli/environment/top.mbt @@ -1,5 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Get the POSIX-style environment variables. /// @@ -10,74 +9,68 @@ /// in the component model, this import function should return the same /// values each time it is called. pub fn get_environment() -> Array[(String, String)] { - let return_area = mbt_ffi_malloc(8) - wasmImportGetEnvironment(return_area) - - let array : Array[(String, String)] = [] - for index = 0; index < mbt_ffi_load32(return_area + 4); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index * 16 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array.push((result, result0)) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array - mbt_ffi_free(return_area) - return ret -} + let return_area = mbt_ffi_malloc(8) + wasmImportGetEnvironment(return_area); + + let array : Array[(String, String)] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 16) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array.push((result, result0)) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array + mbt_ffi_free(return_area) + return ret + +} ///| /// Get the POSIX-style arguments to the program. pub fn get_arguments() -> Array[String] { - let return_area = mbt_ffi_malloc(8) - wasmImportGetArguments(return_area) - - let array : Array[String] = [] - for index = 0; index < mbt_ffi_load32(return_area + 4); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index * 8 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array - mbt_ffi_free(return_area) - return ret -} + let return_area = mbt_ffi_malloc(8) + wasmImportGetArguments(return_area); + + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 8) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array + mbt_ffi_free(return_area) + return ret + +} ///| /// Return a path that programs should use as their initial current working /// directory, interpreting `.` as shorthand for this. pub fn get_initial_cwd() -> String? { - let return_area = mbt_ffi_malloc(12) - wasmImportGetInitialCwd(return_area) - - let lifted : String? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Option::Some(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret + + let return_area = mbt_ffi_malloc(12) + wasmImportGetInitialCwd(return_area); + + let lifted : String? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Option::Some(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/cli/stdout/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/cli/stdout/ffi.mbt index 9b220a3f7d..c2d223d22f 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/cli/stdout/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/cli/stdout/ffi.mbt @@ -1,4 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportGetStdout() -> Int = "wasi:cli/stdout@0.2.6" "get-stdout" + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/cli/stdout/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/cli/stdout/top.mbt index 7f32033d68..c7b4a72158 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/cli/stdout/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/cli/stdout/top.mbt @@ -1,8 +1,10 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| pub fn get_stdout() -> @streams.OutputStream { - let result : Int = wasmImportGetStdout() - let ret = @streams.OutputStream::OutputStream(result) - return ret + + let result : Int = wasmImportGetStdout(); + let ret = @streams.OutputStream::OutputStream(result) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/clocks/system-clock/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/clocks/system-clock/ffi.mbt index fcf6a7cda2..45f1eaa45c 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/clocks/system-clock/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/clocks/system-clock/ffi.mbt @@ -1,26 +1,25 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| -fn wasmImportNow(p0 : Int) = "wasi:clocks/system-clock@0.3.0" "now" +fn wasmImportNow(p0 : Int) = "wasi:clocks/system-clock@0.3.0" "now" -///| fn wasmImportGetResolution() -> Int64 = "wasi:clocks/system-clock@0.3.0" "get-resolution" ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#|(func (param i32) local.get 0 call $moonbit.decref) ///| extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/clocks/system-clock/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/clocks/system-clock/top.mbt index 19f9fa1c7b..aa6475e7f8 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/clocks/system-clock/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/clocks/system-clock/top.mbt @@ -1,5 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// An "instant", or "exact time", is a point in time without regard to any /// time zone: just the time since a particular external reference point, @@ -18,10 +17,8 @@ /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time pub(all) struct Instant { - seconds : Int64 - nanoseconds : UInt + seconds : Int64; nanoseconds : UInt } derive(Show, Eq) - ///| /// Read the current value of the clock. /// @@ -30,21 +27,22 @@ pub(all) struct Instant { /// /// The nanoseconds field of the output is always less than 1000000000. pub fn now() -> Instant { - let return_area = mbt_ffi_malloc(16) - wasmImportNow(return_area) - let ret = Instant::{ - seconds: mbt_ffi_load64(return_area + 0), - nanoseconds: mbt_ffi_load32(return_area + 8).reinterpret_as_uint(), - } - mbt_ffi_free(return_area) - return ret -} + let return_area = mbt_ffi_malloc(16) + wasmImportNow(return_area); + let ret = Instant::{seconds : mbt_ffi_load64((return_area) + 0), nanoseconds : (mbt_ffi_load32((return_area) + 8)).reinterpret_as_uint()} + mbt_ffi_free(return_area) + return ret + +} ///| /// Query the resolution of the clock. Returns the smallest duration of time /// that the implementation permits distinguishing. pub fn get_resolution() -> UInt64 { - let result : Int64 = wasmImportGetResolution() - let ret = result.reinterpret_as_uint64() - return ret + + let result : Int64 = wasmImportGetResolution(); + let ret = (result).reinterpret_as_uint64() + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/clocks/types/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/clocks/types/ffi.mbt index 01e5518ad5..821232033b 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/clocks/types/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/clocks/types/ffi.mbt @@ -1 +1,2 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/clocks/types/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/clocks/types/top.mbt index 01e5518ad5..821232033b 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/clocks/types/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/clocks/types/top.mbt @@ -1 +1,2 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/config/store/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/config/store/ffi.mbt index 9c44bd5d22..343bd6d2e4 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/config/store/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/config/store/ffi.mbt @@ -1,38 +1,37 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| -fn wasmImportGet(p0 : Int, p1 : Int, p2 : Int) = "wasi:config/store@0.2.0-draft" "get" +fn wasmImportGet(p0 : Int, p1 : Int, p2 : Int) = "wasi:config/store@0.2.0-draft" "get" + +fn wasmImportGetAll(p0 : Int) = "wasi:config/store@0.2.0-draft" "get-all" ///| -fn wasmImportGetAll(p0 : Int) = "wasi:config/store@0.2.0-draft" "get-all" +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| #owned(str) extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) - -///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +#|(func (param i32) (result i32) local.get 0) ///| extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#|(func (param i32) local.get 0 call $moonbit.decref) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/config/store/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/config/store/top.mbt index e567c20c64..520a875c8f 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/config/store/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/config/store/top.mbt @@ -1,126 +1,116 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// An error type that encapsulates the different errors that can occur fetching configuration values. pub(all) suberror Error_ { - Upstream(String) - Io(String) + Upstream(String) + Io(String) } derive(Show, Eq) - ///| /// Gets a configuration value of type `string` associated with the `key`. /// /// The value is returned as an `option`. If the key is not found, /// `Ok(none)` is returned. If an error occurs, an `Err(error)` is returned. pub fn get(key : String) -> Result[String?, Error_] { - let ptr = mbt_ffi_str2ptr(key) - let return_area = mbt_ffi_malloc(16) - wasmImportGet(ptr, key.length(), return_area) - - let lifted3 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let lifted : String? = match mbt_ffi_load8_u(return_area + 4) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Option::Some(result) - } - _ => panic() - } - Result::Ok(lifted) - } - 1 => { - let lifted2 = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Upstream(result0) - } - 1 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Io(result1) - } - _ => panic() + let ptr = mbt_ffi_str2ptr(key) + let return_area = mbt_ffi_malloc(16) + wasmImportGet(ptr, key.length(), return_area); + + let lifted3 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let lifted : String? = match mbt_ffi_load8_u((return_area) + 4) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Option::Some(result) + } + _ => panic() + } + + Result::Ok(lifted) + } + 1 => { + + let lifted2 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Upstream(result0) + } + 1 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Io(result1) + } + _ => panic() + } + + Result::Err(lifted2) + } + _ => panic() } + let ret = lifted3 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret - Result::Err(lifted2) - } - _ => panic() - } - let ret = lifted3 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret } - ///| /// Gets a list of configuration key-value pairs of type `string`. /// /// If an error occurs, an `Err(error)` is returned. pub fn get_all() -> Result[Array[(String, String)], Error_] { - let return_area = mbt_ffi_malloc(16) - wasmImportGetAll(return_area) - - let lifted3 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array : Array[(String, String)] = [] - for index = 0; index < mbt_ffi_load32(return_area + 8); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index * 16 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array.push((result, result0)) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Result::Ok(array) - } - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Upstream(result1) - } - 1 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Error_::Io(result2) - } - _ => panic() + + let return_area = mbt_ffi_malloc(16) + wasmImportGetAll(return_area); + + let lifted3 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let array : Array[(String, String)] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 8)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index * 16) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array.push((result, result0)) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) + + Result::Ok(array) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Upstream(result1) + } + 1 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Error_::Io(result2) + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted3 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted3 - mbt_ffi_free(return_area) - return ret } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/filesystem/preopens/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/filesystem/preopens/ffi.mbt index 7f5194eed2..b8772c0a35 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/filesystem/preopens/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/filesystem/preopens/ffi.mbt @@ -1,26 +1,26 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| -fn wasmImportGetDirectories(p0 : Int) = "wasi:filesystem/preopens@0.3.0" "get-directories" +fn wasmImportGetDirectories(p0 : Int) = "wasi:filesystem/preopens@0.3.0" "get-directories" ///| extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +#|(func (param i32) (result i32) local.get 0 i32.load) ///| extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/filesystem/preopens/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/filesystem/preopens/top.mbt index 17a0586fb5..efa7406d5c 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/filesystem/preopens/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/filesystem/preopens/top.mbt @@ -1,26 +1,23 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Return the set of preopened directories, and their paths. pub fn get_directories() -> Array[(@types.Descriptor, String)] { - let return_area = mbt_ffi_malloc(8) - wasmImportGetDirectories(return_area) - let array : Array[(@types.Descriptor, String)] = [] - for index = 0; index < mbt_ffi_load32(return_area + 4); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index * 12 + let return_area = mbt_ffi_malloc(8) + wasmImportGetDirectories(return_area); + + let array : Array[(@types.Descriptor, String)] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 12) - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 4), - mbt_ffi_load32(iter_base + 8), - ) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8)) + + array.push((@types.Descriptor::Descriptor(mbt_ffi_load32((iter_base) + 0)), result)) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array + mbt_ffi_free(return_area) + return ret - array.push( - (@types.Descriptor::Descriptor(mbt_ffi_load32(iter_base + 0)), result), - ) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array - mbt_ffi_free(return_area) - return ret } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/filesystem/types/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/filesystem/types/ffi.mbt index fc23e7a6ba..7ae66846cf 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/filesystem/types/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/filesystem/types/ffi.mbt @@ -1,3197 +1,3157 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropDescriptor(resource : Int) = "wasi:filesystem/types@0.3.0" "[resource-drop]descriptor" -///| -fn wasmImportMethodDescriptorReadViaStream(p0 : Int, p1 : Int64, p2 : Int) = "wasi:filesystem/types@0.3.0" "[method]descriptor.read-via-stream" - -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][stream-read-0][method]descriptor.read-via-stream" +fn wasmImportMethodDescriptorReadViaStream(p0 : Int, p1 : Int64, p2 : Int) = "wasi:filesystem/types@0.3.0" "[method]descriptor.read-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0CancelRead( - handle : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[stream-cancel-read-0][method]descriptor.read-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][stream-read-0][method]descriptor.read-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0CancelRead(handle : Int) -> Int = "wasi:filesystem/types@0.3.0" "[stream-cancel-read-0][method]descriptor.read-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0DropReadable( - handle : Int, -) = "wasi:filesystem/types@0.3.0" "[stream-drop-readable-0][method]descriptor.read-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0DropReadable(handle : Int) = "wasi:filesystem/types@0.3.0" "[stream-drop-readable-0][method]descriptor.read-via-stream" -///| -fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource::finish_read( - self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource::wait_for_read_cleanup( - self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource::cancel_active_read( - self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource::close( - self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0DropReadable(self.handle) } -///| fn WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource::close_sync( - self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0DropReadable(self.handle) } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource::read( - self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource, - count : Int, +self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) + } + let values = wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) + if end { + self.close() + } + Some(values) +} + +fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Read( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][future-read-1][method]descriptor.read-via-stream" - -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1CancelRead( - handle : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[future-cancel-read-1][method]descriptor.read-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Read(handle : Int, buffer_ptr : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][future-read-1][method]descriptor.read-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1CancelRead(handle : Int) -> Int = "wasi:filesystem/types@0.3.0" "[future-cancel-read-1][method]descriptor.read-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1DropReadable( - handle : Int, -) = "wasi:filesystem/types@0.3.0" "[future-drop-readable-1][method]descriptor.read-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1DropReadable(handle : Int) = "wasi:filesystem/types@0.3.0" "[future-drop-readable-1][method]descriptor.read-via-stream" -///| -fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(20 * length) - ptr +fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(20 * length) + ptr } -///| fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 20 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 12)) - _ => panic() + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 20 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() } - _ => panic() - } - _ => panic() - } - } + + } + } -///| -fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Lift( - ptr : Int, -) -> Result[Unit, ErrorCode] { - let lifted1 = match mbt_ffi_load8_u(ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(ptr + 8) { - 0 => Option::None +fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Lift(ptr : Int) -> Result[Unit, ErrorCode] { + + let lifted1 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { + + Result::Ok(()) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 12), - mbt_ffi_load32(ptr + 16), - ) - Option::Some(result) + let lifted0 = match (mbt_ffi_load8_u((ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 12), mbt_ffi_load32((ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) } _ => panic() - } - - ErrorCode::Other(lifted) - } - _ => panic() } - Result::Err(lifted0) - } - _ => panic() - } - - lifted1 + lifted1 } -///| priv struct WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource::finish_read( - self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource::wait_for_read_cleanup( - self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource::cancel_active_read( - self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let completed = Ref(false) - @async-core.protect_from_cancel( - () => { - completed.val = @async-core.cancel_future_read( - self.read_task, - self.handle, - () => { - wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let completed = Ref(false) + @async-core.protect_from_cancel( + () => { + completed.val = @async-core.cancel_future_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - if completed.val && self.read_buffer != 0 { - wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Reject( - self.read_buffer, - 0, - 1, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + if completed.val && self.read_buffer != 0 { + wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Reject(self.read_buffer, 0, 1) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource::close( - self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1DropReadable(self.handle) } -///| fn WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource::close_sync( - self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1DropReadable(self.handle) } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource::read( - self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource, ) -> Result[Unit, ErrorCode] { - if self.closed { - raise @async-core.FutureReadError::Dropped - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - let ptr = wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Malloc( - 1, - ) - defer mbt_ffi_free(ptr) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - @async-core.suspend_for_future_read( - self.handle, - wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Read( + if self.closed { + raise @async-core.FutureReadError::Dropped + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + let ptr = wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Malloc(1) + defer { mbt_ffi_free(ptr) } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + @async-core.suspend_for_future_read( self.handle, - ptr, - ), - ) catch { - err => { + wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Read(self.handle, ptr), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped } + let value = wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Lift(ptr) self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - let value = wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1Lift( - ptr, - ) - self.finish_read() - if !self.closed { - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1DropReadable( - self.handle, - ) - } - value -} - -///| -fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureLift( - handle : Int, -) -> @async-core.Future[Result[Unit, ErrorCode]] { - let source = WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Future::from_source(() => source.read(), () => source.close(), () => { - source.close_sync() - }) + if !self.closed { + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1DropReadable(self.handle) + } + value +} + +fn wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureLift(handle : Int) -> @async-core.Future[Result[Unit, ErrorCode]] { + let source = WasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Future::from_source( + () => source.read(), + () => source.close(), + () => source.close_sync(), + ) } -///| -fn wasmImportMethodDescriptorWriteViaStream( - p0 : Int, - p1 : Int, - p2 : Int64, -) -> Int = "wasi:filesystem/types@0.3.0" "[method]descriptor.write-via-stream" - -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][stream-read-0][method]descriptor.write-via-stream" +fn wasmImportMethodDescriptorWriteViaStream(p0 : Int, p1 : Int, p2 : Int64) -> Int = "wasi:filesystem/types@0.3.0" "[method]descriptor.write-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0CancelRead( - handle : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[stream-cancel-read-0][method]descriptor.write-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][stream-read-0][method]descriptor.write-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0CancelRead(handle : Int) -> Int = "wasi:filesystem/types@0.3.0" "[stream-cancel-read-0][method]descriptor.write-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropReadable( - handle : Int, -) = "wasi:filesystem/types@0.3.0" "[stream-drop-readable-0][method]descriptor.write-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropReadable(handle : Int) = "wasi:filesystem/types@0.3.0" "[stream-drop-readable-0][method]descriptor.write-via-stream" -///| fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0New() -> UInt64 = "wasi:filesystem/types@0.3.0" "[stream-new-0][method]descriptor.write-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Write(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][stream-write-0][method]descriptor.write-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Write( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][stream-write-0][method]descriptor.write-via-stream" - -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0CancelWrite( - handle : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[stream-cancel-write-0][method]descriptor.write-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0CancelWrite(handle : Int) -> Int = "wasi:filesystem/types@0.3.0" "[stream-cancel-write-0][method]descriptor.write-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropWritable( - handle : Int, -) = "wasi:filesystem/types@0.3.0" "[stream-drop-writable-0][method]descriptor.write-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropWritable(handle : Int) = "wasi:filesystem/types@0.3.0" "[stream-drop-writable-0][method]descriptor.write-via-stream" -///| -fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Commit( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| -fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Lower( - value : Byte, - ptr : Int, -) -> Unit { - mbt_ffi_store8(ptr + 0, value.to_int()) +fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Lower(value : Byte, ptr : Int) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).to_int()) + } -///| fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource::finish_read( - self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource::wait_for_read_cleanup( - self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource::cancel_active_read( - self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource::close( - self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropReadable(self.handle) } -///| fn WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource::close_sync( - self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - if wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamRejectPrepared( - self.handle, - ) { - self.closed = true - return - } + if wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamRejectPrepared(self.handle) { + self.closed = true + return + } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropReadable(self.handle) } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource::read( - self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource, - count : Int, +self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) } + let values = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) + if end { + self.close() + } + Some(values) +} + +fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| priv struct WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducer { - stream : @async-core.Stream[Byte] - writer : Int + stream : @async-core.Stream[Byte] + writer : Int } -///| -let wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducers : Map[ - Int, - WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducer, -] = Map([]) +let wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducers : Map[Int, WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducer] = Map([]) -///| -fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamRejectPrepared( - handle : Int, -) -> Bool { - guard wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return false - } - wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducers.remove( - handle, - ) - let writer = prepared.writer - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropReadable( - handle, - ) - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropWritable( - writer, - ) - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( - () => { - prepared.stream.reject((value : Byte) => { - let ptr = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Malloc( - 1, - ) - wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Lower( - value, ptr, - ) - wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Reject( - ptr, 0, 1, - ) - mbt_ffi_free(ptr) - }) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - }) - true +fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamRejectPrepared(handle : Int) -> Bool { + guard wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducers.get(handle) is Some(prepared) else { + return false + } + wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducers.remove(handle) + let writer = prepared.writer + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropReadable(handle) + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropWritable(writer) + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + prepared.stream.reject((value : Byte) => { + let ptr = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Malloc(1) + wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Lower(value, ptr) + wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + }) + true } -///| -fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamCommit( - handle : Int, -) -> Unit { - guard wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return - } - wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducers.remove( - handle, - ) - let stream = prepared.stream - let writer = prepared.writer - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let producer = stream.take_producer() - @async-core.spawn_component_task_current(async fn() { - let writer_closed = Ref(false) - let writer_lock = @async-core.Mutex() - let close_writer = fn() -> Unit { - if !writer_closed.val { - writer_closed.val = true - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropWritable( - writer, - ) - } - } - let close_writer_serialized = async fn() -> Unit { - writer_lock.acquire() - defer writer_lock.release() - close_writer() - } - let cleanup_value = fn(value : Byte) -> Unit { - let ptr = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Malloc( - 1, - ) - wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Lower( - value, ptr, - ) - wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Reject( - ptr, 0, 1, - ) - mbt_ffi_free(ptr) - } - let sink = @async-core.Sink::from_callbacks( - (data : ArrayView[Byte]) => { - writer_lock.acquire() - defer writer_lock.release() - if writer_closed.val || data.length() == 0 { - return 0 - } - let data_len = if data.length() < 64 { data.length() } else { 64 } - let ptr = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Malloc( - data_len, - ) - for i in 0.. Unit { - wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Commit( - ptr, 0, transferred, - ) - if transferred < data_len { - wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Reject( - ptr, - transferred, - data_len - transferred, +fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamCommit(handle : Int) -> Unit { + guard wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducers.get(handle) is Some(prepared) else { + return + } + wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducers.remove(handle) + let stream = prepared.stream + let writer = prepared.writer + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let producer = stream.take_producer() + @async-core.spawn_component_task_current(async fn() { + let writer_closed = Ref(false) + let writer_lock = @async-core.Mutex() + let close_writer = fn() -> Unit { + if !writer_closed.val { + writer_closed.val = true + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0DropWritable(writer) + } + } + let close_writer_serialized = async fn() -> Unit { + writer_lock.acquire() + defer writer_lock.release() + close_writer() + } + let cleanup_value = fn(value : Byte) -> Unit { + let ptr = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Malloc(1) + wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Lower(value, ptr) + wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + } + let sink = @async-core.Sink::from_callbacks( + (data : ArrayView[Byte]) => { + writer_lock.acquire() + defer writer_lock.release() + if writer_closed.val || data.length() == 0 { + return 0 + } + let data_len = if data.length() < 64 { + data.length() + } else { + 64 + } + let ptr = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Malloc(data_len) + for i in 0.. Unit { + wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Commit(ptr, 0, transferred) + if transferred < data_len { + wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Reject( + ptr, + transferred, + data_len - transferred, + ) + } + mbt_ffi_free(ptr) + } + let mut total = 0 + let mut dropped = false + while total < data_len { + let (progress, end) = @async-core.suspend_for_stream_write( + writer, + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Write( + writer, + ptr + total * 1, + data_len - total, + ), + ) catch { + _ => { + total = total + @async-core.cancel_stream_write( + writer, + () => wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0CancelWrite(writer), + ) + settle_staging(total) + close_writer() + return data_len + } + } + total = total + progress + if end { + dropped = true + break + } + } + settle_staging(total) + if dropped { + close_writer() + } + // The canonical writer accepted `total`; generated cleanup + // consumed the rest of this staging window. + data_len + }, + () => close_writer_serialized(), + () => !writer_closed.val, + Some(cleanup_value), ) - } - mbt_ffi_free(ptr) - } - let mut total = 0 - let mut dropped = false - while total < data_len { - let (progress, end) = @async-core.suspend_for_stream_write( - writer, - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0Write( - writer, - ptr + total * 1, - data_len - total, - ), - ) catch { - _ => { - total = total + - @async-core.cancel_stream_write(writer, () => { - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0CancelWrite( - writer, - ) - }) - settle_staging(total) - close_writer() - return data_len + let relay_source = producer is None + let run_producer = async fn() -> Unit { + match producer { + Some(producer) => { + producer(sink) + sink.close() + } + None => + for ;; { + match stream.read(64) { + Some(data) => + if !sink.write_all(data[:]) { + stream.reject(cleanup_value) + return + } + None => { + sink.close() + return + } + } + } + } } - } - total = total + progress - if end { - dropped = true - break - } - } - settle_staging(total) - if dropped { - close_writer() - } - // The canonical writer accepted `total`; generated cleanup - // consumed the rest of this staging window. - data_len - }, - () => close_writer_serialized(), - () => !writer_closed.val, - Some(cleanup_value), - ) - let relay_source = producer is None - let run_producer = async fn() -> Unit { - match producer { - Some(producer) => { - producer(sink) - sink.close() - } - None => - for ;; { - match stream.read(64) { - Some(data) => - if !sink.write_all(data[:]) { - stream.reject(cleanup_value) - return - } - None => { - sink.close() - return - } + run_producer() catch { + _ => + if relay_source { + @async-core.protect_from_cancel( + () => stream.reject(cleanup_value), + resume_on_cancel=true, + ) catch { + _ => () + } + } } - } - } - } - run_producer() catch { - _ => - if relay_source { - @async-core.protect_from_cancel( - () => stream.reject(cleanup_value), + // A retained Sink may still own an in-flight canonical write after its + // producer returns. Do not drop the writable endpoint until that write + // has reached a terminal event and released its staging buffer. + @async-core.protect_from_cancel( + () => close_writer_serialized(), resume_on_cancel=true, - ) catch { - _ => () - } - } - } - // A retained Sink may still own an in-flight canonical write after its - // producer returns. Do not drop the writable endpoint until that write - // has reached a terminal event and released its staging buffer. - @async-core.protect_from_cancel( - () => close_writer_serialized(), - resume_on_cancel=true, - ) - }) + ) + }) } -///| -fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamLower( - stream : @async-core.Stream[Byte], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let pair = wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducers.set( - reader, - { stream, writer }, - ) - reader +fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamLower(stream : @async-core.Stream[Byte]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let pair = wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamProducers.set(reader, { stream, writer }) + reader } -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Read( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][future-read-1][method]descriptor.write-via-stream" - -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1CancelRead( - handle : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[future-cancel-read-1][method]descriptor.write-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Read(handle : Int, buffer_ptr : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][future-read-1][method]descriptor.write-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1CancelRead(handle : Int) -> Int = "wasi:filesystem/types@0.3.0" "[future-cancel-read-1][method]descriptor.write-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1DropReadable( - handle : Int, -) = "wasi:filesystem/types@0.3.0" "[future-drop-readable-1][method]descriptor.write-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1DropReadable(handle : Int) = "wasi:filesystem/types@0.3.0" "[future-drop-readable-1][method]descriptor.write-via-stream" -///| -fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(20 * length) - ptr +fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(20 * length) + ptr } -///| fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 20 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 12)) - _ => panic() + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 20 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() } - _ => panic() - } - _ => panic() - } - } + + } + } -///| -fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Lift( - ptr : Int, -) -> Result[Unit, ErrorCode] { - let lifted1 = match mbt_ffi_load8_u(ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 12), - mbt_ffi_load32(ptr + 16), - ) +fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Lift(ptr : Int) -> Result[Unit, ErrorCode] { - Option::Some(result) + let lifted1 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { + + Result::Ok(()) } - _ => panic() - } + 1 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + let lifted0 = match (mbt_ffi_load8_u((ptr) + 4)) { + 0 => { - Result::Err(lifted0) - } - _ => panic() - } + ErrorCode::Access + } + 1 => { - lifted1 -} + ErrorCode::Already + } + 2 => { -///| -priv struct WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar -} + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 12), mbt_ffi_load32((ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) + } + _ => panic() + } + + lifted1 +} + +priv struct WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource { + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar +} -///| fn WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource::finish_read( - self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource::wait_for_read_cleanup( - self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource::cancel_active_read( - self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let completed = Ref(false) - @async-core.protect_from_cancel( - () => { - completed.val = @async-core.cancel_future_read( - self.read_task, - self.handle, - () => { - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let completed = Ref(false) + @async-core.protect_from_cancel( + () => { + completed.val = @async-core.cancel_future_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - if completed.val && self.read_buffer != 0 { - wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Reject( - self.read_buffer, - 0, - 1, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + if completed.val && self.read_buffer != 0 { + wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Reject(self.read_buffer, 0, 1) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource::close( - self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1DropReadable(self.handle) } -///| fn WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource::close_sync( - self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1DropReadable(self.handle) } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource::read( - self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource, ) -> Result[Unit, ErrorCode] { - if self.closed { - raise @async-core.FutureReadError::Dropped - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - let ptr = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Malloc( - 1, - ) - defer mbt_ffi_free(ptr) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - @async-core.suspend_for_future_read( - self.handle, - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Read( + if self.closed { + raise @async-core.FutureReadError::Dropped + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + let ptr = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Malloc(1) + defer { mbt_ffi_free(ptr) } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + @async-core.suspend_for_future_read( self.handle, - ptr, - ), - ) catch { - err => { + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Read(self.handle, ptr), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped } + let value = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Lift(ptr) self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - let value = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1Lift( - ptr, - ) - self.finish_read() - if !self.closed { - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1DropReadable( - self.handle, - ) - } - value -} - -///| -fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureLift( - handle : Int, -) -> @async-core.Future[Result[Unit, ErrorCode]] { - let source = WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Future::from_source(() => source.read(), () => source.close(), () => { - source.close_sync() - }) + if !self.closed { + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1DropReadable(self.handle) + } + value +} + +fn wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureLift(handle : Int) -> @async-core.Future[Result[Unit, ErrorCode]] { + let source = WasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Future::from_source( + () => source.read(), + () => source.close(), + () => source.close_sync(), + ) } -///| fn wasmImportMethodDescriptorAppendViaStream(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[method]descriptor.append-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][stream-read-0][method]descriptor.append-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][stream-read-0][method]descriptor.append-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0CancelRead(handle : Int) -> Int = "wasi:filesystem/types@0.3.0" "[stream-cancel-read-0][method]descriptor.append-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0CancelRead( - handle : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[stream-cancel-read-0][method]descriptor.append-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropReadable(handle : Int) = "wasi:filesystem/types@0.3.0" "[stream-drop-readable-0][method]descriptor.append-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropReadable( - handle : Int, -) = "wasi:filesystem/types@0.3.0" "[stream-drop-readable-0][method]descriptor.append-via-stream" - -///| fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0New() -> UInt64 = "wasi:filesystem/types@0.3.0" "[stream-new-0][method]descriptor.append-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Write(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][stream-write-0][method]descriptor.append-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Write( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][stream-write-0][method]descriptor.append-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0CancelWrite(handle : Int) -> Int = "wasi:filesystem/types@0.3.0" "[stream-cancel-write-0][method]descriptor.append-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0CancelWrite( - handle : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[stream-cancel-write-0][method]descriptor.append-via-stream" - -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropWritable( - handle : Int, -) = "wasi:filesystem/types@0.3.0" "[stream-drop-writable-0][method]descriptor.append-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropWritable(handle : Int) = "wasi:filesystem/types@0.3.0" "[stream-drop-writable-0][method]descriptor.append-via-stream" -///| -fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Commit( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| -fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Lower( - value : Byte, - ptr : Int, -) -> Unit { - mbt_ffi_store8(ptr + 0, value.to_int()) +fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Lower(value : Byte, ptr : Int) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).to_int()) + } -///| fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource::finish_read( - self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource::wait_for_read_cleanup( - self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource::cancel_active_read( - self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource::close( - self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropReadable(self.handle) } -///| fn WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource::close_sync( - self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - if wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamRejectPrepared( - self.handle, - ) { - self.closed = true - return - } + if wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamRejectPrepared(self.handle) { + self.closed = true + return + } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropReadable(self.handle) } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource::read( - self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource, - count : Int, +self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) } + let values = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) + if end { + self.close() + } + Some(values) +} + +fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| priv struct WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducer { - stream : @async-core.Stream[Byte] - writer : Int + stream : @async-core.Stream[Byte] + writer : Int } -///| -let wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducers : Map[ - Int, - WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducer, -] = Map([]) +let wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducers : Map[Int, WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducer] = Map([]) -///| -fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamRejectPrepared( - handle : Int, -) -> Bool { - guard wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return false - } - wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducers.remove( - handle, - ) - let writer = prepared.writer - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropReadable( - handle, - ) - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropWritable( - writer, - ) - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( - () => { - prepared.stream.reject((value : Byte) => { - let ptr = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Malloc( - 1, - ) - wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Lower( - value, ptr, - ) - wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Reject( - ptr, 0, 1, - ) - mbt_ffi_free(ptr) - }) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - }) - true +fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamRejectPrepared(handle : Int) -> Bool { + guard wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducers.get(handle) is Some(prepared) else { + return false + } + wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducers.remove(handle) + let writer = prepared.writer + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropReadable(handle) + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropWritable(writer) + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + prepared.stream.reject((value : Byte) => { + let ptr = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Malloc(1) + wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Lower(value, ptr) + wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + }) + true } -///| -fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamCommit( - handle : Int, -) -> Unit { - guard wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return - } - wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducers.remove( - handle, - ) - let stream = prepared.stream - let writer = prepared.writer - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let producer = stream.take_producer() - @async-core.spawn_component_task_current(async fn() { - let writer_closed = Ref(false) - let writer_lock = @async-core.Mutex() - let close_writer = fn() -> Unit { - if !writer_closed.val { - writer_closed.val = true - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropWritable( - writer, - ) - } - } - let close_writer_serialized = async fn() -> Unit { - writer_lock.acquire() - defer writer_lock.release() - close_writer() - } - let cleanup_value = fn(value : Byte) -> Unit { - let ptr = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Malloc( - 1, - ) - wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Lower( - value, ptr, - ) - wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Reject( - ptr, 0, 1, - ) - mbt_ffi_free(ptr) - } - let sink = @async-core.Sink::from_callbacks( - (data : ArrayView[Byte]) => { - writer_lock.acquire() - defer writer_lock.release() - if writer_closed.val || data.length() == 0 { - return 0 - } - let data_len = if data.length() < 64 { data.length() } else { 64 } - let ptr = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Malloc( - data_len, - ) - for i in 0.. Unit { - wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Commit( - ptr, 0, transferred, - ) - if transferred < data_len { - wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Reject( - ptr, - transferred, - data_len - transferred, +fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamCommit(handle : Int) -> Unit { + guard wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducers.get(handle) is Some(prepared) else { + return + } + wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducers.remove(handle) + let stream = prepared.stream + let writer = prepared.writer + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let producer = stream.take_producer() + @async-core.spawn_component_task_current(async fn() { + let writer_closed = Ref(false) + let writer_lock = @async-core.Mutex() + let close_writer = fn() -> Unit { + if !writer_closed.val { + writer_closed.val = true + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0DropWritable(writer) + } + } + let close_writer_serialized = async fn() -> Unit { + writer_lock.acquire() + defer writer_lock.release() + close_writer() + } + let cleanup_value = fn(value : Byte) -> Unit { + let ptr = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Malloc(1) + wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Lower(value, ptr) + wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + } + let sink = @async-core.Sink::from_callbacks( + (data : ArrayView[Byte]) => { + writer_lock.acquire() + defer writer_lock.release() + if writer_closed.val || data.length() == 0 { + return 0 + } + let data_len = if data.length() < 64 { + data.length() + } else { + 64 + } + let ptr = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Malloc(data_len) + for i in 0.. Unit { + wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Commit(ptr, 0, transferred) + if transferred < data_len { + wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Reject( + ptr, + transferred, + data_len - transferred, + ) + } + mbt_ffi_free(ptr) + } + let mut total = 0 + let mut dropped = false + while total < data_len { + let (progress, end) = @async-core.suspend_for_stream_write( + writer, + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Write( + writer, + ptr + total * 1, + data_len - total, + ), + ) catch { + _ => { + total = total + @async-core.cancel_stream_write( + writer, + () => wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0CancelWrite(writer), + ) + settle_staging(total) + close_writer() + return data_len + } + } + total = total + progress + if end { + dropped = true + break + } + } + settle_staging(total) + if dropped { + close_writer() + } + // The canonical writer accepted `total`; generated cleanup + // consumed the rest of this staging window. + data_len + }, + () => close_writer_serialized(), + () => !writer_closed.val, + Some(cleanup_value), ) - } - mbt_ffi_free(ptr) - } - let mut total = 0 - let mut dropped = false - while total < data_len { - let (progress, end) = @async-core.suspend_for_stream_write( - writer, - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0Write( - writer, - ptr + total * 1, - data_len - total, - ), - ) catch { - _ => { - total = total + - @async-core.cancel_stream_write(writer, () => { - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0CancelWrite( - writer, - ) - }) - settle_staging(total) - close_writer() - return data_len + let relay_source = producer is None + let run_producer = async fn() -> Unit { + match producer { + Some(producer) => { + producer(sink) + sink.close() + } + None => + for ;; { + match stream.read(64) { + Some(data) => + if !sink.write_all(data[:]) { + stream.reject(cleanup_value) + return + } + None => { + sink.close() + return + } + } + } + } } - } - total = total + progress - if end { - dropped = true - break - } - } - settle_staging(total) - if dropped { - close_writer() - } - // The canonical writer accepted `total`; generated cleanup - // consumed the rest of this staging window. - data_len - }, - () => close_writer_serialized(), - () => !writer_closed.val, - Some(cleanup_value), - ) - let relay_source = producer is None - let run_producer = async fn() -> Unit { - match producer { - Some(producer) => { - producer(sink) - sink.close() - } - None => - for ;; { - match stream.read(64) { - Some(data) => - if !sink.write_all(data[:]) { - stream.reject(cleanup_value) - return - } - None => { - sink.close() - return - } + run_producer() catch { + _ => + if relay_source { + @async-core.protect_from_cancel( + () => stream.reject(cleanup_value), + resume_on_cancel=true, + ) catch { + _ => () + } + } } - } - } - } - run_producer() catch { - _ => - if relay_source { - @async-core.protect_from_cancel( - () => stream.reject(cleanup_value), + // A retained Sink may still own an in-flight canonical write after its + // producer returns. Do not drop the writable endpoint until that write + // has reached a terminal event and released its staging buffer. + @async-core.protect_from_cancel( + () => close_writer_serialized(), resume_on_cancel=true, - ) catch { - _ => () - } - } - } - // A retained Sink may still own an in-flight canonical write after its - // producer returns. Do not drop the writable endpoint until that write - // has reached a terminal event and released its staging buffer. - @async-core.protect_from_cancel( - () => close_writer_serialized(), - resume_on_cancel=true, - ) - }) + ) + }) } -///| -fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamLower( - stream : @async-core.Stream[Byte], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let pair = wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducers.set( - reader, - { stream, writer }, - ) - reader +fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamLower(stream : @async-core.Stream[Byte]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let pair = wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamProducers.set(reader, { stream, writer }) + reader } -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Read( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][future-read-1][method]descriptor.append-via-stream" - -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1CancelRead( - handle : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[future-cancel-read-1][method]descriptor.append-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Read(handle : Int, buffer_ptr : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][future-read-1][method]descriptor.append-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1CancelRead(handle : Int) -> Int = "wasi:filesystem/types@0.3.0" "[future-cancel-read-1][method]descriptor.append-via-stream" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1DropReadable( - handle : Int, -) = "wasi:filesystem/types@0.3.0" "[future-drop-readable-1][method]descriptor.append-via-stream" +fn wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1DropReadable(handle : Int) = "wasi:filesystem/types@0.3.0" "[future-drop-readable-1][method]descriptor.append-via-stream" -///| -fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(20 * length) - ptr +fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(20 * length) + ptr } -///| fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 20 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 12)) - _ => panic() + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 20 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() } - _ => panic() - } - _ => panic() - } - } + + } + } -///| -fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Lift( - ptr : Int, -) -> Result[Unit, ErrorCode] { - let lifted1 = match mbt_ffi_load8_u(ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(ptr + 8) { - 0 => Option::None +fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Lift(ptr : Int) -> Result[Unit, ErrorCode] { + + let lifted1 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { + + Result::Ok(()) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 12), - mbt_ffi_load32(ptr + 16), - ) - Option::Some(result) + let lifted0 = match (mbt_ffi_load8_u((ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 12), mbt_ffi_load32((ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) } _ => panic() - } - - ErrorCode::Other(lifted) - } - _ => panic() } - Result::Err(lifted0) - } - _ => panic() - } - - lifted1 + lifted1 } -///| priv struct WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource::finish_read( - self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource::wait_for_read_cleanup( - self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource::cancel_active_read( - self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let completed = Ref(false) - @async-core.protect_from_cancel( - () => { - completed.val = @async-core.cancel_future_read( - self.read_task, - self.handle, - () => { - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let completed = Ref(false) + @async-core.protect_from_cancel( + () => { + completed.val = @async-core.cancel_future_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - if completed.val && self.read_buffer != 0 { - wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Reject( - self.read_buffer, - 0, - 1, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + if completed.val && self.read_buffer != 0 { + wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Reject(self.read_buffer, 0, 1) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource::close( - self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1DropReadable(self.handle) } -///| fn WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource::close_sync( - self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1DropReadable(self.handle) } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource::read( - self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource, ) -> Result[Unit, ErrorCode] { - if self.closed { - raise @async-core.FutureReadError::Dropped - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - let ptr = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Malloc( - 1, - ) - defer mbt_ffi_free(ptr) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - @async-core.suspend_for_future_read( - self.handle, - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Read( + if self.closed { + raise @async-core.FutureReadError::Dropped + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + let ptr = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Malloc(1) + defer { mbt_ffi_free(ptr) } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + @async-core.suspend_for_future_read( self.handle, - ptr, - ), - ) catch { - err => { + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Read(self.handle, ptr), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped } + let value = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Lift(ptr) self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - let value = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1Lift( - ptr, - ) - self.finish_read() - if !self.closed { - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1DropReadable( - self.handle, - ) - } - value -} - -///| -fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureLift( - handle : Int, -) -> @async-core.Future[Result[Unit, ErrorCode]] { - let source = WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Future::from_source(() => source.read(), () => source.close(), () => { - source.close_sync() - }) + if !self.closed { + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1DropReadable(self.handle) + } + value +} + +fn wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureLift(handle : Int) -> @async-core.Future[Result[Unit, ErrorCode]] { + let source = WasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Future::from_source( + () => source.read(), + () => source.close(), + () => source.close_sync(), + ) } -///| -fn wasmImportMethodDescriptorAdvise( - p0 : Int, - p1 : Int64, - p2 : Int64, - p3 : Int, - p4 : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.advise" +fn wasmImportMethodDescriptorAdvise(p0 : Int, p1 : Int64, p2 : Int64, p3 : Int, p4 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.advise" -///| fn wasmImportMethodDescriptorSyncData(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.sync-data" -///| fn wasmImportMethodDescriptorGetFlags(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.get-flags" -///| fn wasmImportMethodDescriptorGetType(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.get-type" -///| fn wasmImportMethodDescriptorSetSize(p0 : Int, p1 : Int64, p2 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.set-size" -///| fn wasmImportMethodDescriptorSetTimes(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.set-times" -///| -fn wasmImportMethodDescriptorReadDirectory(p0 : Int, p1 : Int) = "wasi:filesystem/types@0.3.0" "[method]descriptor.read-directory" +fn wasmImportMethodDescriptorReadDirectory(p0 : Int, p1 : Int) = "wasi:filesystem/types@0.3.0" "[method]descriptor.read-directory" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][stream-read-0][method]descriptor.read-directory" - -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0CancelRead( - handle : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[stream-cancel-read-0][method]descriptor.read-directory" +fn wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][stream-read-0][method]descriptor.read-directory" +fn wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0CancelRead(handle : Int) -> Int = "wasi:filesystem/types@0.3.0" "[stream-cancel-read-0][method]descriptor.read-directory" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0DropReadable( - handle : Int, -) = "wasi:filesystem/types@0.3.0" "[stream-drop-readable-0][method]descriptor.read-directory" +fn wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0DropReadable(handle : Int) = "wasi:filesystem/types@0.3.0" "[stream-drop-readable-0][method]descriptor.read-directory" -///| -fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(24 * length) - ptr +fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(24 * length) + ptr } -///| fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 24 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => - match mbt_ffi_load8_u(elem_ptr + 4) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 8)) - _ => panic() - } - _ => panic() - } - mbt_ffi_free(mbt_ffi_load32(elem_ptr + 16)) - } + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 24 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => { + + match (mbt_ffi_load8_u((elem_ptr) + 4)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 8)) + + } + _ => panic() + } + + } + _ => panic() + } + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 16)) + + } + } -///| -fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Lift( - ptr : Int, -) -> DirectoryEntry { - let lifted0 = match mbt_ffi_load8_u(ptr + 0) { - 0 => DescriptorType::BlockDevice - 1 => DescriptorType::CharacterDevice - 2 => DescriptorType::Directory - 3 => DescriptorType::Fifo - 4 => DescriptorType::SymbolicLink - 5 => DescriptorType::RegularFile - 6 => DescriptorType::Socket - 7 => { - let lifted : String? = match mbt_ffi_load8_u(ptr + 4) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 8), - mbt_ffi_load32(ptr + 12), - ) - - Option::Some(result) - } - _ => panic() - } - - DescriptorType::Other(lifted) - } - _ => panic() - } - - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 16), - mbt_ffi_load32(ptr + 20), - ) - - DirectoryEntry::{ type_: lifted0, name: result1 } +fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Lift(ptr : Int) -> DirectoryEntry { + + let lifted0 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { + + DescriptorType::BlockDevice + } + 1 => { + + DescriptorType::CharacterDevice + } + 2 => { + + DescriptorType::Directory + } + 3 => { + + DescriptorType::Fifo + } + 4 => { + + DescriptorType::SymbolicLink + } + 5 => { + + DescriptorType::RegularFile + } + 6 => { + + DescriptorType::Socket + } + 7 => { + + let lifted : String? = match mbt_ffi_load8_u((ptr) + 4) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 8), mbt_ffi_load32((ptr) + 12)) + + Option::Some(result) + } + _ => panic() + } + + DescriptorType::Other(lifted) + } + _ => panic() + } + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 16), mbt_ffi_load32((ptr) + 20)) + + DirectoryEntry::{type_ : lifted0, name : result1} } -///| fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[DirectoryEntry] { - FixedArray::makei(length, index => { - let ptr = ptr + index * 24 - wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Lift(ptr) - }) + + FixedArray::makei( + length, + (index) => { + let ptr = (ptr) + (index * 24) + wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Lift(ptr) + } + ) + } -///| priv struct WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource::finish_read( - self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource::wait_for_read_cleanup( - self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource::cancel_active_read( - self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource::close( - self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0DropReadable(self.handle) } -///| fn WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource::close_sync( - self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0DropReadable(self.handle) } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource::read( - self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource, - count : Int, +self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource, +count : Int, ) -> FixedArray[DirectoryEntry]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) + } + let values = wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0ListLift(ptr, progress) + owns_buffer = false self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0ListLift( - ptr, progress, - ) - owns_buffer = false - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamLift( - handle : Int, -) -> @async-core.Stream[DirectoryEntry] { - let source = WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) + if end { + self.close() + } + Some(values) +} + +fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamLift(handle : Int) -> @async-core.Stream[DirectoryEntry] { + let source = WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Read( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][future-read-1][method]descriptor.read-directory" +fn wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Read(handle : Int, buffer_ptr : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][future-read-1][method]descriptor.read-directory" +fn wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1CancelRead(handle : Int) -> Int = "wasi:filesystem/types@0.3.0" "[future-cancel-read-1][method]descriptor.read-directory" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1CancelRead( - handle : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[future-cancel-read-1][method]descriptor.read-directory" +fn wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1DropReadable(handle : Int) = "wasi:filesystem/types@0.3.0" "[future-drop-readable-1][method]descriptor.read-directory" -///| -fn wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1DropReadable( - handle : Int, -) = "wasi:filesystem/types@0.3.0" "[future-drop-readable-1][method]descriptor.read-directory" - -///| -fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(20 * length) - ptr +fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(20 * length) + ptr } -///| fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 20 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 12)) - _ => panic() + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 20 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() } - _ => panic() - } - _ => panic() - } - } + + } + } -///| -fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Lift( - ptr : Int, -) -> Result[Unit, ErrorCode] { - let lifted1 = match mbt_ffi_load8_u(ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(ptr + 8) { - 0 => Option::None +fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Lift(ptr : Int) -> Result[Unit, ErrorCode] { + + let lifted1 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { + + Result::Ok(()) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 12), - mbt_ffi_load32(ptr + 16), - ) - Option::Some(result) + let lifted0 = match (mbt_ffi_load8_u((ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 12), mbt_ffi_load32((ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) } _ => panic() - } - - ErrorCode::Other(lifted) - } - _ => panic() } - Result::Err(lifted0) - } - _ => panic() - } - - lifted1 + lifted1 } -///| priv struct WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource::finish_read( - self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource::wait_for_read_cleanup( - self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource::cancel_active_read( - self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let completed = Ref(false) - @async-core.protect_from_cancel( - () => { - completed.val = @async-core.cancel_future_read( - self.read_task, - self.handle, - () => { - wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let completed = Ref(false) + @async-core.protect_from_cancel( + () => { + completed.val = @async-core.cancel_future_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - if completed.val && self.read_buffer != 0 { - wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Reject( - self.read_buffer, - 0, - 1, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + if completed.val && self.read_buffer != 0 { + wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Reject(self.read_buffer, 0, 1) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource::close( - self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1DropReadable(self.handle) } -///| fn WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource::close_sync( - self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1DropReadable(self.handle) } -///| async fn WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource::read( - self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource, +self : WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource, ) -> Result[Unit, ErrorCode] { - if self.closed { - raise @async-core.FutureReadError::Dropped - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - let ptr = wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Malloc( - 1, - ) - defer mbt_ffi_free(ptr) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - @async-core.suspend_for_future_read( - self.handle, - wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Read( + if self.closed { + raise @async-core.FutureReadError::Dropped + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + let ptr = wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Malloc(1) + defer { mbt_ffi_free(ptr) } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + @async-core.suspend_for_future_read( self.handle, - ptr, - ), - ) catch { - err => { + wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Read(self.handle, ptr), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped } + let value = wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Lift(ptr) self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - let value = wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1Lift( - ptr, - ) - self.finish_read() - if !self.closed { - self.closed = true - wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1DropReadable( - self.handle, - ) - } - value -} - -///| -fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureLift( - handle : Int, -) -> @async-core.Future[Result[Unit, ErrorCode]] { - let source = WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Future::from_source(() => source.read(), () => source.close(), () => { - source.close_sync() - }) + if !self.closed { + self.closed = true + wasmImportWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1DropReadable(self.handle) + } + value +} + +fn wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureLift(handle : Int) -> @async-core.Future[Result[Unit, ErrorCode]] { + let source = WasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Future::from_source( + () => source.read(), + () => source.close(), + () => source.close_sync(), + ) } -///| fn wasmImportMethodDescriptorSync(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.sync" -///| -fn wasmImportMethodDescriptorCreateDirectoryAt( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.create-directory-at" +fn wasmImportMethodDescriptorCreateDirectoryAt(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.create-directory-at" -///| fn wasmImportMethodDescriptorStat(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.stat" -///| -fn wasmImportMethodDescriptorStatAt( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.stat-at" +fn wasmImportMethodDescriptorStatAt(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.stat-at" -///| fn wasmImportMethodDescriptorSetTimesAt(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.set-times-at" -///| fn wasmImportMethodDescriptorLinkAt(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.link-at" -///| fn wasmImportMethodDescriptorOpenAt(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.open-at" -///| -fn wasmImportMethodDescriptorReadlinkAt( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.readlink-at" +fn wasmImportMethodDescriptorReadlinkAt(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.readlink-at" -///| -fn wasmImportMethodDescriptorRemoveDirectoryAt( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.remove-directory-at" +fn wasmImportMethodDescriptorRemoveDirectoryAt(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.remove-directory-at" -///| fn wasmImportMethodDescriptorRenameAt(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.rename-at" -///| fn wasmImportMethodDescriptorSymlinkAt(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.symlink-at" -///| -fn wasmImportMethodDescriptorUnlinkFileAt( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.unlink-file-at" +fn wasmImportMethodDescriptorUnlinkFileAt(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.unlink-file-at" -///| fn wasmImportMethodDescriptorIsSameObject(p0 : Int, p1 : Int, p2 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.is-same-object" -///| fn wasmImportMethodDescriptorMetadataHash(p0 : Int, p1 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.metadata-hash" -///| -fn wasmImportMethodDescriptorMetadataHashAt( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, -) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.metadata-hash-at" +fn wasmImportMethodDescriptorMetadataHashAt(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) -> Int = "wasi:filesystem/types@0.3.0" "[async-lower][method]descriptor.metadata-hash-at" ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/filesystem/types/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/filesystem/types/top.mbt index 570e3b843d..59766077da 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/filesystem/types/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/filesystem/types/top.mbt @@ -1,294 +1,214 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// The type of a filesystem object referenced by a descriptor. /// /// Note: This was called `filetype` in earlier versions of WASI. pub(all) enum DescriptorType { - BlockDevice - CharacterDevice - Directory - Fifo - SymbolicLink - RegularFile - Socket - Other(String?) + BlockDevice + CharacterDevice + Directory + Fifo + SymbolicLink + RegularFile + Socket + Other(String?) } derive(Show, Eq) - ///| /// Descriptor flags. /// /// Note: This was called `fdflags` in earlier versions of WASI. pub(all) struct DescriptorFlags(Byte) derive(Show, Eq) - -///| pub fn DescriptorFlags::default() -> DescriptorFlags { - b'\x00' + b'\x00' } - -///| pub(all) enum DescriptorFlagsFlag { - READ - WRITE - FILE_INTEGRITY_SYNC - DATA_INTEGRITY_SYNC - REQUESTED_WRITE_SYNC - MUTATE_DIRECTORY + READ; WRITE; FILE_INTEGRITY_SYNC; DATA_INTEGRITY_SYNC; REQUESTED_WRITE_SYNC; MUTATE_DIRECTORY } - -///| fn DescriptorFlagsFlag::value(self : DescriptorFlagsFlag) -> Byte { - match self { - READ => (1U << 0).to_byte() - WRITE => (1U << 1).to_byte() - FILE_INTEGRITY_SYNC => (1U << 2).to_byte() - DATA_INTEGRITY_SYNC => (1U << 3).to_byte() - REQUESTED_WRITE_SYNC => (1U << 4).to_byte() - MUTATE_DIRECTORY => (1U << 5).to_byte() - } + match self { + READ => ((1U << 0).to_byte()) + WRITE => ((1U << 1).to_byte()) + FILE_INTEGRITY_SYNC => ((1U << 2).to_byte()) + DATA_INTEGRITY_SYNC => ((1U << 3).to_byte()) + REQUESTED_WRITE_SYNC => ((1U << 4).to_byte()) + MUTATE_DIRECTORY => ((1U << 5).to_byte()) + } } - -///| -pub fn DescriptorFlags::set( - self : Self, - other : DescriptorFlagsFlag, -) -> DescriptorFlags { - let DescriptorFlags(flag) = self - flag.lor(other.value()) +pub fn DescriptorFlags::set(self : Self, other: DescriptorFlagsFlag) -> DescriptorFlags { + let DescriptorFlags(flag) = self + flag.lor(other.value()) } - -///| -pub fn DescriptorFlags::unset( - self : Self, - other : DescriptorFlagsFlag, -) -> DescriptorFlags { - let DescriptorFlags(flag) = self - flag.land(other.value().lnot()) +pub fn DescriptorFlags::unset(self : Self, other: DescriptorFlagsFlag) -> DescriptorFlags { + let DescriptorFlags(flag) = self + flag.land(other.value().lnot()) } - -///| -pub fn DescriptorFlags::is_set( - self : Self, - other : DescriptorFlagsFlag, -) -> Bool { - let DescriptorFlags(flag) = self - flag.land(other.value()) == other.value() +pub fn DescriptorFlags::is_set(self : Self, other: DescriptorFlagsFlag) -> Bool { + let DescriptorFlags(flag) = self + (flag.land(other.value()) == other.value()) } - ///| /// Flags determining the method of how paths are resolved. pub(all) struct PathFlags(Byte) derive(Show, Eq) - -///| pub fn PathFlags::default() -> PathFlags { - b'\x00' + b'\x00' } - -///| pub(all) enum PathFlagsFlag { - SYMLINK_FOLLOW + SYMLINK_FOLLOW } - -///| fn PathFlagsFlag::value(self : PathFlagsFlag) -> Byte { - match self { - SYMLINK_FOLLOW => (1U << 0).to_byte() - } + match self { + SYMLINK_FOLLOW => ((1U << 0).to_byte()) + } } - -///| -pub fn PathFlags::set(self : Self, other : PathFlagsFlag) -> PathFlags { - let PathFlags(flag) = self - flag.lor(other.value()) +pub fn PathFlags::set(self : Self, other: PathFlagsFlag) -> PathFlags { + let PathFlags(flag) = self + flag.lor(other.value()) } - -///| -pub fn PathFlags::unset(self : Self, other : PathFlagsFlag) -> PathFlags { - let PathFlags(flag) = self - flag.land(other.value().lnot()) +pub fn PathFlags::unset(self : Self, other: PathFlagsFlag) -> PathFlags { + let PathFlags(flag) = self + flag.land(other.value().lnot()) } - -///| -pub fn PathFlags::is_set(self : Self, other : PathFlagsFlag) -> Bool { - let PathFlags(flag) = self - flag.land(other.value()) == other.value() +pub fn PathFlags::is_set(self : Self, other: PathFlagsFlag) -> Bool { + let PathFlags(flag) = self + (flag.land(other.value()) == other.value()) } - ///| /// Open flags used by `open-at`. pub(all) struct OpenFlags(Byte) derive(Show, Eq) - -///| pub fn OpenFlags::default() -> OpenFlags { - b'\x00' + b'\x00' } - -///| pub(all) enum OpenFlagsFlag { - CREATE - DIRECTORY - EXCLUSIVE - TRUNCATE + CREATE; DIRECTORY; EXCLUSIVE; TRUNCATE } - -///| fn OpenFlagsFlag::value(self : OpenFlagsFlag) -> Byte { - match self { - CREATE => (1U << 0).to_byte() - DIRECTORY => (1U << 1).to_byte() - EXCLUSIVE => (1U << 2).to_byte() - TRUNCATE => (1U << 3).to_byte() - } + match self { + CREATE => ((1U << 0).to_byte()) + DIRECTORY => ((1U << 1).to_byte()) + EXCLUSIVE => ((1U << 2).to_byte()) + TRUNCATE => ((1U << 3).to_byte()) + } } - -///| -pub fn OpenFlags::set(self : Self, other : OpenFlagsFlag) -> OpenFlags { - let OpenFlags(flag) = self - flag.lor(other.value()) +pub fn OpenFlags::set(self : Self, other: OpenFlagsFlag) -> OpenFlags { + let OpenFlags(flag) = self + flag.lor(other.value()) } - -///| -pub fn OpenFlags::unset(self : Self, other : OpenFlagsFlag) -> OpenFlags { - let OpenFlags(flag) = self - flag.land(other.value().lnot()) +pub fn OpenFlags::unset(self : Self, other: OpenFlagsFlag) -> OpenFlags { + let OpenFlags(flag) = self + flag.land(other.value().lnot()) } - -///| -pub fn OpenFlags::is_set(self : Self, other : OpenFlagsFlag) -> Bool { - let OpenFlags(flag) = self - flag.land(other.value()) == other.value() +pub fn OpenFlags::is_set(self : Self, other: OpenFlagsFlag) -> Bool { + let OpenFlags(flag) = self + (flag.land(other.value()) == other.value()) } - ///| /// File attributes. /// /// Note: This was called `filestat` in earlier versions of WASI. pub(all) struct DescriptorStat { - type_ : DescriptorType - link_count : UInt64 - size : UInt64 - data_access_timestamp : @system-clock.Instant? - data_modification_timestamp : @system-clock.Instant? - status_change_timestamp : @system-clock.Instant? + type_ : DescriptorType; link_count : UInt64; size : UInt64; data_access_timestamp : @system-clock.Instant?; data_modification_timestamp : @system-clock.Instant?; status_change_timestamp : @system-clock.Instant? } derive(Show, Eq) - ///| /// When setting a timestamp, this gives the value to set it to. pub(all) enum NewTimestamp { - NoChange - Now - Timestamp(@system-clock.Instant) + NoChange + Now + Timestamp(@system-clock.Instant) } derive(Show, Eq) - ///| /// A directory entry. pub(all) struct DirectoryEntry { - type_ : DescriptorType - name : String + type_ : DescriptorType; name : String } derive(Show, Eq) - ///| /// Error codes returned by functions, similar to `errno` in POSIX. /// Not all of these error codes are returned by the functions provided by this /// API; some are used in higher-level library layers, and others are provided /// merely for alignment with POSIX. pub(all) suberror ErrorCode { - Access - Already - BadDescriptor - Busy - Deadlock - Quota - Exist - FileTooLarge - IllegalByteSequence - InProgress - Interrupted - Invalid - Io - IsDirectory - Loop - TooManyLinks - MessageSize - NameTooLong - NoDevice - NoEntry - NoLock - InsufficientMemory - InsufficientSpace - NotDirectory - NotEmpty - NotRecoverable - Unsupported - NoTty - NoSuchDevice - Overflow - NotPermitted - Pipe - ReadOnly - InvalidSeek - TextFileBusy - CrossDevice - Other(String?) + Access + Already + BadDescriptor + Busy + Deadlock + Quota + Exist + FileTooLarge + IllegalByteSequence + InProgress + Interrupted + Invalid + Io + IsDirectory + Loop + TooManyLinks + MessageSize + NameTooLong + NoDevice + NoEntry + NoLock + InsufficientMemory + InsufficientSpace + NotDirectory + NotEmpty + NotRecoverable + Unsupported + NoTty + NoSuchDevice + Overflow + NotPermitted + Pipe + ReadOnly + InvalidSeek + TextFileBusy + CrossDevice + Other(String?) } derive(Show, Eq) - ///| /// File or memory access pattern advisory information. pub(all) enum Advice { - NORMAL - SEQUENTIAL - RANDOM - WILL_NEED - DONT_NEED - NO_REUSE + NORMAL; SEQUENTIAL; RANDOM; WILL_NEED; DONT_NEED; NO_REUSE } derive(Show, Eq) -///| pub fn Advice::ordinal(self : Advice) -> Int { - match self { - NORMAL => 0 - SEQUENTIAL => 1 - RANDOM => 2 - WILL_NEED => 3 - DONT_NEED => 4 - NO_REUSE => 5 - } + match self { + NORMAL => 0 + SEQUENTIAL => 1 + RANDOM => 2 + WILL_NEED => 3 + DONT_NEED => 4 + NO_REUSE => 5 + } } -///| pub fn Advice::from(self : Int) -> Advice { - match self { - 0 => NORMAL - 1 => SEQUENTIAL - 2 => RANDOM - 3 => WILL_NEED - 4 => DONT_NEED - 5 => NO_REUSE - _ => panic() - } + match self { + 0 => NORMAL + 1 => SEQUENTIAL + 2 => RANDOM + 3 => WILL_NEED + 4 => DONT_NEED + 5 => NO_REUSE + _ => panic() + } } - ///| /// A 128-bit hash value, split into parts because wasm doesn't have a /// 128-bit integer type. pub(all) struct MetadataHashValue { - lower : UInt64 - upper : UInt64 + lower : UInt64; upper : UInt64 } derive(Show, Eq) - ///| /// A descriptor is a reference to a filesystem object, which may be a file, /// directory, named pipe, special file, or other object on which filesystem /// calls may be made. pub(all) struct Descriptor(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Descriptor::drop(self : Descriptor) -> Unit { - let Descriptor(resource) = self - wasmImportResourceDropDescriptor(resource) + let Descriptor(resource) = self + wasmImportResourceDropDescriptor(resource) } - ///| /// Return a stream for reading from a file. /// @@ -306,27 +226,21 @@ pub fn Descriptor::drop(self : Descriptor) -> Unit { /// resolves to `err` with an `error-code`. /// /// Note: This is similar to `pread` in POSIX. -pub fn Descriptor::read_via_stream( - self : Descriptor, - offset : UInt64, -) -> (@async-core.Stream[Byte], @async-core.Future[Result[Unit, ErrorCode]]) { - let Descriptor(handle) = self - let return_area = mbt_ffi_malloc(8) - let lower_arg = handle - let lower_arg0 = offset.reinterpret_as_int64() - let lower_arg1 = return_area - wasmImportMethodDescriptorReadViaStream(lower_arg, lower_arg0, lower_arg1) - let result = wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamLift( - mbt_ffi_load32(return_area + 0), - ) - let result2 = wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureLift( - mbt_ffi_load32(return_area + 4), - ) - let ret = (result, result2) - mbt_ffi_free(return_area) - return ret -} +pub fn Descriptor::read_via_stream(self : Descriptor, offset : UInt64) -> (@async-core.Stream[Byte], @async-core.Future[Result[Unit, ErrorCode]]) { + + let Descriptor(handle) = self + let return_area = mbt_ffi_malloc(8) + let lower_arg = handle + let lower_arg0 = (offset).reinterpret_as_int64() + let lower_arg1 = return_area + wasmImportMethodDescriptorReadViaStream(lower_arg, lower_arg0, lower_arg1); + let result = wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamStream0StreamLift(mbt_ffi_load32((return_area) + 0)) + let result2 = wasmWasiFilesystemTypes030MethodDescriptorReadViaStreamFuture1FutureLift(mbt_ffi_load32((return_area) + 4)) + let ret = (result, result2) + mbt_ffi_free(return_area) + return ret +} ///| /// Return a stream for writing to a file, if available. /// @@ -340,30 +254,19 @@ pub fn Descriptor::read_via_stream( /// written or an error is encountered. /// /// Note: This is similar to `pwrite` in POSIX. -pub fn Descriptor::write_via_stream( - self : Descriptor, - data : @async-core.Stream[Byte], - offset : UInt64, -) -> @async-core.Future[Result[Unit, ErrorCode]] { - let Descriptor(handle) = self - let lower_arg = handle - let lower_arg0 = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamLower( - data, - ) - let lower_arg1 = offset.reinterpret_as_int64() - let result : Int = wasmImportMethodDescriptorWriteViaStream( - lower_arg, lower_arg0, lower_arg1, - ) - wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamCommit( - lower_arg0, - ) - let result3 = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureLift( - result, - ) - let ret = result3 - return ret -} +pub fn Descriptor::write_via_stream(self : Descriptor, data : @async-core.Stream[Byte], offset : UInt64) -> @async-core.Future[Result[Unit, ErrorCode]] { + + let Descriptor(handle) = self + let lower_arg = handle + let lower_arg0 = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamLower(data) + let lower_arg1 = (offset).reinterpret_as_int64() + let result : Int = wasmImportMethodDescriptorWriteViaStream(lower_arg, lower_arg0, lower_arg1); + wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamStream0StreamCommit(lower_arg0) + let result3 = wasmWasiFilesystemTypes030MethodDescriptorWriteViaStreamFuture1FutureLift(result) + let ret = result3 + return ret +} ///| /// Return a stream for appending to a file, if available. /// @@ -373,3130 +276,5397 @@ pub fn Descriptor::write_via_stream( /// written or an error is encountered. /// /// Note: This is similar to `write` with `O_APPEND` in POSIX. -pub fn Descriptor::append_via_stream( - self : Descriptor, - data : @async-core.Stream[Byte], -) -> @async-core.Future[Result[Unit, ErrorCode]] { - let Descriptor(handle) = self - let lower_arg = handle - let lower_arg0 = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamLower( - data, - ) - let result : Int = wasmImportMethodDescriptorAppendViaStream( - lower_arg, lower_arg0, - ) - wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamCommit( - lower_arg0, - ) - let result2 = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureLift( - result, - ) - let ret = result2 - return ret -} +pub fn Descriptor::append_via_stream(self : Descriptor, data : @async-core.Stream[Byte]) -> @async-core.Future[Result[Unit, ErrorCode]] { + let Descriptor(handle) = self + let lower_arg = handle + let lower_arg0 = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamLower(data) + let result : Int = wasmImportMethodDescriptorAppendViaStream(lower_arg, lower_arg0); + wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamStream0StreamCommit(lower_arg0) + let result2 = wasmWasiFilesystemTypes030MethodDescriptorAppendViaStreamFuture1FutureLift(result) + let ret = result2 + return ret + +} ///| /// Provide file advisory information on a descriptor. /// /// This is similar to `posix_fadvise` in POSIX. -pub async fn Descriptor::advise( - self : Descriptor, - offset : UInt64, - length : UInt64, - advice : Advice, -) -> Result[Unit, ErrorCode] { - let Descriptor(handle) = self - - let lower_arg = handle - let lower_arg0 = offset.reinterpret_as_int64() - let lower_arg1 = length.reinterpret_as_int64() - let lower_arg2 = advice.ordinal() - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorAdvise( - lower_arg, lower_arg0, lower_arg1, lower_arg2, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() +pub async fn Descriptor::advise(self : Descriptor, offset : UInt64, length : UInt64, advice : Advice) -> Result[Unit, ErrorCode] { + + let Descriptor(handle) = self + + let lower_arg = handle + let lower_arg0 = (offset).reinterpret_as_int64() + let lower_arg1 = (length).reinterpret_as_int64() + let lower_arg2 = advice.ordinal() + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorAdvise(lower_arg, lower_arg0, lower_arg1, lower_arg2, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } - Option::Some(result) + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(()) } - _ => panic() - } + 1 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { - Result::Err(lifted0) - } - _ => panic() - } + ErrorCode::Access + } + 1 => { - lifted1 -} + ErrorCode::Already + } + 2 => { -///| -/// Synchronize the data of a file to disk. -/// -/// This function succeeds with no effect if the file descriptor is not -/// opened for writing. -/// -/// Note: This is similar to `fdatasync` in POSIX. -pub async fn Descriptor::sync_data( - self : Descriptor, -) -> Result[Unit, ErrorCode] { - let Descriptor(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorSyncData(lower_arg, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + ErrorCode::BadDescriptor + } + 3 => { - Option::Some(result) - } - _ => panic() - } + ErrorCode::Busy + } + 4 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + ErrorCode::Deadlock + } + 5 => { - Result::Err(lifted0) - } - _ => panic() - } + ErrorCode::Quota + } + 6 => { - lifted1 -} + ErrorCode::Exist + } + 7 => { -///| -/// Get flags associated with a descriptor. -/// -/// Note: This returns similar flags to `fcntl(fd, F_GETFL)` in POSIX. -/// -/// Note: This returns the value that was the `fs_flags` value returned -/// from `fdstat_get` in earlier versions of WASI. -pub async fn Descriptor::get_flags( - self : Descriptor, -) -> Result[DescriptorFlags, ErrorCode] { - let Descriptor(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorGetFlags(lower_arg, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(DescriptorFlags(mbt_ffi_load8_u(result_ptr + 4).to_byte())) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + ErrorCode::FileTooLarge + } + 8 => { - Option::Some(result) - } - _ => panic() - } + ErrorCode::IllegalByteSequence + } + 9 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + ErrorCode::InProgress + } + 10 => { - Result::Err(lifted0) - } - _ => panic() - } + ErrorCode::Interrupted + } + 11 => { - lifted1 -} + ErrorCode::Invalid + } + 12 => { -///| -/// Get the dynamic type of a descriptor. -/// -/// Note: This returns the same value as the `type` field of the `fd-stat` -/// returned by `stat`, `stat-at` and similar. -/// -/// Note: This returns similar flags to the `st_mode & S_IFMT` value provided -/// by `fstat` in POSIX. -/// -/// Note: This returns the value that was the `fs_filetype` value returned -/// from `fdstat_get` in earlier versions of WASI. -pub async fn Descriptor::get_type( - self : Descriptor, -) -> Result[DescriptorType, ErrorCode] { - let Descriptor(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorGetType(lower_arg, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted4 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => DescriptorType::BlockDevice - 1 => DescriptorType::CharacterDevice - 2 => DescriptorType::Directory - 3 => DescriptorType::Fifo - 4 => DescriptorType::SymbolicLink - 5 => DescriptorType::RegularFile - 6 => DescriptorType::Socket - 7 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + ErrorCode::Io + } + 13 => { - Option::Some(result) - } - _ => panic() - } + ErrorCode::IsDirectory + } + 14 => { - DescriptorType::Other(lifted) - } - _ => panic() - } + ErrorCode::Loop + } + 15 => { - Result::Ok(lifted0) - } - 1 => { - let lifted3 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted2 : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result1 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + ErrorCode::TooManyLinks + } + 16 => { - Option::Some(result1) - } - _ => panic() - } + ErrorCode::MessageSize + } + 17 => { - ErrorCode::Other(lifted2) - } - _ => panic() - } + ErrorCode::NameTooLong + } + 18 => { - Result::Err(lifted3) - } - _ => panic() - } + ErrorCode::NoDevice + } + 19 => { - lifted4 -} + ErrorCode::NoEntry + } + 20 => { -///| -/// Adjust the size of an open file. If this increases the file's size, the -/// extra bytes are filled with zeros. -/// -/// Note: This was called `fd_filestat_set_size` in earlier versions of WASI. -pub async fn Descriptor::set_size( - self : Descriptor, - size : UInt64, -) -> Result[Unit, ErrorCode] { - let Descriptor(handle) = self - - let lower_arg = handle - let lower_arg0 = size.reinterpret_as_int64() - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorSetSize( - lower_arg, lower_arg0, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + ErrorCode::NoLock + } + 21 => { - Option::Some(result) - } - _ => panic() - } + ErrorCode::InsufficientMemory + } + 22 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + ErrorCode::InsufficientSpace + } + 23 => { - Result::Err(lifted0) - } - _ => panic() - } + ErrorCode::NotDirectory + } + 24 => { - lifted1 -} + ErrorCode::NotEmpty + } + 25 => { -///| -/// Adjust the timestamps of an open file or directory. -/// -/// Note: This is similar to `futimens` in POSIX. -/// -/// Note: This was called `fd_filestat_set_times` in earlier versions of WASI. -pub async fn Descriptor::set_times( - self : Descriptor, - data_access_timestamp : NewTimestamp, - data_modification_timestamp : NewTimestamp, -) -> Result[Unit, ErrorCode] { - let lower_ptr : Int = mbt_ffi_malloc(56) - defer mbt_ffi_free(lower_ptr) - - let Descriptor(handle) = self - mbt_ffi_store32(lower_ptr + 0 + 0, handle) - - match data_access_timestamp { - NoChange => { - mbt_ffi_store8(lower_ptr + 8 + 0, 0) - - () - } - Now => { - mbt_ffi_store8(lower_ptr + 8 + 0, 1) - - () - } - Timestamp(payload1) => { - mbt_ffi_store8(lower_ptr + 8 + 0, 2) - mbt_ffi_store64(lower_ptr + 8 + 8, payload1.seconds) - mbt_ffi_store32( - lower_ptr + 8 + 16, - payload1.nanoseconds.reinterpret_as_int(), - ) + ErrorCode::NotRecoverable + } + 26 => { - () - } - } - - match data_modification_timestamp { - NoChange => { - mbt_ffi_store8(lower_ptr + 32 + 0, 0) - - () - } - Now => { - mbt_ffi_store8(lower_ptr + 32 + 0, 1) - - () - } - Timestamp(payload1) => { - mbt_ffi_store8(lower_ptr + 32 + 0, 2) - mbt_ffi_store64(lower_ptr + 32 + 8, payload1.seconds) - mbt_ffi_store32( - lower_ptr + 32 + 16, - payload1.nanoseconds.reinterpret_as_int(), - ) + ErrorCode::Unsupported + } + 27 => { - () - } - } - - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorSetTimes(lower_ptr, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + ErrorCode::NoTty + } + 28 => { - Option::Some(result) - } - _ => panic() - } + ErrorCode::NoSuchDevice + } + 29 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + ErrorCode::Overflow + } + 30 => { - Result::Err(lifted0) - } - _ => panic() - } + ErrorCode::NotPermitted + } + 31 => { - lifted1 -} + ErrorCode::Pipe + } + 32 => { -///| -/// Read directory entries from a directory. -/// -/// On filesystems where directories contain entries referring to themselves -/// and their parents, often named `.` and `..` respectively, these entries -/// are omitted. -/// -/// This always returns a new stream which starts at the beginning of the -/// directory. Multiple streams may be active on the same directory, and they -/// do not interfere with each other. -/// -/// This function returns a future, which will resolve to an error code if -/// reading full contents of the directory fails. -pub fn Descriptor::read_directory( - self : Descriptor, -) -> ( - @async-core.Stream[DirectoryEntry], - @async-core.Future[Result[Unit, ErrorCode]], -) { - let Descriptor(handle) = self - let return_area = mbt_ffi_malloc(8) - let lower_arg = handle - let lower_arg0 = return_area - wasmImportMethodDescriptorReadDirectory(lower_arg, lower_arg0) - let result = wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamLift( - mbt_ffi_load32(return_area + 0), - ) - let result1 = wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureLift( - mbt_ffi_load32(return_area + 4), - ) - let ret = (result, result1) - mbt_ffi_free(return_area) - return ret -} + ErrorCode::ReadOnly + } + 33 => { -///| -/// Synchronize the data and metadata of a file to disk. -/// -/// This function succeeds with no effect if the file descriptor is not -/// opened for writing. -/// -/// Note: This is similar to `fsync` in POSIX. -pub async fn Descriptor::sync(self : Descriptor) -> Result[Unit, ErrorCode] { - let Descriptor(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorSync(lower_arg, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + ErrorCode::InvalidSeek + } + 34 => { - Option::Some(result) - } - _ => panic() - } + ErrorCode::TextFileBusy + } + 35 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + ErrorCode::CrossDevice + } + 36 => { - Result::Err(lifted0) - } - _ => panic() - } + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { - lifted1 -} + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) -///| -/// Create a directory. -/// -/// Note: This is similar to `mkdirat` in POSIX. -pub async fn Descriptor::create_directory_at( - self : Descriptor, - path : String, -) -> Result[Unit, ErrorCode] { - let Descriptor(handle) = self - - let ptr = mbt_ffi_str2ptr(path) - - let lower_arg = handle - let lower_arg0 = ptr - let lower_arg1 = path.length() - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorCreateDirectoryAt( - lower_arg, lower_arg0, lower_arg1, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - mbt_ffi_free(lower_arg0) - } else { - mbt_ffi_free(lower_arg0) - } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + Option::Some(result) + } + _ => panic() + } - Option::Some(result) + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) } _ => panic() - } - - ErrorCode::Other(lifted) - } - _ => panic() } - Result::Err(lifted0) - } - _ => panic() - } + lifted1 - lifted1 } - ///| -/// Return the attributes of an open file or directory. +/// Synchronize the data of a file to disk. /// -/// Note: This is similar to `fstat` in POSIX, except that it does not return -/// device and inode information. For testing whether two descriptors refer to -/// the same underlying filesystem object, use `is-same-object`. To obtain -/// additional data that can be used do determine whether a file has been -/// modified, use `metadata-hash`. +/// This function succeeds with no effect if the file descriptor is not +/// opened for writing. /// -/// Note: This was called `fd_filestat_get` in earlier versions of WASI. -pub async fn Descriptor::stat( - self : Descriptor, -) -> Result[DescriptorStat, ErrorCode] { - let Descriptor(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(112 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorStat(lower_arg, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => - match mbt_ffi_load8_u(result_ptr + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 16)) - _ => panic() - } - _ => panic() - } - 1 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 16)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted7 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => DescriptorType::BlockDevice - 1 => DescriptorType::CharacterDevice - 2 => DescriptorType::Directory - 3 => DescriptorType::Fifo - 4 => DescriptorType::SymbolicLink - 5 => DescriptorType::RegularFile - 6 => DescriptorType::Socket - 7 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 12) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 16), - mbt_ffi_load32(result_ptr + 20), - ) +/// Note: This is similar to `fdatasync` in POSIX. +pub async fn Descriptor::sync_data(self : Descriptor) -> Result[Unit, ErrorCode] { - Option::Some(result) - } - _ => panic() - } + let Descriptor(handle) = self - DescriptorType::Other(lifted) - } - _ => panic() - } + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) - let lifted1 : @system-clock.Instant? = match - mbt_ffi_load8_u(result_ptr + 40) { - 0 => Option::None - 1 => - Option::Some(@system-clock.Instant::{ - seconds: mbt_ffi_load64(result_ptr + 48), - nanoseconds: mbt_ffi_load32(result_ptr + 56).reinterpret_as_uint(), - }) - _ => panic() - } + let subtask_code = wasmImportMethodDescriptorSyncData(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, - let lifted2 : @system-clock.Instant? = match - mbt_ffi_load8_u(result_ptr + 64) { - 0 => Option::None - 1 => - Option::Some(@system-clock.Instant::{ - seconds: mbt_ffi_load64(result_ptr + 72), - nanoseconds: mbt_ffi_load32(result_ptr + 80).reinterpret_as_uint(), - }) - _ => panic() + fn(before_started) { + if before_started { + () + } else { + () + } } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } - let lifted3 : @system-clock.Instant? = match - mbt_ffi_load8_u(result_ptr + 88) { - 0 => Option::None - 1 => - Option::Some(@system-clock.Instant::{ - seconds: mbt_ffi_load64(result_ptr + 96), - nanoseconds: mbt_ffi_load32(result_ptr + 104).reinterpret_as_uint(), - }) - _ => panic() - } + }, + ) - Result::Ok(DescriptorStat::{ - type_: lifted0, - link_count: mbt_ffi_load64(result_ptr + 24).reinterpret_as_uint64(), - size: mbt_ffi_load64(result_ptr + 32).reinterpret_as_uint64(), - data_access_timestamp: lifted1, - data_modification_timestamp: lifted2, - status_change_timestamp: lifted3, - }) - } - 1 => { - let lifted6 = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted5 : String? = match mbt_ffi_load8_u(result_ptr + 12) { - 0 => Option::None - 1 => { - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 16), - mbt_ffi_load32(result_ptr + 20), - ) + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { - Option::Some(result4) + Result::Ok(()) } - _ => panic() - } + 1 => { - ErrorCode::Other(lifted5) - } - _ => panic() - } + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { - Result::Err(lifted6) - } - _ => panic() - } + ErrorCode::Access + } + 1 => { - lifted7 -} + ErrorCode::Already + } + 2 => { -///| -/// Return the attributes of a file or directory. -/// -/// Note: This is similar to `fstatat` in POSIX, except that it does not -/// return device and inode information. See the `stat` description for a -/// discussion of alternatives. -/// -/// Note: This was called `path_filestat_get` in earlier versions of WASI. -pub async fn Descriptor::stat_at( - self : Descriptor, - path_flags : PathFlags, - path : String, -) -> Result[DescriptorStat, ErrorCode] { - let Descriptor(handle) = self - - let PathFlags(flag) = path_flags - - let ptr = mbt_ffi_str2ptr(path) - - let lower_arg = handle - let lower_arg0 = flag.to_int() - let lower_arg1 = ptr - let lower_arg2 = path.length() - let result_ptr = mbt_ffi_malloc(112 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorStatAt( - lower_arg, lower_arg0, lower_arg1, lower_arg2, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - mbt_ffi_free(lower_arg1) - } else { - mbt_ffi_free(lower_arg1) - } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => - match mbt_ffi_load8_u(result_ptr + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 16)) - _ => panic() - } - _ => panic() - } - 1 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 16)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted7 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => DescriptorType::BlockDevice - 1 => DescriptorType::CharacterDevice - 2 => DescriptorType::Directory - 3 => DescriptorType::Fifo - 4 => DescriptorType::SymbolicLink - 5 => DescriptorType::RegularFile - 6 => DescriptorType::Socket - 7 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 12) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 16), - mbt_ffi_load32(result_ptr + 20), - ) + ErrorCode::BadDescriptor + } + 3 => { - Option::Some(result) - } - _ => panic() - } + ErrorCode::Busy + } + 4 => { - DescriptorType::Other(lifted) - } - _ => panic() - } + ErrorCode::Deadlock + } + 5 => { - let lifted1 : @system-clock.Instant? = match - mbt_ffi_load8_u(result_ptr + 40) { - 0 => Option::None - 1 => - Option::Some(@system-clock.Instant::{ - seconds: mbt_ffi_load64(result_ptr + 48), - nanoseconds: mbt_ffi_load32(result_ptr + 56).reinterpret_as_uint(), - }) - _ => panic() - } + ErrorCode::Quota + } + 6 => { - let lifted2 : @system-clock.Instant? = match - mbt_ffi_load8_u(result_ptr + 64) { - 0 => Option::None - 1 => - Option::Some(@system-clock.Instant::{ - seconds: mbt_ffi_load64(result_ptr + 72), - nanoseconds: mbt_ffi_load32(result_ptr + 80).reinterpret_as_uint(), - }) - _ => panic() - } + ErrorCode::Exist + } + 7 => { - let lifted3 : @system-clock.Instant? = match - mbt_ffi_load8_u(result_ptr + 88) { - 0 => Option::None - 1 => - Option::Some(@system-clock.Instant::{ - seconds: mbt_ffi_load64(result_ptr + 96), - nanoseconds: mbt_ffi_load32(result_ptr + 104).reinterpret_as_uint(), - }) - _ => panic() - } + ErrorCode::FileTooLarge + } + 8 => { - Result::Ok(DescriptorStat::{ - type_: lifted0, - link_count: mbt_ffi_load64(result_ptr + 24).reinterpret_as_uint64(), - size: mbt_ffi_load64(result_ptr + 32).reinterpret_as_uint64(), - data_access_timestamp: lifted1, - data_modification_timestamp: lifted2, - status_change_timestamp: lifted3, - }) - } - 1 => { - let lifted6 = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted5 : String? = match mbt_ffi_load8_u(result_ptr + 12) { - 0 => Option::None - 1 => { - let result4 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 16), - mbt_ffi_load32(result_ptr + 20), - ) + ErrorCode::IllegalByteSequence + } + 9 => { - Option::Some(result4) - } - _ => panic() - } + ErrorCode::InProgress + } + 10 => { - ErrorCode::Other(lifted5) - } - _ => panic() - } + ErrorCode::Interrupted + } + 11 => { - Result::Err(lifted6) - } - _ => panic() - } + ErrorCode::Invalid + } + 12 => { - lifted7 -} + ErrorCode::Io + } + 13 => { -///| -/// Adjust the timestamps of a file or directory. -/// -/// Note: This is similar to `utimensat` in POSIX. -/// -/// Note: This was called `path_filestat_set_times` in earlier versions of -/// WASI. -pub async fn Descriptor::set_times_at( - self : Descriptor, - path_flags : PathFlags, - path : String, - data_access_timestamp : NewTimestamp, - data_modification_timestamp : NewTimestamp, -) -> Result[Unit, ErrorCode] { - let lower_ptr : Int = mbt_ffi_malloc(64) - defer mbt_ffi_free(lower_ptr) - - let Descriptor(handle) = self - mbt_ffi_store32(lower_ptr + 0 + 0, handle) - - let PathFlags(flag) = path_flags - - mbt_ffi_store8(lower_ptr + 4 + 0, flag.to_int()) - - let ptr = mbt_ffi_str2ptr(path) - mbt_ffi_store32(lower_ptr + 8 + 4, path.length()) - mbt_ffi_store32(lower_ptr + 8 + 0, ptr) - - match data_access_timestamp { - NoChange => { - mbt_ffi_store8(lower_ptr + 16 + 0, 0) - - () - } - Now => { - mbt_ffi_store8(lower_ptr + 16 + 0, 1) - - () - } - Timestamp(payload1) => { - mbt_ffi_store8(lower_ptr + 16 + 0, 2) - mbt_ffi_store64(lower_ptr + 16 + 8, payload1.seconds) - mbt_ffi_store32( - lower_ptr + 16 + 16, - payload1.nanoseconds.reinterpret_as_int(), - ) + ErrorCode::IsDirectory + } + 14 => { - () - } - } - - match data_modification_timestamp { - NoChange => { - mbt_ffi_store8(lower_ptr + 40 + 0, 0) - - () - } - Now => { - mbt_ffi_store8(lower_ptr + 40 + 0, 1) - - () - } - Timestamp(payload1) => { - mbt_ffi_store8(lower_ptr + 40 + 0, 2) - mbt_ffi_store64(lower_ptr + 40 + 8, payload1.seconds) - mbt_ffi_store32( - lower_ptr + 40 + 16, - payload1.nanoseconds.reinterpret_as_int(), - ) + ErrorCode::Loop + } + 15 => { - () - } - } - - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorSetTimesAt(lower_ptr, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 8)) - } else { - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 8)) - } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) + } + _ => panic() + } + + lifted1 + +} +///| +/// Get flags associated with a descriptor. +/// +/// Note: This returns similar flags to `fcntl(fd, F_GETFL)` in POSIX. +/// +/// Note: This returns the value that was the `fs_flags` value returned +/// from `fdstat_get` in earlier versions of WASI. +pub async fn Descriptor::get_flags(self : Descriptor) -> Result[DescriptorFlags, ErrorCode] { + + let Descriptor(handle) = self + + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorGetFlags(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(DescriptorFlags(mbt_ffi_load8_u((result_ptr) + 4).to_byte())) + } + 1 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) + } + _ => panic() + } + + lifted1 + +} +///| +/// Get the dynamic type of a descriptor. +/// +/// Note: This returns the same value as the `type` field of the `fd-stat` +/// returned by `stat`, `stat-at` and similar. +/// +/// Note: This returns similar flags to the `st_mode & S_IFMT` value provided +/// by `fstat` in POSIX. +/// +/// Note: This returns the value that was the `fs_filetype` value returned +/// from `fdstat_get` in earlier versions of WASI. +pub async fn Descriptor::get_type(self : Descriptor) -> Result[DescriptorType, ErrorCode] { + + let Descriptor(handle) = self + + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorGetType(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted4 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + DescriptorType::BlockDevice + } + 1 => { + + DescriptorType::CharacterDevice + } + 2 => { + + DescriptorType::Directory + } + 3 => { + + DescriptorType::Fifo + } + 4 => { + + DescriptorType::SymbolicLink + } + 5 => { + + DescriptorType::RegularFile + } + 6 => { + + DescriptorType::Socket + } + 7 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + DescriptorType::Other(lifted) + } + _ => panic() + } + + Result::Ok(lifted0) + } + 1 => { + + let lifted3 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted2 : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result1 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result1) + } + _ => panic() + } + + ErrorCode::Other(lifted2) + } + _ => panic() + } + + Result::Err(lifted3) + } + _ => panic() + } + + lifted4 + +} +///| +/// Adjust the size of an open file. If this increases the file's size, the +/// extra bytes are filled with zeros. +/// +/// Note: This was called `fd_filestat_set_size` in earlier versions of WASI. +pub async fn Descriptor::set_size(self : Descriptor, size : UInt64) -> Result[Unit, ErrorCode] { + + let Descriptor(handle) = self + + let lower_arg = handle + let lower_arg0 = (size).reinterpret_as_int64() + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorSetSize(lower_arg, lower_arg0, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) + } + _ => panic() + } + + lifted1 + +} +///| +/// Adjust the timestamps of an open file or directory. +/// +/// Note: This is similar to `futimens` in POSIX. +/// +/// Note: This was called `fd_filestat_set_times` in earlier versions of WASI. +pub async fn Descriptor::set_times(self : Descriptor, data_access_timestamp : NewTimestamp, data_modification_timestamp : NewTimestamp) -> Result[Unit, ErrorCode] { + + let lower_ptr : Int = mbt_ffi_malloc(56) + defer mbt_ffi_free(lower_ptr) + + let Descriptor(handle) = self + mbt_ffi_store32((lower_ptr + 0) + 0, handle) + + match data_access_timestamp { + NoChange => { + mbt_ffi_store8((lower_ptr + 8) + 0, (0)) + + () + } + Now => { + mbt_ffi_store8((lower_ptr + 8) + 0, (1)) + + () + } + Timestamp(payload1) => { + mbt_ffi_store8((lower_ptr + 8) + 0, (2)) + mbt_ffi_store64((lower_ptr + 8) + 8, (payload1).seconds) + mbt_ffi_store32((lower_ptr + 8) + 16, ((payload1).nanoseconds).reinterpret_as_int()) + + () + } + } + + match data_modification_timestamp { + NoChange => { + mbt_ffi_store8((lower_ptr + 32) + 0, (0)) + + () + } + Now => { + mbt_ffi_store8((lower_ptr + 32) + 0, (1)) + + () + } + Timestamp(payload1) => { + mbt_ffi_store8((lower_ptr + 32) + 0, (2)) + mbt_ffi_store64((lower_ptr + 32) + 8, (payload1).seconds) + mbt_ffi_store32((lower_ptr + 32) + 16, ((payload1).nanoseconds).reinterpret_as_int()) + + () + } + } + + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorSetTimes(lower_ptr, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) + } + _ => panic() + } + + lifted1 + +} +///| +/// Read directory entries from a directory. +/// +/// On filesystems where directories contain entries referring to themselves +/// and their parents, often named `.` and `..` respectively, these entries +/// are omitted. +/// +/// This always returns a new stream which starts at the beginning of the +/// directory. Multiple streams may be active on the same directory, and they +/// do not interfere with each other. +/// +/// This function returns a future, which will resolve to an error code if +/// reading full contents of the directory fails. +pub fn Descriptor::read_directory(self : Descriptor) -> (@async-core.Stream[DirectoryEntry], @async-core.Future[Result[Unit, ErrorCode]]) { + + let Descriptor(handle) = self + let return_area = mbt_ffi_malloc(8) + let lower_arg = handle + let lower_arg0 = return_area + wasmImportMethodDescriptorReadDirectory(lower_arg, lower_arg0); + let result = wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryStream0StreamLift(mbt_ffi_load32((return_area) + 0)) + let result1 = wasmWasiFilesystemTypes030MethodDescriptorReadDirectoryFuture1FutureLift(mbt_ffi_load32((return_area) + 4)) + let ret = (result, result1) + mbt_ffi_free(return_area) + return ret + +} +///| +/// Synchronize the data and metadata of a file to disk. +/// +/// This function succeeds with no effect if the file descriptor is not +/// opened for writing. +/// +/// Note: This is similar to `fsync` in POSIX. +pub async fn Descriptor::sync(self : Descriptor) -> Result[Unit, ErrorCode] { + + let Descriptor(handle) = self + + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorSync(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) + } + _ => panic() + } + + lifted1 + +} +///| +/// Create a directory. +/// +/// Note: This is similar to `mkdirat` in POSIX. +pub async fn Descriptor::create_directory_at(self : Descriptor, path : String) -> Result[Unit, ErrorCode] { + + let Descriptor(handle) = self + + let ptr = mbt_ffi_str2ptr(path) + + let lower_arg = handle + let lower_arg0 = ptr + let lower_arg1 = path.length() + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorCreateDirectoryAt(lower_arg, lower_arg0, lower_arg1, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + mbt_ffi_free(lower_arg0) + + } else { + mbt_ffi_free(lower_arg0) + + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) + } + _ => panic() + } + + lifted1 + +} +///| +/// Return the attributes of an open file or directory. +/// +/// Note: This is similar to `fstat` in POSIX, except that it does not return +/// device and inode information. For testing whether two descriptors refer to +/// the same underlying filesystem object, use `is-same-object`. To obtain +/// additional data that can be used do determine whether a file has been +/// modified, use `metadata-hash`. +/// +/// Note: This was called `fd_filestat_get` in earlier versions of WASI. +pub async fn Descriptor::stat(self : Descriptor) -> Result[DescriptorStat, ErrorCode] { + + let Descriptor(handle) = self + + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(112 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorStat(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => { + + match (mbt_ffi_load8_u((result_ptr) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 16)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 16)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted7 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { + + DescriptorType::BlockDevice + } + 1 => { + + DescriptorType::CharacterDevice + } + 2 => { + + DescriptorType::Directory + } + 3 => { + + DescriptorType::Fifo + } + 4 => { + + DescriptorType::SymbolicLink + } + 5 => { + + DescriptorType::RegularFile + } + 6 => { + + DescriptorType::Socket + } + 7 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 12) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 16), mbt_ffi_load32((result_ptr) + 20)) + + Option::Some(result) + } + _ => panic() + } + + DescriptorType::Other(lifted) + } + _ => panic() + } + + let lifted1 : @system-clock.Instant? = match mbt_ffi_load8_u((result_ptr) + 40) { + 0 => Option::None + 1 => { + + Option::Some(@system-clock.Instant::{seconds : mbt_ffi_load64((result_ptr) + 48), nanoseconds : (mbt_ffi_load32((result_ptr) + 56)).reinterpret_as_uint()}) + } + _ => panic() + } + + let lifted2 : @system-clock.Instant? = match mbt_ffi_load8_u((result_ptr) + 64) { + 0 => Option::None + 1 => { + + Option::Some(@system-clock.Instant::{seconds : mbt_ffi_load64((result_ptr) + 72), nanoseconds : (mbt_ffi_load32((result_ptr) + 80)).reinterpret_as_uint()}) + } + _ => panic() + } + + let lifted3 : @system-clock.Instant? = match mbt_ffi_load8_u((result_ptr) + 88) { + 0 => Option::None + 1 => { + + Option::Some(@system-clock.Instant::{seconds : mbt_ffi_load64((result_ptr) + 96), nanoseconds : (mbt_ffi_load32((result_ptr) + 104)).reinterpret_as_uint()}) + } + _ => panic() + } + + Result::Ok(DescriptorStat::{type_ : lifted0, link_count : (mbt_ffi_load64((result_ptr) + 24)).reinterpret_as_uint64(), size : (mbt_ffi_load64((result_ptr) + 32)).reinterpret_as_uint64(), data_access_timestamp : lifted1, data_modification_timestamp : lifted2, status_change_timestamp : lifted3}) + } + 1 => { + + let lifted6 = match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted5 : String? = match mbt_ffi_load8_u((result_ptr) + 12) { + 0 => Option::None + 1 => { + + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 16), mbt_ffi_load32((result_ptr) + 20)) + + Option::Some(result4) + } + _ => panic() + } + + ErrorCode::Other(lifted5) + } + _ => panic() + } + + Result::Err(lifted6) + } + _ => panic() + } + + lifted7 + +} +///| +/// Return the attributes of a file or directory. +/// +/// Note: This is similar to `fstatat` in POSIX, except that it does not +/// return device and inode information. See the `stat` description for a +/// discussion of alternatives. +/// +/// Note: This was called `path_filestat_get` in earlier versions of WASI. +pub async fn Descriptor::stat_at(self : Descriptor, path_flags : PathFlags, path : String) -> Result[DescriptorStat, ErrorCode] { + + let Descriptor(handle) = self + + let PathFlags(flag) = path_flags + + let ptr = mbt_ffi_str2ptr(path) + + let lower_arg = handle + let lower_arg0 = flag.to_int() + let lower_arg1 = ptr + let lower_arg2 = path.length() + let result_ptr = mbt_ffi_malloc(112 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorStatAt(lower_arg, lower_arg0, lower_arg1, lower_arg2, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + mbt_ffi_free(lower_arg1) + + } else { + mbt_ffi_free(lower_arg1) + + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => { + + match (mbt_ffi_load8_u((result_ptr) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 16)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 16)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted7 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { + + DescriptorType::BlockDevice + } + 1 => { + + DescriptorType::CharacterDevice + } + 2 => { + + DescriptorType::Directory + } + 3 => { + + DescriptorType::Fifo + } + 4 => { + + DescriptorType::SymbolicLink + } + 5 => { + + DescriptorType::RegularFile + } + 6 => { + + DescriptorType::Socket + } + 7 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 12) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 16), mbt_ffi_load32((result_ptr) + 20)) + + Option::Some(result) + } + _ => panic() + } + + DescriptorType::Other(lifted) + } + _ => panic() + } + + let lifted1 : @system-clock.Instant? = match mbt_ffi_load8_u((result_ptr) + 40) { + 0 => Option::None + 1 => { + + Option::Some(@system-clock.Instant::{seconds : mbt_ffi_load64((result_ptr) + 48), nanoseconds : (mbt_ffi_load32((result_ptr) + 56)).reinterpret_as_uint()}) + } + _ => panic() + } + + let lifted2 : @system-clock.Instant? = match mbt_ffi_load8_u((result_ptr) + 64) { + 0 => Option::None + 1 => { + + Option::Some(@system-clock.Instant::{seconds : mbt_ffi_load64((result_ptr) + 72), nanoseconds : (mbt_ffi_load32((result_ptr) + 80)).reinterpret_as_uint()}) + } + _ => panic() + } + + let lifted3 : @system-clock.Instant? = match mbt_ffi_load8_u((result_ptr) + 88) { + 0 => Option::None + 1 => { + + Option::Some(@system-clock.Instant::{seconds : mbt_ffi_load64((result_ptr) + 96), nanoseconds : (mbt_ffi_load32((result_ptr) + 104)).reinterpret_as_uint()}) + } + _ => panic() + } + + Result::Ok(DescriptorStat::{type_ : lifted0, link_count : (mbt_ffi_load64((result_ptr) + 24)).reinterpret_as_uint64(), size : (mbt_ffi_load64((result_ptr) + 32)).reinterpret_as_uint64(), data_access_timestamp : lifted1, data_modification_timestamp : lifted2, status_change_timestamp : lifted3}) + } + 1 => { + + let lifted6 = match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted5 : String? = match mbt_ffi_load8_u((result_ptr) + 12) { + 0 => Option::None + 1 => { + + let result4 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 16), mbt_ffi_load32((result_ptr) + 20)) + + Option::Some(result4) + } + _ => panic() + } + + ErrorCode::Other(lifted5) + } + _ => panic() + } + + Result::Err(lifted6) + } + _ => panic() + } + + lifted7 + +} +///| +/// Adjust the timestamps of a file or directory. +/// +/// Note: This is similar to `utimensat` in POSIX. +/// +/// Note: This was called `path_filestat_set_times` in earlier versions of +/// WASI. +pub async fn Descriptor::set_times_at(self : Descriptor, path_flags : PathFlags, path : String, data_access_timestamp : NewTimestamp, data_modification_timestamp : NewTimestamp) -> Result[Unit, ErrorCode] { + + let lower_ptr : Int = mbt_ffi_malloc(64) + defer mbt_ffi_free(lower_ptr) + + let Descriptor(handle) = self + mbt_ffi_store32((lower_ptr + 0) + 0, handle) + + let PathFlags(flag) = path_flags + + mbt_ffi_store8((lower_ptr + 4) + 0, flag.to_int()) + + let ptr = mbt_ffi_str2ptr(path) + mbt_ffi_store32((lower_ptr + 8) + 4, path.length()) + mbt_ffi_store32((lower_ptr + 8) + 0, ptr) + + match data_access_timestamp { + NoChange => { + mbt_ffi_store8((lower_ptr + 16) + 0, (0)) + + () + } + Now => { + mbt_ffi_store8((lower_ptr + 16) + 0, (1)) + + () + } + Timestamp(payload1) => { + mbt_ffi_store8((lower_ptr + 16) + 0, (2)) + mbt_ffi_store64((lower_ptr + 16) + 8, (payload1).seconds) + mbt_ffi_store32((lower_ptr + 16) + 16, ((payload1).nanoseconds).reinterpret_as_int()) + + () + } + } + + match data_modification_timestamp { + NoChange => { + mbt_ffi_store8((lower_ptr + 40) + 0, (0)) + + () + } + Now => { + mbt_ffi_store8((lower_ptr + 40) + 0, (1)) + + () + } + Timestamp(payload1) => { + mbt_ffi_store8((lower_ptr + 40) + 0, (2)) + mbt_ffi_store64((lower_ptr + 40) + 8, (payload1).seconds) + mbt_ffi_store32((lower_ptr + 40) + 16, ((payload1).nanoseconds).reinterpret_as_int()) + + () + } + } + + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorSetTimesAt(lower_ptr, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 8)) + + } else { + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 8)) + + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) + } + _ => panic() + } + + lifted1 + +} +///| +/// Create a hard link. +/// +/// Fails with `error-code::no-entry` if the old path does not exist, +/// with `error-code::exist` if the new path already exists, and +/// `error-code::not-permitted` if the old path is not a file. +/// +/// Note: This is similar to `linkat` in POSIX. +pub async fn Descriptor::link_at(self : Descriptor, old_path_flags : PathFlags, old_path : String, new_descriptor : Descriptor, new_path : String) -> Result[Unit, ErrorCode] { + + let lower_ptr : Int = mbt_ffi_malloc(28) + defer mbt_ffi_free(lower_ptr) + + let Descriptor(handle) = self + mbt_ffi_store32((lower_ptr + 0) + 0, handle) + + let PathFlags(flag) = old_path_flags + + mbt_ffi_store8((lower_ptr + 4) + 0, flag.to_int()) + + let ptr = mbt_ffi_str2ptr(old_path) + mbt_ffi_store32((lower_ptr + 8) + 4, old_path.length()) + mbt_ffi_store32((lower_ptr + 8) + 0, ptr) + + let Descriptor(handle) = new_descriptor + mbt_ffi_store32((lower_ptr + 16) + 0, handle) + + let ptr = mbt_ffi_str2ptr(new_path) + mbt_ffi_store32((lower_ptr + 20) + 4, new_path.length()) + mbt_ffi_store32((lower_ptr + 20) + 0, ptr) + + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorLinkAt(lower_ptr, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 8)) + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 20)) + + } else { + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 8)) + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 20)) + + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) + } + _ => panic() + } + + lifted1 + +} +///| +/// Open a file or directory. +/// +/// If `flags` contains `descriptor-flags::mutate-directory`, and the base +/// descriptor doesn't have `descriptor-flags::mutate-directory` set, +/// `open-at` fails with `error-code::read-only`. +/// +/// If `flags` contains `write` or `mutate-directory`, or `open-flags` +/// contains `truncate` or `create`, and the base descriptor doesn't have +/// `descriptor-flags::mutate-directory` set, `open-at` fails with +/// `error-code::read-only`. +/// +/// Note: This is similar to `openat` in POSIX. +pub async fn Descriptor::open_at(self : Descriptor, path_flags : PathFlags, path : String, open_flags : OpenFlags, flags : DescriptorFlags) -> Result[Descriptor, ErrorCode] { + + let lower_ptr : Int = mbt_ffi_malloc(20) + defer mbt_ffi_free(lower_ptr) + + let Descriptor(handle) = self + mbt_ffi_store32((lower_ptr + 0) + 0, handle) + + let PathFlags(flag) = path_flags + + mbt_ffi_store8((lower_ptr + 4) + 0, flag.to_int()) + + let ptr = mbt_ffi_str2ptr(path) + mbt_ffi_store32((lower_ptr + 8) + 4, path.length()) + mbt_ffi_store32((lower_ptr + 8) + 0, ptr) + + let OpenFlags(flag) = open_flags + + mbt_ffi_store8((lower_ptr + 16) + 0, flag.to_int()) + + let DescriptorFlags(flag) = flags + + mbt_ffi_store8((lower_ptr + 17) + 0, flag.to_int()) + + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorOpenAt(lower_ptr, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 8)) + + } else { + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 8)) + + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + Descriptor::Descriptor(mbt_ffi_load32((result_ptr) + 4)).drop() + + } + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(Descriptor::Descriptor(mbt_ffi_load32((result_ptr) + 4))) + } + 1 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) + } + _ => panic() + } + + lifted1 + +} +///| +/// Read the contents of a symbolic link. +/// +/// If the contents contain an absolute or rooted path in the underlying +/// filesystem, this function fails with `error-code::not-permitted`. +/// +/// Note: This is similar to `readlinkat` in POSIX. +pub async fn Descriptor::readlink_at(self : Descriptor, path : String) -> Result[String, ErrorCode] { + + let Descriptor(handle) = self + + let ptr = mbt_ffi_str2ptr(path) + + let lower_arg = handle + let lower_arg0 = ptr + let lower_arg1 = path.length() + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorReadlinkAt(lower_arg, lower_arg0, lower_arg1, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + mbt_ffi_free(lower_arg0) + + } else { + mbt_ffi_free(lower_arg0) + + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 4)) + + } + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted2 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 4), mbt_ffi_load32((result_ptr) + 8)) + + Result::Ok(result) + } + 1 => { + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result0) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted1) + } + _ => panic() + } + + lifted2 + +} +///| +/// Remove a directory. +/// +/// Return `error-code::not-empty` if the directory is not empty. +/// +/// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX. +pub async fn Descriptor::remove_directory_at(self : Descriptor, path : String) -> Result[Unit, ErrorCode] { + + let Descriptor(handle) = self + + let ptr = mbt_ffi_str2ptr(path) + + let lower_arg = handle + let lower_arg0 = ptr + let lower_arg1 = path.length() + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorRemoveDirectoryAt(lower_arg, lower_arg0, lower_arg1, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + mbt_ffi_free(lower_arg0) + + } else { + mbt_ffi_free(lower_arg0) + + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) + } + _ => panic() + } + + lifted1 + +} +///| +/// Rename a filesystem object. +/// +/// Note: This is similar to `renameat` in POSIX. +pub async fn Descriptor::rename_at(self : Descriptor, old_path : String, new_descriptor : Descriptor, new_path : String) -> Result[Unit, ErrorCode] { + + let lower_ptr : Int = mbt_ffi_malloc(24) + defer mbt_ffi_free(lower_ptr) + + let Descriptor(handle) = self + mbt_ffi_store32((lower_ptr + 0) + 0, handle) + + let ptr = mbt_ffi_str2ptr(old_path) + mbt_ffi_store32((lower_ptr + 4) + 4, old_path.length()) + mbt_ffi_store32((lower_ptr + 4) + 0, ptr) + + let Descriptor(handle) = new_descriptor + mbt_ffi_store32((lower_ptr + 12) + 0, handle) + + let ptr = mbt_ffi_str2ptr(new_path) + mbt_ffi_store32((lower_ptr + 16) + 4, new_path.length()) + mbt_ffi_store32((lower_ptr + 16) + 0, ptr) + + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorRenameAt(lower_ptr, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 4)) + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 16)) + + } else { + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 4)) + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 16)) + + } + } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) + } + _ => panic() + } + + lifted1 + +} +///| +/// Create a symbolic link (also known as a "symlink"). +/// +/// If `old-path` starts with `/`, the function fails with +/// `error-code::not-permitted`. +/// +/// Note: This is similar to `symlinkat` in POSIX. +pub async fn Descriptor::symlink_at(self : Descriptor, old_path : String, new_path : String) -> Result[Unit, ErrorCode] { + + let lower_ptr : Int = mbt_ffi_malloc(20) + defer mbt_ffi_free(lower_ptr) + + let Descriptor(handle) = self + mbt_ffi_store32((lower_ptr + 0) + 0, handle) + + let ptr = mbt_ffi_str2ptr(old_path) + mbt_ffi_store32((lower_ptr + 4) + 4, old_path.length()) + mbt_ffi_store32((lower_ptr + 4) + 0, ptr) + + let ptr = mbt_ffi_str2ptr(new_path) + mbt_ffi_store32((lower_ptr + 12) + 4, new_path.length()) + mbt_ffi_store32((lower_ptr + 12) + 0, ptr) + + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorSymlinkAt(lower_ptr, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 4)) + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 12)) + + } else { + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 4)) + mbt_ffi_free(mbt_ffi_load32((lower_ptr) + 12)) + + } } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(()) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) - Option::Some(result) + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) } _ => panic() - } - - ErrorCode::Other(lifted) - } - _ => panic() } - Result::Err(lifted0) - } - _ => panic() - } + lifted1 - lifted1 } - ///| -/// Create a hard link. +/// Unlink a filesystem object that is not a directory. /// -/// Fails with `error-code::no-entry` if the old path does not exist, -/// with `error-code::exist` if the new path already exists, and -/// `error-code::not-permitted` if the old path is not a file. +/// This is similar to `unlinkat(fd, path, 0)` in POSIX. /// -/// Note: This is similar to `linkat` in POSIX. -pub async fn Descriptor::link_at( - self : Descriptor, - old_path_flags : PathFlags, - old_path : String, - new_descriptor : Descriptor, - new_path : String, -) -> Result[Unit, ErrorCode] { - let lower_ptr : Int = mbt_ffi_malloc(28) - defer mbt_ffi_free(lower_ptr) - - let Descriptor(handle) = self - mbt_ffi_store32(lower_ptr + 0 + 0, handle) - - let PathFlags(flag) = old_path_flags - - mbt_ffi_store8(lower_ptr + 4 + 0, flag.to_int()) - - let ptr = mbt_ffi_str2ptr(old_path) - mbt_ffi_store32(lower_ptr + 8 + 4, old_path.length()) - mbt_ffi_store32(lower_ptr + 8 + 0, ptr) - - let Descriptor(handle) = new_descriptor - mbt_ffi_store32(lower_ptr + 16 + 0, handle) - - let ptr = mbt_ffi_str2ptr(new_path) - mbt_ffi_store32(lower_ptr + 20 + 4, new_path.length()) - mbt_ffi_store32(lower_ptr + 20 + 0, ptr) - - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorLinkAt(lower_ptr, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 8)) - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 20)) - } else { - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 8)) - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 20)) - } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() +/// Error returns are as specified by POSIX. +/// +/// If the filesystem object is a directory, `error-code::access` or +/// `error-code::is-directory` may be returned instead of the +/// POSIX-specified `error-code::not-permitted`. +pub async fn Descriptor::unlink_file_at(self : Descriptor, path : String) -> Result[Unit, ErrorCode] { + + let Descriptor(handle) = self + + let ptr = mbt_ffi_str2ptr(path) + + let lower_arg = handle + let lower_arg0 = ptr + let lower_arg1 = path.length() + let result_ptr = mbt_ffi_malloc(20 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorUnlinkFileAt(lower_arg, lower_arg0, lower_arg1, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + mbt_ffi_free(lower_arg0) + + } else { + mbt_ffi_free(lower_arg0) + + } } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 12)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { - Option::Some(result) + Result::Ok(()) } - _ => panic() - } + 1 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { - Result::Err(lifted0) - } - _ => panic() - } + ErrorCode::Access + } + 1 => { - lifted1 -} + ErrorCode::Already + } + 2 => { -///| -/// Open a file or directory. -/// -/// If `flags` contains `descriptor-flags::mutate-directory`, and the base -/// descriptor doesn't have `descriptor-flags::mutate-directory` set, -/// `open-at` fails with `error-code::read-only`. -/// -/// If `flags` contains `write` or `mutate-directory`, or `open-flags` -/// contains `truncate` or `create`, and the base descriptor doesn't have -/// `descriptor-flags::mutate-directory` set, `open-at` fails with -/// `error-code::read-only`. -/// -/// Note: This is similar to `openat` in POSIX. -pub async fn Descriptor::open_at( - self : Descriptor, - path_flags : PathFlags, - path : String, - open_flags : OpenFlags, - flags : DescriptorFlags, -) -> Result[Descriptor, ErrorCode] { - let lower_ptr : Int = mbt_ffi_malloc(20) - defer mbt_ffi_free(lower_ptr) + ErrorCode::BadDescriptor + } + 3 => { - let Descriptor(handle) = self - mbt_ffi_store32(lower_ptr + 0 + 0, handle) + ErrorCode::Busy + } + 4 => { - let PathFlags(flag) = path_flags + ErrorCode::Deadlock + } + 5 => { - mbt_ffi_store8(lower_ptr + 4 + 0, flag.to_int()) + ErrorCode::Quota + } + 6 => { - let ptr = mbt_ffi_str2ptr(path) - mbt_ffi_store32(lower_ptr + 8 + 4, path.length()) - mbt_ffi_store32(lower_ptr + 8 + 0, ptr) + ErrorCode::Exist + } + 7 => { - let OpenFlags(flag) = open_flags + ErrorCode::FileTooLarge + } + 8 => { - mbt_ffi_store8(lower_ptr + 16 + 0, flag.to_int()) + ErrorCode::IllegalByteSequence + } + 9 => { - let DescriptorFlags(flag) = flags + ErrorCode::InProgress + } + 10 => { - mbt_ffi_store8(lower_ptr + 17 + 0, flag.to_int()) + ErrorCode::Interrupted + } + 11 => { - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) + ErrorCode::Invalid + } + 12 => { - let subtask_code = wasmImportMethodDescriptorOpenAt(lower_ptr, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 8)) - } else { - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 8)) - } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Descriptor::Descriptor(mbt_ffi_load32(result_ptr + 4)).drop() - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(Descriptor::Descriptor(mbt_ffi_load32(result_ptr + 4))) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + ErrorCode::Io + } + 13 => { - Option::Some(result) - } - _ => panic() - } + ErrorCode::IsDirectory + } + 14 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + ErrorCode::Loop + } + 15 => { - Result::Err(lifted0) - } - _ => panic() - } + ErrorCode::TooManyLinks + } + 16 => { - lifted1 -} + ErrorCode::MessageSize + } + 17 => { -///| -/// Read the contents of a symbolic link. -/// -/// If the contents contain an absolute or rooted path in the underlying -/// filesystem, this function fails with `error-code::not-permitted`. -/// -/// Note: This is similar to `readlinkat` in POSIX. -pub async fn Descriptor::readlink_at( - self : Descriptor, - path : String, -) -> Result[String, ErrorCode] { - let Descriptor(handle) = self - - let ptr = mbt_ffi_str2ptr(path) - - let lower_arg = handle - let lower_arg0 = ptr - let lower_arg1 = path.length() - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorReadlinkAt( - lower_arg, lower_arg0, lower_arg1, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - mbt_ffi_free(lower_arg0) - } else { - mbt_ffi_free(lower_arg0) - } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 4)) - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted2 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 4), - mbt_ffi_load32(result_ptr + 8), - ) + ErrorCode::NameTooLong + } + 18 => { - Result::Ok(result) - } - 1 => { - let lifted1 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + ErrorCode::NoDevice + } + 19 => { - Option::Some(result0) - } - _ => panic() - } + ErrorCode::NoEntry + } + 20 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + ErrorCode::NoLock + } + 21 => { - Result::Err(lifted1) - } - _ => panic() - } + ErrorCode::InsufficientMemory + } + 22 => { - lifted2 -} + ErrorCode::InsufficientSpace + } + 23 => { -///| -/// Remove a directory. -/// -/// Return `error-code::not-empty` if the directory is not empty. -/// -/// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX. -pub async fn Descriptor::remove_directory_at( - self : Descriptor, - path : String, -) -> Result[Unit, ErrorCode] { - let Descriptor(handle) = self - - let ptr = mbt_ffi_str2ptr(path) - - let lower_arg = handle - let lower_arg0 = ptr - let lower_arg1 = path.length() - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorRemoveDirectoryAt( - lower_arg, lower_arg0, lower_arg1, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - mbt_ffi_free(lower_arg0) - } else { - mbt_ffi_free(lower_arg0) - } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + ErrorCode::NotDirectory + } + 24 => { - Option::Some(result) - } - _ => panic() - } + ErrorCode::NotEmpty + } + 25 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + ErrorCode::NotRecoverable + } + 26 => { - Result::Err(lifted0) - } - _ => panic() - } + ErrorCode::Unsupported + } + 27 => { - lifted1 -} + ErrorCode::NoTty + } + 28 => { -///| -/// Rename a filesystem object. -/// -/// Note: This is similar to `renameat` in POSIX. -pub async fn Descriptor::rename_at( - self : Descriptor, - old_path : String, - new_descriptor : Descriptor, - new_path : String, -) -> Result[Unit, ErrorCode] { - let lower_ptr : Int = mbt_ffi_malloc(24) - defer mbt_ffi_free(lower_ptr) - - let Descriptor(handle) = self - mbt_ffi_store32(lower_ptr + 0 + 0, handle) - - let ptr = mbt_ffi_str2ptr(old_path) - mbt_ffi_store32(lower_ptr + 4 + 4, old_path.length()) - mbt_ffi_store32(lower_ptr + 4 + 0, ptr) - - let Descriptor(handle) = new_descriptor - mbt_ffi_store32(lower_ptr + 12 + 0, handle) - - let ptr = mbt_ffi_str2ptr(new_path) - mbt_ffi_store32(lower_ptr + 16 + 4, new_path.length()) - mbt_ffi_store32(lower_ptr + 16 + 0, ptr) - - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorRenameAt(lower_ptr, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 4)) - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 16)) - } else { - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 4)) - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 16)) - } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + ErrorCode::NoSuchDevice + } + 29 => { - Option::Some(result) - } - _ => panic() - } + ErrorCode::Overflow + } + 30 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + ErrorCode::NotPermitted + } + 31 => { - Result::Err(lifted0) - } - _ => panic() - } + ErrorCode::Pipe + } + 32 => { - lifted1 -} + ErrorCode::ReadOnly + } + 33 => { -///| -/// Create a symbolic link (also known as a "symlink"). -/// -/// If `old-path` starts with `/`, the function fails with -/// `error-code::not-permitted`. -/// -/// Note: This is similar to `symlinkat` in POSIX. -pub async fn Descriptor::symlink_at( - self : Descriptor, - old_path : String, - new_path : String, -) -> Result[Unit, ErrorCode] { - let lower_ptr : Int = mbt_ffi_malloc(20) - defer mbt_ffi_free(lower_ptr) - - let Descriptor(handle) = self - mbt_ffi_store32(lower_ptr + 0 + 0, handle) - - let ptr = mbt_ffi_str2ptr(old_path) - mbt_ffi_store32(lower_ptr + 4 + 4, old_path.length()) - mbt_ffi_store32(lower_ptr + 4 + 0, ptr) - - let ptr = mbt_ffi_str2ptr(new_path) - mbt_ffi_store32(lower_ptr + 12 + 4, new_path.length()) - mbt_ffi_store32(lower_ptr + 12 + 0, ptr) - - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorSymlinkAt(lower_ptr, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 4)) - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 12)) - } else { - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 4)) - mbt_ffi_free(mbt_ffi_load32(lower_ptr + 12)) - } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + ErrorCode::InvalidSeek + } + 34 => { - Option::Some(result) - } - _ => panic() - } + ErrorCode::TextFileBusy + } + 35 => { - ErrorCode::Other(lifted) - } - _ => panic() - } + ErrorCode::CrossDevice + } + 36 => { - Result::Err(lifted0) - } - _ => panic() - } + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 8) { + 0 => Option::None + 1 => { - lifted1 -} + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 12), mbt_ffi_load32((result_ptr) + 16)) -///| -/// Unlink a filesystem object that is not a directory. -/// -/// This is similar to `unlinkat(fd, path, 0)` in POSIX. -/// -/// Error returns are as specified by POSIX. -/// -/// If the filesystem object is a directory, `error-code::access` or -/// `error-code::is-directory` may be returned instead of the -/// POSIX-specified `error-code::not-permitted`. -pub async fn Descriptor::unlink_file_at( - self : Descriptor, - path : String, -) -> Result[Unit, ErrorCode] { - let Descriptor(handle) = self - - let ptr = mbt_ffi_str2ptr(path) - - let lower_arg = handle - let lower_arg0 = ptr - let lower_arg1 = path.length() - let result_ptr = mbt_ffi_malloc(20 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorUnlinkFileAt( - lower_arg, lower_arg0, lower_arg1, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - mbt_ffi_free(lower_arg0) - } else { - mbt_ffi_free(lower_arg0) - } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 12)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 12), - mbt_ffi_load32(result_ptr + 16), - ) + Option::Some(result) + } + _ => panic() + } - Option::Some(result) + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) } _ => panic() - } - - ErrorCode::Other(lifted) - } - _ => panic() } - Result::Err(lifted0) - } - _ => panic() - } + lifted1 - lifted1 } - ///| /// Test whether two descriptors refer to the same filesystem object. /// @@ -3504,30 +5674,37 @@ pub async fn Descriptor::unlink_file_at( /// same device (`st_dev`) and inode (`st_ino` or `d_ino`) numbers. /// wasi-filesystem does not expose device and inode numbers, so this function /// may be used instead. -pub async fn Descriptor::is_same_object( - self : Descriptor, - other : Descriptor, -) -> Bool { - let Descriptor(handle) = self - - let Descriptor(handle0) = other - - let lower_arg = handle - let lower_arg0 = handle0 - let result_ptr = mbt_ffi_malloc(1 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorIsSameObject( - lower_arg, lower_arg0, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { }, - ) - mbt_ffi_load8_u(result_ptr + 0) != 0 -} +pub async fn Descriptor::is_same_object(self : Descriptor, other : Descriptor) -> Bool { + + let Descriptor(handle) = self + + let Descriptor(handle0) = other + + let lower_arg = handle + let lower_arg0 = handle0 + let result_ptr = mbt_ffi_malloc(1 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorIsSameObject(lower_arg, lower_arg0, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } + } + , + fn() { + + }, + ) + + (mbt_ffi_load8_u((result_ptr) + 0) != 0) +} ///| /// Return a hash of the metadata associated with a filesystem object referred /// to by a descriptor. @@ -3548,302 +5725,544 @@ pub async fn Descriptor::is_same_object( /// computed hash. /// /// However, none of these is required. -pub async fn Descriptor::metadata_hash( - self : Descriptor, -) -> Result[MetadataHashValue, ErrorCode] { - let Descriptor(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(24 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorMetadataHash( - lower_arg, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 16)) - _ => panic() - } - _ => panic() - } - _ => panic() +pub async fn Descriptor::metadata_hash(self : Descriptor) -> Result[MetadataHashValue, ErrorCode] { + + let Descriptor(handle) = self + + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(24 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorMetadataHash(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => - Result::Ok(MetadataHashValue::{ - lower: mbt_ffi_load64(result_ptr + 8).reinterpret_as_uint64(), - upper: mbt_ffi_load64(result_ptr + 16).reinterpret_as_uint64(), - }) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 12) { - 0 => Option::None + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 16)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(MetadataHashValue::{lower : (mbt_ffi_load64((result_ptr) + 8)).reinterpret_as_uint64(), upper : (mbt_ffi_load64((result_ptr) + 16)).reinterpret_as_uint64()}) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 16), - mbt_ffi_load32(result_ptr + 20), - ) - Option::Some(result) + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 12) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 16), mbt_ffi_load32((result_ptr) + 20)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) } _ => panic() - } - - ErrorCode::Other(lifted) - } - _ => panic() } - Result::Err(lifted0) - } - _ => panic() - } + lifted1 - lifted1 } - ///| /// Return a hash of the metadata associated with a filesystem object referred /// to by a directory descriptor and a relative path. /// /// This performs the same hash computation as `metadata-hash`. -pub async fn Descriptor::metadata_hash_at( - self : Descriptor, - path_flags : PathFlags, - path : String, -) -> Result[MetadataHashValue, ErrorCode] { - let Descriptor(handle) = self - - let PathFlags(flag) = path_flags - - let ptr = mbt_ffi_str2ptr(path) - - let lower_arg = handle - let lower_arg0 = flag.to_int() - let lower_arg1 = ptr - let lower_arg2 = path.length() - let result_ptr = mbt_ffi_malloc(24 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodDescriptorMetadataHashAt( - lower_arg, lower_arg0, lower_arg1, lower_arg2, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - mbt_ffi_free(lower_arg1) - } else { - mbt_ffi_free(lower_arg1) - } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => () - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => () - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => () - 23 => () - 24 => () - 25 => () - 26 => () - 27 => () - 28 => () - 29 => () - 30 => () - 31 => () - 32 => () - 33 => () - 34 => () - 35 => () - 36 => - match mbt_ffi_load8_u(result_ptr + 12) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 16)) - _ => panic() - } - _ => panic() - } - _ => panic() +pub async fn Descriptor::metadata_hash_at(self : Descriptor, path_flags : PathFlags, path : String) -> Result[MetadataHashValue, ErrorCode] { + + let Descriptor(handle) = self + + let PathFlags(flag) = path_flags + + let ptr = mbt_ffi_str2ptr(path) + + let lower_arg = handle + let lower_arg0 = flag.to_int() + let lower_arg1 = ptr + let lower_arg2 = path.length() + let result_ptr = mbt_ffi_malloc(24 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodDescriptorMetadataHashAt(lower_arg, lower_arg0, lower_arg1, lower_arg2, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + mbt_ffi_free(lower_arg1) + + } else { + mbt_ffi_free(lower_arg1) + + } } - }, - ) - - let lifted1 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => - Result::Ok(MetadataHashValue::{ - lower: mbt_ffi_load64(result_ptr + 8).reinterpret_as_uint64(), - upper: mbt_ffi_load64(result_ptr + 16).reinterpret_as_uint64(), - }) - 1 => { - let lifted0 = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => ErrorCode::Access - 1 => ErrorCode::Already - 2 => ErrorCode::BadDescriptor - 3 => ErrorCode::Busy - 4 => ErrorCode::Deadlock - 5 => ErrorCode::Quota - 6 => ErrorCode::Exist - 7 => ErrorCode::FileTooLarge - 8 => ErrorCode::IllegalByteSequence - 9 => ErrorCode::InProgress - 10 => ErrorCode::Interrupted - 11 => ErrorCode::Invalid - 12 => ErrorCode::Io - 13 => ErrorCode::IsDirectory - 14 => ErrorCode::Loop - 15 => ErrorCode::TooManyLinks - 16 => ErrorCode::MessageSize - 17 => ErrorCode::NameTooLong - 18 => ErrorCode::NoDevice - 19 => ErrorCode::NoEntry - 20 => ErrorCode::NoLock - 21 => ErrorCode::InsufficientMemory - 22 => ErrorCode::InsufficientSpace - 23 => ErrorCode::NotDirectory - 24 => ErrorCode::NotEmpty - 25 => ErrorCode::NotRecoverable - 26 => ErrorCode::Unsupported - 27 => ErrorCode::NoTty - 28 => ErrorCode::NoSuchDevice - 29 => ErrorCode::Overflow - 30 => ErrorCode::NotPermitted - 31 => ErrorCode::Pipe - 32 => ErrorCode::ReadOnly - 33 => ErrorCode::InvalidSeek - 34 => ErrorCode::TextFileBusy - 35 => ErrorCode::CrossDevice - 36 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 12) { - 0 => Option::None + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => () + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => () + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => () + 23 => () + 24 => () + 25 => () + 26 => () + 27 => () + 28 => () + 29 => () + 30 => () + 31 => () + 32 => () + 33 => () + 34 => () + 35 => () + 36 => { + + match (mbt_ffi_load8_u((result_ptr) + 12)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 16)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() + } + + }, + ) + + let lifted1 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(MetadataHashValue::{lower : (mbt_ffi_load64((result_ptr) + 8)).reinterpret_as_uint64(), upper : (mbt_ffi_load64((result_ptr) + 16)).reinterpret_as_uint64()}) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 16), - mbt_ffi_load32(result_ptr + 20), - ) - Option::Some(result) + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { + + ErrorCode::Access + } + 1 => { + + ErrorCode::Already + } + 2 => { + + ErrorCode::BadDescriptor + } + 3 => { + + ErrorCode::Busy + } + 4 => { + + ErrorCode::Deadlock + } + 5 => { + + ErrorCode::Quota + } + 6 => { + + ErrorCode::Exist + } + 7 => { + + ErrorCode::FileTooLarge + } + 8 => { + + ErrorCode::IllegalByteSequence + } + 9 => { + + ErrorCode::InProgress + } + 10 => { + + ErrorCode::Interrupted + } + 11 => { + + ErrorCode::Invalid + } + 12 => { + + ErrorCode::Io + } + 13 => { + + ErrorCode::IsDirectory + } + 14 => { + + ErrorCode::Loop + } + 15 => { + + ErrorCode::TooManyLinks + } + 16 => { + + ErrorCode::MessageSize + } + 17 => { + + ErrorCode::NameTooLong + } + 18 => { + + ErrorCode::NoDevice + } + 19 => { + + ErrorCode::NoEntry + } + 20 => { + + ErrorCode::NoLock + } + 21 => { + + ErrorCode::InsufficientMemory + } + 22 => { + + ErrorCode::InsufficientSpace + } + 23 => { + + ErrorCode::NotDirectory + } + 24 => { + + ErrorCode::NotEmpty + } + 25 => { + + ErrorCode::NotRecoverable + } + 26 => { + + ErrorCode::Unsupported + } + 27 => { + + ErrorCode::NoTty + } + 28 => { + + ErrorCode::NoSuchDevice + } + 29 => { + + ErrorCode::Overflow + } + 30 => { + + ErrorCode::NotPermitted + } + 31 => { + + ErrorCode::Pipe + } + 32 => { + + ErrorCode::ReadOnly + } + 33 => { + + ErrorCode::InvalidSeek + } + 34 => { + + ErrorCode::TextFileBusy + } + 35 => { + + ErrorCode::CrossDevice + } + 36 => { + + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 12) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 16), mbt_ffi_load32((result_ptr) + 20)) + + Option::Some(result) + } + _ => panic() + } + + ErrorCode::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) } _ => panic() - } - - ErrorCode::Other(lifted) - } - _ => panic() } - Result::Err(lifted0) - } - _ => panic() - } + lifted1 - lifted1 } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/http/client/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/http/client/ffi.mbt index e8f5bbe8bb..73a881a6d0 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/http/client/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/http/client/ffi.mbt @@ -1,38 +1,38 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportSend(p0 : Int, p1 : Int) -> Int = "wasi:http/client@0.3.0" "[async-lower]send" -///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) - ///| extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_u) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) + +///| +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/http/client/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/http/client/top.mbt index 22a11e4fcd..37f6fc4c44 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/http/client/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/http/client/top.mbt @@ -1,459 +1,583 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// This function may be used to either send an outgoing request over the /// network or to forward it to another component. -pub async fn send( - request : @types.Request, -) -> Result[@types.Response, @types.ErrorCode] { - let @types.Request(handle) = request - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(40 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportSend(lower_arg, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { - if before_started { - @types.Request::Request(lower_arg).drop() - } else { - () +pub async fn send(request : @types.Request) -> Result[@types.Response, @types.ErrorCode] { + + let @types.Request(handle) = request + + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(40 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportSend(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + @types.Request::Request(lower_arg).drop() + + } else { + () + } } - }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => @types.Response::Response(mbt_ffi_load32(result_ptr + 8)).drop() - 1 => - match mbt_ffi_load8_u(result_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(result_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(result_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(result_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 24)) - _ => panic() + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + @types.Response::Response(mbt_ffi_load32((result_ptr) + 8)).drop() + } - _ => panic() - } - 23 => () - 24 => - match mbt_ffi_load8_u(result_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - _ => panic() - } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(result_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - _ => panic() - } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(result_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - _ => panic() - } - 31 => - match mbt_ffi_load8_u(result_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(result_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - _ => panic() - } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(result_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(result_ptr + 20)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - }, - ) - - let lifted30 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(@types.Response::Response(mbt_ffi_load32(result_ptr + 8))) - 1 => { - let lifted29 = match mbt_ffi_load8_u(result_ptr + 8) { - 0 => @types.ErrorCode::DnsTimeout - 1 => { - let lifted : String? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 20), - mbt_ffi_load32(result_ptr + 24), - ) + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((result_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((result_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((result_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((result_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((result_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((result_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((result_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((result_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((result_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((result_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } - Option::Some(result) + } + _ => panic() } - _ => panic() - } - - let lifted0 : UInt? = match mbt_ffi_load8_u(result_ptr + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load16_u(result_ptr + 30) - .land(0xFFFF) - .reinterpret_as_uint(), - ) - _ => panic() - } - - @types.ErrorCode::DnsError(@types.DnsErrorPayload::{ - rcode: lifted, - info_code: lifted0, - }) - } - 2 => @types.ErrorCode::DestinationNotFound - 3 => @types.ErrorCode::DestinationUnavailable - 4 => @types.ErrorCode::DestinationIpProhibited - 5 => @types.ErrorCode::DestinationIpUnroutable - 6 => @types.ErrorCode::ConnectionRefused - 7 => @types.ErrorCode::ConnectionTerminated - 8 => @types.ErrorCode::ConnectionTimeout - 9 => @types.ErrorCode::ConnectionReadTimeout - 10 => @types.ErrorCode::ConnectionWriteTimeout - 11 => @types.ErrorCode::ConnectionLimitReached - 12 => @types.ErrorCode::TlsProtocolError - 13 => @types.ErrorCode::TlsCertificateError - 14 => { - let lifted1 : Byte? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load8_u(result_ptr + 17).to_byte()) - _ => panic() - } - let lifted3 : String? = match mbt_ffi_load8_u(result_ptr + 20) { - 0 => Option::None - 1 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 24), - mbt_ffi_load32(result_ptr + 28), - ) + }, + ) + + let lifted30 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { - Option::Some(result2) + Result::Ok(@types.Response::Response(mbt_ffi_load32((result_ptr) + 8))) } - _ => panic() - } - - @types.ErrorCode::TlsAlertReceived(@types.TlsAlertReceivedPayload::{ - alert_id: lifted1, - alert_message: lifted3, - }) - } - 15 => @types.ErrorCode::HttpRequestDenied - 16 => @types.ErrorCode::HttpRequestLengthRequired - 17 => { - let lifted4 : UInt64? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(result_ptr + 24).reinterpret_as_uint64(), - ) - _ => panic() - } - - @types.ErrorCode::HttpRequestBodySize(lifted4) - } - 18 => @types.ErrorCode::HttpRequestMethodInvalid - 19 => @types.ErrorCode::HttpRequestUriInvalid - 20 => @types.ErrorCode::HttpRequestUriTooLong - 21 => { - let lifted5 : UInt? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(result_ptr + 20).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.ErrorCode::HttpRequestHeaderSectionSize(lifted5) - } - 22 => { - let lifted9 : @types.FieldSizePayload? = match - mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None 1 => { - let lifted7 : String? = match mbt_ffi_load8_u(result_ptr + 20) { - 0 => Option::None - 1 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 24), - mbt_ffi_load32(result_ptr + 28), - ) - - Option::Some(result6) - } - _ => panic() - } - - let lifted8 : UInt? = match mbt_ffi_load8_u(result_ptr + 32) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(result_ptr + 36).reinterpret_as_uint(), - ) - _ => panic() - } - - Option::Some(@types.FieldSizePayload::{ - field_name: lifted7, - field_size: lifted8, - }) - } - _ => panic() - } - - @types.ErrorCode::HttpRequestHeaderSize(lifted9) - } - 23 => { - let lifted10 : UInt? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(result_ptr + 20).reinterpret_as_uint(), - ) - _ => panic() - } - @types.ErrorCode::HttpRequestTrailerSectionSize(lifted10) - } - 24 => { - let lifted12 : String? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => { - let result11 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 20), - mbt_ffi_load32(result_ptr + 24), - ) + let lifted29 = match (mbt_ffi_load8_u((result_ptr) + 8)) { + 0 => { - Option::Some(result11) - } - _ => panic() - } - - let lifted13 : UInt? = match mbt_ffi_load8_u(result_ptr + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(result_ptr + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.ErrorCode::HttpRequestTrailerSize(@types.FieldSizePayload::{ - field_name: lifted12, - field_size: lifted13, - }) - } - 25 => @types.ErrorCode::HttpResponseIncomplete - 26 => { - let lifted14 : UInt? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(result_ptr + 20).reinterpret_as_uint(), - ) - _ => panic() - } + @types.ErrorCode::DnsTimeout + } + 1 => { - @types.ErrorCode::HttpResponseHeaderSectionSize(lifted14) - } - 27 => { - let lifted16 : String? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 20), - mbt_ffi_load32(result_ptr + 24), - ) + let lifted : String? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { - Option::Some(result15) - } - _ => panic() - } - - let lifted17 : UInt? = match mbt_ffi_load8_u(result_ptr + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(result_ptr + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.ErrorCode::HttpResponseHeaderSize(@types.FieldSizePayload::{ - field_name: lifted16, - field_size: lifted17, - }) - } - 28 => { - let lifted18 : UInt64? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load64(result_ptr + 24).reinterpret_as_uint64(), - ) - _ => panic() - } - - @types.ErrorCode::HttpResponseBodySize(lifted18) - } - 29 => { - let lifted19 : UInt? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(result_ptr + 20).reinterpret_as_uint(), - ) - _ => panic() - } + let result = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 20), mbt_ffi_load32((result_ptr) + 24)) - @types.ErrorCode::HttpResponseTrailerSectionSize(lifted19) - } - 30 => { - let lifted21 : String? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => { - let result20 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 20), - mbt_ffi_load32(result_ptr + 24), - ) + Option::Some(result) + } + _ => panic() + } - Option::Some(result20) - } - _ => panic() - } - - let lifted22 : UInt? = match mbt_ffi_load8_u(result_ptr + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load32(result_ptr + 32).reinterpret_as_uint(), - ) - _ => panic() - } - - @types.ErrorCode::HttpResponseTrailerSize(@types.FieldSizePayload::{ - field_name: lifted21, - field_size: lifted22, - }) - } - 31 => { - let lifted24 : String? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 20), - mbt_ffi_load32(result_ptr + 24), - ) + let lifted0 : UInt? = match mbt_ffi_load8_u((result_ptr) + 28) { + 0 => Option::None + 1 => { - Option::Some(result23) - } - _ => panic() - } + Option::Some((mbt_ffi_load16_u((result_ptr) + 30).land(0xFFFF).reinterpret_as_uint())) + } + _ => panic() + } - @types.ErrorCode::HttpResponseTransferCoding(lifted24) - } - 32 => { - let lifted26 : String? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => { - let result25 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 20), - mbt_ffi_load32(result_ptr + 24), - ) + @types.ErrorCode::DnsError(@types.DnsErrorPayload::{rcode : lifted, info_code : lifted0}) + } + 2 => { - Option::Some(result25) - } - _ => panic() - } - - @types.ErrorCode::HttpResponseContentCoding(lifted26) - } - 33 => @types.ErrorCode::HttpResponseTimeout - 34 => @types.ErrorCode::HttpUpgradeFailed - 35 => @types.ErrorCode::HttpProtocolError - 36 => @types.ErrorCode::LoopDetected - 37 => @types.ErrorCode::ConfigurationError - 38 => { - let lifted28 : String? = match mbt_ffi_load8_u(result_ptr + 16) { - 0 => Option::None - 1 => { - let result27 = mbt_ffi_ptr2str( - mbt_ffi_load32(result_ptr + 20), - mbt_ffi_load32(result_ptr + 24), - ) + @types.ErrorCode::DestinationNotFound + } + 3 => { + + @types.ErrorCode::DestinationUnavailable + } + 4 => { + + @types.ErrorCode::DestinationIpProhibited + } + 5 => { + + @types.ErrorCode::DestinationIpUnroutable + } + 6 => { + + @types.ErrorCode::ConnectionRefused + } + 7 => { - Option::Some(result27) + @types.ErrorCode::ConnectionTerminated + } + 8 => { + + @types.ErrorCode::ConnectionTimeout + } + 9 => { + + @types.ErrorCode::ConnectionReadTimeout + } + 10 => { + + @types.ErrorCode::ConnectionWriteTimeout + } + 11 => { + + @types.ErrorCode::ConnectionLimitReached + } + 12 => { + + @types.ErrorCode::TlsProtocolError + } + 13 => { + + @types.ErrorCode::TlsCertificateError + } + 14 => { + + let lifted1 : Byte? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load8_u((result_ptr) + 17)).to_byte()) + } + _ => panic() + } + + let lifted3 : String? = match mbt_ffi_load8_u((result_ptr) + 20) { + 0 => Option::None + 1 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 24), mbt_ffi_load32((result_ptr) + 28)) + + Option::Some(result2) + } + _ => panic() + } + + @types.ErrorCode::TlsAlertReceived(@types.TlsAlertReceivedPayload::{alert_id : lifted1, alert_message : lifted3}) + } + 15 => { + + @types.ErrorCode::HttpRequestDenied + } + 16 => { + + @types.ErrorCode::HttpRequestLengthRequired + } + 17 => { + + let lifted4 : UInt64? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((result_ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + @types.ErrorCode::HttpRequestBodySize(lifted4) + } + 18 => { + + @types.ErrorCode::HttpRequestMethodInvalid + } + 19 => { + + @types.ErrorCode::HttpRequestUriInvalid + } + 20 => { + + @types.ErrorCode::HttpRequestUriTooLong + } + 21 => { + + let lifted5 : UInt? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((result_ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.ErrorCode::HttpRequestHeaderSectionSize(lifted5) + } + 22 => { + + let lifted9 : @types.FieldSizePayload? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + let lifted7 : String? = match mbt_ffi_load8_u((result_ptr) + 20) { + 0 => Option::None + 1 => { + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 24), mbt_ffi_load32((result_ptr) + 28)) + + Option::Some(result6) + } + _ => panic() + } + + let lifted8 : UInt? = match mbt_ffi_load8_u((result_ptr) + 32) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((result_ptr) + 36)).reinterpret_as_uint()) + } + _ => panic() + } + + Option::Some(@types.FieldSizePayload::{field_name : lifted7, field_size : lifted8}) + } + _ => panic() + } + + @types.ErrorCode::HttpRequestHeaderSize(lifted9) + } + 23 => { + + let lifted10 : UInt? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((result_ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.ErrorCode::HttpRequestTrailerSectionSize(lifted10) + } + 24 => { + + let lifted12 : String? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + let result11 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 20), mbt_ffi_load32((result_ptr) + 24)) + + Option::Some(result11) + } + _ => panic() + } + + let lifted13 : UInt? = match mbt_ffi_load8_u((result_ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((result_ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.ErrorCode::HttpRequestTrailerSize(@types.FieldSizePayload::{field_name : lifted12, field_size : lifted13}) + } + 25 => { + + @types.ErrorCode::HttpResponseIncomplete + } + 26 => { + + let lifted14 : UInt? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((result_ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.ErrorCode::HttpResponseHeaderSectionSize(lifted14) + } + 27 => { + + let lifted16 : String? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 20), mbt_ffi_load32((result_ptr) + 24)) + + Option::Some(result15) + } + _ => panic() + } + + let lifted17 : UInt? = match mbt_ffi_load8_u((result_ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((result_ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.ErrorCode::HttpResponseHeaderSize(@types.FieldSizePayload::{field_name : lifted16, field_size : lifted17}) + } + 28 => { + + let lifted18 : UInt64? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((result_ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + @types.ErrorCode::HttpResponseBodySize(lifted18) + } + 29 => { + + let lifted19 : UInt? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((result_ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.ErrorCode::HttpResponseTrailerSectionSize(lifted19) + } + 30 => { + + let lifted21 : String? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + let result20 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 20), mbt_ffi_load32((result_ptr) + 24)) + + Option::Some(result20) + } + _ => panic() + } + + let lifted22 : UInt? = match mbt_ffi_load8_u((result_ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((result_ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + @types.ErrorCode::HttpResponseTrailerSize(@types.FieldSizePayload::{field_name : lifted21, field_size : lifted22}) + } + 31 => { + + let lifted24 : String? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 20), mbt_ffi_load32((result_ptr) + 24)) + + Option::Some(result23) + } + _ => panic() + } + + @types.ErrorCode::HttpResponseTransferCoding(lifted24) + } + 32 => { + + let lifted26 : String? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + let result25 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 20), mbt_ffi_load32((result_ptr) + 24)) + + Option::Some(result25) + } + _ => panic() + } + + @types.ErrorCode::HttpResponseContentCoding(lifted26) + } + 33 => { + + @types.ErrorCode::HttpResponseTimeout + } + 34 => { + + @types.ErrorCode::HttpUpgradeFailed + } + 35 => { + + @types.ErrorCode::HttpProtocolError + } + 36 => { + + @types.ErrorCode::LoopDetected + } + 37 => { + + @types.ErrorCode::ConfigurationError + } + 38 => { + + let lifted28 : String? = match mbt_ffi_load8_u((result_ptr) + 16) { + 0 => Option::None + 1 => { + + let result27 = mbt_ffi_ptr2str(mbt_ffi_load32((result_ptr) + 20), mbt_ffi_load32((result_ptr) + 24)) + + Option::Some(result27) + } + _ => panic() + } + + @types.ErrorCode::InternalError(lifted28) + } + _ => panic() + } + + Result::Err(lifted29) } _ => panic() - } - - @types.ErrorCode::InternalError(lifted28) - } - _ => panic() } - Result::Err(lifted29) - } - _ => panic() - } + lifted30 - lifted30 } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/http/types/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/http/types/ffi.mbt index f8fa1be1f6..f0202cdc2c 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/http/types/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/http/types/ffi.mbt @@ -1,9985 +1,10717 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropFields(resource : Int) = "wasi:http/types@0.3.0" "[resource-drop]fields" -///| fn wasmImportResourceDropRequest(resource : Int) = "wasi:http/types@0.3.0" "[resource-drop]request" -///| fn wasmImportResourceDropRequestOptions(resource : Int) = "wasi:http/types@0.3.0" "[resource-drop]request-options" -///| fn wasmImportResourceDropResponse(resource : Int) = "wasi:http/types@0.3.0" "[resource-drop]response" -///| fn wasmImportConstructorFields() -> Int = "wasi:http/types@0.3.0" "[constructor]fields" -///| -fn wasmImportStaticFieldsFromList(p0 : Int, p1 : Int, p2 : Int) = "wasi:http/types@0.3.0" "[static]fields.from-list" +fn wasmImportStaticFieldsFromList(p0 : Int, p1 : Int, p2 : Int) = "wasi:http/types@0.3.0" "[static]fields.from-list" -///| -fn wasmImportMethodFieldsGet(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:http/types@0.3.0" "[method]fields.get" +fn wasmImportMethodFieldsGet(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:http/types@0.3.0" "[method]fields.get" -///| fn wasmImportMethodFieldsHas(p0 : Int, p1 : Int, p2 : Int) -> Int = "wasi:http/types@0.3.0" "[method]fields.has" -///| -fn wasmImportMethodFieldsSet( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "wasi:http/types@0.3.0" "[method]fields.set" +fn wasmImportMethodFieldsSet(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "wasi:http/types@0.3.0" "[method]fields.set" -///| -fn wasmImportMethodFieldsDelete(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:http/types@0.3.0" "[method]fields.delete" +fn wasmImportMethodFieldsDelete(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:http/types@0.3.0" "[method]fields.delete" -///| -fn wasmImportMethodFieldsGetAndDelete(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:http/types@0.3.0" "[method]fields.get-and-delete" +fn wasmImportMethodFieldsGetAndDelete(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:http/types@0.3.0" "[method]fields.get-and-delete" -///| -fn wasmImportMethodFieldsAppend( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, -) = "wasi:http/types@0.3.0" "[method]fields.append" +fn wasmImportMethodFieldsAppend(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int) = "wasi:http/types@0.3.0" "[method]fields.append" -///| -fn wasmImportMethodFieldsCopyAll(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]fields.copy-all" +fn wasmImportMethodFieldsCopyAll(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]fields.copy-all" -///| fn wasmImportMethodFieldsClone(p0 : Int) -> Int = "wasi:http/types@0.3.0" "[method]fields.clone" -///| -fn wasmImportStaticRequestNew( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, - p5 : Int, - p6 : Int, -) = "wasi:http/types@0.3.0" "[static]request.new" - -///| -fn wasmImportWasiHttpTypes030StaticRequestNewStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][stream-read-0][static]request.new" +fn wasmImportStaticRequestNew(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int) = "wasi:http/types@0.3.0" "[static]request.new" -///| -fn wasmImportWasiHttpTypes030StaticRequestNewStream0CancelRead( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[stream-cancel-read-0][static]request.new" +fn wasmImportWasiHttpTypes030StaticRequestNewStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][stream-read-0][static]request.new" +fn wasmImportWasiHttpTypes030StaticRequestNewStream0CancelRead(handle : Int) -> Int = "wasi:http/types@0.3.0" "[stream-cancel-read-0][static]request.new" -///| fn wasmImportWasiHttpTypes030StaticRequestNewStream0DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[stream-drop-readable-0][static]request.new" -///| fn wasmImportWasiHttpTypes030StaticRequestNewStream0New() -> UInt64 = "wasi:http/types@0.3.0" "[stream-new-0][static]request.new" +fn wasmImportWasiHttpTypes030StaticRequestNewStream0Write(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][stream-write-0][static]request.new" -///| -fn wasmImportWasiHttpTypes030StaticRequestNewStream0Write( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][stream-write-0][static]request.new" - -///| -fn wasmImportWasiHttpTypes030StaticRequestNewStream0CancelWrite( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[stream-cancel-write-0][static]request.new" +fn wasmImportWasiHttpTypes030StaticRequestNewStream0CancelWrite(handle : Int) -> Int = "wasi:http/types@0.3.0" "[stream-cancel-write-0][static]request.new" -///| fn wasmImportWasiHttpTypes030StaticRequestNewStream0DropWritable(handle : Int) = "wasi:http/types@0.3.0" "[stream-drop-writable-0][static]request.new" -///| fn wasmWasiHttpTypes030StaticRequestNewStream0Malloc(length : Int) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmWasiHttpTypes030StaticRequestNewStream0Commit( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmWasiHttpTypes030StaticRequestNewStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| -fn wasmWasiHttpTypes030StaticRequestNewStream0Lower( - value : Byte, - ptr : Int, -) -> Unit { - mbt_ffi_store8(ptr + 0, value.to_int()) +fn wasmWasiHttpTypes030StaticRequestNewStream0Lower(value : Byte, ptr : Int) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).to_int()) + } -///| fn wasmWasiHttpTypes030StaticRequestNewStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmWasiHttpTypes030StaticRequestNewStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiHttpTypes030StaticRequestNewStream0StreamSource::finish_read( - self : WasmWasiHttpTypes030StaticRequestNewStream0StreamSource, +self : WasmWasiHttpTypes030StaticRequestNewStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiHttpTypes030StaticRequestNewStream0StreamSource::wait_for_read_cleanup( - self : WasmWasiHttpTypes030StaticRequestNewStream0StreamSource, +self : WasmWasiHttpTypes030StaticRequestNewStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiHttpTypes030StaticRequestNewStream0StreamSource::cancel_active_read( - self : WasmWasiHttpTypes030StaticRequestNewStream0StreamSource, +self : WasmWasiHttpTypes030StaticRequestNewStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiHttpTypes030StaticRequestNewStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiHttpTypes030StaticRequestNewStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiHttpTypes030StaticRequestNewStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiHttpTypes030StaticRequestNewStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiHttpTypes030StaticRequestNewStream0StreamSource::close( - self : WasmWasiHttpTypes030StaticRequestNewStream0StreamSource, +self : WasmWasiHttpTypes030StaticRequestNewStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiHttpTypes030StaticRequestNewStream0DropReadable(self.handle) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiHttpTypes030StaticRequestNewStream0DropReadable(self.handle) } -///| fn WasmWasiHttpTypes030StaticRequestNewStream0StreamSource::close_sync( - self : WasmWasiHttpTypes030StaticRequestNewStream0StreamSource, +self : WasmWasiHttpTypes030StaticRequestNewStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - if wasmWasiHttpTypes030StaticRequestNewStream0StreamRejectPrepared( - self.handle, - ) { - self.closed = true - return - } + if wasmWasiHttpTypes030StaticRequestNewStream0StreamRejectPrepared(self.handle) { + self.closed = true + return + } - self.closed = true - wasmImportWasiHttpTypes030StaticRequestNewStream0DropReadable(self.handle) + self.closed = true + wasmImportWasiHttpTypes030StaticRequestNewStream0DropReadable(self.handle) } -///| async fn WasmWasiHttpTypes030StaticRequestNewStream0StreamSource::read( - self : WasmWasiHttpTypes030StaticRequestNewStream0StreamSource, - count : Int, +self : WasmWasiHttpTypes030StaticRequestNewStream0StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiHttpTypes030StaticRequestNewStream0Malloc(read_count) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiHttpTypes030StaticRequestNewStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiHttpTypes030StaticRequestNewStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportWasiHttpTypes030StaticRequestNewStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticRequestNewStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticRequestNewStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) + } + let values = wasmWasiHttpTypes030StaticRequestNewStream0ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiHttpTypes030StaticRequestNewStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmWasiHttpTypes030StaticRequestNewStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmWasiHttpTypes030StaticRequestNewStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) + if end { + self.close() + } + Some(values) +} + +fn wasmWasiHttpTypes030StaticRequestNewStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmWasiHttpTypes030StaticRequestNewStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| priv struct WasmWasiHttpTypes030StaticRequestNewStream0StreamProducer { - stream : @async-core.Stream[Byte] - writer : Int + stream : @async-core.Stream[Byte] + writer : Int } -///| -let wasmWasiHttpTypes030StaticRequestNewStream0StreamProducers : Map[ - Int, - WasmWasiHttpTypes030StaticRequestNewStream0StreamProducer, -] = Map([]) +let wasmWasiHttpTypes030StaticRequestNewStream0StreamProducers : Map[Int, WasmWasiHttpTypes030StaticRequestNewStream0StreamProducer] = Map([]) -///| -fn wasmWasiHttpTypes030StaticRequestNewStream0StreamRejectPrepared( - handle : Int, -) -> Bool { - guard wasmWasiHttpTypes030StaticRequestNewStream0StreamProducers.get(handle) - is Some(prepared) else { - return false - } - wasmWasiHttpTypes030StaticRequestNewStream0StreamProducers.remove(handle) - let writer = prepared.writer - wasmImportWasiHttpTypes030StaticRequestNewStream0DropReadable(handle) - wasmImportWasiHttpTypes030StaticRequestNewStream0DropWritable(writer) - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( - () => { - prepared.stream.reject((value : Byte) => { - let ptr = wasmWasiHttpTypes030StaticRequestNewStream0Malloc(1) - wasmWasiHttpTypes030StaticRequestNewStream0Lower(value, ptr) - wasmWasiHttpTypes030StaticRequestNewStream0Reject(ptr, 0, 1) - mbt_ffi_free(ptr) - }) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - }) - true +fn wasmWasiHttpTypes030StaticRequestNewStream0StreamRejectPrepared(handle : Int) -> Bool { + guard wasmWasiHttpTypes030StaticRequestNewStream0StreamProducers.get(handle) is Some(prepared) else { + return false + } + wasmWasiHttpTypes030StaticRequestNewStream0StreamProducers.remove(handle) + let writer = prepared.writer + wasmImportWasiHttpTypes030StaticRequestNewStream0DropReadable(handle) + wasmImportWasiHttpTypes030StaticRequestNewStream0DropWritable(writer) + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + prepared.stream.reject((value : Byte) => { + let ptr = wasmWasiHttpTypes030StaticRequestNewStream0Malloc(1) + wasmWasiHttpTypes030StaticRequestNewStream0Lower(value, ptr) + wasmWasiHttpTypes030StaticRequestNewStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + }) + true } -///| -fn wasmWasiHttpTypes030StaticRequestNewStream0StreamCommit( - handle : Int, -) -> Unit { - guard wasmWasiHttpTypes030StaticRequestNewStream0StreamProducers.get(handle) - is Some(prepared) else { - return - } - wasmWasiHttpTypes030StaticRequestNewStream0StreamProducers.remove(handle) - let stream = prepared.stream - let writer = prepared.writer - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let producer = stream.take_producer() - @async-core.spawn_component_task_current(async fn() { - let writer_closed = Ref(false) - let writer_lock = @async-core.Mutex() - let close_writer = fn() -> Unit { - if !writer_closed.val { - writer_closed.val = true - wasmImportWasiHttpTypes030StaticRequestNewStream0DropWritable(writer) - } - } - let close_writer_serialized = async fn() -> Unit { - writer_lock.acquire() - defer writer_lock.release() - close_writer() - } - let cleanup_value = fn(value : Byte) -> Unit { - let ptr = wasmWasiHttpTypes030StaticRequestNewStream0Malloc(1) - wasmWasiHttpTypes030StaticRequestNewStream0Lower(value, ptr) - wasmWasiHttpTypes030StaticRequestNewStream0Reject(ptr, 0, 1) - mbt_ffi_free(ptr) - } - let sink = @async-core.Sink::from_callbacks( - (data : ArrayView[Byte]) => { - writer_lock.acquire() - defer writer_lock.release() - if writer_closed.val || data.length() == 0 { - return 0 - } - let data_len = if data.length() < 64 { data.length() } else { 64 } - let ptr = wasmWasiHttpTypes030StaticRequestNewStream0Malloc(data_len) - for i in 0.. Unit { - wasmWasiHttpTypes030StaticRequestNewStream0Commit(ptr, 0, transferred) - if transferred < data_len { - wasmWasiHttpTypes030StaticRequestNewStream0Reject( - ptr, - transferred, - data_len - transferred, +fn wasmWasiHttpTypes030StaticRequestNewStream0StreamCommit(handle : Int) -> Unit { + guard wasmWasiHttpTypes030StaticRequestNewStream0StreamProducers.get(handle) is Some(prepared) else { + return + } + wasmWasiHttpTypes030StaticRequestNewStream0StreamProducers.remove(handle) + let stream = prepared.stream + let writer = prepared.writer + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let producer = stream.take_producer() + @async-core.spawn_component_task_current(async fn() { + let writer_closed = Ref(false) + let writer_lock = @async-core.Mutex() + let close_writer = fn() -> Unit { + if !writer_closed.val { + writer_closed.val = true + wasmImportWasiHttpTypes030StaticRequestNewStream0DropWritable(writer) + } + } + let close_writer_serialized = async fn() -> Unit { + writer_lock.acquire() + defer writer_lock.release() + close_writer() + } + let cleanup_value = fn(value : Byte) -> Unit { + let ptr = wasmWasiHttpTypes030StaticRequestNewStream0Malloc(1) + wasmWasiHttpTypes030StaticRequestNewStream0Lower(value, ptr) + wasmWasiHttpTypes030StaticRequestNewStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + } + let sink = @async-core.Sink::from_callbacks( + (data : ArrayView[Byte]) => { + writer_lock.acquire() + defer writer_lock.release() + if writer_closed.val || data.length() == 0 { + return 0 + } + let data_len = if data.length() < 64 { + data.length() + } else { + 64 + } + let ptr = wasmWasiHttpTypes030StaticRequestNewStream0Malloc(data_len) + for i in 0.. Unit { + wasmWasiHttpTypes030StaticRequestNewStream0Commit(ptr, 0, transferred) + if transferred < data_len { + wasmWasiHttpTypes030StaticRequestNewStream0Reject( + ptr, + transferred, + data_len - transferred, + ) + } + mbt_ffi_free(ptr) + } + let mut total = 0 + let mut dropped = false + while total < data_len { + let (progress, end) = @async-core.suspend_for_stream_write( + writer, + wasmImportWasiHttpTypes030StaticRequestNewStream0Write( + writer, + ptr + total * 1, + data_len - total, + ), + ) catch { + _ => { + total = total + @async-core.cancel_stream_write( + writer, + () => wasmImportWasiHttpTypes030StaticRequestNewStream0CancelWrite(writer), + ) + settle_staging(total) + close_writer() + return data_len + } + } + total = total + progress + if end { + dropped = true + break + } + } + settle_staging(total) + if dropped { + close_writer() + } + // The canonical writer accepted `total`; generated cleanup + // consumed the rest of this staging window. + data_len + }, + () => close_writer_serialized(), + () => !writer_closed.val, + Some(cleanup_value), ) - } - mbt_ffi_free(ptr) - } - let mut total = 0 - let mut dropped = false - while total < data_len { - let (progress, end) = @async-core.suspend_for_stream_write( - writer, - wasmImportWasiHttpTypes030StaticRequestNewStream0Write( - writer, - ptr + total * 1, - data_len - total, - ), - ) catch { - _ => { - total = total + - @async-core.cancel_stream_write(writer, () => { - wasmImportWasiHttpTypes030StaticRequestNewStream0CancelWrite( - writer, - ) - }) - settle_staging(total) - close_writer() - return data_len - } - } - total = total + progress - if end { - dropped = true - break - } - } - settle_staging(total) - if dropped { - close_writer() - } - // The canonical writer accepted `total`; generated cleanup - // consumed the rest of this staging window. - data_len - }, - () => close_writer_serialized(), - () => !writer_closed.val, - Some(cleanup_value), - ) - let relay_source = producer is None - let run_producer = async fn() -> Unit { - match producer { - Some(producer) => { - producer(sink) - sink.close() - } - None => - for ;; { - match stream.read(64) { - Some(data) => - if !sink.write_all(data[:]) { - stream.reject(cleanup_value) - return - } - None => { - sink.close() - return - } - } - } - } - } - run_producer() catch { - _ => - if relay_source { - @async-core.protect_from_cancel( - () => stream.reject(cleanup_value), + let relay_source = producer is None + let run_producer = async fn() -> Unit { + match producer { + Some(producer) => { + producer(sink) + sink.close() + } + None => + for ;; { + match stream.read(64) { + Some(data) => + if !sink.write_all(data[:]) { + stream.reject(cleanup_value) + return + } + None => { + sink.close() + return + } + } + } + } + } + run_producer() catch { + _ => + if relay_source { + @async-core.protect_from_cancel( + () => stream.reject(cleanup_value), + resume_on_cancel=true, + ) catch { + _ => () + } + } + } + // A retained Sink may still own an in-flight canonical write after its + // producer returns. Do not drop the writable endpoint until that write + // has reached a terminal event and released its staging buffer. + @async-core.protect_from_cancel( + () => close_writer_serialized(), resume_on_cancel=true, - ) catch { - _ => () - } - } - } - // A retained Sink may still own an in-flight canonical write after its - // producer returns. Do not drop the writable endpoint until that write - // has reached a terminal event and released its staging buffer. - @async-core.protect_from_cancel( - () => close_writer_serialized(), - resume_on_cancel=true, - ) - }) + ) + }) } -///| -fn wasmWasiHttpTypes030StaticRequestNewStream0StreamLower( - stream : @async-core.Stream[Byte], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let pair = wasmImportWasiHttpTypes030StaticRequestNewStream0New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmWasiHttpTypes030StaticRequestNewStream0StreamProducers.set(reader, { - stream, - writer, - }) - reader +fn wasmWasiHttpTypes030StaticRequestNewStream0StreamLower(stream : @async-core.Stream[Byte]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let pair = wasmImportWasiHttpTypes030StaticRequestNewStream0New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmWasiHttpTypes030StaticRequestNewStream0StreamProducers.set(reader, { stream, writer }) + reader } -///| -fn wasmImportWasiHttpTypes030StaticRequestNewFuture1Read( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-1][static]request.new" - -///| -fn wasmImportWasiHttpTypes030StaticRequestNewFuture1CancelRead( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-1][static]request.new" +fn wasmImportWasiHttpTypes030StaticRequestNewFuture1Read(handle : Int, buffer_ptr : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-1][static]request.new" +fn wasmImportWasiHttpTypes030StaticRequestNewFuture1CancelRead(handle : Int) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-1][static]request.new" -///| fn wasmImportWasiHttpTypes030StaticRequestNewFuture1DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-readable-1][static]request.new" -///| fn wasmImportWasiHttpTypes030StaticRequestNewFuture1New() -> UInt64 = "wasi:http/types@0.3.0" "[future-new-1][static]request.new" +fn wasmImportWasiHttpTypes030StaticRequestNewFuture1Write(handle : Int, buffer_ptr : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-write-1][static]request.new" -///| -fn wasmImportWasiHttpTypes030StaticRequestNewFuture1Write( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-write-1][static]request.new" - -///| fn wasmImportWasiHttpTypes030StaticRequestNewFuture1DropWritable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-writable-1][static]request.new" -///| fn wasmWasiHttpTypes030StaticRequestNewFuture1Malloc(length : Int) -> Int { - let ptr = mbt_ffi_malloc(40 * length) - ptr + let ptr = mbt_ffi_malloc(40 * length) + ptr } -///| fn wasmWasiHttpTypes030StaticRequestNewFuture1Commit( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 40 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => () - _ => panic() - } - 1 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 40 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => () + _ => panic() + } + + } + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } + + } _ => panic() - } - _ => panic() - } - 23 => () - 24 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 31 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - } + + } + } -///| fn wasmWasiHttpTypes030StaticRequestNewFuture1Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 40 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => Fields::Fields(mbt_ffi_load32(elem_ptr + 12)).drop() - _ => panic() - } - 1 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 40 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + Fields::Fields(mbt_ffi_load32((elem_ptr) + 12)).drop() + + } + _ => panic() + } + + } + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } + + } _ => panic() - } - _ => panic() - } - 23 => () - 24 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() } - 31 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - } -} -///| -fn wasmWasiHttpTypes030StaticRequestNewFuture1Lift( - ptr : Int, -) -> Result[Fields?, ErrorCode] { - let lifted31 = match mbt_ffi_load8_u(ptr + 0) { - 0 => { - let lifted : Fields? = match mbt_ffi_load8_u(ptr + 8) { - 0 => Option::None - 1 => Option::Some(Fields::Fields(mbt_ffi_load32(ptr + 12))) - _ => panic() - } - - Result::Ok(lifted) - } - 1 => { - let lifted30 = match mbt_ffi_load8_u(ptr + 8) { - 0 => ErrorCode::DnsTimeout - 1 => { - let lifted0 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + } - Option::Some(result) - } - _ => panic() - } - - let lifted1 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load16_u(ptr + 30).land(0xFFFF).reinterpret_as_uint(), - ) - _ => panic() - } - - ErrorCode::DnsError(DnsErrorPayload::{ - rcode: lifted0, - info_code: lifted1, - }) - } - 2 => ErrorCode::DestinationNotFound - 3 => ErrorCode::DestinationUnavailable - 4 => ErrorCode::DestinationIpProhibited - 5 => ErrorCode::DestinationIpUnroutable - 6 => ErrorCode::ConnectionRefused - 7 => ErrorCode::ConnectionTerminated - 8 => ErrorCode::ConnectionTimeout - 9 => ErrorCode::ConnectionReadTimeout - 10 => ErrorCode::ConnectionWriteTimeout - 11 => ErrorCode::ConnectionLimitReached - 12 => ErrorCode::TlsProtocolError - 13 => ErrorCode::TlsCertificateError - 14 => { - let lifted2 : Byte? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load8_u(ptr + 17).to_byte()) - _ => panic() - } +} - let lifted4 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) +fn wasmWasiHttpTypes030StaticRequestNewFuture1Lift(ptr : Int) -> Result[Fields?, ErrorCode] { - Option::Some(result3) - } - _ => panic() - } - - ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{ - alert_id: lifted2, - alert_message: lifted4, - }) - } - 15 => ErrorCode::HttpRequestDenied - 16 => ErrorCode::HttpRequestLengthRequired - 17 => { - let lifted5 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpRequestBodySize(lifted5) - } - 18 => ErrorCode::HttpRequestMethodInvalid - 19 => ErrorCode::HttpRequestUriInvalid - 20 => ErrorCode::HttpRequestUriTooLong - 21 => { - let lifted6 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + let lifted31 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { - ErrorCode::HttpRequestHeaderSectionSize(lifted6) - } - 22 => { - let lifted10 : FieldSizePayload? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let lifted8 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result7 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) - - Option::Some(result7) - } - _ => panic() - } - - let lifted9 : UInt? = match mbt_ffi_load8_u(ptr + 32) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(ptr + 36).reinterpret_as_uint()) - _ => panic() - } - - Option::Some(FieldSizePayload::{ - field_name: lifted8, - field_size: lifted9, - }) - } - _ => panic() - } - - ErrorCode::HttpRequestHeaderSize(lifted10) - } - 23 => { - let lifted11 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + let lifted : Fields? = match mbt_ffi_load8_u((ptr) + 8) { + 0 => Option::None + 1 => { - ErrorCode::HttpRequestTrailerSectionSize(lifted11) - } - 24 => { - let lifted13 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result12 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + Option::Some(Fields::Fields(mbt_ffi_load32((ptr) + 12))) + } + _ => panic() + } - Option::Some(result12) + Result::Ok(lifted) } - _ => panic() - } - - let lifted14 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{ - field_name: lifted13, - field_size: lifted14, - }) - } - 25 => ErrorCode::HttpResponseIncomplete - 26 => { - let lifted15 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseHeaderSectionSize(lifted15) - } - 27 => { - let lifted17 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None 1 => { - let result16 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result16) - } - _ => panic() - } - - let lifted18 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{ - field_name: lifted17, - field_size: lifted18, - }) - } - 28 => { - let lifted19 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpResponseBodySize(lifted19) - } - 29 => { - let lifted20 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - ErrorCode::HttpResponseTrailerSectionSize(lifted20) - } - 30 => { - let lifted22 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + let lifted30 = match (mbt_ffi_load8_u((ptr) + 8)) { + 0 => { - Option::Some(result21) - } - _ => panic() - } + ErrorCode::DnsTimeout + } + 1 => { - let lifted23 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{ - field_name: lifted22, - field_size: lifted23, - }) - } - 31 => { - let lifted25 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result24 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + let lifted0 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - Option::Some(result24) - } - _ => panic() - } + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - ErrorCode::HttpResponseTransferCoding(lifted25) - } - 32 => { - let lifted27 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result26 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + Option::Some(result) + } + _ => panic() + } - Option::Some(result26) - } - _ => panic() - } - - ErrorCode::HttpResponseContentCoding(lifted27) - } - 33 => ErrorCode::HttpResponseTimeout - 34 => ErrorCode::HttpUpgradeFailed - 35 => ErrorCode::HttpProtocolError - 36 => ErrorCode::LoopDetected - 37 => ErrorCode::ConfigurationError - 38 => { - let lifted29 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result28 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + let lifted1 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { - Option::Some(result28) - } - _ => panic() - } + Option::Some((mbt_ffi_load16_u((ptr) + 30).land(0xFFFF).reinterpret_as_uint())) + } + _ => panic() + } - ErrorCode::InternalError(lifted29) - } - _ => panic() - } + ErrorCode::DnsError(DnsErrorPayload::{rcode : lifted0, info_code : lifted1}) + } + 2 => { - Result::Err(lifted30) - } - _ => panic() - } + ErrorCode::DestinationNotFound + } + 3 => { - lifted31 -} + ErrorCode::DestinationUnavailable + } + 4 => { -///| -fn wasmWasiHttpTypes030StaticRequestNewFuture1Lower( - value : Result[Fields?, ErrorCode], - ptr : Int, -) -> Unit { - match value { - Ok(payload) => { - mbt_ffi_store8(ptr + 0, 0) + ErrorCode::DestinationIpProhibited + } + 5 => { - match payload { - None => { - mbt_ffi_store8(ptr + 8, 0) + ErrorCode::DestinationIpUnroutable + } + 6 => { - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) + ErrorCode::ConnectionRefused + } + 7 => { - let Fields(handle) = payload1 - mbt_ffi_store32(ptr + 12, handle) + ErrorCode::ConnectionTerminated + } + 8 => { - () - } - } + ErrorCode::ConnectionTimeout + } + 9 => { - () - } - Err(payload2) => { - mbt_ffi_store8(ptr + 0, 1) + ErrorCode::ConnectionReadTimeout + } + 10 => { - match payload2 { - DnsTimeout => { - mbt_ffi_store8(ptr + 8, 0) + ErrorCode::ConnectionWriteTimeout + } + 11 => { - () - } - DnsError(payload4) => { - mbt_ffi_store8(ptr + 8, 1) + ErrorCode::ConnectionLimitReached + } + 12 => { - match payload4.rcode { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::TlsProtocolError + } + 13 => { - () - } - Some(payload6) => { - mbt_ffi_store8(ptr + 16, 1) + ErrorCode::TlsCertificateError + } + 14 => { - let ptr7 = mbt_ffi_str2ptr(payload6) - mbt_ffi_store32(ptr + 24, payload6.length()) - mbt_ffi_store32(ptr + 20, ptr7) + let lifted2 : Byte? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - } + Option::Some((mbt_ffi_load8_u((ptr) + 17)).to_byte()) + } + _ => panic() + } - match payload4.info_code { - None => { - mbt_ffi_store8(ptr + 28, 0) + let lifted4 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { - () - } - Some(payload9) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store16(ptr + 30, payload9.reinterpret_as_int()) + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) - () - } - } - - () - } - DestinationNotFound => { - mbt_ffi_store8(ptr + 8, 2) - - () - } - DestinationUnavailable => { - mbt_ffi_store8(ptr + 8, 3) - - () - } - DestinationIpProhibited => { - mbt_ffi_store8(ptr + 8, 4) - - () - } - DestinationIpUnroutable => { - mbt_ffi_store8(ptr + 8, 5) - - () - } - ConnectionRefused => { - mbt_ffi_store8(ptr + 8, 6) - - () - } - ConnectionTerminated => { - mbt_ffi_store8(ptr + 8, 7) - - () - } - ConnectionTimeout => { - mbt_ffi_store8(ptr + 8, 8) - - () - } - ConnectionReadTimeout => { - mbt_ffi_store8(ptr + 8, 9) - - () - } - ConnectionWriteTimeout => { - mbt_ffi_store8(ptr + 8, 10) - - () - } - ConnectionLimitReached => { - mbt_ffi_store8(ptr + 8, 11) - - () - } - TlsProtocolError => { - mbt_ffi_store8(ptr + 8, 12) - - () - } - TlsCertificateError => { - mbt_ffi_store8(ptr + 8, 13) - - () - } - TlsAlertReceived(payload22) => { - mbt_ffi_store8(ptr + 8, 14) - - match payload22.alert_id { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload24) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store8(ptr + 17, payload24.to_int()) + Option::Some(result3) + } + _ => panic() + } - () - } - } + ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{alert_id : lifted2, alert_message : lifted4}) + } + 15 => { - match payload22.alert_message { - None => { - mbt_ffi_store8(ptr + 20, 0) + ErrorCode::HttpRequestDenied + } + 16 => { - () - } - Some(payload26) => { - mbt_ffi_store8(ptr + 20, 1) + ErrorCode::HttpRequestLengthRequired + } + 17 => { - let ptr27 = mbt_ffi_str2ptr(payload26) - mbt_ffi_store32(ptr + 28, payload26.length()) - mbt_ffi_store32(ptr + 24, ptr27) + let lifted5 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpRequestBodySize(lifted5) + } + 18 => { + + ErrorCode::HttpRequestMethodInvalid + } + 19 => { + + ErrorCode::HttpRequestUriInvalid + } + 20 => { + + ErrorCode::HttpRequestUriTooLong + } + 21 => { + + let lifted6 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSectionSize(lifted6) + } + 22 => { + + let lifted10 : FieldSizePayload? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let lifted8 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { + + let result7 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) + + Option::Some(result7) + } + _ => panic() + } + + let lifted9 : UInt? = match mbt_ffi_load8_u((ptr) + 32) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 36)).reinterpret_as_uint()) + } + _ => panic() + } + + Option::Some(FieldSizePayload::{field_name : lifted8, field_size : lifted9}) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSize(lifted10) + } + 23 => { + + let lifted11 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSectionSize(lifted11) + } + 24 => { + + let lifted13 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result12 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result12) + } + _ => panic() + } + + let lifted14 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{field_name : lifted13, field_size : lifted14}) + } + 25 => { + + ErrorCode::HttpResponseIncomplete + } + 26 => { + + let lifted15 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - } + ErrorCode::HttpResponseHeaderSectionSize(lifted15) + } + 27 => { - () - } - HttpRequestDenied => { - mbt_ffi_store8(ptr + 8, 15) + let lifted17 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - HttpRequestLengthRequired => { - mbt_ffi_store8(ptr + 8, 16) + let result16 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result16) + } + _ => panic() + } + + let lifted18 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - HttpRequestBodySize(payload30) => { - mbt_ffi_store8(ptr + 8, 17) + ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{field_name : lifted17, field_size : lifted18}) + } + 28 => { + + let lifted19 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - match payload30 { - None => { - mbt_ffi_store8(ptr + 16, 0) + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpResponseBodySize(lifted19) + } + 29 => { - () - } - Some(payload32) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store64(ptr + 24, payload32.reinterpret_as_int64()) + let lifted20 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - } + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - HttpRequestMethodInvalid => { - mbt_ffi_store8(ptr + 8, 18) + ErrorCode::HttpResponseTrailerSectionSize(lifted20) + } + 30 => { - () - } - HttpRequestUriInvalid => { - mbt_ffi_store8(ptr + 8, 19) + let lifted22 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - HttpRequestUriTooLong => { - mbt_ffi_store8(ptr + 8, 20) + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - HttpRequestHeaderSectionSize(payload36) => { - mbt_ffi_store8(ptr + 8, 21) + Option::Some(result21) + } + _ => panic() + } - match payload36 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let lifted23 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { - () - } - Some(payload38) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload38.reinterpret_as_int()) + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - } + ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{field_name : lifted22, field_size : lifted23}) + } + 31 => { - () - } - HttpRequestHeaderSize(payload39) => { - mbt_ffi_store8(ptr + 8, 22) + let lifted25 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - match payload39 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let result24 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - Some(payload41) => { - mbt_ffi_store8(ptr + 16, 1) + Option::Some(result24) + } + _ => panic() + } - match payload41.field_name { - None => { - mbt_ffi_store8(ptr + 20, 0) + ErrorCode::HttpResponseTransferCoding(lifted25) + } + 32 => { - () - } - Some(payload43) => { - mbt_ffi_store8(ptr + 20, 1) + let lifted27 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - let ptr44 = mbt_ffi_str2ptr(payload43) - mbt_ffi_store32(ptr + 28, payload43.length()) - mbt_ffi_store32(ptr + 24, ptr44) + let result26 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - } + Option::Some(result26) + } + _ => panic() + } - match payload41.field_size { - None => { - mbt_ffi_store8(ptr + 32, 0) + ErrorCode::HttpResponseContentCoding(lifted27) + } + 33 => { - () - } - Some(payload46) => { - mbt_ffi_store8(ptr + 32, 1) - mbt_ffi_store32(ptr + 36, payload46.reinterpret_as_int()) + ErrorCode::HttpResponseTimeout + } + 34 => { - () - } - } + ErrorCode::HttpUpgradeFailed + } + 35 => { - () - } - } + ErrorCode::HttpProtocolError + } + 36 => { - () - } - HttpRequestTrailerSectionSize(payload47) => { - mbt_ffi_store8(ptr + 8, 23) + ErrorCode::LoopDetected + } + 37 => { - match payload47 { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::ConfigurationError + } + 38 => { - () - } - Some(payload49) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload49.reinterpret_as_int()) + let lifted29 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - } + let result28 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - HttpRequestTrailerSize(payload50) => { - mbt_ffi_store8(ptr + 8, 24) + Option::Some(result28) + } + _ => panic() + } - match payload50.field_name { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::InternalError(lifted29) + } + _ => panic() + } - () + Result::Err(lifted30) } - Some(payload52) => { - mbt_ffi_store8(ptr + 16, 1) - - let ptr53 = mbt_ffi_str2ptr(payload52) - mbt_ffi_store32(ptr + 24, payload52.length()) - mbt_ffi_store32(ptr + 20, ptr53) + _ => panic() + } - () - } - } + lifted31 +} - match payload50.field_size { - None => { - mbt_ffi_store8(ptr + 28, 0) +fn wasmWasiHttpTypes030StaticRequestNewFuture1Lower(value : Result[Fields?, ErrorCode], ptr : Int) -> Unit { - () - } - Some(payload55) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store32(ptr + 32, payload55.reinterpret_as_int()) + match value { + Ok(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) - () - } - } + match (payload) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - () - } - HttpResponseIncomplete => { - mbt_ffi_store8(ptr + 8, 25) + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) - () - } - HttpResponseHeaderSectionSize(payload57) => { - mbt_ffi_store8(ptr + 8, 26) + let Fields(handle) = payload1 + mbt_ffi_store32((ptr) + 12, handle) - match payload57 { - None => { - mbt_ffi_store8(ptr + 16, 0) + () + } + } - () + () } - Some(payload59) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload59.reinterpret_as_int()) + Err(payload2) => { + mbt_ffi_store8((ptr) + 0, (1)) + + match payload2 { + DnsTimeout => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + DnsError(payload4) => { + mbt_ffi_store8((ptr) + 8, (1)) + + match ((payload4).rcode) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload6) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr7 = mbt_ffi_str2ptr(payload6) + mbt_ffi_store32((ptr) + 24, payload6.length()) + mbt_ffi_store32((ptr) + 20, ptr7) + + () + } + } + + match ((payload4).info_code) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload9) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store16((ptr) + 30, (payload9).reinterpret_as_int()) + + () + } + } + + () + } + DestinationNotFound => { + mbt_ffi_store8((ptr) + 8, (2)) + + () + } + DestinationUnavailable => { + mbt_ffi_store8((ptr) + 8, (3)) + + () + } + DestinationIpProhibited => { + mbt_ffi_store8((ptr) + 8, (4)) + + () + } + DestinationIpUnroutable => { + mbt_ffi_store8((ptr) + 8, (5)) + + () + } + ConnectionRefused => { + mbt_ffi_store8((ptr) + 8, (6)) + + () + } + ConnectionTerminated => { + mbt_ffi_store8((ptr) + 8, (7)) + + () + } + ConnectionTimeout => { + mbt_ffi_store8((ptr) + 8, (8)) + + () + } + ConnectionReadTimeout => { + mbt_ffi_store8((ptr) + 8, (9)) + + () + } + ConnectionWriteTimeout => { + mbt_ffi_store8((ptr) + 8, (10)) + + () + } + ConnectionLimitReached => { + mbt_ffi_store8((ptr) + 8, (11)) + + () + } + TlsProtocolError => { + mbt_ffi_store8((ptr) + 8, (12)) + + () + } + TlsCertificateError => { + mbt_ffi_store8((ptr) + 8, (13)) + + () + } + TlsAlertReceived(payload22) => { + mbt_ffi_store8((ptr) + 8, (14)) + + match ((payload22).alert_id) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload24) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store8((ptr) + 17, (payload24).to_int()) + + () + } + } + + match ((payload22).alert_message) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) + + () + } + Some(payload26) => { + mbt_ffi_store8((ptr) + 20, (1)) + + let ptr27 = mbt_ffi_str2ptr(payload26) + mbt_ffi_store32((ptr) + 28, payload26.length()) + mbt_ffi_store32((ptr) + 24, ptr27) + + () + } + } + + () + } + HttpRequestDenied => { + mbt_ffi_store8((ptr) + 8, (15)) + + () + } + HttpRequestLengthRequired => { + mbt_ffi_store8((ptr) + 8, (16)) + + () + } + HttpRequestBodySize(payload30) => { + mbt_ffi_store8((ptr) + 8, (17)) + + match (payload30) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload32) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store64((ptr) + 24, (payload32).reinterpret_as_int64()) + + () + } + } + + () + } + HttpRequestMethodInvalid => { + mbt_ffi_store8((ptr) + 8, (18)) + + () + } + HttpRequestUriInvalid => { + mbt_ffi_store8((ptr) + 8, (19)) + + () + } + HttpRequestUriTooLong => { + mbt_ffi_store8((ptr) + 8, (20)) + + () + } + HttpRequestHeaderSectionSize(payload36) => { + mbt_ffi_store8((ptr) + 8, (21)) + + match (payload36) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload38) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload38).reinterpret_as_int()) + + () + } + } + + () + } + HttpRequestHeaderSize(payload39) => { + mbt_ffi_store8((ptr) + 8, (22)) + + match (payload39) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload41) => { + mbt_ffi_store8((ptr) + 16, (1)) + + match ((payload41).field_name) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) + + () + } + Some(payload43) => { + mbt_ffi_store8((ptr) + 20, (1)) + + let ptr44 = mbt_ffi_str2ptr(payload43) + mbt_ffi_store32((ptr) + 28, payload43.length()) + mbt_ffi_store32((ptr) + 24, ptr44) + + () + } + } + + match ((payload41).field_size) { + None => { + mbt_ffi_store8((ptr) + 32, (0)) + + () + } + Some(payload46) => { + mbt_ffi_store8((ptr) + 32, (1)) + mbt_ffi_store32((ptr) + 36, (payload46).reinterpret_as_int()) + + () + } + } + + () + } + } + + () + } + HttpRequestTrailerSectionSize(payload47) => { + mbt_ffi_store8((ptr) + 8, (23)) + + match (payload47) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload49) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload49).reinterpret_as_int()) + + () + } + } + + () + } + HttpRequestTrailerSize(payload50) => { + mbt_ffi_store8((ptr) + 8, (24)) + + match ((payload50).field_name) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload52) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr53 = mbt_ffi_str2ptr(payload52) + mbt_ffi_store32((ptr) + 24, payload52.length()) + mbt_ffi_store32((ptr) + 20, ptr53) + + () + } + } + + match ((payload50).field_size) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload55) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store32((ptr) + 32, (payload55).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseIncomplete => { + mbt_ffi_store8((ptr) + 8, (25)) + + () + } + HttpResponseHeaderSectionSize(payload57) => { + mbt_ffi_store8((ptr) + 8, (26)) + + match (payload57) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload59) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload59).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseHeaderSize(payload60) => { + mbt_ffi_store8((ptr) + 8, (27)) + + match ((payload60).field_name) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload62) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr63 = mbt_ffi_str2ptr(payload62) + mbt_ffi_store32((ptr) + 24, payload62.length()) + mbt_ffi_store32((ptr) + 20, ptr63) + + () + } + } + + match ((payload60).field_size) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload65) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store32((ptr) + 32, (payload65).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseBodySize(payload66) => { + mbt_ffi_store8((ptr) + 8, (28)) + + match (payload66) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload68) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store64((ptr) + 24, (payload68).reinterpret_as_int64()) + + () + } + } + + () + } + HttpResponseTrailerSectionSize(payload69) => { + mbt_ffi_store8((ptr) + 8, (29)) + + match (payload69) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload71) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload71).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseTrailerSize(payload72) => { + mbt_ffi_store8((ptr) + 8, (30)) + + match ((payload72).field_name) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload74) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr75 = mbt_ffi_str2ptr(payload74) + mbt_ffi_store32((ptr) + 24, payload74.length()) + mbt_ffi_store32((ptr) + 20, ptr75) + + () + } + } + + match ((payload72).field_size) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload77) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store32((ptr) + 32, (payload77).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseTransferCoding(payload78) => { + mbt_ffi_store8((ptr) + 8, (31)) + + match (payload78) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload80) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr81 = mbt_ffi_str2ptr(payload80) + mbt_ffi_store32((ptr) + 24, payload80.length()) + mbt_ffi_store32((ptr) + 20, ptr81) + + () + } + } + + () + } + HttpResponseContentCoding(payload82) => { + mbt_ffi_store8((ptr) + 8, (32)) + + match (payload82) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload84) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr85 = mbt_ffi_str2ptr(payload84) + mbt_ffi_store32((ptr) + 24, payload84.length()) + mbt_ffi_store32((ptr) + 20, ptr85) + + () + } + } + + () + } + HttpResponseTimeout => { + mbt_ffi_store8((ptr) + 8, (33)) + + () + } + HttpUpgradeFailed => { + mbt_ffi_store8((ptr) + 8, (34)) + + () + } + HttpProtocolError => { + mbt_ffi_store8((ptr) + 8, (35)) + + () + } + LoopDetected => { + mbt_ffi_store8((ptr) + 8, (36)) + + () + } + ConfigurationError => { + mbt_ffi_store8((ptr) + 8, (37)) + + () + } + InternalError(payload91) => { + mbt_ffi_store8((ptr) + 8, (38)) + + match (payload91) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload93) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr94 = mbt_ffi_str2ptr(payload93) + mbt_ffi_store32((ptr) + 24, payload93.length()) + mbt_ffi_store32((ptr) + 20, ptr94) + + () + } + } + + () + } + } - () + () } - } - - () - } - HttpResponseHeaderSize(payload60) => { - mbt_ffi_store8(ptr + 8, 27) + } - match payload60.field_name { - None => { - mbt_ffi_store8(ptr + 16, 0) +} - () - } - Some(payload62) => { - mbt_ffi_store8(ptr + 16, 1) +priv struct WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource { + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar +} - let ptr63 = mbt_ffi_str2ptr(payload62) - mbt_ffi_store32(ptr + 24, payload62.length()) - mbt_ffi_store32(ptr + 20, ptr63) +fn WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::finish_read( +self : WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource, +) -> Unit { + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. +} - () +async fn WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::wait_for_read_cleanup( +self : WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource, +) -> Unit noraise { + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() } - } - - match payload60.field_size { - None => { - mbt_ffi_store8(ptr + 28, 0) + }, + resume_on_cancel=true, + ) catch { + _ => () + } +} - () - } - Some(payload65) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store32(ptr + 32, payload65.reinterpret_as_int()) +async fn WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::cancel_active_read( +self : WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource, +) -> Unit noraise { + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let completed = Ref(false) + @async-core.protect_from_cancel( + () => { + completed.val = @async-core.cancel_future_read( + self.read_task, + self.handle, + () => wasmImportWasiHttpTypes030StaticRequestNewFuture1CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + if completed.val && self.read_buffer != 0 { + wasmWasiHttpTypes030StaticRequestNewFuture1Reject(self.read_buffer, 0, 1) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() +} - () - } - } +async fn WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::close( +self : WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource, +) -> Unit noraise { + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiHttpTypes030StaticRequestNewFuture1DropReadable(self.handle) +} - () - } - HttpResponseBodySize(payload66) => { - mbt_ffi_store8(ptr + 8, 28) +fn WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::close_sync( +self : WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource, +) -> Unit { + if self.closed || self.reading { + return + } - match payload66 { - None => { - mbt_ffi_store8(ptr + 16, 0) + if wasmWasiHttpTypes030StaticRequestNewFuture1FutureRejectPrepared(self.handle) { + self.closed = true + return + } - () - } - Some(payload68) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store64(ptr + 24, payload68.reinterpret_as_int64()) + self.closed = true + wasmImportWasiHttpTypes030StaticRequestNewFuture1DropReadable(self.handle) +} - () - } - } +async fn WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::read( +self : WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource, +) -> Result[Fields?, ErrorCode] { + if self.closed { + raise @async-core.FutureReadError::Dropped + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + let ptr = wasmWasiHttpTypes030StaticRequestNewFuture1Malloc(1) + defer { mbt_ffi_free(ptr) } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + @async-core.suspend_for_future_read( + self.handle, + wasmImportWasiHttpTypes030StaticRequestNewFuture1Read(self.handle, ptr), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticRequestNewFuture1DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + let value = wasmWasiHttpTypes030StaticRequestNewFuture1Lift(ptr) + self.finish_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticRequestNewFuture1DropReadable(self.handle) + } + value +} + +fn wasmWasiHttpTypes030StaticRequestNewFuture1FutureLift(handle : Int) -> @async-core.Future[Result[Fields?, ErrorCode]] { + let source = WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Future::from_source( + () => source.read(), + () => source.close(), + () => source.close_sync(), + ) +} - () - } - HttpResponseTrailerSectionSize(payload69) => { - mbt_ffi_store8(ptr + 8, 29) +priv struct WasmWasiHttpTypes030StaticRequestNewFuture1FutureProducer { + future : @async-core.Future[Result[Fields?, ErrorCode]] + writer : Int +} - match payload69 { - None => { - mbt_ffi_store8(ptr + 16, 0) +let wasmWasiHttpTypes030StaticRequestNewFuture1FutureProducers : Map[Int, WasmWasiHttpTypes030StaticRequestNewFuture1FutureProducer] = Map([]) - () +fn wasmWasiHttpTypes030StaticRequestNewFuture1FutureRejectPrepared(handle : Int) -> Bool { + guard wasmWasiHttpTypes030StaticRequestNewFuture1FutureProducers.get(handle) is Some(producer) else { + return false + } + wasmWasiHttpTypes030StaticRequestNewFuture1FutureProducers.remove(handle) + let writer = producer.writer + wasmImportWasiHttpTypes030StaticRequestNewFuture1DropReadable(handle) + @async-core.spawn_component_task_current(async fn() { + defer wasmImportWasiHttpTypes030StaticRequestNewFuture1DropWritable(writer) + @async-core.protect_from_cancel( + () => { + producer.future.reject((value : Result[Fields?, ErrorCode]) => { + let ptr = wasmWasiHttpTypes030StaticRequestNewFuture1Malloc(1) + wasmWasiHttpTypes030StaticRequestNewFuture1Lower(value, ptr) + wasmWasiHttpTypes030StaticRequestNewFuture1Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + let ptr = wasmWasiHttpTypes030StaticRequestNewFuture1Malloc(1) + defer { mbt_ffi_free(ptr) } + let terminal : Ref[Bool?] = { val: None } + while terminal.val is None { + terminal.val = @async-core.suspend_for_future_write_terminal( + writer, + wasmImportWasiHttpTypes030StaticRequestNewFuture1Write(writer, ptr), + ) + } + guard terminal.val is Some(transferred) + if transferred { + abort("rejected component future unexpectedly transferred a value") + } + }, + resume_on_cancel=true, + ) catch { + _ => abort("failed to reject component future producer") } - Some(payload71) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload71.reinterpret_as_int()) + }) + true +} - () +fn wasmWasiHttpTypes030StaticRequestNewFuture1FutureCommit(handle : Int) -> Unit { + guard wasmWasiHttpTypes030StaticRequestNewFuture1FutureProducers.get(handle) is Some(producer) else { + return + } + wasmWasiHttpTypes030StaticRequestNewFuture1FutureProducers.remove(handle) + let writer = producer.writer + if !@async-core.has_component_task_scope() { + abort("component future producer requires an async task scope") + } + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + let value = producer.future.get() + let ptr = wasmWasiHttpTypes030StaticRequestNewFuture1Malloc(1) + wasmWasiHttpTypes030StaticRequestNewFuture1Lower(value, ptr) + let terminal : Ref[Bool?] = { val: None } + while terminal.val is None { + terminal.val = @async-core.suspend_for_future_write_terminal( + writer, + wasmImportWasiHttpTypes030StaticRequestNewFuture1Write(writer, ptr), + ) + } + guard terminal.val is Some(transferred) + if transferred { + wasmWasiHttpTypes030StaticRequestNewFuture1Commit(ptr, 0, 1) + } else { + wasmWasiHttpTypes030StaticRequestNewFuture1Reject(ptr, 0, 1) + } + mbt_ffi_free(ptr) + wasmImportWasiHttpTypes030StaticRequestNewFuture1DropWritable(writer) + }, + resume_on_cancel=true, + ) catch { + _ => abort("component future producer ended without a value") } - } + }) +} - () - } - HttpResponseTrailerSize(payload72) => { - mbt_ffi_store8(ptr + 8, 30) +fn wasmWasiHttpTypes030StaticRequestNewFuture1FutureLower(future : @async-core.Future[Result[Fields?, ErrorCode]]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component future producer requires an async task scope") + } + let pair = wasmImportWasiHttpTypes030StaticRequestNewFuture1New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmWasiHttpTypes030StaticRequestNewFuture1FutureProducers.set(reader, { future, writer }) + reader +} - match payload72.field_name { - None => { - mbt_ffi_store8(ptr + 16, 0) +fn wasmImportWasiHttpTypes030StaticRequestNewFuture2Read(handle : Int, buffer_ptr : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-2][static]request.new" +fn wasmImportWasiHttpTypes030StaticRequestNewFuture2CancelRead(handle : Int) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-2][static]request.new" - () - } - Some(payload74) => { - mbt_ffi_store8(ptr + 16, 1) +fn wasmImportWasiHttpTypes030StaticRequestNewFuture2DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-readable-2][static]request.new" - let ptr75 = mbt_ffi_str2ptr(payload74) - mbt_ffi_store32(ptr + 24, payload74.length()) - mbt_ffi_store32(ptr + 20, ptr75) +fn wasmWasiHttpTypes030StaticRequestNewFuture2Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(40 * length) + ptr +} - () - } - } +fn wasmWasiHttpTypes030StaticRequestNewFuture2Reject( +ptr : Int, +start : Int, +length : Int, +) -> Unit { - match payload72.field_size { - None => { - mbt_ffi_store8(ptr + 28, 0) + for i in start..<(start + length) { + let elem_ptr = ptr + i * 40 - () + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() } - Some(payload77) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store32(ptr + 32, payload77.reinterpret_as_int()) - () - } - } + } - () - } - HttpResponseTransferCoding(payload78) => { - mbt_ffi_store8(ptr + 8, 31) +} + +fn wasmWasiHttpTypes030StaticRequestNewFuture2Lift(ptr : Int) -> Result[Unit, ErrorCode] { - match payload78 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let lifted30 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { - () + Result::Ok(()) } - Some(payload80) => { - mbt_ffi_store8(ptr + 16, 1) + 1 => { - let ptr81 = mbt_ffi_str2ptr(payload80) - mbt_ffi_store32(ptr + 24, payload80.length()) - mbt_ffi_store32(ptr + 20, ptr81) + let lifted29 = match (mbt_ffi_load8_u((ptr) + 8)) { + 0 => { - () - } - } + ErrorCode::DnsTimeout + } + 1 => { - () - } - HttpResponseContentCoding(payload82) => { - mbt_ffi_store8(ptr + 8, 32) + let lifted : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - match payload82 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - Some(payload84) => { - mbt_ffi_store8(ptr + 16, 1) + Option::Some(result) + } + _ => panic() + } - let ptr85 = mbt_ffi_str2ptr(payload84) - mbt_ffi_store32(ptr + 24, payload84.length()) - mbt_ffi_store32(ptr + 20, ptr85) + let lifted0 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { - () - } - } - - () - } - HttpResponseTimeout => { - mbt_ffi_store8(ptr + 8, 33) - - () - } - HttpUpgradeFailed => { - mbt_ffi_store8(ptr + 8, 34) - - () - } - HttpProtocolError => { - mbt_ffi_store8(ptr + 8, 35) - - () - } - LoopDetected => { - mbt_ffi_store8(ptr + 8, 36) - - () - } - ConfigurationError => { - mbt_ffi_store8(ptr + 8, 37) - - () - } - InternalError(payload91) => { - mbt_ffi_store8(ptr + 8, 38) - - match payload91 { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload93) => { - mbt_ffi_store8(ptr + 16, 1) + Option::Some((mbt_ffi_load16_u((ptr) + 30).land(0xFFFF).reinterpret_as_uint())) + } + _ => panic() + } - let ptr94 = mbt_ffi_str2ptr(payload93) - mbt_ffi_store32(ptr + 24, payload93.length()) - mbt_ffi_store32(ptr + 20, ptr94) + ErrorCode::DnsError(DnsErrorPayload::{rcode : lifted, info_code : lifted0}) + } + 2 => { - () - } - } + ErrorCode::DestinationNotFound + } + 3 => { - () - } - } + ErrorCode::DestinationUnavailable + } + 4 => { - () - } - } -} + ErrorCode::DestinationIpProhibited + } + 5 => { -///| -priv struct WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar -} + ErrorCode::DestinationIpUnroutable + } + 6 => { -///| -fn WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::finish_read( - self : WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource, -) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. -} + ErrorCode::ConnectionRefused + } + 7 => { -///| -async fn WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::wait_for_read_cleanup( - self : WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource, -) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() - } - }, - resume_on_cancel=true, - ) catch { - _ => () - } -} + ErrorCode::ConnectionTerminated + } + 8 => { -///| -async fn WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::cancel_active_read( - self : WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource, -) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let completed = Ref(false) - @async-core.protect_from_cancel( - () => { - completed.val = @async-core.cancel_future_read( - self.read_task, - self.handle, - () => { - wasmImportWasiHttpTypes030StaticRequestNewFuture1CancelRead( - self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - if completed.val && self.read_buffer != 0 { - wasmWasiHttpTypes030StaticRequestNewFuture1Reject(self.read_buffer, 0, 1) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() -} + ErrorCode::ConnectionTimeout + } + 9 => { -///| -async fn WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::close( - self : WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource, -) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiHttpTypes030StaticRequestNewFuture1DropReadable(self.handle) -} + ErrorCode::ConnectionReadTimeout + } + 10 => { -///| -fn WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::close_sync( - self : WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource, -) -> Unit { - if self.closed || self.reading { - return - } + ErrorCode::ConnectionWriteTimeout + } + 11 => { - if wasmWasiHttpTypes030StaticRequestNewFuture1FutureRejectPrepared( - self.handle, - ) { - self.closed = true - return - } + ErrorCode::ConnectionLimitReached + } + 12 => { - self.closed = true - wasmImportWasiHttpTypes030StaticRequestNewFuture1DropReadable(self.handle) -} + ErrorCode::TlsProtocolError + } + 13 => { -///| -async fn WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::read( - self : WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource, -) -> Result[Fields?, ErrorCode] { - if self.closed { - raise @async-core.FutureReadError::Dropped - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - let ptr = wasmWasiHttpTypes030StaticRequestNewFuture1Malloc(1) - defer mbt_ffi_free(ptr) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - @async-core.suspend_for_future_read( - self.handle, - wasmImportWasiHttpTypes030StaticRequestNewFuture1Read(self.handle, ptr), - ) catch { - err => { - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticRequestNewFuture1DropReadable( - self.handle, - ) - } - } - self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - let value = wasmWasiHttpTypes030StaticRequestNewFuture1Lift(ptr) - self.finish_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticRequestNewFuture1DropReadable(self.handle) - } - value -} + ErrorCode::TlsCertificateError + } + 14 => { -///| -fn wasmWasiHttpTypes030StaticRequestNewFuture1FutureLift( - handle : Int, -) -> @async-core.Future[Result[Fields?, ErrorCode]] { - let source = WasmWasiHttpTypes030StaticRequestNewFuture1FutureSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Future::from_source(() => source.read(), () => source.close(), () => { - source.close_sync() - }) -} + let lifted1 : Byte? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { -///| -priv struct WasmWasiHttpTypes030StaticRequestNewFuture1FutureProducer { - future : @async-core.Future[Result[Fields?, ErrorCode]] - writer : Int -} + Option::Some((mbt_ffi_load8_u((ptr) + 17)).to_byte()) + } + _ => panic() + } -///| -let wasmWasiHttpTypes030StaticRequestNewFuture1FutureProducers : Map[ - Int, - WasmWasiHttpTypes030StaticRequestNewFuture1FutureProducer, -] = Map([]) + let lifted3 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { -///| -fn wasmWasiHttpTypes030StaticRequestNewFuture1FutureRejectPrepared( - handle : Int, -) -> Bool { - guard wasmWasiHttpTypes030StaticRequestNewFuture1FutureProducers.get(handle) - is Some(producer) else { - return false - } - wasmWasiHttpTypes030StaticRequestNewFuture1FutureProducers.remove(handle) - let writer = producer.writer - wasmImportWasiHttpTypes030StaticRequestNewFuture1DropReadable(handle) - @async-core.spawn_component_task_current(async fn() { - defer wasmImportWasiHttpTypes030StaticRequestNewFuture1DropWritable(writer) - @async-core.protect_from_cancel( - () => { - producer.future.reject((value : Result[Fields?, ErrorCode]) => { - let ptr = wasmWasiHttpTypes030StaticRequestNewFuture1Malloc(1) - wasmWasiHttpTypes030StaticRequestNewFuture1Lower(value, ptr) - wasmWasiHttpTypes030StaticRequestNewFuture1Reject(ptr, 0, 1) - mbt_ffi_free(ptr) - }) - let ptr = wasmWasiHttpTypes030StaticRequestNewFuture1Malloc(1) - defer mbt_ffi_free(ptr) - let terminal : Ref[Bool?] = { val: None } - while terminal.val is None { - terminal.val = @async-core.suspend_for_future_write_terminal( - writer, - wasmImportWasiHttpTypes030StaticRequestNewFuture1Write(writer, ptr), - ) - } - guard terminal.val is Some(transferred) - if transferred { - abort("rejected component future unexpectedly transferred a value") - } - }, - resume_on_cancel=true, - ) catch { - _ => abort("failed to reject component future producer") - } - }) - true -} + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) -///| -fn wasmWasiHttpTypes030StaticRequestNewFuture1FutureCommit( - handle : Int, -) -> Unit { - guard wasmWasiHttpTypes030StaticRequestNewFuture1FutureProducers.get(handle) - is Some(producer) else { - return - } - wasmWasiHttpTypes030StaticRequestNewFuture1FutureProducers.remove(handle) - let writer = producer.writer - if !@async-core.has_component_task_scope() { - abort("component future producer requires an async task scope") - } - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( - () => { - let value = producer.future.get() - let ptr = wasmWasiHttpTypes030StaticRequestNewFuture1Malloc(1) - wasmWasiHttpTypes030StaticRequestNewFuture1Lower(value, ptr) - let terminal : Ref[Bool?] = { val: None } - while terminal.val is None { - terminal.val = @async-core.suspend_for_future_write_terminal( - writer, - wasmImportWasiHttpTypes030StaticRequestNewFuture1Write(writer, ptr), - ) - } - guard terminal.val is Some(transferred) - if transferred { - wasmWasiHttpTypes030StaticRequestNewFuture1Commit(ptr, 0, 1) - } else { - wasmWasiHttpTypes030StaticRequestNewFuture1Reject(ptr, 0, 1) - } - mbt_ffi_free(ptr) - wasmImportWasiHttpTypes030StaticRequestNewFuture1DropWritable(writer) - }, - resume_on_cancel=true, - ) catch { - _ => abort("component future producer ended without a value") - } - }) -} + Option::Some(result2) + } + _ => panic() + } -///| -fn wasmWasiHttpTypes030StaticRequestNewFuture1FutureLower( - future : @async-core.Future[Result[Fields?, ErrorCode]], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component future producer requires an async task scope") - } - let pair = wasmImportWasiHttpTypes030StaticRequestNewFuture1New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmWasiHttpTypes030StaticRequestNewFuture1FutureProducers.set(reader, { - future, - writer, - }) - reader -} + ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{alert_id : lifted1, alert_message : lifted3}) + } + 15 => { -///| -fn wasmImportWasiHttpTypes030StaticRequestNewFuture2Read( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-2][static]request.new" + ErrorCode::HttpRequestDenied + } + 16 => { -///| -fn wasmImportWasiHttpTypes030StaticRequestNewFuture2CancelRead( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-2][static]request.new" + ErrorCode::HttpRequestLengthRequired + } + 17 => { -///| -fn wasmImportWasiHttpTypes030StaticRequestNewFuture2DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-readable-2][static]request.new" + let lifted4 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpRequestBodySize(lifted4) + } + 18 => { + + ErrorCode::HttpRequestMethodInvalid + } + 19 => { + + ErrorCode::HttpRequestUriInvalid + } + 20 => { + + ErrorCode::HttpRequestUriTooLong + } + 21 => { + + let lifted5 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSectionSize(lifted5) + } + 22 => { + + let lifted9 : FieldSizePayload? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let lifted7 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) + + Option::Some(result6) + } + _ => panic() + } + + let lifted8 : UInt? = match mbt_ffi_load8_u((ptr) + 32) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 36)).reinterpret_as_uint()) + } + _ => panic() + } + + Option::Some(FieldSizePayload::{field_name : lifted7, field_size : lifted8}) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSize(lifted9) + } + 23 => { + + let lifted10 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSectionSize(lifted10) + } + 24 => { + + let lifted12 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result11 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result11) + } + _ => panic() + } + + let lifted13 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{field_name : lifted12, field_size : lifted13}) + } + 25 => { + + ErrorCode::HttpResponseIncomplete + } + 26 => { + + let lifted14 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } -///| -fn wasmWasiHttpTypes030StaticRequestNewFuture2Malloc(length : Int) -> Int { - let ptr = mbt_ffi_malloc(40 * length) - ptr -} + ErrorCode::HttpResponseHeaderSectionSize(lifted14) + } + 27 => { -///| -fn wasmWasiHttpTypes030StaticRequestNewFuture2Reject( - ptr : Int, - start : Int, - length : Int, -) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 40 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - _ => panic() - } - 23 => () - 24 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 31 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - } -} + let lifted16 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { -///| -fn wasmWasiHttpTypes030StaticRequestNewFuture2Lift( - ptr : Int, -) -> Result[Unit, ErrorCode] { - let lifted30 = match mbt_ffi_load8_u(ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted29 = match mbt_ffi_load8_u(ptr + 8) { - 0 => ErrorCode::DnsTimeout - 1 => { - let lifted : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result15) + } + _ => panic() + } + + let lifted17 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - Option::Some(result) - } - _ => panic() - } - - let lifted0 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load16_u(ptr + 30).land(0xFFFF).reinterpret_as_uint(), - ) - _ => panic() - } - - ErrorCode::DnsError(DnsErrorPayload::{ - rcode: lifted, - info_code: lifted0, - }) - } - 2 => ErrorCode::DestinationNotFound - 3 => ErrorCode::DestinationUnavailable - 4 => ErrorCode::DestinationIpProhibited - 5 => ErrorCode::DestinationIpUnroutable - 6 => ErrorCode::ConnectionRefused - 7 => ErrorCode::ConnectionTerminated - 8 => ErrorCode::ConnectionTimeout - 9 => ErrorCode::ConnectionReadTimeout - 10 => ErrorCode::ConnectionWriteTimeout - 11 => ErrorCode::ConnectionLimitReached - 12 => ErrorCode::TlsProtocolError - 13 => ErrorCode::TlsCertificateError - 14 => { - let lifted1 : Byte? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load8_u(ptr + 17).to_byte()) - _ => panic() - } + ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{field_name : lifted16, field_size : lifted17}) + } + 28 => { + + let lifted18 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - let lifted3 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpResponseBodySize(lifted18) + } + 29 => { - Option::Some(result2) - } - _ => panic() - } - - ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{ - alert_id: lifted1, - alert_message: lifted3, - }) - } - 15 => ErrorCode::HttpRequestDenied - 16 => ErrorCode::HttpRequestLengthRequired - 17 => { - let lifted4 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpRequestBodySize(lifted4) - } - 18 => ErrorCode::HttpRequestMethodInvalid - 19 => ErrorCode::HttpRequestUriInvalid - 20 => ErrorCode::HttpRequestUriTooLong - 21 => { - let lifted5 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + let lifted19 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - ErrorCode::HttpRequestHeaderSectionSize(lifted5) - } - 22 => { - let lifted9 : FieldSizePayload? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let lifted7 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) - - Option::Some(result6) - } - _ => panic() - } - - let lifted8 : UInt? = match mbt_ffi_load8_u(ptr + 32) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(ptr + 36).reinterpret_as_uint()) - _ => panic() - } - - Option::Some(FieldSizePayload::{ - field_name: lifted7, - field_size: lifted8, - }) - } - _ => panic() - } - - ErrorCode::HttpRequestHeaderSize(lifted9) - } - 23 => { - let lifted10 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } - ErrorCode::HttpRequestTrailerSectionSize(lifted10) - } - 24 => { - let lifted12 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result11 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + ErrorCode::HttpResponseTrailerSectionSize(lifted19) + } + 30 => { - Option::Some(result11) - } - _ => panic() - } + let lifted21 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - let lifted13 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{ - field_name: lifted12, - field_size: lifted13, - }) - } - 25 => ErrorCode::HttpResponseIncomplete - 26 => { - let lifted14 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + let result20 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - ErrorCode::HttpResponseHeaderSectionSize(lifted14) - } - 27 => { - let lifted16 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + Option::Some(result20) + } + _ => panic() + } - Option::Some(result15) - } - _ => panic() - } + let lifted22 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { - let lifted17 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{ - field_name: lifted16, - field_size: lifted17, - }) - } - 28 => { - let lifted18 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpResponseBodySize(lifted18) - } - 29 => { - let lifted19 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - ErrorCode::HttpResponseTrailerSectionSize(lifted19) - } - 30 => { - let lifted21 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result20 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{field_name : lifted21, field_size : lifted22}) + } + 31 => { - Option::Some(result20) - } - _ => panic() - } + let lifted24 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - let lifted22 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{ - field_name: lifted21, - field_size: lifted22, - }) - } - 31 => { - let lifted24 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - Option::Some(result23) - } - _ => panic() - } + Option::Some(result23) + } + _ => panic() + } - ErrorCode::HttpResponseTransferCoding(lifted24) - } - 32 => { - let lifted26 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result25 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + ErrorCode::HttpResponseTransferCoding(lifted24) + } + 32 => { - Option::Some(result25) - } - _ => panic() - } - - ErrorCode::HttpResponseContentCoding(lifted26) - } - 33 => ErrorCode::HttpResponseTimeout - 34 => ErrorCode::HttpUpgradeFailed - 35 => ErrorCode::HttpProtocolError - 36 => ErrorCode::LoopDetected - 37 => ErrorCode::ConfigurationError - 38 => { - let lifted28 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result27 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + let lifted26 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - Option::Some(result27) + let result25 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result25) + } + _ => panic() + } + + ErrorCode::HttpResponseContentCoding(lifted26) + } + 33 => { + + ErrorCode::HttpResponseTimeout + } + 34 => { + + ErrorCode::HttpUpgradeFailed + } + 35 => { + + ErrorCode::HttpProtocolError + } + 36 => { + + ErrorCode::LoopDetected + } + 37 => { + + ErrorCode::ConfigurationError + } + 38 => { + + let lifted28 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result27 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result27) + } + _ => panic() + } + + ErrorCode::InternalError(lifted28) + } + _ => panic() + } + + Result::Err(lifted29) } _ => panic() - } - - ErrorCode::InternalError(lifted28) - } - _ => panic() } - Result::Err(lifted29) - } - _ => panic() - } - - lifted30 + lifted30 } -///| priv struct WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource::finish_read( - self : WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource, +self : WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource::wait_for_read_cleanup( - self : WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource, +self : WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource::cancel_active_read( - self : WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource, +self : WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let completed = Ref(false) - @async-core.protect_from_cancel( - () => { - completed.val = @async-core.cancel_future_read( - self.read_task, - self.handle, - () => { - wasmImportWasiHttpTypes030StaticRequestNewFuture2CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let completed = Ref(false) + @async-core.protect_from_cancel( + () => { + completed.val = @async-core.cancel_future_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - if completed.val && self.read_buffer != 0 { - wasmWasiHttpTypes030StaticRequestNewFuture2Reject(self.read_buffer, 0, 1) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiHttpTypes030StaticRequestNewFuture2CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + if completed.val && self.read_buffer != 0 { + wasmWasiHttpTypes030StaticRequestNewFuture2Reject(self.read_buffer, 0, 1) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource::close( - self : WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource, +self : WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiHttpTypes030StaticRequestNewFuture2DropReadable(self.handle) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiHttpTypes030StaticRequestNewFuture2DropReadable(self.handle) } -///| fn WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource::close_sync( - self : WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource, +self : WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportWasiHttpTypes030StaticRequestNewFuture2DropReadable(self.handle) + self.closed = true + wasmImportWasiHttpTypes030StaticRequestNewFuture2DropReadable(self.handle) } -///| async fn WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource::read( - self : WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource, +self : WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource, ) -> Result[Unit, ErrorCode] { - if self.closed { - raise @async-core.FutureReadError::Dropped - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - let ptr = wasmWasiHttpTypes030StaticRequestNewFuture2Malloc(1) - defer mbt_ffi_free(ptr) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - @async-core.suspend_for_future_read( - self.handle, - wasmImportWasiHttpTypes030StaticRequestNewFuture2Read(self.handle, ptr), - ) catch { - err => { + if self.closed { + raise @async-core.FutureReadError::Dropped + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + let ptr = wasmWasiHttpTypes030StaticRequestNewFuture2Malloc(1) + defer { mbt_ffi_free(ptr) } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + @async-core.suspend_for_future_read( + self.handle, + wasmImportWasiHttpTypes030StaticRequestNewFuture2Read(self.handle, ptr), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticRequestNewFuture2DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticRequestNewFuture2DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped } + let value = wasmWasiHttpTypes030StaticRequestNewFuture2Lift(ptr) self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - let value = wasmWasiHttpTypes030StaticRequestNewFuture2Lift(ptr) - self.finish_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticRequestNewFuture2DropReadable(self.handle) - } - value -} - -///| -fn wasmWasiHttpTypes030StaticRequestNewFuture2FutureLift( - handle : Int, -) -> @async-core.Future[Result[Unit, ErrorCode]] { - let source = WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Future::from_source(() => source.read(), () => source.close(), () => { - source.close_sync() - }) + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticRequestNewFuture2DropReadable(self.handle) + } + value +} + +fn wasmWasiHttpTypes030StaticRequestNewFuture2FutureLift(handle : Int) -> @async-core.Future[Result[Unit, ErrorCode]] { + let source = WasmWasiHttpTypes030StaticRequestNewFuture2FutureSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Future::from_source( + () => source.read(), + () => source.close(), + () => source.close_sync(), + ) } -///| -fn wasmImportMethodRequestGetMethod(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request.get-method" +fn wasmImportMethodRequestGetMethod(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request.get-method" -///| -fn wasmImportMethodRequestSetMethod( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, -) -> Int = "wasi:http/types@0.3.0" "[method]request.set-method" +fn wasmImportMethodRequestSetMethod(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "wasi:http/types@0.3.0" "[method]request.set-method" -///| -fn wasmImportMethodRequestGetPathWithQuery(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request.get-path-with-query" +fn wasmImportMethodRequestGetPathWithQuery(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request.get-path-with-query" -///| -fn wasmImportMethodRequestSetPathWithQuery( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, -) -> Int = "wasi:http/types@0.3.0" "[method]request.set-path-with-query" +fn wasmImportMethodRequestSetPathWithQuery(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "wasi:http/types@0.3.0" "[method]request.set-path-with-query" -///| -fn wasmImportMethodRequestGetScheme(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request.get-scheme" +fn wasmImportMethodRequestGetScheme(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request.get-scheme" -///| -fn wasmImportMethodRequestSetScheme( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, -) -> Int = "wasi:http/types@0.3.0" "[method]request.set-scheme" +fn wasmImportMethodRequestSetScheme(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) -> Int = "wasi:http/types@0.3.0" "[method]request.set-scheme" -///| -fn wasmImportMethodRequestGetAuthority(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request.get-authority" +fn wasmImportMethodRequestGetAuthority(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request.get-authority" -///| -fn wasmImportMethodRequestSetAuthority( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, -) -> Int = "wasi:http/types@0.3.0" "[method]request.set-authority" +fn wasmImportMethodRequestSetAuthority(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "wasi:http/types@0.3.0" "[method]request.set-authority" -///| -fn wasmImportMethodRequestGetOptions(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request.get-options" +fn wasmImportMethodRequestGetOptions(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request.get-options" -///| fn wasmImportMethodRequestGetHeaders(p0 : Int) -> Int = "wasi:http/types@0.3.0" "[method]request.get-headers" -///| -fn wasmImportStaticRequestConsumeBody(p0 : Int, p1 : Int, p2 : Int) = "wasi:http/types@0.3.0" "[static]request.consume-body" - -///| -fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0Read( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-0][static]request.consume-body" +fn wasmImportStaticRequestConsumeBody(p0 : Int, p1 : Int, p2 : Int) = "wasi:http/types@0.3.0" "[static]request.consume-body" -///| -fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0CancelRead( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-0][static]request.consume-body" +fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0Read(handle : Int, buffer_ptr : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-0][static]request.consume-body" +fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0CancelRead(handle : Int) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-0][static]request.consume-body" -///| -fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropReadable( - handle : Int, -) = "wasi:http/types@0.3.0" "[future-drop-readable-0][static]request.consume-body" +fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-readable-0][static]request.consume-body" -///| fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0New() -> UInt64 = "wasi:http/types@0.3.0" "[future-new-0][static]request.consume-body" +fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0Write(handle : Int, buffer_ptr : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-write-0][static]request.consume-body" -///| -fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0Write( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-write-0][static]request.consume-body" - -///| -fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropWritable( - handle : Int, -) = "wasi:http/types@0.3.0" "[future-drop-writable-0][static]request.consume-body" +fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropWritable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-writable-0][static]request.consume-body" -///| -fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(40 * length) - ptr +fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(40 * length) + ptr } -///| fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Commit( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 40 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 20) { + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 40 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } + + } _ => panic() - } - _ => panic() - } - 23 => () - 24 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() } - 31 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - } + + } + } -///| fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 40 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 20) { + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 40 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } + + } _ => panic() - } - _ => panic() - } - 23 => () - 24 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 31 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - } -} - -///| -fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Lift( - ptr : Int, -) -> Result[Unit, ErrorCode] { - let lifted30 = match mbt_ffi_load8_u(ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted29 = match mbt_ffi_load8_u(ptr + 8) { - 0 => ErrorCode::DnsTimeout - 1 => { - let lifted : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result) - } - _ => panic() - } - - let lifted0 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load16_u(ptr + 30).land(0xFFFF).reinterpret_as_uint(), - ) - _ => panic() - } - - ErrorCode::DnsError(DnsErrorPayload::{ - rcode: lifted, - info_code: lifted0, - }) - } - 2 => ErrorCode::DestinationNotFound - 3 => ErrorCode::DestinationUnavailable - 4 => ErrorCode::DestinationIpProhibited - 5 => ErrorCode::DestinationIpUnroutable - 6 => ErrorCode::ConnectionRefused - 7 => ErrorCode::ConnectionTerminated - 8 => ErrorCode::ConnectionTimeout - 9 => ErrorCode::ConnectionReadTimeout - 10 => ErrorCode::ConnectionWriteTimeout - 11 => ErrorCode::ConnectionLimitReached - 12 => ErrorCode::TlsProtocolError - 13 => ErrorCode::TlsCertificateError - 14 => { - let lifted1 : Byte? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load8_u(ptr + 17).to_byte()) - _ => panic() - } - - let lifted3 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) - - Option::Some(result2) - } - _ => panic() - } - - ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{ - alert_id: lifted1, - alert_message: lifted3, - }) - } - 15 => ErrorCode::HttpRequestDenied - 16 => ErrorCode::HttpRequestLengthRequired - 17 => { - let lifted4 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpRequestBodySize(lifted4) - } - 18 => ErrorCode::HttpRequestMethodInvalid - 19 => ErrorCode::HttpRequestUriInvalid - 20 => ErrorCode::HttpRequestUriTooLong - 21 => { - let lifted5 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestHeaderSectionSize(lifted5) - } - 22 => { - let lifted9 : FieldSizePayload? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let lifted7 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) - - Option::Some(result6) - } - _ => panic() - } - - let lifted8 : UInt? = match mbt_ffi_load8_u(ptr + 32) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(ptr + 36).reinterpret_as_uint()) - _ => panic() - } - - Option::Some(FieldSizePayload::{ - field_name: lifted7, - field_size: lifted8, - }) - } - _ => panic() - } - - ErrorCode::HttpRequestHeaderSize(lifted9) - } - 23 => { - let lifted10 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSectionSize(lifted10) - } - 24 => { - let lifted12 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result11 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result11) - } - _ => panic() - } - - let lifted13 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{ - field_name: lifted12, - field_size: lifted13, - }) - } - 25 => ErrorCode::HttpResponseIncomplete - 26 => { - let lifted14 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseHeaderSectionSize(lifted14) - } - 27 => { - let lifted16 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result15) - } - _ => panic() - } - - let lifted17 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{ - field_name: lifted16, - field_size: lifted17, - }) - } - 28 => { - let lifted18 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpResponseBodySize(lifted18) - } - 29 => { - let lifted19 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseTrailerSectionSize(lifted19) - } - 30 => { - let lifted21 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result20 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result20) - } - _ => panic() - } - - let lifted22 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{ - field_name: lifted21, - field_size: lifted22, - }) - } - 31 => { - let lifted24 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - Option::Some(result23) - } - _ => panic() - } - - ErrorCode::HttpResponseTransferCoding(lifted24) - } - 32 => { - let lifted26 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result25 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result25) - } - _ => panic() - } - - ErrorCode::HttpResponseContentCoding(lifted26) - } - 33 => ErrorCode::HttpResponseTimeout - 34 => ErrorCode::HttpUpgradeFailed - 35 => ErrorCode::HttpProtocolError - 36 => ErrorCode::LoopDetected - 37 => ErrorCode::ConfigurationError - 38 => { - let lifted28 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result27 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result27) - } - _ => panic() - } - - ErrorCode::InternalError(lifted28) - } - _ => panic() } - Result::Err(lifted29) - } - _ => panic() - } - - lifted30 } -///| -fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Lower( - value : Result[Unit, ErrorCode], - ptr : Int, -) -> Unit { - match value { - Ok(_payload) => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Err(payload0) => { - mbt_ffi_store8(ptr + 0, 1) +fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Lift(ptr : Int) -> Result[Unit, ErrorCode] { - match payload0 { - DnsTimeout => { - mbt_ffi_store8(ptr + 8, 0) + let lifted30 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { - () - } - DnsError(payload2) => { - mbt_ffi_store8(ptr + 8, 1) - - match payload2.rcode { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 16, 1) - - let ptr5 = mbt_ffi_str2ptr(payload4) - mbt_ffi_store32(ptr + 24, payload4.length()) - mbt_ffi_store32(ptr + 20, ptr5) - - () - } - } - - match payload2.info_code { - None => { - mbt_ffi_store8(ptr + 28, 0) - - () - } - Some(payload7) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store16(ptr + 30, payload7.reinterpret_as_int()) - - () - } - } - - () - } - DestinationNotFound => { - mbt_ffi_store8(ptr + 8, 2) - - () - } - DestinationUnavailable => { - mbt_ffi_store8(ptr + 8, 3) - - () - } - DestinationIpProhibited => { - mbt_ffi_store8(ptr + 8, 4) - - () - } - DestinationIpUnroutable => { - mbt_ffi_store8(ptr + 8, 5) - - () - } - ConnectionRefused => { - mbt_ffi_store8(ptr + 8, 6) - - () - } - ConnectionTerminated => { - mbt_ffi_store8(ptr + 8, 7) - - () - } - ConnectionTimeout => { - mbt_ffi_store8(ptr + 8, 8) - - () - } - ConnectionReadTimeout => { - mbt_ffi_store8(ptr + 8, 9) - - () - } - ConnectionWriteTimeout => { - mbt_ffi_store8(ptr + 8, 10) - - () - } - ConnectionLimitReached => { - mbt_ffi_store8(ptr + 8, 11) - - () - } - TlsProtocolError => { - mbt_ffi_store8(ptr + 8, 12) - - () - } - TlsCertificateError => { - mbt_ffi_store8(ptr + 8, 13) - - () - } - TlsAlertReceived(payload20) => { - mbt_ffi_store8(ptr + 8, 14) - - match payload20.alert_id { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload22) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store8(ptr + 17, payload22.to_int()) - - () - } - } - - match payload20.alert_message { - None => { - mbt_ffi_store8(ptr + 20, 0) - - () + Result::Ok(()) } - Some(payload24) => { - mbt_ffi_store8(ptr + 20, 1) - - let ptr25 = mbt_ffi_str2ptr(payload24) - mbt_ffi_store32(ptr + 28, payload24.length()) - mbt_ffi_store32(ptr + 24, ptr25) - - () - } - } - - () - } - HttpRequestDenied => { - mbt_ffi_store8(ptr + 8, 15) - - () - } - HttpRequestLengthRequired => { - mbt_ffi_store8(ptr + 8, 16) - - () - } - HttpRequestBodySize(payload28) => { - mbt_ffi_store8(ptr + 8, 17) - - match payload28 { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload30) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store64(ptr + 24, payload30.reinterpret_as_int64()) - - () - } - } - - () - } - HttpRequestMethodInvalid => { - mbt_ffi_store8(ptr + 8, 18) - - () - } - HttpRequestUriInvalid => { - mbt_ffi_store8(ptr + 8, 19) - - () - } - HttpRequestUriTooLong => { - mbt_ffi_store8(ptr + 8, 20) + 1 => { - () - } - HttpRequestHeaderSectionSize(payload34) => { - mbt_ffi_store8(ptr + 8, 21) + let lifted29 = match (mbt_ffi_load8_u((ptr) + 8)) { + 0 => { - match payload34 { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::DnsTimeout + } + 1 => { - () - } - Some(payload36) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload36.reinterpret_as_int()) + let lifted : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - } + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - HttpRequestHeaderSize(payload37) => { - mbt_ffi_store8(ptr + 8, 22) + Option::Some(result) + } + _ => panic() + } - match payload37 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let lifted0 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { - () - } - Some(payload39) => { - mbt_ffi_store8(ptr + 16, 1) + Option::Some((mbt_ffi_load16_u((ptr) + 30).land(0xFFFF).reinterpret_as_uint())) + } + _ => panic() + } - match payload39.field_name { - None => { - mbt_ffi_store8(ptr + 20, 0) + ErrorCode::DnsError(DnsErrorPayload::{rcode : lifted, info_code : lifted0}) + } + 2 => { - () - } - Some(payload41) => { - mbt_ffi_store8(ptr + 20, 1) + ErrorCode::DestinationNotFound + } + 3 => { - let ptr42 = mbt_ffi_str2ptr(payload41) - mbt_ffi_store32(ptr + 28, payload41.length()) - mbt_ffi_store32(ptr + 24, ptr42) + ErrorCode::DestinationUnavailable + } + 4 => { - () - } - } + ErrorCode::DestinationIpProhibited + } + 5 => { - match payload39.field_size { - None => { - mbt_ffi_store8(ptr + 32, 0) + ErrorCode::DestinationIpUnroutable + } + 6 => { - () - } - Some(payload44) => { - mbt_ffi_store8(ptr + 32, 1) - mbt_ffi_store32(ptr + 36, payload44.reinterpret_as_int()) + ErrorCode::ConnectionRefused + } + 7 => { - () - } - } + ErrorCode::ConnectionTerminated + } + 8 => { - () - } - } + ErrorCode::ConnectionTimeout + } + 9 => { - () - } - HttpRequestTrailerSectionSize(payload45) => { - mbt_ffi_store8(ptr + 8, 23) + ErrorCode::ConnectionReadTimeout + } + 10 => { - match payload45 { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::ConnectionWriteTimeout + } + 11 => { - () - } - Some(payload47) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload47.reinterpret_as_int()) + ErrorCode::ConnectionLimitReached + } + 12 => { - () - } - } + ErrorCode::TlsProtocolError + } + 13 => { - () - } - HttpRequestTrailerSize(payload48) => { - mbt_ffi_store8(ptr + 8, 24) + ErrorCode::TlsCertificateError + } + 14 => { - match payload48.field_name { - None => { - mbt_ffi_store8(ptr + 16, 0) + let lifted1 : Byte? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload50) => { - mbt_ffi_store8(ptr + 16, 1) + Option::Some((mbt_ffi_load8_u((ptr) + 17)).to_byte()) + } + _ => panic() + } - let ptr51 = mbt_ffi_str2ptr(payload50) - mbt_ffi_store32(ptr + 24, payload50.length()) - mbt_ffi_store32(ptr + 20, ptr51) + let lifted3 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { - () - } - } + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) - match payload48.field_size { - None => { - mbt_ffi_store8(ptr + 28, 0) + Option::Some(result2) + } + _ => panic() + } - () - } - Some(payload53) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store32(ptr + 32, payload53.reinterpret_as_int()) + ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{alert_id : lifted1, alert_message : lifted3}) + } + 15 => { - () - } - } + ErrorCode::HttpRequestDenied + } + 16 => { - () - } - HttpResponseIncomplete => { - mbt_ffi_store8(ptr + 8, 25) + ErrorCode::HttpRequestLengthRequired + } + 17 => { - () - } - HttpResponseHeaderSectionSize(payload55) => { - mbt_ffi_store8(ptr + 8, 26) + let lifted4 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpRequestBodySize(lifted4) + } + 18 => { + + ErrorCode::HttpRequestMethodInvalid + } + 19 => { + + ErrorCode::HttpRequestUriInvalid + } + 20 => { + + ErrorCode::HttpRequestUriTooLong + } + 21 => { + + let lifted5 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSectionSize(lifted5) + } + 22 => { + + let lifted9 : FieldSizePayload? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let lifted7 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) + + Option::Some(result6) + } + _ => panic() + } + + let lifted8 : UInt? = match mbt_ffi_load8_u((ptr) + 32) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 36)).reinterpret_as_uint()) + } + _ => panic() + } + + Option::Some(FieldSizePayload::{field_name : lifted7, field_size : lifted8}) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSize(lifted9) + } + 23 => { + + let lifted10 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSectionSize(lifted10) + } + 24 => { + + let lifted12 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result11 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result11) + } + _ => panic() + } + + let lifted13 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{field_name : lifted12, field_size : lifted13}) + } + 25 => { + + ErrorCode::HttpResponseIncomplete + } + 26 => { + + let lifted14 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } - match payload55 { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::HttpResponseHeaderSectionSize(lifted14) + } + 27 => { - () - } - Some(payload57) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload57.reinterpret_as_int()) + let lifted16 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - } + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result15) + } + _ => panic() + } + + let lifted17 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - HttpResponseHeaderSize(payload58) => { - mbt_ffi_store8(ptr + 8, 27) + ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{field_name : lifted16, field_size : lifted17}) + } + 28 => { + + let lifted18 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - match payload58.field_name { - None => { - mbt_ffi_store8(ptr + 16, 0) + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpResponseBodySize(lifted18) + } + 29 => { - () - } - Some(payload60) => { - mbt_ffi_store8(ptr + 16, 1) + let lifted19 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - let ptr61 = mbt_ffi_str2ptr(payload60) - mbt_ffi_store32(ptr + 24, payload60.length()) - mbt_ffi_store32(ptr + 20, ptr61) + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - } + ErrorCode::HttpResponseTrailerSectionSize(lifted19) + } + 30 => { - match payload58.field_size { - None => { - mbt_ffi_store8(ptr + 28, 0) + let lifted21 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload63) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store32(ptr + 32, payload63.reinterpret_as_int()) + let result20 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - } + Option::Some(result20) + } + _ => panic() + } - () - } - HttpResponseBodySize(payload64) => { - mbt_ffi_store8(ptr + 8, 28) + let lifted22 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { - match payload64 { - None => { - mbt_ffi_store8(ptr + 16, 0) + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - Some(payload66) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store64(ptr + 24, payload66.reinterpret_as_int64()) + ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{field_name : lifted21, field_size : lifted22}) + } + 31 => { - () - } - } + let lifted24 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - HttpResponseTrailerSectionSize(payload67) => { - mbt_ffi_store8(ptr + 8, 29) + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - match payload67 { - None => { - mbt_ffi_store8(ptr + 16, 0) + Option::Some(result23) + } + _ => panic() + } - () - } - Some(payload69) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload69.reinterpret_as_int()) + ErrorCode::HttpResponseTransferCoding(lifted24) + } + 32 => { - () - } - } + let lifted26 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - HttpResponseTrailerSize(payload70) => { - mbt_ffi_store8(ptr + 8, 30) + let result25 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - match payload70.field_name { - None => { - mbt_ffi_store8(ptr + 16, 0) + Option::Some(result25) + } + _ => panic() + } - () - } - Some(payload72) => { - mbt_ffi_store8(ptr + 16, 1) + ErrorCode::HttpResponseContentCoding(lifted26) + } + 33 => { - let ptr73 = mbt_ffi_str2ptr(payload72) - mbt_ffi_store32(ptr + 24, payload72.length()) - mbt_ffi_store32(ptr + 20, ptr73) + ErrorCode::HttpResponseTimeout + } + 34 => { - () - } - } + ErrorCode::HttpUpgradeFailed + } + 35 => { - match payload70.field_size { - None => { - mbt_ffi_store8(ptr + 28, 0) + ErrorCode::HttpProtocolError + } + 36 => { - () - } - Some(payload75) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store32(ptr + 32, payload75.reinterpret_as_int()) + ErrorCode::LoopDetected + } + 37 => { - () - } - } + ErrorCode::ConfigurationError + } + 38 => { - () - } - HttpResponseTransferCoding(payload76) => { - mbt_ffi_store8(ptr + 8, 31) + let lifted28 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - match payload76 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let result27 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - Some(payload78) => { - mbt_ffi_store8(ptr + 16, 1) + Option::Some(result27) + } + _ => panic() + } - let ptr79 = mbt_ffi_str2ptr(payload78) - mbt_ffi_store32(ptr + 24, payload78.length()) - mbt_ffi_store32(ptr + 20, ptr79) + ErrorCode::InternalError(lifted28) + } + _ => panic() + } - () + Result::Err(lifted29) } - } - - () - } - HttpResponseContentCoding(payload80) => { - mbt_ffi_store8(ptr + 8, 32) + _ => panic() + } - match payload80 { - None => { - mbt_ffi_store8(ptr + 16, 0) + lifted30 +} - () - } - Some(payload82) => { - mbt_ffi_store8(ptr + 16, 1) +fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Lower(value : Result[Unit, ErrorCode], ptr : Int) -> Unit { - let ptr83 = mbt_ffi_str2ptr(payload82) - mbt_ffi_store32(ptr + 24, payload82.length()) - mbt_ffi_store32(ptr + 20, ptr83) + match value { + Ok(_payload) => { + mbt_ffi_store8((ptr) + 0, (0)) - () - } - } - - () - } - HttpResponseTimeout => { - mbt_ffi_store8(ptr + 8, 33) - - () - } - HttpUpgradeFailed => { - mbt_ffi_store8(ptr + 8, 34) - - () - } - HttpProtocolError => { - mbt_ffi_store8(ptr + 8, 35) - - () - } - LoopDetected => { - mbt_ffi_store8(ptr + 8, 36) - - () - } - ConfigurationError => { - mbt_ffi_store8(ptr + 8, 37) - - () - } - InternalError(payload89) => { - mbt_ffi_store8(ptr + 8, 38) - - match payload89 { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () + () } - Some(payload91) => { - mbt_ffi_store8(ptr + 16, 1) - - let ptr92 = mbt_ffi_str2ptr(payload91) - mbt_ffi_store32(ptr + 24, payload91.length()) - mbt_ffi_store32(ptr + 20, ptr92) + Err(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + match payload0 { + DnsTimeout => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + DnsError(payload2) => { + mbt_ffi_store8((ptr) + 8, (1)) + + match ((payload2).rcode) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr5 = mbt_ffi_str2ptr(payload4) + mbt_ffi_store32((ptr) + 24, payload4.length()) + mbt_ffi_store32((ptr) + 20, ptr5) + + () + } + } + + match ((payload2).info_code) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload7) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store16((ptr) + 30, (payload7).reinterpret_as_int()) + + () + } + } + + () + } + DestinationNotFound => { + mbt_ffi_store8((ptr) + 8, (2)) + + () + } + DestinationUnavailable => { + mbt_ffi_store8((ptr) + 8, (3)) + + () + } + DestinationIpProhibited => { + mbt_ffi_store8((ptr) + 8, (4)) + + () + } + DestinationIpUnroutable => { + mbt_ffi_store8((ptr) + 8, (5)) + + () + } + ConnectionRefused => { + mbt_ffi_store8((ptr) + 8, (6)) + + () + } + ConnectionTerminated => { + mbt_ffi_store8((ptr) + 8, (7)) + + () + } + ConnectionTimeout => { + mbt_ffi_store8((ptr) + 8, (8)) + + () + } + ConnectionReadTimeout => { + mbt_ffi_store8((ptr) + 8, (9)) + + () + } + ConnectionWriteTimeout => { + mbt_ffi_store8((ptr) + 8, (10)) + + () + } + ConnectionLimitReached => { + mbt_ffi_store8((ptr) + 8, (11)) + + () + } + TlsProtocolError => { + mbt_ffi_store8((ptr) + 8, (12)) + + () + } + TlsCertificateError => { + mbt_ffi_store8((ptr) + 8, (13)) + + () + } + TlsAlertReceived(payload20) => { + mbt_ffi_store8((ptr) + 8, (14)) + + match ((payload20).alert_id) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload22) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store8((ptr) + 17, (payload22).to_int()) + + () + } + } + + match ((payload20).alert_message) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) + + () + } + Some(payload24) => { + mbt_ffi_store8((ptr) + 20, (1)) + + let ptr25 = mbt_ffi_str2ptr(payload24) + mbt_ffi_store32((ptr) + 28, payload24.length()) + mbt_ffi_store32((ptr) + 24, ptr25) + + () + } + } + + () + } + HttpRequestDenied => { + mbt_ffi_store8((ptr) + 8, (15)) + + () + } + HttpRequestLengthRequired => { + mbt_ffi_store8((ptr) + 8, (16)) + + () + } + HttpRequestBodySize(payload28) => { + mbt_ffi_store8((ptr) + 8, (17)) + + match (payload28) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload30) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store64((ptr) + 24, (payload30).reinterpret_as_int64()) + + () + } + } + + () + } + HttpRequestMethodInvalid => { + mbt_ffi_store8((ptr) + 8, (18)) + + () + } + HttpRequestUriInvalid => { + mbt_ffi_store8((ptr) + 8, (19)) + + () + } + HttpRequestUriTooLong => { + mbt_ffi_store8((ptr) + 8, (20)) + + () + } + HttpRequestHeaderSectionSize(payload34) => { + mbt_ffi_store8((ptr) + 8, (21)) + + match (payload34) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload36) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload36).reinterpret_as_int()) + + () + } + } + + () + } + HttpRequestHeaderSize(payload37) => { + mbt_ffi_store8((ptr) + 8, (22)) + + match (payload37) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload39) => { + mbt_ffi_store8((ptr) + 16, (1)) + + match ((payload39).field_name) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) + + () + } + Some(payload41) => { + mbt_ffi_store8((ptr) + 20, (1)) + + let ptr42 = mbt_ffi_str2ptr(payload41) + mbt_ffi_store32((ptr) + 28, payload41.length()) + mbt_ffi_store32((ptr) + 24, ptr42) + + () + } + } + + match ((payload39).field_size) { + None => { + mbt_ffi_store8((ptr) + 32, (0)) + + () + } + Some(payload44) => { + mbt_ffi_store8((ptr) + 32, (1)) + mbt_ffi_store32((ptr) + 36, (payload44).reinterpret_as_int()) + + () + } + } + + () + } + } + + () + } + HttpRequestTrailerSectionSize(payload45) => { + mbt_ffi_store8((ptr) + 8, (23)) + + match (payload45) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload47) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload47).reinterpret_as_int()) + + () + } + } + + () + } + HttpRequestTrailerSize(payload48) => { + mbt_ffi_store8((ptr) + 8, (24)) + + match ((payload48).field_name) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload50) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr51 = mbt_ffi_str2ptr(payload50) + mbt_ffi_store32((ptr) + 24, payload50.length()) + mbt_ffi_store32((ptr) + 20, ptr51) + + () + } + } + + match ((payload48).field_size) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload53) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store32((ptr) + 32, (payload53).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseIncomplete => { + mbt_ffi_store8((ptr) + 8, (25)) + + () + } + HttpResponseHeaderSectionSize(payload55) => { + mbt_ffi_store8((ptr) + 8, (26)) + + match (payload55) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload57) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload57).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseHeaderSize(payload58) => { + mbt_ffi_store8((ptr) + 8, (27)) + + match ((payload58).field_name) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload60) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr61 = mbt_ffi_str2ptr(payload60) + mbt_ffi_store32((ptr) + 24, payload60.length()) + mbt_ffi_store32((ptr) + 20, ptr61) + + () + } + } + + match ((payload58).field_size) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload63) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store32((ptr) + 32, (payload63).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseBodySize(payload64) => { + mbt_ffi_store8((ptr) + 8, (28)) + + match (payload64) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload66) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store64((ptr) + 24, (payload66).reinterpret_as_int64()) + + () + } + } + + () + } + HttpResponseTrailerSectionSize(payload67) => { + mbt_ffi_store8((ptr) + 8, (29)) + + match (payload67) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload69) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload69).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseTrailerSize(payload70) => { + mbt_ffi_store8((ptr) + 8, (30)) + + match ((payload70).field_name) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload72) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr73 = mbt_ffi_str2ptr(payload72) + mbt_ffi_store32((ptr) + 24, payload72.length()) + mbt_ffi_store32((ptr) + 20, ptr73) + + () + } + } + + match ((payload70).field_size) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload75) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store32((ptr) + 32, (payload75).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseTransferCoding(payload76) => { + mbt_ffi_store8((ptr) + 8, (31)) + + match (payload76) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload78) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr79 = mbt_ffi_str2ptr(payload78) + mbt_ffi_store32((ptr) + 24, payload78.length()) + mbt_ffi_store32((ptr) + 20, ptr79) + + () + } + } + + () + } + HttpResponseContentCoding(payload80) => { + mbt_ffi_store8((ptr) + 8, (32)) + + match (payload80) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload82) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr83 = mbt_ffi_str2ptr(payload82) + mbt_ffi_store32((ptr) + 24, payload82.length()) + mbt_ffi_store32((ptr) + 20, ptr83) + + () + } + } + + () + } + HttpResponseTimeout => { + mbt_ffi_store8((ptr) + 8, (33)) + + () + } + HttpUpgradeFailed => { + mbt_ffi_store8((ptr) + 8, (34)) + + () + } + HttpProtocolError => { + mbt_ffi_store8((ptr) + 8, (35)) + + () + } + LoopDetected => { + mbt_ffi_store8((ptr) + 8, (36)) + + () + } + ConfigurationError => { + mbt_ffi_store8((ptr) + 8, (37)) + + () + } + InternalError(payload89) => { + mbt_ffi_store8((ptr) + 8, (38)) + + match (payload89) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload91) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr92 = mbt_ffi_str2ptr(payload91) + mbt_ffi_store32((ptr) + 24, payload91.length()) + mbt_ffi_store32((ptr) + 20, ptr92) + + () + } + } + + () + } + } - () + () } - } - - () - } } - () - } - } } -///| priv struct WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource::finish_read( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource::wait_for_read_cleanup( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource::cancel_active_read( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let completed = Ref(false) - @async-core.protect_from_cancel( - () => { - completed.val = @async-core.cancel_future_read( - self.read_task, - self.handle, - () => { - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let completed = Ref(false) + @async-core.protect_from_cancel( + () => { + completed.val = @async-core.cancel_future_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - if completed.val && self.read_buffer != 0 { - wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Reject( - self.read_buffer, - 0, - 1, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + if completed.val && self.read_buffer != 0 { + wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Reject(self.read_buffer, 0, 1) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource::close( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropReadable(self.handle) } -///| fn WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource::close_sync( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - if wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureRejectPrepared( - self.handle, - ) { - self.closed = true - return - } + if wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureRejectPrepared(self.handle) { + self.closed = true + return + } - self.closed = true - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropReadable(self.handle) } -///| async fn WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource::read( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource, ) -> Result[Unit, ErrorCode] { - if self.closed { - raise @async-core.FutureReadError::Dropped - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - let ptr = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Malloc(1) - defer mbt_ffi_free(ptr) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - @async-core.suspend_for_future_read( - self.handle, - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0Read( + if self.closed { + raise @async-core.FutureReadError::Dropped + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + let ptr = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Malloc(1) + defer { mbt_ffi_free(ptr) } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + @async-core.suspend_for_future_read( self.handle, - ptr, - ), - ) catch { - err => { + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0Read(self.handle, ptr), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped } + let value = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Lift(ptr) self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - let value = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Lift(ptr) - self.finish_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropReadable( - self.handle, - ) - } - value -} - -///| -fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureLift( - handle : Int, -) -> @async-core.Future[Result[Unit, ErrorCode]] { - let source = WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Future::from_source(() => source.read(), () => source.close(), () => { - source.close_sync() - }) + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropReadable(self.handle) + } + value +} + +fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureLift(handle : Int) -> @async-core.Future[Result[Unit, ErrorCode]] { + let source = WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Future::from_source( + () => source.read(), + () => source.close(), + () => source.close_sync(), + ) } -///| priv struct WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducer { - future : @async-core.Future[Result[Unit, ErrorCode]] - writer : Int + future : @async-core.Future[Result[Unit, ErrorCode]] + writer : Int } -///| -let wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducers : Map[ - Int, - WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducer, -] = Map([]) +let wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducers : Map[Int, WasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducer] = Map([]) -///| -fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureRejectPrepared( - handle : Int, -) -> Bool { - guard wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducers.get( - handle, - ) - is Some(producer) else { - return false - } - wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducers.remove( - handle, - ) - let writer = producer.writer - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropReadable(handle) - @async-core.spawn_component_task_current(async fn() { - defer wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropWritable( - writer, - ) - @async-core.protect_from_cancel( - () => { - producer.future.reject((value : Result[Unit, ErrorCode]) => { - let ptr = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Malloc(1) - wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Lower(value, ptr) - wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Reject(ptr, 0, 1) - mbt_ffi_free(ptr) - }) - let ptr = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Malloc(1) - defer mbt_ffi_free(ptr) - let terminal : Ref[Bool?] = { val: None } - while terminal.val is None { - terminal.val = @async-core.suspend_for_future_write_terminal( - writer, - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0Write( - writer, ptr, - ), - ) - } - guard terminal.val is Some(transferred) - if transferred { - abort("rejected component future unexpectedly transferred a value") - } - }, - resume_on_cancel=true, - ) catch { - _ => abort("failed to reject component future producer") - } - }) - true +fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureRejectPrepared(handle : Int) -> Bool { + guard wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducers.get(handle) is Some(producer) else { + return false + } + wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducers.remove(handle) + let writer = producer.writer + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropReadable(handle) + @async-core.spawn_component_task_current(async fn() { + defer wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropWritable(writer) + @async-core.protect_from_cancel( + () => { + producer.future.reject((value : Result[Unit, ErrorCode]) => { + let ptr = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Malloc(1) + wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Lower(value, ptr) + wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + let ptr = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Malloc(1) + defer { mbt_ffi_free(ptr) } + let terminal : Ref[Bool?] = { val: None } + while terminal.val is None { + terminal.val = @async-core.suspend_for_future_write_terminal( + writer, + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0Write(writer, ptr), + ) + } + guard terminal.val is Some(transferred) + if transferred { + abort("rejected component future unexpectedly transferred a value") + } + }, + resume_on_cancel=true, + ) catch { + _ => abort("failed to reject component future producer") + } + }) + true } -///| -fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureCommit( - handle : Int, -) -> Unit { - guard wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducers.get( - handle, - ) - is Some(producer) else { - return - } - wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducers.remove( - handle, - ) - let writer = producer.writer - if !@async-core.has_component_task_scope() { - abort("component future producer requires an async task scope") - } - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( - () => { - let value = producer.future.get() - let ptr = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Malloc(1) - wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Lower(value, ptr) - let terminal : Ref[Bool?] = { val: None } - while terminal.val is None { - terminal.val = @async-core.suspend_for_future_write_terminal( - writer, - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0Write( - writer, ptr, - ), - ) - } - guard terminal.val is Some(transferred) - if transferred { - wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Commit(ptr, 0, 1) - } else { - wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Reject(ptr, 0, 1) - } - mbt_ffi_free(ptr) - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropWritable( - writer, - ) - }, - resume_on_cancel=true, - ) catch { - _ => abort("component future producer ended without a value") - } - }) +fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureCommit(handle : Int) -> Unit { + guard wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducers.get(handle) is Some(producer) else { + return + } + wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducers.remove(handle) + let writer = producer.writer + if !@async-core.has_component_task_scope() { + abort("component future producer requires an async task scope") + } + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + let value = producer.future.get() + let ptr = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Malloc(1) + wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Lower(value, ptr) + let terminal : Ref[Bool?] = { val: None } + while terminal.val is None { + terminal.val = @async-core.suspend_for_future_write_terminal( + writer, + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0Write(writer, ptr), + ) + } + guard terminal.val is Some(transferred) + if transferred { + wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Commit(ptr, 0, 1) + } else { + wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0Reject(ptr, 0, 1) + } + mbt_ffi_free(ptr) + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0DropWritable(writer) + }, + resume_on_cancel=true, + ) catch { + _ => abort("component future producer ended without a value") + } + }) } -///| -fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureLower( - future : @async-core.Future[Result[Unit, ErrorCode]], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component future producer requires an async task scope") - } - let pair = wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducers.set( - reader, - { future, writer }, - ) - reader +fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureLower(future : @async-core.Future[Result[Unit, ErrorCode]]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component future producer requires an async task scope") + } + let pair = wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture0New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureProducers.set(reader, { future, writer }) + reader } -///| -fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][stream-read-1][static]request.consume-body" - -///| -fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1CancelRead( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[stream-cancel-read-1][static]request.consume-body" +fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][stream-read-1][static]request.consume-body" +fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1CancelRead(handle : Int) -> Int = "wasi:http/types@0.3.0" "[stream-cancel-read-1][static]request.consume-body" -///| -fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1DropReadable( - handle : Int, -) = "wasi:http/types@0.3.0" "[stream-drop-readable-1][static]request.consume-body" +fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[stream-drop-readable-1][static]request.consume-body" -///| -fn wasmWasiHttpTypes030StaticRequestConsumeBodyStream1Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmWasiHttpTypes030StaticRequestConsumeBodyStream1Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmWasiHttpTypes030StaticRequestConsumeBodyStream1Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmWasiHttpTypes030StaticRequestConsumeBodyStream1ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource::finish_read( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource::wait_for_read_cleanup( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource::cancel_active_read( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiHttpTypes030StaticRequestConsumeBodyStream1Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiHttpTypes030StaticRequestConsumeBodyStream1Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource::close( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1DropReadable(self.handle) } -///| fn WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource::close_sync( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1DropReadable(self.handle) } -///| async fn WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource::read( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource, - count : Int, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiHttpTypes030StaticRequestConsumeBodyStream1Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiHttpTypes030StaticRequestConsumeBodyStream1Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticRequestConsumeBodyStream1DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) + } + let values = wasmWasiHttpTypes030StaticRequestConsumeBodyStream1ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiHttpTypes030StaticRequestConsumeBodyStream1ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) + if end { + self.close() + } + Some(values) +} + +fn wasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| -fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2Read( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-2][static]request.consume-body" - -///| -fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2CancelRead( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-2][static]request.consume-body" +fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2Read(handle : Int, buffer_ptr : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-2][static]request.consume-body" +fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2CancelRead(handle : Int) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-2][static]request.consume-body" -///| -fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2DropReadable( - handle : Int, -) = "wasi:http/types@0.3.0" "[future-drop-readable-2][static]request.consume-body" +fn wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-readable-2][static]request.consume-body" -///| -fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(40 * length) - ptr +fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(40 * length) + ptr } -///| fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 40 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => Fields::Fields(mbt_ffi_load32(elem_ptr + 12)).drop() - _ => panic() - } - 1 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 40 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + Fields::Fields(mbt_ffi_load32((elem_ptr) + 12)).drop() + + } + _ => panic() + } + + } + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } + + } _ => panic() - } - _ => panic() - } - 23 => () - 24 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 31 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - } + + } + } -///| -fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2Lift( - ptr : Int, -) -> Result[Fields?, ErrorCode] { - let lifted31 = match mbt_ffi_load8_u(ptr + 0) { - 0 => { - let lifted : Fields? = match mbt_ffi_load8_u(ptr + 8) { - 0 => Option::None - 1 => Option::Some(Fields::Fields(mbt_ffi_load32(ptr + 12))) - _ => panic() - } - - Result::Ok(lifted) - } - 1 => { - let lifted30 = match mbt_ffi_load8_u(ptr + 8) { - 0 => ErrorCode::DnsTimeout - 1 => { - let lifted0 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) +fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2Lift(ptr : Int) -> Result[Fields?, ErrorCode] { - Option::Some(result) - } - _ => panic() - } - - let lifted1 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load16_u(ptr + 30).land(0xFFFF).reinterpret_as_uint(), - ) - _ => panic() - } - - ErrorCode::DnsError(DnsErrorPayload::{ - rcode: lifted0, - info_code: lifted1, - }) - } - 2 => ErrorCode::DestinationNotFound - 3 => ErrorCode::DestinationUnavailable - 4 => ErrorCode::DestinationIpProhibited - 5 => ErrorCode::DestinationIpUnroutable - 6 => ErrorCode::ConnectionRefused - 7 => ErrorCode::ConnectionTerminated - 8 => ErrorCode::ConnectionTimeout - 9 => ErrorCode::ConnectionReadTimeout - 10 => ErrorCode::ConnectionWriteTimeout - 11 => ErrorCode::ConnectionLimitReached - 12 => ErrorCode::TlsProtocolError - 13 => ErrorCode::TlsCertificateError - 14 => { - let lifted2 : Byte? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load8_u(ptr + 17).to_byte()) - _ => panic() - } + let lifted31 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { - let lifted4 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) + let lifted : Fields? = match mbt_ffi_load8_u((ptr) + 8) { + 0 => Option::None + 1 => { - Option::Some(result3) - } - _ => panic() - } - - ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{ - alert_id: lifted2, - alert_message: lifted4, - }) - } - 15 => ErrorCode::HttpRequestDenied - 16 => ErrorCode::HttpRequestLengthRequired - 17 => { - let lifted5 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpRequestBodySize(lifted5) - } - 18 => ErrorCode::HttpRequestMethodInvalid - 19 => ErrorCode::HttpRequestUriInvalid - 20 => ErrorCode::HttpRequestUriTooLong - 21 => { - let lifted6 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + Option::Some(Fields::Fields(mbt_ffi_load32((ptr) + 12))) + } + _ => panic() + } - ErrorCode::HttpRequestHeaderSectionSize(lifted6) - } - 22 => { - let lifted10 : FieldSizePayload? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let lifted8 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result7 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) - - Option::Some(result7) - } - _ => panic() - } - - let lifted9 : UInt? = match mbt_ffi_load8_u(ptr + 32) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(ptr + 36).reinterpret_as_uint()) - _ => panic() - } - - Option::Some(FieldSizePayload::{ - field_name: lifted8, - field_size: lifted9, - }) + Result::Ok(lifted) } - _ => panic() - } - - ErrorCode::HttpRequestHeaderSize(lifted10) - } - 23 => { - let lifted11 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSectionSize(lifted11) - } - 24 => { - let lifted13 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None 1 => { - let result12 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - Option::Some(result12) - } - _ => panic() - } + let lifted30 = match (mbt_ffi_load8_u((ptr) + 8)) { + 0 => { - let lifted14 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{ - field_name: lifted13, - field_size: lifted14, - }) - } - 25 => ErrorCode::HttpResponseIncomplete - 26 => { - let lifted15 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + ErrorCode::DnsTimeout + } + 1 => { - ErrorCode::HttpResponseHeaderSectionSize(lifted15) - } - 27 => { - let lifted17 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result16 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + let lifted0 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - Option::Some(result16) - } - _ => panic() - } + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - let lifted18 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{ - field_name: lifted17, - field_size: lifted18, - }) - } - 28 => { - let lifted19 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpResponseBodySize(lifted19) - } - 29 => { - let lifted20 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + Option::Some(result) + } + _ => panic() + } - ErrorCode::HttpResponseTrailerSectionSize(lifted20) - } - 30 => { - let lifted22 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + let lifted1 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { - Option::Some(result21) - } - _ => panic() - } + Option::Some((mbt_ffi_load16_u((ptr) + 30).land(0xFFFF).reinterpret_as_uint())) + } + _ => panic() + } - let lifted23 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{ - field_name: lifted22, - field_size: lifted23, - }) - } - 31 => { - let lifted25 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result24 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + ErrorCode::DnsError(DnsErrorPayload::{rcode : lifted0, info_code : lifted1}) + } + 2 => { - Option::Some(result24) - } - _ => panic() - } + ErrorCode::DestinationNotFound + } + 3 => { - ErrorCode::HttpResponseTransferCoding(lifted25) - } - 32 => { - let lifted27 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result26 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + ErrorCode::DestinationUnavailable + } + 4 => { - Option::Some(result26) - } - _ => panic() - } - - ErrorCode::HttpResponseContentCoding(lifted27) - } - 33 => ErrorCode::HttpResponseTimeout - 34 => ErrorCode::HttpUpgradeFailed - 35 => ErrorCode::HttpProtocolError - 36 => ErrorCode::LoopDetected - 37 => ErrorCode::ConfigurationError - 38 => { - let lifted29 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result28 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + ErrorCode::DestinationIpProhibited + } + 5 => { + + ErrorCode::DestinationIpUnroutable + } + 6 => { + + ErrorCode::ConnectionRefused + } + 7 => { + + ErrorCode::ConnectionTerminated + } + 8 => { + + ErrorCode::ConnectionTimeout + } + 9 => { + + ErrorCode::ConnectionReadTimeout + } + 10 => { + + ErrorCode::ConnectionWriteTimeout + } + 11 => { + + ErrorCode::ConnectionLimitReached + } + 12 => { + + ErrorCode::TlsProtocolError + } + 13 => { + + ErrorCode::TlsCertificateError + } + 14 => { + + let lifted2 : Byte? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load8_u((ptr) + 17)).to_byte()) + } + _ => panic() + } + + let lifted4 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) + + Option::Some(result3) + } + _ => panic() + } + + ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{alert_id : lifted2, alert_message : lifted4}) + } + 15 => { + + ErrorCode::HttpRequestDenied + } + 16 => { + + ErrorCode::HttpRequestLengthRequired + } + 17 => { + + let lifted5 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpRequestBodySize(lifted5) + } + 18 => { + + ErrorCode::HttpRequestMethodInvalid + } + 19 => { + + ErrorCode::HttpRequestUriInvalid + } + 20 => { + + ErrorCode::HttpRequestUriTooLong + } + 21 => { + + let lifted6 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSectionSize(lifted6) + } + 22 => { + + let lifted10 : FieldSizePayload? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let lifted8 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { + + let result7 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) + + Option::Some(result7) + } + _ => panic() + } + + let lifted9 : UInt? = match mbt_ffi_load8_u((ptr) + 32) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 36)).reinterpret_as_uint()) + } + _ => panic() + } + + Option::Some(FieldSizePayload::{field_name : lifted8, field_size : lifted9}) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSize(lifted10) + } + 23 => { + + let lifted11 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSectionSize(lifted11) + } + 24 => { + + let lifted13 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result12 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result12) + } + _ => panic() + } + + let lifted14 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{field_name : lifted13, field_size : lifted14}) + } + 25 => { + + ErrorCode::HttpResponseIncomplete + } + 26 => { + + let lifted15 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpResponseHeaderSectionSize(lifted15) + } + 27 => { + + let lifted17 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result16 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result16) + } + _ => panic() + } + + let lifted18 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{field_name : lifted17, field_size : lifted18}) + } + 28 => { + + let lifted19 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpResponseBodySize(lifted19) + } + 29 => { + + let lifted20 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpResponseTrailerSectionSize(lifted20) + } + 30 => { + + let lifted22 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result21) + } + _ => panic() + } + + let lifted23 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{field_name : lifted22, field_size : lifted23}) + } + 31 => { + + let lifted25 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result24 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result24) + } + _ => panic() + } - Option::Some(result28) + ErrorCode::HttpResponseTransferCoding(lifted25) + } + 32 => { + + let lifted27 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result26 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result26) + } + _ => panic() + } + + ErrorCode::HttpResponseContentCoding(lifted27) + } + 33 => { + + ErrorCode::HttpResponseTimeout + } + 34 => { + + ErrorCode::HttpUpgradeFailed + } + 35 => { + + ErrorCode::HttpProtocolError + } + 36 => { + + ErrorCode::LoopDetected + } + 37 => { + + ErrorCode::ConfigurationError + } + 38 => { + + let lifted29 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result28 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result28) + } + _ => panic() + } + + ErrorCode::InternalError(lifted29) + } + _ => panic() + } + + Result::Err(lifted30) } _ => panic() - } - - ErrorCode::InternalError(lifted29) - } - _ => panic() } - Result::Err(lifted30) - } - _ => panic() - } - - lifted31 + lifted31 } -///| priv struct WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource::finish_read( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource::wait_for_read_cleanup( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource::cancel_active_read( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let completed = Ref(false) - @async-core.protect_from_cancel( - () => { - completed.val = @async-core.cancel_future_read( - self.read_task, - self.handle, - () => { - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let completed = Ref(false) + @async-core.protect_from_cancel( + () => { + completed.val = @async-core.cancel_future_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - if completed.val && self.read_buffer != 0 { - wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2Reject( - self.read_buffer, - 0, - 1, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + if completed.val && self.read_buffer != 0 { + wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2Reject(self.read_buffer, 0, 1) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource::close( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2DropReadable(self.handle) } -///| fn WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource::close_sync( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2DropReadable(self.handle) } -///| async fn WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource::read( - self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource, +self : WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource, ) -> Result[Fields?, ErrorCode] { - if self.closed { - raise @async-core.FutureReadError::Dropped - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - let ptr = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2Malloc(1) - defer mbt_ffi_free(ptr) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - @async-core.suspend_for_future_read( - self.handle, - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2Read( + if self.closed { + raise @async-core.FutureReadError::Dropped + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + let ptr = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2Malloc(1) + defer { mbt_ffi_free(ptr) } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + @async-core.suspend_for_future_read( self.handle, - ptr, - ), - ) catch { - err => { + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2Read(self.handle, ptr), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped } + let value = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2Lift(ptr) self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - let value = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2Lift(ptr) - self.finish_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2DropReadable( - self.handle, - ) - } - value -} - -///| -fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureLift( - handle : Int, -) -> @async-core.Future[Result[Fields?, ErrorCode]] { - let source = WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Future::from_source(() => source.read(), () => source.close(), () => { - source.close_sync() - }) + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticRequestConsumeBodyFuture2DropReadable(self.handle) + } + value +} + +fn wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureLift(handle : Int) -> @async-core.Future[Result[Fields?, ErrorCode]] { + let source = WasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Future::from_source( + () => source.read(), + () => source.close(), + () => source.close_sync(), + ) } -///| fn wasmImportConstructorRequestOptions() -> Int = "wasi:http/types@0.3.0" "[constructor]request-options" -///| -fn wasmImportMethodRequestOptionsGetConnectTimeout(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request-options.get-connect-timeout" +fn wasmImportMethodRequestOptionsGetConnectTimeout(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request-options.get-connect-timeout" -///| -fn wasmImportMethodRequestOptionsSetConnectTimeout( - p0 : Int, - p1 : Int, - p2 : Int64, - p3 : Int, -) = "wasi:http/types@0.3.0" "[method]request-options.set-connect-timeout" +fn wasmImportMethodRequestOptionsSetConnectTimeout(p0 : Int, p1 : Int, p2 : Int64, p3 : Int) = "wasi:http/types@0.3.0" "[method]request-options.set-connect-timeout" -///| -fn wasmImportMethodRequestOptionsGetFirstByteTimeout(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request-options.get-first-byte-timeout" +fn wasmImportMethodRequestOptionsGetFirstByteTimeout(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request-options.get-first-byte-timeout" -///| -fn wasmImportMethodRequestOptionsSetFirstByteTimeout( - p0 : Int, - p1 : Int, - p2 : Int64, - p3 : Int, -) = "wasi:http/types@0.3.0" "[method]request-options.set-first-byte-timeout" +fn wasmImportMethodRequestOptionsSetFirstByteTimeout(p0 : Int, p1 : Int, p2 : Int64, p3 : Int) = "wasi:http/types@0.3.0" "[method]request-options.set-first-byte-timeout" -///| -fn wasmImportMethodRequestOptionsGetBetweenBytesTimeout(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request-options.get-between-bytes-timeout" +fn wasmImportMethodRequestOptionsGetBetweenBytesTimeout(p0 : Int, p1 : Int) = "wasi:http/types@0.3.0" "[method]request-options.get-between-bytes-timeout" -///| -fn wasmImportMethodRequestOptionsSetBetweenBytesTimeout( - p0 : Int, - p1 : Int, - p2 : Int64, - p3 : Int, -) = "wasi:http/types@0.3.0" "[method]request-options.set-between-bytes-timeout" +fn wasmImportMethodRequestOptionsSetBetweenBytesTimeout(p0 : Int, p1 : Int, p2 : Int64, p3 : Int) = "wasi:http/types@0.3.0" "[method]request-options.set-between-bytes-timeout" -///| fn wasmImportMethodRequestOptionsClone(p0 : Int) -> Int = "wasi:http/types@0.3.0" "[method]request-options.clone" -///| -fn wasmImportStaticResponseNew( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, - p4 : Int, -) = "wasi:http/types@0.3.0" "[static]response.new" - -///| -fn wasmImportWasiHttpTypes030StaticResponseNewStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][stream-read-0][static]response.new" +fn wasmImportStaticResponseNew(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) = "wasi:http/types@0.3.0" "[static]response.new" -///| -fn wasmImportWasiHttpTypes030StaticResponseNewStream0CancelRead( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[stream-cancel-read-0][static]response.new" +fn wasmImportWasiHttpTypes030StaticResponseNewStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][stream-read-0][static]response.new" +fn wasmImportWasiHttpTypes030StaticResponseNewStream0CancelRead(handle : Int) -> Int = "wasi:http/types@0.3.0" "[stream-cancel-read-0][static]response.new" -///| fn wasmImportWasiHttpTypes030StaticResponseNewStream0DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[stream-drop-readable-0][static]response.new" -///| fn wasmImportWasiHttpTypes030StaticResponseNewStream0New() -> UInt64 = "wasi:http/types@0.3.0" "[stream-new-0][static]response.new" +fn wasmImportWasiHttpTypes030StaticResponseNewStream0Write(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][stream-write-0][static]response.new" -///| -fn wasmImportWasiHttpTypes030StaticResponseNewStream0Write( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][stream-write-0][static]response.new" +fn wasmImportWasiHttpTypes030StaticResponseNewStream0CancelWrite(handle : Int) -> Int = "wasi:http/types@0.3.0" "[stream-cancel-write-0][static]response.new" -///| -fn wasmImportWasiHttpTypes030StaticResponseNewStream0CancelWrite( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[stream-cancel-write-0][static]response.new" - -///| fn wasmImportWasiHttpTypes030StaticResponseNewStream0DropWritable(handle : Int) = "wasi:http/types@0.3.0" "[stream-drop-writable-0][static]response.new" -///| fn wasmWasiHttpTypes030StaticResponseNewStream0Malloc(length : Int) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmWasiHttpTypes030StaticResponseNewStream0Commit( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmWasiHttpTypes030StaticResponseNewStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| -fn wasmWasiHttpTypes030StaticResponseNewStream0Lower( - value : Byte, - ptr : Int, -) -> Unit { - mbt_ffi_store8(ptr + 0, value.to_int()) +fn wasmWasiHttpTypes030StaticResponseNewStream0Lower(value : Byte, ptr : Int) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).to_int()) + } -///| fn wasmWasiHttpTypes030StaticResponseNewStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmWasiHttpTypes030StaticResponseNewStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiHttpTypes030StaticResponseNewStream0StreamSource::finish_read( - self : WasmWasiHttpTypes030StaticResponseNewStream0StreamSource, +self : WasmWasiHttpTypes030StaticResponseNewStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiHttpTypes030StaticResponseNewStream0StreamSource::wait_for_read_cleanup( - self : WasmWasiHttpTypes030StaticResponseNewStream0StreamSource, +self : WasmWasiHttpTypes030StaticResponseNewStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiHttpTypes030StaticResponseNewStream0StreamSource::cancel_active_read( - self : WasmWasiHttpTypes030StaticResponseNewStream0StreamSource, -) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiHttpTypes030StaticResponseNewStream0CancelRead( - self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiHttpTypes030StaticResponseNewStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() -} - -///| -async fn WasmWasiHttpTypes030StaticResponseNewStream0StreamSource::close( - self : WasmWasiHttpTypes030StaticResponseNewStream0StreamSource, +self : WasmWasiHttpTypes030StaticResponseNewStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiHttpTypes030StaticResponseNewStream0DropReadable(self.handle) -} - -///| -fn WasmWasiHttpTypes030StaticResponseNewStream0StreamSource::close_sync( - self : WasmWasiHttpTypes030StaticResponseNewStream0StreamSource, -) -> Unit { - if self.closed || self.reading { - return - } - - if wasmWasiHttpTypes030StaticResponseNewStream0StreamRejectPrepared( - self.handle, - ) { - self.closed = true - return - } - - self.closed = true - wasmImportWasiHttpTypes030StaticResponseNewStream0DropReadable(self.handle) -} - -///| -async fn WasmWasiHttpTypes030StaticResponseNewStream0StreamSource::read( - self : WasmWasiHttpTypes030StaticResponseNewStream0StreamSource, - count : Int, -) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiHttpTypes030StaticResponseNewStream0Malloc(read_count) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiHttpTypes030StaticResponseNewStream0Read( - self.handle, - ptr, - read_count, - ), - ) catch { - err => { + if !self.reading { + return + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticResponseNewStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + return } - self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiHttpTypes030StaticResponseNewStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmWasiHttpTypes030StaticResponseNewStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmWasiHttpTypes030StaticResponseNewStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) -} - -///| -priv struct WasmWasiHttpTypes030StaticResponseNewStream0StreamProducer { - stream : @async-core.Stream[Byte] - writer : Int -} - -///| -let wasmWasiHttpTypes030StaticResponseNewStream0StreamProducers : Map[ - Int, - WasmWasiHttpTypes030StaticResponseNewStream0StreamProducer, -] = Map([]) - -///| -fn wasmWasiHttpTypes030StaticResponseNewStream0StreamRejectPrepared( - handle : Int, -) -> Bool { - guard wasmWasiHttpTypes030StaticResponseNewStream0StreamProducers.get(handle) - is Some(prepared) else { - return false - } - wasmWasiHttpTypes030StaticResponseNewStream0StreamProducers.remove(handle) - let writer = prepared.writer - wasmImportWasiHttpTypes030StaticResponseNewStream0DropReadable(handle) - wasmImportWasiHttpTypes030StaticResponseNewStream0DropWritable(writer) - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( () => { - prepared.stream.reject((value : Byte) => { - let ptr = wasmWasiHttpTypes030StaticResponseNewStream0Malloc(1) - wasmWasiHttpTypes030StaticResponseNewStream0Lower(value, ptr) - wasmWasiHttpTypes030StaticResponseNewStream0Reject(ptr, 0, 1) - mbt_ffi_free(ptr) - }) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - }) - true -} - -///| -fn wasmWasiHttpTypes030StaticResponseNewStream0StreamCommit( - handle : Int, -) -> Unit { - guard wasmWasiHttpTypes030StaticResponseNewStream0StreamProducers.get(handle) - is Some(prepared) else { - return - } - wasmWasiHttpTypes030StaticResponseNewStream0StreamProducers.remove(handle) - let stream = prepared.stream - let writer = prepared.writer - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let producer = stream.take_producer() - @async-core.spawn_component_task_current(async fn() { - let writer_closed = Ref(false) - let writer_lock = @async-core.Mutex() - let close_writer = fn() -> Unit { - if !writer_closed.val { - writer_closed.val = true - wasmImportWasiHttpTypes030StaticResponseNewStream0DropWritable(writer) - } - } - let close_writer_serialized = async fn() -> Unit { - writer_lock.acquire() - defer writer_lock.release() - close_writer() - } - let cleanup_value = fn(value : Byte) -> Unit { - let ptr = wasmWasiHttpTypes030StaticResponseNewStream0Malloc(1) - wasmWasiHttpTypes030StaticResponseNewStream0Lower(value, ptr) - wasmWasiHttpTypes030StaticResponseNewStream0Reject(ptr, 0, 1) - mbt_ffi_free(ptr) - } - let sink = @async-core.Sink::from_callbacks( - (data : ArrayView[Byte]) => { - writer_lock.acquire() - defer writer_lock.release() - if writer_closed.val || data.length() == 0 { - return 0 - } - let data_len = if data.length() < 64 { data.length() } else { 64 } - let ptr = wasmWasiHttpTypes030StaticResponseNewStream0Malloc(data_len) - for i in 0.. Unit { - wasmWasiHttpTypes030StaticResponseNewStream0Commit( - ptr, 0, transferred, - ) - if transferred < data_len { - wasmWasiHttpTypes030StaticResponseNewStream0Reject( - ptr, - transferred, - data_len - transferred, + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, + self.handle, + () => wasmImportWasiHttpTypes030StaticResponseNewStream0CancelRead(self.handle), ) - } - mbt_ffi_free(ptr) - } - let mut total = 0 - let mut dropped = false - while total < data_len { - let (progress, end) = @async-core.suspend_for_stream_write( - writer, - wasmImportWasiHttpTypes030StaticResponseNewStream0Write( - writer, - ptr + total * 1, - data_len - total, - ), - ) catch { - _ => { - total = total + - @async-core.cancel_stream_write(writer, () => { - wasmImportWasiHttpTypes030StaticResponseNewStream0CancelWrite( - writer, - ) - }) - settle_staging(total) - close_writer() - return data_len - } - } - total = total + progress - if end { - dropped = true - break - } - } - settle_staging(total) - if dropped { - close_writer() - } - // The canonical writer accepted `total`; generated cleanup - // consumed the rest of this staging window. - data_len }, - () => close_writer_serialized(), - () => !writer_closed.val, - Some(cleanup_value), - ) - let relay_source = producer is None - let run_producer = async fn() -> Unit { - match producer { - Some(producer) => { - producer(sink) - sink.close() - } - None => - for ;; { - match stream.read(64) { - Some(data) => - if !sink.write_all(data[:]) { - stream.reject(cleanup_value) - return - } - None => { - sink.close() - return - } - } - } - } - } - run_producer() catch { - _ => - if relay_source { - @async-core.protect_from_cancel( - () => stream.reject(cleanup_value), - resume_on_cancel=true, - ) catch { - _ => () - } - } - } - // A retained Sink may still own an in-flight canonical write after its - // producer returns. Do not drop the writable endpoint until that write - // has reached a terminal event and released its staging buffer. - @async-core.protect_from_cancel( - () => close_writer_serialized(), resume_on_cancel=true, - ) - }) -} - -///| -fn wasmWasiHttpTypes030StaticResponseNewStream0StreamLower( - stream : @async-core.Stream[Byte], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let pair = wasmImportWasiHttpTypes030StaticResponseNewStream0New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmWasiHttpTypes030StaticResponseNewStream0StreamProducers.set(reader, { - stream, - writer, - }) - reader -} - -///| -fn wasmImportWasiHttpTypes030StaticResponseNewFuture1Read( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-1][static]response.new" - -///| -fn wasmImportWasiHttpTypes030StaticResponseNewFuture1CancelRead( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-1][static]response.new" - -///| -fn wasmImportWasiHttpTypes030StaticResponseNewFuture1DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-readable-1][static]response.new" - -///| -fn wasmImportWasiHttpTypes030StaticResponseNewFuture1New() -> UInt64 = "wasi:http/types@0.3.0" "[future-new-1][static]response.new" - -///| -fn wasmImportWasiHttpTypes030StaticResponseNewFuture1Write( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-write-1][static]response.new" - -///| -fn wasmImportWasiHttpTypes030StaticResponseNewFuture1DropWritable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-writable-1][static]response.new" - -///| -fn wasmWasiHttpTypes030StaticResponseNewFuture1Malloc(length : Int) -> Int { - let ptr = mbt_ffi_malloc(40 * length) - ptr -} - -///| -fn wasmWasiHttpTypes030StaticResponseNewFuture1Commit( - ptr : Int, - start : Int, - length : Int, -) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 40 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => () - _ => panic() - } - 1 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - _ => panic() - } - 23 => () - 24 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 31 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - } -} - -///| -fn wasmWasiHttpTypes030StaticResponseNewFuture1Reject( - ptr : Int, - start : Int, - length : Int, -) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 40 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => Fields::Fields(mbt_ffi_load32(elem_ptr + 12)).drop() - _ => panic() - } - 1 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - _ => panic() - } - 23 => () - 24 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 31 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - } + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiHttpTypes030StaticResponseNewStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| -fn wasmWasiHttpTypes030StaticResponseNewFuture1Lift( - ptr : Int, -) -> Result[Fields?, ErrorCode] { - let lifted31 = match mbt_ffi_load8_u(ptr + 0) { - 0 => { - let lifted : Fields? = match mbt_ffi_load8_u(ptr + 8) { - 0 => Option::None - 1 => Option::Some(Fields::Fields(mbt_ffi_load32(ptr + 12))) - _ => panic() - } - - Result::Ok(lifted) - } - 1 => { - let lifted30 = match mbt_ffi_load8_u(ptr + 8) { - 0 => ErrorCode::DnsTimeout - 1 => { - let lifted0 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result) - } - _ => panic() - } - - let lifted1 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load16_u(ptr + 30).land(0xFFFF).reinterpret_as_uint(), - ) - _ => panic() - } - - ErrorCode::DnsError(DnsErrorPayload::{ - rcode: lifted0, - info_code: lifted1, - }) - } - 2 => ErrorCode::DestinationNotFound - 3 => ErrorCode::DestinationUnavailable - 4 => ErrorCode::DestinationIpProhibited - 5 => ErrorCode::DestinationIpUnroutable - 6 => ErrorCode::ConnectionRefused - 7 => ErrorCode::ConnectionTerminated - 8 => ErrorCode::ConnectionTimeout - 9 => ErrorCode::ConnectionReadTimeout - 10 => ErrorCode::ConnectionWriteTimeout - 11 => ErrorCode::ConnectionLimitReached - 12 => ErrorCode::TlsProtocolError - 13 => ErrorCode::TlsCertificateError - 14 => { - let lifted2 : Byte? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load8_u(ptr + 17).to_byte()) - _ => panic() - } - - let lifted4 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) - - Option::Some(result3) - } - _ => panic() - } - - ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{ - alert_id: lifted2, - alert_message: lifted4, - }) - } - 15 => ErrorCode::HttpRequestDenied - 16 => ErrorCode::HttpRequestLengthRequired - 17 => { - let lifted5 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpRequestBodySize(lifted5) - } - 18 => ErrorCode::HttpRequestMethodInvalid - 19 => ErrorCode::HttpRequestUriInvalid - 20 => ErrorCode::HttpRequestUriTooLong - 21 => { - let lifted6 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestHeaderSectionSize(lifted6) - } - 22 => { - let lifted10 : FieldSizePayload? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let lifted8 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result7 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) - - Option::Some(result7) - } - _ => panic() - } - - let lifted9 : UInt? = match mbt_ffi_load8_u(ptr + 32) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(ptr + 36).reinterpret_as_uint()) - _ => panic() - } - - Option::Some(FieldSizePayload::{ - field_name: lifted8, - field_size: lifted9, - }) - } - _ => panic() - } - - ErrorCode::HttpRequestHeaderSize(lifted10) - } - 23 => { - let lifted11 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSectionSize(lifted11) - } - 24 => { - let lifted13 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result12 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result12) - } - _ => panic() - } - - let lifted14 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{ - field_name: lifted13, - field_size: lifted14, - }) - } - 25 => ErrorCode::HttpResponseIncomplete - 26 => { - let lifted15 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseHeaderSectionSize(lifted15) - } - 27 => { - let lifted17 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result16 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result16) - } - _ => panic() - } - - let lifted18 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{ - field_name: lifted17, - field_size: lifted18, - }) - } - 28 => { - let lifted19 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpResponseBodySize(lifted19) - } - 29 => { - let lifted20 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseTrailerSectionSize(lifted20) - } - 30 => { - let lifted22 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result21) - } - _ => panic() - } +async fn WasmWasiHttpTypes030StaticResponseNewStream0StreamSource::close( +self : WasmWasiHttpTypes030StaticResponseNewStream0StreamSource, +) -> Unit noraise { + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiHttpTypes030StaticResponseNewStream0DropReadable(self.handle) +} - let lifted23 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{ - field_name: lifted22, - field_size: lifted23, - }) - } - 31 => { - let lifted25 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result24 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) +fn WasmWasiHttpTypes030StaticResponseNewStream0StreamSource::close_sync( +self : WasmWasiHttpTypes030StaticResponseNewStream0StreamSource, +) -> Unit { + if self.closed || self.reading { + return + } - Option::Some(result24) - } - _ => panic() - } + if wasmWasiHttpTypes030StaticResponseNewStream0StreamRejectPrepared(self.handle) { + self.closed = true + return + } - ErrorCode::HttpResponseTransferCoding(lifted25) - } - 32 => { - let lifted27 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result26 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + self.closed = true + wasmImportWasiHttpTypes030StaticResponseNewStream0DropReadable(self.handle) +} - Option::Some(result26) +async fn WasmWasiHttpTypes030StaticResponseNewStream0StreamSource::read( +self : WasmWasiHttpTypes030StaticResponseNewStream0StreamSource, +count : Int, +) -> FixedArray[Byte]? { + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiHttpTypes030StaticResponseNewStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) } - _ => panic() - } - - ErrorCode::HttpResponseContentCoding(lifted27) - } - 33 => ErrorCode::HttpResponseTimeout - 34 => ErrorCode::HttpUpgradeFailed - 35 => ErrorCode::HttpProtocolError - 36 => ErrorCode::LoopDetected - 37 => ErrorCode::ConfigurationError - 38 => { - let lifted29 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result28 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result28) + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( + self.handle, + wasmImportWasiHttpTypes030StaticResponseNewStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticResponseNewStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err } - _ => panic() - } - - ErrorCode::InternalError(lifted29) - } - _ => panic() } - - Result::Err(lifted30) - } - _ => panic() - } - - lifted31 + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) + } + let values = wasmWasiHttpTypes030StaticResponseNewStream0ListLift(ptr, progress) + owns_buffer = true + self.finish_read() + if end { + self.close() + } + Some(values) +} + +fn wasmWasiHttpTypes030StaticResponseNewStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmWasiHttpTypes030StaticResponseNewStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| -fn wasmWasiHttpTypes030StaticResponseNewFuture1Lower( - value : Result[Fields?, ErrorCode], - ptr : Int, -) -> Unit { - match value { - Ok(payload) => { - mbt_ffi_store8(ptr + 0, 0) - - match payload { - None => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - Some(payload1) => { - mbt_ffi_store8(ptr + 8, 1) +priv struct WasmWasiHttpTypes030StaticResponseNewStream0StreamProducer { + stream : @async-core.Stream[Byte] + writer : Int +} - let Fields(handle) = payload1 - mbt_ffi_store32(ptr + 12, handle) +let wasmWasiHttpTypes030StaticResponseNewStream0StreamProducers : Map[Int, WasmWasiHttpTypes030StaticResponseNewStream0StreamProducer] = Map([]) - () - } +fn wasmWasiHttpTypes030StaticResponseNewStream0StreamRejectPrepared(handle : Int) -> Bool { + guard wasmWasiHttpTypes030StaticResponseNewStream0StreamProducers.get(handle) is Some(prepared) else { + return false } + wasmWasiHttpTypes030StaticResponseNewStream0StreamProducers.remove(handle) + let writer = prepared.writer + wasmImportWasiHttpTypes030StaticResponseNewStream0DropReadable(handle) + wasmImportWasiHttpTypes030StaticResponseNewStream0DropWritable(writer) + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + prepared.stream.reject((value : Byte) => { + let ptr = wasmWasiHttpTypes030StaticResponseNewStream0Malloc(1) + wasmWasiHttpTypes030StaticResponseNewStream0Lower(value, ptr) + wasmWasiHttpTypes030StaticResponseNewStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + }) + true +} - () - } - Err(payload2) => { - mbt_ffi_store8(ptr + 0, 1) +fn wasmWasiHttpTypes030StaticResponseNewStream0StreamCommit(handle : Int) -> Unit { + guard wasmWasiHttpTypes030StaticResponseNewStream0StreamProducers.get(handle) is Some(prepared) else { + return + } + wasmWasiHttpTypes030StaticResponseNewStream0StreamProducers.remove(handle) + let stream = prepared.stream + let writer = prepared.writer + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let producer = stream.take_producer() + @async-core.spawn_component_task_current(async fn() { + let writer_closed = Ref(false) + let writer_lock = @async-core.Mutex() + let close_writer = fn() -> Unit { + if !writer_closed.val { + writer_closed.val = true + wasmImportWasiHttpTypes030StaticResponseNewStream0DropWritable(writer) + } + } + let close_writer_serialized = async fn() -> Unit { + writer_lock.acquire() + defer writer_lock.release() + close_writer() + } + let cleanup_value = fn(value : Byte) -> Unit { + let ptr = wasmWasiHttpTypes030StaticResponseNewStream0Malloc(1) + wasmWasiHttpTypes030StaticResponseNewStream0Lower(value, ptr) + wasmWasiHttpTypes030StaticResponseNewStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + } + let sink = @async-core.Sink::from_callbacks( + (data : ArrayView[Byte]) => { + writer_lock.acquire() + defer writer_lock.release() + if writer_closed.val || data.length() == 0 { + return 0 + } + let data_len = if data.length() < 64 { + data.length() + } else { + 64 + } + let ptr = wasmWasiHttpTypes030StaticResponseNewStream0Malloc(data_len) + for i in 0.. Unit { + wasmWasiHttpTypes030StaticResponseNewStream0Commit(ptr, 0, transferred) + if transferred < data_len { + wasmWasiHttpTypes030StaticResponseNewStream0Reject( + ptr, + transferred, + data_len - transferred, + ) + } + mbt_ffi_free(ptr) + } + let mut total = 0 + let mut dropped = false + while total < data_len { + let (progress, end) = @async-core.suspend_for_stream_write( + writer, + wasmImportWasiHttpTypes030StaticResponseNewStream0Write( + writer, + ptr + total * 1, + data_len - total, + ), + ) catch { + _ => { + total = total + @async-core.cancel_stream_write( + writer, + () => wasmImportWasiHttpTypes030StaticResponseNewStream0CancelWrite(writer), + ) + settle_staging(total) + close_writer() + return data_len + } + } + total = total + progress + if end { + dropped = true + break + } + } + settle_staging(total) + if dropped { + close_writer() + } + // The canonical writer accepted `total`; generated cleanup + // consumed the rest of this staging window. + data_len + }, + () => close_writer_serialized(), + () => !writer_closed.val, + Some(cleanup_value), + ) + let relay_source = producer is None + let run_producer = async fn() -> Unit { + match producer { + Some(producer) => { + producer(sink) + sink.close() + } + None => + for ;; { + match stream.read(64) { + Some(data) => + if !sink.write_all(data[:]) { + stream.reject(cleanup_value) + return + } + None => { + sink.close() + return + } + } + } + } + } + run_producer() catch { + _ => + if relay_source { + @async-core.protect_from_cancel( + () => stream.reject(cleanup_value), + resume_on_cancel=true, + ) catch { + _ => () + } + } + } + // A retained Sink may still own an in-flight canonical write after its + // producer returns. Do not drop the writable endpoint until that write + // has reached a terminal event and released its staging buffer. + @async-core.protect_from_cancel( + () => close_writer_serialized(), + resume_on_cancel=true, + ) + }) +} - match payload2 { - DnsTimeout => { - mbt_ffi_store8(ptr + 8, 0) +fn wasmWasiHttpTypes030StaticResponseNewStream0StreamLower(stream : @async-core.Stream[Byte]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let pair = wasmImportWasiHttpTypes030StaticResponseNewStream0New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmWasiHttpTypes030StaticResponseNewStream0StreamProducers.set(reader, { stream, writer }) + reader +} - () - } - DnsError(payload4) => { - mbt_ffi_store8(ptr + 8, 1) +fn wasmImportWasiHttpTypes030StaticResponseNewFuture1Read(handle : Int, buffer_ptr : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-1][static]response.new" +fn wasmImportWasiHttpTypes030StaticResponseNewFuture1CancelRead(handle : Int) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-1][static]response.new" - match payload4.rcode { - None => { - mbt_ffi_store8(ptr + 16, 0) +fn wasmImportWasiHttpTypes030StaticResponseNewFuture1DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-readable-1][static]response.new" - () - } - Some(payload6) => { - mbt_ffi_store8(ptr + 16, 1) +fn wasmImportWasiHttpTypes030StaticResponseNewFuture1New() -> UInt64 = "wasi:http/types@0.3.0" "[future-new-1][static]response.new" +fn wasmImportWasiHttpTypes030StaticResponseNewFuture1Write(handle : Int, buffer_ptr : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-write-1][static]response.new" - let ptr7 = mbt_ffi_str2ptr(payload6) - mbt_ffi_store32(ptr + 24, payload6.length()) - mbt_ffi_store32(ptr + 20, ptr7) +fn wasmImportWasiHttpTypes030StaticResponseNewFuture1DropWritable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-writable-1][static]response.new" - () - } - } +fn wasmWasiHttpTypes030StaticResponseNewFuture1Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(40 * length) + ptr +} - match payload4.info_code { - None => { - mbt_ffi_store8(ptr + 28, 0) +fn wasmWasiHttpTypes030StaticResponseNewFuture1Commit( +ptr : Int, +start : Int, +length : Int, +) -> Unit { - () + for i in start..<(start + length) { + let elem_ptr = ptr + i * 40 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => () + _ => panic() + } + + } + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() } - Some(payload9) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store16(ptr + 30, payload9.reinterpret_as_int()) - () - } - } - - () - } - DestinationNotFound => { - mbt_ffi_store8(ptr + 8, 2) - - () - } - DestinationUnavailable => { - mbt_ffi_store8(ptr + 8, 3) - - () - } - DestinationIpProhibited => { - mbt_ffi_store8(ptr + 8, 4) - - () - } - DestinationIpUnroutable => { - mbt_ffi_store8(ptr + 8, 5) - - () - } - ConnectionRefused => { - mbt_ffi_store8(ptr + 8, 6) - - () - } - ConnectionTerminated => { - mbt_ffi_store8(ptr + 8, 7) - - () - } - ConnectionTimeout => { - mbt_ffi_store8(ptr + 8, 8) - - () - } - ConnectionReadTimeout => { - mbt_ffi_store8(ptr + 8, 9) - - () - } - ConnectionWriteTimeout => { - mbt_ffi_store8(ptr + 8, 10) - - () - } - ConnectionLimitReached => { - mbt_ffi_store8(ptr + 8, 11) - - () - } - TlsProtocolError => { - mbt_ffi_store8(ptr + 8, 12) - - () - } - TlsCertificateError => { - mbt_ffi_store8(ptr + 8, 13) - - () - } - TlsAlertReceived(payload22) => { - mbt_ffi_store8(ptr + 8, 14) - - match payload22.alert_id { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload24) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store8(ptr + 17, payload24.to_int()) + } - () - } - } +} - match payload22.alert_message { - None => { - mbt_ffi_store8(ptr + 20, 0) +fn wasmWasiHttpTypes030StaticResponseNewFuture1Reject( +ptr : Int, +start : Int, +length : Int, +) -> Unit { - () + for i in start..<(start + length) { + let elem_ptr = ptr + i * 40 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + Fields::Fields(mbt_ffi_load32((elem_ptr) + 12)).drop() + + } + _ => panic() + } + + } + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() } - Some(payload26) => { - mbt_ffi_store8(ptr + 20, 1) - let ptr27 = mbt_ffi_str2ptr(payload26) - mbt_ffi_store32(ptr + 28, payload26.length()) - mbt_ffi_store32(ptr + 24, ptr27) - - () - } - } + } - () - } - HttpRequestDenied => { - mbt_ffi_store8(ptr + 8, 15) +} - () - } - HttpRequestLengthRequired => { - mbt_ffi_store8(ptr + 8, 16) +fn wasmWasiHttpTypes030StaticResponseNewFuture1Lift(ptr : Int) -> Result[Fields?, ErrorCode] { - () - } - HttpRequestBodySize(payload30) => { - mbt_ffi_store8(ptr + 8, 17) + let lifted31 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { - match payload30 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let lifted : Fields? = match mbt_ffi_load8_u((ptr) + 8) { + 0 => Option::None + 1 => { - () - } - Some(payload32) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store64(ptr + 24, payload32.reinterpret_as_int64()) + Option::Some(Fields::Fields(mbt_ffi_load32((ptr) + 12))) + } + _ => panic() + } - () + Result::Ok(lifted) } - } - - () - } - HttpRequestMethodInvalid => { - mbt_ffi_store8(ptr + 8, 18) + 1 => { - () - } - HttpRequestUriInvalid => { - mbt_ffi_store8(ptr + 8, 19) + let lifted30 = match (mbt_ffi_load8_u((ptr) + 8)) { + 0 => { - () - } - HttpRequestUriTooLong => { - mbt_ffi_store8(ptr + 8, 20) + ErrorCode::DnsTimeout + } + 1 => { - () - } - HttpRequestHeaderSectionSize(payload36) => { - mbt_ffi_store8(ptr + 8, 21) + let lifted0 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - match payload36 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - Some(payload38) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload38.reinterpret_as_int()) + Option::Some(result) + } + _ => panic() + } - () - } - } + let lifted1 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { - () - } - HttpRequestHeaderSize(payload39) => { - mbt_ffi_store8(ptr + 8, 22) + Option::Some((mbt_ffi_load16_u((ptr) + 30).land(0xFFFF).reinterpret_as_uint())) + } + _ => panic() + } - match payload39 { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::DnsError(DnsErrorPayload::{rcode : lifted0, info_code : lifted1}) + } + 2 => { - () - } - Some(payload41) => { - mbt_ffi_store8(ptr + 16, 1) + ErrorCode::DestinationNotFound + } + 3 => { - match payload41.field_name { - None => { - mbt_ffi_store8(ptr + 20, 0) + ErrorCode::DestinationUnavailable + } + 4 => { - () - } - Some(payload43) => { - mbt_ffi_store8(ptr + 20, 1) + ErrorCode::DestinationIpProhibited + } + 5 => { - let ptr44 = mbt_ffi_str2ptr(payload43) - mbt_ffi_store32(ptr + 28, payload43.length()) - mbt_ffi_store32(ptr + 24, ptr44) + ErrorCode::DestinationIpUnroutable + } + 6 => { - () - } - } + ErrorCode::ConnectionRefused + } + 7 => { - match payload41.field_size { - None => { - mbt_ffi_store8(ptr + 32, 0) + ErrorCode::ConnectionTerminated + } + 8 => { - () - } - Some(payload46) => { - mbt_ffi_store8(ptr + 32, 1) - mbt_ffi_store32(ptr + 36, payload46.reinterpret_as_int()) + ErrorCode::ConnectionTimeout + } + 9 => { - () - } - } + ErrorCode::ConnectionReadTimeout + } + 10 => { - () - } - } + ErrorCode::ConnectionWriteTimeout + } + 11 => { - () - } - HttpRequestTrailerSectionSize(payload47) => { - mbt_ffi_store8(ptr + 8, 23) + ErrorCode::ConnectionLimitReached + } + 12 => { - match payload47 { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::TlsProtocolError + } + 13 => { - () - } - Some(payload49) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload49.reinterpret_as_int()) + ErrorCode::TlsCertificateError + } + 14 => { - () - } - } + let lifted2 : Byte? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - HttpRequestTrailerSize(payload50) => { - mbt_ffi_store8(ptr + 8, 24) + Option::Some((mbt_ffi_load8_u((ptr) + 17)).to_byte()) + } + _ => panic() + } - match payload50.field_name { - None => { - mbt_ffi_store8(ptr + 16, 0) + let lifted4 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { - () - } - Some(payload52) => { - mbt_ffi_store8(ptr + 16, 1) + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) - let ptr53 = mbt_ffi_str2ptr(payload52) - mbt_ffi_store32(ptr + 24, payload52.length()) - mbt_ffi_store32(ptr + 20, ptr53) + Option::Some(result3) + } + _ => panic() + } - () - } - } + ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{alert_id : lifted2, alert_message : lifted4}) + } + 15 => { - match payload50.field_size { - None => { - mbt_ffi_store8(ptr + 28, 0) + ErrorCode::HttpRequestDenied + } + 16 => { - () - } - Some(payload55) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store32(ptr + 32, payload55.reinterpret_as_int()) + ErrorCode::HttpRequestLengthRequired + } + 17 => { - () - } - } + let lifted5 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpRequestBodySize(lifted5) + } + 18 => { + + ErrorCode::HttpRequestMethodInvalid + } + 19 => { + + ErrorCode::HttpRequestUriInvalid + } + 20 => { + + ErrorCode::HttpRequestUriTooLong + } + 21 => { + + let lifted6 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSectionSize(lifted6) + } + 22 => { + + let lifted10 : FieldSizePayload? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let lifted8 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { + + let result7 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) + + Option::Some(result7) + } + _ => panic() + } + + let lifted9 : UInt? = match mbt_ffi_load8_u((ptr) + 32) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 36)).reinterpret_as_uint()) + } + _ => panic() + } + + Option::Some(FieldSizePayload::{field_name : lifted8, field_size : lifted9}) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSize(lifted10) + } + 23 => { + + let lifted11 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSectionSize(lifted11) + } + 24 => { + + let lifted13 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result12 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result12) + } + _ => panic() + } + + let lifted14 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{field_name : lifted13, field_size : lifted14}) + } + 25 => { + + ErrorCode::HttpResponseIncomplete + } + 26 => { + + let lifted15 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - HttpResponseIncomplete => { - mbt_ffi_store8(ptr + 8, 25) + ErrorCode::HttpResponseHeaderSectionSize(lifted15) + } + 27 => { - () - } - HttpResponseHeaderSectionSize(payload57) => { - mbt_ffi_store8(ptr + 8, 26) + let lifted17 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - match payload57 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let result16 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result16) + } + _ => panic() + } + + let lifted18 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - Some(payload59) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload59.reinterpret_as_int()) + ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{field_name : lifted17, field_size : lifted18}) + } + 28 => { + + let lifted19 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - } + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpResponseBodySize(lifted19) + } + 29 => { - () - } - HttpResponseHeaderSize(payload60) => { - mbt_ffi_store8(ptr + 8, 27) + let lifted20 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - match payload60.field_name { - None => { - mbt_ffi_store8(ptr + 16, 0) + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - Some(payload62) => { - mbt_ffi_store8(ptr + 16, 1) + ErrorCode::HttpResponseTrailerSectionSize(lifted20) + } + 30 => { - let ptr63 = mbt_ffi_str2ptr(payload62) - mbt_ffi_store32(ptr + 24, payload62.length()) - mbt_ffi_store32(ptr + 20, ptr63) + let lifted22 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - } + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - match payload60.field_size { - None => { - mbt_ffi_store8(ptr + 28, 0) + Option::Some(result21) + } + _ => panic() + } - () - } - Some(payload65) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store32(ptr + 32, payload65.reinterpret_as_int()) + let lifted23 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { - () - } - } + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - HttpResponseBodySize(payload66) => { - mbt_ffi_store8(ptr + 8, 28) + ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{field_name : lifted22, field_size : lifted23}) + } + 31 => { - match payload66 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let lifted25 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload68) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store64(ptr + 24, payload68.reinterpret_as_int64()) + let result24 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - } + Option::Some(result24) + } + _ => panic() + } - () - } - HttpResponseTrailerSectionSize(payload69) => { - mbt_ffi_store8(ptr + 8, 29) + ErrorCode::HttpResponseTransferCoding(lifted25) + } + 32 => { - match payload69 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let lifted27 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload71) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload71.reinterpret_as_int()) + let result26 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - } + Option::Some(result26) + } + _ => panic() + } - () - } - HttpResponseTrailerSize(payload72) => { - mbt_ffi_store8(ptr + 8, 30) + ErrorCode::HttpResponseContentCoding(lifted27) + } + 33 => { - match payload72.field_name { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::HttpResponseTimeout + } + 34 => { - () - } - Some(payload74) => { - mbt_ffi_store8(ptr + 16, 1) + ErrorCode::HttpUpgradeFailed + } + 35 => { - let ptr75 = mbt_ffi_str2ptr(payload74) - mbt_ffi_store32(ptr + 24, payload74.length()) - mbt_ffi_store32(ptr + 20, ptr75) + ErrorCode::HttpProtocolError + } + 36 => { - () - } - } + ErrorCode::LoopDetected + } + 37 => { - match payload72.field_size { - None => { - mbt_ffi_store8(ptr + 28, 0) + ErrorCode::ConfigurationError + } + 38 => { - () - } - Some(payload77) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store32(ptr + 32, payload77.reinterpret_as_int()) + let lifted29 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - } + let result28 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - HttpResponseTransferCoding(payload78) => { - mbt_ffi_store8(ptr + 8, 31) + Option::Some(result28) + } + _ => panic() + } - match payload78 { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::InternalError(lifted29) + } + _ => panic() + } - () + Result::Err(lifted30) } - Some(payload80) => { - mbt_ffi_store8(ptr + 16, 1) - - let ptr81 = mbt_ffi_str2ptr(payload80) - mbt_ffi_store32(ptr + 24, payload80.length()) - mbt_ffi_store32(ptr + 20, ptr81) + _ => panic() + } - () - } - } + lifted31 +} - () - } - HttpResponseContentCoding(payload82) => { - mbt_ffi_store8(ptr + 8, 32) +fn wasmWasiHttpTypes030StaticResponseNewFuture1Lower(value : Result[Fields?, ErrorCode], ptr : Int) -> Unit { - match payload82 { - None => { - mbt_ffi_store8(ptr + 16, 0) + match value { + Ok(payload) => { + mbt_ffi_store8((ptr) + 0, (0)) - () - } - Some(payload84) => { - mbt_ffi_store8(ptr + 16, 1) + match (payload) { + None => { + mbt_ffi_store8((ptr) + 8, (0)) - let ptr85 = mbt_ffi_str2ptr(payload84) - mbt_ffi_store32(ptr + 24, payload84.length()) - mbt_ffi_store32(ptr + 20, ptr85) + () + } + Some(payload1) => { + mbt_ffi_store8((ptr) + 8, (1)) - () - } - } - - () - } - HttpResponseTimeout => { - mbt_ffi_store8(ptr + 8, 33) - - () - } - HttpUpgradeFailed => { - mbt_ffi_store8(ptr + 8, 34) - - () - } - HttpProtocolError => { - mbt_ffi_store8(ptr + 8, 35) - - () - } - LoopDetected => { - mbt_ffi_store8(ptr + 8, 36) - - () - } - ConfigurationError => { - mbt_ffi_store8(ptr + 8, 37) - - () - } - InternalError(payload91) => { - mbt_ffi_store8(ptr + 8, 38) - - match payload91 { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload93) => { - mbt_ffi_store8(ptr + 16, 1) + let Fields(handle) = payload1 + mbt_ffi_store32((ptr) + 12, handle) - let ptr94 = mbt_ffi_str2ptr(payload93) - mbt_ffi_store32(ptr + 24, payload93.length()) - mbt_ffi_store32(ptr + 20, ptr94) + () + } + } - () + () } - } + Err(payload2) => { + mbt_ffi_store8((ptr) + 0, (1)) + + match payload2 { + DnsTimeout => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + DnsError(payload4) => { + mbt_ffi_store8((ptr) + 8, (1)) + + match ((payload4).rcode) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload6) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr7 = mbt_ffi_str2ptr(payload6) + mbt_ffi_store32((ptr) + 24, payload6.length()) + mbt_ffi_store32((ptr) + 20, ptr7) + + () + } + } + + match ((payload4).info_code) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload9) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store16((ptr) + 30, (payload9).reinterpret_as_int()) + + () + } + } + + () + } + DestinationNotFound => { + mbt_ffi_store8((ptr) + 8, (2)) + + () + } + DestinationUnavailable => { + mbt_ffi_store8((ptr) + 8, (3)) + + () + } + DestinationIpProhibited => { + mbt_ffi_store8((ptr) + 8, (4)) + + () + } + DestinationIpUnroutable => { + mbt_ffi_store8((ptr) + 8, (5)) + + () + } + ConnectionRefused => { + mbt_ffi_store8((ptr) + 8, (6)) + + () + } + ConnectionTerminated => { + mbt_ffi_store8((ptr) + 8, (7)) + + () + } + ConnectionTimeout => { + mbt_ffi_store8((ptr) + 8, (8)) + + () + } + ConnectionReadTimeout => { + mbt_ffi_store8((ptr) + 8, (9)) + + () + } + ConnectionWriteTimeout => { + mbt_ffi_store8((ptr) + 8, (10)) + + () + } + ConnectionLimitReached => { + mbt_ffi_store8((ptr) + 8, (11)) + + () + } + TlsProtocolError => { + mbt_ffi_store8((ptr) + 8, (12)) + + () + } + TlsCertificateError => { + mbt_ffi_store8((ptr) + 8, (13)) + + () + } + TlsAlertReceived(payload22) => { + mbt_ffi_store8((ptr) + 8, (14)) + + match ((payload22).alert_id) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload24) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store8((ptr) + 17, (payload24).to_int()) + + () + } + } + + match ((payload22).alert_message) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) + + () + } + Some(payload26) => { + mbt_ffi_store8((ptr) + 20, (1)) + + let ptr27 = mbt_ffi_str2ptr(payload26) + mbt_ffi_store32((ptr) + 28, payload26.length()) + mbt_ffi_store32((ptr) + 24, ptr27) + + () + } + } + + () + } + HttpRequestDenied => { + mbt_ffi_store8((ptr) + 8, (15)) + + () + } + HttpRequestLengthRequired => { + mbt_ffi_store8((ptr) + 8, (16)) + + () + } + HttpRequestBodySize(payload30) => { + mbt_ffi_store8((ptr) + 8, (17)) + + match (payload30) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload32) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store64((ptr) + 24, (payload32).reinterpret_as_int64()) + + () + } + } + + () + } + HttpRequestMethodInvalid => { + mbt_ffi_store8((ptr) + 8, (18)) + + () + } + HttpRequestUriInvalid => { + mbt_ffi_store8((ptr) + 8, (19)) + + () + } + HttpRequestUriTooLong => { + mbt_ffi_store8((ptr) + 8, (20)) + + () + } + HttpRequestHeaderSectionSize(payload36) => { + mbt_ffi_store8((ptr) + 8, (21)) + + match (payload36) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload38) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload38).reinterpret_as_int()) + + () + } + } + + () + } + HttpRequestHeaderSize(payload39) => { + mbt_ffi_store8((ptr) + 8, (22)) + + match (payload39) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload41) => { + mbt_ffi_store8((ptr) + 16, (1)) + + match ((payload41).field_name) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) + + () + } + Some(payload43) => { + mbt_ffi_store8((ptr) + 20, (1)) + + let ptr44 = mbt_ffi_str2ptr(payload43) + mbt_ffi_store32((ptr) + 28, payload43.length()) + mbt_ffi_store32((ptr) + 24, ptr44) + + () + } + } + + match ((payload41).field_size) { + None => { + mbt_ffi_store8((ptr) + 32, (0)) + + () + } + Some(payload46) => { + mbt_ffi_store8((ptr) + 32, (1)) + mbt_ffi_store32((ptr) + 36, (payload46).reinterpret_as_int()) + + () + } + } + + () + } + } + + () + } + HttpRequestTrailerSectionSize(payload47) => { + mbt_ffi_store8((ptr) + 8, (23)) + + match (payload47) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload49) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload49).reinterpret_as_int()) + + () + } + } + + () + } + HttpRequestTrailerSize(payload50) => { + mbt_ffi_store8((ptr) + 8, (24)) + + match ((payload50).field_name) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload52) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr53 = mbt_ffi_str2ptr(payload52) + mbt_ffi_store32((ptr) + 24, payload52.length()) + mbt_ffi_store32((ptr) + 20, ptr53) + + () + } + } + + match ((payload50).field_size) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload55) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store32((ptr) + 32, (payload55).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseIncomplete => { + mbt_ffi_store8((ptr) + 8, (25)) + + () + } + HttpResponseHeaderSectionSize(payload57) => { + mbt_ffi_store8((ptr) + 8, (26)) + + match (payload57) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload59) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload59).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseHeaderSize(payload60) => { + mbt_ffi_store8((ptr) + 8, (27)) + + match ((payload60).field_name) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload62) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr63 = mbt_ffi_str2ptr(payload62) + mbt_ffi_store32((ptr) + 24, payload62.length()) + mbt_ffi_store32((ptr) + 20, ptr63) + + () + } + } + + match ((payload60).field_size) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload65) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store32((ptr) + 32, (payload65).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseBodySize(payload66) => { + mbt_ffi_store8((ptr) + 8, (28)) + + match (payload66) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload68) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store64((ptr) + 24, (payload68).reinterpret_as_int64()) + + () + } + } + + () + } + HttpResponseTrailerSectionSize(payload69) => { + mbt_ffi_store8((ptr) + 8, (29)) + + match (payload69) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload71) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload71).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseTrailerSize(payload72) => { + mbt_ffi_store8((ptr) + 8, (30)) + + match ((payload72).field_name) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload74) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr75 = mbt_ffi_str2ptr(payload74) + mbt_ffi_store32((ptr) + 24, payload74.length()) + mbt_ffi_store32((ptr) + 20, ptr75) + + () + } + } + + match ((payload72).field_size) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload77) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store32((ptr) + 32, (payload77).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseTransferCoding(payload78) => { + mbt_ffi_store8((ptr) + 8, (31)) + + match (payload78) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload80) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr81 = mbt_ffi_str2ptr(payload80) + mbt_ffi_store32((ptr) + 24, payload80.length()) + mbt_ffi_store32((ptr) + 20, ptr81) + + () + } + } + + () + } + HttpResponseContentCoding(payload82) => { + mbt_ffi_store8((ptr) + 8, (32)) + + match (payload82) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload84) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr85 = mbt_ffi_str2ptr(payload84) + mbt_ffi_store32((ptr) + 24, payload84.length()) + mbt_ffi_store32((ptr) + 20, ptr85) + + () + } + } + + () + } + HttpResponseTimeout => { + mbt_ffi_store8((ptr) + 8, (33)) + + () + } + HttpUpgradeFailed => { + mbt_ffi_store8((ptr) + 8, (34)) + + () + } + HttpProtocolError => { + mbt_ffi_store8((ptr) + 8, (35)) + + () + } + LoopDetected => { + mbt_ffi_store8((ptr) + 8, (36)) + + () + } + ConfigurationError => { + mbt_ffi_store8((ptr) + 8, (37)) + + () + } + InternalError(payload91) => { + mbt_ffi_store8((ptr) + 8, (38)) + + match (payload91) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload93) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr94 = mbt_ffi_str2ptr(payload93) + mbt_ffi_store32((ptr) + 24, payload93.length()) + mbt_ffi_store32((ptr) + 20, ptr94) + + () + } + } + + () + } + } - () - } + () + } } - () - } - } } -///| priv struct WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource::finish_read( - self : WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource, +self : WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource::wait_for_read_cleanup( - self : WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource, +self : WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource::cancel_active_read( - self : WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource, +self : WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let completed = Ref(false) - @async-core.protect_from_cancel( - () => { - completed.val = @async-core.cancel_future_read( - self.read_task, - self.handle, - () => { - wasmImportWasiHttpTypes030StaticResponseNewFuture1CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let completed = Ref(false) + @async-core.protect_from_cancel( + () => { + completed.val = @async-core.cancel_future_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - if completed.val && self.read_buffer != 0 { - wasmWasiHttpTypes030StaticResponseNewFuture1Reject(self.read_buffer, 0, 1) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiHttpTypes030StaticResponseNewFuture1CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + if completed.val && self.read_buffer != 0 { + wasmWasiHttpTypes030StaticResponseNewFuture1Reject(self.read_buffer, 0, 1) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource::close( - self : WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource, +self : WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiHttpTypes030StaticResponseNewFuture1DropReadable(self.handle) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiHttpTypes030StaticResponseNewFuture1DropReadable(self.handle) } -///| fn WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource::close_sync( - self : WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource, +self : WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - if wasmWasiHttpTypes030StaticResponseNewFuture1FutureRejectPrepared( - self.handle, - ) { - self.closed = true - return - } + if wasmWasiHttpTypes030StaticResponseNewFuture1FutureRejectPrepared(self.handle) { + self.closed = true + return + } - self.closed = true - wasmImportWasiHttpTypes030StaticResponseNewFuture1DropReadable(self.handle) + self.closed = true + wasmImportWasiHttpTypes030StaticResponseNewFuture1DropReadable(self.handle) } -///| async fn WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource::read( - self : WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource, +self : WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource, ) -> Result[Fields?, ErrorCode] { - if self.closed { - raise @async-core.FutureReadError::Dropped - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - let ptr = wasmWasiHttpTypes030StaticResponseNewFuture1Malloc(1) - defer mbt_ffi_free(ptr) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - @async-core.suspend_for_future_read( - self.handle, - wasmImportWasiHttpTypes030StaticResponseNewFuture1Read(self.handle, ptr), - ) catch { - err => { + if self.closed { + raise @async-core.FutureReadError::Dropped + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + let ptr = wasmWasiHttpTypes030StaticResponseNewFuture1Malloc(1) + defer { mbt_ffi_free(ptr) } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + @async-core.suspend_for_future_read( + self.handle, + wasmImportWasiHttpTypes030StaticResponseNewFuture1Read(self.handle, ptr), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticResponseNewFuture1DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticResponseNewFuture1DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped } + let value = wasmWasiHttpTypes030StaticResponseNewFuture1Lift(ptr) self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - let value = wasmWasiHttpTypes030StaticResponseNewFuture1Lift(ptr) - self.finish_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticResponseNewFuture1DropReadable(self.handle) - } - value -} - -///| -fn wasmWasiHttpTypes030StaticResponseNewFuture1FutureLift( - handle : Int, -) -> @async-core.Future[Result[Fields?, ErrorCode]] { - let source = WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Future::from_source(() => source.read(), () => source.close(), () => { - source.close_sync() - }) + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticResponseNewFuture1DropReadable(self.handle) + } + value +} + +fn wasmWasiHttpTypes030StaticResponseNewFuture1FutureLift(handle : Int) -> @async-core.Future[Result[Fields?, ErrorCode]] { + let source = WasmWasiHttpTypes030StaticResponseNewFuture1FutureSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Future::from_source( + () => source.read(), + () => source.close(), + () => source.close_sync(), + ) } -///| priv struct WasmWasiHttpTypes030StaticResponseNewFuture1FutureProducer { - future : @async-core.Future[Result[Fields?, ErrorCode]] - writer : Int + future : @async-core.Future[Result[Fields?, ErrorCode]] + writer : Int } -///| -let wasmWasiHttpTypes030StaticResponseNewFuture1FutureProducers : Map[ - Int, - WasmWasiHttpTypes030StaticResponseNewFuture1FutureProducer, -] = Map([]) +let wasmWasiHttpTypes030StaticResponseNewFuture1FutureProducers : Map[Int, WasmWasiHttpTypes030StaticResponseNewFuture1FutureProducer] = Map([]) -///| -fn wasmWasiHttpTypes030StaticResponseNewFuture1FutureRejectPrepared( - handle : Int, -) -> Bool { - guard wasmWasiHttpTypes030StaticResponseNewFuture1FutureProducers.get(handle) - is Some(producer) else { - return false - } - wasmWasiHttpTypes030StaticResponseNewFuture1FutureProducers.remove(handle) - let writer = producer.writer - wasmImportWasiHttpTypes030StaticResponseNewFuture1DropReadable(handle) - @async-core.spawn_component_task_current(async fn() { - defer wasmImportWasiHttpTypes030StaticResponseNewFuture1DropWritable(writer) - @async-core.protect_from_cancel( - () => { - producer.future.reject((value : Result[Fields?, ErrorCode]) => { - let ptr = wasmWasiHttpTypes030StaticResponseNewFuture1Malloc(1) - wasmWasiHttpTypes030StaticResponseNewFuture1Lower(value, ptr) - wasmWasiHttpTypes030StaticResponseNewFuture1Reject(ptr, 0, 1) - mbt_ffi_free(ptr) - }) - let ptr = wasmWasiHttpTypes030StaticResponseNewFuture1Malloc(1) - defer mbt_ffi_free(ptr) - let terminal : Ref[Bool?] = { val: None } - while terminal.val is None { - terminal.val = @async-core.suspend_for_future_write_terminal( - writer, - wasmImportWasiHttpTypes030StaticResponseNewFuture1Write(writer, ptr), - ) - } - guard terminal.val is Some(transferred) - if transferred { - abort("rejected component future unexpectedly transferred a value") - } - }, - resume_on_cancel=true, - ) catch { - _ => abort("failed to reject component future producer") - } - }) - true +fn wasmWasiHttpTypes030StaticResponseNewFuture1FutureRejectPrepared(handle : Int) -> Bool { + guard wasmWasiHttpTypes030StaticResponseNewFuture1FutureProducers.get(handle) is Some(producer) else { + return false + } + wasmWasiHttpTypes030StaticResponseNewFuture1FutureProducers.remove(handle) + let writer = producer.writer + wasmImportWasiHttpTypes030StaticResponseNewFuture1DropReadable(handle) + @async-core.spawn_component_task_current(async fn() { + defer wasmImportWasiHttpTypes030StaticResponseNewFuture1DropWritable(writer) + @async-core.protect_from_cancel( + () => { + producer.future.reject((value : Result[Fields?, ErrorCode]) => { + let ptr = wasmWasiHttpTypes030StaticResponseNewFuture1Malloc(1) + wasmWasiHttpTypes030StaticResponseNewFuture1Lower(value, ptr) + wasmWasiHttpTypes030StaticResponseNewFuture1Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + let ptr = wasmWasiHttpTypes030StaticResponseNewFuture1Malloc(1) + defer { mbt_ffi_free(ptr) } + let terminal : Ref[Bool?] = { val: None } + while terminal.val is None { + terminal.val = @async-core.suspend_for_future_write_terminal( + writer, + wasmImportWasiHttpTypes030StaticResponseNewFuture1Write(writer, ptr), + ) + } + guard terminal.val is Some(transferred) + if transferred { + abort("rejected component future unexpectedly transferred a value") + } + }, + resume_on_cancel=true, + ) catch { + _ => abort("failed to reject component future producer") + } + }) + true } -///| -fn wasmWasiHttpTypes030StaticResponseNewFuture1FutureCommit( - handle : Int, -) -> Unit { - guard wasmWasiHttpTypes030StaticResponseNewFuture1FutureProducers.get(handle) - is Some(producer) else { - return - } - wasmWasiHttpTypes030StaticResponseNewFuture1FutureProducers.remove(handle) - let writer = producer.writer - if !@async-core.has_component_task_scope() { - abort("component future producer requires an async task scope") - } - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( - () => { - let value = producer.future.get() - let ptr = wasmWasiHttpTypes030StaticResponseNewFuture1Malloc(1) - wasmWasiHttpTypes030StaticResponseNewFuture1Lower(value, ptr) - let terminal : Ref[Bool?] = { val: None } - while terminal.val is None { - terminal.val = @async-core.suspend_for_future_write_terminal( - writer, - wasmImportWasiHttpTypes030StaticResponseNewFuture1Write(writer, ptr), - ) - } - guard terminal.val is Some(transferred) - if transferred { - wasmWasiHttpTypes030StaticResponseNewFuture1Commit(ptr, 0, 1) - } else { - wasmWasiHttpTypes030StaticResponseNewFuture1Reject(ptr, 0, 1) - } - mbt_ffi_free(ptr) - wasmImportWasiHttpTypes030StaticResponseNewFuture1DropWritable(writer) - }, - resume_on_cancel=true, - ) catch { - _ => abort("component future producer ended without a value") - } - }) +fn wasmWasiHttpTypes030StaticResponseNewFuture1FutureCommit(handle : Int) -> Unit { + guard wasmWasiHttpTypes030StaticResponseNewFuture1FutureProducers.get(handle) is Some(producer) else { + return + } + wasmWasiHttpTypes030StaticResponseNewFuture1FutureProducers.remove(handle) + let writer = producer.writer + if !@async-core.has_component_task_scope() { + abort("component future producer requires an async task scope") + } + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + let value = producer.future.get() + let ptr = wasmWasiHttpTypes030StaticResponseNewFuture1Malloc(1) + wasmWasiHttpTypes030StaticResponseNewFuture1Lower(value, ptr) + let terminal : Ref[Bool?] = { val: None } + while terminal.val is None { + terminal.val = @async-core.suspend_for_future_write_terminal( + writer, + wasmImportWasiHttpTypes030StaticResponseNewFuture1Write(writer, ptr), + ) + } + guard terminal.val is Some(transferred) + if transferred { + wasmWasiHttpTypes030StaticResponseNewFuture1Commit(ptr, 0, 1) + } else { + wasmWasiHttpTypes030StaticResponseNewFuture1Reject(ptr, 0, 1) + } + mbt_ffi_free(ptr) + wasmImportWasiHttpTypes030StaticResponseNewFuture1DropWritable(writer) + }, + resume_on_cancel=true, + ) catch { + _ => abort("component future producer ended without a value") + } + }) } -///| -fn wasmWasiHttpTypes030StaticResponseNewFuture1FutureLower( - future : @async-core.Future[Result[Fields?, ErrorCode]], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component future producer requires an async task scope") - } - let pair = wasmImportWasiHttpTypes030StaticResponseNewFuture1New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmWasiHttpTypes030StaticResponseNewFuture1FutureProducers.set(reader, { - future, - writer, - }) - reader +fn wasmWasiHttpTypes030StaticResponseNewFuture1FutureLower(future : @async-core.Future[Result[Fields?, ErrorCode]]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component future producer requires an async task scope") + } + let pair = wasmImportWasiHttpTypes030StaticResponseNewFuture1New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmWasiHttpTypes030StaticResponseNewFuture1FutureProducers.set(reader, { future, writer }) + reader } -///| -fn wasmImportWasiHttpTypes030StaticResponseNewFuture2Read( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-2][static]response.new" - -///| -fn wasmImportWasiHttpTypes030StaticResponseNewFuture2CancelRead( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-2][static]response.new" +fn wasmImportWasiHttpTypes030StaticResponseNewFuture2Read(handle : Int, buffer_ptr : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-2][static]response.new" +fn wasmImportWasiHttpTypes030StaticResponseNewFuture2CancelRead(handle : Int) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-2][static]response.new" -///| fn wasmImportWasiHttpTypes030StaticResponseNewFuture2DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-readable-2][static]response.new" -///| fn wasmWasiHttpTypes030StaticResponseNewFuture2Malloc(length : Int) -> Int { - let ptr = mbt_ffi_malloc(40 * length) - ptr + let ptr = mbt_ffi_malloc(40 * length) + ptr } -///| fn wasmWasiHttpTypes030StaticResponseNewFuture2Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 40 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 20) { + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 40 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } + + } _ => panic() - } - _ => panic() - } - 23 => () - 24 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 31 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() } - _ => panic() - } - _ => panic() - } - } + + } + } -///| -fn wasmWasiHttpTypes030StaticResponseNewFuture2Lift( - ptr : Int, -) -> Result[Unit, ErrorCode] { - let lifted30 = match mbt_ffi_load8_u(ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted29 = match mbt_ffi_load8_u(ptr + 8) { - 0 => ErrorCode::DnsTimeout - 1 => { - let lifted : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) +fn wasmWasiHttpTypes030StaticResponseNewFuture2Lift(ptr : Int) -> Result[Unit, ErrorCode] { - Option::Some(result) - } - _ => panic() - } - - let lifted0 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load16_u(ptr + 30).land(0xFFFF).reinterpret_as_uint(), - ) - _ => panic() - } - - ErrorCode::DnsError(DnsErrorPayload::{ - rcode: lifted, - info_code: lifted0, - }) - } - 2 => ErrorCode::DestinationNotFound - 3 => ErrorCode::DestinationUnavailable - 4 => ErrorCode::DestinationIpProhibited - 5 => ErrorCode::DestinationIpUnroutable - 6 => ErrorCode::ConnectionRefused - 7 => ErrorCode::ConnectionTerminated - 8 => ErrorCode::ConnectionTimeout - 9 => ErrorCode::ConnectionReadTimeout - 10 => ErrorCode::ConnectionWriteTimeout - 11 => ErrorCode::ConnectionLimitReached - 12 => ErrorCode::TlsProtocolError - 13 => ErrorCode::TlsCertificateError - 14 => { - let lifted1 : Byte? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load8_u(ptr + 17).to_byte()) - _ => panic() - } + let lifted30 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { - let lifted3 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None + Result::Ok(()) + } 1 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) - Option::Some(result2) - } - _ => panic() - } - - ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{ - alert_id: lifted1, - alert_message: lifted3, - }) - } - 15 => ErrorCode::HttpRequestDenied - 16 => ErrorCode::HttpRequestLengthRequired - 17 => { - let lifted4 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpRequestBodySize(lifted4) - } - 18 => ErrorCode::HttpRequestMethodInvalid - 19 => ErrorCode::HttpRequestUriInvalid - 20 => ErrorCode::HttpRequestUriTooLong - 21 => { - let lifted5 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + let lifted29 = match (mbt_ffi_load8_u((ptr) + 8)) { + 0 => { - ErrorCode::HttpRequestHeaderSectionSize(lifted5) - } - 22 => { - let lifted9 : FieldSizePayload? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let lifted7 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) - - Option::Some(result6) - } - _ => panic() - } - - let lifted8 : UInt? = match mbt_ffi_load8_u(ptr + 32) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(ptr + 36).reinterpret_as_uint()) - _ => panic() - } - - Option::Some(FieldSizePayload::{ - field_name: lifted7, - field_size: lifted8, - }) - } - _ => panic() - } - - ErrorCode::HttpRequestHeaderSize(lifted9) - } - 23 => { - let lifted10 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + ErrorCode::DnsTimeout + } + 1 => { + + let lifted : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result) + } + _ => panic() + } + + let lifted0 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load16_u((ptr) + 30).land(0xFFFF).reinterpret_as_uint())) + } + _ => panic() + } + + ErrorCode::DnsError(DnsErrorPayload::{rcode : lifted, info_code : lifted0}) + } + 2 => { + + ErrorCode::DestinationNotFound + } + 3 => { + + ErrorCode::DestinationUnavailable + } + 4 => { + + ErrorCode::DestinationIpProhibited + } + 5 => { + + ErrorCode::DestinationIpUnroutable + } + 6 => { + + ErrorCode::ConnectionRefused + } + 7 => { + + ErrorCode::ConnectionTerminated + } + 8 => { + + ErrorCode::ConnectionTimeout + } + 9 => { + + ErrorCode::ConnectionReadTimeout + } + 10 => { + + ErrorCode::ConnectionWriteTimeout + } + 11 => { + + ErrorCode::ConnectionLimitReached + } + 12 => { + + ErrorCode::TlsProtocolError + } + 13 => { + + ErrorCode::TlsCertificateError + } + 14 => { + + let lifted1 : Byte? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load8_u((ptr) + 17)).to_byte()) + } + _ => panic() + } + + let lifted3 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { + + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) + + Option::Some(result2) + } + _ => panic() + } + + ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{alert_id : lifted1, alert_message : lifted3}) + } + 15 => { + + ErrorCode::HttpRequestDenied + } + 16 => { + + ErrorCode::HttpRequestLengthRequired + } + 17 => { + + let lifted4 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpRequestBodySize(lifted4) + } + 18 => { + + ErrorCode::HttpRequestMethodInvalid + } + 19 => { + + ErrorCode::HttpRequestUriInvalid + } + 20 => { + + ErrorCode::HttpRequestUriTooLong + } + 21 => { + + let lifted5 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSectionSize(lifted5) + } + 22 => { + + let lifted9 : FieldSizePayload? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let lifted7 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) + + Option::Some(result6) + } + _ => panic() + } + + let lifted8 : UInt? = match mbt_ffi_load8_u((ptr) + 32) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 36)).reinterpret_as_uint()) + } + _ => panic() + } + + Option::Some(FieldSizePayload::{field_name : lifted7, field_size : lifted8}) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSize(lifted9) + } + 23 => { + + let lifted10 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSectionSize(lifted10) + } + 24 => { + + let lifted12 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result11 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result11) + } + _ => panic() + } + + let lifted13 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{field_name : lifted12, field_size : lifted13}) + } + 25 => { + + ErrorCode::HttpResponseIncomplete + } + 26 => { + + let lifted14 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpResponseHeaderSectionSize(lifted14) + } + 27 => { + + let lifted16 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result15) + } + _ => panic() + } + + let lifted17 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{field_name : lifted16, field_size : lifted17}) + } + 28 => { + + let lifted18 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpResponseBodySize(lifted18) + } + 29 => { + + let lifted19 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpResponseTrailerSectionSize(lifted19) + } + 30 => { + + let lifted21 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result20 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result20) + } + _ => panic() + } + + let lifted22 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{field_name : lifted21, field_size : lifted22}) + } + 31 => { + + let lifted24 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result23) + } + _ => panic() + } + + ErrorCode::HttpResponseTransferCoding(lifted24) + } + 32 => { - ErrorCode::HttpRequestTrailerSectionSize(lifted10) - } - 24 => { - let lifted12 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result11 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + let lifted26 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - Option::Some(result11) - } - _ => panic() - } + let result25 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - let lifted13 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{ - field_name: lifted12, - field_size: lifted13, - }) - } - 25 => ErrorCode::HttpResponseIncomplete - 26 => { - let lifted14 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + Option::Some(result25) + } + _ => panic() + } - ErrorCode::HttpResponseHeaderSectionSize(lifted14) - } - 27 => { - let lifted16 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + ErrorCode::HttpResponseContentCoding(lifted26) + } + 33 => { - Option::Some(result15) - } - _ => panic() - } + ErrorCode::HttpResponseTimeout + } + 34 => { - let lifted17 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{ - field_name: lifted16, - field_size: lifted17, - }) - } - 28 => { - let lifted18 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpResponseBodySize(lifted18) - } - 29 => { - let lifted19 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + ErrorCode::HttpUpgradeFailed + } + 35 => { - ErrorCode::HttpResponseTrailerSectionSize(lifted19) - } - 30 => { - let lifted21 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result20 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + ErrorCode::HttpProtocolError + } + 36 => { - Option::Some(result20) - } - _ => panic() - } + ErrorCode::LoopDetected + } + 37 => { - let lifted22 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{ - field_name: lifted21, - field_size: lifted22, - }) - } - 31 => { - let lifted24 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + ErrorCode::ConfigurationError + } + 38 => { - Option::Some(result23) - } - _ => panic() - } + let lifted28 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - ErrorCode::HttpResponseTransferCoding(lifted24) - } - 32 => { - let lifted26 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result25 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + let result27 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - Option::Some(result25) - } - _ => panic() - } - - ErrorCode::HttpResponseContentCoding(lifted26) - } - 33 => ErrorCode::HttpResponseTimeout - 34 => ErrorCode::HttpUpgradeFailed - 35 => ErrorCode::HttpProtocolError - 36 => ErrorCode::LoopDetected - 37 => ErrorCode::ConfigurationError - 38 => { - let lifted28 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result27 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + Option::Some(result27) + } + _ => panic() + } - Option::Some(result27) + ErrorCode::InternalError(lifted28) + } + _ => panic() + } + + Result::Err(lifted29) } _ => panic() - } - - ErrorCode::InternalError(lifted28) - } - _ => panic() } - Result::Err(lifted29) - } - _ => panic() - } - - lifted30 + lifted30 } -///| priv struct WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource::finish_read( - self : WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource, +self : WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource::wait_for_read_cleanup( - self : WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource, +self : WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource::cancel_active_read( - self : WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource, +self : WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let completed = Ref(false) - @async-core.protect_from_cancel( - () => { - completed.val = @async-core.cancel_future_read( - self.read_task, - self.handle, - () => { - wasmImportWasiHttpTypes030StaticResponseNewFuture2CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let completed = Ref(false) + @async-core.protect_from_cancel( + () => { + completed.val = @async-core.cancel_future_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - if completed.val && self.read_buffer != 0 { - wasmWasiHttpTypes030StaticResponseNewFuture2Reject(self.read_buffer, 0, 1) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiHttpTypes030StaticResponseNewFuture2CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + if completed.val && self.read_buffer != 0 { + wasmWasiHttpTypes030StaticResponseNewFuture2Reject(self.read_buffer, 0, 1) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource::close( - self : WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource, +self : WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiHttpTypes030StaticResponseNewFuture2DropReadable(self.handle) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiHttpTypes030StaticResponseNewFuture2DropReadable(self.handle) } -///| fn WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource::close_sync( - self : WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource, +self : WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportWasiHttpTypes030StaticResponseNewFuture2DropReadable(self.handle) + self.closed = true + wasmImportWasiHttpTypes030StaticResponseNewFuture2DropReadable(self.handle) } -///| async fn WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource::read( - self : WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource, +self : WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource, ) -> Result[Unit, ErrorCode] { - if self.closed { - raise @async-core.FutureReadError::Dropped - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - let ptr = wasmWasiHttpTypes030StaticResponseNewFuture2Malloc(1) - defer mbt_ffi_free(ptr) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - @async-core.suspend_for_future_read( - self.handle, - wasmImportWasiHttpTypes030StaticResponseNewFuture2Read(self.handle, ptr), - ) catch { - err => { + if self.closed { + raise @async-core.FutureReadError::Dropped + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + let ptr = wasmWasiHttpTypes030StaticResponseNewFuture2Malloc(1) + defer { mbt_ffi_free(ptr) } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + @async-core.suspend_for_future_read( + self.handle, + wasmImportWasiHttpTypes030StaticResponseNewFuture2Read(self.handle, ptr), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticResponseNewFuture2DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticResponseNewFuture2DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped } + let value = wasmWasiHttpTypes030StaticResponseNewFuture2Lift(ptr) self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - let value = wasmWasiHttpTypes030StaticResponseNewFuture2Lift(ptr) - self.finish_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticResponseNewFuture2DropReadable(self.handle) - } - value -} - -///| -fn wasmWasiHttpTypes030StaticResponseNewFuture2FutureLift( - handle : Int, -) -> @async-core.Future[Result[Unit, ErrorCode]] { - let source = WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Future::from_source(() => source.read(), () => source.close(), () => { - source.close_sync() - }) + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticResponseNewFuture2DropReadable(self.handle) + } + value +} + +fn wasmWasiHttpTypes030StaticResponseNewFuture2FutureLift(handle : Int) -> @async-core.Future[Result[Unit, ErrorCode]] { + let source = WasmWasiHttpTypes030StaticResponseNewFuture2FutureSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Future::from_source( + () => source.read(), + () => source.close(), + () => source.close_sync(), + ) } -///| fn wasmImportMethodResponseGetStatusCode(p0 : Int) -> Int = "wasi:http/types@0.3.0" "[method]response.get-status-code" -///| fn wasmImportMethodResponseSetStatusCode(p0 : Int, p1 : Int) -> Int = "wasi:http/types@0.3.0" "[method]response.set-status-code" -///| fn wasmImportMethodResponseGetHeaders(p0 : Int) -> Int = "wasi:http/types@0.3.0" "[method]response.get-headers" -///| -fn wasmImportStaticResponseConsumeBody(p0 : Int, p1 : Int, p2 : Int) = "wasi:http/types@0.3.0" "[static]response.consume-body" - -///| -fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0Read( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-0][static]response.consume-body" +fn wasmImportStaticResponseConsumeBody(p0 : Int, p1 : Int, p2 : Int) = "wasi:http/types@0.3.0" "[static]response.consume-body" -///| -fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0CancelRead( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-0][static]response.consume-body" +fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0Read(handle : Int, buffer_ptr : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-0][static]response.consume-body" +fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0CancelRead(handle : Int) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-0][static]response.consume-body" -///| -fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropReadable( - handle : Int, -) = "wasi:http/types@0.3.0" "[future-drop-readable-0][static]response.consume-body" +fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-readable-0][static]response.consume-body" -///| fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0New() -> UInt64 = "wasi:http/types@0.3.0" "[future-new-0][static]response.consume-body" +fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0Write(handle : Int, buffer_ptr : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-write-0][static]response.consume-body" -///| -fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0Write( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-write-0][static]response.consume-body" - -///| -fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropWritable( - handle : Int, -) = "wasi:http/types@0.3.0" "[future-drop-writable-0][static]response.consume-body" +fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropWritable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-writable-0][static]response.consume-body" -///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(40 * length) - ptr +fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(40 * length) + ptr } -///| fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Commit( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 40 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - _ => panic() - } - 23 => () - 24 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 31 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - } -} -///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Reject( - ptr : Int, - start : Int, - length : Int, -) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 40 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 20) { + for i in start..<(start + length) { + let elem_ptr = ptr + i * 40 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } + + } _ => panic() - } - _ => panic() - } - 23 => () - 24 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 31 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - } -} - -///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Lift( - ptr : Int, -) -> Result[Unit, ErrorCode] { - let lifted30 = match mbt_ffi_load8_u(ptr + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted29 = match mbt_ffi_load8_u(ptr + 8) { - 0 => ErrorCode::DnsTimeout - 1 => { - let lifted : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result) - } - _ => panic() - } - - let lifted0 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load16_u(ptr + 30).land(0xFFFF).reinterpret_as_uint(), - ) - _ => panic() - } - - ErrorCode::DnsError(DnsErrorPayload::{ - rcode: lifted, - info_code: lifted0, - }) - } - 2 => ErrorCode::DestinationNotFound - 3 => ErrorCode::DestinationUnavailable - 4 => ErrorCode::DestinationIpProhibited - 5 => ErrorCode::DestinationIpUnroutable - 6 => ErrorCode::ConnectionRefused - 7 => ErrorCode::ConnectionTerminated - 8 => ErrorCode::ConnectionTimeout - 9 => ErrorCode::ConnectionReadTimeout - 10 => ErrorCode::ConnectionWriteTimeout - 11 => ErrorCode::ConnectionLimitReached - 12 => ErrorCode::TlsProtocolError - 13 => ErrorCode::TlsCertificateError - 14 => { - let lifted1 : Byte? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load8_u(ptr + 17).to_byte()) - _ => panic() - } - - let lifted3 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result2 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) - - Option::Some(result2) - } - _ => panic() - } - - ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{ - alert_id: lifted1, - alert_message: lifted3, - }) - } - 15 => ErrorCode::HttpRequestDenied - 16 => ErrorCode::HttpRequestLengthRequired - 17 => { - let lifted4 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpRequestBodySize(lifted4) - } - 18 => ErrorCode::HttpRequestMethodInvalid - 19 => ErrorCode::HttpRequestUriInvalid - 20 => ErrorCode::HttpRequestUriTooLong - 21 => { - let lifted5 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestHeaderSectionSize(lifted5) - } - 22 => { - let lifted9 : FieldSizePayload? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let lifted7 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result6 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) - - Option::Some(result6) - } - _ => panic() - } - - let lifted8 : UInt? = match mbt_ffi_load8_u(ptr + 32) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(ptr + 36).reinterpret_as_uint()) - _ => panic() - } - - Option::Some(FieldSizePayload::{ - field_name: lifted7, - field_size: lifted8, - }) - } - _ => panic() - } - - ErrorCode::HttpRequestHeaderSize(lifted9) - } - 23 => { - let lifted10 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSectionSize(lifted10) - } - 24 => { - let lifted12 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result11 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result11) - } - _ => panic() - } - - let lifted13 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{ - field_name: lifted12, - field_size: lifted13, - }) - } - 25 => ErrorCode::HttpResponseIncomplete - 26 => { - let lifted14 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseHeaderSectionSize(lifted14) - } - 27 => { - let lifted16 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result15 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result15) - } - _ => panic() - } - - let lifted17 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{ - field_name: lifted16, - field_size: lifted17, - }) - } - 28 => { - let lifted18 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpResponseBodySize(lifted18) - } - 29 => { - let lifted19 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseTrailerSectionSize(lifted19) - } - 30 => { - let lifted21 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result20 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result20) } - _ => panic() - } - - let lifted22 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{ - field_name: lifted21, - field_size: lifted22, - }) - } - 31 => { - let lifted24 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result23 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result23) - } - _ => panic() - } - - ErrorCode::HttpResponseTransferCoding(lifted24) - } - 32 => { - let lifted26 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result25 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result25) - } - _ => panic() - } - - ErrorCode::HttpResponseContentCoding(lifted26) - } - 33 => ErrorCode::HttpResponseTimeout - 34 => ErrorCode::HttpUpgradeFailed - 35 => ErrorCode::HttpProtocolError - 36 => ErrorCode::LoopDetected - 37 => ErrorCode::ConfigurationError - 38 => { - let lifted28 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result27 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - - Option::Some(result27) - } - _ => panic() - } - ErrorCode::InternalError(lifted28) - } - _ => panic() } - Result::Err(lifted29) - } - _ => panic() - } - - lifted30 } -///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Lower( - value : Result[Unit, ErrorCode], - ptr : Int, +fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Reject( +ptr : Int, +start : Int, +length : Int, ) -> Unit { - match value { - Ok(_payload) => { - mbt_ffi_store8(ptr + 0, 0) - - () - } - Err(payload0) => { - mbt_ffi_store8(ptr + 0, 1) - - match payload0 { - DnsTimeout => { - mbt_ffi_store8(ptr + 8, 0) - - () - } - DnsError(payload2) => { - mbt_ffi_store8(ptr + 8, 1) - - match payload2.rcode { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload4) => { - mbt_ffi_store8(ptr + 16, 1) - - let ptr5 = mbt_ffi_str2ptr(payload4) - mbt_ffi_store32(ptr + 24, payload4.length()) - mbt_ffi_store32(ptr + 20, ptr5) - - () - } - } - - match payload2.info_code { - None => { - mbt_ffi_store8(ptr + 28, 0) - - () - } - Some(payload7) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store16(ptr + 30, payload7.reinterpret_as_int()) - - () - } - } - - () - } - DestinationNotFound => { - mbt_ffi_store8(ptr + 8, 2) - - () - } - DestinationUnavailable => { - mbt_ffi_store8(ptr + 8, 3) - - () - } - DestinationIpProhibited => { - mbt_ffi_store8(ptr + 8, 4) - - () - } - DestinationIpUnroutable => { - mbt_ffi_store8(ptr + 8, 5) - - () - } - ConnectionRefused => { - mbt_ffi_store8(ptr + 8, 6) - - () - } - ConnectionTerminated => { - mbt_ffi_store8(ptr + 8, 7) - - () - } - ConnectionTimeout => { - mbt_ffi_store8(ptr + 8, 8) - - () - } - ConnectionReadTimeout => { - mbt_ffi_store8(ptr + 8, 9) - - () - } - ConnectionWriteTimeout => { - mbt_ffi_store8(ptr + 8, 10) - - () - } - ConnectionLimitReached => { - mbt_ffi_store8(ptr + 8, 11) - - () - } - TlsProtocolError => { - mbt_ffi_store8(ptr + 8, 12) - - () - } - TlsCertificateError => { - mbt_ffi_store8(ptr + 8, 13) - - () - } - TlsAlertReceived(payload20) => { - mbt_ffi_store8(ptr + 8, 14) - - match payload20.alert_id { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () - } - Some(payload22) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store8(ptr + 17, payload22.to_int()) - - () - } - } - match payload20.alert_message { - None => { - mbt_ffi_store8(ptr + 20, 0) + for i in start..<(start + length) { + let elem_ptr = ptr + i * 40 - () - } - Some(payload24) => { - mbt_ffi_store8(ptr + 20, 1) - - let ptr25 = mbt_ffi_str2ptr(payload24) - mbt_ffi_store32(ptr + 28, payload24.length()) - mbt_ffi_store32(ptr + 24, ptr25) - - () + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + _ => panic() } - } - - () - } - HttpRequestDenied => { - mbt_ffi_store8(ptr + 8, 15) - () - } - HttpRequestLengthRequired => { - mbt_ffi_store8(ptr + 8, 16) + } - () - } - HttpRequestBodySize(payload28) => { - mbt_ffi_store8(ptr + 8, 17) +} - match payload28 { - None => { - mbt_ffi_store8(ptr + 16, 0) +fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Lift(ptr : Int) -> Result[Unit, ErrorCode] { - () - } - Some(payload30) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store64(ptr + 24, payload30.reinterpret_as_int64()) + let lifted30 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { - () + Result::Ok(()) } - } - - () - } - HttpRequestMethodInvalid => { - mbt_ffi_store8(ptr + 8, 18) - - () - } - HttpRequestUriInvalid => { - mbt_ffi_store8(ptr + 8, 19) - - () - } - HttpRequestUriTooLong => { - mbt_ffi_store8(ptr + 8, 20) + 1 => { - () - } - HttpRequestHeaderSectionSize(payload34) => { - mbt_ffi_store8(ptr + 8, 21) + let lifted29 = match (mbt_ffi_load8_u((ptr) + 8)) { + 0 => { - match payload34 { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::DnsTimeout + } + 1 => { - () - } - Some(payload36) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload36.reinterpret_as_int()) + let lifted : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - } + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - HttpRequestHeaderSize(payload37) => { - mbt_ffi_store8(ptr + 8, 22) + Option::Some(result) + } + _ => panic() + } - match payload37 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let lifted0 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { - () - } - Some(payload39) => { - mbt_ffi_store8(ptr + 16, 1) + Option::Some((mbt_ffi_load16_u((ptr) + 30).land(0xFFFF).reinterpret_as_uint())) + } + _ => panic() + } - match payload39.field_name { - None => { - mbt_ffi_store8(ptr + 20, 0) + ErrorCode::DnsError(DnsErrorPayload::{rcode : lifted, info_code : lifted0}) + } + 2 => { - () - } - Some(payload41) => { - mbt_ffi_store8(ptr + 20, 1) + ErrorCode::DestinationNotFound + } + 3 => { - let ptr42 = mbt_ffi_str2ptr(payload41) - mbt_ffi_store32(ptr + 28, payload41.length()) - mbt_ffi_store32(ptr + 24, ptr42) + ErrorCode::DestinationUnavailable + } + 4 => { - () - } - } + ErrorCode::DestinationIpProhibited + } + 5 => { - match payload39.field_size { - None => { - mbt_ffi_store8(ptr + 32, 0) + ErrorCode::DestinationIpUnroutable + } + 6 => { - () - } - Some(payload44) => { - mbt_ffi_store8(ptr + 32, 1) - mbt_ffi_store32(ptr + 36, payload44.reinterpret_as_int()) + ErrorCode::ConnectionRefused + } + 7 => { - () - } - } + ErrorCode::ConnectionTerminated + } + 8 => { - () - } - } + ErrorCode::ConnectionTimeout + } + 9 => { - () - } - HttpRequestTrailerSectionSize(payload45) => { - mbt_ffi_store8(ptr + 8, 23) + ErrorCode::ConnectionReadTimeout + } + 10 => { - match payload45 { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::ConnectionWriteTimeout + } + 11 => { - () - } - Some(payload47) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload47.reinterpret_as_int()) + ErrorCode::ConnectionLimitReached + } + 12 => { - () - } - } + ErrorCode::TlsProtocolError + } + 13 => { - () - } - HttpRequestTrailerSize(payload48) => { - mbt_ffi_store8(ptr + 8, 24) + ErrorCode::TlsCertificateError + } + 14 => { - match payload48.field_name { - None => { - mbt_ffi_store8(ptr + 16, 0) + let lifted1 : Byte? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload50) => { - mbt_ffi_store8(ptr + 16, 1) + Option::Some((mbt_ffi_load8_u((ptr) + 17)).to_byte()) + } + _ => panic() + } - let ptr51 = mbt_ffi_str2ptr(payload50) - mbt_ffi_store32(ptr + 24, payload50.length()) - mbt_ffi_store32(ptr + 20, ptr51) + let lifted3 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { - () - } - } + let result2 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) - match payload48.field_size { - None => { - mbt_ffi_store8(ptr + 28, 0) + Option::Some(result2) + } + _ => panic() + } - () - } - Some(payload53) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store32(ptr + 32, payload53.reinterpret_as_int()) + ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{alert_id : lifted1, alert_message : lifted3}) + } + 15 => { - () - } - } + ErrorCode::HttpRequestDenied + } + 16 => { - () - } - HttpResponseIncomplete => { - mbt_ffi_store8(ptr + 8, 25) + ErrorCode::HttpRequestLengthRequired + } + 17 => { - () - } - HttpResponseHeaderSectionSize(payload55) => { - mbt_ffi_store8(ptr + 8, 26) + let lifted4 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpRequestBodySize(lifted4) + } + 18 => { + + ErrorCode::HttpRequestMethodInvalid + } + 19 => { + + ErrorCode::HttpRequestUriInvalid + } + 20 => { + + ErrorCode::HttpRequestUriTooLong + } + 21 => { + + let lifted5 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSectionSize(lifted5) + } + 22 => { + + let lifted9 : FieldSizePayload? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let lifted7 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { + + let result6 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) + + Option::Some(result6) + } + _ => panic() + } + + let lifted8 : UInt? = match mbt_ffi_load8_u((ptr) + 32) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 36)).reinterpret_as_uint()) + } + _ => panic() + } + + Option::Some(FieldSizePayload::{field_name : lifted7, field_size : lifted8}) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSize(lifted9) + } + 23 => { + + let lifted10 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSectionSize(lifted10) + } + 24 => { + + let lifted12 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result11 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result11) + } + _ => panic() + } + + let lifted13 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{field_name : lifted12, field_size : lifted13}) + } + 25 => { + + ErrorCode::HttpResponseIncomplete + } + 26 => { + + let lifted14 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } - match payload55 { - None => { - mbt_ffi_store8(ptr + 16, 0) + ErrorCode::HttpResponseHeaderSectionSize(lifted14) + } + 27 => { - () - } - Some(payload57) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload57.reinterpret_as_int()) + let lifted16 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - } + let result15 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result15) + } + _ => panic() + } + + let lifted17 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - HttpResponseHeaderSize(payload58) => { - mbt_ffi_store8(ptr + 8, 27) + ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{field_name : lifted16, field_size : lifted17}) + } + 28 => { + + let lifted18 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - match payload58.field_name { - None => { - mbt_ffi_store8(ptr + 16, 0) + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpResponseBodySize(lifted18) + } + 29 => { - () - } - Some(payload60) => { - mbt_ffi_store8(ptr + 16, 1) + let lifted19 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - let ptr61 = mbt_ffi_str2ptr(payload60) - mbt_ffi_store32(ptr + 24, payload60.length()) - mbt_ffi_store32(ptr + 20, ptr61) + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - } + ErrorCode::HttpResponseTrailerSectionSize(lifted19) + } + 30 => { - match payload58.field_size { - None => { - mbt_ffi_store8(ptr + 28, 0) + let lifted21 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - Some(payload63) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store32(ptr + 32, payload63.reinterpret_as_int()) + let result20 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - } + Option::Some(result20) + } + _ => panic() + } - () - } - HttpResponseBodySize(payload64) => { - mbt_ffi_store8(ptr + 8, 28) + let lifted22 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { - match payload64 { - None => { - mbt_ffi_store8(ptr + 16, 0) + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } - () - } - Some(payload66) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store64(ptr + 24, payload66.reinterpret_as_int64()) + ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{field_name : lifted21, field_size : lifted22}) + } + 31 => { - () - } - } + let lifted24 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - HttpResponseTrailerSectionSize(payload67) => { - mbt_ffi_store8(ptr + 8, 29) + let result23 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - match payload67 { - None => { - mbt_ffi_store8(ptr + 16, 0) + Option::Some(result23) + } + _ => panic() + } - () - } - Some(payload69) => { - mbt_ffi_store8(ptr + 16, 1) - mbt_ffi_store32(ptr + 20, payload69.reinterpret_as_int()) + ErrorCode::HttpResponseTransferCoding(lifted24) + } + 32 => { - () - } - } + let lifted26 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - () - } - HttpResponseTrailerSize(payload70) => { - mbt_ffi_store8(ptr + 8, 30) + let result25 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - match payload70.field_name { - None => { - mbt_ffi_store8(ptr + 16, 0) + Option::Some(result25) + } + _ => panic() + } - () - } - Some(payload72) => { - mbt_ffi_store8(ptr + 16, 1) + ErrorCode::HttpResponseContentCoding(lifted26) + } + 33 => { - let ptr73 = mbt_ffi_str2ptr(payload72) - mbt_ffi_store32(ptr + 24, payload72.length()) - mbt_ffi_store32(ptr + 20, ptr73) + ErrorCode::HttpResponseTimeout + } + 34 => { - () - } - } + ErrorCode::HttpUpgradeFailed + } + 35 => { - match payload70.field_size { - None => { - mbt_ffi_store8(ptr + 28, 0) + ErrorCode::HttpProtocolError + } + 36 => { - () - } - Some(payload75) => { - mbt_ffi_store8(ptr + 28, 1) - mbt_ffi_store32(ptr + 32, payload75.reinterpret_as_int()) + ErrorCode::LoopDetected + } + 37 => { - () - } - } + ErrorCode::ConfigurationError + } + 38 => { - () - } - HttpResponseTransferCoding(payload76) => { - mbt_ffi_store8(ptr + 8, 31) + let lifted28 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - match payload76 { - None => { - mbt_ffi_store8(ptr + 16, 0) + let result27 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - () - } - Some(payload78) => { - mbt_ffi_store8(ptr + 16, 1) + Option::Some(result27) + } + _ => panic() + } - let ptr79 = mbt_ffi_str2ptr(payload78) - mbt_ffi_store32(ptr + 24, payload78.length()) - mbt_ffi_store32(ptr + 20, ptr79) + ErrorCode::InternalError(lifted28) + } + _ => panic() + } - () + Result::Err(lifted29) } - } - - () - } - HttpResponseContentCoding(payload80) => { - mbt_ffi_store8(ptr + 8, 32) + _ => panic() + } - match payload80 { - None => { - mbt_ffi_store8(ptr + 16, 0) + lifted30 +} - () - } - Some(payload82) => { - mbt_ffi_store8(ptr + 16, 1) +fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Lower(value : Result[Unit, ErrorCode], ptr : Int) -> Unit { - let ptr83 = mbt_ffi_str2ptr(payload82) - mbt_ffi_store32(ptr + 24, payload82.length()) - mbt_ffi_store32(ptr + 20, ptr83) + match value { + Ok(_payload) => { + mbt_ffi_store8((ptr) + 0, (0)) - () - } - } - - () - } - HttpResponseTimeout => { - mbt_ffi_store8(ptr + 8, 33) - - () - } - HttpUpgradeFailed => { - mbt_ffi_store8(ptr + 8, 34) - - () - } - HttpProtocolError => { - mbt_ffi_store8(ptr + 8, 35) - - () - } - LoopDetected => { - mbt_ffi_store8(ptr + 8, 36) - - () - } - ConfigurationError => { - mbt_ffi_store8(ptr + 8, 37) - - () - } - InternalError(payload89) => { - mbt_ffi_store8(ptr + 8, 38) - - match payload89 { - None => { - mbt_ffi_store8(ptr + 16, 0) - - () + () } - Some(payload91) => { - mbt_ffi_store8(ptr + 16, 1) - - let ptr92 = mbt_ffi_str2ptr(payload91) - mbt_ffi_store32(ptr + 24, payload91.length()) - mbt_ffi_store32(ptr + 20, ptr92) + Err(payload0) => { + mbt_ffi_store8((ptr) + 0, (1)) + + match payload0 { + DnsTimeout => { + mbt_ffi_store8((ptr) + 8, (0)) + + () + } + DnsError(payload2) => { + mbt_ffi_store8((ptr) + 8, (1)) + + match ((payload2).rcode) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload4) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr5 = mbt_ffi_str2ptr(payload4) + mbt_ffi_store32((ptr) + 24, payload4.length()) + mbt_ffi_store32((ptr) + 20, ptr5) + + () + } + } + + match ((payload2).info_code) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload7) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store16((ptr) + 30, (payload7).reinterpret_as_int()) + + () + } + } + + () + } + DestinationNotFound => { + mbt_ffi_store8((ptr) + 8, (2)) + + () + } + DestinationUnavailable => { + mbt_ffi_store8((ptr) + 8, (3)) + + () + } + DestinationIpProhibited => { + mbt_ffi_store8((ptr) + 8, (4)) + + () + } + DestinationIpUnroutable => { + mbt_ffi_store8((ptr) + 8, (5)) + + () + } + ConnectionRefused => { + mbt_ffi_store8((ptr) + 8, (6)) + + () + } + ConnectionTerminated => { + mbt_ffi_store8((ptr) + 8, (7)) + + () + } + ConnectionTimeout => { + mbt_ffi_store8((ptr) + 8, (8)) + + () + } + ConnectionReadTimeout => { + mbt_ffi_store8((ptr) + 8, (9)) + + () + } + ConnectionWriteTimeout => { + mbt_ffi_store8((ptr) + 8, (10)) + + () + } + ConnectionLimitReached => { + mbt_ffi_store8((ptr) + 8, (11)) + + () + } + TlsProtocolError => { + mbt_ffi_store8((ptr) + 8, (12)) + + () + } + TlsCertificateError => { + mbt_ffi_store8((ptr) + 8, (13)) + + () + } + TlsAlertReceived(payload20) => { + mbt_ffi_store8((ptr) + 8, (14)) + + match ((payload20).alert_id) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload22) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store8((ptr) + 17, (payload22).to_int()) + + () + } + } + + match ((payload20).alert_message) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) + + () + } + Some(payload24) => { + mbt_ffi_store8((ptr) + 20, (1)) + + let ptr25 = mbt_ffi_str2ptr(payload24) + mbt_ffi_store32((ptr) + 28, payload24.length()) + mbt_ffi_store32((ptr) + 24, ptr25) + + () + } + } + + () + } + HttpRequestDenied => { + mbt_ffi_store8((ptr) + 8, (15)) + + () + } + HttpRequestLengthRequired => { + mbt_ffi_store8((ptr) + 8, (16)) + + () + } + HttpRequestBodySize(payload28) => { + mbt_ffi_store8((ptr) + 8, (17)) + + match (payload28) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload30) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store64((ptr) + 24, (payload30).reinterpret_as_int64()) + + () + } + } + + () + } + HttpRequestMethodInvalid => { + mbt_ffi_store8((ptr) + 8, (18)) + + () + } + HttpRequestUriInvalid => { + mbt_ffi_store8((ptr) + 8, (19)) + + () + } + HttpRequestUriTooLong => { + mbt_ffi_store8((ptr) + 8, (20)) + + () + } + HttpRequestHeaderSectionSize(payload34) => { + mbt_ffi_store8((ptr) + 8, (21)) + + match (payload34) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload36) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload36).reinterpret_as_int()) + + () + } + } + + () + } + HttpRequestHeaderSize(payload37) => { + mbt_ffi_store8((ptr) + 8, (22)) + + match (payload37) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload39) => { + mbt_ffi_store8((ptr) + 16, (1)) + + match ((payload39).field_name) { + None => { + mbt_ffi_store8((ptr) + 20, (0)) + + () + } + Some(payload41) => { + mbt_ffi_store8((ptr) + 20, (1)) + + let ptr42 = mbt_ffi_str2ptr(payload41) + mbt_ffi_store32((ptr) + 28, payload41.length()) + mbt_ffi_store32((ptr) + 24, ptr42) + + () + } + } + + match ((payload39).field_size) { + None => { + mbt_ffi_store8((ptr) + 32, (0)) + + () + } + Some(payload44) => { + mbt_ffi_store8((ptr) + 32, (1)) + mbt_ffi_store32((ptr) + 36, (payload44).reinterpret_as_int()) + + () + } + } + + () + } + } + + () + } + HttpRequestTrailerSectionSize(payload45) => { + mbt_ffi_store8((ptr) + 8, (23)) + + match (payload45) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload47) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload47).reinterpret_as_int()) + + () + } + } + + () + } + HttpRequestTrailerSize(payload48) => { + mbt_ffi_store8((ptr) + 8, (24)) + + match ((payload48).field_name) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload50) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr51 = mbt_ffi_str2ptr(payload50) + mbt_ffi_store32((ptr) + 24, payload50.length()) + mbt_ffi_store32((ptr) + 20, ptr51) + + () + } + } + + match ((payload48).field_size) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload53) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store32((ptr) + 32, (payload53).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseIncomplete => { + mbt_ffi_store8((ptr) + 8, (25)) + + () + } + HttpResponseHeaderSectionSize(payload55) => { + mbt_ffi_store8((ptr) + 8, (26)) + + match (payload55) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload57) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload57).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseHeaderSize(payload58) => { + mbt_ffi_store8((ptr) + 8, (27)) + + match ((payload58).field_name) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload60) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr61 = mbt_ffi_str2ptr(payload60) + mbt_ffi_store32((ptr) + 24, payload60.length()) + mbt_ffi_store32((ptr) + 20, ptr61) + + () + } + } + + match ((payload58).field_size) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload63) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store32((ptr) + 32, (payload63).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseBodySize(payload64) => { + mbt_ffi_store8((ptr) + 8, (28)) + + match (payload64) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload66) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store64((ptr) + 24, (payload66).reinterpret_as_int64()) + + () + } + } + + () + } + HttpResponseTrailerSectionSize(payload67) => { + mbt_ffi_store8((ptr) + 8, (29)) + + match (payload67) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload69) => { + mbt_ffi_store8((ptr) + 16, (1)) + mbt_ffi_store32((ptr) + 20, (payload69).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseTrailerSize(payload70) => { + mbt_ffi_store8((ptr) + 8, (30)) + + match ((payload70).field_name) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload72) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr73 = mbt_ffi_str2ptr(payload72) + mbt_ffi_store32((ptr) + 24, payload72.length()) + mbt_ffi_store32((ptr) + 20, ptr73) + + () + } + } + + match ((payload70).field_size) { + None => { + mbt_ffi_store8((ptr) + 28, (0)) + + () + } + Some(payload75) => { + mbt_ffi_store8((ptr) + 28, (1)) + mbt_ffi_store32((ptr) + 32, (payload75).reinterpret_as_int()) + + () + } + } + + () + } + HttpResponseTransferCoding(payload76) => { + mbt_ffi_store8((ptr) + 8, (31)) + + match (payload76) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload78) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr79 = mbt_ffi_str2ptr(payload78) + mbt_ffi_store32((ptr) + 24, payload78.length()) + mbt_ffi_store32((ptr) + 20, ptr79) + + () + } + } + + () + } + HttpResponseContentCoding(payload80) => { + mbt_ffi_store8((ptr) + 8, (32)) + + match (payload80) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload82) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr83 = mbt_ffi_str2ptr(payload82) + mbt_ffi_store32((ptr) + 24, payload82.length()) + mbt_ffi_store32((ptr) + 20, ptr83) + + () + } + } + + () + } + HttpResponseTimeout => { + mbt_ffi_store8((ptr) + 8, (33)) + + () + } + HttpUpgradeFailed => { + mbt_ffi_store8((ptr) + 8, (34)) + + () + } + HttpProtocolError => { + mbt_ffi_store8((ptr) + 8, (35)) + + () + } + LoopDetected => { + mbt_ffi_store8((ptr) + 8, (36)) + + () + } + ConfigurationError => { + mbt_ffi_store8((ptr) + 8, (37)) + + () + } + InternalError(payload89) => { + mbt_ffi_store8((ptr) + 8, (38)) + + match (payload89) { + None => { + mbt_ffi_store8((ptr) + 16, (0)) + + () + } + Some(payload91) => { + mbt_ffi_store8((ptr) + 16, (1)) + + let ptr92 = mbt_ffi_str2ptr(payload91) + mbt_ffi_store32((ptr) + 24, payload91.length()) + mbt_ffi_store32((ptr) + 20, ptr92) + + () + } + } + + () + } + } - () + () } - } - - () - } } - () - } - } } -///| priv struct WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource::finish_read( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource::wait_for_read_cleanup( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource::cancel_active_read( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let completed = Ref(false) - @async-core.protect_from_cancel( - () => { - completed.val = @async-core.cancel_future_read( - self.read_task, - self.handle, - () => { - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let completed = Ref(false) + @async-core.protect_from_cancel( + () => { + completed.val = @async-core.cancel_future_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - if completed.val && self.read_buffer != 0 { - wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Reject( - self.read_buffer, - 0, - 1, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + if completed.val && self.read_buffer != 0 { + wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Reject(self.read_buffer, 0, 1) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource::close( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropReadable(self.handle) } -///| fn WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource::close_sync( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - if wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureRejectPrepared( - self.handle, - ) { - self.closed = true - return - } + if wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureRejectPrepared(self.handle) { + self.closed = true + return + } - self.closed = true - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropReadable(self.handle) } -///| async fn WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource::read( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource, ) -> Result[Unit, ErrorCode] { - if self.closed { - raise @async-core.FutureReadError::Dropped - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - let ptr = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Malloc(1) - defer mbt_ffi_free(ptr) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - @async-core.suspend_for_future_read( - self.handle, - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0Read( + if self.closed { + raise @async-core.FutureReadError::Dropped + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + let ptr = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Malloc(1) + defer { mbt_ffi_free(ptr) } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + @async-core.suspend_for_future_read( self.handle, - ptr, - ), - ) catch { - err => { + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0Read(self.handle, ptr), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped } + let value = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Lift(ptr) self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - let value = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Lift(ptr) - self.finish_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropReadable( - self.handle, - ) - } - value -} - -///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureLift( - handle : Int, -) -> @async-core.Future[Result[Unit, ErrorCode]] { - let source = WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Future::from_source(() => source.read(), () => source.close(), () => { - source.close_sync() - }) + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropReadable(self.handle) + } + value +} + +fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureLift(handle : Int) -> @async-core.Future[Result[Unit, ErrorCode]] { + let source = WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Future::from_source( + () => source.read(), + () => source.close(), + () => source.close_sync(), + ) } -///| priv struct WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducer { - future : @async-core.Future[Result[Unit, ErrorCode]] - writer : Int + future : @async-core.Future[Result[Unit, ErrorCode]] + writer : Int } -///| -let wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducers : Map[ - Int, - WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducer, -] = Map([]) +let wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducers : Map[Int, WasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducer] = Map([]) -///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureRejectPrepared( - handle : Int, -) -> Bool { - guard wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducers.get( - handle, - ) - is Some(producer) else { - return false - } - wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducers.remove( - handle, - ) - let writer = producer.writer - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropReadable(handle) - @async-core.spawn_component_task_current(async fn() { - defer wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropWritable( - writer, - ) - @async-core.protect_from_cancel( - () => { - producer.future.reject((value : Result[Unit, ErrorCode]) => { - let ptr = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Malloc( - 1, - ) - wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Lower(value, ptr) - wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Reject(ptr, 0, 1) - mbt_ffi_free(ptr) - }) - let ptr = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Malloc(1) - defer mbt_ffi_free(ptr) - let terminal : Ref[Bool?] = { val: None } - while terminal.val is None { - terminal.val = @async-core.suspend_for_future_write_terminal( - writer, - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0Write( - writer, ptr, - ), - ) - } - guard terminal.val is Some(transferred) - if transferred { - abort("rejected component future unexpectedly transferred a value") - } - }, - resume_on_cancel=true, - ) catch { - _ => abort("failed to reject component future producer") - } - }) - true +fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureRejectPrepared(handle : Int) -> Bool { + guard wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducers.get(handle) is Some(producer) else { + return false + } + wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducers.remove(handle) + let writer = producer.writer + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropReadable(handle) + @async-core.spawn_component_task_current(async fn() { + defer wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropWritable(writer) + @async-core.protect_from_cancel( + () => { + producer.future.reject((value : Result[Unit, ErrorCode]) => { + let ptr = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Malloc(1) + wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Lower(value, ptr) + wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + let ptr = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Malloc(1) + defer { mbt_ffi_free(ptr) } + let terminal : Ref[Bool?] = { val: None } + while terminal.val is None { + terminal.val = @async-core.suspend_for_future_write_terminal( + writer, + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0Write(writer, ptr), + ) + } + guard terminal.val is Some(transferred) + if transferred { + abort("rejected component future unexpectedly transferred a value") + } + }, + resume_on_cancel=true, + ) catch { + _ => abort("failed to reject component future producer") + } + }) + true } -///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureCommit( - handle : Int, -) -> Unit { - guard wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducers.get( - handle, - ) - is Some(producer) else { - return - } - wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducers.remove( - handle, - ) - let writer = producer.writer - if !@async-core.has_component_task_scope() { - abort("component future producer requires an async task scope") - } - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( - () => { - let value = producer.future.get() - let ptr = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Malloc(1) - wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Lower(value, ptr) - let terminal : Ref[Bool?] = { val: None } - while terminal.val is None { - terminal.val = @async-core.suspend_for_future_write_terminal( - writer, - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0Write( - writer, ptr, - ), - ) - } - guard terminal.val is Some(transferred) - if transferred { - wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Commit(ptr, 0, 1) - } else { - wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Reject(ptr, 0, 1) - } - mbt_ffi_free(ptr) - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropWritable( - writer, - ) - }, - resume_on_cancel=true, - ) catch { - _ => abort("component future producer ended without a value") - } - }) +fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureCommit(handle : Int) -> Unit { + guard wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducers.get(handle) is Some(producer) else { + return + } + wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducers.remove(handle) + let writer = producer.writer + if !@async-core.has_component_task_scope() { + abort("component future producer requires an async task scope") + } + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + let value = producer.future.get() + let ptr = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Malloc(1) + wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Lower(value, ptr) + let terminal : Ref[Bool?] = { val: None } + while terminal.val is None { + terminal.val = @async-core.suspend_for_future_write_terminal( + writer, + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0Write(writer, ptr), + ) + } + guard terminal.val is Some(transferred) + if transferred { + wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Commit(ptr, 0, 1) + } else { + wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0Reject(ptr, 0, 1) + } + mbt_ffi_free(ptr) + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0DropWritable(writer) + }, + resume_on_cancel=true, + ) catch { + _ => abort("component future producer ended without a value") + } + }) } -///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureLower( - future : @async-core.Future[Result[Unit, ErrorCode]], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component future producer requires an async task scope") - } - let pair = wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducers.set( - reader, - { future, writer }, - ) - reader +fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureLower(future : @async-core.Future[Result[Unit, ErrorCode]]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component future producer requires an async task scope") + } + let pair = wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture0New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureProducers.set(reader, { future, writer }) + reader } -///| -fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][stream-read-1][static]response.consume-body" - -///| -fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1CancelRead( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[stream-cancel-read-1][static]response.consume-body" +fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][stream-read-1][static]response.consume-body" +fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1CancelRead(handle : Int) -> Int = "wasi:http/types@0.3.0" "[stream-cancel-read-1][static]response.consume-body" -///| -fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1DropReadable( - handle : Int, -) = "wasi:http/types@0.3.0" "[stream-drop-readable-1][static]response.consume-body" +fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[stream-drop-readable-1][static]response.consume-body" -///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyStream1Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmWasiHttpTypes030StaticResponseConsumeBodyStream1Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmWasiHttpTypes030StaticResponseConsumeBodyStream1Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmWasiHttpTypes030StaticResponseConsumeBodyStream1ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource::finish_read( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource::wait_for_read_cleanup( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource::cancel_active_read( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiHttpTypes030StaticResponseConsumeBodyStream1Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiHttpTypes030StaticResponseConsumeBodyStream1Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource::close( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1DropReadable(self.handle) } -///| fn WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource::close_sync( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1DropReadable(self.handle) } -///| async fn WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource::read( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource, - count : Int, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiHttpTypes030StaticResponseConsumeBodyStream1Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiHttpTypes030StaticResponseConsumeBodyStream1Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticResponseConsumeBodyStream1DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) } + let values = wasmWasiHttpTypes030StaticResponseConsumeBodyStream1ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiHttpTypes030StaticResponseConsumeBodyStream1ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) -} - -///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) + if end { + self.close() + } + Some(values) +} + +fn wasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| -fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2Read( - handle : Int, - buffer_ptr : Int, -) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-2][static]response.consume-body" - -///| -fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2CancelRead( - handle : Int, -) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-2][static]response.consume-body" +fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2Read(handle : Int, buffer_ptr : Int) -> Int = "wasi:http/types@0.3.0" "[async-lower][future-read-2][static]response.consume-body" +fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2CancelRead(handle : Int) -> Int = "wasi:http/types@0.3.0" "[future-cancel-read-2][static]response.consume-body" -///| -fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2DropReadable( - handle : Int, -) = "wasi:http/types@0.3.0" "[future-drop-readable-2][static]response.consume-body" +fn wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2DropReadable(handle : Int) = "wasi:http/types@0.3.0" "[future-drop-readable-2][static]response.consume-body" -///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(40 * length) - ptr +fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(40 * length) + ptr } -///| fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - for i in start..<(start + length) { - let elem_ptr = ptr + i * 40 - - match mbt_ffi_load8_u(elem_ptr + 0) { - 0 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => Fields::Fields(mbt_ffi_load32(elem_ptr + 12)).drop() - _ => panic() - } - 1 => - match mbt_ffi_load8_u(elem_ptr + 8) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 2 => () - 3 => () - 4 => () - 5 => () - 6 => () - 7 => () - 8 => () - 9 => () - 10 => () - 11 => () - 12 => () - 13 => () - 14 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) - _ => panic() - } - 15 => () - 16 => () - 17 => () - 18 => () - 19 => () - 20 => () - 21 => () - 22 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => - match mbt_ffi_load8_u(elem_ptr + 20) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 24)) + + for i in start..<(start + length) { + let elem_ptr = ptr + i * 40 + + match (mbt_ffi_load8_u((elem_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + Fields::Fields(mbt_ffi_load32((elem_ptr) + 12)).drop() + + } + _ => panic() + } + + } + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 8)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 2 => () + 3 => () + 4 => () + 5 => () + 6 => () + 7 => () + 8 => () + 9 => () + 10 => () + 11 => () + 12 => () + 13 => () + 14 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + 15 => () + 16 => () + 17 => () + 18 => () + 19 => () + 20 => () + 21 => () + 22 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + + match (mbt_ffi_load8_u((elem_ptr) + 20)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 24)) + + } + _ => panic() + } + + } + _ => panic() + } + + } + 23 => () + 24 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 25 => () + 26 => () + 27 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 28 => () + 29 => () + 30 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 31 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 32 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + 33 => () + 34 => () + 35 => () + 36 => () + 37 => () + 38 => { + + match (mbt_ffi_load8_u((elem_ptr) + 16)) { + 0 => () + 1 => { + mbt_ffi_free(mbt_ffi_load32((elem_ptr) + 20)) + + } + _ => panic() + } + + } + _ => panic() + } + + } _ => panic() - } - _ => panic() } - 23 => () - 24 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 25 => () - 26 => () - 27 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 28 => () - 29 => () - 30 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 31 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 32 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - 33 => () - 34 => () - 35 => () - 36 => () - 37 => () - 38 => - match mbt_ffi_load8_u(elem_ptr + 16) { - 0 => () - 1 => mbt_ffi_free(mbt_ffi_load32(elem_ptr + 20)) - _ => panic() - } - _ => panic() - } - _ => panic() - } - } + + } + } -///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2Lift( - ptr : Int, -) -> Result[Fields?, ErrorCode] { - let lifted31 = match mbt_ffi_load8_u(ptr + 0) { - 0 => { - let lifted : Fields? = match mbt_ffi_load8_u(ptr + 8) { - 0 => Option::None - 1 => Option::Some(Fields::Fields(mbt_ffi_load32(ptr + 12))) - _ => panic() - } - - Result::Ok(lifted) - } - 1 => { - let lifted30 = match mbt_ffi_load8_u(ptr + 8) { - 0 => ErrorCode::DnsTimeout - 1 => { - let lifted0 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) +fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2Lift(ptr : Int) -> Result[Fields?, ErrorCode] { - Option::Some(result) - } - _ => panic() - } - - let lifted1 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => - Option::Some( - mbt_ffi_load16_u(ptr + 30).land(0xFFFF).reinterpret_as_uint(), - ) - _ => panic() - } - - ErrorCode::DnsError(DnsErrorPayload::{ - rcode: lifted0, - info_code: lifted1, - }) - } - 2 => ErrorCode::DestinationNotFound - 3 => ErrorCode::DestinationUnavailable - 4 => ErrorCode::DestinationIpProhibited - 5 => ErrorCode::DestinationIpUnroutable - 6 => ErrorCode::ConnectionRefused - 7 => ErrorCode::ConnectionTerminated - 8 => ErrorCode::ConnectionTimeout - 9 => ErrorCode::ConnectionReadTimeout - 10 => ErrorCode::ConnectionWriteTimeout - 11 => ErrorCode::ConnectionLimitReached - 12 => ErrorCode::TlsProtocolError - 13 => ErrorCode::TlsCertificateError - 14 => { - let lifted2 : Byte? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load8_u(ptr + 17).to_byte()) - _ => panic() - } + let lifted31 = match (mbt_ffi_load8_u((ptr) + 0)) { + 0 => { - let lifted4 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result3 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) + let lifted : Fields? = match mbt_ffi_load8_u((ptr) + 8) { + 0 => Option::None + 1 => { - Option::Some(result3) - } - _ => panic() - } - - ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{ - alert_id: lifted2, - alert_message: lifted4, - }) - } - 15 => ErrorCode::HttpRequestDenied - 16 => ErrorCode::HttpRequestLengthRequired - 17 => { - let lifted5 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpRequestBodySize(lifted5) - } - 18 => ErrorCode::HttpRequestMethodInvalid - 19 => ErrorCode::HttpRequestUriInvalid - 20 => ErrorCode::HttpRequestUriTooLong - 21 => { - let lifted6 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + Option::Some(Fields::Fields(mbt_ffi_load32((ptr) + 12))) + } + _ => panic() + } - ErrorCode::HttpRequestHeaderSectionSize(lifted6) - } - 22 => { - let lifted10 : FieldSizePayload? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let lifted8 : String? = match mbt_ffi_load8_u(ptr + 20) { - 0 => Option::None - 1 => { - let result7 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 24), - mbt_ffi_load32(ptr + 28), - ) - - Option::Some(result7) - } - _ => panic() - } - - let lifted9 : UInt? = match mbt_ffi_load8_u(ptr + 32) { - 0 => Option::None - 1 => - Option::Some(mbt_ffi_load32(ptr + 36).reinterpret_as_uint()) - _ => panic() - } - - Option::Some(FieldSizePayload::{ - field_name: lifted8, - field_size: lifted9, - }) + Result::Ok(lifted) } - _ => panic() - } - - ErrorCode::HttpRequestHeaderSize(lifted10) - } - 23 => { - let lifted11 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSectionSize(lifted11) - } - 24 => { - let lifted13 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None 1 => { - let result12 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) - Option::Some(result12) - } - _ => panic() - } + let lifted30 = match (mbt_ffi_load8_u((ptr) + 8)) { + 0 => { - let lifted14 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{ - field_name: lifted13, - field_size: lifted14, - }) - } - 25 => ErrorCode::HttpResponseIncomplete - 26 => { - let lifted15 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + ErrorCode::DnsTimeout + } + 1 => { - ErrorCode::HttpResponseHeaderSectionSize(lifted15) - } - 27 => { - let lifted17 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result16 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + let lifted0 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { - Option::Some(result16) - } - _ => panic() - } + let result = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) - let lifted18 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{ - field_name: lifted17, - field_size: lifted18, - }) - } - 28 => { - let lifted19 : UInt64? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(ptr + 24).reinterpret_as_uint64()) - _ => panic() - } - - ErrorCode::HttpResponseBodySize(lifted19) - } - 29 => { - let lifted20 : UInt? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 20).reinterpret_as_uint()) - _ => panic() - } + Option::Some(result) + } + _ => panic() + } - ErrorCode::HttpResponseTrailerSectionSize(lifted20) - } - 30 => { - let lifted22 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result21 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + let lifted1 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { - Option::Some(result21) - } - _ => panic() - } + Option::Some((mbt_ffi_load16_u((ptr) + 30).land(0xFFFF).reinterpret_as_uint())) + } + _ => panic() + } - let lifted23 : UInt? = match mbt_ffi_load8_u(ptr + 28) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load32(ptr + 32).reinterpret_as_uint()) - _ => panic() - } - - ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{ - field_name: lifted22, - field_size: lifted23, - }) - } - 31 => { - let lifted25 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result24 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + ErrorCode::DnsError(DnsErrorPayload::{rcode : lifted0, info_code : lifted1}) + } + 2 => { - Option::Some(result24) - } - _ => panic() - } + ErrorCode::DestinationNotFound + } + 3 => { - ErrorCode::HttpResponseTransferCoding(lifted25) - } - 32 => { - let lifted27 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result26 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + ErrorCode::DestinationUnavailable + } + 4 => { - Option::Some(result26) - } - _ => panic() - } - - ErrorCode::HttpResponseContentCoding(lifted27) - } - 33 => ErrorCode::HttpResponseTimeout - 34 => ErrorCode::HttpUpgradeFailed - 35 => ErrorCode::HttpProtocolError - 36 => ErrorCode::LoopDetected - 37 => ErrorCode::ConfigurationError - 38 => { - let lifted29 : String? = match mbt_ffi_load8_u(ptr + 16) { - 0 => Option::None - 1 => { - let result28 = mbt_ffi_ptr2str( - mbt_ffi_load32(ptr + 20), - mbt_ffi_load32(ptr + 24), - ) + ErrorCode::DestinationIpProhibited + } + 5 => { + + ErrorCode::DestinationIpUnroutable + } + 6 => { + + ErrorCode::ConnectionRefused + } + 7 => { + + ErrorCode::ConnectionTerminated + } + 8 => { + + ErrorCode::ConnectionTimeout + } + 9 => { + + ErrorCode::ConnectionReadTimeout + } + 10 => { + + ErrorCode::ConnectionWriteTimeout + } + 11 => { + + ErrorCode::ConnectionLimitReached + } + 12 => { + + ErrorCode::TlsProtocolError + } + 13 => { + + ErrorCode::TlsCertificateError + } + 14 => { + + let lifted2 : Byte? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load8_u((ptr) + 17)).to_byte()) + } + _ => panic() + } + + let lifted4 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { + + let result3 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) + + Option::Some(result3) + } + _ => panic() + } + + ErrorCode::TlsAlertReceived(TlsAlertReceivedPayload::{alert_id : lifted2, alert_message : lifted4}) + } + 15 => { + + ErrorCode::HttpRequestDenied + } + 16 => { + + ErrorCode::HttpRequestLengthRequired + } + 17 => { + + let lifted5 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpRequestBodySize(lifted5) + } + 18 => { + + ErrorCode::HttpRequestMethodInvalid + } + 19 => { + + ErrorCode::HttpRequestUriInvalid + } + 20 => { + + ErrorCode::HttpRequestUriTooLong + } + 21 => { + + let lifted6 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSectionSize(lifted6) + } + 22 => { + + let lifted10 : FieldSizePayload? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let lifted8 : String? = match mbt_ffi_load8_u((ptr) + 20) { + 0 => Option::None + 1 => { + + let result7 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 24), mbt_ffi_load32((ptr) + 28)) + + Option::Some(result7) + } + _ => panic() + } + + let lifted9 : UInt? = match mbt_ffi_load8_u((ptr) + 32) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 36)).reinterpret_as_uint()) + } + _ => panic() + } + + Option::Some(FieldSizePayload::{field_name : lifted8, field_size : lifted9}) + } + _ => panic() + } + + ErrorCode::HttpRequestHeaderSize(lifted10) + } + 23 => { + + let lifted11 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSectionSize(lifted11) + } + 24 => { + + let lifted13 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result12 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result12) + } + _ => panic() + } + + let lifted14 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpRequestTrailerSize(FieldSizePayload::{field_name : lifted13, field_size : lifted14}) + } + 25 => { + + ErrorCode::HttpResponseIncomplete + } + 26 => { + + let lifted15 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } - Option::Some(result28) + ErrorCode::HttpResponseHeaderSectionSize(lifted15) + } + 27 => { + + let lifted17 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result16 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result16) + } + _ => panic() + } + + let lifted18 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpResponseHeaderSize(FieldSizePayload::{field_name : lifted17, field_size : lifted18}) + } + 28 => { + + let lifted19 : UInt64? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((ptr) + 24)).reinterpret_as_uint64()) + } + _ => panic() + } + + ErrorCode::HttpResponseBodySize(lifted19) + } + 29 => { + + let lifted20 : UInt? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 20)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpResponseTrailerSectionSize(lifted20) + } + 30 => { + + let lifted22 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result21 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result21) + } + _ => panic() + } + + let lifted23 : UInt? = match mbt_ffi_load8_u((ptr) + 28) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load32((ptr) + 32)).reinterpret_as_uint()) + } + _ => panic() + } + + ErrorCode::HttpResponseTrailerSize(FieldSizePayload::{field_name : lifted22, field_size : lifted23}) + } + 31 => { + + let lifted25 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result24 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result24) + } + _ => panic() + } + + ErrorCode::HttpResponseTransferCoding(lifted25) + } + 32 => { + + let lifted27 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result26 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result26) + } + _ => panic() + } + + ErrorCode::HttpResponseContentCoding(lifted27) + } + 33 => { + + ErrorCode::HttpResponseTimeout + } + 34 => { + + ErrorCode::HttpUpgradeFailed + } + 35 => { + + ErrorCode::HttpProtocolError + } + 36 => { + + ErrorCode::LoopDetected + } + 37 => { + + ErrorCode::ConfigurationError + } + 38 => { + + let lifted29 : String? = match mbt_ffi_load8_u((ptr) + 16) { + 0 => Option::None + 1 => { + + let result28 = mbt_ffi_ptr2str(mbt_ffi_load32((ptr) + 20), mbt_ffi_load32((ptr) + 24)) + + Option::Some(result28) + } + _ => panic() + } + + ErrorCode::InternalError(lifted29) + } + _ => panic() + } + + Result::Err(lifted30) } _ => panic() - } - - ErrorCode::InternalError(lifted29) - } - _ => panic() } - Result::Err(lifted30) - } - _ => panic() - } - - lifted31 + lifted31 } -///| priv struct WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource::finish_read( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource::wait_for_read_cleanup( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () } - }, - resume_on_cancel=true, - ) catch { - _ => () - } } -///| async fn WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource::cancel_active_read( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let completed = Ref(false) - @async-core.protect_from_cancel( - () => { - completed.val = @async-core.cancel_future_read( - self.read_task, - self.handle, - () => { - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let completed = Ref(false) + @async-core.protect_from_cancel( + () => { + completed.val = @async-core.cancel_future_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - if completed.val && self.read_buffer != 0 { - wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2Reject( - self.read_buffer, - 0, - 1, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + if completed.val && self.read_buffer != 0 { + wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2Reject(self.read_buffer, 0, 1) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource::close( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2DropReadable(self.handle) } -///| fn WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource::close_sync( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - self.closed = true - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2DropReadable( - self.handle, - ) + self.closed = true + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2DropReadable(self.handle) } -///| async fn WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource::read( - self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource, +self : WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource, ) -> Result[Fields?, ErrorCode] { - if self.closed { - raise @async-core.FutureReadError::Dropped - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - let ptr = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2Malloc(1) - defer mbt_ffi_free(ptr) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - @async-core.suspend_for_future_read( - self.handle, - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2Read( + if self.closed { + raise @async-core.FutureReadError::Dropped + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + let ptr = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2Malloc(1) + defer { mbt_ffi_free(ptr) } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + @async-core.suspend_for_future_read( self.handle, - ptr, - ), - ) catch { - err => { + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2Read(self.handle, ptr), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + raise @async-core.FutureReadError::Dropped } + let value = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2Lift(ptr) self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - raise @async-core.FutureReadError::Dropped - } - let value = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2Lift(ptr) - self.finish_read() - if !self.closed { - self.closed = true - wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2DropReadable( - self.handle, - ) - } - value + if !self.closed { + self.closed = true + wasmImportWasiHttpTypes030StaticResponseConsumeBodyFuture2DropReadable(self.handle) + } + value +} + +fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureLift(handle : Int) -> @async-core.Future[Result[Fields?, ErrorCode]] { + let source = WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Future::from_source( + () => source.read(), + () => source.close(), + () => source.close_sync(), + ) } ///| -fn wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureLift( - handle : Int, -) -> @async-core.Future[Result[Fields?, ErrorCode]] { - let source = WasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Future::from_source(() => source.read(), () => source.close(), () => { - source.close_sync() - }) -} +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load16_u) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = +#|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_load16_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load16_u) ///| extern "wasm" fn mbt_ffi_store16(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store16) ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) - -///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| #owned(bytes) extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| -extern "wasm" fn mbt_ffi_store64(offset : Int, value : Int64) = - #|(func (param i32) (param i64) local.get 0 local.get 1 i64.store) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/http/types/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/http/types/top.mbt index 6280ac0a7b..3a7176d21b 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/http/types/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/http/types/top.mbt @@ -1,114 +1,102 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// This type corresponds to HTTP standard Methods. pub(all) enum Method { - Get - Head - Post - Put - Delete - Connect - Options - Trace - Patch - Other(String) + Get + Head + Post + Put + Delete + Connect + Options + Trace + Patch + Other(String) } derive(Show, Eq) - ///| /// This type corresponds to HTTP standard Related Schemes. pub(all) enum Scheme { - Http - Https - Other(String) + Http + Https + Other(String) } derive(Show, Eq) - ///| /// Defines the case payload type for `DNS-error` above: pub(all) struct DnsErrorPayload { - rcode : String? - info_code : UInt? + rcode : String?; info_code : UInt? } derive(Show, Eq) - ///| /// Defines the case payload type for `TLS-alert-received` above: pub(all) struct TlsAlertReceivedPayload { - alert_id : Byte? - alert_message : String? + alert_id : Byte?; alert_message : String? } derive(Show, Eq) - ///| /// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: pub(all) struct FieldSizePayload { - field_name : String? - field_size : UInt? + field_name : String?; field_size : UInt? } derive(Show, Eq) - ///| /// These cases are inspired by the IANA HTTP Proxy Error Types: /// pub(all) suberror ErrorCode { - DnsTimeout - DnsError(DnsErrorPayload) - DestinationNotFound - DestinationUnavailable - DestinationIpProhibited - DestinationIpUnroutable - ConnectionRefused - ConnectionTerminated - ConnectionTimeout - ConnectionReadTimeout - ConnectionWriteTimeout - ConnectionLimitReached - TlsProtocolError - TlsCertificateError - TlsAlertReceived(TlsAlertReceivedPayload) - HttpRequestDenied - HttpRequestLengthRequired - HttpRequestBodySize(UInt64?) - HttpRequestMethodInvalid - HttpRequestUriInvalid - HttpRequestUriTooLong - HttpRequestHeaderSectionSize(UInt?) - HttpRequestHeaderSize(FieldSizePayload?) - HttpRequestTrailerSectionSize(UInt?) - HttpRequestTrailerSize(FieldSizePayload) - HttpResponseIncomplete - HttpResponseHeaderSectionSize(UInt?) - HttpResponseHeaderSize(FieldSizePayload) - HttpResponseBodySize(UInt64?) - HttpResponseTrailerSectionSize(UInt?) - HttpResponseTrailerSize(FieldSizePayload) - HttpResponseTransferCoding(String?) - HttpResponseContentCoding(String?) - HttpResponseTimeout - HttpUpgradeFailed - HttpProtocolError - LoopDetected - ConfigurationError - InternalError(String?) + DnsTimeout + DnsError(DnsErrorPayload) + DestinationNotFound + DestinationUnavailable + DestinationIpProhibited + DestinationIpUnroutable + ConnectionRefused + ConnectionTerminated + ConnectionTimeout + ConnectionReadTimeout + ConnectionWriteTimeout + ConnectionLimitReached + TlsProtocolError + TlsCertificateError + TlsAlertReceived(TlsAlertReceivedPayload) + HttpRequestDenied + HttpRequestLengthRequired + HttpRequestBodySize(UInt64?) + HttpRequestMethodInvalid + HttpRequestUriInvalid + HttpRequestUriTooLong + HttpRequestHeaderSectionSize(UInt?) + HttpRequestHeaderSize(FieldSizePayload?) + HttpRequestTrailerSectionSize(UInt?) + HttpRequestTrailerSize(FieldSizePayload) + HttpResponseIncomplete + HttpResponseHeaderSectionSize(UInt?) + HttpResponseHeaderSize(FieldSizePayload) + HttpResponseBodySize(UInt64?) + HttpResponseTrailerSectionSize(UInt?) + HttpResponseTrailerSize(FieldSizePayload) + HttpResponseTransferCoding(String?) + HttpResponseContentCoding(String?) + HttpResponseTimeout + HttpUpgradeFailed + HttpProtocolError + LoopDetected + ConfigurationError + InternalError(String?) } derive(Show, Eq) - ///| /// This type enumerates the different kinds of errors that may occur when /// setting or appending to a `fields` resource. pub(all) suberror HeaderError { - InvalidSyntax - Forbidden - Immutable - SizeExceeded - Other(String?) + InvalidSyntax + Forbidden + Immutable + SizeExceeded + Other(String?) } derive(Show, Eq) - ///| /// This type enumerates the different kinds of errors that may occur when /// setting fields of a `request-options` resource. pub(all) suberror RequestOptionsError { - NotSupported - Immutable - Other(String?) + NotSupported + Immutable + Other(String?) } derive(Show, Eq) - ///| /// This following block defines the `fields` resource which corresponds to /// HTTP standard Fields. Fields are a common representation used for both @@ -131,24 +119,20 @@ pub(all) suberror RequestOptionsError { /// fail with `header-error.size-exceeded` pub(all) struct Fields(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Fields::drop(self : Fields) -> Unit { - let Fields(resource) = self - wasmImportResourceDropFields(resource) + let Fields(resource) = self + wasmImportResourceDropFields(resource) } - ///| /// Represents an HTTP Request. pub(all) struct Request(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Request::drop(self : Request) -> Unit { - let Request(resource) = self - wasmImportResourceDropRequest(resource) + let Request(resource) = self + wasmImportResourceDropRequest(resource) } - ///| /// Parameters for making an HTTP Request. Each of these parameters is /// currently an optional timeout applicable to the transport layer of the @@ -158,34 +142,31 @@ pub fn Request::drop(self : Request) -> Unit { /// asynchronous call. pub(all) struct RequestOptions(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn RequestOptions::drop(self : RequestOptions) -> Unit { - let RequestOptions(resource) = self - wasmImportResourceDropRequestOptions(resource) + let RequestOptions(resource) = self + wasmImportResourceDropRequestOptions(resource) } - ///| /// Represents an HTTP Response. pub(all) struct Response(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Response::drop(self : Response) -> Unit { - let Response(resource) = self - wasmImportResourceDropResponse(resource) + let Response(resource) = self + wasmImportResourceDropResponse(resource) } - ///| /// Construct an empty HTTP Fields. /// /// The resulting `fields` is mutable. pub fn Fields::fields() -> Fields { - let result : Int = wasmImportConstructorFields() - let ret = Fields::Fields(result) - return ret -} + let result : Int = wasmImportConstructorFields(); + let ret = Fields::Fields(result) + return ret + +} ///| /// Construct an HTTP Fields. /// @@ -203,112 +184,125 @@ pub fn Fields::fields() -> Fields { /// An error result will be returned if any header or value was /// syntactically invalid, if a header was forbidden, or if the /// entries would exceed an implementation size limit. -pub fn Fields::from_list( - entries : Array[(String, FixedArray[Byte])], -) -> Result[Fields, HeaderError] { - let cleanup_list : Array[Int] = [] - - let address = mbt_ffi_malloc(entries.length() * 16) - for index = 0; index < entries.length(); index = index + 1 { - let iter_elem : (String, FixedArray[Byte]) = entries[index] - let iter_base = address + index * 16 - - let ptr = mbt_ffi_str2ptr(iter_elem.0) - mbt_ffi_store32(iter_base + 4, iter_elem.0.length()) - mbt_ffi_store32(iter_base + 0, ptr) - - let ptr0 = mbt_ffi_bytes2ptr(iter_elem.1) - - mbt_ffi_store32(iter_base + 12, iter_elem.1.length()) - mbt_ffi_store32(iter_base + 8, ptr0) - cleanup_list.push(ptr) - cleanup_list.push(ptr0) - } - let return_area = mbt_ffi_malloc(20) - wasmImportStaticFieldsFromList(address, entries.length(), return_area) - - let lifted2 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(Fields::Fields(mbt_ffi_load32(return_area + 4))) - 1 => { - let lifted1 = match mbt_ffi_load8_u(return_area + 4) { - 0 => HeaderError::InvalidSyntax - 1 => HeaderError::Forbidden - 2 => HeaderError::Immutable - 3 => HeaderError::SizeExceeded - 4 => { - let lifted : String? = match mbt_ffi_load8_u(return_area + 8) { - 0 => Option::None +pub fn Fields::from_list(entries : Array[(String, FixedArray[Byte])]) -> Result[Fields, HeaderError] { + let cleanup_list : Array[Int] = [] + + let address = mbt_ffi_malloc((entries).length() * 16); + for index = 0; index < (entries).length(); index = index + 1 { + let iter_elem : (String, FixedArray[Byte]) = (entries)[(index)] + let iter_base = address + (index * 16); + + let ptr = mbt_ffi_str2ptr((iter_elem).0) + mbt_ffi_store32((iter_base) + 4, (iter_elem).0.length()) + mbt_ffi_store32((iter_base) + 0, ptr) + + let ptr0 = mbt_ffi_bytes2ptr((iter_elem).1) + + mbt_ffi_store32((iter_base) + 12, (iter_elem).1.length()) + mbt_ffi_store32((iter_base) + 8, ptr0) + cleanup_list.push(ptr) + cleanup_list.push(ptr0) + + } + let return_area = mbt_ffi_malloc(20) + wasmImportStaticFieldsFromList(address, (entries).length(), return_area); + + let lifted2 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(Fields::Fields(mbt_ffi_load32((return_area) + 4))) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - Option::Some(result) + let lifted1 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + HeaderError::InvalidSyntax + } + 1 => { + + HeaderError::Forbidden + } + 2 => { + + HeaderError::Immutable + } + 3 => { + + HeaderError::SizeExceeded + } + 4 => { + + let lifted : String? = match mbt_ffi_load8_u((return_area) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Option::Some(result) + } + _ => panic() + } + + HeaderError::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted1) } _ => panic() - } - - HeaderError::Other(lifted) - } - _ => panic() } + let ret = lifted2 + mbt_ffi_free(address) + mbt_ffi_free(return_area) - Result::Err(lifted1) - } - _ => panic() - } - let ret = lifted2 - mbt_ffi_free(address) - mbt_ffi_free(return_area) + cleanup_list.each(mbt_ffi_free) + return ret - cleanup_list.each(mbt_ffi_free) - return ret } - ///| /// Get all of the values corresponding to a name. If the name is not present /// in this `fields`, an empty list is returned. However, if the name is /// present but empty, this is represented by a list with one or more /// empty field-values present. pub fn Fields::get(self : Fields, name : String) -> Array[FixedArray[Byte]] { - let Fields(handle) = self - - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(8) - wasmImportMethodFieldsGet(handle, ptr, name.length(), return_area) - - let array : Array[FixedArray[Byte]] = [] - for index = 0; index < mbt_ffi_load32(return_area + 4); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index * 8 - - let result = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} + let Fields(handle) = self + + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(8) + wasmImportMethodFieldsGet(handle, ptr, name.length(), return_area); + + let array : Array[FixedArray[Byte]] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 8) + + let result = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// Returns `true` when the name is present in this `fields`. If the name is /// syntactically invalid, `false` is returned. pub fn Fields::has(self : Fields, name : String) -> Bool { - let Fields(handle) = self - let ptr = mbt_ffi_str2ptr(name) - let result : Int = wasmImportMethodFieldsHas(handle, ptr, name.length()) - let ret = result != 0 - mbt_ffi_free(ptr) - return ret -} + let Fields(handle) = self + + let ptr = mbt_ffi_str2ptr(name) + let result : Int = wasmImportMethodFieldsHas(handle, ptr, name.length()); + let ret = (result != 0) + mbt_ffi_free(ptr) + return ret +} ///| /// Set all of the values for a name. Clears any existing values for that /// name, if they have been set. @@ -317,130 +311,148 @@ pub fn Fields::has(self : Fields, name : String) -> Bool { /// /// Fails with `header-error.size-exceeded` if the name or values would /// exceed an implementation-defined size limit. -pub fn Fields::set( - self : Fields, - name : String, - value : Array[FixedArray[Byte]], -) -> Result[Unit, HeaderError] { - let cleanup_list : Array[Int] = [] - - let Fields(handle) = self - - let ptr = mbt_ffi_str2ptr(name) - - let address = mbt_ffi_malloc(value.length() * 8) - for index = 0; index < value.length(); index = index + 1 { - let iter_elem : FixedArray[Byte] = value[index] - let iter_base = address + index * 8 - - let ptr0 = mbt_ffi_bytes2ptr(iter_elem) - - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr0) - cleanup_list.push(ptr0) - } - let return_area = mbt_ffi_malloc(20) - wasmImportMethodFieldsSet( - handle, - ptr, - name.length(), - address, - value.length(), - return_area, - ) - - let lifted2 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted1 = match mbt_ffi_load8_u(return_area + 4) { - 0 => HeaderError::InvalidSyntax - 1 => HeaderError::Forbidden - 2 => HeaderError::Immutable - 3 => HeaderError::SizeExceeded - 4 => { - let lifted : String? = match mbt_ffi_load8_u(return_area + 8) { - 0 => Option::None +pub fn Fields::set(self : Fields, name : String, value : Array[FixedArray[Byte]]) -> Result[Unit, HeaderError] { + let cleanup_list : Array[Int] = [] + + let Fields(handle) = self + + let ptr = mbt_ffi_str2ptr(name) + + let address = mbt_ffi_malloc((value).length() * 8); + for index = 0; index < (value).length(); index = index + 1 { + let iter_elem : FixedArray[Byte] = (value)[(index)] + let iter_base = address + (index * 8); + + let ptr0 = mbt_ffi_bytes2ptr(iter_elem) + + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr0) + cleanup_list.push(ptr0) + + } + let return_area = mbt_ffi_malloc(20) + wasmImportMethodFieldsSet(handle, ptr, name.length(), address, (value).length(), return_area); + + let lifted2 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - Option::Some(result) + let lifted1 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + HeaderError::InvalidSyntax + } + 1 => { + + HeaderError::Forbidden + } + 2 => { + + HeaderError::Immutable + } + 3 => { + + HeaderError::SizeExceeded + } + 4 => { + + let lifted : String? = match mbt_ffi_load8_u((return_area) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Option::Some(result) + } + _ => panic() + } + + HeaderError::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted1) } _ => panic() - } - - HeaderError::Other(lifted) - } - _ => panic() } + let ret = lifted2 + mbt_ffi_free(ptr) + mbt_ffi_free(address) + mbt_ffi_free(return_area) - Result::Err(lifted1) - } - _ => panic() - } - let ret = lifted2 - mbt_ffi_free(ptr) - mbt_ffi_free(address) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + cleanup_list.each(mbt_ffi_free) + return ret +} ///| /// Delete all values for a name. Does nothing if no values for the name /// exist. /// /// Fails with `header-error.immutable` if the `fields` are immutable. -pub fn Fields::delete( - self : Fields, - name : String, -) -> Result[Unit, HeaderError] { - let Fields(handle) = self - - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(20) - wasmImportMethodFieldsDelete(handle, ptr, name.length(), return_area) - - let lifted1 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted0 = match mbt_ffi_load8_u(return_area + 4) { - 0 => HeaderError::InvalidSyntax - 1 => HeaderError::Forbidden - 2 => HeaderError::Immutable - 3 => HeaderError::SizeExceeded - 4 => { - let lifted : String? = match mbt_ffi_load8_u(return_area + 8) { - 0 => Option::None +pub fn Fields::delete(self : Fields, name : String) -> Result[Unit, HeaderError] { + + let Fields(handle) = self + + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(20) + wasmImportMethodFieldsDelete(handle, ptr, name.length(), return_area); + + let lifted1 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - Option::Some(result) + let lifted0 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + HeaderError::InvalidSyntax + } + 1 => { + + HeaderError::Forbidden + } + 2 => { + + HeaderError::Immutable + } + 3 => { + + HeaderError::SizeExceeded + } + 4 => { + + let lifted : String? = match mbt_ffi_load8_u((return_area) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Option::Some(result) + } + _ => panic() + } + + HeaderError::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted0) } _ => panic() - } - - HeaderError::Other(lifted) - } - _ => panic() } + let ret = lifted1 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret - Result::Err(lifted0) - } - _ => panic() - } - let ret = lifted1 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret } - ///| /// Delete all values for a name. Does nothing if no values for the name /// exist. @@ -448,68 +460,76 @@ pub fn Fields::delete( /// Returns all values previously corresponding to the name, if any. /// /// Fails with `header-error.immutable` if the `fields` are immutable. -pub fn Fields::get_and_delete( - self : Fields, - name : String, -) -> Result[Array[FixedArray[Byte]], HeaderError] { - let Fields(handle) = self - - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(20) - wasmImportMethodFieldsGetAndDelete(handle, ptr, name.length(), return_area) - - let lifted2 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array : Array[FixedArray[Byte]] = [] - for index = 0; index < mbt_ffi_load32(return_area + 8); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index * 8 - - let result = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Result::Ok(array) - } - 1 => { - let lifted1 = match mbt_ffi_load8_u(return_area + 4) { - 0 => HeaderError::InvalidSyntax - 1 => HeaderError::Forbidden - 2 => HeaderError::Immutable - 3 => HeaderError::SizeExceeded - 4 => { - let lifted : String? = match mbt_ffi_load8_u(return_area + 8) { - 0 => Option::None +pub fn Fields::get_and_delete(self : Fields, name : String) -> Result[Array[FixedArray[Byte]], HeaderError] { + + let Fields(handle) = self + + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(20) + wasmImportMethodFieldsGetAndDelete(handle, ptr, name.length(), return_area); + + let lifted2 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let array : Array[FixedArray[Byte]] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 8)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index * 8) + + let result = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) + + Result::Ok(array) + } 1 => { - let result0 = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - Option::Some(result0) + let lifted1 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + HeaderError::InvalidSyntax + } + 1 => { + + HeaderError::Forbidden + } + 2 => { + + HeaderError::Immutable + } + 3 => { + + HeaderError::SizeExceeded + } + 4 => { + + let lifted : String? = match mbt_ffi_load8_u((return_area) + 8) { + 0 => Option::None + 1 => { + + let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Option::Some(result0) + } + _ => panic() + } + + HeaderError::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted1) } _ => panic() - } - - HeaderError::Other(lifted) - } - _ => panic() } + let ret = lifted2 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret - Result::Err(lifted1) - } - _ => panic() - } - let ret = lifted2 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret } - ///| /// Append a value for a name. Does not change or delete any existing /// values for that name. @@ -518,65 +538,70 @@ pub fn Fields::get_and_delete( /// /// Fails with `header-error.size-exceeded` if the value would exceed /// an implementation-defined size limit. -pub fn Fields::append( - self : Fields, - name : String, - value : FixedArray[Byte], -) -> Result[Unit, HeaderError] { - let Fields(handle) = self - - let ptr = mbt_ffi_str2ptr(name) - - let ptr0 = mbt_ffi_bytes2ptr(value) - - let return_area = mbt_ffi_malloc(20) - wasmImportMethodFieldsAppend( - handle, - ptr, - name.length(), - ptr0, - value.length(), - return_area, - ) - - let lifted2 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted1 = match mbt_ffi_load8_u(return_area + 4) { - 0 => HeaderError::InvalidSyntax - 1 => HeaderError::Forbidden - 2 => HeaderError::Immutable - 3 => HeaderError::SizeExceeded - 4 => { - let lifted : String? = match mbt_ffi_load8_u(return_area + 8) { - 0 => Option::None +pub fn Fields::append(self : Fields, name : String, value : FixedArray[Byte]) -> Result[Unit, HeaderError] { + + let Fields(handle) = self + + let ptr = mbt_ffi_str2ptr(name) + + let ptr0 = mbt_ffi_bytes2ptr(value) + + let return_area = mbt_ffi_malloc(20) + wasmImportMethodFieldsAppend(handle, ptr, name.length(), ptr0, value.length(), return_area); + + let lifted2 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - Option::Some(result) + let lifted1 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + HeaderError::InvalidSyntax + } + 1 => { + + HeaderError::Forbidden + } + 2 => { + + HeaderError::Immutable + } + 3 => { + + HeaderError::SizeExceeded + } + 4 => { + + let lifted : String? = match mbt_ffi_load8_u((return_area) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Option::Some(result) + } + _ => panic() + } + + HeaderError::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted1) } _ => panic() - } - - HeaderError::Other(lifted) - } - _ => panic() } + let ret = lifted2 + mbt_ffi_free(ptr) + mbt_ffi_free(ptr0) + mbt_ffi_free(return_area) + return ret - Result::Err(lifted1) - } - _ => panic() - } - let ret = lifted2 - mbt_ffi_free(ptr) - mbt_ffi_free(ptr0) - mbt_ffi_free(return_area) - return ret } - ///| /// Retrieve the full set of names and values in the Fields. Like the /// constructor, the list represents each name-value pair. @@ -588,43 +613,39 @@ pub fn Fields::append( /// The names and values are always returned in the original casing and in /// the order in which they will be serialized for transport. pub fn Fields::copy_all(self : Fields) -> Array[(String, FixedArray[Byte])] { - let Fields(handle) = self - let return_area = mbt_ffi_malloc(8) - wasmImportMethodFieldsCopyAll(handle, return_area) - - let array : Array[(String, FixedArray[Byte])] = [] - for index = 0; index < mbt_ffi_load32(return_area + 4); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 0) + index * 16 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - let result0 = mbt_ffi_ptr2bytes( - mbt_ffi_load32(iter_base + 8), - mbt_ffi_load32(iter_base + 12), - ) - - array.push((result, result0)) - } - mbt_ffi_free(mbt_ffi_load32(return_area + 0)) - let ret = array - mbt_ffi_free(return_area) - return ret -} + let Fields(handle) = self + let return_area = mbt_ffi_malloc(8) + wasmImportMethodFieldsCopyAll(handle, return_area); + + let array : Array[(String, FixedArray[Byte])] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 16) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + let result0 = mbt_ffi_ptr2bytes(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12)) + + array.push((result, result0)) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 0)) + let ret = array + mbt_ffi_free(return_area) + return ret + +} ///| /// Make a deep copy of the Fields. Equivalent in behavior to calling the /// `fields` constructor on the return value of `copy-all`. The resulting /// `fields` is mutable. pub fn Fields::clone(self : Fields) -> Fields { - let Fields(handle) = self - let result : Int = wasmImportMethodFieldsClone(handle) - let ret = Fields::Fields(result) - return ret -} + let Fields(handle) = self + let result : Int = wasmImportMethodFieldsClone(handle); + let ret = Fields::Fields(result) + return ret + +} ///| /// Construct a new `request` with a default `method` of `GET`, and /// `none` values for `path-with-query`, `scheme`, and `authority`. @@ -647,339 +668,422 @@ pub fn Fields::clone(self : Fields) -> Fields { /// to reject invalid constructions of `request`. /// /// The returned future resolves to result of transmission of this request. -pub fn Request::new( - headers : Fields, - contents : @async-core.Stream[Byte]?, - trailers : @async-core.Future[Result[Fields?, ErrorCode]], - options : RequestOptions?, -) -> (Request, @async-core.Future[Result[Unit, ErrorCode]]) { - let Fields(handle) = headers - - let (lowered, lowered1) = match contents { - None => (0, 0) - Some(payload0) => - (1, wasmWasiHttpTypes030StaticRequestNewStream0StreamLower(payload0)) - } - - let (lowered5, lowered6) = match options { - None => (0, 0) - Some(payload3) => { - let RequestOptions(handle4) = payload3 - - (1, handle4) - } - } - let return_area = mbt_ffi_malloc(8) - let lower_arg = handle - let lower_arg7 = lowered - let lower_arg8 = lowered1 - let lower_arg9 = wasmWasiHttpTypes030StaticRequestNewFuture1FutureLower( - trailers, - ) - let lower_arg10 = lowered5 - let lower_arg11 = lowered6 - let lower_arg12 = return_area - wasmImportStaticRequestNew( - lower_arg, lower_arg7, lower_arg8, lower_arg9, lower_arg10, lower_arg11, lower_arg12, - ) - - match lower_arg7 { - 0 => () - 1 => wasmWasiHttpTypes030StaticRequestNewStream0StreamCommit(lower_arg8) - _ => panic() - } - wasmWasiHttpTypes030StaticRequestNewFuture1FutureCommit(lower_arg9) - - match lower_arg10 { - 0 => () - 1 => () - _ => panic() - } - let result14 = wasmWasiHttpTypes030StaticRequestNewFuture2FutureLift( - mbt_ffi_load32(return_area + 4), - ) - let ret = (Request::Request(mbt_ffi_load32(return_area + 0)), result14) - mbt_ffi_free(return_area) - return ret -} +pub fn Request::new(headers : Fields, contents : @async-core.Stream[Byte]?, trailers : @async-core.Future[Result[Fields?, ErrorCode]], options : RequestOptions?) -> (Request, @async-core.Future[Result[Unit, ErrorCode]]) { + let Fields(handle) = headers + + let (lowered, lowered1) = match (contents) { + None => { + + ((0), 0) + } + Some(payload0) => { + + ((1), wasmWasiHttpTypes030StaticRequestNewStream0StreamLower(payload0)) + } + } + + let (lowered5, lowered6) = match (options) { + None => { + + ((0), 0) + } + Some(payload3) => { + + let RequestOptions(handle4) = payload3 + + ((1), handle4) + } + } + let return_area = mbt_ffi_malloc(8) + let lower_arg = handle + let lower_arg7 = lowered + let lower_arg8 = lowered1 + let lower_arg9 = wasmWasiHttpTypes030StaticRequestNewFuture1FutureLower(trailers) + let lower_arg10 = lowered5 + let lower_arg11 = lowered6 + let lower_arg12 = return_area + wasmImportStaticRequestNew(lower_arg, lower_arg7, lower_arg8, lower_arg9, lower_arg10, lower_arg11, lower_arg12); + + match (lower_arg7) { + 0 => () + 1 => { + wasmWasiHttpTypes030StaticRequestNewStream0StreamCommit(lower_arg8) + + } + _ => panic() + } + wasmWasiHttpTypes030StaticRequestNewFuture1FutureCommit(lower_arg9) + + match (lower_arg10) { + 0 => () + 1 => () + _ => panic() + } + let result14 = wasmWasiHttpTypes030StaticRequestNewFuture2FutureLift(mbt_ffi_load32((return_area) + 4)) + let ret = (Request::Request(mbt_ffi_load32((return_area) + 0)), result14) + mbt_ffi_free(return_area) + return ret + +} ///| /// Get the Method for the Request. pub fn Request::get_method(self : Request) -> Method { - let Request(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodRequestGetMethod(handle, return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Method::Get - 1 => Method::Head - 2 => Method::Post - 3 => Method::Put - 4 => Method::Delete - 5 => Method::Connect - 6 => Method::Options - 7 => Method::Trace - 8 => Method::Patch - 9 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Method::Other(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} + let Request(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodRequestGetMethod(handle, return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Method::Get + } + 1 => { + + Method::Head + } + 2 => { + + Method::Post + } + 3 => { + + Method::Put + } + 4 => { + + Method::Delete + } + 5 => { + + Method::Connect + } + 6 => { + + Method::Options + } + 7 => { + + Method::Trace + } + 8 => { + + Method::Patch + } + 9 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Method::Other(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} ///| /// Set the Method for the Request. Fails if the string present in a /// `method.other` argument is not a syntactically valid method. -pub fn Request::set_method( - self : Request, - method_ : Method, -) -> Result[Unit, Unit] { - let cleanup_list : Array[Int] = [] - - let Request(handle) = self - - let (lowered, lowered9, lowered10) = match method_ { - Get => (0, 0, 0) - Head => (1, 0, 0) - Post => (2, 0, 0) - Put => (3, 0, 0) - Delete => (4, 0, 0) - Connect => (5, 0, 0) - Options => (6, 0, 0) - Trace => (7, 0, 0) - Patch => (8, 0, 0) - Other(payload8) => { - let ptr = mbt_ffi_str2ptr(payload8) - cleanup_list.push(ptr) - - (9, ptr, payload8.length()) - } - } - let result : Int = wasmImportMethodRequestSetMethod( - handle, lowered, lowered9, lowered10, - ) - - let lifted = match result { - 0 => Result::Ok(()) - 1 => Result::Err(()) - _ => panic() - } - let ret = lifted - - cleanup_list.each(mbt_ffi_free) - return ret -} +pub fn Request::set_method(self : Request, method_ : Method) -> Result[Unit, Unit] { + let cleanup_list : Array[Int] = [] + + let Request(handle) = self + + let (lowered,lowered9,lowered10) = match method_ { + Get => { + + ((0), 0, 0) + } + Head => { + + ((1), 0, 0) + } + Post => { + + ((2), 0, 0) + } + Put => { + + ((3), 0, 0) + } + Delete => { + + ((4), 0, 0) + } + Connect => { + + ((5), 0, 0) + } + Options => { + + ((6), 0, 0) + } + Trace => { + + ((7), 0, 0) + } + Patch => { + + ((8), 0, 0) + } + Other(payload8) => { + + let ptr = mbt_ffi_str2ptr(payload8) + cleanup_list.push(ptr) + + ((9), ptr, payload8.length()) + } + } + let result : Int = wasmImportMethodRequestSetMethod(handle, lowered, lowered9, lowered10); + let lifted = match (result) { + 0 => { + + Result::Ok(()) + } + 1 => { + + Result::Err(()) + } + _ => panic() + } + let ret = lifted + + cleanup_list.each(mbt_ffi_free) + return ret + +} ///| /// Get the combination of the HTTP Path and Query for the Request. When /// `none`, this represents an empty Path and empty Query. pub fn Request::get_path_with_query(self : Request) -> String? { - let Request(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodRequestGetPathWithQuery(handle, return_area) - - let lifted : String? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Option::Some(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} + let Request(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodRequestGetPathWithQuery(handle, return_area); + + let lifted : String? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Option::Some(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} ///| /// Set the combination of the HTTP Path and Query for the Request. When /// `none`, this represents an empty Path and empty Query. Fails is the /// string given is not a syntactically valid path and query uri component. -pub fn Request::set_path_with_query( - self : Request, - path_with_query : String?, -) -> Result[Unit, Unit] { - let cleanup_list : Array[Int] = [] - - let Request(handle) = self - - let (lowered, lowered1, lowered2) = match path_with_query { - None => (0, 0, 0) - Some(payload0) => { - let ptr = mbt_ffi_str2ptr(payload0) - cleanup_list.push(ptr) - - (1, ptr, payload0.length()) - } - } - let result : Int = wasmImportMethodRequestSetPathWithQuery( - handle, lowered, lowered1, lowered2, - ) - - let lifted = match result { - 0 => Result::Ok(()) - 1 => Result::Err(()) - _ => panic() - } - let ret = lifted - - cleanup_list.each(mbt_ffi_free) - return ret -} +pub fn Request::set_path_with_query(self : Request, path_with_query : String?) -> Result[Unit, Unit] { + let cleanup_list : Array[Int] = [] + + let Request(handle) = self + + let (lowered, lowered1, lowered2) = match (path_with_query) { + None => { + + ((0), 0, 0) + } + Some(payload0) => { + + let ptr = mbt_ffi_str2ptr(payload0) + cleanup_list.push(ptr) + + ((1), ptr, payload0.length()) + } + } + let result : Int = wasmImportMethodRequestSetPathWithQuery(handle, lowered, lowered1, lowered2); + + let lifted = match (result) { + 0 => { + + Result::Ok(()) + } + 1 => { + Result::Err(()) + } + _ => panic() + } + let ret = lifted + + cleanup_list.each(mbt_ffi_free) + return ret + +} ///| /// Get the HTTP Related Scheme for the Request. When `none`, the /// implementation may choose an appropriate default scheme. pub fn Request::get_scheme(self : Request) -> Scheme? { - let Request(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodRequestGetScheme(handle, return_area) - - let lifted0 : Scheme? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => Scheme::Http - 1 => Scheme::Https - 2 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 8), - mbt_ffi_load32(return_area + 12), - ) - - Scheme::Other(result) - } - _ => panic() + + let Request(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodRequestGetScheme(handle, return_area); + + let lifted0 : Scheme? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + Scheme::Http + } + 1 => { + + Scheme::Https + } + 2 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 8), mbt_ffi_load32((return_area) + 12)) + + Scheme::Other(result) + } + _ => panic() + } + + Option::Some(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(return_area) + return ret - Option::Some(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(return_area) - return ret } - ///| /// Set the HTTP Related Scheme for the Request. When `none`, the /// implementation may choose an appropriate default scheme. Fails if the /// string given is not a syntactically valid uri scheme. -pub fn Request::set_scheme( - self : Request, - scheme : Scheme?, -) -> Result[Unit, Unit] { - let cleanup_list : Array[Int] = [] - - let Request(handle) = self - - let (lowered6, lowered7, lowered8, lowered9) = match scheme { - None => (0, 0, 0, 0) - Some(payload0) => { - let (lowered, lowered4, lowered5) = match payload0 { - Http => (0, 0, 0) - Https => (1, 0, 0) - Other(payload3) => { - let ptr = mbt_ffi_str2ptr(payload3) - cleanup_list.push(ptr) - - (2, ptr, payload3.length()) - } +pub fn Request::set_scheme(self : Request, scheme : Scheme?) -> Result[Unit, Unit] { + let cleanup_list : Array[Int] = [] + + let Request(handle) = self + + let (lowered6, lowered7, lowered8, lowered9) = match (scheme) { + None => { + + ((0), 0, 0, 0) + } + Some(payload0) => { + + let (lowered,lowered4,lowered5) = match payload0 { + Http => { + + ((0), 0, 0) + } + Https => { + + ((1), 0, 0) + } + Other(payload3) => { + + let ptr = mbt_ffi_str2ptr(payload3) + cleanup_list.push(ptr) + + ((2), ptr, payload3.length()) + } + } + + ((1), lowered, lowered4, lowered5) + } } + let result : Int = wasmImportMethodRequestSetScheme(handle, lowered6, lowered7, lowered8, lowered9); - (1, lowered, lowered4, lowered5) - } - } - let result : Int = wasmImportMethodRequestSetScheme( - handle, lowered6, lowered7, lowered8, lowered9, - ) - - let lifted = match result { - 0 => Result::Ok(()) - 1 => Result::Err(()) - _ => panic() - } - let ret = lifted - - cleanup_list.each(mbt_ffi_free) - return ret -} + let lifted = match (result) { + 0 => { + + Result::Ok(()) + } + 1 => { + + Result::Err(()) + } + _ => panic() + } + let ret = lifted + + cleanup_list.each(mbt_ffi_free) + return ret +} ///| /// Get the authority of the Request's target URI. A value of `none` may be used /// with Related Schemes which do not require an authority. The HTTP and /// HTTPS schemes always require an authority. pub fn Request::get_authority(self : Request) -> String? { - let Request(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodRequestGetAuthority(handle, return_area) - - let lifted : String? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Option::Some(result) - } - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} + let Request(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodRequestGetAuthority(handle, return_area); + + let lifted : String? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Option::Some(result) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} ///| /// Set the authority of the Request's target URI. A value of `none` may be used /// with Related Schemes which do not require an authority. The HTTP and /// HTTPS schemes always require an authority. Fails if the string given is /// not a syntactically valid URI authority. -pub fn Request::set_authority( - self : Request, - authority : String?, -) -> Result[Unit, Unit] { - let cleanup_list : Array[Int] = [] - - let Request(handle) = self - - let (lowered, lowered1, lowered2) = match authority { - None => (0, 0, 0) - Some(payload0) => { - let ptr = mbt_ffi_str2ptr(payload0) - cleanup_list.push(ptr) - - (1, ptr, payload0.length()) - } - } - let result : Int = wasmImportMethodRequestSetAuthority( - handle, lowered, lowered1, lowered2, - ) - - let lifted = match result { - 0 => Result::Ok(()) - 1 => Result::Err(()) - _ => panic() - } - let ret = lifted - - cleanup_list.each(mbt_ffi_free) - return ret -} +pub fn Request::set_authority(self : Request, authority : String?) -> Result[Unit, Unit] { + let cleanup_list : Array[Int] = [] + + let Request(handle) = self + + let (lowered, lowered1, lowered2) = match (authority) { + None => { + + ((0), 0, 0) + } + Some(payload0) => { + + let ptr = mbt_ffi_str2ptr(payload0) + cleanup_list.push(ptr) + + ((1), ptr, payload0.length()) + } + } + let result : Int = wasmImportMethodRequestSetAuthority(handle, lowered, lowered1, lowered2); + + let lifted = match (result) { + 0 => { + + Result::Ok(()) + } + 1 => { + + Result::Err(()) + } + _ => panic() + } + let ret = lifted + cleanup_list.each(mbt_ffi_free) + return ret + +} ///| /// Get the `request-options` to be associated with this request /// @@ -990,35 +1094,37 @@ pub fn Request::set_authority( /// the parent `request` is dropped, or its ownership is transferred to /// another component by e.g. `handler.handle`. pub fn Request::get_options(self : Request) -> RequestOptions? { - let Request(handle) = self - let return_area = mbt_ffi_malloc(8) - wasmImportMethodRequestGetOptions(handle, return_area) - - let lifted : RequestOptions? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => - Option::Some( - RequestOptions::RequestOptions(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} + let Request(handle) = self + let return_area = mbt_ffi_malloc(8) + wasmImportMethodRequestGetOptions(handle, return_area); + + let lifted : RequestOptions? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + Option::Some(RequestOptions::RequestOptions(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} ///| /// Get the headers associated with the Request. /// /// The returned `headers` resource is immutable: `set`, `append`, and /// `delete` operations will fail with `header-error.immutable`. pub fn Request::get_headers(self : Request) -> Fields { - let Request(handle) = self - let result : Int = wasmImportMethodRequestGetHeaders(handle) - let ret = Fields::Fields(result) - return ret -} + let Request(handle) = self + let result : Int = wasmImportMethodRequestGetHeaders(handle); + let ret = Fields::Fields(result) + return ret + +} ///| /// Get body of the Request. /// @@ -1032,261 +1138,298 @@ pub fn Request::get_headers(self : Request) -> Fields { /// /// Note that function will move the `request`, but references to headers or /// request options acquired from it previously will remain valid. -pub fn Request::consume_body( - this : Request, - res : @async-core.Future[Result[Unit, ErrorCode]], -) -> (@async-core.Stream[Byte], @async-core.Future[Result[Fields?, ErrorCode]]) { - let Request(handle) = this - let return_area = mbt_ffi_malloc(8) - let lower_arg = handle - let lower_arg0 = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureLower( - res, - ) - let lower_arg1 = return_area - wasmImportStaticRequestConsumeBody(lower_arg, lower_arg0, lower_arg1) - wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureCommit(lower_arg0) - let result2 = wasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamLift( - mbt_ffi_load32(return_area + 0), - ) - let result3 = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureLift( - mbt_ffi_load32(return_area + 4), - ) - let ret = (result2, result3) - mbt_ffi_free(return_area) - return ret -} +pub fn Request::consume_body(this : Request, res : @async-core.Future[Result[Unit, ErrorCode]]) -> (@async-core.Stream[Byte], @async-core.Future[Result[Fields?, ErrorCode]]) { + + let Request(handle) = this + let return_area = mbt_ffi_malloc(8) + let lower_arg = handle + let lower_arg0 = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureLower(res) + let lower_arg1 = return_area + wasmImportStaticRequestConsumeBody(lower_arg, lower_arg0, lower_arg1); + wasmWasiHttpTypes030StaticRequestConsumeBodyFuture0FutureCommit(lower_arg0) + let result2 = wasmWasiHttpTypes030StaticRequestConsumeBodyStream1StreamLift(mbt_ffi_load32((return_area) + 0)) + let result3 = wasmWasiHttpTypes030StaticRequestConsumeBodyFuture2FutureLift(mbt_ffi_load32((return_area) + 4)) + let ret = (result2, result3) + mbt_ffi_free(return_area) + return ret +} ///| /// Construct a default `request-options` value. pub fn RequestOptions::request_options() -> RequestOptions { - let result : Int = wasmImportConstructorRequestOptions() - let ret = RequestOptions::RequestOptions(result) - return ret -} + let result : Int = wasmImportConstructorRequestOptions(); + let ret = RequestOptions::RequestOptions(result) + return ret + +} ///| /// The timeout for the initial connect to the HTTP Server. pub fn RequestOptions::get_connect_timeout(self : RequestOptions) -> UInt64? { - let RequestOptions(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodRequestOptionsGetConnectTimeout(handle, return_area) - - let lifted : UInt64? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} + let RequestOptions(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodRequestOptionsGetConnectTimeout(handle, return_area); + + let lifted : UInt64? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} ///| /// Set the timeout for the initial connect to the HTTP Server. An error /// return value indicates that this timeout is not supported or that this /// handle is immutable. -pub fn RequestOptions::set_connect_timeout( - self : RequestOptions, - duration : UInt64?, -) -> Result[Unit, RequestOptionsError] { - let RequestOptions(handle) = self - - let (lowered, lowered1) = match duration { - None => (0, 0L) - Some(payload0) => (1, payload0.reinterpret_as_int64()) - } - let return_area = mbt_ffi_malloc(20) - wasmImportMethodRequestOptionsSetConnectTimeout( - handle, lowered, lowered1, return_area, - ) - - let lifted3 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted2 = match mbt_ffi_load8_u(return_area + 4) { - 0 => RequestOptionsError::NotSupported - 1 => RequestOptionsError::Immutable - 2 => { - let lifted : String? = match mbt_ffi_load8_u(return_area + 8) { - 0 => Option::None +pub fn RequestOptions::set_connect_timeout(self : RequestOptions, duration : UInt64?) -> Result[Unit, RequestOptionsError] { + + let RequestOptions(handle) = self + + let (lowered, lowered1) = match (duration) { + None => { + + ((0), 0L) + } + Some(payload0) => { + + ((1), (payload0).reinterpret_as_int64()) + } + } + let return_area = mbt_ffi_malloc(20) + wasmImportMethodRequestOptionsSetConnectTimeout(handle, lowered, lowered1, return_area); + + let lifted3 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - Option::Some(result) + let lifted2 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + RequestOptionsError::NotSupported + } + 1 => { + + RequestOptionsError::Immutable + } + 2 => { + + let lifted : String? = match mbt_ffi_load8_u((return_area) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Option::Some(result) + } + _ => panic() + } + + RequestOptionsError::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted2) } _ => panic() - } - - RequestOptionsError::Other(lifted) - } - _ => panic() } + let ret = lifted3 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted2) - } - _ => panic() - } - let ret = lifted3 - mbt_ffi_free(return_area) - return ret } - ///| /// The timeout for receiving the first byte of the Response body. pub fn RequestOptions::get_first_byte_timeout(self : RequestOptions) -> UInt64? { - let RequestOptions(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodRequestOptionsGetFirstByteTimeout(handle, return_area) - - let lifted : UInt64? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} + let RequestOptions(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodRequestOptionsGetFirstByteTimeout(handle, return_area); + + let lifted : UInt64? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} ///| /// Set the timeout for receiving the first byte of the Response body. An /// error return value indicates that this timeout is not supported or that /// this handle is immutable. -pub fn RequestOptions::set_first_byte_timeout( - self : RequestOptions, - duration : UInt64?, -) -> Result[Unit, RequestOptionsError] { - let RequestOptions(handle) = self - - let (lowered, lowered1) = match duration { - None => (0, 0L) - Some(payload0) => (1, payload0.reinterpret_as_int64()) - } - let return_area = mbt_ffi_malloc(20) - wasmImportMethodRequestOptionsSetFirstByteTimeout( - handle, lowered, lowered1, return_area, - ) - - let lifted3 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted2 = match mbt_ffi_load8_u(return_area + 4) { - 0 => RequestOptionsError::NotSupported - 1 => RequestOptionsError::Immutable - 2 => { - let lifted : String? = match mbt_ffi_load8_u(return_area + 8) { - 0 => Option::None +pub fn RequestOptions::set_first_byte_timeout(self : RequestOptions, duration : UInt64?) -> Result[Unit, RequestOptionsError] { + + let RequestOptions(handle) = self + + let (lowered, lowered1) = match (duration) { + None => { + + ((0), 0L) + } + Some(payload0) => { + + ((1), (payload0).reinterpret_as_int64()) + } + } + let return_area = mbt_ffi_malloc(20) + wasmImportMethodRequestOptionsSetFirstByteTimeout(handle, lowered, lowered1, return_area); + + let lifted3 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - Option::Some(result) + let lifted2 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + RequestOptionsError::NotSupported + } + 1 => { + + RequestOptionsError::Immutable + } + 2 => { + + let lifted : String? = match mbt_ffi_load8_u((return_area) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Option::Some(result) + } + _ => panic() + } + + RequestOptionsError::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted2) } _ => panic() - } - - RequestOptionsError::Other(lifted) - } - _ => panic() } + let ret = lifted3 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted2) - } - _ => panic() - } - let ret = lifted3 - mbt_ffi_free(return_area) - return ret } - ///| /// The timeout for receiving subsequent chunks of bytes in the Response /// body stream. -pub fn RequestOptions::get_between_bytes_timeout( - self : RequestOptions, -) -> UInt64? { - let RequestOptions(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodRequestOptionsGetBetweenBytesTimeout(handle, return_area) - - let lifted : UInt64? = match mbt_ffi_load8_u(return_area + 0) { - 0 => Option::None - 1 => Option::Some(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} +pub fn RequestOptions::get_between_bytes_timeout(self : RequestOptions) -> UInt64? { + let RequestOptions(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodRequestOptionsGetBetweenBytesTimeout(handle, return_area); + + let lifted : UInt64? = match mbt_ffi_load8_u((return_area) + 0) { + 0 => Option::None + 1 => { + + Option::Some((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} ///| /// Set the timeout for receiving subsequent chunks of bytes in the Response /// body stream. An error return value indicates that this timeout is not /// supported or that this handle is immutable. -pub fn RequestOptions::set_between_bytes_timeout( - self : RequestOptions, - duration : UInt64?, -) -> Result[Unit, RequestOptionsError] { - let RequestOptions(handle) = self - - let (lowered, lowered1) = match duration { - None => (0, 0L) - Some(payload0) => (1, payload0.reinterpret_as_int64()) - } - let return_area = mbt_ffi_malloc(20) - wasmImportMethodRequestOptionsSetBetweenBytesTimeout( - handle, lowered, lowered1, return_area, - ) - - let lifted3 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted2 = match mbt_ffi_load8_u(return_area + 4) { - 0 => RequestOptionsError::NotSupported - 1 => RequestOptionsError::Immutable - 2 => { - let lifted : String? = match mbt_ffi_load8_u(return_area + 8) { - 0 => Option::None +pub fn RequestOptions::set_between_bytes_timeout(self : RequestOptions, duration : UInt64?) -> Result[Unit, RequestOptionsError] { + + let RequestOptions(handle) = self + + let (lowered, lowered1) = match (duration) { + None => { + + ((0), 0L) + } + Some(payload0) => { + + ((1), (payload0).reinterpret_as_int64()) + } + } + let return_area = mbt_ffi_malloc(20) + wasmImportMethodRequestOptionsSetBetweenBytesTimeout(handle, lowered, lowered1, return_area); + + let lifted3 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } 1 => { - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 12), - mbt_ffi_load32(return_area + 16), - ) - Option::Some(result) + let lifted2 = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + RequestOptionsError::NotSupported + } + 1 => { + + RequestOptionsError::Immutable + } + 2 => { + + let lifted : String? = match mbt_ffi_load8_u((return_area) + 8) { + 0 => Option::None + 1 => { + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 12), mbt_ffi_load32((return_area) + 16)) + + Option::Some(result) + } + _ => panic() + } + + RequestOptionsError::Other(lifted) + } + _ => panic() + } + + Result::Err(lifted2) } _ => panic() - } - - RequestOptionsError::Other(lifted) - } - _ => panic() } + let ret = lifted3 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted2) - } - _ => panic() - } - let ret = lifted3 - mbt_ffi_free(return_area) - return ret } - ///| /// Make a deep copy of the `request-options`. /// The resulting `request-options` is mutable. pub fn RequestOptions::clone(self : RequestOptions) -> RequestOptions { - let RequestOptions(handle) = self - let result : Int = wasmImportMethodRequestOptionsClone(handle) - let ret = RequestOptions::RequestOptions(result) - return ret -} + let RequestOptions(handle) = self + let result : Int = wasmImportMethodRequestOptionsClone(handle); + let ret = RequestOptions::RequestOptions(result) + return ret + +} ///| /// Construct a new `response`, with a default `status-code` of `200`. /// If a different `status-code` is needed, it must be set via the @@ -1301,87 +1444,89 @@ pub fn RequestOptions::clone(self : RequestOptions) -> RequestOptions { /// will be closed immediately. /// /// The returned future resolves to result of transmission of this response. -pub fn Response::new( - headers : Fields, - contents : @async-core.Stream[Byte]?, - trailers : @async-core.Future[Result[Fields?, ErrorCode]], -) -> (Response, @async-core.Future[Result[Unit, ErrorCode]]) { - let Fields(handle) = headers - - let (lowered, lowered1) = match contents { - None => (0, 0) - Some(payload0) => - (1, wasmWasiHttpTypes030StaticResponseNewStream0StreamLower(payload0)) - } - let return_area = mbt_ffi_malloc(8) - let lower_arg = handle - let lower_arg2 = lowered - let lower_arg3 = lowered1 - let lower_arg4 = wasmWasiHttpTypes030StaticResponseNewFuture1FutureLower( - trailers, - ) - let lower_arg5 = return_area - wasmImportStaticResponseNew( - lower_arg, lower_arg2, lower_arg3, lower_arg4, lower_arg5, - ) - - match lower_arg2 { - 0 => () - 1 => wasmWasiHttpTypes030StaticResponseNewStream0StreamCommit(lower_arg3) - _ => panic() - } - wasmWasiHttpTypes030StaticResponseNewFuture1FutureCommit(lower_arg4) - let result7 = wasmWasiHttpTypes030StaticResponseNewFuture2FutureLift( - mbt_ffi_load32(return_area + 4), - ) - let ret = (Response::Response(mbt_ffi_load32(return_area + 0)), result7) - mbt_ffi_free(return_area) - return ret -} +pub fn Response::new(headers : Fields, contents : @async-core.Stream[Byte]?, trailers : @async-core.Future[Result[Fields?, ErrorCode]]) -> (Response, @async-core.Future[Result[Unit, ErrorCode]]) { + + let Fields(handle) = headers + + let (lowered, lowered1) = match (contents) { + None => { + + ((0), 0) + } + Some(payload0) => { + + ((1), wasmWasiHttpTypes030StaticResponseNewStream0StreamLower(payload0)) + } + } + let return_area = mbt_ffi_malloc(8) + let lower_arg = handle + let lower_arg2 = lowered + let lower_arg3 = lowered1 + let lower_arg4 = wasmWasiHttpTypes030StaticResponseNewFuture1FutureLower(trailers) + let lower_arg5 = return_area + wasmImportStaticResponseNew(lower_arg, lower_arg2, lower_arg3, lower_arg4, lower_arg5); + + match (lower_arg2) { + 0 => () + 1 => { + wasmWasiHttpTypes030StaticResponseNewStream0StreamCommit(lower_arg3) + } + _ => panic() + } + wasmWasiHttpTypes030StaticResponseNewFuture1FutureCommit(lower_arg4) + let result7 = wasmWasiHttpTypes030StaticResponseNewFuture2FutureLift(mbt_ffi_load32((return_area) + 4)) + let ret = (Response::Response(mbt_ffi_load32((return_area) + 0)), result7) + mbt_ffi_free(return_area) + return ret + +} ///| /// Get the HTTP Status Code for the Response. pub fn Response::get_status_code(self : Response) -> UInt { - let Response(handle) = self - let result : Int = wasmImportMethodResponseGetStatusCode(handle) - let ret = result.land(0xFFFF).reinterpret_as_uint() - return ret -} + let Response(handle) = self + let result : Int = wasmImportMethodResponseGetStatusCode(handle); + let ret = (result.land(0xFFFF).reinterpret_as_uint()) + return ret + +} ///| /// Set the HTTP Status Code for the Response. Fails if the status-code /// given is not a valid http status code. -pub fn Response::set_status_code( - self : Response, - status_code : UInt, -) -> Result[Unit, Unit] { - let Response(handle) = self - let result : Int = wasmImportMethodResponseSetStatusCode( - handle, - status_code.reinterpret_as_int(), - ) - - let lifted = match result { - 0 => Result::Ok(()) - 1 => Result::Err(()) - _ => panic() - } - let ret = lifted - return ret -} +pub fn Response::set_status_code(self : Response, status_code : UInt) -> Result[Unit, Unit] { + + let Response(handle) = self + let result : Int = wasmImportMethodResponseSetStatusCode(handle, (status_code).reinterpret_as_int()); + let lifted = match (result) { + 0 => { + + Result::Ok(()) + } + 1 => { + + Result::Err(()) + } + _ => panic() + } + let ret = lifted + return ret + +} ///| /// Get the headers associated with the Response. /// /// The returned `headers` resource is immutable: `set`, `append`, and /// `delete` operations will fail with `header-error.immutable`. pub fn Response::get_headers(self : Response) -> Fields { - let Response(handle) = self - let result : Int = wasmImportMethodResponseGetHeaders(handle) - let ret = Fields::Fields(result) - return ret -} + let Response(handle) = self + let result : Int = wasmImportMethodResponseGetHeaders(handle); + let ret = Fields::Fields(result) + return ret + +} ///| /// Get body of the Response. /// @@ -1395,26 +1540,20 @@ pub fn Response::get_headers(self : Response) -> Fields { /// /// Note that function will move the `response`, but references to headers /// acquired from it previously will remain valid. -pub fn Response::consume_body( - this : Response, - res : @async-core.Future[Result[Unit, ErrorCode]], -) -> (@async-core.Stream[Byte], @async-core.Future[Result[Fields?, ErrorCode]]) { - let Response(handle) = this - let return_area = mbt_ffi_malloc(8) - let lower_arg = handle - let lower_arg0 = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureLower( - res, - ) - let lower_arg1 = return_area - wasmImportStaticResponseConsumeBody(lower_arg, lower_arg0, lower_arg1) - wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureCommit(lower_arg0) - let result2 = wasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamLift( - mbt_ffi_load32(return_area + 0), - ) - let result3 = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureLift( - mbt_ffi_load32(return_area + 4), - ) - let ret = (result2, result3) - mbt_ffi_free(return_area) - return ret +pub fn Response::consume_body(this : Response, res : @async-core.Future[Result[Unit, ErrorCode]]) -> (@async-core.Stream[Byte], @async-core.Future[Result[Fields?, ErrorCode]]) { + + let Response(handle) = this + let return_area = mbt_ffi_malloc(8) + let lower_arg = handle + let lower_arg0 = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureLower(res) + let lower_arg1 = return_area + wasmImportStaticResponseConsumeBody(lower_arg, lower_arg0, lower_arg1); + wasmWasiHttpTypes030StaticResponseConsumeBodyFuture0FutureCommit(lower_arg0) + let result2 = wasmWasiHttpTypes030StaticResponseConsumeBodyStream1StreamLift(mbt_ffi_load32((return_area) + 0)) + let result3 = wasmWasiHttpTypes030StaticResponseConsumeBodyFuture2FutureLift(mbt_ffi_load32((return_area) + 4)) + let ret = (result2, result3) + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/io/error/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/io/error/ffi.mbt index 2e572a5282..190aa2dcee 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/io/error/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/io/error/ffi.mbt @@ -1,29 +1,28 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropError_(resource : Int) = "wasi:io/error@0.2.6" "[resource-drop]error" +fn wasmImportMethodErrorToDebugString(p0 : Int, p1 : Int) = "wasi:io/error@0.2.6" "[method]error.to-debug-string" + ///| -fn wasmImportMethodErrorToDebugString(p0 : Int, p1 : Int) = "wasi:io/error@0.2.6" "[method]error.to-debug-string" +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) -///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) diff --git a/sdks/moonbit/golem_sdk/interface/wasi/io/error/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/io/error/top.mbt index f1982a6b2b..705db7a285 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/io/error/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/io/error/top.mbt @@ -1,5 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// A resource which represents some error information. /// @@ -18,17 +17,13 @@ /// /// The set of functions which can "downcast" an `error` into a more /// concrete type is open. -pub(all) suberror Error_ { - Error_(Int) -} derive(Show, Eq) +pub(all) suberror Error_(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Error_::drop(self : Error_) -> Unit { - let Error_(resource) = self - wasmImportResourceDropError_(resource) + let Error_(resource) = self + wasmImportResourceDropError_(resource) } - ///| /// Returns a string that is suitable to assist humans in debugging /// this error. @@ -38,15 +33,15 @@ pub fn Error_::drop(self : Error_) -> Unit { /// details. Parsing this string is a major platform-compatibility /// hazard. pub fn Error_::to_debug_string(self : Error_) -> String { - let Error_(handle) = self - let return_area = mbt_ffi_malloc(8) - wasmImportMethodErrorToDebugString(handle, return_area) - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 0), - mbt_ffi_load32(return_area + 4), - ) - let ret = result - mbt_ffi_free(return_area) - return ret + let Error_(handle) = self + let return_area = mbt_ffi_malloc(8) + wasmImportMethodErrorToDebugString(handle, return_area); + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 0), mbt_ffi_load32((return_area) + 4)) + let ret = result + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/io/poll/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/io/poll/ffi.mbt index 5f56853eb6..ddcb22fa62 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/io/poll/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/io/poll/ffi.mbt @@ -1,42 +1,36 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropPollable(resource : Int) = "wasi:io/poll@0.2.6" "[resource-drop]pollable" -///| fn wasmImportMethodPollableReady(p0 : Int) -> Int = "wasi:io/poll@0.2.6" "[method]pollable.ready" -///| -fn wasmImportMethodPollableBlock(p0 : Int) = "wasi:io/poll@0.2.6" "[method]pollable.block" +fn wasmImportMethodPollableBlock(p0 : Int) = "wasi:io/poll@0.2.6" "[method]pollable.block" -///| -fn wasmImportPoll(p0 : Int, p1 : Int, p2 : Int) = "wasi:io/poll@0.2.6" "poll" +fn wasmImportPoll(p0 : Int, p1 : Int, p2 : Int) = "wasi:io/poll@0.2.6" "poll" ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#|(func (param i32) local.get 0 call $moonbit.decref) ///| extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_ptr2uint_array(ptr : Int, len : Int) -> FixedArray[UInt] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array32 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_ptr2uint_array( - ptr : Int, - len : Int, -) -> FixedArray[UInt] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array32 - #| local.get 0) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/io/poll/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/io/poll/top.mbt index e127c29881..43e692fed5 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/io/poll/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/io/poll/top.mbt @@ -1,27 +1,25 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// `pollable` represents a single I/O event which may be ready, or not. pub(all) struct Pollable(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Pollable::drop(self : Pollable) -> Unit { - let Pollable(resource) = self - wasmImportResourceDropPollable(resource) + let Pollable(resource) = self + wasmImportResourceDropPollable(resource) } - ///| /// Return the readiness of a pollable. This function never blocks. /// /// Returns `true` when the pollable is ready, and `false` otherwise. pub fn Pollable::ready(self : Pollable) -> Bool { - let Pollable(handle) = self - let result : Int = wasmImportMethodPollableReady(handle) - let ret = result != 0 - return ret -} + let Pollable(handle) = self + let result : Int = wasmImportMethodPollableReady(handle); + let ret = (result != 0) + return ret + +} ///| /// `block` returns immediately if the pollable is ready, and otherwise /// blocks until ready. @@ -29,10 +27,11 @@ pub fn Pollable::ready(self : Pollable) -> Bool { /// This function is equivalent to calling `poll.poll` on a list /// containing only this pollable. pub fn Pollable::block(self : Pollable) -> Unit { - let Pollable(handle) = self - wasmImportMethodPollableBlock(handle) -} + let Pollable(handle) = self + wasmImportMethodPollableBlock(handle); + +} ///| /// Poll for completion on a set of pollables. /// @@ -54,23 +53,24 @@ pub fn Pollable::block(self : Pollable) -> Unit { /// the pollables has an error, it is indicated by marking the source as /// being ready for I/O. pub fn poll(in_ : Array[Pollable]) -> FixedArray[UInt] { - let address = mbt_ffi_malloc(in_.length() * 4) - for index = 0; index < in_.length(); index = index + 1 { - let iter_elem : Pollable = in_[index] - let iter_base = address + index * 4 - let Pollable(handle) = iter_elem - mbt_ffi_store32(iter_base + 0, handle) - } - let return_area = mbt_ffi_malloc(8) - wasmImportPoll(address, in_.length(), return_area) + let address = mbt_ffi_malloc((in_).length() * 4); + for index = 0; index < (in_).length(); index = index + 1 { + let iter_elem : Pollable = (in_)[(index)] + let iter_base = address + (index * 4); + + let Pollable(handle) = iter_elem + mbt_ffi_store32((iter_base) + 0, handle) + + } + let return_area = mbt_ffi_malloc(8) + wasmImportPoll(address, (in_).length(), return_area); + + let result = mbt_ffi_ptr2uint_array(mbt_ffi_load32((return_area) + 0), mbt_ffi_load32((return_area) + 4)) + let ret = result + mbt_ffi_free(address) + mbt_ffi_free(return_area) + return ret - let result = mbt_ffi_ptr2uint_array( - mbt_ffi_load32(return_area + 0), - mbt_ffi_load32(return_area + 4), - ) - let ret = result - mbt_ffi_free(address) - mbt_ffi_free(return_area) - return ret } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/io/streams/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/io/streams/ffi.mbt index 0161fd9e7c..8374e9d3f5 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/io/streams/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/io/streams/ffi.mbt @@ -1,101 +1,71 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropInputStream(resource : Int) = "wasi:io/streams@0.2.6" "[resource-drop]input-stream" -///| fn wasmImportResourceDropOutputStream(resource : Int) = "wasi:io/streams@0.2.6" "[resource-drop]output-stream" -///| -fn wasmImportMethodInputStreamRead(p0 : Int, p1 : Int64, p2 : Int) = "wasi:io/streams@0.2.6" "[method]input-stream.read" +fn wasmImportMethodInputStreamRead(p0 : Int, p1 : Int64, p2 : Int) = "wasi:io/streams@0.2.6" "[method]input-stream.read" -///| -fn wasmImportMethodInputStreamBlockingRead(p0 : Int, p1 : Int64, p2 : Int) = "wasi:io/streams@0.2.6" "[method]input-stream.blocking-read" +fn wasmImportMethodInputStreamBlockingRead(p0 : Int, p1 : Int64, p2 : Int) = "wasi:io/streams@0.2.6" "[method]input-stream.blocking-read" -///| -fn wasmImportMethodInputStreamSkip(p0 : Int, p1 : Int64, p2 : Int) = "wasi:io/streams@0.2.6" "[method]input-stream.skip" +fn wasmImportMethodInputStreamSkip(p0 : Int, p1 : Int64, p2 : Int) = "wasi:io/streams@0.2.6" "[method]input-stream.skip" -///| -fn wasmImportMethodInputStreamBlockingSkip(p0 : Int, p1 : Int64, p2 : Int) = "wasi:io/streams@0.2.6" "[method]input-stream.blocking-skip" +fn wasmImportMethodInputStreamBlockingSkip(p0 : Int, p1 : Int64, p2 : Int) = "wasi:io/streams@0.2.6" "[method]input-stream.blocking-skip" -///| fn wasmImportMethodInputStreamSubscribe(p0 : Int) -> Int = "wasi:io/streams@0.2.6" "[method]input-stream.subscribe" -///| -fn wasmImportMethodOutputStreamCheckWrite(p0 : Int, p1 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.check-write" +fn wasmImportMethodOutputStreamCheckWrite(p0 : Int, p1 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.check-write" -///| -fn wasmImportMethodOutputStreamWrite(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.write" +fn wasmImportMethodOutputStreamWrite(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.write" -///| -fn wasmImportMethodOutputStreamBlockingWriteAndFlush( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, -) = "wasi:io/streams@0.2.6" "[method]output-stream.blocking-write-and-flush" +fn wasmImportMethodOutputStreamBlockingWriteAndFlush(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.blocking-write-and-flush" -///| -fn wasmImportMethodOutputStreamFlush(p0 : Int, p1 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.flush" +fn wasmImportMethodOutputStreamFlush(p0 : Int, p1 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.flush" -///| -fn wasmImportMethodOutputStreamBlockingFlush(p0 : Int, p1 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.blocking-flush" +fn wasmImportMethodOutputStreamBlockingFlush(p0 : Int, p1 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.blocking-flush" -///| fn wasmImportMethodOutputStreamSubscribe(p0 : Int) -> Int = "wasi:io/streams@0.2.6" "[method]output-stream.subscribe" -///| -fn wasmImportMethodOutputStreamWriteZeroes(p0 : Int, p1 : Int64, p2 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.write-zeroes" +fn wasmImportMethodOutputStreamWriteZeroes(p0 : Int, p1 : Int64, p2 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.write-zeroes" -///| -fn wasmImportMethodOutputStreamBlockingWriteZeroesAndFlush( - p0 : Int, - p1 : Int64, - p2 : Int, -) = "wasi:io/streams@0.2.6" "[method]output-stream.blocking-write-zeroes-and-flush" +fn wasmImportMethodOutputStreamBlockingWriteZeroesAndFlush(p0 : Int, p1 : Int64, p2 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.blocking-write-zeroes-and-flush" -///| -fn wasmImportMethodOutputStreamSplice(p0 : Int, p1 : Int, p2 : Int64, p3 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.splice" +fn wasmImportMethodOutputStreamSplice(p0 : Int, p1 : Int, p2 : Int64, p3 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.splice" + +fn wasmImportMethodOutputStreamBlockingSplice(p0 : Int, p1 : Int, p2 : Int64, p3 : Int) = "wasi:io/streams@0.2.6" "[method]output-stream.blocking-splice" ///| -fn wasmImportMethodOutputStreamBlockingSplice( - p0 : Int, - p1 : Int, - p2 : Int64, - p3 : Int, -) = "wasi:io/streams@0.2.6" "[method]output-stream.blocking-splice" +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = +#|(func (param i32) (result i64) local.get 0 i64.load) ///| extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| #owned(bytes) extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) -///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) diff --git a/sdks/moonbit/golem_sdk/interface/wasi/io/streams/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/io/streams/top.mbt index 5a7b065b6d..0cc2b94081 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/io/streams/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/io/streams/top.mbt @@ -1,12 +1,10 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// An error for input-stream and output-stream operations. pub(all) suberror StreamError { - LastOperationFailed(@error.Error_) - Closed + LastOperationFailed(@error.Error_) + Closed } derive(Show, Eq) - ///| /// An input bytestream. /// @@ -18,13 +16,11 @@ pub(all) suberror StreamError { /// for using `wasi:io/poll`. pub(all) struct InputStream(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn InputStream::drop(self : InputStream) -> Unit { - let InputStream(resource) = self - wasmImportResourceDropInputStream(resource) + let InputStream(resource) = self + wasmImportResourceDropInputStream(resource) } - ///| /// An output bytestream. /// @@ -40,13 +36,11 @@ pub fn InputStream::drop(self : InputStream) -> Unit { /// be sure to fully flush your writes. pub(all) struct OutputStream(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn OutputStream::drop(self : OutputStream) -> Unit { - let OutputStream(resource) = self - wasmImportResourceDropOutputStream(resource) + let OutputStream(resource) = self + wasmImportResourceDropOutputStream(resource) } - ///| /// Perform a non-blocking read from the stream. /// @@ -74,163 +68,157 @@ pub fn OutputStream::drop(self : OutputStream) -> Unit { /// is not possible to allocate in wasm32, or not desirable to allocate as /// as a return value by the callee. The callee may return a list of bytes /// less than `len` in size while more bytes are available for reading. -pub fn InputStream::read( - self : InputStream, - len : UInt64, -) -> Result[FixedArray[Byte], StreamError] { - let InputStream(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodInputStreamRead( - handle, - len.reinterpret_as_int64(), - return_area, - ) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = mbt_ffi_ptr2bytes( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Ok(result) - } - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 8)), - ) - 1 => StreamError::Closed - _ => panic() +pub fn InputStream::read(self : InputStream, len : UInt64) -> Result[FixedArray[Byte], StreamError] { + + let InputStream(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodInputStreamRead(handle, (len).reinterpret_as_int64(), return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2bytes(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Ok(result) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 8))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(return_area) - return ret } - ///| /// Read bytes from a stream, after blocking until at least one byte can /// be read. Except for blocking, behavior is identical to `read`. -pub fn InputStream::blocking_read( - self : InputStream, - len : UInt64, -) -> Result[FixedArray[Byte], StreamError] { - let InputStream(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodInputStreamBlockingRead( - handle, - len.reinterpret_as_int64(), - return_area, - ) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = mbt_ffi_ptr2bytes( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Ok(result) - } - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 8)), - ) - 1 => StreamError::Closed - _ => panic() +pub fn InputStream::blocking_read(self : InputStream, len : UInt64) -> Result[FixedArray[Byte], StreamError] { + + let InputStream(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodInputStreamBlockingRead(handle, (len).reinterpret_as_int64(), return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2bytes(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Ok(result) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 8))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(return_area) - return ret } - ///| /// Skip bytes from a stream. Returns number of bytes skipped. /// /// Behaves identical to `read`, except instead of returning a list /// of bytes, returns the number of bytes consumed from the stream. -pub fn InputStream::skip( - self : InputStream, - len : UInt64, -) -> Result[UInt64, StreamError] { - let InputStream(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodInputStreamSkip( - handle, - len.reinterpret_as_int64(), - return_area, - ) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 8) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 12)), - ) - 1 => StreamError::Closed - _ => panic() +pub fn InputStream::skip(self : InputStream, len : UInt64) -> Result[UInt64, StreamError] { + + let InputStream(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodInputStreamSkip(handle, (len).reinterpret_as_int64(), return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 12))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(return_area) - return ret } - ///| /// Skip bytes from a stream, after blocking until at least one byte /// can be skipped. Except for blocking behavior, identical to `skip`. -pub fn InputStream::blocking_skip( - self : InputStream, - len : UInt64, -) -> Result[UInt64, StreamError] { - let InputStream(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodInputStreamBlockingSkip( - handle, - len.reinterpret_as_int64(), - return_area, - ) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 8) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 12)), - ) - 1 => StreamError::Closed - _ => panic() +pub fn InputStream::blocking_skip(self : InputStream, len : UInt64) -> Result[UInt64, StreamError] { + + let InputStream(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodInputStreamBlockingSkip(handle, (len).reinterpret_as_int64(), return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 12))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(return_area) - return ret } - ///| /// Create a `pollable` which will resolve once either the specified stream /// has bytes available to read or the other end of the stream has been @@ -239,12 +227,13 @@ pub fn InputStream::blocking_skip( /// Implementations may trap if the `input-stream` is dropped before /// all derived `pollable`s created with this function are dropped. pub fn InputStream::subscribe(self : InputStream) -> @poll.Pollable { - let InputStream(handle) = self - let result : Int = wasmImportMethodInputStreamSubscribe(handle) - let ret = @poll.Pollable::Pollable(result) - return ret -} + let InputStream(handle) = self + let result : Int = wasmImportMethodInputStreamSubscribe(handle); + let ret = @poll.Pollable::Pollable(result) + return ret + +} ///| /// Check readiness for writing. This function never blocks. /// @@ -255,34 +244,40 @@ pub fn InputStream::subscribe(self : InputStream) -> @poll.Pollable { /// When this function returns 0 bytes, the `subscribe` pollable will /// become ready when this function will report at least 1 byte, or an /// error. -pub fn OutputStream::check_write( - self : OutputStream, -) -> Result[UInt64, StreamError] { - let OutputStream(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodOutputStreamCheckWrite(handle, return_area) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 8) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 12)), - ) - 1 => StreamError::Closed - _ => panic() +pub fn OutputStream::check_write(self : OutputStream) -> Result[UInt64, StreamError] { + + let OutputStream(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodOutputStreamCheckWrite(handle, return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 12))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(return_area) - return ret } - ///| /// Perform a write. This function never blocks. /// @@ -297,39 +292,44 @@ pub fn OutputStream::check_write( /// /// returns Err(closed) without writing if the stream has closed since /// the last call to check-write provided a permit. -pub fn OutputStream::write( - self : OutputStream, - contents : FixedArray[Byte], -) -> Result[Unit, StreamError] { - let OutputStream(handle) = self - - let ptr = mbt_ffi_bytes2ptr(contents) - - let return_area = mbt_ffi_malloc(12) - wasmImportMethodOutputStreamWrite(handle, ptr, contents.length(), return_area) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 8)), - ) - 1 => StreamError::Closed - _ => panic() +pub fn OutputStream::write(self : OutputStream, contents : FixedArray[Byte]) -> Result[Unit, StreamError] { + + let OutputStream(handle) = self + + let ptr = mbt_ffi_bytes2ptr(contents) + + let return_area = mbt_ffi_malloc(12) + wasmImportMethodOutputStreamWrite(handle, ptr, contents.length(), return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 8))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret } - ///| /// Perform a write of up to 4096 bytes, and then flush the stream. Block /// until all of these operations are complete, or an error occurs. @@ -355,44 +355,44 @@ pub fn OutputStream::write( /// // Check for any errors that arose during `flush` /// let _ = this.check-write(); // eliding error handling /// ``` -pub fn OutputStream::blocking_write_and_flush( - self : OutputStream, - contents : FixedArray[Byte], -) -> Result[Unit, StreamError] { - let OutputStream(handle) = self - - let ptr = mbt_ffi_bytes2ptr(contents) - - let return_area = mbt_ffi_malloc(12) - wasmImportMethodOutputStreamBlockingWriteAndFlush( - handle, - ptr, - contents.length(), - return_area, - ) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 8)), - ) - 1 => StreamError::Closed - _ => panic() +pub fn OutputStream::blocking_write_and_flush(self : OutputStream, contents : FixedArray[Byte]) -> Result[Unit, StreamError] { + + let OutputStream(handle) = self + + let ptr = mbt_ffi_bytes2ptr(contents) + + let return_area = mbt_ffi_malloc(12) + wasmImportMethodOutputStreamBlockingWriteAndFlush(handle, ptr, contents.length(), return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 8))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret } - ///| /// Request to flush buffered output. This function never blocks. /// @@ -405,62 +405,76 @@ pub fn OutputStream::blocking_write_and_flush( /// completed. The `subscribe` pollable will become ready when the /// flush has completed and the stream can accept more writes. pub fn OutputStream::flush(self : OutputStream) -> Result[Unit, StreamError] { - let OutputStream(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodOutputStreamFlush(handle, return_area) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 8)), - ) - 1 => StreamError::Closed - _ => panic() + + let OutputStream(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodOutputStreamFlush(handle, return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 8))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(return_area) - return ret } - ///| /// Request to flush buffered output, and block until flush completes /// and stream is ready for writing again. -pub fn OutputStream::blocking_flush( - self : OutputStream, -) -> Result[Unit, StreamError] { - let OutputStream(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodOutputStreamBlockingFlush(handle, return_area) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 8)), - ) - 1 => StreamError::Closed - _ => panic() +pub fn OutputStream::blocking_flush(self : OutputStream) -> Result[Unit, StreamError] { + + let OutputStream(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodOutputStreamBlockingFlush(handle, return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 8))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(return_area) - return ret } - ///| /// Create a `pollable` which will resolve once the output-stream /// is ready for more writing, or an error has occurred. When this @@ -473,12 +487,13 @@ pub fn OutputStream::blocking_flush( /// Implementations may trap if the `output-stream` is dropped before /// all derived `pollable`s created with this function are dropped. pub fn OutputStream::subscribe(self : OutputStream) -> @poll.Pollable { - let OutputStream(handle) = self - let result : Int = wasmImportMethodOutputStreamSubscribe(handle) - let ret = @poll.Pollable::Pollable(result) - return ret -} + let OutputStream(handle) = self + let result : Int = wasmImportMethodOutputStreamSubscribe(handle); + let ret = @poll.Pollable::Pollable(result) + return ret + +} ///| /// Write zeroes to a stream. /// @@ -486,39 +501,40 @@ pub fn OutputStream::subscribe(self : OutputStream) -> @poll.Pollable { /// preconditions (must use check-write first), but instead of /// passing a list of bytes, you simply pass the number of zero-bytes /// that should be written. -pub fn OutputStream::write_zeroes( - self : OutputStream, - len : UInt64, -) -> Result[Unit, StreamError] { - let OutputStream(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodOutputStreamWriteZeroes( - handle, - len.reinterpret_as_int64(), - return_area, - ) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 8)), - ) - 1 => StreamError::Closed - _ => panic() +pub fn OutputStream::write_zeroes(self : OutputStream, len : UInt64) -> Result[Unit, StreamError] { + + let OutputStream(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodOutputStreamWriteZeroes(handle, (len).reinterpret_as_int64(), return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 8))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(return_area) - return ret } - ///| /// Perform a write of up to 4096 zeroes, and then flush the stream. /// Block until all of these operations are complete, or an error @@ -544,39 +560,40 @@ pub fn OutputStream::write_zeroes( /// // Check for any errors that arose during `flush` /// let _ = this.check-write(); // eliding error handling /// ``` -pub fn OutputStream::blocking_write_zeroes_and_flush( - self : OutputStream, - len : UInt64, -) -> Result[Unit, StreamError] { - let OutputStream(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodOutputStreamBlockingWriteZeroesAndFlush( - handle, - len.reinterpret_as_int64(), - return_area, - ) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 4) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 8)), - ) - 1 => StreamError::Closed - _ => panic() +pub fn OutputStream::blocking_write_zeroes_and_flush(self : OutputStream, len : UInt64) -> Result[Unit, StreamError] { + + let OutputStream(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodOutputStreamBlockingWriteZeroesAndFlush(handle, (len).reinterpret_as_int64(), return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 4)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 8))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(return_area) - return ret } - ///| /// Read from one stream and write to another. /// @@ -591,82 +608,82 @@ pub fn OutputStream::blocking_write_zeroes_and_flush( /// /// This function returns the number of bytes transferred; it may be less /// than `len`. -pub fn OutputStream::splice( - self : OutputStream, - src : InputStream, - len : UInt64, -) -> Result[UInt64, StreamError] { - let OutputStream(handle) = self - - let InputStream(handle0) = src - let return_area = mbt_ffi_malloc(16) - wasmImportMethodOutputStreamSplice( - handle, - handle0, - len.reinterpret_as_int64(), - return_area, - ) - - let lifted1 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 8) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 12)), - ) - 1 => StreamError::Closed - _ => panic() +pub fn OutputStream::splice(self : OutputStream, src : InputStream, len : UInt64) -> Result[UInt64, StreamError] { + + let OutputStream(handle) = self + + let InputStream(handle0) = src + let return_area = mbt_ffi_malloc(16) + wasmImportMethodOutputStreamSplice(handle, handle0, (len).reinterpret_as_int64(), return_area); + + let lifted1 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 12))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted1 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted1 - mbt_ffi_free(return_area) - return ret } - ///| /// Read from one stream and write to another, with blocking. /// /// This is similar to `splice`, except that it blocks until the /// `output-stream` is ready for writing, and the `input-stream` /// is ready for reading, before performing the `splice`. -pub fn OutputStream::blocking_splice( - self : OutputStream, - src : InputStream, - len : UInt64, -) -> Result[UInt64, StreamError] { - let OutputStream(handle) = self - - let InputStream(handle0) = src - let return_area = mbt_ffi_malloc(16) - wasmImportMethodOutputStreamBlockingSplice( - handle, - handle0, - len.reinterpret_as_int64(), - return_area, - ) - - let lifted1 = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - 1 => { - let lifted = match mbt_ffi_load8_u(return_area + 8) { - 0 => - StreamError::LastOperationFailed( - @error.Error_::Error_(mbt_ffi_load32(return_area + 12)), - ) - 1 => StreamError::Closed - _ => panic() +pub fn OutputStream::blocking_splice(self : OutputStream, src : InputStream, len : UInt64) -> Result[UInt64, StreamError] { + + let OutputStream(handle) = self + + let InputStream(handle0) = src + let return_area = mbt_ffi_malloc(16) + wasmImportMethodOutputStreamBlockingSplice(handle, handle0, (len).reinterpret_as_int64(), return_area); + + let lifted1 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + 1 => { + + let lifted = match (mbt_ffi_load8_u((return_area) + 8)) { + 0 => { + + StreamError::LastOperationFailed(@error.Error_::Error_(mbt_ffi_load32((return_area) + 12))) + } + 1 => { + + StreamError::Closed + } + _ => panic() + } + + Result::Err(lifted) + } + _ => panic() } + let ret = lifted1 + mbt_ffi_free(return_area) + return ret - Result::Err(lifted) - } - _ => panic() - } - let ret = lifted1 - mbt_ffi_free(return_area) - return ret } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/atomic/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/atomic/ffi.mbt new file mode 100644 index 0000000000..974e9e663c --- /dev/null +++ b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/atomic/ffi.mbt @@ -0,0 +1,42 @@ +// Generated by `wit-bindgen` 0.58.0. DO NOT EDIT! + +///| +fn wasmImportIncrement(p0 : Int, p1 : Int, p2 : Int, p3 : Int64, p4 : Int) = "wasi:keyvalue/atomic@0.1.0" "increment" + +///| +fn wasmImportCompareAndSwap( + p0 : Int, + p1 : Int, + p2 : Int, + p3 : Int64, + p4 : Int64, + p5 : Int, +) = "wasi:keyvalue/atomic@0.1.0" "compare-and-swap" + +///| +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = + #|(func (param i32) (result i32) local.get 0) + +///| +extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = + #|(func (param i32) (result i64) local.get 0 i64.load) + +///| +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = + #|(func (param i32) (result i32) (local i32) + #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc + #| local.tee 1 i32.const 0 call $moonbit.init_array8 + #| local.get 1) + +///| +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = + #|(func (param i32) (result i32) local.get 0 i32.load8_u) + +///| +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = + #|(func (param i32) (result i32) local.get 0 i32.load) + +///| +extern "wasm" fn mbt_ffi_free(position : Int) = + #|(func (param i32) local.get 0 call $moonbit.decref) diff --git a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/cache/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/cache/ffi.mbt index 8f004a0f9f..6f7fcb741b 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/cache/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/cache/ffi.mbt @@ -1,70 +1,56 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropFutureGetResult(resource : Int) = "wasi:keyvalue/cache@0.1.0" "[resource-drop]future-get-result" -///| fn wasmImportResourceDropFutureExistsResult(resource : Int) = "wasi:keyvalue/cache@0.1.0" "[resource-drop]future-exists-result" -///| fn wasmImportResourceDropFutureResult(resource : Int) = "wasi:keyvalue/cache@0.1.0" "[resource-drop]future-result" -///| fn wasmImportResourceDropFutureGetOrSetResult(resource : Int) = "wasi:keyvalue/cache@0.1.0" "[resource-drop]future-get-or-set-result" -///| fn wasmImportResourceDropVacancy(resource : Int) = "wasi:keyvalue/cache@0.1.0" "[resource-drop]vacancy" -///| fn wasmImportGet(p0 : Int, p1 : Int) -> Int = "wasi:keyvalue/cache@0.1.0" "get" -///| fn wasmImportMethodFutureGetResultGet(p0 : Int, p1 : Int) -> Int = "wasi:keyvalue/cache@0.1.0" "[async-lower][method]future-get-result.get" -///| fn wasmImportExists(p0 : Int, p1 : Int) -> Int = "wasi:keyvalue/cache@0.1.0" "exists" -///| fn wasmImportMethodFutureExistsResultGet(p0 : Int, p1 : Int) -> Int = "wasi:keyvalue/cache@0.1.0" "[async-lower][method]future-exists-result.get" -///| fn wasmImportSet(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) -> Int = "wasi:keyvalue/cache@0.1.0" "set" -///| fn wasmImportMethodFutureResultGet(p0 : Int, p1 : Int) -> Int = "wasi:keyvalue/cache@0.1.0" "[async-lower][method]future-result.get" -///| fn wasmImportGetOrSet(p0 : Int, p1 : Int) -> Int = "wasi:keyvalue/cache@0.1.0" "get-or-set" -///| fn wasmImportMethodFutureGetOrSetResultGet(p0 : Int, p1 : Int) -> Int = "wasi:keyvalue/cache@0.1.0" "[async-lower][method]future-get-or-set-result.get" -///| fn wasmImportMethodVacancyVacancyFill(p0 : Int, p1 : Int, p2 : Int) -> Int = "wasi:keyvalue/cache@0.1.0" "[method]vacancy.vacancy-fill" -///| fn wasmImportDelete(p0 : Int, p1 : Int) -> Int = "wasi:keyvalue/cache@0.1.0" "delete" ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/cache/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/cache/top.mbt index 3e60502672..05ff096b93 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/cache/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/cache/top.mbt @@ -1,50 +1,41 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Awaitable result of `get`. The inner `option` returns `none` when the /// requested key wasn't present. pub(all) struct FutureGetResult(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn FutureGetResult::drop(self : FutureGetResult) -> Unit { - let FutureGetResult(resource) = self - wasmImportResourceDropFutureGetResult(resource) + let FutureGetResult(resource) = self + wasmImportResourceDropFutureGetResult(resource) } - ///| /// Awaitable result of `exists`. pub(all) struct FutureExistsResult(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn FutureExistsResult::drop(self : FutureExistsResult) -> Unit { - let FutureExistsResult(resource) = self - wasmImportResourceDropFutureExistsResult(resource) + let FutureExistsResult(resource) = self + wasmImportResourceDropFutureExistsResult(resource) } - ///| /// Awaitable result of `set` and `delete`. pub(all) struct FutureResult(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn FutureResult::drop(self : FutureResult) -> Unit { - let FutureResult(resource) = self - wasmImportResourceDropFutureResult(resource) + let FutureResult(resource) = self + wasmImportResourceDropFutureResult(resource) } - ///| /// Awaitable result of `get-or-set`. pub(all) struct FutureGetOrSetResult(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn FutureGetOrSetResult::drop(self : FutureGetOrSetResult) -> Unit { - let FutureGetOrSetResult(resource) = self - wasmImportResourceDropFutureGetOrSetResult(resource) + let FutureGetOrSetResult(resource) = self + wasmImportResourceDropFutureGetOrSetResult(resource) } - ///| /// The following block defines the `vacancy` resource type. (When resource /// types are added, the `u32` type aliases can be replaced by proper @@ -55,13 +46,11 @@ pub fn FutureGetOrSetResult::drop(self : FutureGetOrSetResult) -> Unit { /// to unblock other waiting `get-or-set` callers. pub(all) struct Vacancy(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Vacancy::drop(self : Vacancy) -> Unit { - let Vacancy(resource) = self - wasmImportResourceDropVacancy(resource) + let Vacancy(resource) = self + wasmImportResourceDropVacancy(resource) } - ///| /// The `get-or-set` operation asynchronously returns one of two cases /// enumerated by `get-or-set-entry`: in the `occupied` case, the given key @@ -74,126 +63,153 @@ pub fn Vacancy::drop(self : Vacancy) -> Unit { /// required to implement this rendezvous or to rendezvous in all possible /// cases. pub(all) enum GetOrSetEntry { - Occupied(@types.IncomingValue) - Vacant(Vacancy) + Occupied(@types.IncomingValue) + Vacant(Vacancy) } derive(Show, Eq) - ///| /// The `get` operation returns the value passed by a previous `set` for the /// same key within the given TTL or none if there is no such value. pub fn get(k : String) -> FutureGetResult { - let ptr = mbt_ffi_str2ptr(k) - let result : Int = wasmImportGet(ptr, k.length()) - let ret = FutureGetResult::FutureGetResult(result) - mbt_ffi_free(ptr) - return ret -} + let ptr = mbt_ffi_str2ptr(k) + let result : Int = wasmImportGet(ptr, k.length()); + let ret = FutureGetResult::FutureGetResult(result) + mbt_ffi_free(ptr) + return ret + +} ///| -pub async fn FutureGetResult::get( - self : FutureGetResult, -) -> Result[@types.IncomingValue?, @wasi-keyvalue-error.Error_] { - let FutureGetResult(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(12 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodFutureGetResultGet(lower_arg, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => () - 1 => - @types.IncomingValue::IncomingValue( - mbt_ffi_load32(result_ptr + 8), - ).drop() - _ => panic() - } - 1 => - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(result_ptr + 4)).drop() - _ => panic() - } - }, - ) - - let lifted0 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - let lifted : @types.IncomingValue? = match - mbt_ffi_load8_u(result_ptr + 4) { - 0 => Option::None - 1 => - Option::Some( - @types.IncomingValue::IncomingValue(mbt_ffi_load32(result_ptr + 8)), - ) - _ => panic() +pub async fn FutureGetResult::get(self : FutureGetResult) -> Result[@types.IncomingValue?, @wasi-keyvalue-error.Error_] { + + let FutureGetResult(handle) = self + + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(12 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodFutureGetResultGet(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } } + , + fn() { - Result::Ok(lifted) - } - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(result_ptr + 4)), + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => () + 1 => { + @types.IncomingValue::IncomingValue(mbt_ffi_load32((result_ptr) + 8)).drop() + + } + _ => panic() + } + + } + 1 => { + @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((result_ptr) + 4)).drop() + + } + _ => panic() + } + + }, ) - _ => panic() - } - lifted0 -} + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + let lifted : @types.IncomingValue? = match mbt_ffi_load8_u((result_ptr) + 4) { + 0 => Option::None + 1 => { + Option::Some(@types.IncomingValue::IncomingValue(mbt_ffi_load32((result_ptr) + 8))) + } + _ => panic() + } + + Result::Ok(lifted) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((result_ptr) + 4))) + } + _ => panic() + } + + lifted0 + +} ///| /// The `exists` operation returns whether a value was previously `set` for /// the given key within the TTL. pub fn exists(k : String) -> FutureExistsResult { - let ptr = mbt_ffi_str2ptr(k) - let result : Int = wasmImportExists(ptr, k.length()) - let ret = FutureExistsResult::FutureExistsResult(result) - mbt_ffi_free(ptr) - return ret -} + let ptr = mbt_ffi_str2ptr(k) + let result : Int = wasmImportExists(ptr, k.length()); + let ret = FutureExistsResult::FutureExistsResult(result) + mbt_ffi_free(ptr) + return ret + +} ///| -pub async fn FutureExistsResult::get( - self : FutureExistsResult, -) -> Result[Bool, @wasi-keyvalue-error.Error_] { - let FutureExistsResult(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(8 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodFutureExistsResultGet( - lower_arg, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(result_ptr + 4)).drop() - _ => panic() +pub async fn FutureExistsResult::get(self : FutureExistsResult) -> Result[Bool, @wasi-keyvalue-error.Error_] { + + let FutureExistsResult(handle) = self + + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(8 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodFutureExistsResultGet(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } } - }, - ) - - let lifted = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(mbt_ffi_load8_u(result_ptr + 4) != 0) - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(result_ptr + 4)), + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((result_ptr) + 4)).drop() + + } + _ => panic() + } + + }, ) - _ => panic() - } - lifted -} + let lifted = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + Result::Ok((mbt_ffi_load8_u((result_ptr) + 4) != 0)) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((result_ptr) + 4))) + } + _ => panic() + } + + lifted + +} ///| /// The `set` operation sets the given value for the given key for the given /// time-to-live (TTL) duration, if supplied, specified in milliseconds. If @@ -202,148 +218,184 @@ pub async fn FutureExistsResult::get( /// value is updated in-place. In the common case of computing and caching a /// value if the given key is not already in the cache, consider using /// `get-or-set` (below) intead of separate `get` and `set` operations. -pub fn set( - k : String, - v : @types.OutgoingValue, - ttl_ms : UInt?, -) -> FutureResult { - let ptr = mbt_ffi_str2ptr(k) - - let @types.OutgoingValue(handle) = v - - let (lowered, lowered1) = match ttl_ms { - None => (0, 0) - Some(payload0) => (1, payload0.reinterpret_as_int()) - } - let result : Int = wasmImportSet(ptr, k.length(), handle, lowered, lowered1) - let ret = FutureResult::FutureResult(result) - mbt_ffi_free(ptr) - return ret -} +pub fn set(k : String, v : @types.OutgoingValue, ttl_ms : UInt?) -> FutureResult { + + let ptr = mbt_ffi_str2ptr(k) + + let @types.OutgoingValue(handle) = v + let (lowered, lowered1) = match (ttl_ms) { + None => { + + ((0), 0) + } + Some(payload0) => { + + ((1), (payload0).reinterpret_as_int()) + } + } + let result : Int = wasmImportSet(ptr, k.length(), handle, lowered, lowered1); + let ret = FutureResult::FutureResult(result) + mbt_ffi_free(ptr) + return ret + +} ///| -pub async fn FutureResult::get( - self : FutureResult, -) -> Result[Unit, @wasi-keyvalue-error.Error_] { - let FutureResult(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(8 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodFutureResultGet(lower_arg, result_ptr) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => () - 1 => - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(result_ptr + 4)).drop() - _ => panic() +pub async fn FutureResult::get(self : FutureResult) -> Result[Unit, @wasi-keyvalue-error.Error_] { + + let FutureResult(handle) = self + + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(8 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodFutureResultGet(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } } - }, - ) - - let lifted = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => Result::Ok(()) - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(result_ptr + 4)), + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => () + 1 => { + @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((result_ptr) + 4)).drop() + + } + _ => panic() + } + + }, ) - _ => panic() - } - lifted -} + let lifted = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((result_ptr) + 4))) + } + _ => panic() + } + + lifted + +} ///| pub fn get_or_set(k : String) -> FutureGetOrSetResult { - let ptr = mbt_ffi_str2ptr(k) - let result : Int = wasmImportGetOrSet(ptr, k.length()) - let ret = FutureGetOrSetResult::FutureGetOrSetResult(result) - mbt_ffi_free(ptr) - return ret -} + let ptr = mbt_ffi_str2ptr(k) + let result : Int = wasmImportGetOrSet(ptr, k.length()); + let ret = FutureGetOrSetResult::FutureGetOrSetResult(result) + mbt_ffi_free(ptr) + return ret + +} ///| -pub async fn FutureGetOrSetResult::get( - self : FutureGetOrSetResult, -) -> Result[GetOrSetEntry, @wasi-keyvalue-error.Error_] { - let FutureGetOrSetResult(handle) = self - - let lower_arg = handle - let result_ptr = mbt_ffi_malloc(12 * 1) - defer mbt_ffi_free(result_ptr) - - let subtask_code = wasmImportMethodFutureGetOrSetResultGet( - lower_arg, result_ptr, - ) - @async-core.suspend_for_subtask( - subtask_code, - fn(before_started) { if before_started { () } else { () } }, - fn() { - match mbt_ffi_load8_u(result_ptr + 0) { - 0 => - match mbt_ffi_load8_u(result_ptr + 4) { - 0 => - @types.IncomingValue::IncomingValue( - mbt_ffi_load32(result_ptr + 8), - ).drop() - 1 => Vacancy::Vacancy(mbt_ffi_load32(result_ptr + 8)).drop() - _ => panic() - } - 1 => - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(result_ptr + 4)).drop() - _ => panic() - } - }, - ) - - let lifted0 = match mbt_ffi_load8_u(result_ptr + 0) { - 0 => { - let lifted = match mbt_ffi_load8_u(result_ptr + 4) { - 0 => - GetOrSetEntry::Occupied( - @types.IncomingValue::IncomingValue(mbt_ffi_load32(result_ptr + 8)), - ) - 1 => - GetOrSetEntry::Vacant( - Vacancy::Vacancy(mbt_ffi_load32(result_ptr + 8)), - ) - _ => panic() +pub async fn FutureGetOrSetResult::get(self : FutureGetOrSetResult) -> Result[GetOrSetEntry, @wasi-keyvalue-error.Error_] { + + let FutureGetOrSetResult(handle) = self + + let lower_arg = handle + let result_ptr = mbt_ffi_malloc(12 * 1) + defer mbt_ffi_free(result_ptr) + + let subtask_code = wasmImportMethodFutureGetOrSetResultGet(lower_arg, result_ptr) + @async-core.suspend_for_subtask( + subtask_code, + + fn(before_started) { + if before_started { + () + } else { + () + } } + , + fn() { + + match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + @types.IncomingValue::IncomingValue(mbt_ffi_load32((result_ptr) + 8)).drop() + + } + 1 => { + Vacancy::Vacancy(mbt_ffi_load32((result_ptr) + 8)).drop() + + } + _ => panic() + } + + } + 1 => { + @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((result_ptr) + 4)).drop() + + } + _ => panic() + } - Result::Ok(lifted) - } - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(result_ptr + 4)), + }, ) - _ => panic() - } - lifted0 -} + let lifted0 = match (mbt_ffi_load8_u((result_ptr) + 0)) { + 0 => { + + let lifted = match (mbt_ffi_load8_u((result_ptr) + 4)) { + 0 => { + + GetOrSetEntry::Occupied(@types.IncomingValue::IncomingValue(mbt_ffi_load32((result_ptr) + 8))) + } + 1 => { + + GetOrSetEntry::Vacant(Vacancy::Vacancy(mbt_ffi_load32((result_ptr) + 8))) + } + _ => panic() + } + + Result::Ok(lifted) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((result_ptr) + 4))) + } + _ => panic() + } + + lifted0 -///| -pub fn Vacancy::vacancy_fill( - self : Vacancy, - ttl_ms : UInt?, -) -> @types.OutgoingValue { - let Vacancy(handle) = self - - let (lowered, lowered1) = match ttl_ms { - None => (0, 0) - Some(payload0) => (1, payload0.reinterpret_as_int()) - } - let result : Int = wasmImportMethodVacancyVacancyFill( - handle, lowered, lowered1, - ) - let ret = @types.OutgoingValue::OutgoingValue(result) - return ret } +///| +pub fn Vacancy::vacancy_fill(self : Vacancy, ttl_ms : UInt?) -> @types.OutgoingValue { + + let Vacancy(handle) = self + + let (lowered, lowered1) = match (ttl_ms) { + None => { + + ((0), 0) + } + Some(payload0) => { + ((1), (payload0).reinterpret_as_int()) + } + } + let result : Int = wasmImportMethodVacancyVacancyFill(handle, lowered, lowered1); + let ret = @types.OutgoingValue::OutgoingValue(result) + return ret + +} ///| /// The `delete` operation removes any value with the given key from the /// cache. Like all cache operations, `delete` is weakly ordered and thus @@ -351,9 +403,12 @@ pub fn Vacancy::vacancy_fill( /// Additionally, due to weak ordering, concurrent `set` calls for the same /// key may or may not get deleted. pub fn delete(k : String) -> FutureResult { - let ptr = mbt_ffi_str2ptr(k) - let result : Int = wasmImportDelete(ptr, k.length()) - let ret = FutureResult::FutureResult(result) - mbt_ffi_free(ptr) - return ret + + let ptr = mbt_ffi_str2ptr(k) + let result : Int = wasmImportDelete(ptr, k.length()); + let ret = FutureResult::FutureResult(result) + mbt_ffi_free(ptr) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual-batch/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual-batch/ffi.mbt index fdae86e03e..48260e0cac 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual-batch/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual-batch/ffi.mbt @@ -1,48 +1,45 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| -fn wasmImportGetMany(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/eventual-batch@0.1.0" "get-many" +fn wasmImportGetMany(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/eventual-batch@0.1.0" "get-many" -///| -fn wasmImportKeys(p0 : Int, p1 : Int) = "wasi:keyvalue/eventual-batch@0.1.0" "keys" +fn wasmImportKeys(p0 : Int, p1 : Int) = "wasi:keyvalue/eventual-batch@0.1.0" "keys" -///| -fn wasmImportSetMany(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/eventual-batch@0.1.0" "set-many" +fn wasmImportSetMany(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/eventual-batch@0.1.0" "set-many" -///| -fn wasmImportDeleteMany(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/eventual-batch@0.1.0" "delete-many" +fn wasmImportDeleteMany(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/eventual-batch@0.1.0" "delete-many" ///| -extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| #owned(str) extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual-batch/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual-batch/top.mbt index 98c467e947..3b94679eeb 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual-batch/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual-batch/top.mbt @@ -1,5 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Get the values associated with the keys in the bucket. It returns a list of /// incoming-value that can be consumed to get the value associated with the key. @@ -12,65 +11,61 @@ /// MAY show an out-of-date value if there are concurrent writes to the bucket. /// /// If any other error occurs, it returns an `Err(error)`. -pub fn get_many( - bucket : @types.Bucket, - keys : Array[String], -) -> Result[Array[@types.IncomingValue?], @wasi-keyvalue-error.Error_] { - let cleanup_list : Array[Int] = [] - - let @types.Bucket(handle) = bucket - - let address = mbt_ffi_malloc(keys.length() * 8) - for index = 0; index < keys.length(); index = index + 1 { - let iter_elem : String = keys[index] - let iter_base = address + index * 8 - - let ptr = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr) - cleanup_list.push(ptr) - } - let return_area = mbt_ffi_malloc(12) - wasmImportGetMany(handle, address, keys.length(), return_area) - - let lifted1 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array : Array[@types.IncomingValue?] = [] - for index0 = 0 - index0 < mbt_ffi_load32(return_area + 8) - index0 = index0 + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index0 * 8 - - let lifted : @types.IncomingValue? = match - mbt_ffi_load8_u(iter_base + 0) { - 0 => Option::None - 1 => - Option::Some( - @types.IncomingValue::IncomingValue(mbt_ffi_load32(iter_base + 4)), - ) - _ => panic() - } - - array.push(lifted) +pub fn get_many(bucket : @types.Bucket, keys : Array[String]) -> Result[Array[@types.IncomingValue?], @wasi-keyvalue-error.Error_] { + let cleanup_list : Array[Int] = [] + + let @types.Bucket(handle) = bucket + + let address = mbt_ffi_malloc((keys).length() * 8); + for index = 0; index < (keys).length(); index = index + 1 { + let iter_elem : String = (keys)[(index)] + let iter_base = address + (index * 8); + + let ptr = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr) + cleanup_list.push(ptr) + } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Result::Ok(array) - } - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted1 - mbt_ffi_free(address) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} + let return_area = mbt_ffi_malloc(12) + wasmImportGetMany(handle, address, (keys).length(), return_area); + + let lifted1 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + let array : Array[@types.IncomingValue?] = []; + for index0 = 0; index0 < (mbt_ffi_load32((return_area) + 8)); index0 = index0 + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index0 * 8) + + let lifted : @types.IncomingValue? = match mbt_ffi_load8_u((iter_base) + 0) { + 0 => Option::None + 1 => { + + Option::Some(@types.IncomingValue::IncomingValue(mbt_ffi_load32((iter_base) + 4))) + } + _ => panic() + } + + array.push(lifted) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) + + Result::Ok(array) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted1 + mbt_ffi_free(address) + mbt_ffi_free(return_area) + + cleanup_list.each(mbt_ffi_free) + return ret + +} ///| /// Get all the keys in the bucket. It returns a list of keys. /// @@ -81,41 +76,38 @@ pub fn get_many( /// MAY show an out-of-date list of keys if there are concurrent writes to the bucket. /// /// If any error occurs, it returns an `Err(error)`. -pub fn keys( - bucket : @types.Bucket, -) -> Result[Array[String], @wasi-keyvalue-error.Error_] { - let @types.Bucket(handle) = bucket - let return_area = mbt_ffi_malloc(12) - wasmImportKeys(handle, return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let array : Array[String] = [] - for index = 0; index < mbt_ffi_load32(return_area + 8); index = index + 1 { - let iter_base = mbt_ffi_load32(return_area + 4) + index * 8 - - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(iter_base + 0), - mbt_ffi_load32(iter_base + 4), - ) - - array.push(result) +pub fn keys(bucket : @types.Bucket) -> Result[Array[String], @wasi-keyvalue-error.Error_] { + + let @types.Bucket(handle) = bucket + let return_area = mbt_ffi_malloc(12) + wasmImportKeys(handle, return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let array : Array[String] = []; + for index = 0; index < (mbt_ffi_load32((return_area) + 8)); index = index + 1 { + let iter_base = (mbt_ffi_load32((return_area) + 4)) + (index * 8) + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4)) + + array.push(result) + } + mbt_ffi_free(mbt_ffi_load32((return_area) + 4)) + + Result::Ok(array) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() } - mbt_ffi_free(mbt_ffi_load32(return_area + 4)) - - Result::Ok(array) - } - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} + let ret = lifted + mbt_ffi_free(return_area) + return ret +} ///| /// Set the values associated with the keys in the bucket. If the key already /// exists in the bucket, it overwrites the value. @@ -131,46 +123,47 @@ pub fn keys( /// set while others might fail. /// /// Other concurrent operations may also be able to see the partial results. -pub fn set_many( - bucket : @types.Bucket, - key_values : Array[(String, @types.OutgoingValue)], -) -> Result[Unit, @wasi-keyvalue-error.Error_] { - let cleanup_list : Array[Int] = [] - - let @types.Bucket(handle) = bucket - - let address = mbt_ffi_malloc(key_values.length() * 12) - for index = 0; index < key_values.length(); index = index + 1 { - let iter_elem : (String, @types.OutgoingValue) = key_values[index] - let iter_base = address + index * 12 - - let ptr = mbt_ffi_str2ptr(iter_elem.0) - mbt_ffi_store32(iter_base + 4, iter_elem.0.length()) - mbt_ffi_store32(iter_base + 0, ptr) - - let @types.OutgoingValue(handle0) = iter_elem.1 - mbt_ffi_store32(iter_base + 8, handle0) - cleanup_list.push(ptr) - } - let return_area = mbt_ffi_malloc(8) - wasmImportSetMany(handle, address, key_values.length(), return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(address) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret -} +pub fn set_many(bucket : @types.Bucket, key_values : Array[(String, @types.OutgoingValue)]) -> Result[Unit, @wasi-keyvalue-error.Error_] { + let cleanup_list : Array[Int] = [] + + let @types.Bucket(handle) = bucket + + let address = mbt_ffi_malloc((key_values).length() * 12); + for index = 0; index < (key_values).length(); index = index + 1 { + let iter_elem : (String, @types.OutgoingValue) = (key_values)[(index)] + let iter_base = address + (index * 12); + + let ptr = mbt_ffi_str2ptr((iter_elem).0) + mbt_ffi_store32((iter_base) + 4, (iter_elem).0.length()) + mbt_ffi_store32((iter_base) + 0, ptr) + + let @types.OutgoingValue(handle0) = (iter_elem).1 + mbt_ffi_store32((iter_base) + 8, handle0) + cleanup_list.push(ptr) + + } + let return_area = mbt_ffi_malloc(8) + wasmImportSetMany(handle, address, (key_values).length(), return_area); + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(address) + mbt_ffi_free(return_area) + + cleanup_list.each(mbt_ffi_free) + return ret + +} ///| /// Delete the key-value pairs associated with the keys in the bucket. /// @@ -185,39 +178,42 @@ pub fn set_many( /// deleted while others might fail. /// /// Other concurrent operations may also be able to see the partial results. -pub fn delete_many( - bucket : @types.Bucket, - keys : Array[String], -) -> Result[Unit, @wasi-keyvalue-error.Error_] { - let cleanup_list : Array[Int] = [] - - let @types.Bucket(handle) = bucket - - let address = mbt_ffi_malloc(keys.length() * 8) - for index = 0; index < keys.length(); index = index + 1 { - let iter_elem : String = keys[index] - let iter_base = address + index * 8 - - let ptr = mbt_ffi_str2ptr(iter_elem) - mbt_ffi_store32(iter_base + 4, iter_elem.length()) - mbt_ffi_store32(iter_base + 0, ptr) - cleanup_list.push(ptr) - } - let return_area = mbt_ffi_malloc(8) - wasmImportDeleteMany(handle, address, keys.length(), return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(address) - mbt_ffi_free(return_area) - - cleanup_list.each(mbt_ffi_free) - return ret +pub fn delete_many(bucket : @types.Bucket, keys : Array[String]) -> Result[Unit, @wasi-keyvalue-error.Error_] { + let cleanup_list : Array[Int] = [] + + let @types.Bucket(handle) = bucket + + let address = mbt_ffi_malloc((keys).length() * 8); + for index = 0; index < (keys).length(); index = index + 1 { + let iter_elem : String = (keys)[(index)] + let iter_base = address + (index * 8); + + let ptr = mbt_ffi_str2ptr(iter_elem) + mbt_ffi_store32((iter_base) + 4, iter_elem.length()) + mbt_ffi_store32((iter_base) + 0, ptr) + cleanup_list.push(ptr) + + } + let return_area = mbt_ffi_malloc(8) + wasmImportDeleteMany(handle, address, (keys).length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(address) + mbt_ffi_free(return_area) + + cleanup_list.each(mbt_ffi_free) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual/ffi.mbt index 1916a11c2a..020c4b9603 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual/ffi.mbt @@ -1,37 +1,34 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| -fn wasmImportGet(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/eventual@0.1.0" "get" +fn wasmImportGet(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/eventual@0.1.0" "get" -///| -fn wasmImportSet(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) = "wasi:keyvalue/eventual@0.1.0" "set" +fn wasmImportSet(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) = "wasi:keyvalue/eventual@0.1.0" "set" -///| -fn wasmImportDelete(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/eventual@0.1.0" "delete" +fn wasmImportDelete(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/eventual@0.1.0" "delete" -///| -fn wasmImportExists(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/eventual@0.1.0" "exists" +fn wasmImportExists(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/eventual@0.1.0" "exists" ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) ///| extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +#|(func (param i32) (result i32) local.get 0 i32.load8_u) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual/top.mbt index 9031ce3651..8938190b32 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/eventual/top.mbt @@ -1,5 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// Get the value associated with the key in the bucket. /// @@ -8,42 +7,40 @@ /// bucket, it returns `Ok(none)`. /// /// If any other error occurs, it returns an `Err(error)`. -pub fn get( - bucket : @types.Bucket, - key : String, -) -> Result[@types.IncomingValue?, @wasi-keyvalue-error.Error_] { - let @types.Bucket(handle) = bucket - - let ptr = mbt_ffi_str2ptr(key) - let return_area = mbt_ffi_malloc(12) - wasmImportGet(handle, ptr, key.length(), return_area) - - let lifted0 = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let lifted : @types.IncomingValue? = match - mbt_ffi_load8_u(return_area + 4) { - 0 => Option::None - 1 => - Option::Some( - @types.IncomingValue::IncomingValue(mbt_ffi_load32(return_area + 8)), - ) - _ => panic() +pub fn get(bucket : @types.Bucket, key : String) -> Result[@types.IncomingValue?, @wasi-keyvalue-error.Error_] { + + let @types.Bucket(handle) = bucket + + let ptr = mbt_ffi_str2ptr(key) + let return_area = mbt_ffi_malloc(12) + wasmImportGet(handle, ptr, key.length(), return_area); + + let lifted0 = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let lifted : @types.IncomingValue? = match mbt_ffi_load8_u((return_area) + 4) { + 0 => Option::None + 1 => { + + Option::Some(@types.IncomingValue::IncomingValue(mbt_ffi_load32((return_area) + 8))) + } + _ => panic() + } + + Result::Ok(lifted) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() } + let ret = lifted0 + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret - Result::Ok(lifted) - } - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted0 - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret } - ///| /// Set the value associated with the key in the bucket. If the key already /// exists in the bucket, it overwrites the value. @@ -51,63 +48,64 @@ pub fn get( /// If the key does not exist in the bucket, it creates a new key-value pair. /// /// If any other error occurs, it returns an `Err(error)`. -pub fn set( - bucket : @types.Bucket, - key : String, - outgoing_value : @types.OutgoingValue, -) -> Result[Unit, @wasi-keyvalue-error.Error_] { - let @types.Bucket(handle) = bucket - - let ptr = mbt_ffi_str2ptr(key) - - let @types.OutgoingValue(handle0) = outgoing_value - let return_area = mbt_ffi_malloc(8) - wasmImportSet(handle, ptr, key.length(), handle0, return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} +pub fn set(bucket : @types.Bucket, key : String, outgoing_value : @types.OutgoingValue) -> Result[Unit, @wasi-keyvalue-error.Error_] { + + let @types.Bucket(handle) = bucket + + let ptr = mbt_ffi_str2ptr(key) + + let @types.OutgoingValue(handle0) = outgoing_value + let return_area = mbt_ffi_malloc(8) + wasmImportSet(handle, ptr, key.length(), handle0, return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret +} ///| /// Delete the key-value pair associated with the key in the bucket. /// /// If the key does not exist in the bucket, it does nothing. /// /// If any other error occurs, it returns an `Err(error)`. -pub fn delete( - bucket : @types.Bucket, - key : String, -) -> Result[Unit, @wasi-keyvalue-error.Error_] { - let @types.Bucket(handle) = bucket - - let ptr = mbt_ffi_str2ptr(key) - let return_area = mbt_ffi_malloc(8) - wasmImportDelete(handle, ptr, key.length(), return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} +pub fn delete(bucket : @types.Bucket, key : String) -> Result[Unit, @wasi-keyvalue-error.Error_] { + + let @types.Bucket(handle) = bucket + + let ptr = mbt_ffi_str2ptr(key) + let return_area = mbt_ffi_malloc(8) + wasmImportDelete(handle, ptr, key.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + Result::Ok(()) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// Check if the key exists in the bucket. /// @@ -115,26 +113,29 @@ pub fn delete( /// not exist in the bucket, it returns `Ok(false)`. /// /// If any other error occurs, it returns an `Err(error)`. -pub fn exists( - bucket : @types.Bucket, - key : String, -) -> Result[Bool, @wasi-keyvalue-error.Error_] { - let @types.Bucket(handle) = bucket - - let ptr = mbt_ffi_str2ptr(key) - let return_area = mbt_ffi_malloc(8) - wasmImportExists(handle, ptr, key.length(), return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load8_u(return_area + 4) != 0) - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret +pub fn exists(bucket : @types.Bucket, key : String) -> Result[Bool, @wasi-keyvalue-error.Error_] { + + let @types.Bucket(handle) = bucket + + let ptr = mbt_ffi_str2ptr(key) + let return_area = mbt_ffi_malloc(8) + wasmImportExists(handle, ptr, key.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok((mbt_ffi_load8_u((return_area) + 4) != 0)) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/types/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/types/ffi.mbt index 41af986568..2be55560ae 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/types/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/types/ffi.mbt @@ -1,866 +1,697 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropBucket(resource : Int) = "wasi:keyvalue/types@0.1.0" "[resource-drop]bucket" -///| fn wasmImportResourceDropOutgoingValue(resource : Int) = "wasi:keyvalue/types@0.1.0" "[resource-drop]outgoing-value" -///| fn wasmImportResourceDropIncomingValue(resource : Int) = "wasi:keyvalue/types@0.1.0" "[resource-drop]incoming-value" -///| -fn wasmImportStaticBucketOpenBucket(p0 : Int, p1 : Int, p2 : Int) = "wasi:keyvalue/types@0.1.0" "[static]bucket.open-bucket" +fn wasmImportStaticBucketOpenBucket(p0 : Int, p1 : Int, p2 : Int) = "wasi:keyvalue/types@0.1.0" "[static]bucket.open-bucket" -///| fn wasmImportStaticOutgoingValueNewOutgoingValue() -> Int = "wasi:keyvalue/types@0.1.0" "[static]outgoing-value.new-outgoing-value" -///| -fn wasmImportMethodOutgoingValueOutgoingValueWriteBodyAsync( - p0 : Int, - p1 : Int, - p2 : Int, -) = "wasi:keyvalue/types@0.1.0" "[method]outgoing-value.outgoing-value-write-body-async" +fn wasmImportMethodOutgoingValueOutgoingValueWriteBodyAsync(p0 : Int, p1 : Int, p2 : Int) = "wasi:keyvalue/types@0.1.0" "[method]outgoing-value.outgoing-value-write-body-async" -///| -fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:keyvalue/types@0.1.0" "[async-lower][stream-read-0][method]outgoing-value.outgoing-value-write-body-async" +fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:keyvalue/types@0.1.0" "[async-lower][stream-read-0][method]outgoing-value.outgoing-value-write-body-async" +fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0CancelRead(handle : Int) -> Int = "wasi:keyvalue/types@0.1.0" "[stream-cancel-read-0][method]outgoing-value.outgoing-value-write-body-async" -///| -fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0CancelRead( - handle : Int, -) -> Int = "wasi:keyvalue/types@0.1.0" "[stream-cancel-read-0][method]outgoing-value.outgoing-value-write-body-async" +fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropReadable(handle : Int) = "wasi:keyvalue/types@0.1.0" "[stream-drop-readable-0][method]outgoing-value.outgoing-value-write-body-async" -///| -fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropReadable( - handle : Int, -) = "wasi:keyvalue/types@0.1.0" "[stream-drop-readable-0][method]outgoing-value.outgoing-value-write-body-async" - -///| fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0New() -> UInt64 = "wasi:keyvalue/types@0.1.0" "[stream-new-0][method]outgoing-value.outgoing-value-write-body-async" +fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Write(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:keyvalue/types@0.1.0" "[async-lower][stream-write-0][method]outgoing-value.outgoing-value-write-body-async" -///| -fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Write( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:keyvalue/types@0.1.0" "[async-lower][stream-write-0][method]outgoing-value.outgoing-value-write-body-async" +fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0CancelWrite(handle : Int) -> Int = "wasi:keyvalue/types@0.1.0" "[stream-cancel-write-0][method]outgoing-value.outgoing-value-write-body-async" -///| -fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0CancelWrite( - handle : Int, -) -> Int = "wasi:keyvalue/types@0.1.0" "[stream-cancel-write-0][method]outgoing-value.outgoing-value-write-body-async" +fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropWritable(handle : Int) = "wasi:keyvalue/types@0.1.0" "[stream-drop-writable-0][method]outgoing-value.outgoing-value-write-body-async" -///| -fn wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropWritable( - handle : Int, -) = "wasi:keyvalue/types@0.1.0" "[stream-drop-writable-0][method]outgoing-value.outgoing-value-write-body-async" - -///| -fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Commit( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| -fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Lower( - value : Byte, - ptr : Int, -) -> Unit { - mbt_ffi_store8(ptr + 0, value.to_int()) +fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Lower(value : Byte, ptr : Int) -> Unit { + mbt_ffi_store8((ptr) + 0, (value).to_int()) + } -///| fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource::finish_read( - self : WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource, +self : WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource::wait_for_read_cleanup( - self : WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource, +self : WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() - } - }, - resume_on_cancel=true, - ) catch { - _ => () - } + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () + } } -///| async fn WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource::cancel_active_read( - self : WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource, +self : WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource::close( - self : WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource, +self : WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropReadable(self.handle) } -///| fn WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource::close_sync( - self : WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource, +self : WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } + if self.closed || self.reading { + return + } - if wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamRejectPrepared( - self.handle, - ) { - self.closed = true - return - } - - self.closed = true - wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropReadable( - self.handle, - ) + if wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamRejectPrepared(self.handle) { + self.closed = true + return + } + + self.closed = true + wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropReadable(self.handle) } -///| async fn WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource::read( - self : WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource, - count : Int, +self : WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) } + let values = wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) + if end { + self.close() + } + Some(values) } -///| -fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) +fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| priv struct WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducer { - stream : @async-core.Stream[Byte] - writer : Int + stream : @async-core.Stream[Byte] + writer : Int } -///| -let wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducers : Map[ - Int, - WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducer, -] = Map([]) +let wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducers : Map[Int, WasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducer] = Map([]) -///| -fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamRejectPrepared( - handle : Int, -) -> Bool { - guard wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return false - } - wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducers.remove( - handle, - ) - let writer = prepared.writer - wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropReadable( - handle, - ) - wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropWritable( - writer, - ) - @async-core.spawn_component_task_current(async fn() { - @async-core.protect_from_cancel( - () => { - prepared.stream.reject((value : Byte) => { - let ptr = wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Malloc( - 1, - ) - wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Lower( - value, ptr, - ) - wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Reject( - ptr, 0, 1, - ) - mbt_ffi_free(ptr) - }) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - }) - true +fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamRejectPrepared(handle : Int) -> Bool { + guard wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducers.get(handle) is Some(prepared) else { + return false + } + wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducers.remove(handle) + let writer = prepared.writer + wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropReadable(handle) + wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropWritable(writer) + @async-core.spawn_component_task_current(async fn() { + @async-core.protect_from_cancel( + () => { + prepared.stream.reject((value : Byte) => { + let ptr = wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Malloc(1) + wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Lower(value, ptr) + wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + }) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + }) + true } -///| -fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamCommit( - handle : Int, -) -> Unit { - guard wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducers.get( - handle, - ) - is Some(prepared) else { - return - } - wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducers.remove( - handle, - ) - let stream = prepared.stream - let writer = prepared.writer - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let producer = stream.take_producer() - @async-core.spawn_component_task_current(async fn() { - let writer_closed = Ref(false) - let writer_lock = @async-core.Mutex() - let close_writer = fn() -> Unit { - if !writer_closed.val { - writer_closed.val = true - wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropWritable( - writer, - ) - } - } - let close_writer_serialized = async fn() -> Unit { - writer_lock.acquire() - defer writer_lock.release() - close_writer() - } - let cleanup_value = fn(value : Byte) -> Unit { - let ptr = wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Malloc( - 1, - ) - wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Lower( - value, ptr, - ) - wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Reject( - ptr, 0, 1, - ) - mbt_ffi_free(ptr) - } - let sink = @async-core.Sink::from_callbacks( - (data : ArrayView[Byte]) => { - writer_lock.acquire() - defer writer_lock.release() - if writer_closed.val || data.length() == 0 { - return 0 - } - let data_len = if data.length() < 64 { data.length() } else { 64 } - let ptr = wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Malloc( - data_len, - ) - for i in 0.. Unit { - wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Commit( - ptr, 0, transferred, - ) - if transferred < data_len { - wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Reject( - ptr, - transferred, - data_len - transferred, +fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamCommit(handle : Int) -> Unit { + guard wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducers.get(handle) is Some(prepared) else { + return + } + wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducers.remove(handle) + let stream = prepared.stream + let writer = prepared.writer + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let producer = stream.take_producer() + @async-core.spawn_component_task_current(async fn() { + let writer_closed = Ref(false) + let writer_lock = @async-core.Mutex() + let close_writer = fn() -> Unit { + if !writer_closed.val { + writer_closed.val = true + wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0DropWritable(writer) + } + } + let close_writer_serialized = async fn() -> Unit { + writer_lock.acquire() + defer writer_lock.release() + close_writer() + } + let cleanup_value = fn(value : Byte) -> Unit { + let ptr = wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Malloc(1) + wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Lower(value, ptr) + wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Reject(ptr, 0, 1) + mbt_ffi_free(ptr) + } + let sink = @async-core.Sink::from_callbacks( + (data : ArrayView[Byte]) => { + writer_lock.acquire() + defer writer_lock.release() + if writer_closed.val || data.length() == 0 { + return 0 + } + let data_len = if data.length() < 64 { + data.length() + } else { + 64 + } + let ptr = wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Malloc(data_len) + for i in 0.. Unit { + wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Commit(ptr, 0, transferred) + if transferred < data_len { + wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Reject( + ptr, + transferred, + data_len - transferred, + ) + } + mbt_ffi_free(ptr) + } + let mut total = 0 + let mut dropped = false + while total < data_len { + let (progress, end) = @async-core.suspend_for_stream_write( + writer, + wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Write( + writer, + ptr + total * 1, + data_len - total, + ), + ) catch { + _ => { + total = total + @async-core.cancel_stream_write( + writer, + () => wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0CancelWrite(writer), + ) + settle_staging(total) + close_writer() + return data_len + } + } + total = total + progress + if end { + dropped = true + break + } + } + settle_staging(total) + if dropped { + close_writer() + } + // The canonical writer accepted `total`; generated cleanup + // consumed the rest of this staging window. + data_len + }, + () => close_writer_serialized(), + () => !writer_closed.val, + Some(cleanup_value), ) - } - mbt_ffi_free(ptr) - } - let mut total = 0 - let mut dropped = false - while total < data_len { - let (progress, end) = @async-core.suspend_for_stream_write( - writer, - wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0Write( - writer, - ptr + total * 1, - data_len - total, - ), - ) catch { - _ => { - total = total + - @async-core.cancel_stream_write(writer, () => { - wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0CancelWrite( - writer, - ) - }) - settle_staging(total) - close_writer() - return data_len + let relay_source = producer is None + let run_producer = async fn() -> Unit { + match producer { + Some(producer) => { + producer(sink) + sink.close() + } + None => + for ;; { + match stream.read(64) { + Some(data) => + if !sink.write_all(data[:]) { + stream.reject(cleanup_value) + return + } + None => { + sink.close() + return + } + } + } + } } - } - total = total + progress - if end { - dropped = true - break - } - } - settle_staging(total) - if dropped { - close_writer() - } - // The canonical writer accepted `total`; generated cleanup - // consumed the rest of this staging window. - data_len - }, - () => close_writer_serialized(), - () => !writer_closed.val, - Some(cleanup_value), - ) - let relay_source = producer is None - let run_producer = async fn() -> Unit { - match producer { - Some(producer) => { - producer(sink) - sink.close() - } - None => - for ;; { - match stream.read(64) { - Some(data) => - if !sink.write_all(data[:]) { - stream.reject(cleanup_value) - return - } - None => { - sink.close() - return - } + run_producer() catch { + _ => + if relay_source { + @async-core.protect_from_cancel( + () => stream.reject(cleanup_value), + resume_on_cancel=true, + ) catch { + _ => () + } + } } - } - } - } - run_producer() catch { - _ => - if relay_source { - @async-core.protect_from_cancel( - () => stream.reject(cleanup_value), + // A retained Sink may still own an in-flight canonical write after its + // producer returns. Do not drop the writable endpoint until that write + // has reached a terminal event and released its staging buffer. + @async-core.protect_from_cancel( + () => close_writer_serialized(), resume_on_cancel=true, - ) catch { - _ => () - } - } - } - // A retained Sink may still own an in-flight canonical write after its - // producer returns. Do not drop the writable endpoint until that write - // has reached a terminal event and released its staging buffer. - @async-core.protect_from_cancel( - () => close_writer_serialized(), - resume_on_cancel=true, - ) - }) + ) + }) } -///| -fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamLower( - stream : @async-core.Stream[Byte], -) -> Int { - if !@async-core.has_component_task_scope() { - abort("component stream producer requires an async task scope") - } - let pair = wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0New() - let reader = pair.to_int() - let writer = (pair >> 32).to_int() - wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducers.set( - reader, - { stream, writer }, - ) - reader +fn wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamLower(stream : @async-core.Stream[Byte]) -> Int { + if !@async-core.has_component_task_scope() { + abort("component stream producer requires an async task scope") + } + let pair = wasmImportWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0New() + let reader = pair.to_int() + let writer = (pair >> 32).to_int() + wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamProducers.set(reader, { stream, writer }) + reader } -///| -fn wasmImportMethodOutgoingValueOutgoingValueWriteBodySync( - p0 : Int, - p1 : Int, - p2 : Int, - p3 : Int, -) = "wasi:keyvalue/types@0.1.0" "[method]outgoing-value.outgoing-value-write-body-sync" +fn wasmImportMethodOutgoingValueOutgoingValueWriteBodySync(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "wasi:keyvalue/types@0.1.0" "[method]outgoing-value.outgoing-value-write-body-sync" -///| -fn wasmImportMethodIncomingValueIncomingValueConsumeSync(p0 : Int, p1 : Int) = "wasi:keyvalue/types@0.1.0" "[method]incoming-value.incoming-value-consume-sync" +fn wasmImportMethodIncomingValueIncomingValueConsumeSync(p0 : Int, p1 : Int) = "wasi:keyvalue/types@0.1.0" "[method]incoming-value.incoming-value-consume-sync" -///| -fn wasmImportMethodIncomingValueIncomingValueConsumeAsync(p0 : Int, p1 : Int) = "wasi:keyvalue/types@0.1.0" "[method]incoming-value.incoming-value-consume-async" +fn wasmImportMethodIncomingValueIncomingValueConsumeAsync(p0 : Int, p1 : Int) = "wasi:keyvalue/types@0.1.0" "[method]incoming-value.incoming-value-consume-async" -///| -fn wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0Read( - handle : Int, - buffer_ptr : Int, - length : Int, -) -> Int = "wasi:keyvalue/types@0.1.0" "[async-lower][stream-read-0][method]incoming-value.incoming-value-consume-async" +fn wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0Read(handle : Int, buffer_ptr : Int, length : Int) -> Int = "wasi:keyvalue/types@0.1.0" "[async-lower][stream-read-0][method]incoming-value.incoming-value-consume-async" +fn wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0CancelRead(handle : Int) -> Int = "wasi:keyvalue/types@0.1.0" "[stream-cancel-read-0][method]incoming-value.incoming-value-consume-async" -///| -fn wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0CancelRead( - handle : Int, -) -> Int = "wasi:keyvalue/types@0.1.0" "[stream-cancel-read-0][method]incoming-value.incoming-value-consume-async" - -///| -fn wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable( - handle : Int, -) = "wasi:keyvalue/types@0.1.0" "[stream-drop-readable-0][method]incoming-value.incoming-value-consume-async" +fn wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable(handle : Int) = "wasi:keyvalue/types@0.1.0" "[stream-drop-readable-0][method]incoming-value.incoming-value-consume-async" -///| -fn wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0Malloc( - length : Int, -) -> Int { - let ptr = mbt_ffi_malloc(1 * length) - ptr +fn wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0Malloc(length : Int) -> Int { + let ptr = mbt_ffi_malloc(1 * length) + ptr } -///| fn wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0Reject( - ptr : Int, - start : Int, - length : Int, +ptr : Int, +start : Int, +length : Int, ) -> Unit { - ignore((ptr, start, length)) + ignore((ptr, start, length)) } -///| fn wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0ListLift( - ptr : Int, - length : Int, +ptr : Int, +length : Int, ) -> FixedArray[Byte] { - mbt_ffi_ptr2bytes(ptr, length) + mbt_ffi_ptr2bytes(ptr, length) } -///| priv struct WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource { - handle : Int - mut closed : Bool - mut reading : Bool - mut read_task : Int - mut read_buffer : Int - mut read_discarding : Bool - mut read_cleanup_done : Bool - read_cleanup : @async-core.CondVar + handle : Int + mut closed : Bool + mut reading : Bool + mut read_task : Int + mut read_buffer : Int + mut read_discarding : Bool + mut read_cleanup_done : Bool + read_cleanup : @async-core.CondVar } -///| fn WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::finish_read( - self : WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, +self : WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, ) -> Unit { - self.reading = false - self.read_task = 0 - self.read_buffer = 0 - self.read_discarding = false - // Keep completion latched until a later read starts so every waiter woken - // by the broadcast can observe it. + self.reading = false + self.read_task = 0 + self.read_buffer = 0 + self.read_discarding = false + // Keep completion latched until a later read starts so every waiter woken + // by the broadcast can observe it. } -///| async fn WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::wait_for_read_cleanup( - self : WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, +self : WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, ) -> Unit noraise { - @async-core.protect_from_cancel( - () => { - while !self.read_cleanup_done { - self.read_cleanup.wait() - } - }, - resume_on_cancel=true, - ) catch { - _ => () - } + @async-core.protect_from_cancel( + () => { + while !self.read_cleanup_done { + self.read_cleanup.wait() + } + }, + resume_on_cancel=true, + ) catch { + _ => () + } } -///| async fn WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::cancel_active_read( - self : WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, +self : WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, ) -> Unit noraise { - if !self.reading { - return - } - if self.read_discarding { - self.wait_for_read_cleanup() - return - } - self.read_discarding = true - let progress_ref = Ref(0) - @async-core.protect_from_cancel( - () => { - progress_ref.val = @async-core.cancel_stream_read( - self.read_task, - self.handle, - () => { - wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0CancelRead( + if !self.reading { + return + } + if self.read_discarding { + self.wait_for_read_cleanup() + return + } + self.read_discarding = true + let progress_ref = Ref(0) + @async-core.protect_from_cancel( + () => { + progress_ref.val = @async-core.cancel_stream_read( + self.read_task, self.handle, - ) - }, - ) - }, - resume_on_cancel=true, - ) catch { - _ => () - } - let progress = progress_ref.val - if progress > 0 && self.read_buffer != 0 { - wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0Reject( - self.read_buffer, - 0, - progress, - ) - } - self.read_cleanup_done = true - self.read_cleanup.broadcast() + () => wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0CancelRead(self.handle), + ) + }, + resume_on_cancel=true, + ) catch { + _ => () + } + let progress = progress_ref.val + if progress > 0 && self.read_buffer != 0 { + wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0Reject(self.read_buffer, 0, progress) + } + self.read_cleanup_done = true + self.read_cleanup.broadcast() } -///| async fn WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::close( - self : WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, +self : WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, ) -> Unit noraise { - if self.closed { - return - } - if self.reading { - self.cancel_active_read() - } - self.closed = true - wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable( - self.handle, - ) + if self.closed { + return + } + if self.reading { + self.cancel_active_read() + } + self.closed = true + wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable(self.handle) } -///| fn WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::close_sync( - self : WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, +self : WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, ) -> Unit { - if self.closed || self.reading { - return - } - - self.closed = true - wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable( - self.handle, - ) + if self.closed || self.reading { + return + } + + self.closed = true + wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable(self.handle) } -///| async fn WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::read( - self : WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, - count : Int, +self : WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource, +count : Int, ) -> FixedArray[Byte]? { - if self.closed { - return None - } - if count <= 0 { - return Some([]) - } - if self.reading { - raise @async-core.EndpointBusy::Read - } - // `Stream.read` promises at most `count`; bound one canonical allocation. - let read_count = if count < 64 { count } else { 64 } - let ptr = wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0Malloc( - read_count, - ) - let mut owns_buffer = false - defer (if !owns_buffer { mbt_ffi_free(ptr) }) - self.reading = true - self.read_task = @async-core.current_component_task_token() - self.read_buffer = ptr - self.read_discarding = false - self.read_cleanup_done = false - let (progress, end) = @async-core.suspend_for_stream_read( - self.handle, - wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0Read( + if self.closed { + return None + } + if count <= 0 { + return Some([]) + } + if self.reading { + raise @async-core.EndpointBusy::Read + } + // `Stream.read` promises at most `count`; bound one canonical allocation. + let read_count = if count < 64 { + count + } else { + 64 + } + let ptr = wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0Malloc(read_count) + let mut owns_buffer = false + defer { + if !owns_buffer { + mbt_ffi_free(ptr) + } + } + self.reading = true + self.read_task = @async-core.current_component_task_token() + self.read_buffer = ptr + self.read_discarding = false + self.read_cleanup_done = false + let (progress, end) = @async-core.suspend_for_stream_read( self.handle, - ptr, - read_count, - ), - ) catch { - err => { + wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0Read(self.handle, ptr, read_count), + ) catch { + err => { + if self.read_discarding { + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if err is @async-core.Cancelled::Cancelled { + self.cancel_active_read() + if !self.closed { + self.closed = true + wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable(self.handle) + } + } + self.finish_read() + raise err + } + } if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if err is @async-core.Cancelled::Cancelled { - self.cancel_active_read() - if !self.closed { - self.closed = true - wasmImportWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0DropReadable( - self.handle, - ) - } + self.wait_for_read_cleanup() + self.finish_read() + return None + } + if progress == 0 { + self.finish_read() + if end { + self.close() + return None + } + return Some([]) } + let values = wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0ListLift(ptr, progress) + owns_buffer = true self.finish_read() - raise err - } - } - if self.read_discarding { - self.wait_for_read_cleanup() - self.finish_read() - return None - } - if progress == 0 { - self.finish_read() - if end { - self.close() - return None - } - return Some([]) - } - let values = wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0ListLift( - ptr, progress, - ) - owns_buffer = true - self.finish_read() - if end { - self.close() - } - Some(values) + if end { + self.close() + } + Some(values) } -///| -fn wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamLift( - handle : Int, -) -> @async-core.Stream[Byte] { - let source = WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::{ - handle, - closed: false, - reading: false, - read_task: 0, - read_buffer: 0, - read_discarding: false, - read_cleanup_done: false, - read_cleanup: CondVar(), - } - @async-core.Stream::from_source( - count => source.read(count), - () => source.close(), - () => source.close_sync(), - ) +fn wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamLift(handle : Int) -> @async-core.Stream[Byte] { + let source = WasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamSource::{ + handle, + closed: false, + reading: false, + read_task: 0, + read_buffer: 0, + read_discarding: false, + read_cleanup_done: false, + read_cleanup: CondVar(), + } + @async-core.Stream::from_source( + (count) => source.read(count), + () => source.close(), + () => source.close_sync(), + ) } -///| -fn wasmImportMethodIncomingValueIncomingValueSize(p0 : Int, p1 : Int) = "wasi:keyvalue/types@0.1.0" "[method]incoming-value.incoming-value-size" +fn wasmImportMethodIncomingValueIncomingValueSize(p0 : Int, p1 : Int) = "wasi:keyvalue/types@0.1.0" "[method]incoming-value.incoming-value-size" ///| -extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array8 +#| local.get 0) ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) - -///| -extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = - #|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) +#|(func (param i32) local.get 0 call $moonbit.decref) ///| -extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load8_u) +#owned(str) +extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = +#|(func (param i32) (result i32) local.get 0) ///| -extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array8 - #| local.get 0) +extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) = +#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8) ///| #owned(bytes) extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| -#owned(str) -extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load8_u) ///| extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 = - #|(func (param i32) (result i64) local.get 0 i64.load) +#|(func (param i32) (result i64) local.get 0 i64.load) + +///| +extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = +#|(func (param i32) (result i32) local.get 0 i32.load) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/types/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/types/top.mbt index 9e8ddb79e2..8150106b55 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/types/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/types/top.mbt @@ -1,5 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// A bucket is a collection of key-value pairs. Each key-value pair is stored /// as a entry in the bucket, and the bucket itself acts as a collection of all @@ -19,26 +18,22 @@ /// Soon: switch to `resource bucket { ... }` pub(all) struct Bucket(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Bucket::drop(self : Bucket) -> Unit { - let Bucket(resource) = self - wasmImportResourceDropBucket(resource) + let Bucket(resource) = self + wasmImportResourceDropBucket(resource) } - ///| /// A value is the data stored in a key-value pair. The value can be of any type /// that can be represented in a byte array. /// Soon: switch to `resource value { ... }` pub(all) struct OutgoingValue(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn OutgoingValue::drop(self : OutgoingValue) -> Unit { - let OutgoingValue(resource) = self - wasmImportResourceDropOutgoingValue(resource) + let OutgoingValue(resource) = self + wasmImportResourceDropOutgoingValue(resource) } - ///| /// A incoming-value is a wrapper around a value. It provides ways to read the value. /// @@ -53,194 +48,184 @@ pub fn OutgoingValue::drop(self : OutgoingValue) -> Unit { /// Soon: switch to `resource incoming-value { ... }` pub(all) struct IncomingValue(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn IncomingValue::drop(self : IncomingValue) -> Unit { - let IncomingValue(resource) = self - wasmImportResourceDropIncomingValue(resource) + let IncomingValue(resource) = self + wasmImportResourceDropIncomingValue(resource) } - ///| /// Opens a bucket with the given name. /// /// If any error occurs, including if the bucket does not exist, it returns an `Err(error)`. -pub fn Bucket::open_bucket( - name : String, -) -> Result[Bucket, @wasi-keyvalue-error.Error_] { - let ptr = mbt_ffi_str2ptr(name) - let return_area = mbt_ffi_malloc(8) - wasmImportStaticBucketOpenBucket(ptr, name.length(), return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(Bucket::Bucket(mbt_ffi_load32(return_area + 4))) - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} +pub fn Bucket::open_bucket(name : String) -> Result[Bucket, @wasi-keyvalue-error.Error_] { + + let ptr = mbt_ffi_str2ptr(name) + let return_area = mbt_ffi_malloc(8) + wasmImportStaticBucketOpenBucket(ptr, name.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(Bucket::Bucket(mbt_ffi_load32((return_area) + 4))) + } + 1 => { + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| pub fn OutgoingValue::new_outgoing_value() -> OutgoingValue { - let result : Int = wasmImportStaticOutgoingValueNewOutgoingValue() - let ret = OutgoingValue::OutgoingValue(result) - return ret -} + let result : Int = wasmImportStaticOutgoingValueNewOutgoingValue(); + let ret = OutgoingValue::OutgoingValue(result) + return ret + +} ///| /// Writes the value asynchronously by consuming the given `stream`: /// the caller keeps the writable end and the host appends every received /// byte to the outgoing value's body. /// If any other error occurs, it returns an `Err(error)`. -pub fn OutgoingValue::outgoing_value_write_body_async( - self : OutgoingValue, - data : @async-core.Stream[Byte], -) -> Result[Unit, @wasi-keyvalue-error.Error_] { - let OutgoingValue(handle) = self - let return_area = mbt_ffi_malloc(8) - let lower_arg = handle - let lower_arg0 = wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamLower( - data, - ) - let lower_arg1 = return_area - wasmImportMethodOutgoingValueOutgoingValueWriteBodyAsync( - lower_arg, lower_arg0, lower_arg1, - ) - wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamCommit( - lower_arg0, - ) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} +pub fn OutgoingValue::outgoing_value_write_body_async(self : OutgoingValue, data : @async-core.Stream[Byte]) -> Result[Unit, @wasi-keyvalue-error.Error_] { + + let OutgoingValue(handle) = self + let return_area = mbt_ffi_malloc(8) + let lower_arg = handle + let lower_arg0 = wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamLower(data) + let lower_arg1 = return_area + wasmImportMethodOutgoingValueOutgoingValueWriteBodyAsync(lower_arg, lower_arg0, lower_arg1); + wasmWasiKeyvalueTypes010MethodOutgoingValueOutgoingValueWriteBodyAsyncStream0StreamCommit(lower_arg0) + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret +} ///| /// Writes the value synchronously. /// If any other error occurs, it returns an `Err(error)`. -pub fn OutgoingValue::outgoing_value_write_body_sync( - self : OutgoingValue, - value : FixedArray[Byte], -) -> Result[Unit, @wasi-keyvalue-error.Error_] { - let OutgoingValue(handle) = self - - let ptr = mbt_ffi_bytes2ptr(value) - - let return_area = mbt_ffi_malloc(8) - wasmImportMethodOutgoingValueOutgoingValueWriteBodySync( - handle, - ptr, - value.length(), - return_area, - ) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(()) - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(ptr) - mbt_ffi_free(return_area) - return ret -} +pub fn OutgoingValue::outgoing_value_write_body_sync(self : OutgoingValue, value : FixedArray[Byte]) -> Result[Unit, @wasi-keyvalue-error.Error_] { + + let OutgoingValue(handle) = self + + let ptr = mbt_ffi_bytes2ptr(value) + let return_area = mbt_ffi_malloc(8) + wasmImportMethodOutgoingValueOutgoingValueWriteBodySync(handle, ptr, value.length(), return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok(()) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(ptr) + mbt_ffi_free(return_area) + return ret + +} ///| /// Consumes the value synchronously and returns the value as a list of bytes. /// If any other error occurs, it returns an `Err(error)`. -pub fn IncomingValue::incoming_value_consume_sync( - self : IncomingValue, -) -> Result[FixedArray[Byte], @wasi-keyvalue-error.Error_] { - let IncomingValue(handle) = self - let return_area = mbt_ffi_malloc(12) - wasmImportMethodIncomingValueIncomingValueConsumeSync(handle, return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = mbt_ffi_ptr2bytes( - mbt_ffi_load32(return_area + 4), - mbt_ffi_load32(return_area + 8), - ) - - Result::Ok(result) - } - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} +pub fn IncomingValue::incoming_value_consume_sync(self : IncomingValue) -> Result[FixedArray[Byte], @wasi-keyvalue-error.Error_] { + + let IncomingValue(handle) = self + let return_area = mbt_ffi_malloc(12) + wasmImportMethodIncomingValueIncomingValueConsumeSync(handle, return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + let result = mbt_ffi_ptr2bytes(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8)) + + Result::Ok(result) + } + 1 => { + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + +} ///| /// Consumes the value asynchronously and returns the value as a `stream`. /// If any other error occurs, it returns an `Err(error)`. -pub fn IncomingValue::incoming_value_consume_async( - self : IncomingValue, -) -> Result[@async-core.Stream[Byte], @wasi-keyvalue-error.Error_] { - let IncomingValue(handle) = self - let return_area = mbt_ffi_malloc(8) - let lower_arg = handle - let lower_arg0 = return_area - wasmImportMethodIncomingValueIncomingValueConsumeAsync(lower_arg, lower_arg0) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => { - let result = wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamLift( - mbt_ffi_load32(return_area + 4), - ) - - Result::Ok(result) - } - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 4)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret -} +pub fn IncomingValue::incoming_value_consume_async(self : IncomingValue) -> Result[@async-core.Stream[Byte], @wasi-keyvalue-error.Error_] { + + let IncomingValue(handle) = self + let return_area = mbt_ffi_malloc(8) + let lower_arg = handle + let lower_arg0 = return_area + wasmImportMethodIncomingValueIncomingValueConsumeAsync(lower_arg, lower_arg0); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + let result = wasmWasiKeyvalueTypes010MethodIncomingValueIncomingValueConsumeAsyncStream0StreamLift(mbt_ffi_load32((return_area) + 4)) + + Result::Ok(result) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 4))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret +} ///| /// The size of the value in bytes. /// If the size is unknown or unavailable, this function returns an `Err(error)`. -pub fn IncomingValue::incoming_value_size( - self : IncomingValue, -) -> Result[UInt64, @wasi-keyvalue-error.Error_] { - let IncomingValue(handle) = self - let return_area = mbt_ffi_malloc(16) - wasmImportMethodIncomingValueIncomingValueSize(handle, return_area) - - let lifted = match mbt_ffi_load8_u(return_area + 0) { - 0 => Result::Ok(mbt_ffi_load64(return_area + 8).reinterpret_as_uint64()) - 1 => - Result::Err( - @wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32(return_area + 8)), - ) - _ => panic() - } - let ret = lifted - mbt_ffi_free(return_area) - return ret +pub fn IncomingValue::incoming_value_size(self : IncomingValue) -> Result[UInt64, @wasi-keyvalue-error.Error_] { + + let IncomingValue(handle) = self + let return_area = mbt_ffi_malloc(16) + wasmImportMethodIncomingValueIncomingValueSize(handle, return_area); + + let lifted = match (mbt_ffi_load8_u((return_area) + 0)) { + 0 => { + + Result::Ok((mbt_ffi_load64((return_area) + 8)).reinterpret_as_uint64()) + } + 1 => { + + Result::Err(@wasi-keyvalue-error.Error_::Error_(mbt_ffi_load32((return_area) + 8))) + } + _ => panic() + } + let ret = lifted + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/wasi-keyvalue-error/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/wasi-keyvalue-error/ffi.mbt index f0fd8284f1..17df045cdc 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/wasi-keyvalue-error/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/wasi-keyvalue-error/ffi.mbt @@ -1,29 +1,28 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| fn wasmImportResourceDropError_(resource : Int) = "wasi:keyvalue/wasi-keyvalue-error@0.1.0" "[resource-drop]error" -///| -fn wasmImportMethodErrorTrace(p0 : Int, p1 : Int) = "wasi:keyvalue/wasi-keyvalue-error@0.1.0" "[method]error.trace" +fn wasmImportMethodErrorTrace(p0 : Int, p1 : Int) = "wasi:keyvalue/wasi-keyvalue-error@0.1.0" "[method]error.trace" ///| extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.load) +#|(func (param i32) (result i32) local.get 0 i32.load) ///| -extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = - #|(func (param i32) (param i32) (result i32) - #| local.get 0 - #| local.get 1 call $moonbit.init_array16 - #| local.get 0) +extern "wasm" fn mbt_ffi_free(position : Int) = +#|(func (param i32) local.get 0 call $moonbit.decref) ///| extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int = - #|(func (param i32) (result i32) (local i32) - #| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc - #| local.tee 1 i32.const 0 call $moonbit.init_array8 - #| local.get 1) +#|(func (param i32) (result i32) (local i32) +#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc +#| local.tee 1 i32.const 0 call $moonbit.init_array8 +#| local.get 1) ///| -extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String = +#|(func (param i32) (param i32) (result i32) +#| local.get 0 +#| local.get 1 call $moonbit.init_array16 +#| local.get 0) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/wasi-keyvalue-error/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/wasi-keyvalue-error/top.mbt index 6a30e3c235..6039b53195 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/wasi-keyvalue-error/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/keyvalue/wasi-keyvalue-error/top.mbt @@ -1,5 +1,4 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// An error resource type for keyvalue operations. /// @@ -16,28 +15,24 @@ /// of the error. In the future, this will be extended to provide more information /// about the error. /// Soon: switch to `resource error { ... }` -pub(all) suberror Error_ { - Error_(Int) -} derive(Show, Eq) +pub(all) suberror Error_(Int) derive(Show, Eq) -///| /// Drops a resource handle. pub fn Error_::drop(self : Error_) -> Unit { - let Error_(resource) = self - wasmImportResourceDropError_(resource) + let Error_(resource) = self + wasmImportResourceDropError_(resource) } - ///| pub fn Error_::trace(self : Error_) -> String { - let Error_(handle) = self - let return_area = mbt_ffi_malloc(8) - wasmImportMethodErrorTrace(handle, return_area) - let result = mbt_ffi_ptr2str( - mbt_ffi_load32(return_area + 0), - mbt_ffi_load32(return_area + 4), - ) - let ret = result - mbt_ffi_free(return_area) - return ret + let Error_(handle) = self + let return_area = mbt_ffi_malloc(8) + wasmImportMethodErrorTrace(handle, return_area); + + let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 0), mbt_ffi_load32((return_area) + 4)) + let ret = result + mbt_ffi_free(return_area) + return ret + } + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/logging/logging/ffi.mbt b/sdks/moonbit/golem_sdk/interface/wasi/logging/logging/ffi.mbt index 4972c05d81..da482887ea 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/logging/logging/ffi.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/logging/logging/ffi.mbt @@ -1,13 +1,13 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! -///| -fn wasmImportLog(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) = "wasi:logging/logging" "log" +fn wasmImportLog(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int) = "wasi:logging/logging" "log" ///| #owned(str) extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int = - #|(func (param i32) (result i32) local.get 0) +#|(func (param i32) (result i32) local.get 0) ///| extern "wasm" fn mbt_ffi_free(position : Int) = - #|(func (param i32) local.get 0 call $moonbit.decref) +#|(func (param i32) local.get 0 call $moonbit.decref) + diff --git a/sdks/moonbit/golem_sdk/interface/wasi/logging/logging/top.mbt b/sdks/moonbit/golem_sdk/interface/wasi/logging/logging/top.mbt index 7e9c0dc669..179a0d436e 100644 --- a/sdks/moonbit/golem_sdk/interface/wasi/logging/logging/top.mbt +++ b/sdks/moonbit/golem_sdk/interface/wasi/logging/logging/top.mbt @@ -1,41 +1,32 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! - ///| /// A log level, describing a kind of message. pub(all) enum Level { - TRACE - DEBUG - INFO - WARN - ERROR - CRITICAL + TRACE; DEBUG; INFO; WARN; ERROR; CRITICAL } derive(Show, Eq) -///| pub fn Level::ordinal(self : Level) -> Int { - match self { - TRACE => 0 - DEBUG => 1 - INFO => 2 - WARN => 3 - ERROR => 4 - CRITICAL => 5 - } + match self { + TRACE => 0 + DEBUG => 1 + INFO => 2 + WARN => 3 + ERROR => 4 + CRITICAL => 5 + } } -///| pub fn Level::from(self : Int) -> Level { - match self { - 0 => TRACE - 1 => DEBUG - 2 => INFO - 3 => WARN - 4 => ERROR - 5 => CRITICAL - _ => panic() - } + match self { + 0 => TRACE + 1 => DEBUG + 2 => INFO + 3 => WARN + 4 => ERROR + 5 => CRITICAL + _ => panic() + } } - ///| /// Emit a log message. /// @@ -44,10 +35,13 @@ pub fn Level::from(self : Int) -> Level { /// consumers group similar messages, and a string containing the message /// text. pub fn log(level : Level, context : String, message : String) -> Unit { - let ptr = mbt_ffi_str2ptr(context) - let ptr0 = mbt_ffi_str2ptr(message) - wasmImportLog(level.ordinal(), ptr, context.length(), ptr0, message.length()) - mbt_ffi_free(ptr) - mbt_ffi_free(ptr0) + let ptr = mbt_ffi_str2ptr(context) + + let ptr0 = mbt_ffi_str2ptr(message) + wasmImportLog(level.ordinal(), ptr, context.length(), ptr0, message.length()); + mbt_ffi_free(ptr) + mbt_ffi_free(ptr0) + } + diff --git a/sdks/moonbit/golem_sdk/rpc/rpc.mbt b/sdks/moonbit/golem_sdk/rpc/rpc.mbt index aadd5e68db..efa566ed0a 100644 --- a/sdks/moonbit/golem_sdk/rpc/rpc.mbt +++ b/sdks/moonbit/golem_sdk/rpc/rpc.mbt @@ -157,7 +157,7 @@ pub async fn AgentClient::invoke_and_await( function_name : String, input : @types.SchemaValueTree, ) -> InvocationResult[@types.SchemaValueTree?] { - let invocation = self.rpc.async_invoke_and_await(function_name, input) + let invocation = self.rpc.async_invoke_and_await(function_name, input, None) defer invocation.future.drop() let result = invocation.future.get() catch { e => { @@ -183,7 +183,7 @@ pub fn AgentClient::invoke( function_name : String, input : @types.SchemaValueTree, ) -> InvocationMetadata { - match self.rpc.invoke(function_name, input) { + match self.rpc.invoke(function_name, input, None) { Ok(value) => { agent_id: value.agent_id, idempotency_key: value.idempotency_key } Err(e) => panic_on_rpc_error(e) @@ -197,7 +197,12 @@ pub fn AgentClient::schedule_invocation( function_name : String, input : @types.SchemaValueTree, ) -> ScheduledInvocationReceipt { - let value = self.rpc.schedule_invocation(scheduled_at, function_name, input) + let value = self.rpc.schedule_invocation( + scheduled_at, + function_name, + input, + None, + ) { metadata: { agent_id: value.metadata.agent_id, @@ -214,7 +219,10 @@ pub fn AgentClient::schedule_cancelable_invocation( input : @types.SchemaValueTree, ) -> CancelableScheduledInvocationReceipt { let value = self.rpc.schedule_cancelable_invocation( - scheduled_at, function_name, input, + scheduled_at, + function_name, + input, + None, ) { metadata: { diff --git a/sdks/moonbit/golem_sdk/schema/schema.mbt b/sdks/moonbit/golem_sdk/schema/schema.mbt index d9c11e129c..147cac6815 100644 --- a/sdks/moonbit/golem_sdk/schema/schema.mbt +++ b/sdks/moonbit/golem_sdk/schema/schema.mbt @@ -115,6 +115,7 @@ pub fn value_kind(v : @model.SchemaValue) -> String { Union(_, _) => "union" Secret(_) => "secret" QuotaToken(_) => "quota-token" + PermissionCard(_) => "permission-card" } } diff --git a/sdks/moonbit/golem_sdk/schema_model/model.mbt b/sdks/moonbit/golem_sdk/schema_model/model.mbt index 44b69d62ad..34f1c3c55d 100644 --- a/sdks/moonbit/golem_sdk/schema_model/model.mbt +++ b/sdks/moonbit/golem_sdk/schema_model/model.mbt @@ -72,6 +72,7 @@ pub(all) enum SchemaTypeBody { // Capability nodes Secret(SecretSpec) QuotaToken(@types.QuotaTokenSpec) + PermissionCard(@types.PermissionCardSpec) // WASI P3 stubs (parseable only; no semantics yet) Future(SchemaType?) Stream(SchemaType?) @@ -185,6 +186,8 @@ pub(all) enum SchemaValue { Secret(GuestSecretHandle) // owned `quota-token` resource carried as an opaque, affine handle QuotaToken(GuestQuotaTokenHandle) + // owned `permission-card` resource carried as an opaque, affine handle + PermissionCard(GuestPermissionCardHandle) } derive(Show, Eq) ///| diff --git a/sdks/moonbit/golem_sdk/schema_model/permission_card_handle.mbt b/sdks/moonbit/golem_sdk/schema_model/permission_card_handle.mbt new file mode 100644 index 0000000000..b43567394e --- /dev/null +++ b/sdks/moonbit/golem_sdk/schema_model/permission_card_handle.mbt @@ -0,0 +1,66 @@ +// Opaque, affine carrier for an owned `golem:core/types@2.0.0` +// `permission-card` resource as it travels inside a `SchemaValue`. + +///| +/// Opaque, affine (take-once) holder for an owned `permission-card` resource +/// handle. The guest can hold and transfer the card, but cannot inspect or +/// forge the runtime-owned authority represented by the raw resource. +pub(all) struct GuestPermissionCardHandle { + priv mut cell : @types.PermissionCard? +} + +///| +/// Wrap a freshly received owned handle in a take-once holder. +pub fn GuestPermissionCardHandle::new( + handle : @types.PermissionCard, +) -> GuestPermissionCardHandle { + { cell: Some(handle) } +} + +///| +/// Whether the handle is still present (not yet transferred). +pub fn GuestPermissionCardHandle::is_present( + self : GuestPermissionCardHandle, +) -> Bool { + self.cell is Some(_) +} + +///| +/// Move the owned handle out, leaving this holder empty. +pub fn GuestPermissionCardHandle::take( + self : GuestPermissionCardHandle, +) -> @types.PermissionCard? { + let current = self.cell + self.cell = None + current +} + +///| +/// Run `f` with the owned handle without consuming it. +pub fn[R] GuestPermissionCardHandle::with_handle( + self : GuestPermissionCardHandle, + f : (@types.PermissionCard) -> R, +) -> R? { + match self.cell { + Some(h) => Some(f(h)) + None => None + } +} + +///| +/// Identity-based equality: two holders are equal only if they are the same +/// instance. An opaque capability has no structural content to compare. +impl Eq for GuestPermissionCardHandle with fn equal(self, other) { + physical_equal(self, other) +} + +///| +impl Show for GuestPermissionCardHandle with fn output(self, logger) { + logger.write_string( + if self.is_present() { + "GuestPermissionCardHandle(present)" + } else { + "GuestPermissionCardHandle(consumed)" + }, + ) +} diff --git a/sdks/moonbit/golem_sdk/schema_model/pkg.generated.mbti b/sdks/moonbit/golem_sdk/schema_model/pkg.generated.mbti index 71cfb24b34..2a9517871d 100644 --- a/sdks/moonbit/golem_sdk/schema_model/pkg.generated.mbti +++ b/sdks/moonbit/golem_sdk/schema_model/pkg.generated.mbti @@ -95,6 +95,14 @@ pub fn GraphEncoder::encode_type(Self, SchemaType) -> Int raise SchemaModelError pub fn GraphEncoder::finish(Self) -> @types.SchemaGraph raise SchemaModelError pub fn GraphEncoder::new(Array[SchemaTypeDef]) -> Self raise SchemaModelError +pub(all) struct GuestPermissionCardHandle { + // private fields +} +pub fn GuestPermissionCardHandle::is_present(Self) -> Bool +pub fn GuestPermissionCardHandle::new(@types.PermissionCard) -> Self +pub fn GuestPermissionCardHandle::take(Self) -> @types.PermissionCard? +pub fn[R] GuestPermissionCardHandle::with_handle(Self, (@types.PermissionCard) -> R) -> R? + pub(all) struct GuestQuotaTokenHandle { // private fields } @@ -185,6 +193,7 @@ pub(all) enum SchemaTypeBody { Union(Array[UnionBranch]) Secret(SecretSpec) QuotaToken(@types.QuotaTokenSpec) + PermissionCard(@types.PermissionCardSpec) Future(SchemaType?) Stream(SchemaType?) } derive(Eq, Show) @@ -230,6 +239,7 @@ pub(all) enum SchemaValue { Union(String, SchemaValue) Secret(GuestSecretHandle) QuotaToken(GuestQuotaTokenHandle) + PermissionCard(GuestPermissionCardHandle) } derive(Eq, Show) pub(all) struct SecretSpec { diff --git a/sdks/moonbit/golem_sdk/schema_model/roundtrip_test.mbt b/sdks/moonbit/golem_sdk/schema_model/roundtrip_test.mbt index ecf9c742ef..d2859d739a 100644 --- a/sdks/moonbit/golem_sdk/schema_model/roundtrip_test.mbt +++ b/sdks/moonbit/golem_sdk/schema_model/roundtrip_test.mbt @@ -453,6 +453,7 @@ test "semantic and capability types round-trip" { category: Some("api-key"), } let quota_s : @types.QuotaTokenSpec = { resource_name: Some("cpu") } + let card_s : @types.PermissionCardSpec = { polymorphic: true } let branch_a : UnionBranch = { tag: "a", body: schema_type(S32(None)), @@ -474,6 +475,7 @@ test "semantic and capability types round-trip" { field("quantity", schema_type(Quantity(qty_s))), field("secret", schema_type(Secret(secret_s))), field("quota", schema_type(QuotaToken(quota_s))), + field("card", schema_type(PermissionCard(card_s))), field("future_some", schema_type(Future(Some(schema_type(S32(None)))))), field("future_none", schema_type(Future(None))), field("stream_some", schema_type(Stream(Some(schema_type(String))))), @@ -764,6 +766,110 @@ test "decode rejects a handle node unreachable from the root" { assert_true(dm.contains("not referenced from the root")) } +///| +/// Build an opaque permission-card handle around a fake resource index. The +/// handle is used only by the host-free schema codec tests. +fn fake_permission_card_handle(index : Int) -> GuestPermissionCardHandle { + GuestPermissionCardHandle::new(@types.PermissionCard::PermissionCard(index)) +} + +///| +test "permission-card value encodes to a handle node and decodes to a fresh handle" { + let handle = fake_permission_card_handle(20) + let wit = schema_value_to_wit(PermissionCard(handle)) + assert_false(handle.is_present()) + guard wit.value_nodes[wit.root] is @types.PermissionCardHandle(_) else { + fail("expected a permission-card-handle wire node") + } + guard schema_value_from_wit(wit) is PermissionCard(decoded) else { + fail("expected a decoded permission-card value") + } + assert_true(decoded.is_present()) +} + +///| +test "permission-card preflight rejects consumed and duplicate handles without moving them" { + let consumed = fake_permission_card_handle(21) + let _ = consumed.take() + let consumed_result = try? schema_value_to_wit(PermissionCard(consumed)) + guard consumed_result is Err(EncodeError(consumed_message)) else { + fail("expected EncodeError, got \{consumed_result}") + } + assert_true(consumed_message.contains("permission-card")) + + let duplicate = fake_permission_card_handle(22) + let duplicate_result = try? schema_value_to_wit( + Tuple([PermissionCard(duplicate), PermissionCard(duplicate)]), + ) + guard duplicate_result is Err(EncodeError(duplicate_message)) else { + fail("expected EncodeError, got \{duplicate_result}") + } + assert_true(duplicate_message.contains("permission-card")) + assert_true(duplicate.is_present()) +} + +///| +test "permission-card preflight rejects distinct holders for one raw handle" { + let raw = @types.PermissionCard::PermissionCard(23) + let a = GuestPermissionCardHandle::new(raw) + let b = GuestPermissionCardHandle::new(raw) + let result = try? schema_value_to_wit( + Tuple([PermissionCard(a), PermissionCard(b)]), + ) + guard result is Err(EncodeError(message)) else { + fail("expected EncodeError, got \{result}") + } + assert_true(message.contains("more than once")) + assert_true(a.is_present() && b.is_present()) +} + +///| +test "permission-card decode rejects duplicate raw and repeated handle nodes" { + let raw = @types.PermissionCard::PermissionCard(24) + let duplicate_raw : @types.SchemaValueTree = { + value_nodes: [ + @types.PermissionCardHandle(raw), + @types.PermissionCardHandle(raw), + @types.TupleValue([0, 1]), + ], + root: 2, + } + let duplicate_raw_result = try? schema_value_from_wit(duplicate_raw) + guard duplicate_raw_result is Err(DecodeError(duplicate_raw_message)) else { + fail("expected DecodeError, got \{duplicate_raw_result}") + } + assert_true(duplicate_raw_message.contains("more than one handle node")) + + let repeated_node : @types.SchemaValueTree = { + value_nodes: [ + @types.PermissionCardHandle(@types.PermissionCard::PermissionCard(25)), + @types.TupleValue([0, 0]), + ], + root: 1, + } + let repeated_node_result = try? schema_value_from_wit(repeated_node) + guard repeated_node_result is Err(DecodeError(repeated_node_message)) else { + fail("expected DecodeError, got \{repeated_node_result}") + } + assert_true(repeated_node_message.contains("more than once")) +} + +///| +test "permission-card decode rejects an unreachable handle node" { + let tree : @types.SchemaValueTree = { + value_nodes: [ + @types.TupleValue([]), + @types.PermissionCardHandle(@types.PermissionCard::PermissionCard(26)), + ], + root: 0, + } + let result = try? schema_value_from_wit(tree) + guard result is Err(DecodeError(message)) else { + fail("expected DecodeError, got \{result}") + } + assert_true(message.contains("not referenced from the root")) +} + ///| test "duplicate def id is rejected before a bad body is decoded" { // Both a duplicate def id AND an out-of-range body index exist; the duplicate diff --git a/sdks/moonbit/golem_sdk/schema_model/wit.mbt b/sdks/moonbit/golem_sdk/schema_model/wit.mbt index a3027352f9..13c4dc1bf8 100644 --- a/sdks/moonbit/golem_sdk/schema_model/wit.mbt +++ b/sdks/moonbit/golem_sdk/schema_model/wit.mbt @@ -247,6 +247,7 @@ fn GraphEncoder::encode_body( category: spec.category, }) QuotaToken(spec) => @types.QuotaTokenType(spec) + PermissionCard(spec) => @types.PermissionCardType(spec) Future(element) => @types.FutureType(self.encode_opt(element)) Stream(element) => @types.StreamType(self.encode_opt(element)) } @@ -482,6 +483,7 @@ fn GraphDecoder::body_of( @types.SecretType(spec) => Secret({ inner: self.type_at(spec.inner), category: spec.category }) @types.QuotaTokenType(spec) => QuotaToken(spec) + @types.PermissionCardType(spec) => PermissionCard(spec) @types.FutureType(element) => Future(self.decode_opt(element)) @types.StreamType(element) => Stream(self.decode_opt(element)) } @@ -622,6 +624,16 @@ fn ValueEncoder::emit_node( "quota-token handle was already transferred; an owned quota-token can only be sent once", ) } + PermissionCard(handle) => + // Move the owned `permission-card` resource out exactly once after the + // full value tree has passed the affine-handle preflight. + match handle.take() { + Some(raw) => @types.PermissionCardHandle(raw) + None => + raise EncodeError( + "permission-card handle was already transferred; an owned permission-card can only be sent once", + ) + } } } @@ -654,7 +666,8 @@ pub fn schema_value_to_wit( fn preflight_value(value : SchemaValue) -> Unit raise SchemaModelError { let seen_secrets : Array[@types.Secret] = [] let seen_quota_tokens : Array[@types.QuotaToken] = [] - preflight_walk(value, seen_secrets, seen_quota_tokens) + let seen_permission_cards : Array[@types.PermissionCard] = [] + preflight_walk(value, seen_secrets, seen_quota_tokens, seen_permission_cards) } ///| @@ -662,6 +675,7 @@ fn preflight_walk( value : SchemaValue, seen_secrets : Array[@types.Secret], seen_quota_tokens : Array[@types.QuotaToken], + seen_permission_cards : Array[@types.PermissionCard], ) -> Unit raise SchemaModelError { match value { S8(i) => @@ -719,48 +733,98 @@ fn preflight_walk( } seen_quota_tokens.push(raw) } + PermissionCard(handle) => { + let raw = match handle.with_handle(r => r) { + Some(raw) => raw + None => + raise EncodeError( + "permission-card handle was already transferred; an owned permission-card can only be sent once", + ) + } + for card in seen_permission_cards { + if card == raw { + raise EncodeError( + "the same permission-card handle appeared more than once in one value tree", + ) + } + } + seen_permission_cards.push(raw) + } Record(fields) => for f in fields { - preflight_walk(f, seen_secrets, seen_quota_tokens) + preflight_walk( + f, seen_secrets, seen_quota_tokens, seen_permission_cards, + ) } Variant(_, payload) => match payload { - Some(p) => preflight_walk(p, seen_secrets, seen_quota_tokens) + Some(p) => + preflight_walk( + p, seen_secrets, seen_quota_tokens, seen_permission_cards, + ) None => () } Tuple(elements) => for e in elements { - preflight_walk(e, seen_secrets, seen_quota_tokens) + preflight_walk( + e, seen_secrets, seen_quota_tokens, seen_permission_cards, + ) } List(elements) => for e in elements { - preflight_walk(e, seen_secrets, seen_quota_tokens) + preflight_walk( + e, seen_secrets, seen_quota_tokens, seen_permission_cards, + ) } FixedList(elements) => for e in elements { - preflight_walk(e, seen_secrets, seen_quota_tokens) + preflight_walk( + e, seen_secrets, seen_quota_tokens, seen_permission_cards, + ) } Map(entries) => for e in entries { - preflight_walk(e.key, seen_secrets, seen_quota_tokens) - preflight_walk(e.value, seen_secrets, seen_quota_tokens) + preflight_walk( + e.key, + seen_secrets, + seen_quota_tokens, + seen_permission_cards, + ) + preflight_walk( + e.value, + seen_secrets, + seen_quota_tokens, + seen_permission_cards, + ) } Option(o) => match o { - Some(x) => preflight_walk(x, seen_secrets, seen_quota_tokens) + Some(x) => + preflight_walk( + x, seen_secrets, seen_quota_tokens, seen_permission_cards, + ) None => () } ResultOk(o) => match o { - Some(x) => preflight_walk(x, seen_secrets, seen_quota_tokens) + Some(x) => + preflight_walk( + x, seen_secrets, seen_quota_tokens, seen_permission_cards, + ) None => () } ResultErr(o) => match o { - Some(x) => preflight_walk(x, seen_secrets, seen_quota_tokens) + Some(x) => + preflight_walk( + x, seen_secrets, seen_quota_tokens, seen_permission_cards, + ) None => () } - Union(_, body) => preflight_walk(body, seen_secrets, seen_quota_tokens) + Union(_, body) => + preflight_walk( + body, seen_secrets, seen_quota_tokens, seen_permission_cards, + ) _ => () } } @@ -779,10 +843,12 @@ priv struct ValueDecoder { // resource in two handles. lifted_secrets : Array[Bool] lifted_quota_tokens : Array[Bool] + lifted_permission_cards : Array[Bool] // Underlying owned resources already lifted, so a malformed tree that carries // the same raw resource in two *different* handle nodes is also rejected. lifted_secret_raws : Array[@types.Secret] lifted_quota_token_raws : Array[@types.QuotaToken] + lifted_permission_card_raws : Array[@types.PermissionCard] } ///| @@ -792,8 +858,10 @@ fn ValueDecoder::new(nodes : Array[@types.SchemaValueNode]) -> ValueDecoder { on_path: Array::make(nodes.length(), false), lifted_secrets: Array::make(nodes.length(), false), lifted_quota_tokens: Array::make(nodes.length(), false), + lifted_permission_cards: Array::make(nodes.length(), false), lifted_secret_raws: [], lifted_quota_token_raws: [], + lifted_permission_card_raws: [], } } @@ -817,6 +885,10 @@ fn ValueDecoder::first_unreferenced_handle(self : ValueDecoder) -> Int? { if not(self.lifted_quota_tokens[i]) { return Some(i) } + @types.PermissionCardHandle(_) => + if not(self.lifted_permission_cards[i]) { + return Some(i) + } _ => () } } @@ -967,6 +1039,25 @@ fn ValueDecoder::from_node( self.lifted_quota_token_raws.push(raw) QuotaToken(GuestQuotaTokenHandle::new(raw)) } + @types.PermissionCardHandle(raw) => { + // The generated resource wrapper is copyable, so enforce affine + // ownership when lifting it into the recursive schema value. + guard not(self.lifted_permission_cards[idx]) else { + raise DecodeError( + "permission-card handle node referenced more than once at index \{idx}; an owned permission-card can only be lifted once", + ) + } + for card in self.lifted_permission_card_raws { + if card == raw { + raise DecodeError( + "the same owned permission-card resource appeared in more than one handle node", + ) + } + } + self.lifted_permission_cards[idx] = true + self.lifted_permission_card_raws.push(raw) + PermissionCard(GuestPermissionCardHandle::new(raw)) + } } } diff --git a/sdks/moonbit/golem_sdk/tool/dispatch.mbt b/sdks/moonbit/golem_sdk/tool/dispatch.mbt index 787760460f..729b41d2f7 100644 --- a/sdks/moonbit/golem_sdk/tool/dispatch.mbt +++ b/sdks/moonbit/golem_sdk/tool/dispatch.mbt @@ -202,6 +202,8 @@ fn value_matches_type( @model.SchemaTypeBody::Secret(_) => value is @model.SchemaValue::Secret(_) @model.SchemaTypeBody::QuotaToken(_) => value is @model.SchemaValue::QuotaToken(_) + @model.SchemaTypeBody::PermissionCard(_) => + value is @model.SchemaValue::PermissionCard(_) @model.SchemaTypeBody::Future(_) => false @model.SchemaTypeBody::Stream(_) => false } diff --git a/sdks/moonbit/golem_sdk/tool/refinement.mbt b/sdks/moonbit/golem_sdk/tool/refinement.mbt index a2ec783fe9..da8fcfe372 100644 --- a/sdks/moonbit/golem_sdk/tool/refinement.mbt +++ b/sdks/moonbit/golem_sdk/tool/refinement.mbt @@ -35,6 +35,7 @@ fn schema_kind_name(body : @model.SchemaTypeBody) -> String { Union(_) => "union" Secret(_) => "secret" QuotaToken(_) => "quota-token" + PermissionCard(_) => "permission-card" Future(_) => "future" Stream(_) => "stream" } diff --git a/sdks/moonbit/golem_sdk/wit/deps/golem-1.x/golem-host.wit b/sdks/moonbit/golem_sdk/wit/deps/golem-1.x/golem-host.wit index ac94d44384..296b14e498 100644 --- a/sdks/moonbit/golem_sdk/wit/deps/golem-1.x/golem-host.wit +++ b/sdks/moonbit/golem_sdk/wit/deps/golem-1.x/golem-host.wit @@ -3,7 +3,7 @@ package golem:api@1.5.0; /// The Golem host API provides low level access to Golem specific features such as promises and control over /// the durability and transactional guarantees the executor provides. interface host { - use golem:core/types@2.0.0.{component-id, card-id, uuid, agent-id, promise-id, oplog-index}; + use golem:core/types@2.0.0.{component-id, uuid, agent-id, promise-id, oplog-index}; /// Represents a Golem component's version type component-revision = u64; @@ -186,17 +186,6 @@ interface host { get: async func() -> list; } - /// Plain-data handle to a permission card visible to the guest. - record card { - card-id: card-id, - } - - enum card-install-error { - revoked, - not-found, - not-permitted, - } - /// Create a new promise create-promise: func() -> promise-id; @@ -257,15 +246,6 @@ interface host { /// to introduce idempotence. generate-idempotency-key: func() -> uuid; - /// Returns one permission card currently installed in this agent's wallet, if any. - self-card: func() -> option; - - /// Derives a card handle from an installed card. This minimal test-facing form keeps the card as plain data. - derive-card: func(card: card) -> result; - - /// Installs a card into this agent's own wallet. - install-card: func(card: card) -> result<_, card-install-error>; - /// Initiates an update attempt for the given agent. The function returns immediately once the request has been processed, /// not waiting for the agent to get updated. update-agent: func(agent-id: agent-id, target-revision: component-revision, mode: update-mode); diff --git a/sdks/moonbit/golem_sdk/wit/deps/golem-agent/host.wit b/sdks/moonbit/golem_sdk/wit/deps/golem-agent/host.wit index 345fa12b02..b10c052e8b 100644 --- a/sdks/moonbit/golem_sdk/wit/deps/golem-agent/host.wit +++ b/sdks/moonbit/golem_sdk/wit/deps/golem-agent/host.wit @@ -1,7 +1,7 @@ package golem:agent@2.0.0; interface host { - use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value}; + use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value, permission-card}; use wasi:clocks/system-clock@0.3.0.{instant as datetime}; use common.{agent-error, agent-type, registered-agent-type, typed-agent-config-value}; @@ -90,25 +90,25 @@ interface host { /// /// `input` encodes the method's parameter list. The returned result is /// `none` for a `unit` output and `some(value)` for a `single` output. - invoke-and-await: func(method-name: string, input: schema-value-tree) -> result; + invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Triggers the invocation of a remote method with the given parameters, /// and returns its final identity immediately. - invoke: func(method-name: string, input: schema-value-tree) -> result; + invoke: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Invokes a remote method with the given parameters, and returns a `future-invoke-result` value which can /// be polled for the result together with the final invocation identity. /// /// With this function it is possible to call multiple (different) agents simultaneously. - async-invoke-and-await: func(method-name: string, input: schema-value-tree) -> async-invocation-with-metadata; + async-invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> async-invocation-with-metadata; /// Schedules an invocation for later and returns its final identity. - schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> scheduled-invocation-receipt; + schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> scheduled-invocation-receipt; /// Schedules an invocation for later and returns its final identity and /// cancellation capability. Call cancel on the returned resource to /// cancel the invocation before the scheduled time. - schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> cancelable-scheduled-invocation-receipt; + schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> cancelable-scheduled-invocation-receipt; } /// Represents an asynchronous invocation result diff --git a/sdks/moonbit/golem_sdk/wit/deps/golem-core-v2/golem-core-v2.wit b/sdks/moonbit/golem_sdk/wit/deps/golem-core-v2/golem-core-v2.wit index bb7dda191e..a59e6e4ede 100644 --- a/sdks/moonbit/golem_sdk/wit/deps/golem-core-v2/golem-core-v2.wit +++ b/sdks/moonbit/golem_sdk/wit/deps/golem-core-v2/golem-core-v2.wit @@ -125,6 +125,17 @@ interface types { /// and reveal it only through capability-gated host interfaces. resource secret; + /// An unforgeable handle to a permission card held by the runtime. The + /// handle is opaque to guests: components can hold, pass, derive, install, + /// and revoke cards only through the `golem:permissions` interfaces. When + /// carried in a `schema-value-tree` (see + /// `schema-value-node::permission-card-handle`) the handle is transferred + /// by ownership; the host converts it to/from its internal trusted + /// card-store representation at the boundary. The wire form is the card-id + /// (UUID) alone — no grants, parents, or metadata cross the wire as + /// authority. + resource permission-card; + // ============================================================ // Schema graph (self-contained type carrier) // ============================================================ @@ -266,6 +277,7 @@ interface types { // --- Capability nodes --- secret-type(secret-spec), quota-token-type(quota-token-spec), + permission-card-type(permission-card-spec), // --- WASI P3 stubs (parseable only; no semantics yet) --- future-type(option), @@ -462,6 +474,13 @@ interface types { resource-name: option, } + record permission-card-spec { + /// `true` = polymorphic (carries slot variables in owner / resource-id), + /// `false` = monomorphic. Structural metadata only; authority lives in + /// the card store, not in the schema spec. + polymorphic: bool, + } + // ============================================================ // Schema value (always paired with a schema-graph) // ============================================================ @@ -524,6 +543,7 @@ interface types { // Capability nodes secret-value(own), quota-token-handle(own), + permission-card-handle(own), // WASI P3 stubs (parseable only in the schema; no constructible values). } diff --git a/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/derive.wit b/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/derive.wit new file mode 100644 index 0000000000..a1cd9f06b6 --- /dev/null +++ b/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/derive.wit @@ -0,0 +1,42 @@ +package golem:permissions@0.1.0; + +/// Derivation of new permission cards from an existing card or from the +/// caller's wallet. +/// +/// Derivation narrows authority: a child card's lattice is bounded by its +/// parent's lattice. The caller specifies which lower-positive and +/// upper-positive grants to retain and which lower-negative and +/// upper-negative grants to add, plus an optional lifespan. +interface derive { + use golem:core/types@2.0.0.{permission-card}; + use types.{pattern-grant, permission-error, duration}; + + /// Derive a child card from `parent`, narrowing the grant lattice. + derive: func( + parent: borrow, + lower-positive-to-retain: list, + lower-negative-to-add: list, + upper-positive-to-retain: list, + upper-negative-to-add: list, + lifespan: option, + ) -> result; + + /// Derive a card directly from the caller's wallet. + derive-from-wallet: func( + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + lifespan: option, + ) -> result; + + /// Derive an invocation-local card from one or more persistent or scope + /// parents. Scope cards are attenuated in-memory and are never persisted. + derive-scope: func( + parents: list>, + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + ) -> result; +} diff --git a/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/inspect.wit b/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/inspect.wit new file mode 100644 index 0000000000..34481974fd --- /dev/null +++ b/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/inspect.wit @@ -0,0 +1,14 @@ +package golem:permissions@0.1.0; + +/// Read-only inspection of a permission card's full grant lattice. +/// +/// Returns the four quadrants of the card's bound lattice +/// (lower/upper × positive/negative) as a `card-view`. Importing this +/// interface grants no authority to mutate or derive cards. +interface inspect { + use golem:core/types@2.0.0.{permission-card}; + use types.{card-view, permission-error}; + + /// Return the card's complete grant lattice. + inspect-card: func(c: borrow) -> result; +} diff --git a/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/kernel-introspection.wit b/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/kernel-introspection.wit new file mode 100644 index 0000000000..d555454b01 --- /dev/null +++ b/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/kernel-introspection.wit @@ -0,0 +1,20 @@ +package golem:permissions@0.1.0; + +/// Introspection of the permission kernel's registered resource classes and +/// verbs, and validation of individual grants against the kernel's schema. +interface kernel-introspection { + use types.{pattern-grant, permission-error}; + + record kernel-module { + class-name: string, + verbs: list, + } + + /// List every resource class the kernel knows about, with their + /// permitted verbs. + list-modules: func() -> list; + + /// Validate that `g` references a known class, owner, recipient, verb, + /// and resource-id pattern accepted by the kernel. + validate-grant: func(g: pattern-grant) -> result<_, permission-error>; +} diff --git a/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/revoke.wit b/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/revoke.wit new file mode 100644 index 0000000000..da2fb7975a --- /dev/null +++ b/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/revoke.wit @@ -0,0 +1,15 @@ +package golem:permissions@0.1.0; + +/// Revocation of a permission card and its derivation DAG subtree. +/// +/// `revoke-card` consumes the owned handle (the receiving component's +/// resource-table entry is deleted); the stored card is walked via the card +/// store's DAG descendant index. Returns the cut-subtree size. +interface revoke { + use golem:core/types@2.0.0.{permission-card}; + use types.{permission-error}; + + /// Revoke `c` and every card transitively derived from it. + /// Consumes the owned handle. + revoke-card: func(c: permission-card) -> result; +} diff --git a/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/types.wit b/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/types.wit new file mode 100644 index 0000000000..2fb749ed60 --- /dev/null +++ b/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/types.wit @@ -0,0 +1,82 @@ +package golem:permissions@0.1.0; + +/// The permission-card resource's shared data model and inspection operations. +/// +/// The `permission-card` capability itself is defined as a bare resource in +/// `golem:core/types` so that it can travel inside a `schema-value-tree` as an +/// opaque, unforgeable handle. This interface exposes only safe inspection +/// operations over that handle plus the records and variants the other +/// permissions interfaces reference. Components that only need to *hold and +/// pass* cards — most tools and middleware — import only this interface. +interface types { + use golem:core/types@2.0.0.{permission-card, card-id, agent-id, uuid}; + + record timestamp { + seconds: s64, + nanoseconds: u32, + } + + /// ISO-8601 duration string (e.g. `"P30D"` for 30 days). + record duration { + iso-8601: string, + } + + variant holder { + account(uuid), + app(uuid), + agent(agent-id), + } + + record pattern-grant { + class: string, + owner: string, + recipient: string, + verb: string, + resource-id: string, + } + + record card-view { + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + } + + record wallet-version-token { + /// 32 bytes — BLAKE3 of (holder-kind, holder-id). + wallet-id-hash: list, + generation: u64, + } + + variant permission-error { + not-permitted(string), + lower-bound-too-broad(string), + upper-bound-too-broad(string), + wallet-multi-source-required(string), + card-revoked(string), + card-expired(string), + install-recipient-mismatch(string), + card-polymorphic-not-usable(string), + unknown-resource-class(string), + invalid-pattern(string), + invalid-verb(string), + invalid-owner(string), + invalid-recipient(string), + } + + // --- Card inspection --- + // Free functions on a borrowed handle, because the resource itself is + // bare in core (matching secret/quota-token). + + /// Stable identifier of this card. + id: func(c: borrow) -> card-id; + + /// Parent card identifiers in the derivation DAG. + parents: func(c: borrow) -> list; + + /// Expiry timestamp, if the card has a bounded lifespan. + expires-at: func(c: borrow) -> option; + + /// `true` if the card is polymorphic (carries slot variables). + is-polymorphic: func(c: borrow) -> bool; +} diff --git a/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/wallet.wit b/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/wallet.wit new file mode 100644 index 0000000000..818d8b1538 --- /dev/null +++ b/sdks/moonbit/golem_sdk/wit/deps/golem-permissions/wallet.wit @@ -0,0 +1,23 @@ +package golem:permissions@0.1.0; + +/// Wallet operations: enumerate the caller's installed cards, query the +/// wallet's version token, and install a card onto a target holder. +interface wallet { + use golem:core/types@2.0.0.{permission-card}; + use types.{permission-error, wallet-version-token, holder}; + + /// All permission cards currently installed in the caller's wallet. + self-wallet: func() -> list; + + /// Version token for the caller's wallet, changed whenever the set of + /// installed cards changes. + self-version: func() -> wallet-version-token; + + /// Install `card` onto `target`. Returns unit on success. + /// + /// Only agent targets are currently supported. Account and application + /// targets return `not-permitted("install-card currently supports only + /// agent targets")` before any wallet or oplog mutation. + install-card: func(card: permission-card, target: holder) + -> result<_, permission-error>; +} diff --git a/sdks/moonbit/golem_sdk/world/agent-guest/ffi_import.mbt b/sdks/moonbit/golem_sdk/world/agent-guest/ffi_import.mbt index 01e5518ad5..821232033b 100644 --- a/sdks/moonbit/golem_sdk/world/agent-guest/ffi_import.mbt +++ b/sdks/moonbit/golem_sdk/world/agent-guest/ffi_import.mbt @@ -1 +1,2 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! + diff --git a/sdks/moonbit/golem_sdk/world/agent-guest/import.mbt b/sdks/moonbit/golem_sdk/world/agent-guest/import.mbt index 01e5518ad5..821232033b 100644 --- a/sdks/moonbit/golem_sdk/world/agent-guest/import.mbt +++ b/sdks/moonbit/golem_sdk/world/agent-guest/import.mbt @@ -1 +1,2 @@ // Generated by `wit-bindgen` 0.59.0. DO NOT EDIT! + diff --git a/sdks/rust/Cargo.lock b/sdks/rust/Cargo.lock index 18cf4ebcdd..a4235d2aca 100644 --- a/sdks/rust/Cargo.lock +++ b/sdks/rust/Cargo.lock @@ -264,9 +264,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -637,13 +637,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -669,9 +669,9 @@ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -1025,9 +1025,9 @@ checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -1386,9 +1386,9 @@ dependencies = [ [[package]] name = "nonempty-collections" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d127e00b37b19c36c28ac00e874240a61faeea14c7b759b1d9c77efa048322a" +checksum = "988fb92b275335f315a9bddf7a8881a02c79c6084e9a626f656f12c50776a045" [[package]] name = "num-bigint" @@ -2257,20 +2257,20 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6328af13490e73a9b4694030fafd93f8c8c6a9dede33e821c3fc63eddf8042ba" +checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] name = "toml" -version = "1.1.3+spec-1.1.0" +version = "1.1.4+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53c96ecdfa941c8fc4fcaed14f99ada8ebed502eef533015095a07e3301d4c3c" +checksum = "3aace63f4bbcdfc2c965b059de67119c89c4017a70d633be6c104910f67056f5" dependencies = [ "indexmap", "serde_core", @@ -2304,9 +2304,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/sdks/rust/golem-rust-macro/src/agentic/client_generation.rs b/sdks/rust/golem-rust-macro/src/agentic/client_generation.rs index e219a25764..1754f3416c 100644 --- a/sdks/rust/golem-rust-macro/src/agentic/client_generation.rs +++ b/sdks/rust/golem-rust-macro/src/agentic/client_generation.rs @@ -918,7 +918,8 @@ fn generate_method_code( let rpc_result_future = self.wasm_rpc.async_invoke_and_await( #remote_token, - input + input, + None ).future; let rpc_result: Result, golem_rust::golem_agentic::golem::agent::host::RpcError> = @@ -934,7 +935,7 @@ fn generate_method_code( #encode_input let rpc_result: Result<(), golem_rust::golem_agentic::golem::agent::host::RpcError> = - self.wasm_rpc.invoke(#remote_token, input).map(|_| ()); + self.wasm_rpc.invoke(#remote_token, input, None).map(|_| ()); rpc_result.unwrap_or_else(|e| panic!("rpc call to trigger {} failed: {:?}", #remote_token, e)); } @@ -945,7 +946,8 @@ fn generate_method_code( self.wasm_rpc.schedule_invocation( #scheduled_time_param, #remote_token, - input + input, + None ); } @@ -955,7 +957,8 @@ fn generate_method_code( self.wasm_rpc.schedule_cancelable_invocation( #scheduled_time_param, #remote_token, - input + input, + None ).cancellation_token } }; @@ -964,7 +967,7 @@ fn generate_method_code( quote! { pub async fn #method_name(#(#input_defs),*) -> golem_rust::agentic::EphemeralInvocationResult<#return_type> { #encode_input - let invocation = self.wasm_rpc.async_invoke_and_await(#remote_token, input); + let invocation = self.wasm_rpc.async_invoke_and_await(#remote_token, input, None); let metadata = invocation.metadata; let rpc_result: Result, golem_rust::golem_agentic::golem::agent::host::RpcError> = golem_rust::agentic::await_invoke_schema_value_result(invocation.future).await; @@ -975,18 +978,18 @@ fn generate_method_code( pub fn #trigger_name(#(#input_defs),*) -> golem_rust::golem_agentic::golem::agent::host::InvocationMetadata { #encode_input - self.wasm_rpc.invoke(#remote_token, input) + self.wasm_rpc.invoke(#remote_token, input, None) .unwrap_or_else(|e| panic!("rpc call to trigger {} failed: {:?}", #remote_token, e)) } pub fn #schedule_name(#(#input_defs,)* #scheduled_time_param: golem_rust::ScheduledTime) -> golem_rust::golem_agentic::golem::agent::host::InvocationMetadata { #encode_input - self.wasm_rpc.schedule_invocation(#scheduled_time_param, #remote_token, input).metadata + self.wasm_rpc.schedule_invocation(#scheduled_time_param, #remote_token, input, None).metadata } pub fn #schedule_cancelable_name(#(#input_defs,)* #scheduled_time_param: golem_rust::ScheduledTime) -> golem_rust::golem_agentic::golem::agent::host::CancelableScheduledInvocationReceipt { #encode_input - let receipt = self.wasm_rpc.schedule_cancelable_invocation(#scheduled_time_param, #remote_token, input); + let receipt = self.wasm_rpc.schedule_cancelable_invocation(#scheduled_time_param, #remote_token, input, None); receipt } } diff --git a/sdks/rust/golem-rust/src/agentic/extended_tool_type.rs b/sdks/rust/golem-rust/src/agentic/extended_tool_type.rs index 7d1f77e2c4..6c5fe43916 100644 --- a/sdks/rust/golem-rust/src/agentic/extended_tool_type.rs +++ b/sdks/rust/golem-rust/src/agentic/extended_tool_type.rs @@ -3539,6 +3539,10 @@ fn schema_types_match( (SchemaType::QuotaToken { spec: sa, .. }, SchemaType::QuotaToken { spec: sb, .. }) => { sa.resource_name == sb.resource_name } + ( + SchemaType::PermissionCard { spec: sa, .. }, + SchemaType::PermissionCard { spec: sb, .. }, + ) => sa.polymorphic == sb.polymorphic, ( SchemaType::Text { restrictions: ra, .. @@ -3671,8 +3675,8 @@ mod tests { use crate::agentic::tool_refinement::{refine_numeric, refine_path, refine_text, refine_url}; use crate::schema::schema_type::{NumericBound, NumericRestrictions}; use crate::schema::{ - BinaryRestrictions, PathDirection, PathKind, PathSpec, QuantitySpec, QuotaTokenSpec, - SecretSpec, TextRestrictions, + BinaryRestrictions, PathDirection, PathKind, PathSpec, PermissionCardSpec, QuantitySpec, + QuotaTokenSpec, SecretSpec, TextRestrictions, }; use test_r::test; @@ -5293,7 +5297,7 @@ mod tests { } #[test] - fn rich_leaf_secret_and_quota_identity_is_compared() { + fn rich_leaf_capability_identity_is_compared() { assert!(shapes_match( SchemaType::secret(SecretSpec { inner: Box::new(SchemaType::string()), @@ -5322,6 +5326,14 @@ mod tests { resource_name: Some("requests".into()) }), )); + assert!(shapes_match( + SchemaType::permission_card(PermissionCardSpec { polymorphic: true }), + SchemaType::permission_card(PermissionCardSpec { polymorphic: true }), + )); + assert!(!shapes_match( + SchemaType::permission_card(PermissionCardSpec { polymorphic: true }), + SchemaType::permission_card(PermissionCardSpec { polymorphic: false }), + )); } #[test] diff --git a/sdks/rust/golem-rust/src/agentic/tool_refinement.rs b/sdks/rust/golem-rust/src/agentic/tool_refinement.rs index 37acd25a3f..b3ee6a0544 100644 --- a/sdks/rust/golem-rust/src/agentic/tool_refinement.rs +++ b/sdks/rust/golem-rust/src/agentic/tool_refinement.rs @@ -226,6 +226,7 @@ fn schema_kind_name(ty: &SchemaType) -> &'static str { SchemaType::Union { .. } => "union", SchemaType::Secret { .. } => "secret", SchemaType::QuotaToken { .. } => "quota-token", + SchemaType::PermissionCard { .. } => "permission-card", SchemaType::Future { .. } => "future", SchemaType::Stream { .. } => "stream", } diff --git a/sdks/rust/golem-rust/src/lib.rs b/sdks/rust/golem-rust/src/lib.rs index 357e7cffe5..d2e30f714b 100644 --- a/sdks/rust/golem-rust/src/lib.rs +++ b/sdks/rust/golem-rust/src/lib.rs @@ -127,6 +127,12 @@ pub mod bindings { pub use crate::raw_bindings::golem::agent::host; } + pub mod permissions { + pub use crate::raw_bindings::golem::permissions::{ + derive, inspect, kernel_introspection, revoke, types, wallet, + }; + } + pub mod tool { pub use crate::raw_bindings::golem::tool::host; } @@ -384,18 +390,6 @@ fn wire_component_id_to_schema(value: schema::wit::wire::ComponentId) -> Compone } } -fn schema_card_id_to_wire(value: CardId) -> schema::wit::wire::CardId { - schema::wit::wire::CardId { - uuid: schema_uuid_to_wire(value.uuid), - } -} - -fn wire_card_id_to_schema(value: schema::wit::wire::CardId) -> CardId { - CardId { - uuid: wire_uuid_to_schema(value.uuid), - } -} - fn schema_agent_id_to_wire(value: AgentId) -> schema::wit::wire::AgentId { schema::wit::wire::AgentId { component_id: schema_component_id_to_wire(value.component_id), @@ -469,54 +463,6 @@ pub enum UpdateMode { SnapshotBased, } -#[derive(Clone, Debug, Eq, PartialEq, IntoSchema, FromSchema)] -pub struct Card { - pub card_id: CardId, -} - -impl From for Card { - fn from(value: host_api::Card) -> Self { - Self { - card_id: wire_card_id_to_schema(value.card_id), - } - } -} - -impl From for host_api::Card { - fn from(value: Card) -> Self { - Self { - card_id: schema_card_id_to_wire(value.card_id), - } - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, IntoSchema, FromSchema)] -pub enum CardInstallError { - Revoked, - NotFound, - NotPermitted, -} - -impl From for CardInstallError { - fn from(value: host_api::CardInstallError) -> Self { - match value { - host_api::CardInstallError::Revoked => Self::Revoked, - host_api::CardInstallError::NotFound => Self::NotFound, - host_api::CardInstallError::NotPermitted => Self::NotPermitted, - } - } -} - -impl From for host_api::CardInstallError { - fn from(value: CardInstallError) -> Self { - match value { - CardInstallError::Revoked => Self::Revoked, - CardInstallError::NotFound => Self::NotFound, - CardInstallError::NotPermitted => Self::NotPermitted, - } - } -} - impl From for UpdateMode { fn from(value: host_api::UpdateMode) -> Self { match value { @@ -1130,20 +1076,6 @@ pub fn generate_idempotency_key() -> uuid::Uuid { Into::into(host_api::generate_idempotency_key()) } -pub fn self_card() -> Option { - host_api::self_card().map(Into::into) -} - -pub fn derive_card(card: Card) -> Result { - let card = host_api::Card::from(card); - host_api::derive_card(card).map(Into::into) -} - -pub fn install_card(card: Card) -> Result<(), CardInstallError> { - let card = host_api::Card::from(card); - host_api::install_card(card).map_err(Into::into) -} - pub struct AtomicOperationGuard { begin: OplogIndex, } diff --git a/sdks/rust/golem-rust/tests/schema_reexport.rs b/sdks/rust/golem-rust/tests/schema_reexport.rs index 65d2f3d827..1f571b8b09 100644 --- a/sdks/rust/golem-rust/tests/schema_reexport.rs +++ b/sdks/rust/golem-rust/tests/schema_reexport.rs @@ -6,6 +6,14 @@ use golem_rust::{ }; use test_r::test; +// Every public golem:permissions interface must remain available through the SDK bindings. +#[test] +fn all_permission_wit_bindings_are_publicly_exposed() { + use golem_rust::bindings::golem::permissions::kernel_introspection; + + let _ = kernel_introspection::list_modules; +} + #[derive(Clone, Debug, PartialEq, IntoSchema, FromSchema)] struct ReexportedSchemaType { name: String, diff --git a/sdks/rust/golem-rust/wit/deps/golem-1.x/golem-host.wit b/sdks/rust/golem-rust/wit/deps/golem-1.x/golem-host.wit index ac94d44384..296b14e498 100644 --- a/sdks/rust/golem-rust/wit/deps/golem-1.x/golem-host.wit +++ b/sdks/rust/golem-rust/wit/deps/golem-1.x/golem-host.wit @@ -3,7 +3,7 @@ package golem:api@1.5.0; /// The Golem host API provides low level access to Golem specific features such as promises and control over /// the durability and transactional guarantees the executor provides. interface host { - use golem:core/types@2.0.0.{component-id, card-id, uuid, agent-id, promise-id, oplog-index}; + use golem:core/types@2.0.0.{component-id, uuid, agent-id, promise-id, oplog-index}; /// Represents a Golem component's version type component-revision = u64; @@ -186,17 +186,6 @@ interface host { get: async func() -> list; } - /// Plain-data handle to a permission card visible to the guest. - record card { - card-id: card-id, - } - - enum card-install-error { - revoked, - not-found, - not-permitted, - } - /// Create a new promise create-promise: func() -> promise-id; @@ -257,15 +246,6 @@ interface host { /// to introduce idempotence. generate-idempotency-key: func() -> uuid; - /// Returns one permission card currently installed in this agent's wallet, if any. - self-card: func() -> option; - - /// Derives a card handle from an installed card. This minimal test-facing form keeps the card as plain data. - derive-card: func(card: card) -> result; - - /// Installs a card into this agent's own wallet. - install-card: func(card: card) -> result<_, card-install-error>; - /// Initiates an update attempt for the given agent. The function returns immediately once the request has been processed, /// not waiting for the agent to get updated. update-agent: func(agent-id: agent-id, target-revision: component-revision, mode: update-mode); diff --git a/sdks/rust/golem-rust/wit/deps/golem-agent/host.wit b/sdks/rust/golem-rust/wit/deps/golem-agent/host.wit index 345fa12b02..b10c052e8b 100644 --- a/sdks/rust/golem-rust/wit/deps/golem-agent/host.wit +++ b/sdks/rust/golem-rust/wit/deps/golem-agent/host.wit @@ -1,7 +1,7 @@ package golem:agent@2.0.0; interface host { - use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value}; + use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value, permission-card}; use wasi:clocks/system-clock@0.3.0.{instant as datetime}; use common.{agent-error, agent-type, registered-agent-type, typed-agent-config-value}; @@ -90,25 +90,25 @@ interface host { /// /// `input` encodes the method's parameter list. The returned result is /// `none` for a `unit` output and `some(value)` for a `single` output. - invoke-and-await: func(method-name: string, input: schema-value-tree) -> result; + invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Triggers the invocation of a remote method with the given parameters, /// and returns its final identity immediately. - invoke: func(method-name: string, input: schema-value-tree) -> result; + invoke: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Invokes a remote method with the given parameters, and returns a `future-invoke-result` value which can /// be polled for the result together with the final invocation identity. /// /// With this function it is possible to call multiple (different) agents simultaneously. - async-invoke-and-await: func(method-name: string, input: schema-value-tree) -> async-invocation-with-metadata; + async-invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> async-invocation-with-metadata; /// Schedules an invocation for later and returns its final identity. - schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> scheduled-invocation-receipt; + schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> scheduled-invocation-receipt; /// Schedules an invocation for later and returns its final identity and /// cancellation capability. Call cancel on the returned resource to /// cancel the invocation before the scheduled time. - schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> cancelable-scheduled-invocation-receipt; + schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> cancelable-scheduled-invocation-receipt; } /// Represents an asynchronous invocation result diff --git a/sdks/rust/golem-rust/wit/deps/golem-core-v2/golem-core-v2.wit b/sdks/rust/golem-rust/wit/deps/golem-core-v2/golem-core-v2.wit index bb7dda191e..a59e6e4ede 100644 --- a/sdks/rust/golem-rust/wit/deps/golem-core-v2/golem-core-v2.wit +++ b/sdks/rust/golem-rust/wit/deps/golem-core-v2/golem-core-v2.wit @@ -125,6 +125,17 @@ interface types { /// and reveal it only through capability-gated host interfaces. resource secret; + /// An unforgeable handle to a permission card held by the runtime. The + /// handle is opaque to guests: components can hold, pass, derive, install, + /// and revoke cards only through the `golem:permissions` interfaces. When + /// carried in a `schema-value-tree` (see + /// `schema-value-node::permission-card-handle`) the handle is transferred + /// by ownership; the host converts it to/from its internal trusted + /// card-store representation at the boundary. The wire form is the card-id + /// (UUID) alone — no grants, parents, or metadata cross the wire as + /// authority. + resource permission-card; + // ============================================================ // Schema graph (self-contained type carrier) // ============================================================ @@ -266,6 +277,7 @@ interface types { // --- Capability nodes --- secret-type(secret-spec), quota-token-type(quota-token-spec), + permission-card-type(permission-card-spec), // --- WASI P3 stubs (parseable only; no semantics yet) --- future-type(option), @@ -462,6 +474,13 @@ interface types { resource-name: option, } + record permission-card-spec { + /// `true` = polymorphic (carries slot variables in owner / resource-id), + /// `false` = monomorphic. Structural metadata only; authority lives in + /// the card store, not in the schema spec. + polymorphic: bool, + } + // ============================================================ // Schema value (always paired with a schema-graph) // ============================================================ @@ -524,6 +543,7 @@ interface types { // Capability nodes secret-value(own), quota-token-handle(own), + permission-card-handle(own), // WASI P3 stubs (parseable only in the schema; no constructible values). } diff --git a/sdks/rust/golem-rust/wit/deps/golem-permissions/derive.wit b/sdks/rust/golem-rust/wit/deps/golem-permissions/derive.wit new file mode 100644 index 0000000000..a1cd9f06b6 --- /dev/null +++ b/sdks/rust/golem-rust/wit/deps/golem-permissions/derive.wit @@ -0,0 +1,42 @@ +package golem:permissions@0.1.0; + +/// Derivation of new permission cards from an existing card or from the +/// caller's wallet. +/// +/// Derivation narrows authority: a child card's lattice is bounded by its +/// parent's lattice. The caller specifies which lower-positive and +/// upper-positive grants to retain and which lower-negative and +/// upper-negative grants to add, plus an optional lifespan. +interface derive { + use golem:core/types@2.0.0.{permission-card}; + use types.{pattern-grant, permission-error, duration}; + + /// Derive a child card from `parent`, narrowing the grant lattice. + derive: func( + parent: borrow, + lower-positive-to-retain: list, + lower-negative-to-add: list, + upper-positive-to-retain: list, + upper-negative-to-add: list, + lifespan: option, + ) -> result; + + /// Derive a card directly from the caller's wallet. + derive-from-wallet: func( + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + lifespan: option, + ) -> result; + + /// Derive an invocation-local card from one or more persistent or scope + /// parents. Scope cards are attenuated in-memory and are never persisted. + derive-scope: func( + parents: list>, + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + ) -> result; +} diff --git a/sdks/rust/golem-rust/wit/deps/golem-permissions/inspect.wit b/sdks/rust/golem-rust/wit/deps/golem-permissions/inspect.wit new file mode 100644 index 0000000000..34481974fd --- /dev/null +++ b/sdks/rust/golem-rust/wit/deps/golem-permissions/inspect.wit @@ -0,0 +1,14 @@ +package golem:permissions@0.1.0; + +/// Read-only inspection of a permission card's full grant lattice. +/// +/// Returns the four quadrants of the card's bound lattice +/// (lower/upper × positive/negative) as a `card-view`. Importing this +/// interface grants no authority to mutate or derive cards. +interface inspect { + use golem:core/types@2.0.0.{permission-card}; + use types.{card-view, permission-error}; + + /// Return the card's complete grant lattice. + inspect-card: func(c: borrow) -> result; +} diff --git a/sdks/rust/golem-rust/wit/deps/golem-permissions/kernel-introspection.wit b/sdks/rust/golem-rust/wit/deps/golem-permissions/kernel-introspection.wit new file mode 100644 index 0000000000..d555454b01 --- /dev/null +++ b/sdks/rust/golem-rust/wit/deps/golem-permissions/kernel-introspection.wit @@ -0,0 +1,20 @@ +package golem:permissions@0.1.0; + +/// Introspection of the permission kernel's registered resource classes and +/// verbs, and validation of individual grants against the kernel's schema. +interface kernel-introspection { + use types.{pattern-grant, permission-error}; + + record kernel-module { + class-name: string, + verbs: list, + } + + /// List every resource class the kernel knows about, with their + /// permitted verbs. + list-modules: func() -> list; + + /// Validate that `g` references a known class, owner, recipient, verb, + /// and resource-id pattern accepted by the kernel. + validate-grant: func(g: pattern-grant) -> result<_, permission-error>; +} diff --git a/sdks/rust/golem-rust/wit/deps/golem-permissions/revoke.wit b/sdks/rust/golem-rust/wit/deps/golem-permissions/revoke.wit new file mode 100644 index 0000000000..da2fb7975a --- /dev/null +++ b/sdks/rust/golem-rust/wit/deps/golem-permissions/revoke.wit @@ -0,0 +1,15 @@ +package golem:permissions@0.1.0; + +/// Revocation of a permission card and its derivation DAG subtree. +/// +/// `revoke-card` consumes the owned handle (the receiving component's +/// resource-table entry is deleted); the stored card is walked via the card +/// store's DAG descendant index. Returns the cut-subtree size. +interface revoke { + use golem:core/types@2.0.0.{permission-card}; + use types.{permission-error}; + + /// Revoke `c` and every card transitively derived from it. + /// Consumes the owned handle. + revoke-card: func(c: permission-card) -> result; +} diff --git a/sdks/rust/golem-rust/wit/deps/golem-permissions/types.wit b/sdks/rust/golem-rust/wit/deps/golem-permissions/types.wit new file mode 100644 index 0000000000..2fb749ed60 --- /dev/null +++ b/sdks/rust/golem-rust/wit/deps/golem-permissions/types.wit @@ -0,0 +1,82 @@ +package golem:permissions@0.1.0; + +/// The permission-card resource's shared data model and inspection operations. +/// +/// The `permission-card` capability itself is defined as a bare resource in +/// `golem:core/types` so that it can travel inside a `schema-value-tree` as an +/// opaque, unforgeable handle. This interface exposes only safe inspection +/// operations over that handle plus the records and variants the other +/// permissions interfaces reference. Components that only need to *hold and +/// pass* cards — most tools and middleware — import only this interface. +interface types { + use golem:core/types@2.0.0.{permission-card, card-id, agent-id, uuid}; + + record timestamp { + seconds: s64, + nanoseconds: u32, + } + + /// ISO-8601 duration string (e.g. `"P30D"` for 30 days). + record duration { + iso-8601: string, + } + + variant holder { + account(uuid), + app(uuid), + agent(agent-id), + } + + record pattern-grant { + class: string, + owner: string, + recipient: string, + verb: string, + resource-id: string, + } + + record card-view { + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + } + + record wallet-version-token { + /// 32 bytes — BLAKE3 of (holder-kind, holder-id). + wallet-id-hash: list, + generation: u64, + } + + variant permission-error { + not-permitted(string), + lower-bound-too-broad(string), + upper-bound-too-broad(string), + wallet-multi-source-required(string), + card-revoked(string), + card-expired(string), + install-recipient-mismatch(string), + card-polymorphic-not-usable(string), + unknown-resource-class(string), + invalid-pattern(string), + invalid-verb(string), + invalid-owner(string), + invalid-recipient(string), + } + + // --- Card inspection --- + // Free functions on a borrowed handle, because the resource itself is + // bare in core (matching secret/quota-token). + + /// Stable identifier of this card. + id: func(c: borrow) -> card-id; + + /// Parent card identifiers in the derivation DAG. + parents: func(c: borrow) -> list; + + /// Expiry timestamp, if the card has a bounded lifespan. + expires-at: func(c: borrow) -> option; + + /// `true` if the card is polymorphic (carries slot variables). + is-polymorphic: func(c: borrow) -> bool; +} diff --git a/sdks/rust/golem-rust/wit/deps/golem-permissions/wallet.wit b/sdks/rust/golem-rust/wit/deps/golem-permissions/wallet.wit new file mode 100644 index 0000000000..818d8b1538 --- /dev/null +++ b/sdks/rust/golem-rust/wit/deps/golem-permissions/wallet.wit @@ -0,0 +1,23 @@ +package golem:permissions@0.1.0; + +/// Wallet operations: enumerate the caller's installed cards, query the +/// wallet's version token, and install a card onto a target holder. +interface wallet { + use golem:core/types@2.0.0.{permission-card}; + use types.{permission-error, wallet-version-token, holder}; + + /// All permission cards currently installed in the caller's wallet. + self-wallet: func() -> list; + + /// Version token for the caller's wallet, changed whenever the set of + /// installed cards changes. + self-version: func() -> wallet-version-token; + + /// Install `card` onto `target`. Returns unit on success. + /// + /// Only agent targets are currently supported. Account and application + /// targets return `not-permitted("install-card currently supports only + /// agent targets")` before any wallet or oplog mutation. + install-card: func(card: permission-card, target: holder) + -> result<_, permission-error>; +} diff --git a/sdks/rust/golem-rust/wit/golem-rust.wit b/sdks/rust/golem-rust/wit/golem-rust.wit index 7280d6b3b5..74c382227d 100644 --- a/sdks/rust/golem-rust/wit/golem-rust.wit +++ b/sdks/rust/golem-rust/wit/golem-rust.wit @@ -8,6 +8,12 @@ world golem-rust { import golem:agent/host@2.0.0; import golem:tool/host@0.1.0; + import golem:permissions/types@0.1.0; + import golem:permissions/inspect@0.1.0; + import golem:permissions/derive@0.1.0; + import golem:permissions/revoke@0.1.0; + import golem:permissions/wallet@0.1.0; + import golem:permissions/kernel-introspection@0.1.0; import golem:durability/durability@1.5.0; import golem:quota/types@1.5.0; diff --git a/sdks/scala/core/js/src/main/scala/golem/runtime/rpc/host/WasmRpcApi.scala b/sdks/scala/core/js/src/main/scala/golem/runtime/rpc/host/WasmRpcApi.scala index 43707c4212..dc00a54c41 100644 --- a/sdks/scala/core/js/src/main/scala/golem/runtime/rpc/host/WasmRpcApi.scala +++ b/sdks/scala/core/js/src/main/scala/golem/runtime/rpc/host/WasmRpcApi.scala @@ -126,7 +126,7 @@ private[golem] object WasmRpcApi { input: JsSchemaValueTree ): Either[RpcError, InvocationResult[js.UndefOr[JsSchemaValueTree]]] = try { - val value = raw.invokeAndAwait(functionName, input) + val value = raw.invokeAndAwait(functionName, input, js.undefined) Right(InvocationResult(metadata(value.metadata), value.result)) } catch { case js.JavaScriptException(e) => Left(decodeRpcError(e)) } @@ -134,7 +134,7 @@ private[golem] object WasmRpcApi { invokeWithMetadata(functionName, input).map(_ => ()) def invokeWithMetadata(functionName: String, input: JsSchemaValueTree): Either[RpcError, InvocationMetadata] = - try Right(metadata(raw.invoke(functionName, input))) + try Right(metadata(raw.invoke(functionName, input, js.undefined))) catch { case js.JavaScriptException(e) => Left(decodeRpcError(e)) } def asyncInvokeAndAwait(functionName: String, input: JsSchemaValueTree): Either[RpcError, RawFutureInvokeResult] = @@ -145,7 +145,7 @@ private[golem] object WasmRpcApi { input: JsSchemaValueTree ): Either[RpcError, (InvocationMetadata, RawFutureInvokeResult)] = try { - val value = raw.asyncInvokeAndAwait(functionName, input) + val value = raw.asyncInvokeAndAwait(functionName, input, js.undefined) Right((metadata(value.metadata), value.future)) } catch { case js.JavaScriptException(e) => Left(decodeRpcError(e)) } @@ -164,7 +164,7 @@ private[golem] object WasmRpcApi { try Right( InvocationReceipt( - metadata(raw.scheduleInvocation(datetimeToJs(datetime), functionName, input).metadata) + metadata(raw.scheduleInvocation(datetimeToJs(datetime), functionName, input, js.undefined).metadata) ) ) catch { case js.JavaScriptException(e) => Left(decodeRpcError(e)) } @@ -182,7 +182,7 @@ private[golem] object WasmRpcApi { input: JsSchemaValueTree ): Either[RpcError, CancelableInvocationReceipt] = try { - val value = raw.scheduleCancelableInvocation(datetimeToJs(datetime), functionName, input) + val value = raw.scheduleCancelableInvocation(datetimeToJs(datetime), functionName, input, js.undefined) Right(CancelableInvocationReceipt(metadata(value.metadata), CancellationToken(value.cancellationToken))) } catch { case js.JavaScriptException(e) => Left(decodeRpcError(e)) } @@ -250,18 +250,28 @@ private[golem] object WasmRpcApi { @unused phantomId: js.Any, @unused agentConfig: js.Array[JsTypedAgentConfigValue] ) extends js.Object { - def invokeAndAwait(methodName: String, input: JsSchemaValueTree): RawInvocationResultWithMetadata = js.native - def invoke(methodName: String, input: JsSchemaValueTree): RawInvocationMetadata = js.native - def asyncInvokeAndAwait(methodName: String, input: JsSchemaValueTree): RawAsyncInvocationWithMetadata = js.native + def invokeAndAwait( + methodName: String, + input: JsSchemaValueTree, + scopeCard: js.Any + ): RawInvocationResultWithMetadata = js.native + def invoke(methodName: String, input: JsSchemaValueTree, scopeCard: js.Any): RawInvocationMetadata = js.native + def asyncInvokeAndAwait( + methodName: String, + input: JsSchemaValueTree, + scopeCard: js.Any + ): RawAsyncInvocationWithMetadata = js.native def scheduleInvocation( scheduledTime: JsDatetime, methodName: String, - input: JsSchemaValueTree + input: JsSchemaValueTree, + scopeCard: js.Any ): RawScheduledInvocationReceipt = js.native def scheduleCancelableInvocation( scheduledTime: JsDatetime, methodName: String, - input: JsSchemaValueTree + input: JsSchemaValueTree, + scopeCard: js.Any ): RawCancelableScheduledInvocationReceipt = js.native } } diff --git a/sdks/scala/scripts/generate-agent-guest-wasm.sh b/sdks/scala/scripts/generate-agent-guest-wasm.sh index bb33ffa362..2047a29421 100755 --- a/sdks/scala/scripts/generate-agent-guest-wasm.sh +++ b/sdks/scala/scripts/generate-agent-guest-wasm.sh @@ -38,7 +38,6 @@ wit_dir="$sdk_root/wit" gen_dir="$sdk_root/.generated" agent_wit_root="$gen_dir/agent-wit-root" wrapper_dir="$gen_dir/agent-guest-wrapper" -out_wasm="$wrapper_dir/target/wasm32-wasip2/release/agent_guest.wasm" echo "[agent-guest] sdk_root=$sdk_root" >&2 @@ -133,12 +132,22 @@ fi # resolve a fresh lock during the build. rm -f "$wrapper_dir/Cargo.lock" -echo "[agent-guest] Building guest runtime (cargo build --target wasm32-wasip2 --release)..." >&2 if [[ -f "$HOME/.cargo/env" ]]; then # shellcheck disable=SC1091 . "$HOME/.cargo/env" fi +target_dir="$( + cd "$wrapper_dir" + rustup run stable cargo metadata --no-deps --format-version 1 | sed -n 's/.*"target_directory":"\([^"]*\)".*/\1/p' +)" +if [[ -z "$target_dir" ]]; then + echo "[agent-guest] ERROR: failed to resolve the cargo target directory" >&2 + exit 1 +fi +out_wasm="$target_dir/wasm32-wasip2/release/agent_guest.wasm" + +echo "[agent-guest] Building guest runtime (cargo build --target wasm32-wasip2 --release)..." >&2 ( cd "$wrapper_dir" && env -u ARGV0 rustup run stable cargo build --target wasm32-wasip2 --release --no-default-features --features full-p3,golem ) if [[ ! -f "$out_wasm" ]]; then diff --git a/sdks/scala/wit/deps/golem-1.x/golem-host.wit b/sdks/scala/wit/deps/golem-1.x/golem-host.wit index ac94d44384..296b14e498 100644 --- a/sdks/scala/wit/deps/golem-1.x/golem-host.wit +++ b/sdks/scala/wit/deps/golem-1.x/golem-host.wit @@ -3,7 +3,7 @@ package golem:api@1.5.0; /// The Golem host API provides low level access to Golem specific features such as promises and control over /// the durability and transactional guarantees the executor provides. interface host { - use golem:core/types@2.0.0.{component-id, card-id, uuid, agent-id, promise-id, oplog-index}; + use golem:core/types@2.0.0.{component-id, uuid, agent-id, promise-id, oplog-index}; /// Represents a Golem component's version type component-revision = u64; @@ -186,17 +186,6 @@ interface host { get: async func() -> list; } - /// Plain-data handle to a permission card visible to the guest. - record card { - card-id: card-id, - } - - enum card-install-error { - revoked, - not-found, - not-permitted, - } - /// Create a new promise create-promise: func() -> promise-id; @@ -257,15 +246,6 @@ interface host { /// to introduce idempotence. generate-idempotency-key: func() -> uuid; - /// Returns one permission card currently installed in this agent's wallet, if any. - self-card: func() -> option; - - /// Derives a card handle from an installed card. This minimal test-facing form keeps the card as plain data. - derive-card: func(card: card) -> result; - - /// Installs a card into this agent's own wallet. - install-card: func(card: card) -> result<_, card-install-error>; - /// Initiates an update attempt for the given agent. The function returns immediately once the request has been processed, /// not waiting for the agent to get updated. update-agent: func(agent-id: agent-id, target-revision: component-revision, mode: update-mode); diff --git a/sdks/scala/wit/deps/golem-agent/host.wit b/sdks/scala/wit/deps/golem-agent/host.wit index 345fa12b02..b10c052e8b 100644 --- a/sdks/scala/wit/deps/golem-agent/host.wit +++ b/sdks/scala/wit/deps/golem-agent/host.wit @@ -1,7 +1,7 @@ package golem:agent@2.0.0; interface host { - use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value}; + use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value, permission-card}; use wasi:clocks/system-clock@0.3.0.{instant as datetime}; use common.{agent-error, agent-type, registered-agent-type, typed-agent-config-value}; @@ -90,25 +90,25 @@ interface host { /// /// `input` encodes the method's parameter list. The returned result is /// `none` for a `unit` output and `some(value)` for a `single` output. - invoke-and-await: func(method-name: string, input: schema-value-tree) -> result; + invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Triggers the invocation of a remote method with the given parameters, /// and returns its final identity immediately. - invoke: func(method-name: string, input: schema-value-tree) -> result; + invoke: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Invokes a remote method with the given parameters, and returns a `future-invoke-result` value which can /// be polled for the result together with the final invocation identity. /// /// With this function it is possible to call multiple (different) agents simultaneously. - async-invoke-and-await: func(method-name: string, input: schema-value-tree) -> async-invocation-with-metadata; + async-invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> async-invocation-with-metadata; /// Schedules an invocation for later and returns its final identity. - schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> scheduled-invocation-receipt; + schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> scheduled-invocation-receipt; /// Schedules an invocation for later and returns its final identity and /// cancellation capability. Call cancel on the returned resource to /// cancel the invocation before the scheduled time. - schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> cancelable-scheduled-invocation-receipt; + schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> cancelable-scheduled-invocation-receipt; } /// Represents an asynchronous invocation result diff --git a/sdks/scala/wit/deps/golem-core-v2/golem-core-v2.wit b/sdks/scala/wit/deps/golem-core-v2/golem-core-v2.wit index bb7dda191e..a59e6e4ede 100644 --- a/sdks/scala/wit/deps/golem-core-v2/golem-core-v2.wit +++ b/sdks/scala/wit/deps/golem-core-v2/golem-core-v2.wit @@ -125,6 +125,17 @@ interface types { /// and reveal it only through capability-gated host interfaces. resource secret; + /// An unforgeable handle to a permission card held by the runtime. The + /// handle is opaque to guests: components can hold, pass, derive, install, + /// and revoke cards only through the `golem:permissions` interfaces. When + /// carried in a `schema-value-tree` (see + /// `schema-value-node::permission-card-handle`) the handle is transferred + /// by ownership; the host converts it to/from its internal trusted + /// card-store representation at the boundary. The wire form is the card-id + /// (UUID) alone — no grants, parents, or metadata cross the wire as + /// authority. + resource permission-card; + // ============================================================ // Schema graph (self-contained type carrier) // ============================================================ @@ -266,6 +277,7 @@ interface types { // --- Capability nodes --- secret-type(secret-spec), quota-token-type(quota-token-spec), + permission-card-type(permission-card-spec), // --- WASI P3 stubs (parseable only; no semantics yet) --- future-type(option), @@ -462,6 +474,13 @@ interface types { resource-name: option, } + record permission-card-spec { + /// `true` = polymorphic (carries slot variables in owner / resource-id), + /// `false` = monomorphic. Structural metadata only; authority lives in + /// the card store, not in the schema spec. + polymorphic: bool, + } + // ============================================================ // Schema value (always paired with a schema-graph) // ============================================================ @@ -524,6 +543,7 @@ interface types { // Capability nodes secret-value(own), quota-token-handle(own), + permission-card-handle(own), // WASI P3 stubs (parseable only in the schema; no constructible values). } diff --git a/sdks/scala/wit/deps/golem-permissions/derive.wit b/sdks/scala/wit/deps/golem-permissions/derive.wit new file mode 100644 index 0000000000..a1cd9f06b6 --- /dev/null +++ b/sdks/scala/wit/deps/golem-permissions/derive.wit @@ -0,0 +1,42 @@ +package golem:permissions@0.1.0; + +/// Derivation of new permission cards from an existing card or from the +/// caller's wallet. +/// +/// Derivation narrows authority: a child card's lattice is bounded by its +/// parent's lattice. The caller specifies which lower-positive and +/// upper-positive grants to retain and which lower-negative and +/// upper-negative grants to add, plus an optional lifespan. +interface derive { + use golem:core/types@2.0.0.{permission-card}; + use types.{pattern-grant, permission-error, duration}; + + /// Derive a child card from `parent`, narrowing the grant lattice. + derive: func( + parent: borrow, + lower-positive-to-retain: list, + lower-negative-to-add: list, + upper-positive-to-retain: list, + upper-negative-to-add: list, + lifespan: option, + ) -> result; + + /// Derive a card directly from the caller's wallet. + derive-from-wallet: func( + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + lifespan: option, + ) -> result; + + /// Derive an invocation-local card from one or more persistent or scope + /// parents. Scope cards are attenuated in-memory and are never persisted. + derive-scope: func( + parents: list>, + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + ) -> result; +} diff --git a/sdks/scala/wit/deps/golem-permissions/inspect.wit b/sdks/scala/wit/deps/golem-permissions/inspect.wit new file mode 100644 index 0000000000..34481974fd --- /dev/null +++ b/sdks/scala/wit/deps/golem-permissions/inspect.wit @@ -0,0 +1,14 @@ +package golem:permissions@0.1.0; + +/// Read-only inspection of a permission card's full grant lattice. +/// +/// Returns the four quadrants of the card's bound lattice +/// (lower/upper × positive/negative) as a `card-view`. Importing this +/// interface grants no authority to mutate or derive cards. +interface inspect { + use golem:core/types@2.0.0.{permission-card}; + use types.{card-view, permission-error}; + + /// Return the card's complete grant lattice. + inspect-card: func(c: borrow) -> result; +} diff --git a/sdks/scala/wit/deps/golem-permissions/kernel-introspection.wit b/sdks/scala/wit/deps/golem-permissions/kernel-introspection.wit new file mode 100644 index 0000000000..d555454b01 --- /dev/null +++ b/sdks/scala/wit/deps/golem-permissions/kernel-introspection.wit @@ -0,0 +1,20 @@ +package golem:permissions@0.1.0; + +/// Introspection of the permission kernel's registered resource classes and +/// verbs, and validation of individual grants against the kernel's schema. +interface kernel-introspection { + use types.{pattern-grant, permission-error}; + + record kernel-module { + class-name: string, + verbs: list, + } + + /// List every resource class the kernel knows about, with their + /// permitted verbs. + list-modules: func() -> list; + + /// Validate that `g` references a known class, owner, recipient, verb, + /// and resource-id pattern accepted by the kernel. + validate-grant: func(g: pattern-grant) -> result<_, permission-error>; +} diff --git a/sdks/scala/wit/deps/golem-permissions/revoke.wit b/sdks/scala/wit/deps/golem-permissions/revoke.wit new file mode 100644 index 0000000000..da2fb7975a --- /dev/null +++ b/sdks/scala/wit/deps/golem-permissions/revoke.wit @@ -0,0 +1,15 @@ +package golem:permissions@0.1.0; + +/// Revocation of a permission card and its derivation DAG subtree. +/// +/// `revoke-card` consumes the owned handle (the receiving component's +/// resource-table entry is deleted); the stored card is walked via the card +/// store's DAG descendant index. Returns the cut-subtree size. +interface revoke { + use golem:core/types@2.0.0.{permission-card}; + use types.{permission-error}; + + /// Revoke `c` and every card transitively derived from it. + /// Consumes the owned handle. + revoke-card: func(c: permission-card) -> result; +} diff --git a/sdks/scala/wit/deps/golem-permissions/types.wit b/sdks/scala/wit/deps/golem-permissions/types.wit new file mode 100644 index 0000000000..2fb749ed60 --- /dev/null +++ b/sdks/scala/wit/deps/golem-permissions/types.wit @@ -0,0 +1,82 @@ +package golem:permissions@0.1.0; + +/// The permission-card resource's shared data model and inspection operations. +/// +/// The `permission-card` capability itself is defined as a bare resource in +/// `golem:core/types` so that it can travel inside a `schema-value-tree` as an +/// opaque, unforgeable handle. This interface exposes only safe inspection +/// operations over that handle plus the records and variants the other +/// permissions interfaces reference. Components that only need to *hold and +/// pass* cards — most tools and middleware — import only this interface. +interface types { + use golem:core/types@2.0.0.{permission-card, card-id, agent-id, uuid}; + + record timestamp { + seconds: s64, + nanoseconds: u32, + } + + /// ISO-8601 duration string (e.g. `"P30D"` for 30 days). + record duration { + iso-8601: string, + } + + variant holder { + account(uuid), + app(uuid), + agent(agent-id), + } + + record pattern-grant { + class: string, + owner: string, + recipient: string, + verb: string, + resource-id: string, + } + + record card-view { + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + } + + record wallet-version-token { + /// 32 bytes — BLAKE3 of (holder-kind, holder-id). + wallet-id-hash: list, + generation: u64, + } + + variant permission-error { + not-permitted(string), + lower-bound-too-broad(string), + upper-bound-too-broad(string), + wallet-multi-source-required(string), + card-revoked(string), + card-expired(string), + install-recipient-mismatch(string), + card-polymorphic-not-usable(string), + unknown-resource-class(string), + invalid-pattern(string), + invalid-verb(string), + invalid-owner(string), + invalid-recipient(string), + } + + // --- Card inspection --- + // Free functions on a borrowed handle, because the resource itself is + // bare in core (matching secret/quota-token). + + /// Stable identifier of this card. + id: func(c: borrow) -> card-id; + + /// Parent card identifiers in the derivation DAG. + parents: func(c: borrow) -> list; + + /// Expiry timestamp, if the card has a bounded lifespan. + expires-at: func(c: borrow) -> option; + + /// `true` if the card is polymorphic (carries slot variables). + is-polymorphic: func(c: borrow) -> bool; +} diff --git a/sdks/scala/wit/deps/golem-permissions/wallet.wit b/sdks/scala/wit/deps/golem-permissions/wallet.wit new file mode 100644 index 0000000000..818d8b1538 --- /dev/null +++ b/sdks/scala/wit/deps/golem-permissions/wallet.wit @@ -0,0 +1,23 @@ +package golem:permissions@0.1.0; + +/// Wallet operations: enumerate the caller's installed cards, query the +/// wallet's version token, and install a card onto a target holder. +interface wallet { + use golem:core/types@2.0.0.{permission-card}; + use types.{permission-error, wallet-version-token, holder}; + + /// All permission cards currently installed in the caller's wallet. + self-wallet: func() -> list; + + /// Version token for the caller's wallet, changed whenever the set of + /// installed cards changes. + self-version: func() -> wallet-version-token; + + /// Install `card` onto `target`. Returns unit on success. + /// + /// Only agent targets are currently supported. Account and application + /// targets return `not-permitted("install-card currently supports only + /// agent targets")` before any wallet or oplog mutation. + install-card: func(card: permission-card, target: holder) + -> result<_, permission-error>; +} diff --git a/sdks/scala/wit/dts/golem_agent_2_0_0_host.d.ts b/sdks/scala/wit/dts/golem_agent_2_0_0_host.d.ts index 403d5252e3..c4dd281118 100644 --- a/sdks/scala/wit/dts/golem_agent_2_0_0_host.d.ts +++ b/sdks/scala/wit/dts/golem_agent_2_0_0_host.d.ts @@ -61,29 +61,29 @@ declare module 'golem:agent/host@2.0.0' { * `none` for a `unit` output and `some(value)` for a `single` output. * @throws RpcError */ - invokeAndAwait(methodName: string, input: SchemaValueTree): InvocationResultWithMetadata; + invokeAndAwait(methodName: string, input: SchemaValueTree, scopeCard: PermissionCard | undefined): InvocationResultWithMetadata; /** * Triggers the invocation of a remote method with the given parameters, * and returns its final identity immediately. * @throws RpcError */ - invoke(methodName: string, input: SchemaValueTree): InvocationMetadata; + invoke(methodName: string, input: SchemaValueTree, scopeCard: PermissionCard | undefined): InvocationMetadata; /** * Invokes a remote method with the given parameters, and returns a `future-invoke-result` value which can * be polled for the result together with the final invocation identity. * With this function it is possible to call multiple (different) agents simultaneously. */ - asyncInvokeAndAwait(methodName: string, input: SchemaValueTree): AsyncInvocationWithMetadata; + asyncInvokeAndAwait(methodName: string, input: SchemaValueTree, scopeCard: PermissionCard | undefined): AsyncInvocationWithMetadata; /** * Schedules an invocation for later and returns its final identity. */ - scheduleInvocation(scheduledTime: Datetime, methodName: string, input: SchemaValueTree): ScheduledInvocationReceipt; + scheduleInvocation(scheduledTime: Datetime, methodName: string, input: SchemaValueTree, scopeCard: PermissionCard | undefined): ScheduledInvocationReceipt; /** * Schedules an invocation for later and returns its final identity and * cancellation capability. Call cancel on the returned resource to * cancel the invocation before the scheduled time. */ - scheduleCancelableInvocation(scheduledTime: Datetime, methodName: string, input: SchemaValueTree): CancelableScheduledInvocationReceipt; + scheduleCancelableInvocation(scheduledTime: Datetime, methodName: string, input: SchemaValueTree, scopeCard: PermissionCard | undefined): CancelableScheduledInvocationReceipt; } export class FutureInvokeResult { /** @@ -109,6 +109,7 @@ declare module 'golem:agent/host@2.0.0' { export type SchemaGraph = golemCore200Types.SchemaGraph; export type SchemaValueTree = golemCore200Types.SchemaValueTree; export type TypedSchemaValue = golemCore200Types.TypedSchemaValue; + export type PermissionCard = golemCore200Types.PermissionCard; export type Datetime = wasiClocks030SystemClock.Instant; export type AgentError = golemAgent200Common.AgentError; export type AgentType = golemAgent200Common.AgentType; diff --git a/sdks/scala/wit/dts/golem_api_1_5_0_host.d.ts b/sdks/scala/wit/dts/golem_api_1_5_0_host.d.ts index 955898f23a..b86997399e 100644 --- a/sdks/scala/wit/dts/golem_api_1_5_0_host.d.ts +++ b/sdks/scala/wit/dts/golem_api_1_5_0_host.d.ts @@ -77,20 +77,6 @@ declare module 'golem:api/host@1.5.0' { * to introduce idempotence. */ export function generateIdempotencyKey(): Uuid; - /** - * Returns one permission card currently installed in this agent's wallet, if any. - */ - export function selfCard(): Card | undefined; - /** - * Derives a card handle from an installed card. This minimal test-facing form keeps the card as plain data. - * @throws string - */ - export function deriveCard(card: Card): Card; - /** - * Installs a card into this agent's own wallet. - * @throws CardInstallError - */ - export function installCard(card: Card): void; /** * Initiates an update attempt for the given agent. The function returns immediately once the request has been processed, * not waiting for the agent to get updated. @@ -160,7 +146,6 @@ declare module 'golem:api/host@1.5.0' { get(): Promise; } export type ComponentId = golemCore200Types.ComponentId; - export type CardId = golemCore200Types.CardId; export type Uuid = golemCore200Types.Uuid; export type AgentId = golemCore200Types.AgentId; export type PromiseId = golemCore200Types.PromiseId; @@ -345,13 +330,6 @@ declare module 'golem:api/host@1.5.0' { tag: 'forked' val: ForkDetails }; - /** - * Plain-data handle to a permission card visible to the guest. - */ - export type Card = { - cardId: CardId; - }; - export type CardInstallError = "revoked" | "not-found" | "not-permitted"; /** * Snapshot payload */ @@ -359,5 +337,4 @@ declare module 'golem:api/host@1.5.0' { payload: Uint8Array; mimeType: string; }; - export type Result = { tag: 'ok', val: T } | { tag: 'err', val: E }; } diff --git a/sdks/scala/wit/dts/golem_core_2_0_0_types.d.ts b/sdks/scala/wit/dts/golem_core_2_0_0_types.d.ts index 23592a9b00..ce366223bc 100644 --- a/sdks/scala/wit/dts/golem_core_2_0_0_types.d.ts +++ b/sdks/scala/wit/dts/golem_core_2_0_0_types.d.ts @@ -12,6 +12,8 @@ declare module 'golem:core/types@2.0.0' { } export class Secret { } + export class PermissionCard { + } /** * ============================================================ * Carrier indices @@ -360,6 +362,14 @@ declare module 'golem:core/types@2.0.0' { */ resourceName?: string; }; + export type PermissionCardSpec = { + /** + * `true` = polymorphic (carries slot variables in owner / resource-id), + * `false` = monomorphic. Structural metadata only; authority lives in + * the card store, not in the schema spec. + */ + polymorphic: boolean; + }; /** * The structural body of a `schema-type-node`. * Closed sum types come in two shapes that differ by how the decoder @@ -516,6 +526,10 @@ declare module 'golem:core/types@2.0.0' { tag: 'quota-token-type' val: QuotaTokenSpec } | + { + tag: 'permission-card-type' + val: PermissionCardSpec + } | /** --- WASI P3 stubs (parseable only; no semantics yet) --- */ { tag: 'future-type' @@ -751,6 +765,10 @@ declare module 'golem:core/types@2.0.0' { { tag: 'quota-token-handle' val: QuotaToken + } | + { + tag: 'permission-card-handle' + val: PermissionCard }; /** * ============================================================ diff --git a/sdks/ts/packages/golem-ts-sdk/src/bridge/agent.ts b/sdks/ts/packages/golem-ts-sdk/src/bridge/agent.ts index a1cb60163d..8d8828ee46 100644 --- a/sdks/ts/packages/golem-ts-sdk/src/bridge/agent.ts +++ b/sdks/ts/packages/golem-ts-sdk/src/bridge/agent.ts @@ -100,7 +100,7 @@ export function resolveRemoteAgent( signal?: AbortSignal, ): Promise => { throwIfAborted(signal); - const invocation = rpc.asyncInvokeAndAwait(method, schemaValueToWit(params)); + const invocation = rpc.asyncInvokeAndAwait(method, schemaValueToWit(params), undefined); const future = invocation.future; let result; try { @@ -128,23 +128,23 @@ export function resolveRemoteAgent( (await awaitInvocation(method, params, signal)).value, invokeAndAwaitWithMetadata: awaitInvocation, invoke(method, params) { - rpc.invoke(method, schemaValueToWit(params)); + rpc.invoke(method, schemaValueToWit(params), undefined); }, invokeWithMetadata(method, params) { - return rpc.invoke(method, schemaValueToWit(params)); + return rpc.invoke(method, schemaValueToWit(params), undefined); }, schedule(at, method, params) { - rpc.scheduleInvocation(at, method, schemaValueToWit(params)); + rpc.scheduleInvocation(at, method, schemaValueToWit(params), undefined); }, scheduleWithMetadata(at, method, params) { - return rpc.scheduleInvocation(at, method, schemaValueToWit(params)); + return rpc.scheduleInvocation(at, method, schemaValueToWit(params), undefined); }, scheduleCancelable(at, method, params) { - return rpc.scheduleCancelableInvocation(at, method, schemaValueToWit(params)) + return rpc.scheduleCancelableInvocation(at, method, schemaValueToWit(params), undefined) .cancellationToken; }, scheduleCancelableWithMetadata(at, method, params) { - return rpc.scheduleCancelableInvocation(at, method, schemaValueToWit(params)); + return rpc.scheduleCancelableInvocation(at, method, schemaValueToWit(params), undefined); }, }; } diff --git a/sdks/ts/packages/golem-ts-sdk/tests/bridge.test.ts b/sdks/ts/packages/golem-ts-sdk/tests/bridge.test.ts index 0256487232..28ee3a254c 100644 --- a/sdks/ts/packages/golem-ts-sdk/tests/bridge.test.ts +++ b/sdks/ts/packages/golem-ts-sdk/tests/bridge.test.ts @@ -700,7 +700,7 @@ describe('public bridge runtime', () => { const at = { seconds: 1n, nanoseconds: 0 }; expect(remote.scheduleWithMetadata(at, 'run', bridge.v.tuple([]))).toBe(receipt); - expect(rpc.scheduleInvocation).toHaveBeenCalledWith(at, 'run', expect.anything()); + expect(rpc.scheduleInvocation).toHaveBeenCalledWith(at, 'run', expect.anything(), undefined); }); it('returns unit output from an awaited agent invocation', async () => { diff --git a/sdks/ts/packages/golem-ts-sdk/types/golem_agent_2_0_0_host.d.ts b/sdks/ts/packages/golem-ts-sdk/types/golem_agent_2_0_0_host.d.ts index 403d5252e3..c4dd281118 100644 --- a/sdks/ts/packages/golem-ts-sdk/types/golem_agent_2_0_0_host.d.ts +++ b/sdks/ts/packages/golem-ts-sdk/types/golem_agent_2_0_0_host.d.ts @@ -61,29 +61,29 @@ declare module 'golem:agent/host@2.0.0' { * `none` for a `unit` output and `some(value)` for a `single` output. * @throws RpcError */ - invokeAndAwait(methodName: string, input: SchemaValueTree): InvocationResultWithMetadata; + invokeAndAwait(methodName: string, input: SchemaValueTree, scopeCard: PermissionCard | undefined): InvocationResultWithMetadata; /** * Triggers the invocation of a remote method with the given parameters, * and returns its final identity immediately. * @throws RpcError */ - invoke(methodName: string, input: SchemaValueTree): InvocationMetadata; + invoke(methodName: string, input: SchemaValueTree, scopeCard: PermissionCard | undefined): InvocationMetadata; /** * Invokes a remote method with the given parameters, and returns a `future-invoke-result` value which can * be polled for the result together with the final invocation identity. * With this function it is possible to call multiple (different) agents simultaneously. */ - asyncInvokeAndAwait(methodName: string, input: SchemaValueTree): AsyncInvocationWithMetadata; + asyncInvokeAndAwait(methodName: string, input: SchemaValueTree, scopeCard: PermissionCard | undefined): AsyncInvocationWithMetadata; /** * Schedules an invocation for later and returns its final identity. */ - scheduleInvocation(scheduledTime: Datetime, methodName: string, input: SchemaValueTree): ScheduledInvocationReceipt; + scheduleInvocation(scheduledTime: Datetime, methodName: string, input: SchemaValueTree, scopeCard: PermissionCard | undefined): ScheduledInvocationReceipt; /** * Schedules an invocation for later and returns its final identity and * cancellation capability. Call cancel on the returned resource to * cancel the invocation before the scheduled time. */ - scheduleCancelableInvocation(scheduledTime: Datetime, methodName: string, input: SchemaValueTree): CancelableScheduledInvocationReceipt; + scheduleCancelableInvocation(scheduledTime: Datetime, methodName: string, input: SchemaValueTree, scopeCard: PermissionCard | undefined): CancelableScheduledInvocationReceipt; } export class FutureInvokeResult { /** @@ -109,6 +109,7 @@ declare module 'golem:agent/host@2.0.0' { export type SchemaGraph = golemCore200Types.SchemaGraph; export type SchemaValueTree = golemCore200Types.SchemaValueTree; export type TypedSchemaValue = golemCore200Types.TypedSchemaValue; + export type PermissionCard = golemCore200Types.PermissionCard; export type Datetime = wasiClocks030SystemClock.Instant; export type AgentError = golemAgent200Common.AgentError; export type AgentType = golemAgent200Common.AgentType; diff --git a/sdks/ts/packages/golem-ts-sdk/types/golem_api_1_5_0_host.d.ts b/sdks/ts/packages/golem-ts-sdk/types/golem_api_1_5_0_host.d.ts index 955898f23a..b86997399e 100644 --- a/sdks/ts/packages/golem-ts-sdk/types/golem_api_1_5_0_host.d.ts +++ b/sdks/ts/packages/golem-ts-sdk/types/golem_api_1_5_0_host.d.ts @@ -77,20 +77,6 @@ declare module 'golem:api/host@1.5.0' { * to introduce idempotence. */ export function generateIdempotencyKey(): Uuid; - /** - * Returns one permission card currently installed in this agent's wallet, if any. - */ - export function selfCard(): Card | undefined; - /** - * Derives a card handle from an installed card. This minimal test-facing form keeps the card as plain data. - * @throws string - */ - export function deriveCard(card: Card): Card; - /** - * Installs a card into this agent's own wallet. - * @throws CardInstallError - */ - export function installCard(card: Card): void; /** * Initiates an update attempt for the given agent. The function returns immediately once the request has been processed, * not waiting for the agent to get updated. @@ -160,7 +146,6 @@ declare module 'golem:api/host@1.5.0' { get(): Promise; } export type ComponentId = golemCore200Types.ComponentId; - export type CardId = golemCore200Types.CardId; export type Uuid = golemCore200Types.Uuid; export type AgentId = golemCore200Types.AgentId; export type PromiseId = golemCore200Types.PromiseId; @@ -345,13 +330,6 @@ declare module 'golem:api/host@1.5.0' { tag: 'forked' val: ForkDetails }; - /** - * Plain-data handle to a permission card visible to the guest. - */ - export type Card = { - cardId: CardId; - }; - export type CardInstallError = "revoked" | "not-found" | "not-permitted"; /** * Snapshot payload */ @@ -359,5 +337,4 @@ declare module 'golem:api/host@1.5.0' { payload: Uint8Array; mimeType: string; }; - export type Result = { tag: 'ok', val: T } | { tag: 'err', val: E }; } diff --git a/sdks/ts/packages/golem-ts-sdk/types/golem_core_2_0_0_types.d.ts b/sdks/ts/packages/golem-ts-sdk/types/golem_core_2_0_0_types.d.ts index 23592a9b00..ce366223bc 100644 --- a/sdks/ts/packages/golem-ts-sdk/types/golem_core_2_0_0_types.d.ts +++ b/sdks/ts/packages/golem-ts-sdk/types/golem_core_2_0_0_types.d.ts @@ -12,6 +12,8 @@ declare module 'golem:core/types@2.0.0' { } export class Secret { } + export class PermissionCard { + } /** * ============================================================ * Carrier indices @@ -360,6 +362,14 @@ declare module 'golem:core/types@2.0.0' { */ resourceName?: string; }; + export type PermissionCardSpec = { + /** + * `true` = polymorphic (carries slot variables in owner / resource-id), + * `false` = monomorphic. Structural metadata only; authority lives in + * the card store, not in the schema spec. + */ + polymorphic: boolean; + }; /** * The structural body of a `schema-type-node`. * Closed sum types come in two shapes that differ by how the decoder @@ -516,6 +526,10 @@ declare module 'golem:core/types@2.0.0' { tag: 'quota-token-type' val: QuotaTokenSpec } | + { + tag: 'permission-card-type' + val: PermissionCardSpec + } | /** --- WASI P3 stubs (parseable only; no semantics yet) --- */ { tag: 'future-type' @@ -751,6 +765,10 @@ declare module 'golem:core/types@2.0.0' { { tag: 'quota-token-handle' val: QuotaToken + } | + { + tag: 'permission-card-handle' + val: PermissionCard }; /** * ============================================================ diff --git a/sdks/ts/wit/deps/golem-1.x/golem-host.wit b/sdks/ts/wit/deps/golem-1.x/golem-host.wit index ac94d44384..296b14e498 100644 --- a/sdks/ts/wit/deps/golem-1.x/golem-host.wit +++ b/sdks/ts/wit/deps/golem-1.x/golem-host.wit @@ -3,7 +3,7 @@ package golem:api@1.5.0; /// The Golem host API provides low level access to Golem specific features such as promises and control over /// the durability and transactional guarantees the executor provides. interface host { - use golem:core/types@2.0.0.{component-id, card-id, uuid, agent-id, promise-id, oplog-index}; + use golem:core/types@2.0.0.{component-id, uuid, agent-id, promise-id, oplog-index}; /// Represents a Golem component's version type component-revision = u64; @@ -186,17 +186,6 @@ interface host { get: async func() -> list; } - /// Plain-data handle to a permission card visible to the guest. - record card { - card-id: card-id, - } - - enum card-install-error { - revoked, - not-found, - not-permitted, - } - /// Create a new promise create-promise: func() -> promise-id; @@ -257,15 +246,6 @@ interface host { /// to introduce idempotence. generate-idempotency-key: func() -> uuid; - /// Returns one permission card currently installed in this agent's wallet, if any. - self-card: func() -> option; - - /// Derives a card handle from an installed card. This minimal test-facing form keeps the card as plain data. - derive-card: func(card: card) -> result; - - /// Installs a card into this agent's own wallet. - install-card: func(card: card) -> result<_, card-install-error>; - /// Initiates an update attempt for the given agent. The function returns immediately once the request has been processed, /// not waiting for the agent to get updated. update-agent: func(agent-id: agent-id, target-revision: component-revision, mode: update-mode); diff --git a/sdks/ts/wit/deps/golem-agent/host.wit b/sdks/ts/wit/deps/golem-agent/host.wit index 345fa12b02..b10c052e8b 100644 --- a/sdks/ts/wit/deps/golem-agent/host.wit +++ b/sdks/ts/wit/deps/golem-agent/host.wit @@ -1,7 +1,7 @@ package golem:agent@2.0.0; interface host { - use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value}; + use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value, permission-card}; use wasi:clocks/system-clock@0.3.0.{instant as datetime}; use common.{agent-error, agent-type, registered-agent-type, typed-agent-config-value}; @@ -90,25 +90,25 @@ interface host { /// /// `input` encodes the method's parameter list. The returned result is /// `none` for a `unit` output and `some(value)` for a `single` output. - invoke-and-await: func(method-name: string, input: schema-value-tree) -> result; + invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Triggers the invocation of a remote method with the given parameters, /// and returns its final identity immediately. - invoke: func(method-name: string, input: schema-value-tree) -> result; + invoke: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Invokes a remote method with the given parameters, and returns a `future-invoke-result` value which can /// be polled for the result together with the final invocation identity. /// /// With this function it is possible to call multiple (different) agents simultaneously. - async-invoke-and-await: func(method-name: string, input: schema-value-tree) -> async-invocation-with-metadata; + async-invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> async-invocation-with-metadata; /// Schedules an invocation for later and returns its final identity. - schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> scheduled-invocation-receipt; + schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> scheduled-invocation-receipt; /// Schedules an invocation for later and returns its final identity and /// cancellation capability. Call cancel on the returned resource to /// cancel the invocation before the scheduled time. - schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> cancelable-scheduled-invocation-receipt; + schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> cancelable-scheduled-invocation-receipt; } /// Represents an asynchronous invocation result diff --git a/sdks/ts/wit/deps/golem-core-v2/golem-core-v2.wit b/sdks/ts/wit/deps/golem-core-v2/golem-core-v2.wit index bb7dda191e..a59e6e4ede 100644 --- a/sdks/ts/wit/deps/golem-core-v2/golem-core-v2.wit +++ b/sdks/ts/wit/deps/golem-core-v2/golem-core-v2.wit @@ -125,6 +125,17 @@ interface types { /// and reveal it only through capability-gated host interfaces. resource secret; + /// An unforgeable handle to a permission card held by the runtime. The + /// handle is opaque to guests: components can hold, pass, derive, install, + /// and revoke cards only through the `golem:permissions` interfaces. When + /// carried in a `schema-value-tree` (see + /// `schema-value-node::permission-card-handle`) the handle is transferred + /// by ownership; the host converts it to/from its internal trusted + /// card-store representation at the boundary. The wire form is the card-id + /// (UUID) alone — no grants, parents, or metadata cross the wire as + /// authority. + resource permission-card; + // ============================================================ // Schema graph (self-contained type carrier) // ============================================================ @@ -266,6 +277,7 @@ interface types { // --- Capability nodes --- secret-type(secret-spec), quota-token-type(quota-token-spec), + permission-card-type(permission-card-spec), // --- WASI P3 stubs (parseable only; no semantics yet) --- future-type(option), @@ -462,6 +474,13 @@ interface types { resource-name: option, } + record permission-card-spec { + /// `true` = polymorphic (carries slot variables in owner / resource-id), + /// `false` = monomorphic. Structural metadata only; authority lives in + /// the card store, not in the schema spec. + polymorphic: bool, + } + // ============================================================ // Schema value (always paired with a schema-graph) // ============================================================ @@ -524,6 +543,7 @@ interface types { // Capability nodes secret-value(own), quota-token-handle(own), + permission-card-handle(own), // WASI P3 stubs (parseable only in the schema; no constructible values). } diff --git a/sdks/ts/wit/deps/golem-permissions/derive.wit b/sdks/ts/wit/deps/golem-permissions/derive.wit new file mode 100644 index 0000000000..a1cd9f06b6 --- /dev/null +++ b/sdks/ts/wit/deps/golem-permissions/derive.wit @@ -0,0 +1,42 @@ +package golem:permissions@0.1.0; + +/// Derivation of new permission cards from an existing card or from the +/// caller's wallet. +/// +/// Derivation narrows authority: a child card's lattice is bounded by its +/// parent's lattice. The caller specifies which lower-positive and +/// upper-positive grants to retain and which lower-negative and +/// upper-negative grants to add, plus an optional lifespan. +interface derive { + use golem:core/types@2.0.0.{permission-card}; + use types.{pattern-grant, permission-error, duration}; + + /// Derive a child card from `parent`, narrowing the grant lattice. + derive: func( + parent: borrow, + lower-positive-to-retain: list, + lower-negative-to-add: list, + upper-positive-to-retain: list, + upper-negative-to-add: list, + lifespan: option, + ) -> result; + + /// Derive a card directly from the caller's wallet. + derive-from-wallet: func( + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + lifespan: option, + ) -> result; + + /// Derive an invocation-local card from one or more persistent or scope + /// parents. Scope cards are attenuated in-memory and are never persisted. + derive-scope: func( + parents: list>, + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + ) -> result; +} diff --git a/sdks/ts/wit/deps/golem-permissions/inspect.wit b/sdks/ts/wit/deps/golem-permissions/inspect.wit new file mode 100644 index 0000000000..34481974fd --- /dev/null +++ b/sdks/ts/wit/deps/golem-permissions/inspect.wit @@ -0,0 +1,14 @@ +package golem:permissions@0.1.0; + +/// Read-only inspection of a permission card's full grant lattice. +/// +/// Returns the four quadrants of the card's bound lattice +/// (lower/upper × positive/negative) as a `card-view`. Importing this +/// interface grants no authority to mutate or derive cards. +interface inspect { + use golem:core/types@2.0.0.{permission-card}; + use types.{card-view, permission-error}; + + /// Return the card's complete grant lattice. + inspect-card: func(c: borrow) -> result; +} diff --git a/sdks/ts/wit/deps/golem-permissions/kernel-introspection.wit b/sdks/ts/wit/deps/golem-permissions/kernel-introspection.wit new file mode 100644 index 0000000000..d555454b01 --- /dev/null +++ b/sdks/ts/wit/deps/golem-permissions/kernel-introspection.wit @@ -0,0 +1,20 @@ +package golem:permissions@0.1.0; + +/// Introspection of the permission kernel's registered resource classes and +/// verbs, and validation of individual grants against the kernel's schema. +interface kernel-introspection { + use types.{pattern-grant, permission-error}; + + record kernel-module { + class-name: string, + verbs: list, + } + + /// List every resource class the kernel knows about, with their + /// permitted verbs. + list-modules: func() -> list; + + /// Validate that `g` references a known class, owner, recipient, verb, + /// and resource-id pattern accepted by the kernel. + validate-grant: func(g: pattern-grant) -> result<_, permission-error>; +} diff --git a/sdks/ts/wit/deps/golem-permissions/revoke.wit b/sdks/ts/wit/deps/golem-permissions/revoke.wit new file mode 100644 index 0000000000..da2fb7975a --- /dev/null +++ b/sdks/ts/wit/deps/golem-permissions/revoke.wit @@ -0,0 +1,15 @@ +package golem:permissions@0.1.0; + +/// Revocation of a permission card and its derivation DAG subtree. +/// +/// `revoke-card` consumes the owned handle (the receiving component's +/// resource-table entry is deleted); the stored card is walked via the card +/// store's DAG descendant index. Returns the cut-subtree size. +interface revoke { + use golem:core/types@2.0.0.{permission-card}; + use types.{permission-error}; + + /// Revoke `c` and every card transitively derived from it. + /// Consumes the owned handle. + revoke-card: func(c: permission-card) -> result; +} diff --git a/sdks/ts/wit/deps/golem-permissions/types.wit b/sdks/ts/wit/deps/golem-permissions/types.wit new file mode 100644 index 0000000000..2fb749ed60 --- /dev/null +++ b/sdks/ts/wit/deps/golem-permissions/types.wit @@ -0,0 +1,82 @@ +package golem:permissions@0.1.0; + +/// The permission-card resource's shared data model and inspection operations. +/// +/// The `permission-card` capability itself is defined as a bare resource in +/// `golem:core/types` so that it can travel inside a `schema-value-tree` as an +/// opaque, unforgeable handle. This interface exposes only safe inspection +/// operations over that handle plus the records and variants the other +/// permissions interfaces reference. Components that only need to *hold and +/// pass* cards — most tools and middleware — import only this interface. +interface types { + use golem:core/types@2.0.0.{permission-card, card-id, agent-id, uuid}; + + record timestamp { + seconds: s64, + nanoseconds: u32, + } + + /// ISO-8601 duration string (e.g. `"P30D"` for 30 days). + record duration { + iso-8601: string, + } + + variant holder { + account(uuid), + app(uuid), + agent(agent-id), + } + + record pattern-grant { + class: string, + owner: string, + recipient: string, + verb: string, + resource-id: string, + } + + record card-view { + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + } + + record wallet-version-token { + /// 32 bytes — BLAKE3 of (holder-kind, holder-id). + wallet-id-hash: list, + generation: u64, + } + + variant permission-error { + not-permitted(string), + lower-bound-too-broad(string), + upper-bound-too-broad(string), + wallet-multi-source-required(string), + card-revoked(string), + card-expired(string), + install-recipient-mismatch(string), + card-polymorphic-not-usable(string), + unknown-resource-class(string), + invalid-pattern(string), + invalid-verb(string), + invalid-owner(string), + invalid-recipient(string), + } + + // --- Card inspection --- + // Free functions on a borrowed handle, because the resource itself is + // bare in core (matching secret/quota-token). + + /// Stable identifier of this card. + id: func(c: borrow) -> card-id; + + /// Parent card identifiers in the derivation DAG. + parents: func(c: borrow) -> list; + + /// Expiry timestamp, if the card has a bounded lifespan. + expires-at: func(c: borrow) -> option; + + /// `true` if the card is polymorphic (carries slot variables). + is-polymorphic: func(c: borrow) -> bool; +} diff --git a/sdks/ts/wit/deps/golem-permissions/wallet.wit b/sdks/ts/wit/deps/golem-permissions/wallet.wit new file mode 100644 index 0000000000..818d8b1538 --- /dev/null +++ b/sdks/ts/wit/deps/golem-permissions/wallet.wit @@ -0,0 +1,23 @@ +package golem:permissions@0.1.0; + +/// Wallet operations: enumerate the caller's installed cards, query the +/// wallet's version token, and install a card onto a target holder. +interface wallet { + use golem:core/types@2.0.0.{permission-card}; + use types.{permission-error, wallet-version-token, holder}; + + /// All permission cards currently installed in the caller's wallet. + self-wallet: func() -> list; + + /// Version token for the caller's wallet, changed whenever the set of + /// installed cards changes. + self-version: func() -> wallet-version-token; + + /// Install `card` onto `target`. Returns unit on success. + /// + /// Only agent targets are currently supported. Account and application + /// targets return `not-permitted("install-card currently supports only + /// agent targets")` before any wallet or oplog mutation. + install-card: func(card: permission-card, target: holder) + -> result<_, permission-error>; +} diff --git a/test-components/agent-counters/Cargo.lock b/test-components/agent-counters/Cargo.lock index 058d5fc560..13d30de6e9 100644 --- a/test-components/agent-counters/Cargo.lock +++ b/test-components/agent-counters/Cargo.lock @@ -34,7 +34,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -92,9 +92,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -189,13 +189,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -215,9 +215,9 @@ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -421,9 +421,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -854,7 +854,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -928,9 +928,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -965,7 +965,7 @@ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1001,9 +1001,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/test-components/agent-invocation-context/Cargo.lock b/test-components/agent-invocation-context/Cargo.lock index 5ad31e3e3e..3209d5b328 100644 --- a/test-components/agent-invocation-context/Cargo.lock +++ b/test-components/agent-invocation-context/Cargo.lock @@ -34,7 +34,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -92,9 +92,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -189,13 +189,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -215,9 +215,9 @@ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -460,9 +460,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -882,7 +882,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -956,9 +956,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -993,7 +993,7 @@ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1029,9 +1029,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/test-components/agent-rpc/golem-it-agent-rpc-rust/Cargo.lock b/test-components/agent-rpc/golem-it-agent-rpc-rust/Cargo.lock index c53529fbf8..537cf1048e 100644 --- a/test-components/agent-rpc/golem-it-agent-rpc-rust/Cargo.lock +++ b/test-components/agent-rpc/golem-it-agent-rpc-rust/Cargo.lock @@ -34,7 +34,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -92,9 +92,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -189,13 +189,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -215,9 +215,9 @@ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -459,9 +459,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -891,7 +891,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -965,9 +965,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -1002,7 +1002,7 @@ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1038,9 +1038,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/test-components/agent-rpc/golem-it-agent-rpc-rust/src/lib.rs b/test-components/agent-rpc/golem-it-agent-rpc-rust/src/lib.rs index e559b77114..cc2e4c86cc 100644 --- a/test-components/agent-rpc/golem-it-agent-rpc-rust/src/lib.rs +++ b/test-components/agent-rpc/golem-it-agent-rpc-rust/src/lib.rs @@ -556,7 +556,7 @@ impl RpcAuthTester for RpcAuthTesterImpl { let arg = encode_single_parameter(1u64); - match rpc.invoke_and_await("inc_by", arg) { + match rpc.invoke_and_await("inc_by", arg, None) { Ok(_) => RpcCallOutcome::Ok, Err(e) => RpcCallOutcome::from(e), } @@ -574,7 +574,9 @@ impl CancelTester for CancelTesterImpl { let wasm_rpc = WasmRpc::new("RpcCounter", constructor_data, None, Vec::new()); let input = encode_single_parameter(1u64); - let future = wasm_rpc.async_invoke_and_await("inc_by", input).future; + let future = wasm_rpc + .async_invoke_and_await("inc_by", input, None) + .future; // Cancel immediately before polling/awaiting future.cancel(); @@ -588,7 +590,9 @@ impl CancelTester for CancelTesterImpl { // First, call inc_by to increment the counter let input = encode_single_parameter(5u64); - let future = wasm_rpc.async_invoke_and_await("inc_by", input).future; + let future = wasm_rpc + .async_invoke_and_await("inc_by", input, None) + .future; // Wait for completion. The P3 Golem WIT replaced `subscribe()`/pollable // polling of `future-invoke-result` with an `async get()`, so we just diff --git a/test-components/agent-sdk-rust/Cargo.lock b/test-components/agent-sdk-rust/Cargo.lock index d5d307ad5f..524f1f78b6 100644 --- a/test-components/agent-sdk-rust/Cargo.lock +++ b/test-components/agent-sdk-rust/Cargo.lock @@ -34,7 +34,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -92,9 +92,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -189,13 +189,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -215,9 +215,9 @@ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -464,9 +464,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -896,7 +896,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -970,9 +970,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -1007,7 +1007,7 @@ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1043,9 +1043,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/test-components/agent-updates-v1/Cargo.lock b/test-components/agent-updates-v1/Cargo.lock index 5a458d1db0..32a71aee47 100644 --- a/test-components/agent-updates-v1/Cargo.lock +++ b/test-components/agent-updates-v1/Cargo.lock @@ -34,7 +34,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -92,9 +92,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -189,13 +189,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -215,9 +215,9 @@ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -448,9 +448,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -881,7 +881,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -955,9 +955,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -992,7 +992,7 @@ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1028,9 +1028,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/test-components/agent-updates-v2/Cargo.lock b/test-components/agent-updates-v2/Cargo.lock index 5a458d1db0..32a71aee47 100644 --- a/test-components/agent-updates-v2/Cargo.lock +++ b/test-components/agent-updates-v2/Cargo.lock @@ -34,7 +34,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -92,9 +92,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -189,13 +189,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -215,9 +215,9 @@ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -448,9 +448,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -881,7 +881,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -955,9 +955,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -992,7 +992,7 @@ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1028,9 +1028,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/test-components/host-api-tests/Cargo.lock b/test-components/host-api-tests/Cargo.lock index 6db52c293a..53c2487d06 100644 --- a/test-components/host-api-tests/Cargo.lock +++ b/test-components/host-api-tests/Cargo.lock @@ -34,7 +34,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -92,9 +92,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -195,13 +195,13 @@ checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -221,9 +221,9 @@ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -521,9 +521,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -1035,7 +1035,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1109,9 +1109,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -1146,7 +1146,7 @@ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1212,9 +1212,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/test-components/host-api-tests/src/golem_host_api.rs b/test-components/host-api-tests/src/golem_host_api.rs index 97e69cd0c8..8a4aaeaef3 100644 --- a/test-components/host-api-tests/src/golem_host_api.rs +++ b/test-components/host-api-tests/src/golem_host_api.rs @@ -8,14 +8,13 @@ use golem_rust::retry::{ use golem_rust::wasip3::http::{client, types}; use golem_rust::wasip3::{wit_future, wit_stream}; use golem_rust::{ - AgentAnyFilter, AgentId, AgentMetadata, Card, CardId, Checkpoint, CheckpointResultExt, - ComponentId, ForkResult, FromSchema, GetAgents, IntoSchema, PersistenceLevel, PromiseId, - Schema, Transaction, UpdateMode, Uuid, agent_definition, agent_implementation, atomically, - atomically_async, derive_card, fallible_transaction, fork, generate_idempotency_key, - get_agent_metadata, get_oplog_index, get_promise, get_self_metadata, golem_operation, - infallible_transaction, install_card, oplog_commit, resolve_agent_id, resolve_agent_id_strict, - resolve_component_id, self_card, set_oplog_index, update_agent, use_idempotence_mode, - with_persistence_level, with_persistence_level_async, + AgentAnyFilter, AgentId, AgentMetadata, Checkpoint, CheckpointResultExt, ComponentId, + ForkResult, FromSchema, GetAgents, IntoSchema, PersistenceLevel, PromiseId, Transaction, + UpdateMode, Uuid, agent_definition, agent_implementation, atomically, atomically_async, + fallible_transaction, fork, generate_idempotency_key, get_agent_metadata, get_oplog_index, + get_promise, get_self_metadata, golem_operation, infallible_transaction, oplog_commit, + resolve_agent_id, resolve_agent_id_strict, resolve_component_id, set_oplog_index, update_agent, + use_idempotence_mode, with_persistence_level, with_persistence_level_async, }; use serde::{Deserialize, Serialize}; use std::future::poll_fn; @@ -29,20 +28,6 @@ pub struct ResolveComponentResult { pub strict_worker_found: bool, } -#[derive(Clone, Schema, Serialize, Deserialize)] -pub struct CardApiResult { - pub self_card_found: bool, - pub derive_succeeded: bool, - pub install_succeeded: bool, - pub self_card_found_after_install: bool, -} - -#[derive(Clone, Schema, Serialize, Deserialize)] -pub struct MidInvocationCardRevocationResult { - pub release_observed: bool, - pub derive_succeeded: bool, -} - #[agent_definition()] pub trait GolemHostApi { fn new(name: String) -> Self; @@ -75,15 +60,6 @@ pub trait GolemHostApi { fn get_worker_metadata(&self, agent_id: AgentId) -> Option; fn update_worker(&self, agent_id: AgentId, component_revision: u64, update_mode: UpdateMode); fn generate_idempotency_keys(&self) -> (Uuid, Uuid); - fn card_api_roundtrip(&self) -> CardApiResult; - fn install_card_by_id(&self, high_bits: u64, low_bits: u64) -> bool; - fn derive_card_by_id(&self, high_bits: u64, low_bits: u64) -> bool; - async fn derive_card_after_promise( - &self, - high_bits: u64, - low_bits: u64, - release: PromiseId, - ) -> MidInvocationCardRevocationResult; fn list_retry_policy_names(&self) -> Vec; fn get_retry_policy_count(&self) -> u64; @@ -538,70 +514,6 @@ impl GolemHostApi for GolemHostApiImpl { (key1, key2) } - fn card_api_roundtrip(&self) -> CardApiResult { - let Some(card) = self_card() else { - return CardApiResult { - self_card_found: false, - derive_succeeded: false, - install_succeeded: false, - self_card_found_after_install: false, - }; - }; - - let derived = derive_card(card); - let derive_succeeded = derived.is_ok(); - let install_succeeded = match derived { - Ok(card) => install_card(card).is_ok(), - Err(_) => false, - }; - - CardApiResult { - self_card_found: true, - derive_succeeded, - install_succeeded, - self_card_found_after_install: self_card().is_some(), - } - } - - fn install_card_by_id(&self, high_bits: u64, low_bits: u64) -> bool { - install_card(Card { - card_id: CardId { - uuid: Uuid::from_u64_pair(high_bits, low_bits), - }, - }) - .is_ok() - } - - fn derive_card_by_id(&self, high_bits: u64, low_bits: u64) -> bool { - derive_card(Card { - card_id: CardId { - uuid: Uuid::from_u64_pair(high_bits, low_bits), - }, - }) - .is_ok() - } - - async fn derive_card_after_promise( - &self, - high_bits: u64, - low_bits: u64, - release: PromiseId, - ) -> MidInvocationCardRevocationResult { - let release = get_promise(&release); - let _ = golem_rust::wasip3::random::random::get_random_bytes(4); - let _ = release.get().await; - - for _ in 0..200 { - let _ = golem_rust::wasip3::random::random::get_random_bytes(4); - golem_rust::wasip3::clocks::monotonic_clock::wait_for(50_000_000).await; - } - - MidInvocationCardRevocationResult { - release_observed: true, - derive_succeeded: self.derive_card_by_id(high_bits, low_bits), - } - } - fn list_retry_policy_names(&self) -> Vec { let mut names: Vec = get_retry_policies().into_iter().map(|p| p.name).collect(); names.sort(); diff --git a/test-components/host-api-tests/src/snapshot_card_recovery.rs b/test-components/host-api-tests/src/snapshot_card_recovery.rs index 839225d4f3..2c2cacf161 100644 --- a/test-components/host-api-tests/src/snapshot_card_recovery.rs +++ b/test-components/host-api-tests/src/snapshot_card_recovery.rs @@ -1,47 +1,374 @@ +use golem_rust::bindings::golem::agent::host::{Datetime, RpcError, WasmRpc}; +use golem_rust::bindings::golem::permissions::{derive, inspect, revoke, types, wallet}; +use golem_rust::schema::wit::wire::{AgentId as WireAgentId, PermissionCard}; use golem_rust::{ - Card, CardId, Uuid, agent_definition, agent_implementation, derive_card, install_card, + CardId, ComponentId, FromSchema, IntoSchema, PromiseId, SchemaValue, agent_definition, + agent_implementation, await_promise, create_promise, decode_schema_value, encode_schema_value, }; -#[agent_definition(snapshotting = "enabled")] -pub trait SnapshotCardRecoveryAgent { - fn new() -> Self; +fn encode_parameters(values: Vec) -> golem_rust::schema::wit::wire::SchemaValueTree { + encode_schema_value(&SchemaValue::Record { fields: values }) + .expect("failed to encode RPC parameters") +} + +fn parent_card() -> golem_rust::schema::wit::wire::PermissionCard { + wallet::self_wallet() + .into_iter() + .find(|card| types::is_polymorphic(card)) + .expect("scope-card test parent is not installed") +} + +fn is_inspect_grant(grant: &types::PatternGrant) -> bool { + grant.class == "card" && grant.verb == "inspect" && grant.resource_id == "*" +} + +fn retained_inspect_grant(card: &PermissionCard) -> types::PatternGrant { + inspect::inspect_card(card) + .expect("failed to inspect parent card") + .lower_positive + .into_iter() + .find(is_inspect_grant) + .expect("parent card does not grant card inspection") +} + +fn derive_scope_card() -> golem_rust::schema::wit::wire::PermissionCard { + let parent = parent_card(); + let grant = retained_inspect_grant(&parent); + derive::derive_scope(&[&parent], &[grant], &[], &[], &[]).expect("scope-card derivation failed") +} + +fn derive_persistent_card(parent: &PermissionCard) -> PermissionCard { + let grant = retained_inspect_grant(parent); + derive::derive(parent, &[grant], &[], &[], &[], None) + .expect("persistent card derivation failed") +} + +fn derive_persistent_card_from_wallet() -> PermissionCard { + let parent = parent_card(); + let grant = retained_inspect_grant(&parent); + derive::derive_from_wallet(&[grant], &[], &[], &[], None) + .expect("wallet card derivation failed") +} + +fn card_id(card: &PermissionCard) -> CardId { + types::id(card).into() +} + +fn card_has_id(card: &PermissionCard, card_id: &CardId) -> bool { + &CardId::from(types::id(card)) == card_id +} + +fn agent_holder(component_id: ComponentId, agent_id: String) -> types::Holder { + types::Holder::Agent(WireAgentId { + component_id: component_id.into(), + agent_id, + }) +} + +fn scope_card_observation(scope_card_id: &CardId, root_card_id: &CardId) -> (bool, bool, bool) { + let card = wallet::self_wallet() + .into_iter() + .find(|card| card_has_id(card, scope_card_id)); + let Some(card) = card else { + return (false, false, false); + }; - fn install_card_by_id(&self, high_bits: u64, low_bits: u64) -> bool; + let parent_matches = types::parents(&card) + .iter() + .any(|parent| &CardId::from(parent) == root_card_id); + let inspect_matches = inspect::inspect_card(&card) + .map(|view| { + view.lower_positive.len() == 1 + && is_inspect_grant(&view.lower_positive[0]) + && view.lower_negative.is_empty() + && view.upper_positive.is_empty() + && view.upper_negative.is_empty() + }) + .unwrap_or(false); + (true, parent_matches, inspect_matches) +} + +fn scope_card_rpc(target: String) -> WasmRpc { + WasmRpc::new( + "ScopeCardAgent", + encode_parameters(vec![target.to_value()]), + None, + Vec::new(), + ) +} - fn derive_card_by_id(&self, high_bits: u64, low_bits: u64) -> bool; +fn decode_scope_observation( + value: golem_rust::schema::wit::wire::SchemaValueTree, +) -> (bool, bool, bool) { + let value = decode_schema_value(value).expect("failed to decode scope-card observation"); + <(bool, bool, bool) as FromSchema>::from_value(&value).expect("invalid scope-card observation") } -pub struct SnapshotCardRecoveryAgentImpl; +#[agent_definition] +pub trait ScopeCardAgent { + fn new(name: String) -> Self; + + async fn invoke_and_await_scope(&self, target: String) -> (bool, bool, bool, CardId); + + async fn async_invoke_and_await_scope(&self, target: String) -> (bool, bool, bool, CardId); + + async fn invoke_scope_after_promise( + &self, + target: String, + release: PromiseId, + ) -> (bool, bool, CardId); + + fn invoke_scope_is_denied(&self, target: String) -> bool; + + fn persistent_scope_is_denied(&self, target: String) -> bool; + + fn schedule_scope(&self, target: String); + + fn schedule_cancelable_scope(&self, target: String); + + fn inspect_scope(&self, scope_card_id: CardId, root_card_id: CardId) -> (bool, bool, bool); + + fn create_release_promise(&self) -> PromiseId; + + async fn inspect_scope_after_promise( + &self, + scope_card_id: CardId, + root_card_id: CardId, + release: PromiseId, + ) -> (bool, bool); + + fn derive_and_install_chain( + &self, + component_id: ComponentId, + caller_agent_id: String, + target_agent_id: String, + ) -> (CardId, CardId); + + async fn derive_and_install_after_promise( + &self, + component_id: ComponentId, + target_agent_id: String, + release: PromiseId, + ) -> CardId; + + fn revoke_card_by_id(&self, card_id: CardId) -> u32; + + fn has_card(&self, card_id: CardId) -> bool; +} + +pub struct ScopeCardAgentImpl { + _name: String, +} #[agent_implementation] -impl SnapshotCardRecoveryAgent for SnapshotCardRecoveryAgentImpl { - fn new() -> Self { - Self +impl ScopeCardAgent for ScopeCardAgentImpl { + fn new(name: String) -> Self { + Self { _name: name } + } + + async fn invoke_and_await_scope(&self, target: String) -> (bool, bool, bool, CardId) { + let scope_card = derive_scope_card(); + let scope_card_id = card_id(&scope_card); + let root_card_id = CardId::from( + types::parents(&scope_card) + .into_iter() + .next() + .expect("scope card has no root"), + ); + let invocation = scope_card_rpc(target) + .invoke_and_await( + "inspect_scope", + encode_parameters(vec![scope_card_id.to_value(), root_card_id.to_value()]), + Some(&scope_card), + ) + .expect("scope-card invoke-and-await failed"); + let (present, parent_matches, inspect_matches) = decode_scope_observation( + invocation + .result + .expect("scope-card observation result is missing"), + ); + (present, parent_matches, inspect_matches, scope_card_id) + } + + async fn async_invoke_and_await_scope(&self, target: String) -> (bool, bool, bool, CardId) { + let scope_card = derive_scope_card(); + let scope_card_id = card_id(&scope_card); + let root_card_id = CardId::from( + types::parents(&scope_card) + .into_iter() + .next() + .expect("scope card has no root"), + ); + let invocation = scope_card_rpc(target).async_invoke_and_await( + "inspect_scope", + encode_parameters(vec![scope_card_id.to_value(), root_card_id.to_value()]), + Some(&scope_card), + ); + loop { + let pollable = invocation.future.subscribe(); + golem_rust::agentic::await_pollable(pollable).await; + if let Some(result) = invocation.future.get() { + let value = decode_schema_value( + result + .expect("scope-card async invocation failed") + .expect("scope-card async observation result is missing"), + ) + .expect("failed to decode async scope-card observation"); + let (present, parent_matches, inspect_matches) = + <(bool, bool, bool) as FromSchema>::from_value(&value) + .expect("invalid async scope-card observation"); + break (present, parent_matches, inspect_matches, scope_card_id); + } + } + } + + async fn invoke_scope_after_promise( + &self, + target: String, + release: PromiseId, + ) -> (bool, bool, CardId) { + let scope_card = derive_scope_card(); + let scope_card_id = card_id(&scope_card); + let root_card_id = CardId::from( + types::parents(&scope_card) + .into_iter() + .next() + .expect("scope card has no root"), + ); + let invocation = scope_card_rpc(target) + .invoke_and_await( + "inspect_scope_after_promise", + encode_parameters(vec![ + scope_card_id.to_value(), + root_card_id.to_value(), + release.to_value(), + ]), + Some(&scope_card), + ) + .expect("replay scope-card invocation failed"); + let value = decode_schema_value( + invocation + .result + .expect("replay observation result is missing"), + ) + .expect("failed to decode replay observation"); + let (before, after) = + <(bool, bool) as FromSchema>::from_value(&value).expect("invalid replay observation"); + (before, after, scope_card_id) } - fn install_card_by_id(&self, high_bits: u64, low_bits: u64) -> bool { - install_card(Card { - card_id: CardId { - uuid: Uuid::from_u64_pair(high_bits, low_bits), + fn invoke_scope_is_denied(&self, target: String) -> bool { + let scope_card = derive_scope_card(); + matches!( + scope_card_rpc(target).invoke( + "inspect_scope", + encode_parameters(vec![]), + Some(&scope_card), + ), + Err(RpcError::Denied(_)) + ) + } + + fn persistent_scope_is_denied(&self, target: String) -> bool { + let parent = parent_card(); + matches!( + scope_card_rpc(target).invoke_and_await( + "inspect_scope", + encode_parameters(vec![]), + Some(&parent), + ), + Err(RpcError::Denied(_)) + ) + } + + fn schedule_scope(&self, target: String) { + let scope_card = derive_scope_card(); + scope_card_rpc(target).schedule_invocation( + Datetime { + seconds: 0, + nanoseconds: 0, }, - }) - .is_ok() + "inspect_scope", + encode_parameters(vec![]), + Some(&scope_card), + ); } - fn derive_card_by_id(&self, high_bits: u64, low_bits: u64) -> bool { - derive_card(Card { - card_id: CardId { - uuid: Uuid::from_u64_pair(high_bits, low_bits), + fn schedule_cancelable_scope(&self, target: String) { + let scope_card = derive_scope_card(); + scope_card_rpc(target).schedule_cancelable_invocation( + Datetime { + seconds: 0, + nanoseconds: 0, }, - }) - .is_ok() + "inspect_scope", + encode_parameters(vec![]), + Some(&scope_card), + ); + } + + fn inspect_scope(&self, scope_card_id: CardId, root_card_id: CardId) -> (bool, bool, bool) { + scope_card_observation(&scope_card_id, &root_card_id) + } + + fn create_release_promise(&self) -> PromiseId { + create_promise() + } + + async fn inspect_scope_after_promise( + &self, + scope_card_id: CardId, + root_card_id: CardId, + release: PromiseId, + ) -> (bool, bool) { + let before = scope_card_observation(&scope_card_id, &root_card_id).0; + await_promise(&release).await; + let after = scope_card_observation(&scope_card_id, &root_card_id).0; + (before, after) + } + + fn derive_and_install_chain( + &self, + component_id: ComponentId, + caller_agent_id: String, + target_agent_id: String, + ) -> (CardId, CardId) { + let parent = derive_persistent_card_from_wallet(); + let child = derive_persistent_card(&parent); + let parent_id = card_id(&parent); + let child_id = card_id(&child); + wallet::install_card(child, &agent_holder(component_id.clone(), target_agent_id)) + .expect("failed to install derived card"); + wallet::install_card(parent, &agent_holder(component_id, caller_agent_id)) + .expect("failed to install parent card"); + (parent_id, child_id) + } + + async fn derive_and_install_after_promise( + &self, + component_id: ComponentId, + target_agent_id: String, + release: PromiseId, + ) -> CardId { + let card = derive_persistent_card_from_wallet(); + let id = card_id(&card); + await_promise(&release).await; + wallet::install_card(card, &agent_holder(component_id, target_agent_id)) + .expect("failed to install replayed card"); + id } - async fn save_snapshot(&self) -> Result, String> { - Ok(Vec::new()) + fn revoke_card_by_id(&self, card_id: CardId) -> u32 { + let card = wallet::self_wallet() + .into_iter() + .find(|card| card_has_id(card, &card_id)) + .expect("card to revoke is not installed"); + revoke::revoke_card(card).expect("card revocation failed") } - async fn load_snapshot(&mut self, _bytes: Vec) -> Result<(), String> { - Ok(()) + fn has_card(&self, card_id: CardId) -> bool { + wallet::self_wallet() + .into_iter() + .any(|card| card_has_id(&card, &card_id)) } } diff --git a/test-components/http-tests/Cargo.lock b/test-components/http-tests/Cargo.lock index 19d1bef149..dbc1c6243b 100644 --- a/test-components/http-tests/Cargo.lock +++ b/test-components/http-tests/Cargo.lock @@ -34,7 +34,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -92,9 +92,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -195,13 +195,13 @@ checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -221,9 +221,9 @@ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -522,9 +522,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -1036,7 +1036,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1110,9 +1110,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -1147,7 +1147,7 @@ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1213,9 +1213,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/test-components/initial-file-system/Cargo.lock b/test-components/initial-file-system/Cargo.lock index 3313275979..a595d4e0d3 100644 --- a/test-components/initial-file-system/Cargo.lock +++ b/test-components/initial-file-system/Cargo.lock @@ -34,7 +34,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -92,9 +92,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -189,13 +189,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -215,9 +215,9 @@ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -448,9 +448,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -883,7 +883,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -957,9 +957,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -994,7 +994,7 @@ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1030,9 +1030,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/test-components/oplog-processor/Cargo.lock b/test-components/oplog-processor/Cargo.lock index fef74b1353..290886e203 100644 --- a/test-components/oplog-processor/Cargo.lock +++ b/test-components/oplog-processor/Cargo.lock @@ -81,9 +81,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -162,20 +162,20 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -404,9 +404,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -839,7 +839,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -913,9 +913,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -950,7 +950,7 @@ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -986,9 +986,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/test-components/scalability/scalability-large-dynamic-memory/Cargo.lock b/test-components/scalability/scalability-large-dynamic-memory/Cargo.lock index 75b636c05e..15074557c2 100644 --- a/test-components/scalability/scalability-large-dynamic-memory/Cargo.lock +++ b/test-components/scalability/scalability-large-dynamic-memory/Cargo.lock @@ -34,7 +34,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -92,9 +92,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -189,13 +189,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -215,9 +215,9 @@ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -421,9 +421,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -853,7 +853,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -927,9 +927,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -964,7 +964,7 @@ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1000,9 +1000,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/test-components/scalability/scalability-large-initial-memory/Cargo.lock b/test-components/scalability/scalability-large-initial-memory/Cargo.lock index baa3642058..3c6dc4c582 100644 --- a/test-components/scalability/scalability-large-initial-memory/Cargo.lock +++ b/test-components/scalability/scalability-large-initial-memory/Cargo.lock @@ -34,7 +34,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -92,9 +92,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -189,13 +189,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -215,9 +215,9 @@ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" @@ -421,9 +421,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -853,7 +853,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -927,9 +927,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -964,7 +964,7 @@ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1000,9 +1000,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] diff --git a/wit/deps/golem-1.x/golem-host.wit b/wit/deps/golem-1.x/golem-host.wit index ac94d44384..296b14e498 100644 --- a/wit/deps/golem-1.x/golem-host.wit +++ b/wit/deps/golem-1.x/golem-host.wit @@ -3,7 +3,7 @@ package golem:api@1.5.0; /// The Golem host API provides low level access to Golem specific features such as promises and control over /// the durability and transactional guarantees the executor provides. interface host { - use golem:core/types@2.0.0.{component-id, card-id, uuid, agent-id, promise-id, oplog-index}; + use golem:core/types@2.0.0.{component-id, uuid, agent-id, promise-id, oplog-index}; /// Represents a Golem component's version type component-revision = u64; @@ -186,17 +186,6 @@ interface host { get: async func() -> list; } - /// Plain-data handle to a permission card visible to the guest. - record card { - card-id: card-id, - } - - enum card-install-error { - revoked, - not-found, - not-permitted, - } - /// Create a new promise create-promise: func() -> promise-id; @@ -257,15 +246,6 @@ interface host { /// to introduce idempotence. generate-idempotency-key: func() -> uuid; - /// Returns one permission card currently installed in this agent's wallet, if any. - self-card: func() -> option; - - /// Derives a card handle from an installed card. This minimal test-facing form keeps the card as plain data. - derive-card: func(card: card) -> result; - - /// Installs a card into this agent's own wallet. - install-card: func(card: card) -> result<_, card-install-error>; - /// Initiates an update attempt for the given agent. The function returns immediately once the request has been processed, /// not waiting for the agent to get updated. update-agent: func(agent-id: agent-id, target-revision: component-revision, mode: update-mode); diff --git a/wit/deps/golem-agent/host.wit b/wit/deps/golem-agent/host.wit index 345fa12b02..b10c052e8b 100644 --- a/wit/deps/golem-agent/host.wit +++ b/wit/deps/golem-agent/host.wit @@ -1,7 +1,7 @@ package golem:agent@2.0.0; interface host { - use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value}; + use golem:core/types@2.0.0.{component-id, uuid, promise-id, schema-graph, schema-value-tree, typed-schema-value, permission-card}; use wasi:clocks/system-clock@0.3.0.{instant as datetime}; use common.{agent-error, agent-type, registered-agent-type, typed-agent-config-value}; @@ -90,25 +90,25 @@ interface host { /// /// `input` encodes the method's parameter list. The returned result is /// `none` for a `unit` output and `some(value)` for a `single` output. - invoke-and-await: func(method-name: string, input: schema-value-tree) -> result; + invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Triggers the invocation of a remote method with the given parameters, /// and returns its final identity immediately. - invoke: func(method-name: string, input: schema-value-tree) -> result; + invoke: func(method-name: string, input: schema-value-tree, scope-card: option>) -> result; /// Invokes a remote method with the given parameters, and returns a `future-invoke-result` value which can /// be polled for the result together with the final invocation identity. /// /// With this function it is possible to call multiple (different) agents simultaneously. - async-invoke-and-await: func(method-name: string, input: schema-value-tree) -> async-invocation-with-metadata; + async-invoke-and-await: func(method-name: string, input: schema-value-tree, scope-card: option>) -> async-invocation-with-metadata; /// Schedules an invocation for later and returns its final identity. - schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> scheduled-invocation-receipt; + schedule-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> scheduled-invocation-receipt; /// Schedules an invocation for later and returns its final identity and /// cancellation capability. Call cancel on the returned resource to /// cancel the invocation before the scheduled time. - schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree) -> cancelable-scheduled-invocation-receipt; + schedule-cancelable-invocation: func(scheduled-time: datetime, method-name: string, input: schema-value-tree, scope-card: option>) -> cancelable-scheduled-invocation-receipt; } /// Represents an asynchronous invocation result diff --git a/wit/deps/golem-core-v2/golem-core-v2.wit b/wit/deps/golem-core-v2/golem-core-v2.wit index bb7dda191e..a59e6e4ede 100644 --- a/wit/deps/golem-core-v2/golem-core-v2.wit +++ b/wit/deps/golem-core-v2/golem-core-v2.wit @@ -125,6 +125,17 @@ interface types { /// and reveal it only through capability-gated host interfaces. resource secret; + /// An unforgeable handle to a permission card held by the runtime. The + /// handle is opaque to guests: components can hold, pass, derive, install, + /// and revoke cards only through the `golem:permissions` interfaces. When + /// carried in a `schema-value-tree` (see + /// `schema-value-node::permission-card-handle`) the handle is transferred + /// by ownership; the host converts it to/from its internal trusted + /// card-store representation at the boundary. The wire form is the card-id + /// (UUID) alone — no grants, parents, or metadata cross the wire as + /// authority. + resource permission-card; + // ============================================================ // Schema graph (self-contained type carrier) // ============================================================ @@ -266,6 +277,7 @@ interface types { // --- Capability nodes --- secret-type(secret-spec), quota-token-type(quota-token-spec), + permission-card-type(permission-card-spec), // --- WASI P3 stubs (parseable only; no semantics yet) --- future-type(option), @@ -462,6 +474,13 @@ interface types { resource-name: option, } + record permission-card-spec { + /// `true` = polymorphic (carries slot variables in owner / resource-id), + /// `false` = monomorphic. Structural metadata only; authority lives in + /// the card store, not in the schema spec. + polymorphic: bool, + } + // ============================================================ // Schema value (always paired with a schema-graph) // ============================================================ @@ -524,6 +543,7 @@ interface types { // Capability nodes secret-value(own), quota-token-handle(own), + permission-card-handle(own), // WASI P3 stubs (parseable only in the schema; no constructible values). } diff --git a/wit/deps/golem-permissions/derive.wit b/wit/deps/golem-permissions/derive.wit new file mode 100644 index 0000000000..a1cd9f06b6 --- /dev/null +++ b/wit/deps/golem-permissions/derive.wit @@ -0,0 +1,42 @@ +package golem:permissions@0.1.0; + +/// Derivation of new permission cards from an existing card or from the +/// caller's wallet. +/// +/// Derivation narrows authority: a child card's lattice is bounded by its +/// parent's lattice. The caller specifies which lower-positive and +/// upper-positive grants to retain and which lower-negative and +/// upper-negative grants to add, plus an optional lifespan. +interface derive { + use golem:core/types@2.0.0.{permission-card}; + use types.{pattern-grant, permission-error, duration}; + + /// Derive a child card from `parent`, narrowing the grant lattice. + derive: func( + parent: borrow, + lower-positive-to-retain: list, + lower-negative-to-add: list, + upper-positive-to-retain: list, + upper-negative-to-add: list, + lifespan: option, + ) -> result; + + /// Derive a card directly from the caller's wallet. + derive-from-wallet: func( + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + lifespan: option, + ) -> result; + + /// Derive an invocation-local card from one or more persistent or scope + /// parents. Scope cards are attenuated in-memory and are never persisted. + derive-scope: func( + parents: list>, + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + ) -> result; +} diff --git a/wit/deps/golem-permissions/inspect.wit b/wit/deps/golem-permissions/inspect.wit new file mode 100644 index 0000000000..34481974fd --- /dev/null +++ b/wit/deps/golem-permissions/inspect.wit @@ -0,0 +1,14 @@ +package golem:permissions@0.1.0; + +/// Read-only inspection of a permission card's full grant lattice. +/// +/// Returns the four quadrants of the card's bound lattice +/// (lower/upper × positive/negative) as a `card-view`. Importing this +/// interface grants no authority to mutate or derive cards. +interface inspect { + use golem:core/types@2.0.0.{permission-card}; + use types.{card-view, permission-error}; + + /// Return the card's complete grant lattice. + inspect-card: func(c: borrow) -> result; +} diff --git a/wit/deps/golem-permissions/kernel-introspection.wit b/wit/deps/golem-permissions/kernel-introspection.wit new file mode 100644 index 0000000000..d555454b01 --- /dev/null +++ b/wit/deps/golem-permissions/kernel-introspection.wit @@ -0,0 +1,20 @@ +package golem:permissions@0.1.0; + +/// Introspection of the permission kernel's registered resource classes and +/// verbs, and validation of individual grants against the kernel's schema. +interface kernel-introspection { + use types.{pattern-grant, permission-error}; + + record kernel-module { + class-name: string, + verbs: list, + } + + /// List every resource class the kernel knows about, with their + /// permitted verbs. + list-modules: func() -> list; + + /// Validate that `g` references a known class, owner, recipient, verb, + /// and resource-id pattern accepted by the kernel. + validate-grant: func(g: pattern-grant) -> result<_, permission-error>; +} diff --git a/wit/deps/golem-permissions/revoke.wit b/wit/deps/golem-permissions/revoke.wit new file mode 100644 index 0000000000..da2fb7975a --- /dev/null +++ b/wit/deps/golem-permissions/revoke.wit @@ -0,0 +1,15 @@ +package golem:permissions@0.1.0; + +/// Revocation of a permission card and its derivation DAG subtree. +/// +/// `revoke-card` consumes the owned handle (the receiving component's +/// resource-table entry is deleted); the stored card is walked via the card +/// store's DAG descendant index. Returns the cut-subtree size. +interface revoke { + use golem:core/types@2.0.0.{permission-card}; + use types.{permission-error}; + + /// Revoke `c` and every card transitively derived from it. + /// Consumes the owned handle. + revoke-card: func(c: permission-card) -> result; +} diff --git a/wit/deps/golem-permissions/types.wit b/wit/deps/golem-permissions/types.wit new file mode 100644 index 0000000000..2fb749ed60 --- /dev/null +++ b/wit/deps/golem-permissions/types.wit @@ -0,0 +1,82 @@ +package golem:permissions@0.1.0; + +/// The permission-card resource's shared data model and inspection operations. +/// +/// The `permission-card` capability itself is defined as a bare resource in +/// `golem:core/types` so that it can travel inside a `schema-value-tree` as an +/// opaque, unforgeable handle. This interface exposes only safe inspection +/// operations over that handle plus the records and variants the other +/// permissions interfaces reference. Components that only need to *hold and +/// pass* cards — most tools and middleware — import only this interface. +interface types { + use golem:core/types@2.0.0.{permission-card, card-id, agent-id, uuid}; + + record timestamp { + seconds: s64, + nanoseconds: u32, + } + + /// ISO-8601 duration string (e.g. `"P30D"` for 30 days). + record duration { + iso-8601: string, + } + + variant holder { + account(uuid), + app(uuid), + agent(agent-id), + } + + record pattern-grant { + class: string, + owner: string, + recipient: string, + verb: string, + resource-id: string, + } + + record card-view { + lower-positive: list, + lower-negative: list, + upper-positive: list, + upper-negative: list, + } + + record wallet-version-token { + /// 32 bytes — BLAKE3 of (holder-kind, holder-id). + wallet-id-hash: list, + generation: u64, + } + + variant permission-error { + not-permitted(string), + lower-bound-too-broad(string), + upper-bound-too-broad(string), + wallet-multi-source-required(string), + card-revoked(string), + card-expired(string), + install-recipient-mismatch(string), + card-polymorphic-not-usable(string), + unknown-resource-class(string), + invalid-pattern(string), + invalid-verb(string), + invalid-owner(string), + invalid-recipient(string), + } + + // --- Card inspection --- + // Free functions on a borrowed handle, because the resource itself is + // bare in core (matching secret/quota-token). + + /// Stable identifier of this card. + id: func(c: borrow) -> card-id; + + /// Parent card identifiers in the derivation DAG. + parents: func(c: borrow) -> list; + + /// Expiry timestamp, if the card has a bounded lifespan. + expires-at: func(c: borrow) -> option; + + /// `true` if the card is polymorphic (carries slot variables). + is-polymorphic: func(c: borrow) -> bool; +} diff --git a/wit/deps/golem-permissions/wallet.wit b/wit/deps/golem-permissions/wallet.wit new file mode 100644 index 0000000000..818d8b1538 --- /dev/null +++ b/wit/deps/golem-permissions/wallet.wit @@ -0,0 +1,23 @@ +package golem:permissions@0.1.0; + +/// Wallet operations: enumerate the caller's installed cards, query the +/// wallet's version token, and install a card onto a target holder. +interface wallet { + use golem:core/types@2.0.0.{permission-card}; + use types.{permission-error, wallet-version-token, holder}; + + /// All permission cards currently installed in the caller's wallet. + self-wallet: func() -> list; + + /// Version token for the caller's wallet, changed whenever the set of + /// installed cards changes. + self-version: func() -> wallet-version-token; + + /// Install `card` onto `target`. Returns unit on success. + /// + /// Only agent targets are currently supported. Account and application + /// targets return `not-permitted("install-card currently supports only + /// agent targets")` before any wallet or oplog mutation. + install-card: func(card: permission-card, target: holder) + -> result<_, permission-error>; +} diff --git a/wit/host.wit b/wit/host.wit index b0a00f3793..02e3d6d1a1 100644 --- a/wit/host.wit +++ b/wit/host.wit @@ -25,6 +25,12 @@ world golem { import golem:quota/types@1.5.0; import golem:secrets/types@0.1.0; import golem:secrets/reveal@0.1.0; + import golem:permissions/types@0.1.0; + import golem:permissions/inspect@0.1.0; + import golem:permissions/derive@0.1.0; + import golem:permissions/revoke@0.1.0; + import golem:permissions/wallet@0.1.0; + import golem:permissions/kernel-introspection@0.1.0; import golem:tool/host@0.1.0; // Agent guest-export interfaces the executor invokes through bindgen-typed